summaryrefslogtreecommitdiffstats
path: root/hw/acpi.c
diff options
context:
space:
mode:
authorJuan Quintela2009-09-10 03:04:26 +0200
committerAnthony Liguori2009-09-11 17:19:52 +0200
commit6ee093c90761eabfc6255624000d3d8248802209 (patch)
treef550274a05a1cd7a379f3e4d1cb7789fb2e64b8c /hw/acpi.c
parenttimers: remove useless check (diff)
downloadqemu-6ee093c90761eabfc6255624000d3d8248802209.tar.gz
qemu-6ee093c90761eabfc6255624000d3d8248802209.tar.xz
qemu-6ee093c90761eabfc6255624000d3d8248802209.zip
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/acpi.c')
-rw-r--r--hw/acpi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/acpi.c b/hw/acpi.c
index 6eddd0ec5d..ef4f782a2c 100644
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -79,7 +79,7 @@ static PIIX4PMState *pm_state;
static uint32_t get_pmtmr(PIIX4PMState *s)
{
uint32_t d;
- d = muldiv64(qemu_get_clock(vm_clock), PM_FREQ, ticks_per_sec);
+ d = muldiv64(qemu_get_clock(vm_clock), PM_FREQ, get_ticks_per_sec());
return d & 0xffffff;
}
@@ -88,7 +88,7 @@ static int get_pmsts(PIIX4PMState *s)
int64_t d;
int pmsts;
pmsts = s->pmsts;
- d = muldiv64(qemu_get_clock(vm_clock), PM_FREQ, ticks_per_sec);
+ d = muldiv64(qemu_get_clock(vm_clock), PM_FREQ, get_ticks_per_sec());
if (d >= s->tmr_overflow_time)
s->pmsts |= TMROF_EN;
return s->pmsts;
@@ -105,7 +105,7 @@ static void pm_update_sci(PIIX4PMState *s)
qemu_set_irq(s->irq, sci_level);
/* schedule a timer interruption if needed */
if ((s->pmen & TMROF_EN) && !(pmsts & TMROF_EN)) {
- expire_time = muldiv64(s->tmr_overflow_time, ticks_per_sec, PM_FREQ);
+ expire_time = muldiv64(s->tmr_overflow_time, get_ticks_per_sec(), PM_FREQ);
qemu_mod_timer(s->tmr_timer, expire_time);
} else {
qemu_del_timer(s->tmr_timer);
@@ -130,7 +130,8 @@ static void pm_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
pmsts = get_pmsts(s);
if (pmsts & val & TMROF_EN) {
/* if TMRSTS is reset, then compute the new overflow time */
- d = muldiv64(qemu_get_clock(vm_clock), PM_FREQ, ticks_per_sec);
+ d = muldiv64(qemu_get_clock(vm_clock), PM_FREQ,
+ get_ticks_per_sec());
s->tmr_overflow_time = (d + 0x800000LL) & ~0x7fffffLL;
}
s->pmsts &= ~val;