Skip to contentSkip to conversation

ioemu: fix acpi problems

PATCH New Christoph Egger 1 participant 1 message Sep 11, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ioemu: fix acpi problems

Hi!

Attached patch fixes ACPI problems with GPE
when ioemu build w/o CONFIG_PASSTHROUGH.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
hw/piix4acpi.c +7 -4
index 85b8ac3..599d00d 100644
@@ -233,8 +233,6 @@ static void acpi_map(PCIDevice *pci_dev, int region_num,
     battery_mgmt_init(pci_dev);
 }
 
-#ifdef CONFIG_PASSTHROUGH
-
 static inline int test_bit(uint8_t *map, int bit)
 {
     return ( map[bit / 8] & (1 << (bit % 8)) );
@@ -256,6 +254,8 @@ static void acpi_dbg_writel(void *opaque, uint32_t addr, uint32_t val)
     PIIX4ACPI_LOG(PIIX4ACPI_LOG_INFO, "ACPI:debug: write addr=0x%x, val=0x%x.\n", addr, val);
 }
 
+#ifdef CONFIG_PASSTHROUGH
+
 /*
  * simple PCI hotplug controller IO
  * ACPI_PHP_IO_ADDR + :
@@ -390,6 +390,7 @@ static void php_devfn_init(void)
     register_savevm("pci_devfn", 0, 1, pci_devfn_save, pci_devfn_load,
                     &php_devfn);
 }
+#endif /* CONFIG_PASSTHROUGH */
 
 /* GPEx_STS occupy 1st half of the block, while GPEx_EN 2nd half */
 static uint32_t gpe_sts_read(void *opaque, uint32_t addr)
@@ -509,6 +510,8 @@ static void gpe_acpi_init(void)
     register_savevm("gpe", 0, 1, gpe_save, gpe_load, s);
 }
 
+#ifdef CONFIG_PASSTHROUGH
+
 static void acpi_sci_intr(GPEState *s)
 {
     if ( !test_bit(&s->gpe0_sts[0], ACPI_PHP_GPE_BIT) &&
@@ -658,11 +661,11 @@ i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
 
     acpi_map((PCIDevice *)d, 0, 0x1f40, 0x10, PCI_ADDRESS_SPACE_IO);
 
-#ifdef CONFIG_PASSTHROUGH
     gpe_acpi_init();
+#ifdef CONFIG_PASSTHROUGH
     php_devfn_init();
-    register_ioport_write(ACPI_DBG_IO_ADDR, 4, 4, acpi_dbg_writel, d);
 #endif
+    register_ioport_write(ACPI_DBG_IO_ADDR, 4, 4, acpi_dbg_writel, d);
 
     register_savevm("piix4acpi", 0, 1, piix4acpi_save, piix4acpi_load, d);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel