3 #define EXCEPTION_PROLOG \
5 stw r0,GQR0_OFFSET(sp); \
7 stw r0,GQR1_OFFSET(sp); \
9 stw r0,GQR2_OFFSET(sp); \
11 stw r0,GQR3_OFFSET(sp); \
13 stw r0,GQR4_OFFSET(sp); \
15 stw r0,GQR5_OFFSET(sp); \
17 stw r0,GQR6_OFFSET(sp); \
19 stw r0,GQR7_OFFSET(sp); \
20 stmw r6,GPR6_OFFSET(sp)
22 #define EXCEPTION_EPILOG \
23 lwz r4,GQR0_OFFSET(sp); \
25 lwz r4,GQR1_OFFSET(sp); \
27 lwz r4,GQR2_OFFSET(sp); \
29 lwz r4,GQR3_OFFSET(sp); \
31 lwz r4,GQR4_OFFSET(sp); \
33 lwz r4,GQR5_OFFSET(sp); \
35 lwz r4,GQR6_OFFSET(sp); \
37 lwz r4,GQR7_OFFSET(sp); \
39 lmw r5,GPR5_OFFSET(sp)
41 .extern c_debug_handler
42 .extern _cpu_context_save_fp
43 .globl dbg_exceptionhandler
45 stwu sp,-EXCEPTION_FRAME_END(sp) //now we're able to adjust the stackpointer with it's cached address
51 lis r15,__debug_nestlevel@ha
52 lwz r6,__debug_nestlevel@l(r15)
57 ori sp,sp,__debugstack@l
63 stw r6,__debug_nestlevel@l(r15)
66 bl _cpu_context_save_fp
69 lwz r6,__debug_nestlevel@l(r15)
71 stw r6,__debug_nestlevel@l(r15)
92 lwz toc,GPR2_OFFSET(sp)
93 lwz r0,GPR0_OFFSET(sp)
95 lwz r4,SRR0_OFFSET(sp)
97 lwz r4,SRR1_OFFSET(sp)
100 lwz r4,GPR4_OFFSET(sp)
101 lwz r3,GPR3_OFFSET(sp)
102 addi sp,sp,EXCEPTION_FRAME_END
130 .globl __disable_iabr
161 .globl __debugstack_end,__debugstack