summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRabin Vincent <rabin@rab.in>2010-05-02 15:20:52 +0530
committerAurelien Jarno <aurelien@aurel32.net>2010-05-27 15:52:57 +0200
commit0c459361a1117a6c434c7b2b008a4c6c035eb4bf (patch)
tree125925f4845e4f65e9357cd415f1a2287347ab2a
parentarm_timer: reload timer when enabled (diff)
downloadqemu-kvm-0c459361a1117a6c434c7b2b008a4c6c035eb4bf.tar.gz
qemu-kvm-0c459361a1117a6c434c7b2b008a4c6c035eb4bf.tar.bz2
qemu-kvm-0c459361a1117a6c434c7b2b008a4c6c035eb4bf.zip
arm_timer: fix oneshot mode
In oneshot mode, the delta needs to come from the TimerLoad register, not the maximum limit. Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit a9cf98d939c4f6539fad7e7d812ea16d96ba3dc9)
-rw-r--r--hw/arm_timer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/arm_timer.c b/hw/arm_timer.c
index 5b6947a16..9073ffc00 100644
--- a/hw/arm_timer.c
+++ b/hw/arm_timer.c
@@ -71,7 +71,7 @@ static void arm_timer_recalibrate(arm_timer_state *s, int reload)
{
uint32_t limit;
- if ((s->control & TIMER_CTRL_PERIODIC) == 0) {
+ if ((s->control & (TIMER_CTRL_PERIODIC | TIMER_CTRL_ONESHOT)) == 0) {
/* Free running. */
if (s->control & TIMER_CTRL_32BIT)
limit = 0xffffffff;