summary refs log tree commit diff stats
path: root/hw/ppc/mac_newworld.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-03-19 12:54:31 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2025-03-21 12:51:16 +0100
commit134ab17fffb32a3f86debb4eec9df12f7f833a3b (patch)
tree46f26c5fff8280a3a17ce4ca4a7723b76d60cba9 /hw/ppc/mac_newworld.c
parentcc3d262aa93a42e19c38f6acb6d0f6012a71eb4b (diff)
downloadfocaccia-qemu-134ab17fffb32a3f86debb4eec9df12f7f833a3b.tar.gz
focaccia-qemu-134ab17fffb32a3f86debb4eec9df12f7f833a3b.zip
load_aout: replace bswap_needed with big_endian
Targets know whether they are big-endian more than they know if
the endianness is different from the host: the former is mostly
a constant, at least in machine creation code, while the latter
has to be computed with TARGET_BIG_ENDIAN != HOST_BIG_ENDIAN or
something like that.

load_aout, however, takes a "bswap_needed" argument.  Replace
it with a "big_endian" argument; even though all users are
big-endian, it is cheap enough to keep the optional swapping
functionality even for little-endian boards.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ppc/mac_newworld.c')
-rw-r--r--hw/ppc/mac_newworld.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index cb3dc3ab48..2d5309d6f5 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -197,11 +197,6 @@ static void ppc_core99_init(MachineState *machine)
     }
 
     if (machine->kernel_filename) {
-        int bswap_needed = 0;
-
-#ifdef BSWAP_NEEDED
-        bswap_needed = 1;
-#endif
         kernel_base = KERNEL_LOAD_ADDR;
         kernel_size = load_elf(machine->kernel_filename, NULL,
                                translate_kernel_address, NULL, NULL, NULL,
@@ -209,7 +204,7 @@ static void ppc_core99_init(MachineState *machine)
         if (kernel_size < 0) {
             kernel_size = load_aout(machine->kernel_filename, kernel_base,
                                     machine->ram_size - kernel_base,
-                                    bswap_needed, TARGET_PAGE_SIZE);
+                                    true, TARGET_PAGE_SIZE);
         }
         if (kernel_size < 0) {
             kernel_size = load_image_targphys(machine->kernel_filename,