On 12/19/25 05:18, Philippe Mathieu-Daudé wrote:
> The HPET component is only built / used by X86 targets, which
> are only built in little endianness. Thus we only ever built
> as little endian, never testing the big-endian possibility of
> the DEVICE_NATIVE_ENDIAN definition. Simplify by only keeping
> the little endian variant.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/timer/hpet.c | 2 +-
> rust/hw/timer/hpet/src/device.rs | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
> index 1acba4fa9db..bfad626d5e1 100644
> --- a/hw/timer/hpet.c
> +++ b/hw/timer/hpet.c
> @@ -648,7 +648,7 @@ static const MemoryRegionOps hpet_ram_ops = {
> .min_access_size = 4,
> .max_access_size = 8,
> },
> - .endianness = DEVICE_NATIVE_ENDIAN,
> + .endianness = DEVICE_LITTLE_ENDIAN,
> };
>
> static void hpet_reset(DeviceState *d)
> diff --git a/rust/hw/timer/hpet/src/device.rs b/rust/hw/timer/hpet/src/device.rs
> index 3564aa79c6e..4f4be84115e 100644
> --- a/rust/hw/timer/hpet/src/device.rs
> +++ b/rust/hw/timer/hpet/src/device.rs
> @@ -708,7 +708,7 @@ unsafe fn init(mut this: ParentInit<Self>) {
> MemoryRegionOpsBuilder::<HPETState>::new()
> .read(&HPETState::read)
> .write(&HPETState::write)
> - .native_endian()
> + .little_endian()
> .valid_sizes(4, 8)
> .impl_sizes(4, 8)
> .build();
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~