aboutsummaryrefslogtreecommitdiff
path: root/hw/pl031.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-09-10 03:04:26 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-11 10:19:52 -0500
commit6ee093c90761eabfc6255624000d3d8248802209 (patch)
treef550274a05a1cd7a379f3e4d1cb7789fb2e64b8c /hw/pl031.c
parentb03b2e48cb322cb695ff7a6666b25712140ea3c9 (diff)
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pl031.c')
-rw-r--r--hw/pl031.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/pl031.c b/hw/pl031.c
index 19577dde35..45b7032c50 100644
--- a/hw/pl031.c
+++ b/hw/pl031.c
@@ -67,7 +67,7 @@ static uint32_t pl031_get_count(pl031_state *s)
{
/* This assumes qemu_get_clock returns the time since the machine was
created. */
- return s->tick_offset + qemu_get_clock(vm_clock) / ticks_per_sec;
+ return s->tick_offset + qemu_get_clock(vm_clock) / get_ticks_per_sec();
}
static void pl031_set_alarm(pl031_state *s)
@@ -76,7 +76,7 @@ static void pl031_set_alarm(pl031_state *s)
uint32_t ticks;
now = qemu_get_clock(vm_clock);
- ticks = s->tick_offset + now / ticks_per_sec;
+ ticks = s->tick_offset + now / get_ticks_per_sec();
/* The timer wraps around. This subtraction also wraps in the same way,
and gives correct results when alarm < now_ticks. */
@@ -86,7 +86,7 @@ static void pl031_set_alarm(pl031_state *s)
qemu_del_timer(s->timer);
pl031_interrupt(s);
} else {
- qemu_mod_timer(s->timer, now + (int64_t)ticks * ticks_per_sec);
+ qemu_mod_timer(s->timer, now + (int64_t)ticks * get_ticks_per_sec());
}
}