1+ #include "entry.h"
2+
3+ .macro handle_invalid_entry type
4+ kernel_entry
5+ mov x0 , #\type
6+ mrs x1 , esr_el1
7+ mrs x2 , elr_el1
8+ bl show_invalid_entry_message
9+ b err_hang
10+ .endm
11+
12+ .macro ventry label
13+ . align 7
14+ b \label
15+ .endm
16+
17+ .macro kernel_entry
18+ sub sp , sp , #S_FRAME_SIZE
19+ stp x0 , x1 , [ sp , # 16 * 0 ]
20+ stp x2 , x3 , [ sp , # 16 * 1 ]
21+ stp x4 , x5 , [ sp , # 16 * 2 ]
22+ stp x6 , x7 , [ sp , # 16 * 3 ]
23+ stp x8 , x9 , [ sp , # 16 * 4 ]
24+ stp x10 , x11 , [ sp , # 16 * 5 ]
25+ stp x12 , x13 , [ sp , # 16 * 6 ]
26+ stp x14 , x15 , [ sp , # 16 * 7 ]
27+ stp x16 , x17 , [ sp , # 16 * 8 ]
28+ stp x18 , x19 , [ sp , # 16 * 9 ]
29+ stp x20 , x21 , [ sp , # 16 * 10 ]
30+ stp x22 , x23 , [ sp , # 16 * 11 ]
31+ stp x24 , x25 , [ sp , # 16 * 12 ]
32+ stp x26 , x27 , [ sp , # 16 * 13 ]
33+ stp x28 , x29 , [ sp , # 16 * 14 ]
34+ str x30 , [ sp , # 16 * 15 ]
35+ .endm
36+
37+ .macro kernel_exit
38+ ldp x0 , x1 , [ sp , # 16 * 0 ]
39+ ldp x2 , x3 , [ sp , # 16 * 1 ]
40+ ldp x4 , x5 , [ sp , # 16 * 2 ]
41+ ldp x6 , x7 , [ sp , # 16 * 3 ]
42+ ldp x8 , x9 , [ sp , # 16 * 4 ]
43+ ldp x10 , x11 , [ sp , # 16 * 5 ]
44+ ldp x12 , x13 , [ sp , # 16 * 6 ]
45+ ldp x14 , x15 , [ sp , # 16 * 7 ]
46+ ldp x16 , x17 , [ sp , # 16 * 8 ]
47+ ldp x18 , x19 , [ sp , # 16 * 9 ]
48+ ldp x20 , x21 , [ sp , # 16 * 10 ]
49+ ldp x22 , x23 , [ sp , # 16 * 11 ]
50+ ldp x24 , x25 , [ sp , # 16 * 12 ]
51+ ldp x26 , x27 , [ sp , # 16 * 13 ]
52+ ldp x28 , x29 , [ sp , # 16 * 14 ]
53+ ldr x30 , [ sp , # 16 * 15 ]
54+ add sp , sp , #S_FRAME_SIZE
55+ eret
56+ .endm
57+
58+
59+ / *
60+ * Exception vectors.
61+ * /
62+ . align 11
63+ .globl vectors
64+ vectors:
65+ ventry sync_invalid_el1t // Synchronous EL1t
66+ ventry irq_invalid_el1t // IRQ EL1t
67+ ventry fiq_invalid_el1t // FIQ EL1t
68+ ventry error_invalid_el1t // Error EL1t
69+
70+ ventry sync_invalid_el1h // Synchronous EL1h
71+ ventry el1_irq // IRQ EL1h
72+ ventry fiq_invalid_el1h // FIQ EL1h
73+ ventry error_invalid_el1h // Error EL1h
74+
75+ ventry sync_invalid_el0_64 // Synchronous 64 - bit EL0
76+ ventry irq_invalid_el0_64 // IRQ 64 - bit EL0
77+ ventry fiq_invalid_el0_64 // FIQ 64 - bit EL0
78+ ventry error_invalid_el0_64 // Error 64 - bit EL0
79+
80+ ventry sync_invalid_el0_32 // Synchronous 32 - bit EL0
81+ ventry irq_invalid_el0_32 // IRQ 32 - bit EL0
82+ ventry fiq_invalid_el0_32 // FIQ 32 - bit EL0
83+ ventry error_invalid_el0_32 // Error 32 - bit EL0
84+
85+ sync_invalid_el1t:
86+ handle_invalid_entry SYNC_INVALID_EL1t
87+
88+ irq_invalid_el1t:
89+ handle_invalid_entry IRQ_INVALID_EL1t
90+
91+ fiq_invalid_el1t:
92+ handle_invalid_entry FIQ_INVALID_EL1t
93+
94+ error_invalid_el1t:
95+ handle_invalid_entry ERROR_INVALID_EL1t
96+
97+ sync_invalid_el1h:
98+ handle_invalid_entry SYNC_INVALID_EL1h
99+
100+ fiq_invalid_el1h:
101+ handle_invalid_entry FIQ_INVALID_EL1h
102+
103+ error_invalid_el1h:
104+ handle_invalid_entry ERROR_INVALID_EL1h
105+
106+ sync_invalid_el0_64:
107+ handle_invalid_entry SYNC_INVALID_EL0_64
108+
109+ irq_invalid_el0_64:
110+ handle_invalid_entry IRQ_INVALID_EL0_64
111+
112+ fiq_invalid_el0_64:
113+ handle_invalid_entry FIQ_INVALID_EL0_64
114+
115+ error_invalid_el0_64:
116+ handle_invalid_entry ERROR_INVALID_EL0_64
117+
118+ sync_invalid_el0_32:
119+ handle_invalid_entry SYNC_INVALID_EL0_32
120+
121+ irq_invalid_el0_32:
122+ handle_invalid_entry IRQ_INVALID_EL0_32
123+
124+ fiq_invalid_el0_32:
125+ handle_invalid_entry FIQ_INVALID_EL0_32
126+
127+ error_invalid_el0_32:
128+ handle_invalid_entry ERROR_INVALID_EL0_32
129+
130+ el1_irq:
131+ kernel_entry
132+ bl handle_irq
133+ kernel_exit
134+
135+ .globl err_hang
136+ err_hang: b err_hang
0 commit comments