b18: S7 exit router + dstub trap + docs

This commit is contained in:
SashegDev
2026-09-12 10:30:18 +00:00
parent 67539f7351
commit 049f98122b
6 changed files with 1097 additions and 50 deletions
+8 -14
View File
@@ -1,22 +1,16 @@
.syntax unified
.cpu cortex-a7
.thumb
@ maze entry logger: ring buffer of 8 (lr,sp) at MAILBOX, return 0.
@ Preserves all regs except r0 (return value) and r12 (IP, clobber-ok).
@ maze entry: return 0. Guard: bad lr (high byte != 0x08) spins
@ with IRQs off instead of jumping into the void.
.text
.global maze_stub
maze_stub:
push {r0-r3}
movw r12, #:lower16:0x08006890
movt r12, #:upper16:0x08006890
ldr r0, [r12, #32]
add r0, #1
and r0, #7
str r0, [r12, #32]
lsl r0, #3
add r0, r12
str lr, [r0]
str sp, [r0, #4]
pop {r0-r3}
movs r0, #0
lsr r12, lr, #24
cmp r12, #8
bne maze_hang
bx lr
maze_hang:
cpsid i
b maze_hang