From patchwork Tue Oct 25 14:50:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 9394655 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 71D326077F for ; Tue, 25 Oct 2016 14:58:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64907293F8 for ; Tue, 25 Oct 2016 14:58:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 592972944D; Tue, 25 Oct 2016 14:58:39 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 A3796293F8 for ; Tue, 25 Oct 2016 14:58:38 +0000 (UTC) Received: from localhost ([::1]:55226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz3BU-0006Z9-OC for patchwork-qemu-devel@patchwork.kernel.org; Tue, 25 Oct 2016 10:58:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz33r-0008UP-LH for qemu-devel@nongnu.org; Tue, 25 Oct 2016 10:50:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bz33n-0005zF-Dm for qemu-devel@nongnu.org; Tue, 25 Oct 2016 10:50:43 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:50825) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bz33n-0005xp-2k for qemu-devel@nongnu.org; Tue, 25 Oct 2016 10:50:39 -0400 Received: from Quad.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0Mgrgq-1cKxej3yd6-00M3W5; Tue, 25 Oct 2016 16:50:34 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 25 Oct 2016 16:50:10 +0200 Message-Id: <1477407021-30755-13-git-send-email-laurent@vivier.eu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477407021-30755-1-git-send-email-laurent@vivier.eu> References: <1477407021-30755-1-git-send-email-laurent@vivier.eu> X-Provags-ID: V03:K0:/GMogT00oQz9/hWMVQ4q0D+oZVLRvppwqAL727f71pL4pePVw+p Au2iA+X+sa6fpnCBUKfDox4r3NA+OpE9Y0nU3/eHP3qEAr01arHj8INr77H+AhmQg/r1koU 2G1tt90H8InJ+9sdPEhqMBbdNpaHiVQP19CFWVXBzXjD+NLVdIM4u9PeYjOyMVURTf1/GV7 IbKq/R1SiT798rqobv2WA== X-UI-Out-Filterresults: notjunk:1; V01:K0:pKYSYFuKY+I=:w2LhGFD32lP0j588UAzynW EhAQrlPNy2l6D8ucDq1tSHtL2kY6cFTZVMKMz8zF5Tsr9PWexKdDe/YnCaTmkTvrigXXPbxnc ZmH9UvOmK9wG4rZDzpu4cl6JBue+6g835tDLa+FEp65tFjfLEYOY+qsEhX+vNytvwNAFuWmfo V9SJxg7om18H7ODXTJBludUHQosGaemjOJPHbcr7HDaRW9sDIiP5fcwu+m4CBdoth+WsP3xNE SaqzyTJ9wxBUIqK2CRcSUKV+RFNdPwoidkE3BSVUgOVCgPhUlLTXM30gNyK76VryN5HOywQ1u BO+1G/34dqCW8YsZ2JH5agrlu0aObeb1ykOyh0yb5FMJ8RMlCVVodck4HLR/lifIdRluIeO8O IQOrKCaMgRHbB7GB6t7//XqH+onxQhAgvv0APYqdIu/iQGug6fMQ7/4NgXavPezsSX3B3xpPQ A47h3QsNlayTn2XL3brwmZiFUVRWq+nxvUuRE2C6aWzwtOf1hLx22nEgnvXZRPZlcffTz7v2i 9+lFQ/4ezFye7NgNKlNukSNZL7AWXxg3JzMQSy3D15cu6l9lAhSQh9pqqJKdgtKtR1RJAqSUy Airl1ed1v2Ivb6bsKG9j9YDLj2G/l4tfSHeG4G9m3LcHQYhYuhBnlFrKR3Z31MpPOPq+NHyun vIDvyW7U1efG8Ys3GUff3sDQBO+pnSw+mMc3od/IYutbE5oMLXKiMfpcbR5P5QLYPr1E= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.133 Subject: [Qemu-devel] [PATCH 12/23] target-m68k: remove m68k_cpu_exec_enter() and m68k_cpu_exec_exit() 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: Laurent Vivier , gerg@uclinux.org, schwab@linux-m68k.org, agraf@suse.de, Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Update cc_op directly from tcg_gen_insn_start() and restore_state_to_opc() Copied from target-i386 Signed-off-by: Laurent Vivier --- cpu-exec.c | 6 ------ target-m68k/cpu.c | 2 -- target-m68k/cpu.h | 4 +--- target-m68k/helper.c | 20 -------------------- target-m68k/translate.c | 6 +++++- 5 files changed, 6 insertions(+), 32 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index e114fcd..e1bc368 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -151,12 +151,6 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb) && qemu_log_in_addr_range(itb->pc)) { #if defined(TARGET_I386) log_cpu_state(cpu, CPU_DUMP_CCOP); -#elif defined(TARGET_M68K) - /* ??? Should not modify env state for dumping. */ - cpu_m68k_flush_flags(env, env->cc_op); - env->cc_op = CC_OP_FLAGS; - env->sr = (env->sr & 0xffe0) | env->cc_dest | (env->cc_x << 4); - log_cpu_state(cpu, 0); #else log_cpu_state(cpu, 0); #endif diff --git a/target-m68k/cpu.c b/target-m68k/cpu.c index f925e26..ef02d9f 100644 --- a/target-m68k/cpu.c +++ b/target-m68k/cpu.c @@ -281,8 +281,6 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) #else cc->get_phys_page_debug = m68k_cpu_get_phys_page_debug; #endif - cc->cpu_exec_enter = m68k_cpu_exec_enter; - cc->cpu_exec_exit = m68k_cpu_exec_exit; cc->disas_set_info = m68k_cpu_disas_set_info; cc->gdb_num_core_regs = 18; diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h index 18b6930..f055ef6 100644 --- a/target-m68k/cpu.h +++ b/target-m68k/cpu.h @@ -61,6 +61,7 @@ #define EXCP_HALT_INSN 0x101 #define NB_MMU_MODES 2 +#define TARGET_INSN_START_EXTRA_WORDS 1 typedef struct CPUM68KState { uint32_t dregs[8]; @@ -149,9 +150,6 @@ hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int m68k_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg); int m68k_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); -void m68k_cpu_exec_enter(CPUState *cs); -void m68k_cpu_exec_exit(CPUState *cs); - void m68k_tcg_init(void); void m68k_cpu_init_gdb(M68kCPU *cpu); M68kCPU *cpu_m68k_init(const char *cpu_model); diff --git a/target-m68k/helper.c b/target-m68k/helper.c index dc55a7a..92d1ded 100644 --- a/target-m68k/helper.c +++ b/target-m68k/helper.c @@ -922,23 +922,3 @@ void HELPER(set_mac_extu)(CPUM68KState *env, uint32_t val, uint32_t acc) res |= (uint64_t)(val & 0xffff0000) << 16; env->macc[acc + 1] = res; } - -void m68k_cpu_exec_enter(CPUState *cs) -{ - M68kCPU *cpu = M68K_CPU(cs); - CPUM68KState *env = &cpu->env; - - env->cc_op = CC_OP_FLAGS; - env->cc_dest = env->sr & 0xf; - env->cc_x = (env->sr >> 4) & 1; -} - -void m68k_cpu_exec_exit(CPUState *cs) -{ - M68kCPU *cpu = M68K_CPU(cs); - CPUM68KState *env = &cpu->env; - - cpu_m68k_flush_flags(env, env->cc_op); - env->cc_op = CC_OP_FLAGS; - env->sr = (env->sr & 0xffe0) | env->cc_dest | (env->cc_x << 4); -} diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 650c141..681f3a8 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -3025,7 +3025,7 @@ void gen_intermediate_code(CPUM68KState *env, TranslationBlock *tb) do { pc_offset = dc->pc - pc_start; gen_throws_exception = NULL; - tcg_gen_insn_start(dc->pc); + tcg_gen_insn_start(dc->pc, dc->cc_op); num_insns++; if (unlikely(cpu_breakpoint_test(cs, dc->pc, BP_ANY))) { @@ -3119,5 +3119,9 @@ void m68k_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf, void restore_state_to_opc(CPUM68KState *env, TranslationBlock *tb, target_ulong *data) { + int cc_op = data[1]; env->pc = data[0]; + if (cc_op != CC_OP_DYNAMIC) { + env->cc_op = cc_op; + } }