3 * David Feng <fenghua@phytium.com.cn>
5 * SPDX-License-Identifier: GPL-2.0+
8 #include <asm-offsets.h>
10 #include <asm/ptrace.h>
11 #include <asm/macro.h>
12 #include <linux/linkage.h>
16 * This will save the processor state that is ELR/X0~X30
19 .macro exception_entry
20 stp x29, x30, [sp, #-16]!
21 stp x27, x28, [sp, #-16]!
22 stp x25, x26, [sp, #-16]!
23 stp x23, x24, [sp, #-16]!
24 stp x21, x22, [sp, #-16]!
25 stp x19, x20, [sp, #-16]!
26 stp x17, x18, [sp, #-16]!
27 stp x15, x16, [sp, #-16]!
28 stp x13, x14, [sp, #-16]!
29 stp x11, x12, [sp, #-16]!
30 stp x9, x10, [sp, #-16]!
31 stp x7, x8, [sp, #-16]!
32 stp x5, x6, [sp, #-16]!
33 stp x3, x4, [sp, #-16]!
34 stp x1, x2, [sp, #-16]!
36 /* Could be running at EL3/EL2/EL1 */
37 switch_el x11, 3f, 2f, 1f
47 stp x2, x0, [sp, #-16]!
58 b _do_bad_sync /* Current EL Synchronous Thread */
61 b _do_bad_irq /* Current EL IRQ Thread */
64 b _do_bad_fiq /* Current EL FIQ Thread */
67 b _do_bad_error /* Current EL Error Thread */
70 b _do_sync /* Current EL Synchronous Handler */
73 b _do_irq /* Current EL IRQ Handler */
76 b _do_fiq /* Current EL FIQ Handler */
79 b _do_error /* Current EL Error Handler */
124 switch_el x11, 3f, 2f, 1f
135 ldp x9, x10, [sp],#16
136 ldp x11, x12, [sp],#16
137 ldp x13, x14, [sp],#16
138 ldp x15, x16, [sp],#16
139 ldp x17, x18, [sp],#16
140 ldp x19, x20, [sp],#16
141 ldp x21, x22, [sp],#16
142 ldp x23, x24, [sp],#16
143 ldp x25, x26, [sp],#16
144 ldp x27, x28, [sp],#16
145 ldp x29, x30, [sp],#16