These devices are only used by the AVR target, which is only
built as little-endian. Therefore the DEVICE_NATIVE_ENDIAN
definition expand to DEVICE_LITTLE_ENDIAN (besides, the
DEVICE_BIG_ENDIAN case isn't tested). Simplify directly
using DEVICE_LITTLE_ENDIAN.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/char/avr_usart.c | 2 +-
hw/misc/avr_power.c | 2 +-
hw/timer/avr_timer16.c | 6 +++---
target/avr/helper.c | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/char/avr_usart.c b/hw/char/avr_usart.c
index fae15217e9f..5510dd3f487 100644
--- a/hw/char/avr_usart.c
+++ b/hw/char/avr_usart.c
@@ -255,7 +255,7 @@ static void avr_usart_write(void *opaque, hwaddr addr, uint64_t value,
static const MemoryRegionOps avr_usart_ops = {
.read = avr_usart_read,
.write = avr_usart_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
.impl = {.min_access_size = 1, .max_access_size = 1}
};
diff --git a/hw/misc/avr_power.c b/hw/misc/avr_power.c
index 411f016c997..d8e0d918519 100644
--- a/hw/misc/avr_power.c
+++ b/hw/misc/avr_power.c
@@ -69,7 +69,7 @@ static void avr_mask_write(void *opaque, hwaddr offset,
static const MemoryRegionOps avr_mask_ops = {
.read = avr_mask_read,
.write = avr_mask_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
.impl = {
.max_access_size = 1,
},
diff --git a/hw/timer/avr_timer16.c b/hw/timer/avr_timer16.c
index 012d8290018..110bcd58163 100644
--- a/hw/timer/avr_timer16.c
+++ b/hw/timer/avr_timer16.c
@@ -524,21 +524,21 @@ static void avr_timer16_ifr_write(void *opaque, hwaddr offset,
static const MemoryRegionOps avr_timer16_ops = {
.read = avr_timer16_read,
.write = avr_timer16_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
.impl = {.max_access_size = 1}
};
static const MemoryRegionOps avr_timer16_imsk_ops = {
.read = avr_timer16_imsk_read,
.write = avr_timer16_imsk_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
.impl = {.max_access_size = 1}
};
static const MemoryRegionOps avr_timer16_ifr_ops = {
.read = avr_timer16_ifr_read,
.write = avr_timer16_ifr_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
.impl = {.max_access_size = 1}
};
diff --git a/target/avr/helper.c b/target/avr/helper.c
index 365c8c60e19..9ee0a558ea7 100644
--- a/target/avr/helper.c
+++ b/target/avr/helper.c
@@ -256,7 +256,7 @@ static void avr_cpu_trap_write(void *opaque, hwaddr addr,
const MemoryRegionOps avr_cpu_reg1 = {
.read = avr_cpu_reg1_read,
.write = avr_cpu_trap_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
.valid.min_access_size = 1,
.valid.max_access_size = 1,
};
@@ -264,7 +264,7 @@ const MemoryRegionOps avr_cpu_reg1 = {
const MemoryRegionOps avr_cpu_reg2 = {
.read = avr_cpu_reg2_read,
.write = avr_cpu_trap_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
+ .endianness = DEVICE_LITTLE_ENDIAN,
.valid.min_access_size = 1,
.valid.max_access_size = 1,
};
--
2.52.0
On 12/19/25 08:30, Philippe Mathieu-Daudé wrote: > These devices are only used by the AVR target, which is only > built as little-endian. Therefore the DEVICE_NATIVE_ENDIAN > definition expand to DEVICE_LITTLE_ENDIAN (besides, the > DEVICE_BIG_ENDIAN case isn't tested). Simplify directly > using DEVICE_LITTLE_ENDIAN. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- > hw/char/avr_usart.c | 2 +- > hw/misc/avr_power.c | 2 +- > hw/timer/avr_timer16.c | 6 +++--- > target/avr/helper.c | 4 ++-- > 4 files changed, 7 insertions(+), 7 deletions(-) AVR is all single byte accesses -- it doesn't matter about endianness. :-) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
© 2016 - 2026 Red Hat, Inc.