[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 22/34] arm: Remove ELF_MACHINE from cpu.h
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [RFC PATCH 22/34] arm: Remove ELF_MACHINE from cpu.h |
Date: |
Sun, 10 May 2015 23:29:25 -0700 |
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 armv7m bootloader can just pass EM_ARM directly, as that
is architecture specific code.
This remove another architecture specific definition from the global
namespace.
Signed-off-by: Peter Crosthwaite <address@hidden>
---
hw/arm/armv7m.c | 2 +-
linux-user/elfload.c | 2 ++
target-arm/cpu.h | 2 --
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index c6eab6d..ad89073 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 de7fe14..5239f0b 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -272,6 +272,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,
const CPUX86State *en
/* 32 bit ARM definitions */
#define ELF_START_MMAP 0x80000000
+# define ELF_MACHINE EM_ARM
#define elf_check_arch(x) ((x) == ELF_MACHINE)
@@ -480,6 +481,7 @@ static uint32_t get_elf_hwcap2(void)
#else
/* 64 bit ARM definitions */
#define ELF_START_MMAP 0x80000000
+#define ELF_MACHINE EM_AARCH64
#define elf_check_arch(x) ((x) == ELF_MACHINE)
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 7d08301..5333b1b 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
--
1.9.1
- [Qemu-devel] [RFC PATCH 32/34] arm: xilinx_zynq: Add a microblaze, (continued)
- [Qemu-devel] [RFC PATCH 32/34] arm: xilinx_zynq: Add a microblaze, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 31/34] arm: boot: Don't assume all CPUs are ARM, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 29/34] arm: cpu: Multi-define guard deep CPU specifics, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 30/34] arm: Enable multi-arch, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 28/34] arm: cpu: Guard cpu_init definition for user mode, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 27/34] hw: arm: Explicitly include cpu.h for consumers, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 25/34] arm: cpu: Move CPU_COMMON to front of env, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 26/34] arm: Use qomified tcg defintions, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 22/34] arm: Remove ELF_MACHINE from cpu.h,
Peter Crosthwaite <=
- [Qemu-devel] [RFC PATCH 24/34] arm: delete dummy prototypes, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 23/34] arm: cpu.h: Move cpu-all include, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 20/34] configure: Unify arm and aarch64 disas configury, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 18/34] mb: cpu-qom: Put the ENV first, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 19/34] mb: Enable multi-arch, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 21/34] arm: Rename all exceptions, Peter Crosthwaite, 2015/05/11