diff options
author | Lars Persson <lars.persson@axis.com> | 2012-06-14 16:23:55 +0200 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2012-06-15 13:21:32 +0200 |
commit | 8219314be689f54ff9814e55d619f87b9d66452a (patch) | |
tree | 138134c99e9f48d09f653a0986823a475d2eb4b8 /cpu-exec.c | |
parent | da9fa17ee9bece7e7ef54681832427c1d6baf554 (diff) | |
download | hqemu-8219314be689f54ff9814e55d619f87b9d66452a.zip hqemu-8219314be689f54ff9814e55d619f87b9d66452a.tar.gz |
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 <larper@axis.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'cpu-exec.c')
-rw-r--r-- | cpu-exec.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -467,11 +467,18 @@ int cpu_exec(CPUArchState *env) do_interrupt(env); next_tb = 0; } - if (interrupt_request & CPU_INTERRUPT_NMI - && (env->pregs[PR_CCS] & M_FLAG)) { - env->exception_index = EXCP_NMI; - do_interrupt(env); - next_tb = 0; + if (interrupt_request & CPU_INTERRUPT_NMI) { + unsigned int m_flag_archval; + if (env->pregs[PR_VR] < 32) { + m_flag_archval = M_FLAG_V10; + } else { + m_flag_archval = M_FLAG_V32; + } + if ((env->pregs[PR_CCS] & m_flag_archval)) { + env->exception_index = EXCP_NMI; + do_interrupt(env); + next_tb = 0; + } } #elif defined(TARGET_M68K) if (interrupt_request & CPU_INTERRUPT_HARD |