From 8219314be689f54ff9814e55d619f87b9d66452a Mon Sep 17 00:00:00 2001 From: Lars Persson Date: Thu, 14 Jun 2012 16:23:55 +0200 Subject: cris: Fix NMI-flag handling on crisv10. - The M-flag is encoded in different bits on cris v10 and cris v32. Signed-off-by: Lars Persson Signed-off-by: Edgar E. Iglesias --- target-cris/cpu.h | 3 ++- target-cris/helper.c | 4 ++-- target-cris/op_helper.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'target-cris') diff --git a/target-cris/cpu.h b/target-cris/cpu.h index 73004af010..4f4df6d9b5 100644 --- a/target-cris/cpu.h +++ b/target-cris/cpu.h @@ -69,13 +69,14 @@ /* CPU flags. */ #define Q_FLAG 0x80000000 -#define M_FLAG 0x40000000 +#define M_FLAG_V32 0x40000000 #define PFIX_FLAG 0x800 /* CRISv10 Only. */ #define F_FLAG_V10 0x400 #define P_FLAG_V10 0x200 #define S_FLAG 0x200 #define R_FLAG 0x100 #define P_FLAG 0x80 +#define M_FLAG_V10 0x80 #define U_FLAG 0x40 #define I_FLAG 0x20 #define X_FLAG 0x10 diff --git a/target-cris/helper.c b/target-cris/helper.c index dcc19ef63b..bfbc29ec6a 100644 --- a/target-cris/helper.c +++ b/target-cris/helper.c @@ -127,7 +127,7 @@ static void do_interruptv10(CPUCRISState *env) case EXCP_NMI: /* NMI is hardwired to vector zero. */ ex_vec = 0; - env->pregs[PR_CCS] &= ~M_FLAG; + env->pregs[PR_CCS] &= ~M_FLAG_V10; env->pregs[PRV10_BRP] = env->pc; break; @@ -185,7 +185,7 @@ void do_interrupt(CPUCRISState *env) case EXCP_NMI: /* NMI is hardwired to vector zero. */ ex_vec = 0; - env->pregs[PR_CCS] &= ~M_FLAG; + env->pregs[PR_CCS] &= ~M_FLAG_V32; env->pregs[PR_NRP] = env->pc; break; diff --git a/target-cris/op_helper.c b/target-cris/op_helper.c index b92c106e10..ac7c98c8ed 100644 --- a/target-cris/op_helper.c +++ b/target-cris/op_helper.c @@ -247,8 +247,8 @@ void helper_rfn(void) if (!rflag) env->pregs[PR_CCS] |= P_FLAG; - /* Always set the M flag. */ - env->pregs[PR_CCS] |= M_FLAG; + /* Always set the M flag. */ + env->pregs[PR_CCS] |= M_FLAG_V32; } uint32_t helper_lz(uint32_t t0) -- cgit v1.2.1