From patchwork Wed Aug 17 20:46:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryce Lanham X-Patchwork-Id: 110445 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8FAB1B6F88 for ; Thu, 18 Aug 2011 09:13:50 +1000 (EST) Received: from localhost ([::1]:47074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtn2r-0006Dv-Dh for incoming@patchwork.ozlabs.org; Wed, 17 Aug 2011 16:49:01 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtn2G-0004cu-FJ for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:48:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qtn2E-0006cn-Tv for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:48:24 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:54221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtn2E-0006aR-QR for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:48:22 -0400 Received: by mail-gx0-f173.google.com with SMTP id 26so1230323gxk.4 for ; Wed, 17 Aug 2011 13:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=IMJa3ttpPex+7Dgfh+0or7H6rfL+ZzgIV9n8K9ohTGA=; b=alaHIyt5hGxcexOfUQAwcp+YOjsKHZVSemZSFXx2dPD9U5EM+Bnw4HXaBWFfMvHkQD kKHuEmnvMj5N7K1jzXqrEYpv032CCqhMbkR0LvQtwVSqe8xmSBcGQcqJGXPlWOIfwoxz y0S99mY0e9GXsh3fijAEgTq6WbSXDLpYL6wsc= Received: by 10.236.187.71 with SMTP id x47mr4849391yhm.258.1313614102509; Wed, 17 Aug 2011 13:48:22 -0700 (PDT) Received: from localhost.localdomain (betelgeuse.cs.uchicago.edu [128.135.24.226]) by mx.google.com with ESMTPS id a29sm1237029yhj.59.2011.08.17.13.48.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Aug 2011 13:48:21 -0700 (PDT) From: Bryce Lanham To: qemu-devel@nongnu.org Date: Wed, 17 Aug 2011 15:46:08 -0500 Message-Id: <1313614076-28878-4-git-send-email-blanham@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1313614076-28878-1-git-send-email-blanham@gmail.com> References: <1313614076-28878-1-git-send-email-blanham@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.173 Cc: Laurent Vivier Subject: [Qemu-devel] [PATCH 003/111] linux-user: define default cpu model in configure instead of linux-user/main.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Laurent Vivier Signed-off-by: Laurent Vivier --- configure | 14 ++++++++++++++ linux-user/main.c | 34 +--------------------------------- 2 files changed, 15 insertions(+), 33 deletions(-) diff --git a/configure b/configure index e85d2ca..1b9da9e 100755 --- a/configure +++ b/configure @@ -3145,6 +3145,7 @@ target_dir="$target" config_target_mak=$target_dir/config-target.mak target_arch2=`echo $target | cut -d '-' -f 1` target_bigendian="no" +target_default_cpu="any" case "$target_arch2" in armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus) @@ -3221,11 +3222,13 @@ TARGET_ABI_DIR="" case "$target_arch2" in i386) target_phys_bits=64 + target_default_cpu="qemu32" ;; x86_64) TARGET_BASE_ARCH=i386 target_phys_bits=64 target_long_alignment=8 + target_default_cpu="qemu64" ;; alpha) target_phys_bits=64 @@ -3268,12 +3271,14 @@ case "$target_arch2" in echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak target_nptl="yes" target_phys_bits=64 + target_default_cpu="24Kf" ;; mipsn32|mipsn32el) TARGET_ARCH=mipsn32 TARGET_BASE_ARCH=mips echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak target_phys_bits=64 + target_default_cpu="20Kc" ;; mips64|mips64el) TARGET_ARCH=mips64 @@ -3281,12 +3286,14 @@ case "$target_arch2" in echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak target_phys_bits=64 target_long_alignment=8 + target_default_cpu="20Kc" ;; ppc) gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" target_phys_bits=32 target_nptl="yes" target_libs_softmmu="$fdt_libs" + target_default_cpu="750" ;; ppcemb) TARGET_BASE_ARCH=ppc @@ -3295,6 +3302,7 @@ case "$target_arch2" in target_phys_bits=64 target_nptl="yes" target_libs_softmmu="$fdt_libs" + target_default_cpu="750" ;; ppc64) TARGET_BASE_ARCH=ppc @@ -3303,6 +3311,7 @@ case "$target_arch2" in target_phys_bits=64 target_long_alignment=8 target_libs_softmmu="$fdt_libs" + target_default_cpu="970fx" ;; ppc64abi32) TARGET_ARCH=ppc64 @@ -3312,6 +3321,7 @@ case "$target_arch2" in gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" target_phys_bits=64 target_libs_softmmu="$fdt_libs" + target_default_cpu="750" ;; sh4|sh4eb) TARGET_ARCH=sh4 @@ -3321,11 +3331,13 @@ case "$target_arch2" in ;; sparc) target_phys_bits=64 + target_default_cpu="Fujitsu MB86904" ;; sparc64) TARGET_BASE_ARCH=sparc target_phys_bits=64 target_long_alignment=8 + target_default_cpu="TI UltraSparc II" ;; sparc32plus) TARGET_ARCH=sparc64 @@ -3333,6 +3345,7 @@ case "$target_arch2" in TARGET_ABI_DIR=sparc echo "TARGET_ABI32=y" >> $config_target_mak target_phys_bits=64 + target_default_cpu="Fujitsu MB86904" ;; s390x) target_nptl="yes" @@ -3351,6 +3364,7 @@ echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak +echo "TARGET_DEFAULT_CPU=\"$target_default_cpu\"" >> $config_target_mak echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak target_arch_name="`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`" echo "TARGET_$target_arch_name=y" >> $config_target_mak diff --git a/linux-user/main.c b/linux-user/main.c index 8e15474..68b5681 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3083,39 +3083,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_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();