aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2016-10-24 16:26:51 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-10-24 16:26:51 +0100
commit22471b8a0f1262192fb3698bd2ea1080d9176e6a (patch)
treeecde2662e9b8c848b665941b7bac900acff3baf2 /include
parent2e74583b29fff8e0e543898a9c61508a213ad83e (diff)
hw/ptimer: Add "no immediate trigger" policy
Performing trigger on setting (or starting to run with) counter = 0 could be a wrong behaviour for some of the timers, provide "no immediate trigger" policy to maintain correct behaviour for such timers. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Message-id: 72c0319cf2ec599f22397b7da280c06c34dc40dd.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 b2fb4f9864..911cc11bac 100644
--- a/include/hw/ptimer.h
+++ b/include/hw/ptimer.h
@@ -43,6 +43,10 @@
* re-trigger every period. */
#define PTIMER_POLICY_CONTINUOUS_TRIGGER (1 << 1)
+/* Starting to run with/setting counter to "0" won't trigger immediately,
+ * but after a one period for both oneshot and periodic modes. */
+#define PTIMER_POLICY_NO_IMMEDIATE_TRIGGER (1 << 2)
+
/* ptimer.c */
typedef struct ptimer_state ptimer_state;
typedef void (*ptimer_cb)(void *opaque);