summaryrefslogtreecommitdiff
path: root/hw/hpet.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-06-13 14:15:37 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-06-13 15:32:59 +0300
commit7afbecc9efa64a88ab6194c2cf1d6feabd03d119 (patch)
tree383a5803f97cd298599c07683380e4e2621df8d2 /hw/hpet.c
parentad0a655161a487007742b65d0b1b55aea8051cea (diff)
hpet: Move static timer field initialization
Properly initialize HPETTimer::tn and HPETTimer::state once during hpet_init instead of (re-)writing them on every reset. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/hpet.c')
-rw-r--r--hw/hpet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/hpet.c b/hw/hpet.c
index bcb160b91..fd7a1fd87 100644
--- a/hw/hpet.c
+++ b/hw/hpet.c
@@ -575,12 +575,10 @@ static void hpet_reset(void *opaque)
HPETTimer *timer = &s->timer[i];
hpet_del_timer(timer);
- timer->tn = i;
timer->cmp = ~0ULL;
timer->config = HPET_TN_PERIODIC_CAP | HPET_TN_SIZE_CAP;
/* advertise availability of ioapic inti2 */
timer->config |= 0x00000004ULL << 32;
- timer->state = s;
timer->period = 0ULL;
timer->wrap_flag = 0;
}
@@ -617,6 +615,8 @@ void hpet_init(qemu_irq *irq)
for (i = 0; i < HPET_NUM_TIMERS; i++) {
timer = &s->timer[i];
timer->qemu_timer = qemu_new_timer(vm_clock, hpet_timer, timer);
+ timer->tn = i;
+ timer->state = s;
}
vmstate_register(-1, &vmstate_hpet, s);
qemu_register_reset(hpet_reset, s);