aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-05 00:27:11 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-19 21:03:23 -0400
commitb3e6b5dfcf0974069a8ddcce7dd071120d20d79c (patch)
tree96b8b9446ad134d9aab9021d97c292c0fafd8e90 /arch/powerpc/include
parenta5d4f3ad3a28cf046836b9bfae61d532b8f77036 (diff)
powerpc: More work to support HV exceptions
Rework exception macros a bit to split offset from vector and add some basic support for HDEC, HDSI, HISI and a few more. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/exception-64s.h37
-rw-r--r--arch/powerpc/include/asm/feature-fixups.h2
2 files changed, 25 insertions, 14 deletions
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 1d98e05be511..fb5b0af30fcf 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -150,28 +150,27 @@
150/* 150/*
151 * Exception vectors. 151 * Exception vectors.
152 */ 152 */
153#define STD_EXCEPTION_PSERIES(n, label) \ 153#define STD_EXCEPTION_PSERIES(loc, vec, label) \
154 . = n; \ 154 . = loc; \
155 .globl label##_pSeries; \ 155 .globl label##_pSeries; \
156label##_pSeries: \ 156label##_pSeries: \
157 HMT_MEDIUM; \ 157 HMT_MEDIUM; \
158 DO_KVM n; \ 158 DO_KVM vec; \
159 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \ 159 mtspr SPRN_SPRG_SCRATCH0,r13; /* save r13 */ \
160 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common, EXC_STD) 160 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common, EXC_STD)
161 161
162#define HSTD_EXCEPTION_PSERIES(n, label) \ 162#define STD_EXCEPTION_HV(loc, vec, label) \
163 . = n; \ 163 . = loc; \
164 .globl label##_pSeries; \ 164 .globl label##_hv; \
165label##_pSeries: \ 165label##_hv: \
166 HMT_MEDIUM; \ 166 HMT_MEDIUM; \
167 DO_KVM n; \ 167 DO_KVM vec; \
168 mtspr SPRN_SPRG_HSCRATCH0,r13;/* save r13 */ \ 168 mtspr SPRN_SPRG_HSCRATCH0,r13;/* save r13 */ \
169 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common, EXC_HV) 169 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common, EXC_HV)
170 170
171 171#define __MASKABLE_EXCEPTION_PSERIES(vec, label, h) \
172#define __MASKABLE_EXCEPTION_PSERIES(n, label, h) \
173 HMT_MEDIUM; \ 172 HMT_MEDIUM; \
174 DO_KVM n; \ 173 DO_KVM vec; \
175 mtspr SPRN_SPRG_##h##SCRATCH0,r13; /* save r13 */ \ 174 mtspr SPRN_SPRG_##h##SCRATCH0,r13; /* save r13 */ \
176 GET_PACA(r13); \ 175 GET_PACA(r13); \
177 std r9,PACA_EXGEN+EX_R9(r13); /* save r9, r10 */ \ 176 std r9,PACA_EXGEN+EX_R9(r13); /* save r9, r10 */ \
@@ -193,8 +192,20 @@ label##_pSeries: \
193 mtspr SPRN_##h##SRR1,r10; \ 192 mtspr SPRN_##h##SRR1,r10; \
194 h##rfid; \ 193 h##rfid; \
195 b . /* prevent speculative execution */ 194 b . /* prevent speculative execution */
196#define MASKABLE_EXCEPTION_PSERIES(n, label, h) \ 195#define _MASKABLE_EXCEPTION_PSERIES(vec, label, h) \
197 __MASKABLE_EXCEPTION_PSERIES(n, label, h) 196 __MASKABLE_EXCEPTION_PSERIES(vec, label, h)
197
198#define MASKABLE_EXCEPTION_PSERIES(loc, vec, label) \
199 . = loc; \
200 .globl label##_pSeries; \
201label##_pSeries: \
202 _MASKABLE_EXCEPTION_PSERIES(vec, label, EXC_STD)
203
204#define MASKABLE_EXCEPTION_HV(loc, vec, label) \
205 . = loc; \
206 .globl label##_hv; \
207label##_hv: \
208 _MASKABLE_EXCEPTION_PSERIES(vec, label, EXC_HV)
198 209
199#ifdef CONFIG_PPC_ISERIES 210#ifdef CONFIG_PPC_ISERIES
200#define DISABLE_INTS \ 211#define DISABLE_INTS \
diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h
index 921a8470e18a..bdc0d6877bce 100644
--- a/arch/powerpc/include/asm/feature-fixups.h
+++ b/arch/powerpc/include/asm/feature-fixups.h
@@ -49,7 +49,7 @@ label##5: \
49 FTR_ENTRY_OFFSET label##2b-label##5b; \ 49 FTR_ENTRY_OFFSET label##2b-label##5b; \
50 FTR_ENTRY_OFFSET label##3b-label##5b; \ 50 FTR_ENTRY_OFFSET label##3b-label##5b; \
51 FTR_ENTRY_OFFSET label##4b-label##5b; \ 51 FTR_ENTRY_OFFSET label##4b-label##5b; \
52 .ifgt (label##4b-label##3b)-(label##2b-label##1b); \ 52 .ifgt (label##4b- label##3b)-(label##2b- label##1b); \
53 .error "Feature section else case larger than body"; \ 53 .error "Feature section else case larger than body"; \
54 .endif; \ 54 .endif; \
55 .popsection; 55 .popsection;