mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
clock: Add ClockPreUpdate callback event type
Add a new callback event type ClockPreUpdate, which is called on period changes before the period is updated. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Luc Michel <luc@lmichel.fr> Reviewed-by: Hao Wu <wuhaotsh@google.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20210219144617.4782-3-peter.maydell@linaro.org
This commit is contained in:
parent
5ee0abed51
commit
e4341623a3
3 changed files with 12 additions and 1 deletions
|
@ -181,7 +181,14 @@ events.
|
|||
|
||||
The events currently supported are:
|
||||
|
||||
* ``ClockUpdate`` : called after the input clock's period has changed
|
||||
* ``ClockPreUpdate`` : called when the input clock's period is about to
|
||||
update. This is useful if the device needs to do some action for
|
||||
which it needs to know the old value of the clock period. During
|
||||
this callback, Clock API functions like ``clock_get()`` or
|
||||
``clock_ticks_to_ns()`` will use the old period.
|
||||
* ``ClockUpdate`` : called after the input clock's period has changed.
|
||||
During this callback, Clock API functions like ``clock_ticks_to_ns()``
|
||||
will use the new period.
|
||||
|
||||
Note that a clock only has one callback: it is not possible to register
|
||||
different functions for different events. You must register a single
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue