From: Peter Crosthwaite <crosthwaitepe...@gmail.com> The only generic code relying on this is linux-user. Linux user already has a lot of #ifdef TARGET_ customisation so just define ELF_MACHINE locally there.
The microblaze bootloader can just pass EM_MICROBLAZE directly, as that is architecture specific code. This remove another architecture specific definition from the global namespace. Signed-off-by: Peter Crosthwaite <crosthwaite.pe...@gmail.com> --- hw/microblaze/boot.c | 4 ++-- linux-user/elfload.c | 1 + target-microblaze/cpu.h | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index 4c44317..b3d7c99 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -140,12 +140,12 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base, /* Boots a kernel elf binary. */ kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, &low, &high, - big_endian, ELF_MACHINE, 0); + big_endian, EM_MICROBLAZE, 0); base32 = entry; if (base32 == 0xc0000000) { kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL, &entry, NULL, NULL, - big_endian, ELF_MACHINE, 0); + big_endian, EM_MICROBLAZE, 0); } /* Always boot into physical ram. */ boot_info.bootstrap_pc = (uint32_t)entry; diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 58b799d..5239f0b 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -947,6 +947,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSState *e #ifdef TARGET_MICROBLAZE #define ELF_START_MMAP 0x80000000 +#define ELF_MACHINE EM_MICROBLAZE #define elf_check_arch(x) ( (x) == EM_MICROBLAZE || (x) == EM_MICROBLAZE_OLD) diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h index 4ccbac5..b70536b 100644 --- a/target-microblaze/cpu.h +++ b/target-microblaze/cpu.h @@ -46,7 +46,6 @@ typedef struct CPUMBState CPUMBState; #endif #ifndef TARGET_MULTI -#define ELF_MACHINE EM_MICROBLAZE #define EXCP_MMU 1 #define EXCP_IRQ 2 -- 1.9.1