Patchwork [07/10] Compile most PPC devices only once

login
register
mail settings
Submitter Blue Swirl
Date March 26, 2010, 7:04 p.m.
Message ID <f43fc5581003261204h7754c4c6rd3550b868e07d802@mail.gmail.com>
Download mbox | patch
Permalink /patch/48716/
State New
Headers show

Comments

Blue Swirl - March 26, 2010, 7:04 p.m.
Make byte swapping unconditional since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 Makefile.objs                      |   14 ++++++++++++++
 Makefile.target                    |    8 +++-----
 default-configs/ppc-softmmu.mak    |   10 ++++++++++
 default-configs/ppc64-softmmu.mak  |   10 ++++++++++
 default-configs/ppcemb-softmmu.mak |   10 ++++++++++
 hw/heathrow_pic.c                  |    4 ----
 hw/mac_dbdma.c                     |    4 ----
 hw/ppce500_pci.c                   |    2 --
 hw/unin_pci.c                      |    4 ----
 sysemu.h                           |    4 ----
 10 files changed, 47 insertions(+), 23 deletions(-)

Patch

diff --git a/Makefile.objs b/Makefile.objs
index 3a98197..6498ff7 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -152,6 +152,20 @@  hw-obj-$(CONFIG_ACPI) += acpi.o
 # PPC devices
 hw-obj-$(CONFIG_OPENPIC) += openpic.o
 hw-obj-$(CONFIG_PREP_PCI) += prep_pci.o
+# Mac shared devices
+hw-obj-$(CONFIG_MACIO) += macio.o
+hw-obj-$(CONFIG_CUDA) += cuda.o
+hw-obj-$(CONFIG_ADB) += adb.o
+hw-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o
+hw-obj-$(CONFIG_MAC_DBDMA) += mac_dbdma.o
+# OldWorld PowerMac
+hw-obj-$(CONFIG_HEATHROW_PIC) += heathrow_pic.o
+hw-obj-$(CONFIG_GRACKLE_PCI) += grackle_pci.o
+# NewWorld PowerMac
+hw-obj-$(CONFIG_UNIN_PCI) += unin_pci.o
+hw-obj-$(CONFIG_DEC_PCI) += dec_pci.o
+# PowerPC E500 boards
+hw-obj-$(CONFIG_PPCE500_PCI) += ppce500_pci.o

 # PCI watchdog devices
 hw-obj-y += wdt_i6300esb.o
diff --git a/Makefile.target b/Makefile.target
index fc8e8ff..45c9d40 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -195,17 +195,15 @@  obj-ppc-y += vga.o dma.o
 # PREP target
 obj-ppc-y += pckbd.o i8259.o mc146818rtc.o
 obj-ppc-y += ppc_prep.o
-# Mac shared devices
-obj-ppc-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
 # OldWorld PowerMac
-obj-ppc-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o
+obj-ppc-y += ppc_oldworld.o
 # NewWorld PowerMac
-obj-ppc-y += unin_pci.o ppc_newworld.o dec_pci.o
+obj-ppc-y += ppc_newworld.o
 # PowerPC 4xx boards
 obj-ppc-y += ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
 obj-ppc-y += ppc440.o ppc440_bamboo.o
 # PowerPC E500 boards
-obj-ppc-y += ppce500_pci.o ppce500_mpc8544ds.o
+obj-ppc-y += ppce500_mpc8544ds.o
 obj-ppc-$(CONFIG_KVM) += kvm_ppc.o
 obj-ppc-$(CONFIG_FDT) += device_tree.o

diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak
index 5d87c1e..d8404fc 100644
--- a/default-configs/ppc-softmmu.mak
+++ b/default-configs/ppc-softmmu.mak
@@ -11,6 +11,16 @@  CONFIG_I8254=y
 CONFIG_FDC=y
 CONFIG_OPENPIC=y
 CONFIG_PREP_PCI=y
+CONFIG_MACIO=y
+CONFIG_CUDA=y
+CONFIG_ADB=y
+CONFIG_MAC_NVRAM=y
+CONFIG_MAC_DBDMA=y
+CONFIG_HEATHROW_PIC=y
+CONFIG_GRACKLE_PCI=y
+CONFIG_UNIN_PCI=y
+CONFIG_DEC_PCI=y
+CONFIG_PPCE500_PCI=y
 CONFIG_IDE_CORE=y
 CONFIG_IDE_QDEV=y
 CONFIG_IDE_PCI=y
diff --git a/default-configs/ppc64-softmmu.mak
b/default-configs/ppc64-softmmu.mak
index 7818356..4b40dfa 100644
--- a/default-configs/ppc64-softmmu.mak
+++ b/default-configs/ppc64-softmmu.mak
@@ -11,6 +11,16 @@  CONFIG_I8254=y
 CONFIG_FDC=y
 CONFIG_OPENPIC=y
 CONFIG_PREP_PCI=y
+CONFIG_MACIO=y
+CONFIG_CUDA=y
+CONFIG_ADB=y
+CONFIG_MAC_NVRAM=y
+CONFIG_MAC_DBDMA=y
+CONFIG_HEATHROW_PIC=y
+CONFIG_GRACKLE_PCI=y
+CONFIG_UNIN_PCI=y
+CONFIG_DEC_PCI=y
+CONFIG_PPCE500_PCI=y
 CONFIG_IDE_CORE=y
 CONFIG_IDE_QDEV=y
 CONFIG_IDE_PCI=y
diff --git a/default-configs/ppcemb-softmmu.mak
b/default-configs/ppcemb-softmmu.mak
index 5d29e32..029962f 100644
--- a/default-configs/ppcemb-softmmu.mak
+++ b/default-configs/ppcemb-softmmu.mak
@@ -11,6 +11,16 @@  CONFIG_I8254=y
 CONFIG_FDC=y
 CONFIG_OPENPIC=y
 CONFIG_PREP_PCI=y
+CONFIG_MACIO=y
+CONFIG_CUDA=y
+CONFIG_ADB=y
+CONFIG_MAC_NVRAM=y
+CONFIG_MAC_DBDMA=y
+CONFIG_HEATHROW_PIC=y
+CONFIG_GRACKLE_PCI=y
+CONFIG_UNIN_PCI=y
+CONFIG_DEC_PCI=y
+CONFIG_PPCE500_PCI=y
 CONFIG_IDE_CORE=y
 CONFIG_IDE_QDEV=y
 CONFIG_IDE_PCI=y
diff --git a/hw/heathrow_pic.c b/hw/heathrow_pic.c
index f6174b1..5e27021 100644
--- a/hw/heathrow_pic.c
+++ b/hw/heathrow_pic.c
@@ -68,9 +68,7 @@  static void pic_writel (void *opaque,
target_phys_addr_t addr, uint32_t value)
     HeathrowPIC *pic;
     unsigned int n;

-#ifdef TARGET_WORDS_BIGENDIAN
     value = bswap32(value);
-#endif
     n = ((addr & 0xfff) - 0x10) >> 4;
     PIC_DPRINTF("writel: " TARGET_FMT_plx " %u: %08x\n", addr, n, value);
     if (n >= 2)
@@ -120,9 +118,7 @@  static uint32_t pic_readl (void *opaque,
target_phys_addr_t addr)
         }
     }
     PIC_DPRINTF("readl: " TARGET_FMT_plx " %u: %08x\n", addr, n, value);
-#ifdef TARGET_WORDS_BIGENDIAN
     value = bswap32(value);
-#endif
     return value;
 }

diff --git a/hw/mac_dbdma.c b/hw/mac_dbdma.c
index 8f94c35..e2697d3 100644
--- a/hw/mac_dbdma.c
+++ b/hw/mac_dbdma.c
@@ -707,9 +707,7 @@  static void dbdma_writel (void *opaque,
     DBDMA_DPRINTF("channel 0x%x reg 0x%x\n",
                   (uint32_t)addr >> DBDMA_CHANNEL_SHIFT, reg);

-#ifdef TARGET_WORDS_BIGENDIAN
     value = bswap32(value);
-#endif

     /* cmdptr cannot be modified if channel is RUN or ACTIVE */

@@ -790,9 +788,7 @@  static uint32_t dbdma_readl (void *opaque,
target_phys_addr_t addr)
         break;
     }

-#ifdef TARGET_WORDS_BIGENDIAN
     value = bswap32(value);
-#endif
     return value;
 }

diff --git a/hw/ppce500_pci.c b/hw/ppce500_pci.c
index 683e657..336d284 100644
--- a/hw/ppce500_pci.c
+++ b/hw/ppce500_pci.c
@@ -15,12 +15,10 @@ 
  */

 #include "hw.h"
-#include "ppc.h"
 #include "ppce500.h"
 #include "pci.h"
 #include "pci_host.h"
 #include "bswap.h"
-#include "qemu-log.h"

 #ifdef DEBUG_PCI
 #define pci_debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
diff --git a/hw/unin_pci.c b/hw/unin_pci.c
index a4866f4..f0a773d 100644
--- a/hw/unin_pci.c
+++ b/hw/unin_pci.c
@@ -121,9 +121,7 @@  static void unin_data_write(ReadWriteHandler *handler,
                             pcibus_t addr, uint32_t val, int len)
 {
     UNINState *s = container_of(handler, UNINState, data_handler);
-#ifdef TARGET_WORDS_BIGENDIAN
     val = qemu_bswap_len(val, len);
-#endif
     UNIN_DPRINTF("write addr %" FMT_PCIBUS " len %d val %x\n", addr, len, val);
     pci_data_write(s->host_state.bus,
                    unin_get_config_reg(s->host_state.config_reg, addr),
@@ -140,9 +138,7 @@  static uint32_t unin_data_read(ReadWriteHandler *handler,
                         unin_get_config_reg(s->host_state.config_reg, addr),
                         len);
     UNIN_DPRINTF("read addr %" FMT_PCIBUS " len %d val %x\n", addr, len, val);
-#ifdef TARGET_WORDS_BIGENDIAN
     val = qemu_bswap_len(val, len);
-#endif
     return val;
 }

diff --git a/sysemu.h b/sysemu.h
index 525efd1..5f8c56a 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -144,13 +144,9 @@  extern uint64_t node_cpumask[MAX_NODES];
 extern const char *option_rom[MAX_OPTION_ROMS];
 extern int nb_option_roms;

-#ifdef NEED_CPU_H
-#if defined(TARGET_SPARC) || defined(TARGET_PPC)
 #define MAX_PROM_ENVS 128
 extern const char *prom_envs[MAX_PROM_ENVS];
 extern unsigned int nb_prom_envs;
-#endif
-#endif

 typedef enum {
     IF_NONE,