diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2010-06-14 08:40:29 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-06-14 11:12:53 -0500 |
commit | 072c2c31c27204e8e1897c52e481d2ab0b4d075d (patch) | |
tree | 85d7d23b5c72619a4f2316a5dbb28c5c18360f64 /hw/hpet.c | |
parent | bd69fe8448024258d046e2a15d4cf5c498188144 (diff) |
hpet: Init capability register only once
The capability register is read-only from guest POV, so we do not need
to update it on reset.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/hpet.c')
-rw-r--r-- | hw/hpet.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -648,10 +648,6 @@ static void hpet_reset(DeviceState *d) s->hpet_counter = 0ULL; s->hpet_offset = 0ULL; - /* 64-bit main counter; LegacyReplacementRoute. */ - s->capability = 0x8086a001ULL; - s->capability |= (s->num_timers - 1) << HPET_ID_NUM_TIM_SHIFT; - s->capability |= ((HPET_CLK_PERIOD) << 32); s->config = 0ULL; if (count > 0) { /* we don't enable pit when hpet_reset is first called (by hpet_init) @@ -696,6 +692,11 @@ static int hpet_init(SysBusDevice *dev) timer->state = s; } + /* 64-bit main counter; LegacyReplacementRoute. */ + s->capability = 0x8086a001ULL; + s->capability |= (s->num_timers - 1) << HPET_ID_NUM_TIM_SHIFT; + s->capability |= ((HPET_CLK_PERIOD) << 32); + isa_reserve_irq(RTC_ISA_IRQ); qdev_init_gpio_in(&dev->qdev, hpet_handle_rtc_irq, 1); |