Go to the documentation of this file.
11 #ifndef _ASM_POWERPC_EXCEPTION_64E_H
12 #define _ASM_POWERPC_EXCEPTION_64E_H
40 #define PACA_EXGDBELL PACA_EXGEN
47 #define EX_R10 (2 * 8)
48 #define EX_R11 (3 * 8)
49 #define EX_R13 (4 * 8)
50 #define EX_R14 (5 * 8)
51 #define EX_R15 (6 * 8)
61 #define EX_TLB_R10 ( 0 * 8)
62 #define EX_TLB_R11 ( 1 * 8)
63 #define EX_TLB_R14 ( 2 * 8)
64 #define EX_TLB_R15 ( 3 * 8)
65 #define EX_TLB_R16 ( 4 * 8)
66 #define EX_TLB_CR ( 5 * 8)
67 #define EX_TLB_R12 ( 6 * 8)
68 #define EX_TLB_R13 ( 7 * 8)
69 #define EX_TLB_DEAR ( 8 * 8)
70 #define EX_TLB_ESR ( 9 * 8)
71 #define EX_TLB_SRR0 (10 * 8)
72 #define EX_TLB_SRR1 (11 * 8)
73 #ifdef CONFIG_BOOK3E_MMU_TLB_STATS
74 #define EX_TLB_R8 (12 * 8)
75 #define EX_TLB_R9 (13 * 8)
76 #define EX_TLB_LR (14 * 8)
77 #define EX_TLB_SIZE (15 * 8)
79 #define EX_TLB_SIZE (12 * 8)
82 #define START_EXCEPTION(label) \
83 .globl exc_##label##_book3e; \
98 #define TLB_MISS_PROLOG \
99 mtspr SPRN_SPRG_TLB_SCRATCH,r12; \
100 mfspr r12,SPRN_SPRG_TLB_EXFRAME; \
101 std r10,EX_TLB_R10(r12); \
103 std r11,EX_TLB_R11(r12); \
104 mfspr r11,SPRN_SPRG_TLB_SCRATCH; \
105 std r13,EX_TLB_R13(r12); \
106 mfspr r13,SPRN_SPRG_PACA; \
107 std r14,EX_TLB_R14(r12); \
108 addi r14,r12,EX_TLB_SIZE; \
109 std r15,EX_TLB_R15(r12); \
110 mfspr r15,SPRN_SRR1; \
111 std r16,EX_TLB_R16(r12); \
112 mfspr r16,SPRN_SRR0; \
113 std r10,EX_TLB_CR(r12); \
114 std r11,EX_TLB_R12(r12); \
115 mtspr SPRN_SPRG_TLB_EXFRAME,r14; \
116 std r15,EX_TLB_SRR1(r12); \
117 std r16,EX_TLB_SRR0(r12); \
118 TLB_MISS_PROLOG_STATS
137 #define TLB_MISS_RESTORE(freg) \
138 ld r14,EX_TLB_CR(r12); \
139 ld r10,EX_TLB_R10(r12); \
140 ld r15,EX_TLB_SRR0(r12); \
141 ld r16,EX_TLB_SRR1(r12); \
142 mtspr SPRN_SPRG_TLB_EXFRAME,freg; \
143 ld r11,EX_TLB_R11(r12); \
145 ld r13,EX_TLB_R13(r12); \
146 ld r14,EX_TLB_R14(r12); \
147 mtspr SPRN_SRR0,r15; \
148 ld r15,EX_TLB_R15(r12); \
149 mtspr SPRN_SRR1,r16; \
150 TLB_MISS_RESTORE_STATS \
151 ld r16,EX_TLB_R16(r12); \
152 ld r12,EX_TLB_R12(r12); \
154 #define TLB_MISS_EPILOG_SUCCESS \
155 TLB_MISS_RESTORE(r12)
157 #define TLB_MISS_EPILOG_ERROR \
158 addi r12,r13,PACA_EXTLB; \
159 TLB_MISS_RESTORE(r12)
161 #define TLB_MISS_EPILOG_ERROR_SPECIAL \
162 addi r11,r13,PACA_EXTLB; \
163 TLB_MISS_RESTORE(r11)
165 #ifdef CONFIG_BOOK3E_MMU_TLB_STATS
166 #define TLB_MISS_PROLOG_STATS \
168 std r8,EX_TLB_R8(r12); \
169 std r9,EX_TLB_R9(r12); \
170 std r10,EX_TLB_LR(r12);
171 #define TLB_MISS_RESTORE_STATS \
172 ld r16,EX_TLB_LR(r12); \
173 ld r9,EX_TLB_R9(r12); \
174 ld r8,EX_TLB_R8(r12); \
176 #define TLB_MISS_PROLOG_STATS_BOLTED \
178 std r8,PACA_EXTLB+EX_TLB_R8(r13); \
179 std r9,PACA_EXTLB+EX_TLB_R9(r13); \
180 std r10,PACA_EXTLB+EX_TLB_LR(r13);
181 #define TLB_MISS_RESTORE_STATS_BOLTED \
182 ld r16,PACA_EXTLB+EX_TLB_LR(r13); \
183 ld r9,PACA_EXTLB+EX_TLB_R9(r13); \
184 ld r8,PACA_EXTLB+EX_TLB_R8(r13); \
186 #define TLB_MISS_STATS_D(name) \
187 addi r9,r13,MMSTAT_DSTATS+name; \
189 #define TLB_MISS_STATS_I(name) \
190 addi r9,r13,MMSTAT_ISTATS+name; \
192 #define TLB_MISS_STATS_X(name) \
193 ld r8,PACA_EXTLB+EX_TLB_ESR(r13); \
196 addi r9,r13,MMSTAT_DSTATS+name; \
198 61: addi r9,r13,MMSTAT_ISTATS+name; \
199 62: bl .tlb_stat_inc;
200 #define TLB_MISS_STATS_SAVE_INFO \
201 std r14,EX_TLB_ESR(r12);
202 #define TLB_MISS_STATS_SAVE_INFO_BOLTED \
203 std r14,PACA_EXTLB+EX_TLB_ESR(r13);
205 #define TLB_MISS_PROLOG_STATS
206 #define TLB_MISS_RESTORE_STATS
207 #define TLB_MISS_PROLOG_STATS_BOLTED
208 #define TLB_MISS_RESTORE_STATS_BOLTED
209 #define TLB_MISS_STATS_D(name)
210 #define TLB_MISS_STATS_I(name)
211 #define TLB_MISS_STATS_X(name)
212 #define TLB_MISS_STATS_Y(name)
213 #define TLB_MISS_STATS_SAVE_INFO
214 #define TLB_MISS_STATS_SAVE_INFO_BOLTED
217 #define SET_IVOR(vector_number, vector_offset) \
218 li r3,vector_offset@l; \
219 ori r3,r3,interrupt_base_book3e@l; \
220 mtspr SPRN_IVOR##vector_number,r3;