summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDmitry Osipenko2016-10-24 17:26:50 +0200
committerPeter Maydell2016-10-24 17:26:50 +0200
commit2b5c0322b7d9d2032578bd1efccf72f4ab1b7074 (patch)
tree742da49d300521b572555c8b23cf6aed81f8a63d /include
parenthw/arm/virt: Set minimum_page_bits to 12 (diff)
downloadqemu-2b5c0322b7d9d2032578bd1efccf72f4ab1b7074.tar.gz
qemu-2b5c0322b7d9d2032578bd1efccf72f4ab1b7074.tar.xz
qemu-2b5c0322b7d9d2032578bd1efccf72f4ab1b7074.zip
hw/ptimer: Add "wraparound after one period" policy
Currently, periodic counter wraps around immediately once counter reaches "0", this is wrong behaviour for some of the timers, resulting in one period being lost. Add new ptimer policy that provides correct behaviour for such timers, so that counter stays with "0" for a one period before wrapping around. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Message-id: f22a670cf1f4be298b31640cb5f4be1df0f20ab6.1475421224.git.digetx@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/hw/ptimer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/hw/ptimer.h b/include/hw/ptimer.h
index 26c7fdcd75..03441cbc22 100644
--- a/include/hw/ptimer.h
+++ b/include/hw/ptimer.h
@@ -35,6 +35,10 @@
*/
#define PTIMER_POLICY_DEFAULT 0
+/* Periodic timer counter stays with "0" for a one period before wrapping
+ * around. */
+#define PTIMER_POLICY_WRAP_AFTER_ONE_PERIOD (1 << 0)
+
/* ptimer.c */
typedef struct ptimer_state ptimer_state;
typedef void (*ptimer_cb)(void *opaque);