clock: Add ClockEvent parameter to callbacks
commit5ee0abed51231949ef91d7f8e1115be69ed91e93
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 19 Feb 2021 14:45:34 +0000 (19 14:45 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 8 Mar 2021 17:20:01 +0000 (8 17:20 +0000)
treeb2c5ff7c17430270d3b03213eb668dd207bd4665
parent0436c55edf6b357ff56e2a5bf688df8636f83456
clock: Add ClockEvent parameter to callbacks

The Clock framework allows users to specify a callback which is
called after the clock's period has been updated.  Some users need to
also have a callback which is called before the clock period is
updated.

As the first step in adding support for notifying Clock users on
pre-update events, add an argument to the ClockCallback to specify
what event is being notified, and add an argument to the various
functions for registering a callback to specify which events are
of interest to that callback.

Note that the documentation update renders correct the previously
incorrect claim in 'Adding a new clock' that callbacks "will be
explained in a following section".

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Luc Michel <luc@lmichel.fr>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210219144617.4782-2-peter.maydell@linaro.org
20 files changed:
docs/devel/clocks.rst
hw/adc/npcm7xx_adc.c
hw/arm/armsse.c
hw/char/cadence_uart.c
hw/char/ibex_uart.c
hw/char/pl011.c
hw/core/clock.c
hw/core/qdev-clock.c
hw/mips/cps.c
hw/misc/bcm2835_cprman.c
hw/misc/npcm7xx_clk.c
hw/misc/npcm7xx_pwm.c
hw/misc/zynq_slcr.c
hw/timer/cmsdk-apb-dualtimer.c
hw/timer/cmsdk-apb-timer.c
hw/timer/npcm7xx_timer.c
hw/watchdog/cmsdk-apb-watchdog.c
include/hw/clock.h
include/hw/qdev-clock.h
target/mips/cpu.c