From patchwork Wed Dec 8 11:05:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 74674 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B332FB6EF0 for ; Wed, 8 Dec 2010 22:24:03 +1100 (EST) Received: from localhost ([127.0.0.1]:42267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQI7s-0006n4-FW for incoming@patchwork.ozlabs.org; Wed, 08 Dec 2010 06:24:00 -0500 Received: from [140.186.70.92] (port=49504 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQHqQ-0005KV-Kv for qemu-devel@nongnu.org; Wed, 08 Dec 2010 06:06:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQHqL-0000JU-GU for qemu-devel@nongnu.org; Wed, 08 Dec 2010 06:05:58 -0500 Received: from cantor.suse.de ([195.135.220.2]:58997 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQHqL-0000Ir-7N for qemu-devel@nongnu.org; Wed, 08 Dec 2010 06:05:53 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 7B12B9428F; Wed, 8 Dec 2010 12:05:51 +0100 (CET) From: Alexander Graf To: QEMU-devel Developers Date: Wed, 8 Dec 2010 12:05:47 +0100 Message-Id: <1291806350-9646-13-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1291806350-9646-1-git-send-email-agraf@suse.de> References: <1291806350-9646-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: Blue Swirl , Paul Brook Subject: [Qemu-devel] [PATCH 12/15] rtl8139: Declare as little endian X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch replaces explicit bswaps with endianness hints to the mmio layer. Because we don't depend on the target endianness anymore, we can also move the driver over to Makefile.objs. Signed-off-by: Alexander Graf --- Makefile.objs | 1 + Makefile.target | 3 --- hw/rtl8139.c | 14 +------------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Makefile.objs b/Makefile.objs index 29b1ede..2b93598 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -225,6 +225,7 @@ hw-obj-$(CONFIG_EEPRO100_PCI) += eepro100.o hw-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o hw-obj-$(CONFIG_PCNET_COMMON) += pcnet.o hw-obj-$(CONFIG_E1000_PCI) += e1000.o +hw-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o hw-obj-$(CONFIG_SMC91C111) += smc91c111.o hw-obj-$(CONFIG_LAN9118) += lan9118.o diff --git a/Makefile.target b/Makefile.target index 39d8df9..8bef8e3 100644 --- a/Makefile.target +++ b/Makefile.target @@ -209,9 +209,6 @@ obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o # USB layer obj-$(CONFIG_USB_OHCI) += usb-ohci.o -# PCI network cards -obj-$(CONFIG_RTL8139_PCI) += rtl8139.o - # Inter-VM PCI shared memory obj-$(CONFIG_KVM) += ivshmem.o diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 30a3960..4a73f6f 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -3125,17 +3125,11 @@ static void rtl8139_mmio_writeb(void *opaque, target_phys_addr_t addr, uint32_t static void rtl8139_mmio_writew(void *opaque, target_phys_addr_t addr, uint32_t val) { -#ifdef TARGET_WORDS_BIGENDIAN - val = bswap16(val); -#endif rtl8139_io_writew(opaque, addr & 0xFF, val); } static void rtl8139_mmio_writel(void *opaque, target_phys_addr_t addr, uint32_t val) { -#ifdef TARGET_WORDS_BIGENDIAN - val = bswap32(val); -#endif rtl8139_io_writel(opaque, addr & 0xFF, val); } @@ -3147,18 +3141,12 @@ static uint32_t rtl8139_mmio_readb(void *opaque, target_phys_addr_t addr) static uint32_t rtl8139_mmio_readw(void *opaque, target_phys_addr_t addr) { uint32_t val = rtl8139_io_readw(opaque, addr & 0xFF); -#ifdef TARGET_WORDS_BIGENDIAN - val = bswap16(val); -#endif return val; } static uint32_t rtl8139_mmio_readl(void *opaque, target_phys_addr_t addr) { uint32_t val = rtl8139_io_readl(opaque, addr & 0xFF); -#ifdef TARGET_WORDS_BIGENDIAN - val = bswap32(val); -#endif return val; } @@ -3367,7 +3355,7 @@ static int pci_rtl8139_init(PCIDevice *dev) /* I/O handler for memory-mapped I/O */ s->rtl8139_mmio_io_addr = cpu_register_io_memory(rtl8139_mmio_read, rtl8139_mmio_write, s, - DEVICE_NATIVE_ENDIAN); + DEVICE_LITTLE_ENDIAN); pci_register_bar(&s->dev, 0, 0x100, PCI_BASE_ADDRESS_SPACE_IO, rtl8139_ioport_map);