From 33dff5ff909c54c6545aa818419caf8802156d55 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Tue, 20 Feb 2018 18:33:06 +0100 Subject: linux-user, m68k: select CPU according to ELF header values M680x0 doesn't support the same set of instructions as ColdFire, so we can't use "any" CPU type to execute m68020 instructions. We select CPU type ("m68040" or "any" for ColdFire) according to the ELF header. If we can't, we use by default the value used until now: "any". Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Message-Id: <20180220173307.25125-4-laurent@vivier.eu> --- linux-user/m68k/target_elf.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'linux-user') diff --git a/linux-user/m68k/target_elf.h b/linux-user/m68k/target_elf.h index df375ad5d3..998fe0fe2f 100644 --- a/linux-user/m68k/target_elf.h +++ b/linux-user/m68k/target_elf.h @@ -9,6 +9,12 @@ #define M68K_TARGET_ELF_H static inline const char *cpu_get_model(uint32_t eflags) { + if (eflags == 0 || (eflags & EF_M68K_M68000)) { + /* 680x0 */ + return "m68040"; + } + + /* Coldfire */ return "any"; } #endif -- cgit v1.2.3