Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvEoT-00021M-Gt for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:03:21 -0400 Received: from [140.186.70.92] (port=32776 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvEoQ-0001z0-Pm for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:03:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvEoJ-0007Ta-Ui for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:03:13 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:48744) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvEoJ-0007OU-Q9 for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:03:11 -0400 Received: by mail-pw0-f45.google.com with SMTP id 9so6226558pwi.4 for ; Fri, 26 Mar 2010 12:03:11 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 26 Mar 2010 21:03:11 +0200 Message-ID: From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] [PATCH 04/10] Compile ide/macio only once List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditional since PPC is big endian. Signed-off-by: Blue Swirl --- Makefile.objs | 1 + Makefile.target | 2 +- default-configs/ppc-softmmu.mak | 1 + default-configs/ppc64-softmmu.mak | 1 + default-configs/ppcemb-softmmu.mak | 1 + hw/ide/macio.c | 12 ++---------- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 063f382..713821e 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -170,6 +170,7 @@ hw-obj-$(CONFIG_IDE_PCI) += ide/pci.o hw-obj-$(CONFIG_IDE_ISA) += ide/isa.o hw-obj-$(CONFIG_IDE_PIIX) += ide/piix.o hw-obj-$(CONFIG_IDE_CMD646) += ide/cmd646.o +hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o # SCSI layer hw-obj-y += lsi53c895a.o diff --git a/Makefile.target b/Makefile.target index fbbe63f..e3a9eed 100644 --- a/Makefile.target +++ b/Makefile.target @@ -190,7 +190,7 @@ obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o wdt_ib700.o obj-i386-y += debugcon.o multiboot.o # shared objects -obj-ppc-y = ppc.o ide/macio.o +obj-ppc-y = ppc.o obj-ppc-y += vga.o dma.o openpic.o # PREP target obj-ppc-y += pckbd.o i8259.o mc146818rtc.o diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak index 859423f..78b01d9 100644 --- a/default-configs/ppc-softmmu.mak +++ b/default-configs/ppc-softmmu.mak @@ -14,6 +14,7 @@ CONFIG_IDE_QDEV=y CONFIG_IDE_PCI=y CONFIG_IDE_ISA=y CONFIG_IDE_CMD646=y +CONFIG_IDE_MACIO=y CONFIG_NE2000_ISA=y CONFIG_SOUND=y CONFIG_PFLASH_CFI02=y diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak index 2d0028c..08b07ec 100644 --- a/default-configs/ppc64-softmmu.mak +++ b/default-configs/ppc64-softmmu.mak @@ -14,6 +14,7 @@ CONFIG_IDE_QDEV=y CONFIG_IDE_PCI=y CONFIG_IDE_ISA=y CONFIG_IDE_CMD646=y +CONFIG_IDE_MACIO=y CONFIG_NE2000_ISA=y CONFIG_SOUND=y CONFIG_PFLASH_CFI02=y diff --git a/default-configs/ppcemb-softmmu.mak b/default-configs/ppcemb-softmmu.mak index e5a1dcc..a099468 100644 --- a/default-configs/ppcemb-softmmu.mak +++ b/default-configs/ppcemb-softmmu.mak @@ -14,6 +14,7 @@ CONFIG_IDE_QDEV=y CONFIG_IDE_PCI=y CONFIG_IDE_ISA=y CONFIG_IDE_CMD646=y +CONFIG_IDE_MACIO=y CONFIG_NE2000_ISA=y CONFIG_SOUND=y CONFIG_PFLASH_CFI02=y diff --git a/hw/ide/macio.c b/hw/ide/macio.c index d1bdb49..132d579 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -77,7 +77,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret) s->io_buffer_size = io->len; - qemu_sglist_init(&s->sg, io->len / TARGET_PAGE_SIZE + 1); + qemu_sglist_init(&s->sg, io->len / 4096 + 1); qemu_sglist_add(&s->sg, io->addr, io->len); io->addr += io->len; io->len = 0; @@ -139,7 +139,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret) s->io_buffer_index = 0; s->io_buffer_size = io->len; - qemu_sglist_init(&s->sg, io->len / TARGET_PAGE_SIZE + 1); + qemu_sglist_init(&s->sg, io->len / 4096 + 1); qemu_sglist_add(&s->sg, io->addr, io->len); io->addr += io->len; io->len = 0; @@ -223,9 +223,7 @@ static void pmac_ide_writew (void *opaque, MACIOIDEState *d = opaque; addr = (addr & 0xFFF) >> 4; -#ifdef TARGET_WORDS_BIGENDIAN val = bswap16(val); -#endif if (addr == 0) { ide_data_writew(&d->bus, 0, val); } @@ -242,9 +240,7 @@ static uint32_t pmac_ide_readw (void *opaque,target_phys_addr_t addr) } else { retval = 0xFFFF; } -#ifdef TARGET_WORDS_BIGENDIAN retval = bswap16(retval); -#endif return retval; } @@ -254,9 +250,7 @@ static void pmac_ide_writel (void *opaque, MACIOIDEState *d = opaque; addr = (addr & 0xFFF) >> 4; -#ifdef TARGET_WORDS_BIGENDIAN val = bswap32(val); -#endif if (addr == 0) { ide_data_writel(&d->bus, 0, val); } @@ -273,9 +267,7 @@ static uint32_t pmac_ide_readl (void *opaque,target_phys_addr_t addr) } else { retval = 0xFFFFFFFF; } -#ifdef TARGET_WORDS_BIGENDIAN retval = bswap32(retval); -#endif return retval; } -- 1.6.2.4