]> git.ipfire.org Git - thirdparty/qemu.git/commit - hw/net/lan9118.c
ptimer: Rename ptimer_init() to ptimer_init_with_bh()
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 8 Oct 2019 17:17:20 +0000 (18:17 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 15 Oct 2019 17:09:02 +0000 (18:09 +0100)
commitb01422622b7c7293196fdaf1dbb4f495af44ecf9
treeff3006230f811b3009b3d70ec3c93c118a790372
parentfff9f5558d0e0813d4f80bfe1602acf225eca4fd
ptimer: Rename ptimer_init() to ptimer_init_with_bh()

Currently the ptimer design uses a QEMU bottom-half as its
mechanism for calling back into the device model using the
ptimer when the timer has expired. Unfortunately this design
is fatally flawed, because it means that there is a lag
between the ptimer updating its own state and the device
callback function updating device state, and guest accesses
to device registers between the two can return inconsistent
device state.

We want to replace the bottom-half design with one where
the guest device's callback is called either immediately
(when the ptimer triggers by timeout) or when the device
model code closes a transaction-begin/end section (when the
ptimer triggers because the device model changed the
ptimer's count value or other state). As the first step,
rename ptimer_init() to ptimer_init_with_bh(), to free up
the ptimer_init() name for the new API. We can then convert
all the ptimer users away from ptimer_init_with_bh() before
removing it entirely.

(Commit created with
 git grep -l ptimer_init | xargs sed -i -e 's/ptimer_init/ptimer_init_with_bh/'
and three overlong lines folded by hand.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20191008171740.9679-2-peter.maydell@linaro.org
31 files changed:
hw/arm/musicpal.c
hw/core/ptimer.c
hw/dma/xilinx_axidma.c
hw/m68k/mcf5206.c
hw/m68k/mcf5208.c
hw/net/fsl_etsec/etsec.c
hw/net/lan9118.c
hw/timer/allwinner-a10-pit.c
hw/timer/altera_timer.c
hw/timer/arm_mptimer.c
hw/timer/arm_timer.c
hw/timer/cmsdk-apb-dualtimer.c
hw/timer/cmsdk-apb-timer.c
hw/timer/digic-timer.c
hw/timer/etraxfs_timer.c
hw/timer/exynos4210_mct.c
hw/timer/exynos4210_pwm.c
hw/timer/exynos4210_rtc.c
hw/timer/grlib_gptimer.c
hw/timer/imx_epit.c
hw/timer/imx_gpt.c
hw/timer/lm32_timer.c
hw/timer/milkymist-sysctl.c
hw/timer/mss-timer.c
hw/timer/puv3_ost.c
hw/timer/sh_timer.c
hw/timer/slavio_timer.c
hw/timer/xilinx_timer.c
hw/watchdog/cmsdk-apb-watchdog.c
include/hw/ptimer.h
tests/ptimer-test.c