From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebUzR-00007q-7d for qemu-devel@nongnu.org; Tue, 16 Jan 2018 12:25:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebUzO-0001P7-54 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 12:25:37 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:64350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebUzN-0001Ny-GX for qemu-devel@nongnu.org; Tue, 16 Jan 2018 12:25:33 -0500 From: Laurent Vivier Date: Tue, 16 Jan 2018 18:25:09 +0100 Message-Id: <20180116172510.28878-4-laurent@vivier.eu> In-Reply-To: <20180116172510.28878-1-laurent@vivier.eu> References: <20180116172510.28878-1-laurent@vivier.eu> Subject: [Qemu-devel] [PATCH v2 3/4] linux-user, m68k: select CPU according to ELF header values List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: YunQiang Su , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Riku Voipio , Aaron Sierra , Laurent Vivier 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 ("m68020" 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 --- Notes: v2: call cpu_get_model() with the result of get_elf_eflags() linux-user/m68k/target_elf.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux-user/m68k/target_elf.h b/linux-user/m68k/target_elf.h index df375ad5d3..946b90f342 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) { + /* 680x0 */ + return "m68020"; + } + + /* Coldfire */ return "any"; } #endif -- 2.14.3