ptimer: Rename PTIMER_POLICY_DEFAULT to PTIMER_POLICY_LEGACY
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 16 May 2022 10:30:58 +0000 (11:30 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 19 May 2022 15:19:03 +0000 (16:19 +0100)
commit9598c1bb39b2d4f0d3a55072cc70251c452132cd
tree25191a8ae0b092e021395c442830ae7e2599e72d
parentafdcbddcc92ef75ed1905e6ae7aa00db06e86dfc
ptimer: Rename PTIMER_POLICY_DEFAULT to PTIMER_POLICY_LEGACY

The traditional ptimer behaviour includes a collection of weird edge
case behaviours.  In 2016 we improved the ptimer implementation to
fix these and generally make the behaviour more flexible, with
ptimers opting in to the new behaviour by passing an appropriate set
of policy flags to ptimer_init().  For backwards-compatibility, we
defined PTIMER_POLICY_DEFAULT (which sets no flags) to give the old
weird behaviour.

This turns out to be a poor choice of name, because people writing
new devices which use ptimers are misled into thinking that the
default is probably a sensible choice of flags, when in fact it is
almost always not what you want.  Rename PTIMER_POLICY_DEFAULT to
PTIMER_POLICY_LEGACY and beef up the comment to more clearly say that
new devices should not be using it.

The code-change part of this commit was produced by
  sed -i -e 's/PTIMER_POLICY_DEFAULT/PTIMER_POLICY_LEGACY/g' $(git grep -l PTIMER_POLICY_DEFAULT)
with the exception of a test name string change in
tests/unit/ptimer-test.c which was added manually.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Francisco Iglesias <francisco.iglesias@amd.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220516103058.162280-1-peter.maydell@linaro.org
25 files changed:
hw/arm/musicpal.c
hw/dma/xilinx_axidma.c
hw/dma/xlnx_csu_dma.c
hw/m68k/mcf5206.c
hw/m68k/mcf5208.c
hw/net/can/xlnx-zynqmp-can.c
hw/net/fsl_etsec/etsec.c
hw/net/lan9118.c
hw/rtc/exynos4210_rtc.c
hw/timer/allwinner-a10-pit.c
hw/timer/altera_timer.c
hw/timer/arm_timer.c
hw/timer/digic-timer.c
hw/timer/etraxfs_timer.c
hw/timer/exynos4210_mct.c
hw/timer/exynos4210_pwm.c
hw/timer/grlib_gptimer.c
hw/timer/imx_epit.c
hw/timer/imx_gpt.c
hw/timer/mss-timer.c
hw/timer/sh_timer.c
hw/timer/slavio_timer.c
hw/timer/xilinx_timer.c
include/hw/ptimer.h
tests/unit/ptimer-test.c