[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/15] rtl8139: Declare as little endian
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 12/15] rtl8139: Declare as little endian |
Date: |
Thu, 25 Nov 2010 08:35:52 +0100 |
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 <address@hidden>
---
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 37d4a10..5a679c6 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -216,6 +216,7 @@ hw-obj-y += ne2000.o
hw-obj-y += eepro100.o
hw-obj-y += pcnet.o
hw-obj-y += e1000.o
+hw-obj-y += rtl8139.o
hw-obj-$(CONFIG_SMC91C111) += smc91c111.o
hw-obj-$(CONFIG_LAN9118) += lan9118.o
diff --git a/Makefile.target b/Makefile.target
index 02a7a66..c96107c 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-y += 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);
--
1.6.0.2
- [Qemu-devel] [PATCH 00/15] [RFC] MMIO endianness cleanup, Alexander Graf, 2010/11/25
- [Qemu-devel] [PATCH 04/15] dbdma: Make little endian, Alexander Graf, 2010/11/25
- [Qemu-devel] [PATCH 03/15] Make simple io mem handler endian aware, Alexander Graf, 2010/11/25
- [Qemu-devel] [PATCH 06/15] uninorth: Get rid of bswap, Alexander Graf, 2010/11/25
- [Qemu-devel] [PATCH 07/15] e1000: Make little endian, Alexander Graf, 2010/11/25
- [Qemu-devel] [PATCH 12/15] rtl8139: Declare as little endian,
Alexander Graf <=
- [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Alexander Graf, 2010/11/25
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Andreas Färber, 2010/11/26
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Alexander Graf, 2010/11/26
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Peter Maydell, 2010/11/26
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Paul Brook, 2010/11/26
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Blue Swirl, 2010/11/27
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Paul Brook, 2010/11/27
- Re: [Qemu-devel] [PATCH 01/15] exec: introduce endianness swapped mmio, Gleb Natapov, 2010/11/28
[Qemu-devel] [PATCH 05/15] pci-host: Delegate bswap to mmio layer, Alexander Graf, 2010/11/25