From nobody Wed Nov 5 15:57:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1497279377992106.79365252117191; Mon, 12 Jun 2017 07:56:17 -0700 (PDT) Received: from localhost ([::1]:38515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKQlM-0000vO-Ln for importer@patchew.org; Mon, 12 Jun 2017 10:56:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKQji-0008KA-HK for qemu-devel@nongnu.org; Mon, 12 Jun 2017 10:54:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKQje-0000TM-HU for qemu-devel@nongnu.org; Mon, 12 Jun 2017 10:54:34 -0400 Received: from roura.ac.upc.edu ([147.83.33.10]:60897 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKQje-0000TE-4C; Mon, 12 Jun 2017 10:54:30 -0400 Received: from correu-2.ac.upc.es (correu-2.ac.upc.es [147.83.30.92]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id v5CEsOSx025673; Mon, 12 Jun 2017 16:54:24 +0200 Received: from localhost (unknown [132.68.137.174]) by correu-2.ac.upc.es (Postfix) with ESMTPSA id 5560A1339; Mon, 12 Jun 2017 16:54:18 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Mon, 12 Jun 2017 17:54:17 +0300 Message-Id: <149727925691.28532.17011173936628331941.stgit@frigg.lan> X-Mailer: git-send-email 2.11.0 In-Reply-To: <149727922719.28532.11985025310576184920.stgit@frigg.lan> References: <149727922719.28532.11985025310576184920.stgit@frigg.lan> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id v5CEsOSx025673 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 v6 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 , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Temporarily redefine DISAS_* values based on DJ_TARGET. They should disappear as targets get ported to the generic framework. Signed-off-by: Llu=C3=ADs Vilanova --- include/exec/exec-all.h | 11 +++++++---- target/arm/translate.h | 19 ++++++++++--------- target/cris/translate.c | 3 ++- target/m68k/translate.c | 3 ++- target/s390x/translate.c | 3 ++- target/unicore32/translate.c | 3 ++- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 1ec7637170..6ad31a8b6f 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 =20 /* 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 analyze= d */ +#define DISAS_JUMP (DJ_TARGET + 0) /* only pc was modified dynamicall= y */ +#define DISAS_UPDATE (DJ_TARGET + 1) /* cpu state was modified dynamica= lly */ +#define DISAS_TB_JUMP (DJ_TARGET + 2) /* only pc was modified statically= */ +#define DISAS_TARGET (DJ_TARGET + 3) /* base for target-specific values= */ =20 #include "qemu/log.h" =20 diff --git a/target/arm/translate.h b/target/arm/translate.h index 15d383d9af..e42fdbe61c 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -120,29 +120,30 @@ static void disas_set_insn_syndrome(DisasContext *s, = uint32_t syn) } =20 /* target-specific extra values for is_jmp */ +/* TODO: rename as DJ_* when transitioning this target to generic translat= ion */ /* 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) /* M profile branch which might be an exception return (and so needs * custom end-of-TB code) */ -#define DISAS_BX_EXCRET 11 +#define DISAS_BX_EXCRET (DISAS_TARGET + 7) /* For instructions which want an immediate exit to the main loop, * as opposed to attempting to use lookup_and_goto_ptr. */ -#define DISAS_EXIT 12 +#define DISAS_EXIT (DISAS_TARGET + 8) =20 #ifdef TARGET_AARCH64 void a64_translate_init(void); diff --git a/target/cris/translate.c b/target/cris/translate.c index 35931e7061..85916196fc 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();}) =20 -#define DISAS_SWI 5 +/* TODO: rename as DJ_* when transitioning this target to generic translat= ion */ +#define DISAS_SWI (DISAS_TARGET + 0) =20 /* Used by the decoder. */ #define EXTRACT_FIELD(src, start, end) \ diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 0a3372818c..3a0cb6227f 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -190,7 +190,8 @@ static void do_writebacks(DisasContext *s) } } =20 -#define DISAS_JUMP_NEXT 4 +/* TODO: rename as DJ_* when transitioning this target to generic translat= ion */ +#define DISAS_JUMP_NEXT (DISAS_TARGET + 0) =20 #if defined(CONFIG_USER_ONLY) #define IS_USER(s) 1 diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 2a17b3d7aa..98365bd29c 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -76,7 +76,8 @@ typedef struct { } u; } DisasCompare; =20 -#define DISAS_EXCP 4 +/* TODO: rename as DJ_* when transitioning this target to generic translat= ion */ +#define DISAS_EXCP (DISAS_TARGET + 0) =20 #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 494ed58c10..374b6bb079 100644 --- a/target/unicore32/translate.c +++ b/target/unicore32/translate.c @@ -45,9 +45,10 @@ typedef struct DisasContext { #define IS_USER(s) 1 #endif =20 +/* TODO: rename as DJ_* when transitioning this target to generic translat= ion */ /* 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) =20 static TCGv_env cpu_env; static TCGv_i32 cpu_R[32];