Lines Matching +full:sw +full:- +full:exception

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
12 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
25 #include <asm/asm-offsets.h>
46 l.sw -8(r1),r2 /* store frame pointer */ ;\
47 l.sw -4(r1),r9 /* store return address */ ;\
50 l.addi r1,r1,-8 ;\
52 l.lwz r9,-4(r1) /* restore return address */ ;\
53 l.lwz r2,-8(r1) /* restore fp */ ;\
59 l.sw -12(r1),t1 /* save extra reg */ ;\
60 l.sw -8(r1),r2 /* store frame pointer */ ;\
61 l.sw -4(r1),r9 /* store return address */ ;\
64 l.addi r1,r1,-12 ;\
66 l.lwz r9,-4(r1) /* restore return address */ ;\
67 l.lwz r2,-8(r1) /* restore fp */ ;\
68 l.lwz t1,-12(r1) /* restore extra reg */
147 l.sw PT_GPR2(r1),r2 ;\
148 l.sw PT_GPR3(r1),r3 ;\
150 l.sw PT_GPR5(r1),r5 ;\
151 l.sw PT_GPR6(r1),r6 ;\
152 l.sw PT_GPR7(r1),r7 ;\
153 l.sw PT_GPR8(r1),r8 ;\
154 l.sw PT_GPR9(r1),r9 ;\
156 l.sw PT_GPR11(r1),r11 ;\
158 l.sw PT_GPR13(r1),r13 ;\
159 l.sw PT_GPR14(r1),r14 ;\
160 l.sw PT_GPR15(r1),r15 ;\
161 l.sw PT_GPR16(r1),r16 ;\
162 l.sw PT_GPR17(r1),r17 ;\
163 l.sw PT_GPR18(r1),r18 ;\
164 l.sw PT_GPR19(r1),r19 ;\
165 l.sw PT_GPR20(r1),r20 ;\
166 l.sw PT_GPR21(r1),r21 ;\
167 l.sw PT_GPR22(r1),r22 ;\
168 l.sw PT_GPR23(r1),r23 ;\
169 l.sw PT_GPR24(r1),r24 ;\
170 l.sw PT_GPR25(r1),r25 ;\
171 l.sw PT_GPR26(r1),r26 ;\
172 l.sw PT_GPR27(r1),r27 ;\
173 l.sw PT_GPR28(r1),r28 ;\
174 l.sw PT_GPR29(r1),r29 ;\
176 /* l.sw PT_GPR30(r1),r30*/ ;\
177 l.sw PT_GPR31(r1),r31 ;\
179 /* Store -1 in orig_gpr11 for non-syscall exceptions */ ;\
180 l.addi r30,r0,-1 ;\
181 l.sw PT_ORIG_GPR11(r1),r30
187 l.sw PT_GPR2(r1),r2 ;\
188 l.sw PT_GPR3(r1),r3 ;\
189 l.sw PT_GPR5(r1),r5 ;\
190 l.sw PT_GPR6(r1),r6 ;\
191 l.sw PT_GPR7(r1),r7 ;\
192 l.sw PT_GPR8(r1),r8 ;\
193 l.sw PT_GPR9(r1),r9 ;\
195 l.sw PT_GPR11(r1),r11 ;\
197 l.sw PT_GPR13(r1),r13 ;\
198 l.sw PT_GPR14(r1),r14 ;\
199 l.sw PT_GPR15(r1),r15 ;\
200 l.sw PT_GPR16(r1),r16 ;\
201 l.sw PT_GPR17(r1),r17 ;\
202 l.sw PT_GPR18(r1),r18 ;\
203 l.sw PT_GPR19(r1),r19 ;\
204 l.sw PT_GPR20(r1),r20 ;\
205 l.sw PT_GPR21(r1),r21 ;\
206 l.sw PT_GPR22(r1),r22 ;\
207 l.sw PT_GPR23(r1),r23 ;\
208 l.sw PT_GPR24(r1),r24 ;\
209 l.sw PT_GPR25(r1),r25 ;\
210 l.sw PT_GPR26(r1),r26 ;\
211 l.sw PT_GPR27(r1),r27 ;\
212 l.sw PT_GPR28(r1),r28 ;\
213 l.sw PT_GPR29(r1),r29 ;\
215 l.sw PT_GPR30(r1),r30 ;\
216 /* l.sw PT_GPR31(r1),r31 */ ;\
217 /* Store -1 in orig_gpr11 for non-syscall exceptions */ ;\
218 l.addi r30,r0,-1 ;\
219 l.sw PT_ORIG_GPR11(r1),r30 ;\
221 /* r4 is exception EA */ ;\
232 l.sw 0(reg),r0
235 * contain the same values as when exception we're handling
244 /* ---[ 0x100: RESET exception ]----------------------------------------- */
250 /* ---[ 0x200: BUS exception ]------------------------------------------- */
261 /* ---[ 0x300: Data Page Fault exception ]------------------------------- */
271 l.ori r5,r0,0x300 // exception vector
308 l.andi r6,r6,SPR_SR_DSX // check for delay slot exception
309 l.sfne r6,r0 // exception happened in delay slot
335 /* ---[ 0x400: Insn Page Fault exception ]------------------------------- */
345 l.ori r5,r0,0x400 // exception vector
358 /* ---[ 0x500: Timer exception ]----------------------------------------- */
368 /* ---[ 0x600: Alignment exception ]-------------------------------------- */
430 l.sw PT_PC(r1),r5
443 l.bf sw
457 l.sw 0(r4),r5
467 l.sw 0(r4),r5
483 l.sw 0(r4),r5
499 l.sw 0(r4),r5
511 sw:
530 /* ---[ 0x700: Illegal insn exception ]---------------------------------- */
540 /* ---[ 0x800: External interrupt exception ]---------------------------- */
550 l.addi r1,r1,-0x8
553 l.sw 0x0(r1),r3
555 l.sw 0x4(r1),r4
565 // l.sw PT_SR(r1),r4
577 /* ---[ 0x900: DTLB miss exception ]------------------------------------- */
580 /* ---[ 0xa00: ITLB miss exception ]------------------------------------- */
583 /* ---[ 0xb00: Range exception ]----------------------------------------- */
587 /* ---[ 0xc00: Syscall exception ]--------------------------------------- */
590 * Syscalls are a special type of exception in that they are
597 /* Upon syscall entry we just save the callee-saved registers
598 * and not the call-clobbered ones.
607 l.sw PT_GPR2(r1),r2
608 /* r3-r8 must be saved because syscall restart relies
612 l.sw PT_GPR3(r1),r3
620 l.sw PT_GPR5(r1),r5
621 l.sw PT_GPR6(r1),r6
622 l.sw PT_GPR7(r1),r7
623 l.sw PT_GPR8(r1),r8
624 l.sw PT_GPR9(r1),r9
626 l.sw PT_GPR11(r1),r11
628 l.sw PT_ORIG_GPR11(r1),r11
631 /* r14-r28 (even) aren't touched by the syscall fast path below
640 /* l.sw PT_GPR30(r1),r30 */
672 * which does it in a round-about way.
674 l.sw PT_GPR11(r1),r11 // save return value
681 l.sw -4(r1),r27
682 l.sw -8(r1),r11
683 l.addi r1,r1,-8
692 /* r30 is a callee-saved register so this should still hold the
694 * _syscall_trace_leave expects syscall result to be in pt_regs->r11.
700 /* This is where the exception-return code begins... interrupts need to be
716 * make sure that all the call-saved registers get into pt_regs
719 l.sw PT_GPR14(r1),r14
720 l.sw PT_GPR16(r1),r16
721 l.sw PT_GPR18(r1),r18
722 l.sw PT_GPR20(r1),r20
723 l.sw PT_GPR22(r1),r22
724 l.sw PT_GPR24(r1),r24
725 l.sw PT_GPR26(r1),r26
726 l.sw PT_GPR28(r1),r28
738 * return to userspace will be done via the normal exception return path...
740 * registers with whatever garbage is in pt_regs -- that's OK because those
747 /* The assumption here is that the registers r14-r28 (even) are untouched and
759 /* r3-r8 are technically clobbered, but syscall restart needs these
776 /* Here we use r13-r19 (odd) as scratch regs */
826 * syscall that returns -ENOSYS and then return to the regular
831 l.addi r11,r0,-ENOSYS
835 /* ---[ 0xd00: Trap exception ]------------------------------------------ */
839 /* ---[ 0xe00: Trap exception ]------------------------------------------ */
850 /* ---[ 0xf00: Reserved exception ]-------------------------------------- */
854 /* ---[ 0x1000: Reserved exception ]------------------------------------- */
858 /* ---[ 0x1100: Reserved exception ]------------------------------------- */
862 /* ---[ 0x1200: Reserved exception ]------------------------------------- */
866 /* ---[ 0x1300: Reserved exception ]------------------------------------- */
870 /* ---[ 0x1400: Reserved exception ]------------------------------------- */
874 /* ---[ 0x1500: Reserved exception ]------------------------------------- */
878 /* ---[ 0x1600: Reserved exception ]------------------------------------- */
882 /* ---[ 0x1700: Reserved exception ]------------------------------------- */
886 /* ---[ 0x1800: Reserved exception ]------------------------------------- */
890 /* ---[ 0x1900: Reserved exception ]------------------------------------- */
894 /* ---[ 0x1a00: Reserved exception ]------------------------------------- */
898 /* ---[ 0x1b00: Reserved exception ]------------------------------------- */
902 /* ---[ 0x1c00: Reserved exception ]------------------------------------- */
906 /* ---[ 0x1d00: Reserved exception ]------------------------------------- */
910 /* ---[ 0x1e00: Reserved exception ]------------------------------------- */
914 /* ---[ 0x1f00: Reserved exception ]------------------------------------- */
1001 /* The syscall fast path return expects call-saved registers
1002 * r12-r28 to be untouched, so we restore them here as they
1053 * way, we are a function call and only need to preserve the callee-saved
1064 l.addi r1,r1,-(INT_FRAME_SIZE)
1067 l.sw PT_GPR2(r1),r2
1068 l.sw PT_GPR9(r1),r9
1070 * and expects r12 to be callee-saved... */
1071 l.sw PT_GPR12(r1),r12
1072 l.sw PT_GPR14(r1),r14
1073 l.sw PT_GPR16(r1),r16
1074 l.sw PT_GPR18(r1),r18
1075 l.sw PT_GPR20(r1),r20
1076 l.sw PT_GPR22(r1),r22
1077 l.sw PT_GPR24(r1),r24
1078 l.sw PT_GPR26(r1),r26
1079 l.sw PT_GPR28(r1),r28
1080 l.sw PT_GPR30(r1),r30
1084 /* We use thread_info->ksp for storing the address of the above
1086 * to lose the value of thread_info->ksp, though, so store it as
1087 * pt_regs->sp so that we can easily restore it when we are made
1091 /* Save the old value of thread_info->ksp as pt_regs->sp */
1093 l.sw PT_SP(r1),r29
1096 l.sw TI_KSP(r10),r1 /* Save old stack pointer */
1100 /* Restore the old value of thread_info->ksp */
1102 l.sw TI_KSP(r10),r29
1113 * and expects r12 to be callee-saved... */
1125 /* Unwind stack to pre-switch state */
1128 /* Return via the link-register back to where we 'came from', where
1143 * These are all just wrappers that don't touch the link-register r9, so the
1148 /* fork requires that we save all the callee-saved registers because they
1155 l.sw PT_GPR14(r1),r14
1156 l.sw PT_GPR16(r1),r16
1157 l.sw PT_GPR18(r1),r18
1158 l.sw PT_GPR20(r1),r20
1159 l.sw PT_GPR22(r1),r22
1160 l.sw PT_GPR24(r1),r24
1161 l.sw PT_GPR26(r1),r26
1163 l.sw PT_GPR28(r1),r28
1189 /* This is a catch-all syscall for atomic instructions for the OpenRISC 1000.
1208 l.sw 0(r4),r27
1209 l.sw 0(r5),r29