[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 19/42] hw/dma: Declare device little or big endia
From: |
tony.nguyen |
Subject: |
[Qemu-devel] [PATCH v7 19/42] hw/dma: Declare device little or big endian |
Date: |
Fri, 16 Aug 2019 07:33:05 +0000 |
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
the device endianness as DEVICE_LITTLE_ENDIAN or DEVICE_BIG_ENDIAN
respectively.
This *naive* deduction may result in genuinely native endian devices
being incorrectly declared as little or big endian, but should not
introduce regressions for current targets.
These devices should be re-declared as DEVICE_NATIVE_ENDIAN if 1) it
has a new target with an opposite endian or 2) someone informed knows
better =)
Signed-off-by: Tony Nguyen <address@hidden>
---
hw/dma/bcm2835_dma.c | 4 ++--
hw/dma/etraxfs_dma.c | 2 +-
hw/dma/pl080.c | 2 +-
hw/dma/pl330.c | 2 +-
hw/dma/puv3_dma.c | 2 +-
hw/dma/sparc32_dma.c | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/dma/bcm2835_dma.c b/hw/dma/bcm2835_dma.c
index a39e8f4..907d25c 100644
--- a/hw/dma/bcm2835_dma.c
+++ b/hw/dma/bcm2835_dma.c
@@ -288,7 +288,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,
};
@@ -296,7 +296,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 85783eb..df3ba09 100644
--- a/hw/dma/etraxfs_dma.c
+++ b/hw/dma/etraxfs_dma.c
@@ -697,7 +697,7 @@ dma_write(void *opaque, hwaddr addr,
static const MemoryRegionOps dma_ops = {
.read = dma_read,
.write = dma_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
.valid = {
.min_access_size = 1,
.max_access_size = 4
diff --git a/hw/dma/pl080.c b/hw/dma/pl080.c
index 7e57624..644eadb 100644
--- a/hw/dma/pl080.c
+++ b/hw/dma/pl080.c
@@ -346,7 +346,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 a56a3e7..4c51f2d 100644
--- a/hw/dma/pl330.c
+++ b/hw/dma/pl330.c
@@ -1493,7 +1493,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 122f87a..7002373 100644
--- a/hw/dma/puv3_dma.c
+++ b/hw/dma/puv3_dma.c
@@ -75,7 +75,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 88765d0..6b32372 100644
--- a/hw/dma/sparc32_dma.c
+++ b/hw/dma/sparc32_dma.c
@@ -224,7 +224,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,
--
1.8.3.1
?
- [Qemu-devel] [PATCH v7 11/42] memory: Access MemoryRegion with MemOp, (continued)
- [Qemu-devel] [PATCH v7 11/42] memory: Access MemoryRegion with MemOp, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 12/42] hw/s390x: Hard code size with MO_{8|16|32|64}, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 13/42] target/mips: Hard code size with MO_{8|16|32|64}, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 14/42] exec: Hard code size with MO_{8|16|32|64}, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 16/42] hw/block: Declare device little or big endian, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 15/42] hw/audio: Declare device little or big endian, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 17/42] hw/char: Declare device little or big endian, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 18/42] hw/display: Declare device little or big endian, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 20/42] hw/gpio: Declare device little or big endian, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 19/42] hw/dma: Declare device little or big endian,
tony.nguyen <=
- [Qemu-devel] [PATCH v7 21/42] hw/i2c: Declare device little or big endian, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 22/42] hw/input: Declare device little or big endian, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 24/42] hw/isa: Declare device little or big endian, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 23/42] hw/intc: Declare device little or big endian, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 25/42] hw/misc: Declare device little or big endian, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 26/42] hw/net: Declare device little or big endian, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 27/42] hw/pci-host: Declare device little or big endian, tony.nguyen, 2019/08/16