projects
/
riscv-isa-sim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f478eef
)
Take M-mode interrupts over S-mode interrupts
author
Andrew Waterman
<andrew@sifive.com>
Tue, 21 Feb 2017 01:17:17 +0000
(17:17 -0800)
committer
Andrew Waterman
<andrew@sifive.com>
Tue, 21 Feb 2017 01:17:17 +0000
(17:17 -0800)
riscv/processor.cc
patch
|
blob
|
history
diff --git
a/riscv/processor.cc
b/riscv/processor.cc
index 706c0bcd050f065bfde559b6ebb17981d115ea4e..29307fd5ba9b5aa604bc184aadfc8238bb9fcbbb 100644
(file)
--- a/
riscv/processor.cc
+++ b/
riscv/processor.cc
@@
-172,7
+172,8
@@
void processor_t::take_interrupt(reg_t pending_interrupts)
reg_t sie = get_field(state.mstatus, MSTATUS_SIE);
reg_t s_enabled = state.prv < PRV_S || (state.prv == PRV_S && sie);
- enabled_interrupts |= pending_interrupts & state.mideleg & -s_enabled;
+ if (enabled_interrupts == 0)
+ enabled_interrupts = pending_interrupts & state.mideleg & -s_enabled;
if (enabled_interrupts)
throw trap_t(((reg_t)1 << (max_xlen-1)) | ctz(enabled_interrupts));