diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-01-26 18:01:41 +0100 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-01-31 19:36:44 +0100 |
| commit | adc1a4a26a9e060c76f213e2b5bf275519844068 (patch) | |
| tree | 7c51d4b4c5b8fd1fc58ac8c93e868a766f0a871e /hw/microblaze/boot.c | |
| parent | 90f5c86acbfcd1f19fd1245c96aa2c51be31361a (diff) | |
| download | focaccia-qemu-adc1a4a26a9e060c76f213e2b5bf275519844068.tar.gz focaccia-qemu-adc1a4a26a9e060c76f213e2b5bf275519844068.zip | |
hw/loader: Pass ELFDATA endian order argument to load_elf()
Rather than passing a boolean 'is_big_endian' argument, directly pass the ELFDATA, which can be unspecified using the ELFDATANONE value. Update the call sites: 0 -> ELFDATA2LSB 1 -> ELFDATA2MSB TARGET_BIG_ENDIAN -> TARGET_BIG_ENDIAN ? ELFDATA2MSB : ELFDATA2LSB Suggested-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250127113824.50177-7-philmd@linaro.org>
Diffstat (limited to 'hw/microblaze/boot.c')
| -rw-r--r-- | hw/microblaze/boot.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index 3854bc2291..60b4ef0abe 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -144,13 +144,15 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, bool is_little_endian, /* Boots a kernel elf binary. */ kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &entry, NULL, &high, NULL, - !is_little_endian, EM_MICROBLAZE, 0, 0); + is_little_endian ? ELFDATA2LSB : ELFDATA2MSB, + EM_MICROBLAZE, 0, 0); base32 = entry; if (base32 == 0xc0000000) { kernel_size = load_elf(kernel_filename, NULL, translate_kernel_address, NULL, &entry, NULL, NULL, NULL, - !is_little_endian, EM_MICROBLAZE, 0, 0); + is_little_endian ? ELFDATA2LSB : ELFDATA2MSB, + EM_MICROBLAZE, 0, 0); } /* Always boot into physical ram. */ boot_info.bootstrap_pc = (uint32_t)entry; |