From: Ian Jackson Date: Tue, 3 Jun 2008 13:44:09 +0000 (+0100) Subject: Compilation fixups for Xen piix4acpi (piix4_pm_init) X-Git-Tag: xen-3.3.0-rc1~113 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a50235153379d57354d8a22581ec831c8d06e935;p=qemu-xen-3.3-testing.git Compilation fixups for Xen piix4acpi (piix4_pm_init) Includes change to pc.c to cope with lack of i2c bus, which is not offered to HVM guests. --- diff --git a/hw/pc.c b/hw/pc.c index 05fd047b..cba5ae35 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -1081,8 +1081,11 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, /* TODO: Populate SPD eeprom data. */ smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]); - for (i = 0; i < 8; i++) { - smbus_eeprom_device_init(smbus, 0x50 + i, eeprom_buf + (i * 256)); + + if (smbus) { + for (i = 0; i < 8; i++) { + smbus_eeprom_device_init(smbus, 0x50 + i, eeprom_buf + (i * 256)); + } } } diff --git a/hw/piix4acpi.c b/hw/piix4acpi.c index 12a6afb0..a8b97fdf 100644 --- a/hw/piix4acpi.c +++ b/hw/piix4acpi.c @@ -1,4 +1,4 @@ -/* + /* * PIIX4 ACPI controller emulation * * Winston liwen Wang, winston.l.wang@intel.com @@ -47,8 +47,6 @@ #define PHP_EVT_ADD 0x0 #define PHP_EVT_REMOVE 0x3 -#define ACPI_SCI_IRQ 9 - /* The bit in GPE0_STS/EN to notify the pci hotplug event */ #define ACPI_PHP_GPE_BIT 3 @@ -82,6 +80,7 @@ typedef struct PHPSlots { } PHPSlots; PHPSlots php_slots; +static qemu_irq sci_irq; static void piix4acpi_save(QEMUFile *f, void *opaque) { @@ -330,7 +329,7 @@ static void gpe_sts_write(void *opaque, uint32_t addr, uint32_t val) hotplugged && !test_bit(&s->gpe0_sts[0], ACPI_PHP_GPE_BIT)) { fprintf(logfile, "Clear the GPE0_STS bit for ACPI hotplug & deassert the IRQ.\n"); - pic_set_irq(ACPI_SCI_IRQ, 0); + qemu_irq_lower(sci_irq); } } @@ -359,7 +358,7 @@ static void gpe_en_write(void *opaque, uint32_t addr, uint32_t val) !(val & (1 << (ACPI_PHP_GPE_BIT % 8))) ) { fprintf(logfile, "deassert due to disable GPE bit.\n"); s->sci_asserted = 0; - pic_set_irq(ACPI_SCI_IRQ, 0); + qemu_irq_lower(sci_irq); } } @@ -433,7 +432,7 @@ static void acpi_sci_intr(GPEState *s) set_bit(&s->gpe0_sts[0], ACPI_PHP_GPE_BIT); s->sci_asserted = 1; - pic_set_irq(ACPI_SCI_IRQ, 1); + qemu_irq_raise(sci_irq); fprintf(logfile, "generate a sci for PHP.\n"); } } @@ -501,11 +500,16 @@ void acpi_php_add(int pci_slot) #endif /* CONFIG_PASSTHROUGH */ /* PIIX4 acpi pci configuration space, func 2 */ -void *piix4_pm_init(PCIBus *bus, int devfn) +i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, + qemu_irq sci_irq_spec) { PCIAcpiState *d; uint8_t *pci_conf; + sci_irq = sci_irq_spec; + + /* we ignore smb_io_base as we don't give HVM guests an emulated smbus */ + /* register a function 2 of PIIX4 */ d = (PCIAcpiState *)pci_register_device( bus, "PIIX4 ACPI", sizeof(PCIAcpiState), @@ -546,4 +550,6 @@ void *piix4_pm_init(PCIBus *bus, int devfn) #endif register_savevm("piix4acpi", 0, 1, piix4acpi_save, piix4acpi_load, d); + + return NULL; }