From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JpEcI-0006Th-8f for qemu-devel@nongnu.org; Thu, 24 Apr 2008 23:28:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JpEcH-0006SW-4n for qemu-devel@nongnu.org; Thu, 24 Apr 2008 23:28:53 -0400 Received: from [199.232.76.173] (port=42087 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JpEcG-0006SL-Q9 for qemu-devel@nongnu.org; Thu, 24 Apr 2008 23:28:52 -0400 Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JpEcG-0000r7-EI for qemu-devel@nongnu.org; Thu, 24 Apr 2008 23:28:52 -0400 From: Glauber Costa Date: Fri, 25 Apr 2008 00:23:05 -0300 Message-Id: <12090938091281-git-send-email-gcosta@redhat.com> In-Reply-To: <12090938052239-git-send-email-gcosta@redhat.com> References: <12090937903925-git-send-email-gcosta@redhat.com> <12090937962588-git-send-email-gcosta@redhat.com> <12090937991633-git-send-email-gcosta@redhat.com> <12090938023558-git-send-email-gcosta@redhat.com> <12090938052239-git-send-email-gcosta@redhat.com> Subject: [Qemu-devel] [PATCH 05/10] m68k: replace code inside ifdef with generic function Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm-devel@lists.sourceforge.net this patch replaced code inside specific ifdef in translate-all.c with a generic architecture-implemented function. This leads to a cleaner and more modular code in the generic part. --- target-m68k/translate.c | 5 +++++ translate-all.c | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 39816f4..36e27a1 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -3280,3 +3280,8 @@ void cpu_dump_state(CPUState *env, FILE *f, cpu_fprintf (f, "FPRESULT = %12g\n", *(double *)&env->fp_result); } +void gen_pc_load(CPUState *env, TranslationBlock *tb, + unsigned long searched_pc, int pc_pos, void *puc) +{ + env->pc = gen_opc_pc[pc_pos]; +} diff --git a/translate-all.c b/translate-all.c index 66f03e1..5e63978 100644 --- a/translate-all.c +++ b/translate-all.c @@ -202,7 +202,7 @@ int cpu_restore_state(TranslationBlock *tb, #elif defined(TARGET_PPC) gen_pc_load(env, tb, searched_pc, j, puc); #elif defined(TARGET_M68K) - env->pc = gen_opc_pc[j]; + gen_pc_load(env, tb, searched_pc, j, puc); #elif defined(TARGET_MIPS) env->PC[env->current_tc] = gen_opc_pc[j]; env->hflags &= ~MIPS_HFLAG_BMASK; -- 1.5.0.6