From 2688d179b1003333945017f77d1b16c8f06d7d39 Mon Sep 17 00:00:00 2001 From: "demin.han" Date: Tue, 29 Oct 2024 09:57:36 +0800 Subject: [PATCH] Fix non-standard interrupt start position Signed-off-by: demin.han --- riscv/processor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/riscv/processor.cc b/riscv/processor.cc index 9260045bd3..ab4ff7f7d8 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -304,8 +304,8 @@ void processor_t::take_interrupt(reg_t pending_interrupts) const bool nmie = !(state.mnstatus && !get_field(state.mnstatus->read(), MNSTATUS_NMIE)); if (!state.debug_mode && nmie && enabled_interrupts) { // nonstandard interrupts have highest priority - if (enabled_interrupts >> (IRQ_M_EXT + 1)) - enabled_interrupts = enabled_interrupts >> (IRQ_M_EXT + 1) << (IRQ_M_EXT + 1); + if (enabled_interrupts >> (IRQ_LCOF + 1)) + enabled_interrupts = enabled_interrupts >> (IRQ_LCOF + 1) << (IRQ_LCOF + 1); // standard interrupt priority is MEI, MSI, MTI, SEI, SSI, STI else if (enabled_interrupts & MIP_MEIP) enabled_interrupts = MIP_MEIP;