[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/19] hw/dma: Declare device little or big endian
From: |
Tony Nguyen |
Subject: |
[Qemu-devel] [PATCH 06/19] hw/dma: Declare device little or big endian |
Date: |
Tue, 27 Aug 2019 00:21:32 +1000 |
For each device declared with DEVICE_NATIVE_ENDIAN, find the set of
targets from the set of target/hw/*/device.o.
If the set of targets are all little or all big endian, re-declare
as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN respectively.
Then, on inspection:
- if not used, re-declare as DEVICE_HOST_ENDIAN.
- if max/min size=1, re-declare as DEVICE_HOST_ENDIAN.
- if just a bit bucket, re-declare as DEVICE_HOST_ENDIAN
- if PCI, re-declare as DEVICE_LITTLE_ENDIAN.
- if for {ARM|unicore32} only, re-declare as DEVICE_LITTLE_ENDIAN.
- if for SPARC only, re-declare as DEVICE_BIG_ENDIAN.
Signed-off-by: Tony Nguyen <address@hidden>
---
hw/dma/bcm2835_dma.c | 4 ++--
hw/dma/etraxfs_dma.c | 14 +++++++-------
hw/dma/i8257.c | 4 ++--
hw/dma/pl080.c | 2 +-
hw/dma/pl330.c | 2 +-
hw/dma/puv3_dma.c | 2 +-
hw/dma/sparc32_dma.c | 2 +-
7 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/hw/dma/bcm2835_dma.c b/hw/dma/bcm2835_dma.c
index 192bd377a0..550e67f686 100644
--- a/hw/dma/bcm2835_dma.c
+++ b/hw/dma/bcm2835_dma.c
@@ -290,7 +290,7 @@ static void bcm2835_dma15_write(void *opaque, hwaddr
offset, uint64_t value,
static const MemoryRegionOps bcm2835_dma0_ops = {
.read = bcm2835_dma0_read,
.write = bcm2835_dma0_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
.valid.min_access_size = 4,
.valid.max_access_size = 4,
};
@@ -298,7 +298,7 @@ static const MemoryRegionOps bcm2835_dma0_ops = {
static const MemoryRegionOps bcm2835_dma15_ops = {
.read = bcm2835_dma15_read,
.write = bcm2835_dma15_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
.valid.min_access_size = 4,
.valid.max_access_size = 4,
};
diff --git a/hw/dma/etraxfs_dma.c b/hw/dma/etraxfs_dma.c
index 47e1c6df12..ee3b92437a 100644
--- a/hw/dma/etraxfs_dma.c
+++ b/hw/dma/etraxfs_dma.c
@@ -698,13 +698,13 @@ dma_write(void *opaque, hwaddr addr,
}
static const MemoryRegionOps dma_ops = {
- .read = dma_read,
- .write = dma_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
- .valid = {
- .min_access_size = 1,
- .max_access_size = 4
- }
+ .read = dma_read,
+ .write = dma_write,
+ .endianness = DEVICE_LITTLE_ENDIAN,
+ .valid = {
+ .min_access_size = 1,
+ .max_access_size = 4
+ }
};
static int etraxfs_dmac_run(void *opaque)
diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
index 792f617eb4..e68736fa44 100644
--- a/hw/dma/i8257.c
+++ b/hw/dma/i8257.c
@@ -476,7 +476,7 @@ static int i8257_phony_handler(void *opaque, int nchan, int
dma_pos,
static const MemoryRegionOps channel_io_ops = {
.read = i8257_read_chan,
.write = i8257_write_chan,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_HOST_ENDIAN,
.impl = {
.min_access_size = 1,
.max_access_size = 1,
@@ -500,7 +500,7 @@ static const MemoryRegionPortio pageh_portio_list[] = {
static const MemoryRegionOps cont_io_ops = {
.read = i8257_read_cont,
.write = i8257_write_cont,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_HOST_ENDIAN,
.impl = {
.min_access_size = 1,
.max_access_size = 1,
diff --git a/hw/dma/pl080.c b/hw/dma/pl080.c
index 52ba23f4bf..cbdd1849cd 100644
--- a/hw/dma/pl080.c
+++ b/hw/dma/pl080.c
@@ -350,7 +350,7 @@ static void pl080_write(void *opaque, hwaddr offset,
static const MemoryRegionOps pl080_ops = {
.read = pl080_read,
.write = pl080_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
};
static void pl080_reset(DeviceState *dev)
diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c
index f2bb2d9ac1..a9216680ef 100644
--- a/hw/dma/pl330.c
+++ b/hw/dma/pl330.c
@@ -1496,7 +1496,7 @@ static uint64_t pl330_iomem_read(void *opaque, hwaddr
offset,
static const MemoryRegionOps pl330_ops = {
.read = pl330_iomem_read,
.write = pl330_iomem_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
.impl = {
.min_access_size = 4,
.max_access_size = 4,
diff --git a/hw/dma/puv3_dma.c b/hw/dma/puv3_dma.c
index 5488d388a9..1577056715 100644
--- a/hw/dma/puv3_dma.c
+++ b/hw/dma/puv3_dma.c
@@ -74,7 +74,7 @@ static const MemoryRegionOps puv3_dma_ops = {
.min_access_size = 4,
.max_access_size = 4,
},
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
};
static void puv3_dma_realize(DeviceState *dev, Error **errp)
diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c
index 0e5bbcdc7f..bf76f2e558 100644
--- a/hw/dma/sparc32_dma.c
+++ b/hw/dma/sparc32_dma.c
@@ -226,7 +226,7 @@ static void dma_mem_write(void *opaque, hwaddr addr,
static const MemoryRegionOps dma_mem_ops = {
.read = dma_mem_read,
.write = dma_mem_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_BIG_ENDIAN,
.valid = {
.min_access_size = 4,
.max_access_size = 4,
--
2.23.0
- [Qemu-devel] [PATCH 00/19] Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 01/19] hw/audio: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 02/19] hw/block: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 04/19] hw/core: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 03/19] hw/char: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 05/19] hw/display: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 06/19] hw/dma: Declare device little or big endian,
Tony Nguyen <=
- [Qemu-devel] [PATCH 07/19] hw/gpio: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 08/19] hw/i2c: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 09/19] hw/input: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 10/19] hw/intc: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 11/19] hw/ipack: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 16/19] hw/sd: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 12/19] hw/isa: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 13/19] hw/misc: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 17/19] hw/ssi: Declare device little or big endian, Tony Nguyen, 2019/08/26
- [Qemu-devel] [PATCH 15/19] hw/pci-host: Declare device little or big endian, Tony Nguyen, 2019/08/26