提交 add85a76 编写于 作者: B Blue Swirl

Compile prep_pci only once

Make byte swapping unconditional since PPC is big endian.
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 29e922b6
...@@ -150,7 +150,10 @@ hw-obj-$(CONFIG_USB_UHCI) += usb-uhci.o ...@@ -150,7 +150,10 @@ hw-obj-$(CONFIG_USB_UHCI) += usb-uhci.o
hw-obj-$(CONFIG_USB_OHCI) += usb-ohci.o hw-obj-$(CONFIG_USB_OHCI) += usb-ohci.o
hw-obj-$(CONFIG_FDC) += fdc.o hw-obj-$(CONFIG_FDC) += fdc.o
hw-obj-$(CONFIG_ACPI) += acpi.o hw-obj-$(CONFIG_ACPI) += acpi.o
# PPC devices
hw-obj-$(CONFIG_OPENPIC) += openpic.o hw-obj-$(CONFIG_OPENPIC) += openpic.o
hw-obj-$(CONFIG_PREP_PCI) += prep_pci.o
# PCI watchdog devices # PCI watchdog devices
hw-obj-y += wdt_i6300esb.o hw-obj-y += wdt_i6300esb.o
......
...@@ -193,7 +193,7 @@ obj-ppc-y = ppc.o ...@@ -193,7 +193,7 @@ obj-ppc-y = ppc.o
obj-ppc-y += vga.o dma.o obj-ppc-y += vga.o dma.o
# PREP target # PREP target
obj-ppc-y += pckbd.o i8259.o mc146818rtc.o obj-ppc-y += pckbd.o i8259.o mc146818rtc.o
obj-ppc-y += prep_pci.o ppc_prep.o obj-ppc-y += ppc_prep.o
# Mac shared devices # Mac shared devices
obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
# OldWorld PowerMac # OldWorld PowerMac
......
...@@ -10,6 +10,7 @@ CONFIG_SERIAL=y ...@@ -10,6 +10,7 @@ CONFIG_SERIAL=y
CONFIG_I8254=y CONFIG_I8254=y
CONFIG_FDC=y CONFIG_FDC=y
CONFIG_OPENPIC=y CONFIG_OPENPIC=y
CONFIG_PREP_PCI=y
CONFIG_IDE_CORE=y CONFIG_IDE_CORE=y
CONFIG_IDE_QDEV=y CONFIG_IDE_QDEV=y
CONFIG_IDE_PCI=y CONFIG_IDE_PCI=y
......
...@@ -10,6 +10,7 @@ CONFIG_SERIAL=y ...@@ -10,6 +10,7 @@ CONFIG_SERIAL=y
CONFIG_I8254=y CONFIG_I8254=y
CONFIG_FDC=y CONFIG_FDC=y
CONFIG_OPENPIC=y CONFIG_OPENPIC=y
CONFIG_PREP_PCI=y
CONFIG_IDE_CORE=y CONFIG_IDE_CORE=y
CONFIG_IDE_QDEV=y CONFIG_IDE_QDEV=y
CONFIG_IDE_PCI=y CONFIG_IDE_PCI=y
......
...@@ -10,6 +10,7 @@ CONFIG_SERIAL=y ...@@ -10,6 +10,7 @@ CONFIG_SERIAL=y
CONFIG_I8254=y CONFIG_I8254=y
CONFIG_FDC=y CONFIG_FDC=y
CONFIG_OPENPIC=y CONFIG_OPENPIC=y
CONFIG_PREP_PCI=y
CONFIG_IDE_CORE=y CONFIG_IDE_CORE=y
CONFIG_IDE_QDEV=y CONFIG_IDE_QDEV=y
CONFIG_IDE_PCI=y CONFIG_IDE_PCI=y
......
...@@ -49,18 +49,14 @@ static void PPC_PCIIO_writeb (void *opaque, target_phys_addr_t addr, uint32_t va ...@@ -49,18 +49,14 @@ static void PPC_PCIIO_writeb (void *opaque, target_phys_addr_t addr, uint32_t va
static void PPC_PCIIO_writew (void *opaque, target_phys_addr_t addr, uint32_t val) static void PPC_PCIIO_writew (void *opaque, target_phys_addr_t addr, uint32_t val)
{ {
PREPPCIState *s = opaque; PREPPCIState *s = opaque;
#ifdef TARGET_WORDS_BIGENDIAN
val = bswap16(val); val = bswap16(val);
#endif
pci_data_write(s->bus, PPC_PCIIO_config(addr), val, 2); pci_data_write(s->bus, PPC_PCIIO_config(addr), val, 2);
} }
static void PPC_PCIIO_writel (void *opaque, target_phys_addr_t addr, uint32_t val) static void PPC_PCIIO_writel (void *opaque, target_phys_addr_t addr, uint32_t val)
{ {
PREPPCIState *s = opaque; PREPPCIState *s = opaque;
#ifdef TARGET_WORDS_BIGENDIAN
val = bswap32(val); val = bswap32(val);
#endif
pci_data_write(s->bus, PPC_PCIIO_config(addr), val, 4); pci_data_write(s->bus, PPC_PCIIO_config(addr), val, 4);
} }
...@@ -77,9 +73,7 @@ static uint32_t PPC_PCIIO_readw (void *opaque, target_phys_addr_t addr) ...@@ -77,9 +73,7 @@ static uint32_t PPC_PCIIO_readw (void *opaque, target_phys_addr_t addr)
PREPPCIState *s = opaque; PREPPCIState *s = opaque;
uint32_t val; uint32_t val;
val = pci_data_read(s->bus, PPC_PCIIO_config(addr), 2); val = pci_data_read(s->bus, PPC_PCIIO_config(addr), 2);
#ifdef TARGET_WORDS_BIGENDIAN
val = bswap16(val); val = bswap16(val);
#endif
return val; return val;
} }
...@@ -88,9 +82,7 @@ static uint32_t PPC_PCIIO_readl (void *opaque, target_phys_addr_t addr) ...@@ -88,9 +82,7 @@ static uint32_t PPC_PCIIO_readl (void *opaque, target_phys_addr_t addr)
PREPPCIState *s = opaque; PREPPCIState *s = opaque;
uint32_t val; uint32_t val;
val = pci_data_read(s->bus, PPC_PCIIO_config(addr), 4); val = pci_data_read(s->bus, PPC_PCIIO_config(addr), 4);
#ifdef TARGET_WORDS_BIGENDIAN
val = bswap32(val); val = bswap32(val);
#endif
return val; return val;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册