Lines Matching +full:sw +full:- +full:exception
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
11 * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
26 #include <asm/asm-offsets.h>
30 l.movhi rd,hi(-KERNELBASE) ;\
73 #define EMERGENCY_PRINT_STORE_GPR4 l.sw 0x20(r0),r4
76 #define EMERGENCY_PRINT_STORE_GPR5 l.sw 0x24(r0),r5
79 #define EMERGENCY_PRINT_STORE_GPR6 l.sw 0x28(r0),r6
82 #define EMERGENCY_PRINT_STORE_GPR7 l.sw 0x2c(r0),r7
85 #define EMERGENCY_PRINT_STORE_GPR8 l.sw 0x30(r0),r8
88 #define EMERGENCY_PRINT_STORE_GPR9 l.sw 0x34(r0),r9
113 #define EXCEPTION_STORE_GPR2 l.sw 0x64(r0),r2
116 #define EXCEPTION_STORE_GPR3 l.sw 0x68(r0),r3
119 #define EXCEPTION_STORE_GPR4 l.sw 0x6c(r0),r4
122 #define EXCEPTION_STORE_GPR5 l.sw 0x70(r0),r5
125 #define EXCEPTION_STORE_GPR6 l.sw 0x74(r0),r6
145 #define EXCEPTION_T_STORE_GPR30 l.sw 0x78(r0),r30
148 #define EXCEPTION_T_STORE_GPR10 l.sw 0x7c(r0),r10
151 #define EXCEPTION_T_STORE_SP l.sw 0x80(r0),r1
172 /* Load r10 from current_thread_info_set - clobbers r1 and r30 */
195 * PRMS: handler - a function to jump to. it has to save the
197 * appropriate arch-independant exception handler
200 * PREQ: unchanged state from the time exception happened
203 * to the new created exception frame pointed to by r1
205 * r1 - ksp pointing to the new (exception) frame
206 * r4 - EEAR exception EA
207 * r10 - current pointing to current_thread_info struct
208 * r12 - syscall 0, since we didn't come from syscall
209 * r30 - handler address of the handler we'll jump to
211 * handler has to save remaining registers to the exception
215 * by processor disabling all exceptions/interrupts when exception
238 l.addi r1,r1,-(INT_FRAME_SIZE) ;\
241 l.sw PT_GPR12(r30),r12 ;\
244 l.sw PT_PC(r30),r12 ;\
246 l.sw PT_SR(r30),r12 ;\
249 l.sw PT_GPR30(r30),r12 ;\
250 /* save r10 as was prior to exception */ ;\
252 l.sw PT_GPR10(r30),r12 ;\
253 /* save PT_SP as was prior to exception */ ;\
255 l.sw PT_SP(r30),r12 ;\
256 /* save exception r4, set r4 = EA */ ;\
257 l.sw PT_GPR4(r30),r4 ;\
261 /* ----- turn on MMU ----- */ ;\
262 /* Carry DSX into exception SR */ ;\
326 l.addi r1,r1,-(INT_FRAME_SIZE) ;\
329 l.sw PT_GPR12(r30),r12 ;\
331 l.sw PT_PC(r30),r12 ;\
333 l.sw PT_SR(r30),r12 ;\
336 l.sw PT_GPR30(r30),r12 ;\
337 /* save r10 as was prior to exception */ ;\
339 l.sw PT_GPR10(r30),r12 ;\
340 /* save PT_SP as was prior to exception */ ;\
342 l.sw PT_SP(r30),r12 ;\
343 l.sw PT_GPR13(r30),r13 ;\
344 /* --> */ ;\
345 /* save exception r4, set r4 = EA */ ;\
346 l.sw PT_GPR4(r30),r4 ;\
350 /* ----- play a MMU trick ----- */ ;\
362 /* ---[ 0x100: RESET exception ]----------------------------------------- */
372 /* ---[ 0x200: BUS exception ]------------------------------------------- */
377 /* ---[ 0x300: Data Page Fault exception ]------------------------------- */
386 /* ---[ 0x400: Insn Page Fault exception ]------------------------------- */
395 /* ---[ 0x500: Timer exception ]----------------------------------------- */
399 /* ---[ 0x600: Alignment exception ]------------------------------------- */
403 /* ---[ 0x700: Illegal insn exception ]---------------------------------- */
407 /* ---[ 0x800: External interrupt exception ]---------------------------- */
411 /* ---[ 0x900: DTLB miss exception ]------------------------------------- */
416 /* ---[ 0xa00: ITLB miss exception ]------------------------------------- */
421 /* ---[ 0xb00: Range exception ]----------------------------------------- */
425 /* ---[ 0xc00: Syscall exception ]--------------------------------------- */
429 /* ---[ 0xd00: Floating point exception ]-------------------------------- */
433 /* ---[ 0xe00: Trap exception ]------------------------------------------ */
438 /* ---[ 0xf00: Reserved exception ]-------------------------------------- */
442 /* ---[ 0x1000: Reserved exception ]------------------------------------- */
446 /* ---[ 0x1100: Reserved exception ]------------------------------------- */
450 /* ---[ 0x1200: Reserved exception ]------------------------------------- */
454 /* ---[ 0x1300: Reserved exception ]------------------------------------- */
458 /* ---[ 0x1400: Reserved exception ]------------------------------------- */
462 /* ---[ 0x1500: Reserved exception ]------------------------------------- */
466 /* ---[ 0x1600: Reserved exception ]------------------------------------- */
470 /* ---[ 0x1700: Reserved exception ]------------------------------------- */
474 /* ---[ 0x1800: Reserved exception ]------------------------------------- */
478 /* ---[ 0x1900: Reserved exception ]------------------------------------- */
482 /* ---[ 0x1a00: Reserved exception ]------------------------------------- */
486 /* ---[ 0x1b00: Reserved exception ]------------------------------------- */
490 /* ---[ 0x1c00: Reserved exception ]------------------------------------- */
494 /* ---[ 0x1d00: Reserved exception ]------------------------------------- */
498 /* ---[ 0x1e00: Reserved exception ]------------------------------------- */
502 /* ---[ 0x1f00: Reserved exception ]------------------------------------- */
583 l.sw TI_KSP(r31), r1
590 * .bss contains uninitialized data - clear it up
600 l.sw (0)(r28),r0
722 l.addi r7,r7,-1
737 /* Setup special secondary exception handler */
758 /* Wakeup - Restore exception handler */
763 * Check if we actually got the release signal, if not go-back to
784 l.sw TI_KSP(r30),r1
838 l.addi r5,r0,-1
904 l.addi r5,r0,-1
958 /* ---[ boot dtlb miss handler ]----------------------------------------- */
962 /* mask for DTLB_MR register: - (0) sets V (valid) bit,
963 * - (31-12) sets bits belonging to VPN (31-12)
967 /* mask for DTLB_TR register: - (2) sets CI (cache inhibit) bit,
968 * - (4) sets A (access) bit,
969 * - (5) sets D (dirty) bit,
970 * - (8) sets SRE (superuser read) bit
971 * - (9) sets SWE (superuser write) bit
972 * - (31-12) sets bits belonging to VPN (31-12)
987 l.sfeqi r6,0 // r6 == 0x1 --> SM
1007 …l.srli r3,r4,0xd // r3 <- r4 / 8192 (sets are relative to page size (8Kb) NOT VPN…
1014 l.addi r6, r5, -1 // r6 = nsets mask
1015 l.and r2, r3, r6 // r2 <- r3 % NSETS_MASK
1017 l.or r6,r6,r4 // r6 <- r4
1018 l.ori r6,r6,~(VPN_MASK) // r6 <- VPN :VPN .xfff - clear up lo(r6) to 0x**** *fff
1019 l.movhi r5,hi(DTLB_MR_MASK) // r5 <- ffff:0000.x000
1020 l.ori r5,r5,lo(DTLB_MR_MASK) // r5 <- ffff:1111.x001 - apply DTLB_MR_MASK
1021 l.and r5,r5,r6 // r5 <- VPN :VPN .x001 - we have DTLBMR entry
1028 l.and r3,r4,r4 // delay slot :: 24 <- r4 (if flag==1)
1030 tophys(r3,r4) // r3 <- PA
1032 l.ori r3,r3,~(PPN_MASK) // r3 <- PPN :PPN .xfff - clear up lo(r6) to 0x**** *fff
1033 l.movhi r5,hi(DTLB_TR_MASK) // r5 <- ffff:0000.x000
1034 l.ori r5,r5,lo(DTLB_TR_MASK) // r5 <- ffff:1111.x330 - apply DTLB_MR_MASK
1035 l.and r5,r5,r3 // r5 <- PPN :PPN .x330 - we have DTLBTR entry
1044 l.rfe // SR <- ESR, PC <- EPC
1052 /* ---[ boot itlb miss handler ]----------------------------------------- */
1056 /* mask for ITLB_MR register: - sets V (valid) bit,
1057 * - sets bits belonging to VPN (15-12)
1061 /* mask for ITLB_TR register: - sets A (access) bit,
1062 * - sets SXE (superuser execute) bit
1063 * - sets bits belonging to VPN (15-12)
1083 l.sfeqi r6,0 // r6 == 0x1 --> SM
1094 …l.srli r3,r4,0xd // r3 <- r4 / 8192 (sets are relative to page size (8Kb) NOT VP…
1101 l.addi r6, r5, -1 // r6 = nsets mask
1102 l.and r2, r3, r6 // r2 <- r3 % NSETS_MASK
1104 l.or r6,r6,r4 // r6 <- r4
1105 l.ori r6,r6,~(VPN_MASK) // r6 <- VPN :VPN .xfff - clear up lo(r6) to 0x**** *fff
1106 l.movhi r5,hi(ITLB_MR_MASK) // r5 <- ffff:0000.x000
1107 l.ori r5,r5,lo(ITLB_MR_MASK) // r5 <- ffff:1111.x001 - apply ITLB_MR_MASK
1108 l.and r5,r5,r6 // r5 <- VPN :VPN .x001 - we have ITLBMR entry
1121 l.and r3,r4,r4 // delay slot :: 24 <- r4 (if flag==1)
1123 tophys(r3,r4) // r3 <- PA
1125 l.ori r3,r3,~(PPN_MASK) // r3 <- PPN :PPN .xfff - clear up lo(r6) to 0x**** *fff
1126 l.movhi r5,hi(ITLB_TR_MASK) // r5 <- ffff:0000.x000
1127 l.ori r5,r5,lo(ITLB_TR_MASK) // r5 <- ffff:1111.x050 - apply ITLB_MR_MASK
1128 l.and r5,r5,r3 // r5 <- PPN :PPN .x050 - we have ITLBTR entry
1137 l.rfe // SR <- ESR, PC <- EPC
1155 * Exception handlers are entered with MMU off so the following handler
1173 l.srli r4,r2,0x18 // >> PAGE_SHIFT + (PAGE_SHIFT - 2)
1193 l.andi r3,r2,0x7ff // (1UL << PAGE_SHIFT - 2) - 1
1214 l.addi r2, r3, -1 // r2 = nsets mask
1217 l.and r2, r3, r2 // calc offset: & (NUM_TLB_ENTRIES-1)
1253 l.srli r4,r2,0x18 // >> PAGE_SHIFT + (PAGE_SHIFT - 2)
1274 l.andi r3,r2,0x7ff // (1UL << PAGE_SHIFT - 2) - 1
1299 l.addi r2, r3, -1 // r2 = nsets mask
1302 l.and r2, r3, r2 // calc offset: & (NUM_TLB_ENTRIES-1)
1342 * PRMS: r7 - a 32-bit value with an ASCII character in the first byte
1348 * r4 - to store UART_BASE_ADD
1349 * r5 - for loading OFF_TXFULL / THRE,TEMT
1350 * r6 - for storing bitmask (SERIAL_8250)
1370 l.sw 0(r4),r7
1400 * PRMS: r3 - address of the first character of null
1433 * PRMS: r3 - a 32-bit unsigned integer
1447 l.addi r8,r8,-0x4
1467 /* Numbers greater than 9 translate to a-f */
1479 l.addi r8,r8,-0x4
1549 .string "\r\nRunarunaround: Unhandled exception 0x\0"