qemu/linux-user/m68k/target_elf.h
Laurent Vivier 33dff5ff90 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>
2018-02-25 17:29:21 +01:00

21 lines
547 B
C

/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation, or (at your option) any
* later version. See the COPYING file in the top-level directory.
*/
#ifndef M68K_TARGET_ELF_H
#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