From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO739-0006Fu-GT for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:56:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WO731-0006Ec-R0 for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:55:59 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59843 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO731-0006E1-3a for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:55:51 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 13 Mar 2014 15:54:56 +0100 Message-Id: <1394722501-32326-54-git-send-email-afaerber@suse.de> In-Reply-To: <1394722501-32326-1-git-send-email-afaerber@suse.de> References: <1394722501-32326-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL for-2.0-rc0 53/58] target-cris: Replace DisasContext::env field with CRISCPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , =?UTF-8?q?Andreas=20F=C3=A4rber?= This cleans up repeated cris_env_get_cpu() for cpu_abort(). Signed-off-by: Andreas F=C3=A4rber --- target-cris/translate.c | 16 ++++++++-------- target-cris/translate_v10.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/target-cris/translate.c b/target-cris/translate.c index 3e26b9b..724f920 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -74,7 +74,7 @@ static TCGv env_pc; =20 /* This is the state at translation time. */ typedef struct DisasContext { - CPUCRISState *env; + CRISCPU *cpu; target_ulong pc, ppc; =20 /* Decoder. */ @@ -129,7 +129,7 @@ static void gen_BUG(DisasContext *dc, const char *fil= e, int line) { printf("BUG: pc=3D%x %s %d\n", dc->pc, file, line); qemu_log("BUG: pc=3D%x %s %d\n", dc->pc, file, line); - cpu_abort(CPU(cris_env_get_cpu(dc->env)), "%s:%d\n", file, line); + cpu_abort(CPU(dc->cpu), "%s:%d\n", file, line); } =20 static const char *regnames[] =3D @@ -272,7 +272,7 @@ static int cris_fetch(CPUCRISState *env, DisasContext= *dc, uint32_t addr, break; } default: - cpu_abort(CPU(cris_env_get_cpu(dc->env)), "Invalid fetch size %d= \n", size); + cpu_abort(CPU(dc->cpu), "Invalid fetch size %d\n", size); break; } return r; @@ -1125,7 +1125,7 @@ static inline void cris_prepare_jmp (DisasContext *= dc, unsigned int type) =20 static void gen_load64(DisasContext *dc, TCGv_i64 dst, TCGv addr) { - int mem_index =3D cpu_mmu_index(dc->env); + int mem_index =3D cpu_mmu_index(&dc->cpu->env); =20 /* If we get a fault on a delayslot we must keep the jmp state in the cpu-state to be able to re-execute the jmp. */ @@ -1139,7 +1139,7 @@ static void gen_load64(DisasContext *dc, TCGv_i64 d= st, TCGv addr) static void gen_load(DisasContext *dc, TCGv dst, TCGv addr,=20 unsigned int size, int sign) { - int mem_index =3D cpu_mmu_index(dc->env); + int mem_index =3D cpu_mmu_index(&dc->cpu->env); =20 /* If we get a fault on a delayslot we must keep the jmp state in the cpu-state to be able to re-execute the jmp. */ @@ -1154,7 +1154,7 @@ static void gen_load(DisasContext *dc, TCGv dst, TC= Gv addr, static void gen_store (DisasContext *dc, TCGv addr, TCGv val, unsigned int size) { - int mem_index =3D cpu_mmu_index(dc->env); + int mem_index =3D cpu_mmu_index(&dc->cpu->env); =20 /* If we get a fault on a delayslot we must keep the jmp state in the cpu-state to be able to re-execute the jmp. */ @@ -3170,7 +3170,7 @@ gen_intermediate_code_internal(CRISCPU *cpu, Transl= ationBlock *tb, * delayslot, like in real hw. */ pc_start =3D tb->pc & ~1; - dc->env =3D env; + dc->cpu =3D cpu; dc->tb =3D tb; =20 gen_opc_end =3D tcg_ctx.gen_opc_buf + OPC_MAX_SIZE; @@ -3391,7 +3391,7 @@ gen_intermediate_code_internal(CRISCPU *cpu, Transl= ationBlock *tb, #if !DISAS_CRIS if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) { log_target_disas(env, pc_start, dc->pc - pc_start, - dc->env->pregs[PR_VR]); + env->pregs[PR_VR]); qemu_log("\nisize=3D%d osize=3D%td\n", dc->pc - pc_start, tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf= ); } diff --git a/target-cris/translate_v10.c b/target-cris/translate_v10.c index 3f27456..2ad2b14 100644 --- a/target-cris/translate_v10.c +++ b/target-cris/translate_v10.c @@ -96,7 +96,7 @@ static void gen_store_v10_conditional(DisasContext *dc,= TCGv addr, TCGv val, static void gen_store_v10(DisasContext *dc, TCGv addr, TCGv val, unsigned int size) { - int mem_index =3D cpu_mmu_index(dc->env); + int mem_index =3D cpu_mmu_index(&dc->cpu->env); =20 /* If we get a fault on a delayslot we must keep the jmp state in the cpu-state to be able to re-execute the jmp. */ @@ -340,7 +340,7 @@ static unsigned int dec10_quick_imm(DisasContext *dc) default: LOG_DIS("pc=3D%x mode=3D%x quickimm %d r%d r%d\n", dc->pc, dc->mode, dc->opcode, dc->src, dc->dst); - cpu_abort(CPU(cris_env_get_cpu(dc->env)), "Unhandled quickim= m\n"); + cpu_abort(CPU(dc->cpu), "Unhandled quickimm\n"); break; } return 2; @@ -651,7 +651,7 @@ static unsigned int dec10_reg(DisasContext *dc) case 2: tmp =3D 1; break; case 1: tmp =3D 0; break; default: - cpu_abort(CPU(cris_env_get_cpu(dc->env)), "Unhan= dled BIAP"); + cpu_abort(CPU(dc->cpu), "Unhandled BIAP"); break; } =20 @@ -669,7 +669,7 @@ static unsigned int dec10_reg(DisasContext *dc) default: LOG_DIS("pc=3D%x reg %d r%d r%d\n", dc->pc, dc->opcode, dc->src, dc->dst); - cpu_abort(CPU(cris_env_get_cpu(dc->env)), "Unhandled opc= ode"); + cpu_abort(CPU(dc->cpu), "Unhandled opcode"); break; } } else { @@ -745,7 +745,7 @@ static unsigned int dec10_reg(DisasContext *dc) default: LOG_DIS("pc=3D%x reg %d r%d r%d\n", dc->pc, dc->opcode, dc->src, dc->dst); - cpu_abort(CPU(cris_env_get_cpu(dc->env)), "Unhandled opc= ode"); + cpu_abort(CPU(dc->cpu), "Unhandled opcode"); break; } } @@ -1006,7 +1006,7 @@ static int dec10_bdap_m(CPUCRISState *env, DisasCon= text *dc, int size) if (!dc->postinc && (dc->ir & (1 << 11))) { int simm =3D dc->ir & 0xff; =20 - /* cpu_abort(dc->env, "Unhandled opcode"); */ + /* cpu_abort(CPU(dc->cpu), "Unhandled opcode"); */ /* sign extended. */ simm =3D (int8_t)simm; =20 @@ -1105,7 +1105,7 @@ static unsigned int dec10_ind(CPUCRISState *env, Di= sasContext *dc) default: LOG_DIS("pc=3D%x var-ind.%d %d r%d r%d\n", dc->pc, size, dc->opcode, dc->src, dc->dst); - cpu_abort(CPU(cris_env_get_cpu(dc->env)), "Unhandled opc= ode"); + cpu_abort(CPU(dc->cpu), "Unhandled opcode"); break; } return insn_len; @@ -1198,7 +1198,7 @@ static unsigned int dec10_ind(CPUCRISState *env, Di= sasContext *dc) break; default: LOG_DIS("ERROR pc=3D%x opcode=3D%d\n", dc->pc, dc->opcode); - cpu_abort(CPU(cris_env_get_cpu(dc->env)), "Unhandled opcode"= ); + cpu_abort(CPU(dc->cpu), "Unhandled opcode"); break; } =20 --=20 1.8.4.5