Commit 9dc1917
committed
fix(riscv/irqc): align IMSIC handler to AIA specifications
"The RISC-V Advanced Interrupt Architecture" specifications explain
in Chapter 3 (pages 26-27) how interrupts should be handled with IMSIC,
in particular, interrupt claiming has to be done right after reading the
STOPEI register or in the same read instruction with the csrrw
instruction.
This commit aligns the IMSIC interrupt handler to that specs.
Without this change, if an interrupt with higher priority becomes
pending while handling a lower one, writing to STOPEI after
`interrupts_handle()` executes will claim the higher IRQ, freezing
the execution.
Signed-off-by: Filippo Fontana <filippo.fontana@minervasys.tech>1 parent 85bc288 commit 9dc1917
2 files changed
+11
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
249 | 257 | | |
250 | 258 | | |
251 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 94 | + | |
98 | 95 | | |
99 | 96 | | |
100 | 97 | | |
| |||
0 commit comments