[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 14/42] exec: Hard code size with MO_{8|16|32|64}
From: |
tony.nguyen |
Subject: |
[Qemu-devel] [PATCH v7 14/42] exec: Hard code size with MO_{8|16|32|64} |
Date: |
Fri, 16 Aug 2019 07:31:31 +0000 |
Temporarily no-op size_memop was introduced to aid the conversion of
memory_region_dispatch_{read|write} operand "unsigned size" into
"MemOp op".
Now size_memop is implemented, again hard coded size but with
MO_{8|16|32|64}. This is more expressive and avoids size_memop calls.
Signed-off-by: Tony Nguyen <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
memory_ldst.inc.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/memory_ldst.inc.c b/memory_ldst.inc.c
index 1e8a2fc..de658c4 100644
--- a/memory_ldst.inc.c
+++ b/memory_ldst.inc.c
@@ -38,7 +38,7 @@ static inline uint32_t glue(address_space_ldl_internal,
SUFFIX)(ARG1_DECL,
release_lock |= prepare_mmio_access(mr);
/* I/O case */
- r = memory_region_dispatch_read(mr, addr1, &val, size_memop(4), attrs);
+ r = memory_region_dispatch_read(mr, addr1, &val, MO_32, attrs);
#if defined(TARGET_WORDS_BIGENDIAN)
if (endian == DEVICE_LITTLE_ENDIAN) {
val = bswap32(val);
@@ -114,7 +114,7 @@ static inline uint64_t glue(address_space_ldq_internal,
SUFFIX)(ARG1_DECL,
release_lock |= prepare_mmio_access(mr);
/* I/O case */
- r = memory_region_dispatch_read(mr, addr1, &val, size_memop(8), attrs);
+ r = memory_region_dispatch_read(mr, addr1, &val, MO_64, attrs);
#if defined(TARGET_WORDS_BIGENDIAN)
if (endian == DEVICE_LITTLE_ENDIAN) {
val = bswap64(val);
@@ -188,7 +188,7 @@ uint32_t glue(address_space_ldub, SUFFIX)(ARG1_DECL,
release_lock |= prepare_mmio_access(mr);
/* I/O case */
- r = memory_region_dispatch_read(mr, addr1, &val, size_memop(1), attrs);
+ r = memory_region_dispatch_read(mr, addr1, &val, MO_8, attrs);
} else {
/* RAM case */
ptr = qemu_map_ram_ptr(mr->ram_block, addr1);
@@ -224,7 +224,7 @@ static inline uint32_t glue(address_space_lduw_internal,
SUFFIX)(ARG1_DECL,
release_lock |= prepare_mmio_access(mr);
/* I/O case */
- r = memory_region_dispatch_read(mr, addr1, &val, size_memop(2), attrs);
+ r = memory_region_dispatch_read(mr, addr1, &val, MO_16, attrs);
#if defined(TARGET_WORDS_BIGENDIAN)
if (endian == DEVICE_LITTLE_ENDIAN) {
val = bswap16(val);
@@ -300,7 +300,7 @@ void glue(address_space_stl_notdirty, SUFFIX)(ARG1_DECL,
if (l < 4 || !memory_access_is_direct(mr, true)) {
release_lock |= prepare_mmio_access(mr);
- r = memory_region_dispatch_write(mr, addr1, val, size_memop(4), attrs);
+ r = memory_region_dispatch_write(mr, addr1, val, MO_32, attrs);
} else {
ptr = qemu_map_ram_ptr(mr->ram_block, addr1);
stl_p(ptr, val);
@@ -346,7 +346,7 @@ static inline void glue(address_space_stl_internal,
SUFFIX)(ARG1_DECL,
val = bswap32(val);
}
#endif
- r = memory_region_dispatch_write(mr, addr1, val, size_memop(4), attrs);
+ r = memory_region_dispatch_write(mr, addr1, val, MO_32, attrs);
} else {
/* RAM case */
ptr = qemu_map_ram_ptr(mr->ram_block, addr1);
@@ -408,7 +408,7 @@ void glue(address_space_stb, SUFFIX)(ARG1_DECL,
mr = TRANSLATE(addr, &addr1, &l, true, attrs);
if (!memory_access_is_direct(mr, true)) {
release_lock |= prepare_mmio_access(mr);
- r = memory_region_dispatch_write(mr, addr1, val, size_memop(1), attrs);
+ r = memory_region_dispatch_write(mr, addr1, val, MO_8, attrs);
} else {
/* RAM case */
ptr = qemu_map_ram_ptr(mr->ram_block, addr1);
@@ -451,7 +451,7 @@ static inline void glue(address_space_stw_internal,
SUFFIX)(ARG1_DECL,
val = bswap16(val);
}
#endif
- r = memory_region_dispatch_write(mr, addr1, val, size_memop(2), attrs);
+ r = memory_region_dispatch_write(mr, addr1, val, MO_16, attrs);
} else {
/* RAM case */
ptr = qemu_map_ram_ptr(mr->ram_block, addr1);
@@ -524,7 +524,7 @@ static void glue(address_space_stq_internal,
SUFFIX)(ARG1_DECL,
val = bswap64(val);
}
#endif
- r = memory_region_dispatch_write(mr, addr1, val, size_memop(8), attrs);
+ r = memory_region_dispatch_write(mr, addr1, val, MO_64, attrs);
} else {
/* RAM case */
ptr = qemu_map_ram_ptr(mr->ram_block, addr1);
--
1.8.3.1
?
- [Qemu-devel] [PATCH v7 05/42] hw/s390x: Access MemoryRegion with MemOp, (continued)
- [Qemu-devel] [PATCH v7 05/42] hw/s390x: Access MemoryRegion with MemOp, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 06/42] hw/intc/armv7m_nic: Access MemoryRegion with MemOp, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 02/42] tcg: TCGMemOp is now accelerator independent MemOp, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 07/42] hw/virtio: Access MemoryRegion with MemOp, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 08/42] hw/vfio: Access MemoryRegion with MemOp, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 09/42] exec: Access MemoryRegion with MemOp, tony.nguyen, 2019/08/16
- [Qemu-devel] [PATCH v7 10/42] cputlb: Access MemoryRegion with MemOp, tony.nguyen, 2019/08/16
- [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 <=
- [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, 2019/08/16
- [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