mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
hw/clock: Let clock_set() return boolean value
Let clock_set() return a boolean value whether the clock has been updated or not. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20200806123858.30058-3-f4bug@amsat.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
bb80ae077e
commit
15aa2876d9
2 changed files with 13 additions and 6 deletions
|
@ -34,11 +34,16 @@ void clock_clear_callback(Clock *clk)
|
|||
clock_set_callback(clk, NULL, NULL);
|
||||
}
|
||||
|
||||
void clock_set(Clock *clk, uint64_t period)
|
||||
bool clock_set(Clock *clk, uint64_t period)
|
||||
{
|
||||
if (clk->period == period) {
|
||||
return false;
|
||||
}
|
||||
trace_clock_set(CLOCK_PATH(clk), CLOCK_PERIOD_TO_NS(clk->period),
|
||||
CLOCK_PERIOD_TO_NS(period));
|
||||
clk->period = period;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void clock_propagate_period(Clock *clk, bool call_callbacks)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue