# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1203085880 0
# Node ID 1cb8d51b4d77aba99890b909bf16a01dc3dbcb2a
# Parent 819399d0bdb14803252829da64942f102b579ccc
ioemu: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
tools/ioemu/hw/pass-through.c | 12 ----
tools/ioemu/hw/piix4acpi.c | 114 ++++++++++++++++++++++--------------------
tools/ioemu/vl.c | 14 ++---
tools/ioemu/vl.h | 1
4 files changed, 66 insertions(+), 75 deletions(-)
diff -r 819399d0bdb1 -r 1cb8d51b4d77 tools/ioemu/hw/pass-through.c
--- a/tools/ioemu/hw/pass-through.c Fri Feb 15 14:16:42 2008 +0000
+++ b/tools/ioemu/hw/pass-through.c Fri Feb 15 14:31:20 2008 +0000
@@ -692,15 +692,3 @@ int pt_init(PCIBus *e_bus, char *direct_
/* Success */
return 0;
}
-
-void pt_uninit(void)
-{
- struct pci_access *access;
-
- /* clean up the libpci */
- access = dpci_infos.pci_access;
- if ( access ) {
- pci_cleanup(access);
- }
-
-}
diff -r 819399d0bdb1 -r 1cb8d51b4d77 tools/ioemu/hw/piix4acpi.c
--- a/tools/ioemu/hw/piix4acpi.c Fri Feb 15 14:16:42 2008 +0000
+++ b/tools/ioemu/hw/piix4acpi.c Fri Feb 15 14:31:20 2008 +0000
@@ -94,7 +94,7 @@ static int piix4acpi_load(QEMUFile *f, v
return -EINVAL;
ret = pci_device_load(&s->dev, f);
if (ret < 0)
- return ret;
+ return ret;
qemu_get_be16s(f, &s->pm1_control);
return 0;
}
@@ -114,11 +114,10 @@ static uint32_t acpiPm1Control_readb(voi
static void acpi_shutdown(uint32_t val)
{
- if ( !(val & SLP_EN) )
+ if (!(val & SLP_EN))
return;
- switch ( val & SLP_TYP_Sx )
- {
+ switch (val & SLP_TYP_Sx) {
case SLP_TYP_S4:
case SLP_TYP_S5:
qemu_system_shutdown_request();
@@ -162,7 +161,7 @@ static uint32_t acpiPm1Control_readw(voi
}
static void acpi_map(PCIDevice *pci_dev, int region_num,
- uint32_t addr, uint32_t size, int type)
+ uint32_t addr, uint32_t size, int type)
{
PCIAcpiState *d = (PCIAcpiState *)pci_dev;
@@ -176,6 +175,8 @@ static void acpi_map(PCIDevice *pci_dev,
register_ioport_write(addr + 4, 2, 2, acpiPm1Control_writew, d);
register_ioport_read(addr + 4, 2, 2, acpiPm1Control_readw, d);
}
+
+#ifdef CONFIG_PASSTHROUGH
static inline int test_bit(uint8_t *map, int bit)
{
@@ -217,15 +218,17 @@ static uint32_t acpi_php_readb(void *opa
switch (addr)
{
- case ACPI_PHP_IO_ADDR:
- val = hotplug_slots->plug_evt;
- break;
- default:
- num = addr - ACPI_PHP_IO_ADDR - 1;
- val = hotplug_slots->slot[num].status;
- }
-
- fprintf(logfile, "ACPI PCI hotplug: read addr=0x%x, val=0x%x.\n", addr,
val);
+ case ACPI_PHP_IO_ADDR:
+ val = hotplug_slots->plug_evt;
+ break;
+ default:
+ num = addr - ACPI_PHP_IO_ADDR - 1;
+ val = hotplug_slots->slot[num].status;
+ }
+
+ fprintf(logfile, "ACPI PCI hotplug: read addr=0x%x, val=0x%x.\n",
+ addr, val);
+
return val;
}
@@ -233,27 +236,29 @@ static void acpi_php_writeb(void *opaque
{
PHPSlots *hotplug_slots = opaque;
int php_slot;
- fprintf(logfile, "ACPI PCI hotplug: write addr=0x%x, val=0x%x.\n", addr,
val);
+
+ fprintf(logfile, "ACPI PCI hotplug: write addr=0x%x, val=0x%x.\n",
+ addr, val);
switch (addr)
{
- case ACPI_PHP_IO_ADDR:
- break;
- default:
- php_slot = addr - ACPI_PHP_IO_ADDR - 1;
- if ( val == 0x1 ) { /* Eject command */
- /* make _STA of the slot 0 */
- hotplug_slots->slot[php_slot].status = 0;
-
- /* clear the hotplug event */
- hotplug_slots->plug_evt = 0;
-
- /* power off the slot */
- power_off_php_slot(php_slot);
-
- /* signal the CP ACPI hot remove done. */
- xenstore_record_dm_state("pci-removed");
- }
+ case ACPI_PHP_IO_ADDR:
+ break;
+ default:
+ php_slot = addr - ACPI_PHP_IO_ADDR - 1;
+ if ( val == 0x1 ) { /* Eject command */
+ /* make _STA of the slot 0 */
+ hotplug_slots->slot[php_slot].status = 0;
+
+ /* clear the hotplug event */
+ hotplug_slots->plug_evt = 0;
+
+ /* power off the slot */
+ power_off_php_slot(php_slot);
+
+ /* signal the CP ACPI hot remove done. */
+ xenstore_record_dm_state("pci-removed");
+ }
}
}
@@ -346,8 +351,8 @@ static void gpe_en_write(void *opaque, u
* need deassert the intr to avoid redundant intrs
*/
if ( s->sci_asserted &&
- reg_count == (ACPI_PHP_GPE_BIT / 8) &&
- !(val & (1 << (ACPI_PHP_GPE_BIT % 8))) ) {
+ reg_count == (ACPI_PHP_GPE_BIT / 8) &&
+ !(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);
@@ -393,26 +398,26 @@ static void gpe_acpi_init(void)
memset(s, 0, sizeof(GPEState));
register_ioport_read(ACPI_GPE0_BLK_ADDRESS,
- ACPI_GPE0_BLK_LEN / 2,
- 1,
- gpe_sts_read,
- s);
+ ACPI_GPE0_BLK_LEN / 2,
+ 1,
+ gpe_sts_read,
+ s);
register_ioport_read(ACPI_GPE0_BLK_ADDRESS + ACPI_GPE0_BLK_LEN / 2,
- ACPI_GPE0_BLK_LEN / 2,
- 1,
- gpe_en_read,
- s);
+ ACPI_GPE0_BLK_LEN / 2,
+ 1,
+ gpe_en_read,
+ s);
register_ioport_write(ACPI_GPE0_BLK_ADDRESS,
- ACPI_GPE0_BLK_LEN / 2,
- 1,
- gpe_sts_write,
- s);
+ ACPI_GPE0_BLK_LEN / 2,
+ 1,
+ gpe_sts_write,
+ s);
register_ioport_write(ACPI_GPE0_BLK_ADDRESS + ACPI_GPE0_BLK_LEN / 2,
- ACPI_GPE0_BLK_LEN / 2,
- 1,
- gpe_en_write,
- s);
+ ACPI_GPE0_BLK_LEN / 2,
+ 1,
+ gpe_en_write,
+ s);
register_savevm("gpe", 0, 1, gpe_save, gpe_load, s);
}
@@ -420,7 +425,7 @@ static void acpi_sci_intr(GPEState *s)
static void acpi_sci_intr(GPEState *s)
{
if ( !test_bit(&s->gpe0_sts[0], ACPI_PHP_GPE_BIT) &&
- test_bit(&s->gpe0_en[0], ACPI_PHP_GPE_BIT) ) {
+ test_bit(&s->gpe0_en[0], ACPI_PHP_GPE_BIT) ) {
set_bit(&s->gpe0_sts[0], ACPI_PHP_GPE_BIT);
s->sci_asserted = 1;
@@ -488,6 +493,8 @@ void acpi_php_add(int pci_slot)
/* generate a SCI interrupt */
acpi_sci_intr(s);
}
+
+#endif /* CONFIG_PASSTHROUGH */
/* PIIX4 acpi pci configuration space, func 2 */
void pci_piix4_acpi_init(PCIBus *bus, int devfn)
@@ -528,12 +535,11 @@ void pci_piix4_acpi_init(PCIBus *bus, in
acpi_map((PCIDevice *)d, 0, 0x1f40, 0x10, PCI_ADDRESS_SPACE_IO);
+#ifdef CONFIG_PASSTHROUGH
gpe_acpi_init();
-
php_slots_init();
-
- /* for ACPI debug */
register_ioport_write(ACPI_DBG_IO_ADDR, 4, 4, acpi_dbg_writel, d);
+#endif
register_savevm("piix4acpi", 0, 1, piix4acpi_save, piix4acpi_load, d);
}
diff -r 819399d0bdb1 -r 1cb8d51b4d77 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c Fri Feb 15 14:16:42 2008 +0000
+++ b/tools/ioemu/vl.c Fri Feb 15 14:31:20 2008 +0000
@@ -4384,19 +4384,18 @@ void usb_info(void)
void do_pci_del(char *devname)
{
- int pci_slot;
- pci_slot = bdf_to_slot(devname);
-
+#ifdef CONFIG_PASSTHROUGH
+ int pci_slot = bdf_to_slot(devname);
acpi_php_del(pci_slot);
+#endif
}
void do_pci_add(char *devname)
{
- int pci_slot;
-
- pci_slot = insert_to_pci_slot(devname);
-
+#ifdef CONFIG_PASSTHROUGH
+ int pci_slot = insert_to_pci_slot(devname);
acpi_php_add(pci_slot);
+#endif
}
@@ -7985,6 +7984,5 @@ int main(int argc, char **argv)
main_loop();
quit_timers();
- pt_uninit();
return 0;
}
diff -r 819399d0bdb1 -r 1cb8d51b4d77 tools/ioemu/vl.h
--- a/tools/ioemu/vl.h Fri Feb 15 14:16:42 2008 +0000
+++ b/tools/ioemu/vl.h Fri Feb 15 14:31:20 2008 +0000
@@ -868,7 +868,6 @@ int bdf_to_slot(char*);
int bdf_to_slot(char*);
int power_on_php_slot(int);
int power_off_php_slot(int);
-void pt_uninit(void);
/* prep_pci.c */
PCIBus *pci_prep_init(void);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|