aboutsummaryrefslogtreecommitdiff
path: root/hw/pc.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2011-02-05 14:35:00 +0000
committerBlue Swirl <blauwirbel@gmail.com>2011-02-12 09:45:06 +0000
commitdd703b991cce99271a032a975885dd37d8c07a94 (patch)
tree8dbb91856eb6ba1ffc18e5372320c0fb58ca351f /hw/pc.c
parent4912371fc39120fb7eb1a6b3f270fab30d05a7b6 (diff)
downloadqemu-dd703b991cce99271a032a975885dd37d8c07a94.zip
qemu-dd703b991cce99271a032a975885dd37d8c07a94.tar.gz
qemu-dd703b991cce99271a032a975885dd37d8c07a94.tar.bz2
hpet: make optional
Ignore failure with hpet device creation. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 00fe04e..56bf1d6 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -84,6 +84,7 @@ struct e820_table {
} __attribute((__packed__, __aligned__(4)));
static struct e820_table e820_table;
+struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
void isa_irq_handler(void *opaque, int n, int level)
{
@@ -1104,12 +1105,14 @@ void pc_basic_device_init(qemu_irq *isa_irq,
register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);
if (!no_hpet) {
- DeviceState *hpet = sysbus_create_simple("hpet", HPET_BASE, NULL);
+ DeviceState *hpet = sysbus_try_create_simple("hpet", HPET_BASE, NULL);
- for (i = 0; i < 24; i++) {
- sysbus_connect_irq(sysbus_from_qdev(hpet), i, isa_irq[i]);
+ if (hpet) {
+ for (i = 0; i < 24; i++) {
+ sysbus_connect_irq(sysbus_from_qdev(hpet), i, isa_irq[i]);
+ }
+ rtc_irq = qdev_get_gpio_in(hpet, 0);
}
- rtc_irq = qdev_get_gpio_in(hpet, 0);
}
*rtc_state = rtc_init(2000, rtc_irq);