qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: "YunQiang Su" <syq@debian.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Riku Voipio" <riku.voipio@iki.fi>,
	"Aaron Sierra" <asierra@xes-inc.com>,
	"Laurent Vivier" <laurent@vivier.eu>
Subject: [Qemu-devel] [PATCH v2 3/4] linux-user, m68k: select CPU according to ELF header values
Date: Tue, 16 Jan 2018 18:25:09 +0100	[thread overview]
Message-ID: <20180116172510.28878-4-laurent@vivier.eu> (raw)
In-Reply-To: <20180116172510.28878-1-laurent@vivier.eu>

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 <laurent@vivier.eu>
---

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

  parent reply	other threads:[~2018-01-16 17:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-16 17:25 [Qemu-devel] [PATCH v2 0/4] linux-user: select CPU type according ELF header values Laurent Vivier
2018-01-16 17:25 ` [Qemu-devel] [PATCH v2 1/4] linux-user: Move CPU type name selection to a function Laurent Vivier
2018-01-16 20:10   ` Richard Henderson
2018-01-16 20:34   ` Philippe Mathieu-Daudé
2018-01-16 17:25 ` [Qemu-devel] [PATCH v2 2/4] linux-user: introduce functions to detect CPU type Laurent Vivier
2018-01-16 20:11   ` Richard Henderson
2018-01-16 17:25 ` Laurent Vivier [this message]
2018-01-16 20:22   ` [Qemu-devel] [PATCH v2 3/4] linux-user, m68k: select CPU according to ELF header values Richard Henderson
2018-01-16 17:25 ` [Qemu-devel] [PATCH v2 4/4] linux-user: MIPS set cpu to r6 CPU if binary is R6 Laurent Vivier
2018-01-16 20:26   ` Richard Henderson
2018-01-16 22:01     ` Laurent Vivier
2018-01-16 20:29   ` Philippe Mathieu-Daudé
2018-01-16 21:58     ` Laurent Vivier
2018-01-16 17:33 ` [Qemu-devel] [PATCH v2 0/4] linux-user: select CPU type according ELF header values no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180116172510.28878-4-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=asierra@xes-inc.com \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=riku.voipio@iki.fi \
    --cc=syq@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).