aboutsummaryrefslogtreecommitdiff
path: root/hw/xtensa/pic_cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xtensa/pic_cpu.c')
-rw-r--r--hw/xtensa/pic_cpu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/xtensa/pic_cpu.c b/hw/xtensa/pic_cpu.c
index edd53c9241..1d5982a9e4 100644
--- a/hw/xtensa/pic_cpu.c
+++ b/hw/xtensa/pic_cpu.c
@@ -35,9 +35,13 @@ void check_interrupts(CPUXtensaState *env)
{
CPUState *cs = env_cpu(env);
int minlevel = xtensa_get_cintlevel(env);
- uint32_t int_set_enabled = env->sregs[INTSET] & env->sregs[INTENABLE];
+ uint32_t int_set_enabled = env->sregs[INTSET] &
+ (env->sregs[INTENABLE] | env->config->inttype_mask[INTTYPE_NMI]);
int level;
+ if (minlevel >= env->config->nmi_level) {
+ minlevel = env->config->nmi_level - 1;
+ }
for (level = env->config->nlevel; level > minlevel; --level) {
if (env->config->level_mask[level] & int_set_enabled) {
env->pending_irq_level = level;