From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: [PATCH 09/10] cris: replace code inside ifdef with generic function Date: Fri, 25 Apr 2008 00:23:09 -0300 Message-ID: <1209093821535-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> <12090938091281-git-send-email-gcosta@redhat.com> <12090938123024-git-send-email-gcosta@redhat.com> <12090938153388-git-send-email-gcosta@redhat.com> <12090938183381-git-send-email-gcosta@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, avi@qumranet.com To: qemu-devel@nongnu.org Return-path: In-Reply-To: <12090938183381-git-send-email-gcosta@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org 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-cris/translate.c | 6 ++++++ translate-all.c | 2 +- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/target-cris/translate.c b/target-cris/translate.c index 5769175..e522678 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -2701,3 +2701,9 @@ void cpu_reset (CPUCRISState *env) memset(env, 0, offsetof(CPUCRISState, breakpoints)); tlb_flush(env, 1); } + +void gen_pc_load(CPUState *env, struct TranslationBlock *tb, + unsigned long searched_pc, int pc_pos, void *puc) +{ + env->pregs[PR_ERP] = gen_opc_pc[pc_pos]; +} diff --git a/translate-all.c b/translate-all.c index 401969c..3afb656 100644 --- a/translate-all.c +++ b/translate-all.c @@ -210,7 +210,7 @@ int cpu_restore_state(TranslationBlock *tb, #elif defined(TARGET_SH4) gen_pc_load(env, tb, searched_pc, j, puc); #elif defined(TARGET_CRIS) - env->pregs[PR_ERP] = gen_opc_pc[j]; + gen_pc_load(env, tb, searched_pc, j, puc); #endif #ifdef CONFIG_PROFILER -- 1.5.0.6 ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone