hw/ptimer: Add "wraparound after one period" policy
commit2b5c0322b7d9d2032578bd1efccf72f4ab1b7074
authorDmitry Osipenko <digetx@gmail.com>
Mon, 24 Oct 2016 15:26:50 +0000 (24 16:26 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 24 Oct 2016 15:26:50 +0000 (24 16:26 +0100)
tree742da49d300521b572555c8b23cf6aed81f8a63d
parenta2519ad1828dd443af9f9c293db18db6d6123762
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>
hw/core/ptimer.c
include/hw/ptimer.h