Skip to content

Commit 2ead7ab

Browse files
committed
openrisc: entry: Whitespace and comment cleanups
Cleanups to whitespace and add some comments. Reading through the delay slot logic I noticed some things: - Delay slot instructions were not indented - Some comments are not lined up - Use tabs and spaces consistent with other code No functional change Signed-off-by: Stafford Horne <[email protected]>
1 parent f72deab commit 2ead7ab

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

arch/openrisc/kernel/entry.S

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ EXCEPTION_ENTRY(_data_page_fault_handler)
228228
* DTLB miss handler in the CONFIG_GUARD_PROTECTED_CORE part
229229
*/
230230
#ifdef CONFIG_OPENRISC_NO_SPR_SR_DSX
231-
l.lwz r6,PT_PC(r3) // address of an offending insn
231+
l.lwz r6,PT_PC(r3) // address of an offending insn
232232
l.lwz r6,0(r6) // instruction that caused pf
233233

234234
l.srli r6,r6,26 // check opcode for jump insn
@@ -244,49 +244,47 @@ EXCEPTION_ENTRY(_data_page_fault_handler)
244244
l.bf 8f
245245
l.sfeqi r6,0x12 // l.jalr
246246
l.bf 8f
247-
248-
l.nop
247+
l.nop
249248

250249
l.j 9f
251-
l.nop
252-
8:
250+
l.nop
253251

254-
l.lwz r6,PT_PC(r3) // address of an offending insn
252+
8: // offending insn is in delay slot
253+
l.lwz r6,PT_PC(r3) // address of an offending insn
255254
l.addi r6,r6,4
256255
l.lwz r6,0(r6) // instruction that caused pf
257256
l.srli r6,r6,26 // get opcode
258-
9:
257+
9: // offending instruction opcode loaded in r6
259258

260259
#else
261260

262-
l.mfspr r6,r0,SPR_SR // SR
263-
// l.lwz r6,PT_SR(r3) // ESR
264-
l.andi r6,r6,SPR_SR_DSX // check for delay slot exception
265-
l.sfeqi r6,0x1 // exception happened in delay slot
266-
l.bnf 7f
267-
l.lwz r6,PT_PC(r3) // address of an offending insn
261+
l.mfspr r6,r0,SPR_SR // SR
262+
l.andi r6,r6,SPR_SR_DSX // check for delay slot exception
263+
l.sfeqi r6,0x1 // exception happened in delay slot
264+
l.bnf 7f
265+
l.lwz r6,PT_PC(r3) // address of an offending insn
268266

269-
l.addi r6,r6,4 // offending insn is in delay slot
267+
l.addi r6,r6,4 // offending insn is in delay slot
270268
7:
271269
l.lwz r6,0(r6) // instruction that caused pf
272270
l.srli r6,r6,26 // check opcode for write access
273271
#endif
274272

275-
l.sfgeui r6,0x33 // check opcode for write access
273+
l.sfgeui r6,0x33 // check opcode for write access
276274
l.bnf 1f
277275
l.sfleui r6,0x37
278276
l.bnf 1f
279277
l.ori r6,r0,0x1 // write access
280278
l.j 2f
281-
l.nop
279+
l.nop
282280
1: l.ori r6,r0,0x0 // !write access
283281
2:
284282

285283
/* call fault.c handler in or32/mm/fault.c */
286284
l.jal do_page_fault
287-
l.nop
285+
l.nop
288286
l.j _ret_from_exception
289-
l.nop
287+
l.nop
290288

291289
/* ---[ 0x400: Insn Page Fault exception ]------------------------------- */
292290
EXCEPTION_ENTRY(_itlb_miss_page_fault_handler)
@@ -306,9 +304,9 @@ EXCEPTION_ENTRY(_insn_page_fault_handler)
306304

307305
/* call fault.c handler in or32/mm/fault.c */
308306
l.jal do_page_fault
309-
l.nop
307+
l.nop
310308
l.j _ret_from_exception
311-
l.nop
309+
l.nop
312310

313311

314312
/* ---[ 0x500: Timer exception ]----------------------------------------- */

0 commit comments

Comments
 (0)