Skip to content

Commit e6d20c5

Browse files
committed
openrisc: entry: Fix delay slot detection
Use execption SR stored in pt_regs for detection, the current SR is not correct as the handler is running after return from exception. Also, The code that checks for a delay slot uses a flag bitmask and then wants to check if the result is not zero. The test it implemented was wrong. Correct it by changing the test to check result against non zero. Signed-off-by: Stafford Horne <[email protected]>
1 parent 2ead7ab commit e6d20c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/openrisc/kernel/entry.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ EXCEPTION_ENTRY(_data_page_fault_handler)
258258

259259
#else
260260

261-
l.mfspr r6,r0,SPR_SR // SR
261+
l.lwz r6,PT_SR(r3) // SR
262262
l.andi r6,r6,SPR_SR_DSX // check for delay slot exception
263-
l.sfeqi r6,0x1 // exception happened in delay slot
263+
l.sfne r6,r0 // exception happened in delay slot
264264
l.bnf 7f
265265
l.lwz r6,PT_PC(r3) // address of an offending insn
266266

0 commit comments

Comments
 (0)