aboutsummaryrefslogtreecommitdiff
path: root/linux-user/m68k/target_elf.h
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2018-02-20 18:33:06 +0100
committerLaurent Vivier <laurent@vivier.eu>2018-02-25 17:29:21 +0100
commit33dff5ff909c54c6545aa818419caf8802156d55 (patch)
tree080794b435ac61f4062a5c90a39e1fc64aeba44d /linux-user/m68k/target_elf.h
parent768fe76e92477870ab14399dbc6bb8d801621c5c (diff)
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 <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20180220173307.25125-4-laurent@vivier.eu>
Diffstat (limited to 'linux-user/m68k/target_elf.h')
-rw-r--r--linux-user/m68k/target_elf.h6
1 files changed, 6 insertions, 0 deletions
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