From patchwork Sat May 14 19:41:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 95581 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 AD69CB6EF7 for ; Sun, 15 May 2011 05:41:53 +1000 (EST) Received: from localhost ([::1]:46189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLKil-0007Su-5B for incoming@patchwork.ozlabs.org; Sat, 14 May 2011 15:41:51 -0400 Received: from eggs.gnu.org ([140.186.70.92]:41720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLKib-0007Sn-BR for qemu-devel@nongnu.org; Sat, 14 May 2011 15:41:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QLKiZ-0003KW-M3 for qemu-devel@nongnu.org; Sat, 14 May 2011 15:41:41 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:55856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLKiZ-0003KP-FE for qemu-devel@nongnu.org; Sat, 14 May 2011 15:41:39 -0400 Received: by qyk10 with SMTP id 10so2072646qyk.4 for ; Sat, 14 May 2011 12:41:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=E2iR9Q0uj2Y1QYRvoqEHe4vB17tWXt24C8Ulb+qgByY=; b=AbXWSZqY+xUQEQGrevCtzXZmDFoX9OifHVdYFQfXPejnop2K8fOqWCOgPMBYKmz9QO Fxd6dCDpTqCtuXDRFh7NPULZPWAL5Ik0ad+MC31SpuYV0ebBMWLpvfo4ix0J+bJIeZO4 8WIogOWnT060JYQRMUwOE6VSp3FPzoTn37/Co= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=n7StgW7wTOrk4QsIp7iz3MsFT9dUVuUEIp1HJm9m3F9XmNp+RnpNjRI8k92Q4HXcz+ 2k7Ovd4yGMbKBAfuY23sRsPhJGWaPUDmm4/JZrTZ9ai1cCGHqCNfwJ5Sc4VoeGeE7M83 zJBy6FKyd1nouC6r7vK0dEpgX3ZApsCtDnkBk= Received: by 10.224.189.20 with SMTP id dc20mr1325046qab.287.1305402099067; Sat, 14 May 2011 12:41:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.54.148 with HTTP; Sat, 14 May 2011 12:41:19 -0700 (PDT) From: Blue Swirl Date: Sat, 14 May 2011 22:41:19 +0300 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.216.180 Subject: [Qemu-devel] [PATCH 08/11] Add CONFIG_TARGET_NEEDS_AREG0 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 In the future, targets may avoid using HELPER_CFLAGS when they are no longer using the global CPUState register variable, env a.k.a. AREG0. Signed-off-by: Blue Swirl --- Makefile.target | 4 +++- configure | 6 ++++++ dyngen-exec.h | 2 ++ tcg/arm/tcg-target.h | 4 ++++ tcg/hppa/tcg-target.h | 4 ++++ tcg/i386/tcg-target.h | 4 ++++ tcg/ia64/tcg-target.h | 4 ++++ tcg/mips/tcg-target.h | 4 ++++ tcg/ppc/tcg-target.h | 4 ++++ tcg/ppc64/tcg-target.h | 4 ++++ tcg/s390/tcg-target.h | 4 ++++ tcg/sparc/tcg-target.h | 4 ++++ 12 files changed, 47 insertions(+), 1 deletions(-) From 0d7764b3fe5f13c79b8ee6b81871a2ecfab2adcf Mon Sep 17 00:00:00 2001 Message-Id: <0d7764b3fe5f13c79b8ee6b81871a2ecfab2adcf.1305401750.git.blauwirbel@gmail.com> In-Reply-To: <6e21df8e369388a3152dcc7da30431c672e1ee37.1305401750.git.blauwirbel@gmail.com> References: <6e21df8e369388a3152dcc7da30431c672e1ee37.1305401750.git.blauwirbel@gmail.com> From: Blue Swirl Date: Sun, 8 May 2011 16:54:36 +0000 Subject: [PATCH 08/11] Add CONFIG_TARGET_NEEDS_AREG0 In the future, targets may avoid using HELPER_CFLAGS when they are no longer using the global CPUState register variable, env a.k.a. AREG0. Signed-off-by: Blue Swirl --- Makefile.target | 4 +++- configure | 6 ++++++ dyngen-exec.h | 2 ++ tcg/arm/tcg-target.h | 4 ++++ tcg/hppa/tcg-target.h | 4 ++++ tcg/i386/tcg-target.h | 4 ++++ tcg/ia64/tcg-target.h | 4 ++++ tcg/mips/tcg-target.h | 4 ++++ tcg/ppc/tcg-target.h | 4 ++++ tcg/ppc64/tcg-target.h | 4 ++++ tcg/s390/tcg-target.h | 4 ++++ tcg/sparc/tcg-target.h | 4 ++++ 12 files changed, 47 insertions(+), 1 deletions(-) diff --git a/Makefile.target b/Makefile.target index 602d50d..52db0c3 100644 --- a/Makefile.target +++ b/Makefile.target @@ -92,13 +92,15 @@ translate-all.o: translate-all.c cpu.h tcg/tcg.o: cpu.h -# HELPER_CFLAGS is used for all the code compiled with static register +ifeq ($(CONFIG_TARGET_NEEDS_AREG0), y) +# HELPER_CFLAGS is used for all the legacy code compiled with static register # variables %_helper.o cpu-exec.o user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS) # Note: this is a workaround. The real fix is to avoid compiling # cpu_signal_handler() in user-exec.c. signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS) +endif ######################################################### # Linux user emulator target diff --git a/configure b/configure index 3ba6401..1215da2 100755 --- a/configure +++ b/configure @@ -3374,6 +3374,12 @@ if test "$target_bsd_user" = "yes" ; then echo "CONFIG_BSD_USER=y" >> $config_target_mak fi +case "$ARCH" in + *) + echo "CONFIG_TARGET_NEEDS_AREG0=y" >> $config_target_mak + ;; +esac + # generate QEMU_CFLAGS/LDFLAGS for targets cflags="" diff --git a/dyngen-exec.h b/dyngen-exec.h index db00fba..96f85bb 100644 --- a/dyngen-exec.h +++ b/dyngen-exec.h @@ -28,6 +28,7 @@ /* XXX: This may be wrong for 64-bit ILP32 hosts. */ typedef void * host_reg_t; +#ifdef CONFIG_TARGET_NEEDS_AREG0 #if defined(__i386__) #define AREG0 "ebp" #elif defined(__x86_64__) @@ -63,6 +64,7 @@ typedef void * host_reg_t; #else #error unsupported CPU #endif +#endif #define xglue(x, y) x ## y #define glue(x, y) xglue(x, y) diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index d8d7d94..30d4f40 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -75,10 +75,14 @@ enum { #define TCG_TARGET_HAS_GUEST_BASE +#ifdef CONFIG_TARGET_NEEDS_AREG0 enum { /* Note: must be synced with dyngen-exec.h */ TCG_AREG0 = TCG_REG_R7, }; +#else +#error AREG0 free ops not implemented +#endif static inline void flush_icache_range(unsigned long start, unsigned long stop) { diff --git a/tcg/hppa/tcg-target.h b/tcg/hppa/tcg-target.h index a5cc440..5a32fc8 100644 --- a/tcg/hppa/tcg-target.h +++ b/tcg/hppa/tcg-target.h @@ -102,8 +102,12 @@ enum { #define TCG_TARGET_HAS_GUEST_BASE +#ifdef CONFIG_TARGET_NEEDS_AREG0 /* Note: must be synced with dyngen-exec.h */ #define TCG_AREG0 TCG_REG_R17 +#else +#error AREG0 free ops not implemented +#endif static inline void flush_icache_range(unsigned long start, unsigned long stop) { diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index bfafbfc..2579686 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -114,12 +114,16 @@ enum { #define TCG_TARGET_HAS_GUEST_BASE +#ifdef CONFIG_TARGET_NEEDS_AREG0 /* Note: must be synced with dyngen-exec.h */ #if TCG_TARGET_REG_BITS == 64 # define TCG_AREG0 TCG_REG_R14 #else # define TCG_AREG0 TCG_REG_EBP #endif +#else +#error AREG0 free ops not implemented +#endif static inline void flush_icache_range(unsigned long start, unsigned long stop) { diff --git a/tcg/ia64/tcg-target.h b/tcg/ia64/tcg-target.h index e56e88f..8b46d96 100644 --- a/tcg/ia64/tcg-target.h +++ b/tcg/ia64/tcg-target.h @@ -138,8 +138,12 @@ enum { #undef TCG_TARGET_HAS_not_i32 /* xor r1, -1, r3 */ #undef TCG_TARGET_HAS_not_i64 /* xor r1, -1, r3 */ +#ifdef CONFIG_TARGET_NEEDS_AREG0 /* Note: must be synced with dyngen-exec.h */ #define TCG_AREG0 TCG_REG_R7 +#else +#error AREG0 free ops not implemented +#endif /* Guest base is supported */ #define TCG_TARGET_HAS_GUEST_BASE diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index 0028bfa..d9507a4 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -96,8 +96,12 @@ enum { #undef TCG_TARGET_HAS_ext8u_i32 /* andi rt, rs, 0xff */ #undef TCG_TARGET_HAS_ext16u_i32 /* andi rt, rs, 0xffff */ +#ifdef CONFIG_TARGET_NEEDS_AREG0 /* Note: must be synced with dyngen-exec.h */ #define TCG_AREG0 TCG_REG_S0 +#else +#error AREG0 free ops not implemented +#endif /* guest base is supported */ #define TCG_TARGET_HAS_GUEST_BASE diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index a1f8599..037935c 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -93,6 +93,10 @@ enum { #define TCG_TARGET_HAS_nand_i32 #define TCG_TARGET_HAS_nor_i32 +#ifdef CONFIG_TARGET_NEEDS_AREG0 #define TCG_AREG0 TCG_REG_R27 +#else +#error AREG0 free ops not implemented +#endif #define TCG_TARGET_HAS_GUEST_BASE diff --git a/tcg/ppc64/tcg-target.h b/tcg/ppc64/tcg-target.h index 8a6db11..0158c5b 100644 --- a/tcg/ppc64/tcg-target.h +++ b/tcg/ppc64/tcg-target.h @@ -103,7 +103,11 @@ enum { /* #define TCG_TARGET_HAS_nand_i64 */ /* #define TCG_TARGET_HAS_nor_i64 */ +#ifdef CONFIG_TARGET_NEEDS_AREG0 #define TCG_AREG0 TCG_REG_R27 +#else +#error AREG0 free ops not implemented +#endif #define TCG_TARGET_HAS_GUEST_BASE #define TCG_TARGET_EXTEND_ARGS 1 diff --git a/tcg/s390/tcg-target.h b/tcg/s390/tcg-target.h index 4e45cf3..cbc3283 100644 --- a/tcg/s390/tcg-target.h +++ b/tcg/s390/tcg-target.h @@ -99,10 +99,14 @@ typedef enum TCGReg { #define TCG_TARGET_EXTEND_ARGS 1 +#ifdef CONFIG_TARGET_NEEDS_AREG0 enum { /* Note: must be synced with dyngen-exec.h */ TCG_AREG0 = TCG_REG_R10, }; +#else +#error AREG0 free ops not implemented +#endif static inline void flush_icache_range(unsigned long start, unsigned long stop) { diff --git a/tcg/sparc/tcg-target.h b/tcg/sparc/tcg-target.h index df0785e..ea718e0 100644 --- a/tcg/sparc/tcg-target.h +++ b/tcg/sparc/tcg-target.h @@ -129,6 +129,7 @@ enum { // #define TCG_TARGET_HAS_nor_i64 #endif +#ifdef CONFIG_TARGET_NEEDS_AREG0 /* Note: must be synced with dyngen-exec.h */ #ifdef CONFIG_SOLARIS #define TCG_AREG0 TCG_REG_G2 @@ -137,6 +138,9 @@ enum { #else #define TCG_AREG0 TCG_REG_G6 #endif +#else +#error AREG0 free ops not implemented +#endif static inline void flush_icache_range(unsigned long start, unsigned long stop) { -- 1.7.2.5