From: Laurent Vivier <laurent@vivier.eu>
To: Riku Voipio <riku.voipio@iki.fi>
Cc: qemu-devel@nongnu.org, Laurent Vivier <Laurent@Vivier.EU>
Subject: [Qemu-devel] [PATCH 1/4] linux-user: define default cpu model in configure instead of linux-user/main.c
Date: Fri, 6 Sep 2013 22:47:51 +0200 [thread overview]
Message-ID: <1378500474-26067-2-git-send-email-laurent@vivier.eu> (raw)
In-Reply-To: <1378500474-26067-1-git-send-email-laurent@vivier.eu>
From: Laurent Vivier <Laurent@Vivier.EU>
Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
---
configure | 14 ++++++++++++++
linux-user/main.c | 36 +-----------------------------------
2 files changed, 15 insertions(+), 35 deletions(-)
diff --git a/configure b/configure
index e989609..ef84abe 100755
--- a/configure
+++ b/configure
@@ -4214,6 +4214,7 @@ target_dir="$target"
config_target_mak=$target_dir/config-target.mak
target_name=`echo $target | cut -d '-' -f 1`
target_bigendian="no"
+target_default_cpu="any"
case "$target_name" in
armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
@@ -4261,9 +4262,11 @@ TARGET_ABI_DIR=""
case "$target_name" in
i386)
+ target_default_cpu="qemu32"
;;
x86_64)
TARGET_BASE_ARCH=i386
+ target_default_cpu="qemu64"
;;
alpha)
;;
@@ -4287,17 +4290,20 @@ case "$target_name" in
mips|mipsel)
TARGET_ARCH=mips
echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
+ target_default_cpu="24Kf"
;;
mipsn32|mipsn32el)
TARGET_ARCH=mips64
TARGET_BASE_ARCH=mips
echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
echo "TARGET_ABI32=y" >> $config_target_mak
+ target_default_cpu="20Kc"
;;
mips64|mips64el)
TARGET_ARCH=mips64
TARGET_BASE_ARCH=mips
echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
+ target_default_cpu="20Kc"
;;
moxie)
;;
@@ -4307,16 +4313,19 @@ case "$target_name" in
;;
ppc)
gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
+ target_default_cpu="750"
;;
ppcemb)
TARGET_BASE_ARCH=ppc
TARGET_ABI_DIR=ppc
gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
+ target_default_cpu="750"
;;
ppc64)
TARGET_BASE_ARCH=ppc
TARGET_ABI_DIR=ppc
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
+ target_default_cpu="970fx"
;;
ppc64abi32)
TARGET_ARCH=ppc64
@@ -4324,21 +4333,25 @@ case "$target_name" in
TARGET_ABI_DIR=ppc
echo "TARGET_ABI32=y" >> $config_target_mak
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
+ target_default_cpu="750"
;;
sh4|sh4eb)
TARGET_ARCH=sh4
bflt="yes"
;;
sparc)
+ target_default_cpu="Fujitsu MB86904"
;;
sparc64)
TARGET_BASE_ARCH=sparc
+ target_default_cpu="TI UltraSparc II"
;;
sparc32plus)
TARGET_ARCH=sparc64
TARGET_BASE_ARCH=sparc
TARGET_ABI_DIR=sparc
echo "TARGET_ABI32=y" >> $config_target_mak
+ target_default_cpu="TI UltraSparc II"
;;
s390x)
;;
@@ -4362,6 +4375,7 @@ upper() {
echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]'
}
+echo "TARGET_DEFAULT_CPU=\"$target_default_cpu\"" >> $config_target_mak
target_arch_name="`upper $TARGET_ARCH`"
echo "TARGET_$target_arch_name=y" >> $config_target_mak
echo "TARGET_NAME=$target_name" >> $config_target_mak
diff --git a/linux-user/main.c b/linux-user/main.c
index 5c2f7b2..4681349 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3595,41 +3595,7 @@ int main(int argc, char **argv, char **envp)
init_paths(interp_prefix);
if (cpu_model == NULL) {
-#if defined(TARGET_I386)
-#ifdef TARGET_X86_64
- cpu_model = "qemu64";
-#else
- cpu_model = "qemu32";
-#endif
-#elif defined(TARGET_ARM)
- cpu_model = "any";
-#elif defined(TARGET_UNICORE32)
- cpu_model = "any";
-#elif defined(TARGET_M68K)
- cpu_model = "any";
-#elif defined(TARGET_SPARC)
-#ifdef TARGET_SPARC64
- cpu_model = "TI UltraSparc II";
-#else
- cpu_model = "Fujitsu MB86904";
-#endif
-#elif defined(TARGET_MIPS)
-#if defined(TARGET_ABI_MIPSN32) || defined(TARGET_ABI_MIPSN64)
- cpu_model = "20Kc";
-#else
- cpu_model = "24Kf";
-#endif
-#elif defined TARGET_OPENRISC
- cpu_model = "or1200";
-#elif defined(TARGET_PPC)
-#ifdef TARGET_PPC64
- cpu_model = "970fx";
-#else
- cpu_model = "750";
-#endif
-#else
- cpu_model = "any";
-#endif
+ cpu_model = TARGET_DEFAULT_CPU;
}
tcg_exec_init(0);
cpu_exec_init_all();
--
1.8.1.2
next prev parent reply other threads:[~2013-09-06 20:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 20:47 [Qemu-devel] [PATCH 0/4] Define default CPU at configure time Laurent Vivier
2013-09-06 20:47 ` Laurent Vivier [this message]
2013-09-06 20:47 ` [Qemu-devel] [PATCH 2/4] linux-user: specify the cpu model during configure Laurent Vivier
2013-09-06 20:47 ` [Qemu-devel] [PATCH 3/4] linux-user,m68k: display default cpu Laurent Vivier
2013-09-06 20:47 ` [Qemu-devel] [PATCH 4/4] linux-user,arm: " Laurent Vivier
2013-09-07 8:43 ` [Qemu-devel] [PATCH 0/4] Define default CPU at configure time Peter Maydell
2013-09-07 9:13 ` Laurent Vivier
2013-09-07 9:19 ` Peter Maydell
2013-09-09 19:23 ` Richard Henderson
2013-09-10 7:13 ` Laurent Vivier
2013-09-10 8:40 ` Peter Maydell
-- strict thread matches above, loose matches on Subject: below --
2012-01-22 12:27 [Qemu-devel] [PATCH 0/4] linux-user: A serie of patches to set default CPU Laurent Vivier
2012-01-22 12:27 ` [Qemu-devel] [PATCH 1/4] linux-user: define default cpu model in configure instead of linux-user/main.c Laurent Vivier
2011-09-18 9:37 [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment Laurent Vivier
2011-09-18 9:37 ` [Qemu-devel] [PATCH 1/4] linux-user: define default cpu model in configure instead of linux-user/main.c Laurent Vivier
2011-07-28 13:37 [Qemu-devel] [PATCH 0/4] Set of patches for chrooted environment Laurent Vivier
2011-07-28 13:37 ` [Qemu-devel] [PATCH 1/4] linux-user: define default cpu model in configure instead of linux-user/main.c Laurent Vivier
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=1378500474-26067-2-git-send-email-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/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).