提交 04ce380e 编写于 作者: P Peter Crosthwaite 提交者: Paolo Bonzini

mips: Remove ELF_MACHINE from cpu.h

The only generic code relying on this is linux-user, but linux users'
default behaviour of defaulting ELF_MACHINE to ELF_ARCH will handle
this.

The bootloaders can just pass EM_MIPS directly, as that is
architecture specific code.

This removes another architecture specific definition from the global
namespace.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: NAurelien Jarno <aurelien@aurel32.net>
Reviewed-by: NRichard Henderson <rth@twiddle.net>
Acked-By: NRiku Voipio <riku.voipio@linaro.org>
Signed-off-by: NPeter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 77452383
...@@ -116,7 +116,7 @@ static int64_t load_kernel (CPUMIPSState *env) ...@@ -116,7 +116,7 @@ static int64_t load_kernel (CPUMIPSState *env)
if (load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, NULL, if (load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, NULL,
(uint64_t *)&kernel_entry, (uint64_t *)&kernel_low, (uint64_t *)&kernel_entry, (uint64_t *)&kernel_low,
(uint64_t *)&kernel_high, 0, ELF_MACHINE, 1) < 0) { (uint64_t *)&kernel_high, 0, EM_MIPS, 1) < 0) {
fprintf(stderr, "qemu: could not load kernel '%s'\n", fprintf(stderr, "qemu: could not load kernel '%s'\n",
loaderparams.kernel_filename); loaderparams.kernel_filename);
exit(1); exit(1);
......
...@@ -795,7 +795,7 @@ static int64_t load_kernel (void) ...@@ -795,7 +795,7 @@ static int64_t load_kernel (void)
if (load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, NULL, if (load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, NULL,
(uint64_t *)&kernel_entry, NULL, (uint64_t *)&kernel_high, (uint64_t *)&kernel_entry, NULL, (uint64_t *)&kernel_high,
big_endian, ELF_MACHINE, 1) < 0) { big_endian, EM_MIPS, 1) < 0) {
fprintf(stderr, "qemu: could not load kernel '%s'\n", fprintf(stderr, "qemu: could not load kernel '%s'\n",
loaderparams.kernel_filename); loaderparams.kernel_filename);
exit(1); exit(1);
......
...@@ -69,7 +69,7 @@ static int64_t load_kernel(void) ...@@ -69,7 +69,7 @@ static int64_t load_kernel(void)
kernel_size = load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, kernel_size = load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys,
NULL, (uint64_t *)&entry, NULL, NULL, (uint64_t *)&entry, NULL,
(uint64_t *)&kernel_high, big_endian, (uint64_t *)&kernel_high, big_endian,
ELF_MACHINE, 1); EM_MIPS, 1);
if (kernel_size >= 0) { if (kernel_size >= 0) {
if ((entry & ~0x7fffffffULL) == 0x80000000) if ((entry & ~0x7fffffffULL) == 0x80000000)
entry = (int32_t)entry; entry = (int32_t)entry;
......
...@@ -87,7 +87,7 @@ static int64_t load_kernel(void) ...@@ -87,7 +87,7 @@ static int64_t load_kernel(void)
kernel_size = load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys, kernel_size = load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys,
NULL, (uint64_t *)&entry, NULL, NULL, (uint64_t *)&entry, NULL,
(uint64_t *)&kernel_high, big_endian, (uint64_t *)&kernel_high, big_endian,
ELF_MACHINE, 1); EM_MIPS, 1);
if (kernel_size >= 0) { if (kernel_size >= 0) {
if ((entry & ~0x7fffffffULL) == 0x80000000) if ((entry & ~0x7fffffffULL) == 0x80000000)
entry = (int32_t)entry; entry = (int32_t)entry;
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#define ALIGNED_ONLY #define ALIGNED_ONLY
#define ELF_MACHINE EM_MIPS
#define CPUArchState struct CPUMIPSState #define CPUArchState struct CPUMIPSState
#include "config.h" #include "config.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册