diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2010-06-13 14:15:38 +0200 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-06-13 15:32:59 +0300 |
commit | 822557eb8ea4694d1a91b68cbf6152f5277f5599 (patch) | |
tree | ffd68a258bad7715747dc47b5409e6bbc6585683 /hw/pc.c | |
parent | 7afbecc9efa64a88ab6194c2cf1d6feabd03d119 (diff) |
hpet: Convert to qdev
Register the HPET as a sysbus device and create it that way. As it can
route its IRQs to any ISA IRQ, we need to connect it to all 24 of them.
Once converted to qdev, we can move reset handler and vmstate
registration into its hands as well.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r-- | hw/pc.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -35,6 +35,7 @@ #include "elf.h" #include "multiboot.h" #include "mc146818rtc.h" +#include "sysbus.h" /* output Bochs bios info messages */ //#define DEBUG_BIOS @@ -957,7 +958,11 @@ void pc_basic_device_init(qemu_irq *isa_irq, pit = pit_init(0x40, isa_reserve_irq(0)); pcspk_init(pit); if (!no_hpet) { - hpet_init(isa_irq); + DeviceState *hpet = sysbus_create_simple("hpet", HPET_BASE, NULL); + + for (i = 0; i < 24; i++) { + sysbus_connect_irq(sysbus_from_qdev(hpet), i, isa_irq[i]); + } } for(i = 0; i < MAX_SERIAL_PORTS; i++) { |