[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 32/48] arm: Remove ELF_MACHINE from cpu.h
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 32/48] arm: Remove ELF_MACHINE from cpu.h |
Date: |
Tue, 22 Sep 2015 17:05:55 +0200 |
From: Peter Crosthwaite <address@hidden>
The only generic code relying on this is linux-user. Linux user
already has a lot of #ifdef TARGET_ customisation so instead, define
ELF_ARCH as either EM_ARM or EM_AARCH64 appropriately.
The armv7m bootloader can just pass EM_ARM directly, as that
is architecture specific code. Note that arm_boot already has its own
logic selecting an arm specific elf machine so this makes V7M more
consistent with arm_boot.
This removes another architecture specific definition from the global
namespace.
Cc: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Acked-By: Riku Voipio <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/arm/armv7m.c | 2 +-
linux-user/elfload.c | 4 ++--
target-arm/cpu.h | 2 --
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index 40334d7..eb214db 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -215,7 +215,7 @@ qemu_irq *armv7m_init(MemoryRegion *system_memory, int
mem_size, int num_irq,
if (kernel_filename) {
image_size = load_elf(kernel_filename, NULL, NULL, &entry, &lowaddr,
- NULL, big_endian, ELF_MACHINE, 1);
+ NULL, big_endian, EM_ARM, 1);
if (image_size < 0) {
image_size = load_image_targphys(kernel_filename, 0, mem_size);
lowaddr = 0;
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 0ecc1b2..506b1ee 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -272,7 +272,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,
const CPUX86State *en
#define ELF_START_MMAP 0x80000000
-#define ELF_ARCH ELF_MACHINE
+#define ELF_ARCH EM_ARM
#define ELF_CLASS ELFCLASS32
static inline void init_thread(struct target_pt_regs *regs,
@@ -478,7 +478,7 @@ static uint32_t get_elf_hwcap2(void)
/* 64 bit ARM definitions */
#define ELF_START_MMAP 0x80000000
-#define ELF_ARCH ELF_MACHINE
+#define ELF_ARCH EM_AARCH64
#define ELF_CLASS ELFCLASS64
#define ELF_PLATFORM "aarch64"
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 1b80516..cc1578c 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -26,10 +26,8 @@
#if defined(TARGET_AARCH64)
/* AArch64 definitions */
# define TARGET_LONG_BITS 64
-# define ELF_MACHINE EM_AARCH64
#else
# define TARGET_LONG_BITS 32
-# define ELF_MACHINE EM_ARM
#endif
#define TARGET_IS_BIENDIAN 1
--
2.5.0
- [Qemu-devel] [PULL 24/48] hmp: added local apic dump state, (continued)
- [Qemu-devel] [PULL 24/48] hmp: added local apic dump state, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 25/48] ioapic_internal.h: added more constants, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 23/48] monitor: make monitor_fprintf and mon_get_cpu externally visible, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 26/48] hmp: added io apic dump state, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 28/48] linux_user: elfload: Default ELF_MACHINE to ELF_ARCH, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 29/48] linux-user: elfload: Provide default for elf_check_arch, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 27/48] hmp: implemented io apic dump state for TCG, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 30/48] elf_ops: Fix coding style for EM alias case statement, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 33/48] mb: Remove ELF_MACHINE from cpu.h, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 31/48] elf: Update EM_MOXIE definition, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 32/48] arm: Remove ELF_MACHINE from cpu.h,
Paolo Bonzini <=
- [Qemu-devel] [PULL 36/48] moxie: Remove ELF_MACHINE from cpu.h, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 37/48] unicore: Remove ELF_MACHINE from cpu.h, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 34/48] m68k: Remove ELF_MACHINE from cpu.h, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 35/48] cris: Remove ELF_MACHINE from cpu.h, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 38/48] lm32: Remove ELF_MACHINE from cpu.h, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 40/48] tricore: Remove ELF_MACHINE from cpu.h, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 39/48] or32: Remove ELF_MACHINE from cpu.h, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 41/48] xtensa: Remove ELF_MACHINE from cpu.h, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 42/48] sh4: Remove ELF_MACHINE from cpu.h, Paolo Bonzini, 2015/09/22
- [Qemu-devel] [PULL 43/48] s390: Remove ELF_MACHINE from cpu.h, Paolo Bonzini, 2015/09/22