From patchwork Wed Dec 28 15:45:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 9490473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A835162AB0 for ; Wed, 28 Dec 2016 15:49:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91579262FF for ; Wed, 28 Dec 2016 15:49:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8373C26490; Wed, 28 Dec 2016 15:49:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0C9F1262FF for ; Wed, 28 Dec 2016 15:49:45 +0000 (UTC) Received: from localhost ([::1]:59746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMGU4-0003r4-2v for patchwork-qemu-devel@patchwork.kernel.org; Wed, 28 Dec 2016 10:49:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMGPh-0000Yj-Np for qemu-devel@nongnu.org; Wed, 28 Dec 2016 10:45:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMGPf-0004tI-39 for qemu-devel@nongnu.org; Wed, 28 Dec 2016 10:45:13 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:60264) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMGPe-0004sw-MM; Wed, 28 Dec 2016 10:45:11 -0500 Received: from gw-2.ac.upc.es (gw-2.ac.upc.es [147.83.30.8]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id uBSFj5P4010565; Wed, 28 Dec 2016 16:45:05 +0100 Received: from localhost (unknown [84.88.51.85]) by gw-2.ac.upc.es (Postfix) with ESMTPSA id C4D69A6; Wed, 28 Dec 2016 16:45:04 +0100 (CET) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Wed, 28 Dec 2016 16:45:04 +0100 Message-Id: <148293990447.31645.4730981416477941777.stgit@fimbulvetr.bsc.es> X-Mailer: git-send-email 2.11.0 In-Reply-To: <148293987753.31645.8166717498506500137.stgit@fimbulvetr.bsc.es> References: <148293987753.31645.8166717498506500137.stgit@fimbulvetr.bsc.es> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id uBSFj5P4010565 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 147.83.33.10 Subject: [Qemu-devel] [PATCH v4 4/6] target: [tcg] Redefine DISAS_* onto the generic translation framework (DJ_*) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Peter Crosthwaite , Laurent Vivier , Alexander Graf , "open list:ARM" , "Edgar E. Iglesias" , Paolo Bonzini , Guan Xuetao , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Temporarily redefine DISAS_* values based on DJ_TARGET. They should disappear as targets get ported to the generic framework. Signed-off-by: LluĂ­s Vilanova --- include/exec/exec-all.h | 11 +++++++---- target-arm/translate.h | 15 ++++++++------- target-cris/translate.c | 3 ++- target-m68k/translate.c | 3 ++- target-s390x/translate.c | 3 ++- target-unicore32/translate.c | 3 ++- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 0e45e1aedc..169da5ebe0 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -36,10 +36,13 @@ typedef ram_addr_t tb_page_addr_t; #endif /* is_jmp field values */ -#define DISAS_NEXT 0 /* next instruction can be analyzed */ -#define DISAS_JUMP 1 /* only pc was modified dynamically */ -#define DISAS_UPDATE 2 /* cpu state was modified dynamically */ -#define DISAS_TB_JUMP 3 /* only pc was modified statically */ +/* TODO: delete after all targets are transitioned to generic translation */ +#include "exec/translate-all_template.h" +#define DISAS_NEXT DJ_NEXT /* next instruction can be analyzed */ +#define DISAS_JUMP (DJ_TARGET + 0) /* only pc was modified dynamically */ +#define DISAS_UPDATE (DJ_TARGET + 1) /* cpu state was modified dynamically */ +#define DISAS_TB_JUMP (DJ_TARGET + 2) /* only pc was modified statically */ +#define DISAS_TARGET (DJ_TARGET + 3) /* base for target-specific values */ #include "qemu/log.h" diff --git a/target-arm/translate.h b/target-arm/translate.h index 285e96f087..3dd4c4578e 100644 --- a/target-arm/translate.h +++ b/target-arm/translate.h @@ -105,21 +105,22 @@ static inline int default_exception_el(DisasContext *s) } /* target-specific extra values for is_jmp */ +/* TODO: rename as DJ_* when transitioning this target to generic translation */ /* These instructions trap after executing, so the A32/T32 decoder must * defer them until after the conditional execution state has been updated. * WFI also needs special handling when single-stepping. */ -#define DISAS_WFI 4 -#define DISAS_SWI 5 +#define DISAS_WFI (DISAS_TARGET + 0) +#define DISAS_SWI (DISAS_TARGET + 1) /* For instructions which unconditionally cause an exception we can skip * emitting unreachable code at the end of the TB in the A64 decoder */ -#define DISAS_EXC 6 +#define DISAS_EXC (DISAS_TARGET + 2) /* WFE */ -#define DISAS_WFE 7 -#define DISAS_HVC 8 -#define DISAS_SMC 9 -#define DISAS_YIELD 10 +#define DISAS_WFE (DISAS_TARGET + 3) +#define DISAS_HVC (DISAS_TARGET + 4) +#define DISAS_SMC (DISAS_TARGET + 5) +#define DISAS_YIELD (DISAS_TARGET + 6) #ifdef TARGET_AARCH64 void a64_translate_init(void); diff --git a/target-cris/translate.c b/target-cris/translate.c index ebcf7863bf..001714c7c1 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -50,7 +50,8 @@ #define BUG() (gen_BUG(dc, __FILE__, __LINE__)) #define BUG_ON(x) ({if (x) BUG();}) -#define DISAS_SWI 5 +/* TODO: rename as DJ_* when transitioning this target to generic translation */ +#define DISAS_SWI (DISAS_TARGET + 0) /* Used by the decoder. */ #define EXTRACT_FIELD(src, start, end) \ diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 6da6f2b51b..b2b0555c80 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -143,7 +143,8 @@ typedef struct DisasContext { int done_mac; } DisasContext; -#define DISAS_JUMP_NEXT 4 +/* TODO: rename as DJ_* when transitioning this target to generic translation */ +#define DISAS_JUMP_NEXT (DISAS_TARGET + 0) #if defined(CONFIG_USER_ONLY) #define IS_USER(s) 1 diff --git a/target-s390x/translate.c b/target-s390x/translate.c index a3992dae5a..75787e89e3 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -74,7 +74,8 @@ typedef struct { } u; } DisasCompare; -#define DISAS_EXCP 4 +/* TODO: rename as DJ_* when transitioning this target to generic translation */ +#define DISAS_EXCP (DISAS_TARGET + 0) #ifdef DEBUG_INLINE_BRANCHES static uint64_t inline_branch_hit[CC_OP_MAX]; diff --git a/target-unicore32/translate.c b/target-unicore32/translate.c index 39eaa76b50..de0a64e1c8 100644 --- a/target-unicore32/translate.c +++ b/target-unicore32/translate.c @@ -45,9 +45,10 @@ typedef struct DisasContext { #define IS_USER(s) 1 #endif +/* TODO: rename as DJ_* when transitioning this target to generic translation */ /* These instructions trap after executing, so defer them until after the conditional executions state has been updated. */ -#define DISAS_SYSCALL 5 +#define DISAS_SYSCALL (DISAS_TARGET + 0) static TCGv_env cpu_env; static TCGv_i32 cpu_R[32];