aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2007-08-21 23:48:37 -0400
committerPaul Mackerras <paulus@samba.org>2007-08-22 02:48:35 -0400
commit7180e3e636deff82f8810291878a184f21142fa9 (patch)
tree00e6e833269df0dbcaa7b11059fa5c0a7e446812 /include/asm-powerpc
parentdc8f571a26689102f6abe2565a84226edeaacc61 (diff)
[POWERPC] Split out iSeries specific exception macros
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/exception.h71
1 files changed, 12 insertions, 59 deletions
diff --git a/include/asm-powerpc/exception.h b/include/asm-powerpc/exception.h
index 1980ed364a9c..d850c8ea5903 100644
--- a/include/asm-powerpc/exception.h
+++ b/include/asm-powerpc/exception.h
@@ -62,6 +62,16 @@
62 ori reg,reg,(label)@l; /* virt addr of handler ... */ 62 ori reg,reg,(label)@l; /* virt addr of handler ... */
63#endif 63#endif
64 64
65#define EXCEPTION_PROLOG_1(area) \
66 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
67 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
68 std r10,area+EX_R10(r13); \
69 std r11,area+EX_R11(r13); \
70 std r12,area+EX_R12(r13); \
71 mfspr r9,SPRN_SPRG1; \
72 std r9,area+EX_R13(r13); \
73 mfcr r9
74
65/* 75/*
66 * Equal to EXCEPTION_PROLOG_PSERIES, except that it forces 64bit mode. 76 * Equal to EXCEPTION_PROLOG_PSERIES, except that it forces 64bit mode.
67 * The firmware calls the registered system_reset_fwnmi and 77 * The firmware calls the registered system_reset_fwnmi and
@@ -70,14 +80,7 @@
70 * This firmware bug is present on POWER4 and JS20. 80 * This firmware bug is present on POWER4 and JS20.
71 */ 81 */
72#define EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(area, label) \ 82#define EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(area, label) \
73 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ 83 EXCEPTION_PROLOG_1(area); \
74 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
75 std r10,area+EX_R10(r13); \
76 std r11,area+EX_R11(r13); \
77 std r12,area+EX_R12(r13); \
78 mfspr r9,SPRN_SPRG1; \
79 std r9,area+EX_R13(r13); \
80 mfcr r9; \
81 clrrdi r12,r13,32; /* get high part of &label */ \ 84 clrrdi r12,r13,32; /* get high part of &label */ \
82 mfmsr r10; \ 85 mfmsr r10; \
83 /* force 64bit mode */ \ 86 /* force 64bit mode */ \
@@ -94,14 +97,7 @@
94 b . /* prevent speculative execution */ 97 b . /* prevent speculative execution */
95 98
96#define EXCEPTION_PROLOG_PSERIES(area, label) \ 99#define EXCEPTION_PROLOG_PSERIES(area, label) \
97 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ 100 EXCEPTION_PROLOG_1(area); \
98 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
99 std r10,area+EX_R10(r13); \
100 std r11,area+EX_R11(r13); \
101 std r12,area+EX_R12(r13); \
102 mfspr r9,SPRN_SPRG1; \
103 std r9,area+EX_R13(r13); \
104 mfcr r9; \
105 clrrdi r12,r13,32; /* get high part of &label */ \ 101 clrrdi r12,r13,32; /* get high part of &label */ \
106 mfmsr r10; \ 102 mfmsr r10; \
107 mfspr r11,SPRN_SRR0; /* save SRR0 */ \ 103 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
@@ -114,28 +110,6 @@
114 b . /* prevent speculative execution */ 110 b . /* prevent speculative execution */
115 111
116/* 112/*
117 * This is the start of the interrupt handlers for iSeries
118 * This code runs with relocation on.
119 */
120#define EXCEPTION_PROLOG_ISERIES_1(area) \
121 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
122 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
123 std r10,area+EX_R10(r13); \
124 std r11,area+EX_R11(r13); \
125 std r12,area+EX_R12(r13); \
126 mfspr r9,SPRN_SPRG1; \
127 std r9,area+EX_R13(r13); \
128 mfcr r9
129
130#define EXCEPTION_PROLOG_ISERIES_2 \
131 mfmsr r10; \
132 ld r12,PACALPPACAPTR(r13); \
133 ld r11,LPPACASRR0(r12); \
134 ld r12,LPPACASRR1(r12); \
135 ori r10,r10,MSR_RI; \
136 mtmsrd r10,1
137
138/*
139 * The common exception prolog is used for all except a few exceptions 113 * The common exception prolog is used for all except a few exceptions
140 * such as a segment miss on a kernel address. We have to be prepared 114 * such as a segment miss on a kernel address. We have to be prepared
141 * to take another exception from the point where we first touch the 115 * to take another exception from the point where we first touch the
@@ -247,27 +221,6 @@ label##_pSeries: \
247 rfid; \ 221 rfid; \
248 b . /* prevent speculative execution */ 222 b . /* prevent speculative execution */
249 223
250#define STD_EXCEPTION_ISERIES(n, label, area) \
251 .globl label##_iSeries; \
252label##_iSeries: \
253 HMT_MEDIUM; \
254 mtspr SPRN_SPRG1,r13; /* save r13 */ \
255 EXCEPTION_PROLOG_ISERIES_1(area); \
256 EXCEPTION_PROLOG_ISERIES_2; \
257 b label##_common
258
259#define MASKABLE_EXCEPTION_ISERIES(n, label) \
260 .globl label##_iSeries; \
261label##_iSeries: \
262 HMT_MEDIUM; \
263 mtspr SPRN_SPRG1,r13; /* save r13 */ \
264 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \
265 lbz r10,PACASOFTIRQEN(r13); \
266 cmpwi 0,r10,0; \
267 beq- label##_iSeries_masked; \
268 EXCEPTION_PROLOG_ISERIES_2; \
269 b label##_common; \
270
271#ifdef CONFIG_PPC_ISERIES 224#ifdef CONFIG_PPC_ISERIES
272#define DISABLE_INTS \ 225#define DISABLE_INTS \
273 li r11,0; \ 226 li r11,0; \