mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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>
This commit is contained in:
parent
a2519ad182
commit
2b5c0322b7
2 changed files with 47 additions and 15 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue