Skip to content

Commit 530b593

Browse files
Nicolas Pitrehenrikbrixandersen
authored andcommitted
arch: riscv: apply CONFIG_RISCV_MCAUSE_EXCEPTION_MASK to FPU code
Some implementations use bits outside of the mcause mask for other purpose. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
1 parent cba18a5 commit 530b593

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/riscv/core/isr.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ SECTION_FUNC(exception.entry, _isr_wrapper)
203203
bnez t1, no_fp
204204
/* determine if this is an Illegal Instruction exception */
205205
csrr t2, mcause
206+
li t1, CONFIG_RISCV_MCAUSE_EXCEPTION_MASK
207+
and t2, t2, t1
206208
li t1, 2 /* 2 = illegal instruction */
207209
bne t1, t2, no_fp
208210
/* determine if we trapped on an FP instruction. */

0 commit comments

Comments
 (0)