aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/unaligned.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2007-01-28 08:52:57 -0500
committerKyle McMartin <kyle@athena.road.mcmartin.ca>2007-02-17 01:16:26 -0500
commit0b3d643f9ead9b5141dedbb2d1b06ce15469fc4a (patch)
tree3be51559fb366dea87dc0eacfea2f94c15190875 /arch/parisc/kernel/unaligned.c
parent8e9e9844b44dd9f855d824d035b3097b199e44ed (diff)
[PARISC] add ASM_EXCEPTIONTABLE_ENTRY() macro
- this macro unifies the code to add exception table entries - additionally use ENTRY()/ENDPROC() at more places Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'arch/parisc/kernel/unaligned.c')
-rw-r--r--arch/parisc/kernel/unaligned.c112
1 files changed, 25 insertions, 87 deletions
diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c
index 58ca443100a2..347bb922e6d0 100644
--- a/arch/parisc/kernel/unaligned.c
+++ b/arch/parisc/kernel/unaligned.c
@@ -35,7 +35,7 @@
35#define DPRINTF(fmt, args...) 35#define DPRINTF(fmt, args...)
36#endif 36#endif
37 37
38#ifdef __LP64__ 38#ifdef CONFIG_64BIT
39#define RFMT "%016lx" 39#define RFMT "%016lx"
40#else 40#else
41#define RFMT "%08lx" 41#define RFMT "%08lx"
@@ -150,15 +150,8 @@ static int emulate_ldh(struct pt_regs *regs, int toreg)
150"4: ldi -2, %1\n" 150"4: ldi -2, %1\n"
151 FIXUP_BRANCH(3b) 151 FIXUP_BRANCH(3b)
152" .previous\n" 152" .previous\n"
153" .section __ex_table,\"aw\"\n" 153 ASM_EXCEPTIONTABLE_ENTRY(1b, 4b)
154#ifdef __LP64__ 154 ASM_EXCEPTIONTABLE_ENTRY(2b, 4b)
155" .dword 1b,4b\n"
156" .dword 2b,4b\n"
157#else
158" .word 1b,4b\n"
159" .word 2b,4b\n"
160#endif
161" .previous\n"
162 : "=r" (val), "=r" (ret) 155 : "=r" (val), "=r" (ret)
163 : "0" (val), "r" (saddr), "r" (regs->isr) 156 : "0" (val), "r" (saddr), "r" (regs->isr)
164 : "r20", FIXUP_BRANCH_CLOBBER ); 157 : "r20", FIXUP_BRANCH_CLOBBER );
@@ -195,15 +188,8 @@ static int emulate_ldw(struct pt_regs *regs, int toreg, int flop)
195"4: ldi -2, %1\n" 188"4: ldi -2, %1\n"
196 FIXUP_BRANCH(3b) 189 FIXUP_BRANCH(3b)
197" .previous\n" 190" .previous\n"
198" .section __ex_table,\"aw\"\n" 191 ASM_EXCEPTIONTABLE_ENTRY(1b, 4b)
199#ifdef __LP64__ 192 ASM_EXCEPTIONTABLE_ENTRY(2b, 4b)
200" .dword 1b,4b\n"
201" .dword 2b,4b\n"
202#else
203" .word 1b,4b\n"
204" .word 2b,4b\n"
205#endif
206" .previous\n"
207 : "=r" (val), "=r" (ret) 193 : "=r" (val), "=r" (ret)
208 : "0" (val), "r" (saddr), "r" (regs->isr) 194 : "0" (val), "r" (saddr), "r" (regs->isr)
209 : "r19", "r20", FIXUP_BRANCH_CLOBBER ); 195 : "r19", "r20", FIXUP_BRANCH_CLOBBER );
@@ -227,7 +213,7 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop)
227 regs->isr, regs->ior, toreg); 213 regs->isr, regs->ior, toreg);
228#ifdef CONFIG_PA20 214#ifdef CONFIG_PA20
229 215
230#ifndef __LP64__ 216#ifndef CONFIG_64BIT
231 if (!flop) 217 if (!flop)
232 return -1; 218 return -1;
233#endif 219#endif
@@ -246,15 +232,8 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop)
246"4: ldi -2, %1\n" 232"4: ldi -2, %1\n"
247 FIXUP_BRANCH(3b) 233 FIXUP_BRANCH(3b)
248" .previous\n" 234" .previous\n"
249" .section __ex_table,\"aw\"\n" 235 ASM_EXCEPTIONTABLE_ENTRY(1b,4b)
250#ifdef __LP64__ 236 ASM_EXCEPTIONTABLE_ENTRY(2b,4b)
251" .dword 1b,4b\n"
252" .dword 2b,4b\n"
253#else
254" .word 1b,4b\n"
255" .word 2b,4b\n"
256#endif
257" .previous\n"
258 : "=r" (val), "=r" (ret) 237 : "=r" (val), "=r" (ret)
259 : "0" (val), "r" (saddr), "r" (regs->isr) 238 : "0" (val), "r" (saddr), "r" (regs->isr)
260 : "r19", "r20", FIXUP_BRANCH_CLOBBER ); 239 : "r19", "r20", FIXUP_BRANCH_CLOBBER );
@@ -278,17 +257,9 @@ static int emulate_ldd(struct pt_regs *regs, int toreg, int flop)
278"5: ldi -2, %2\n" 257"5: ldi -2, %2\n"
279 FIXUP_BRANCH(4b) 258 FIXUP_BRANCH(4b)
280" .previous\n" 259" .previous\n"
281" .section __ex_table,\"aw\"\n" 260 ASM_EXCEPTIONTABLE_ENTRY(1b,5b)
282#ifdef __LP64__ 261 ASM_EXCEPTIONTABLE_ENTRY(2b,5b)
283" .dword 1b,5b\n" 262 ASM_EXCEPTIONTABLE_ENTRY(3b,5b)
284" .dword 2b,5b\n"
285" .dword 3b,5b\n"
286#else
287" .word 1b,5b\n"
288" .word 2b,5b\n"
289" .word 3b,5b\n"
290#endif
291" .previous\n"
292 : "=r" (valh), "=r" (vall), "=r" (ret) 263 : "=r" (valh), "=r" (vall), "=r" (ret)
293 : "0" (valh), "1" (vall), "r" (saddr), "r" (regs->isr) 264 : "0" (valh), "1" (vall), "r" (saddr), "r" (regs->isr)
294 : "r19", "r20", FIXUP_BRANCH_CLOBBER ); 265 : "r19", "r20", FIXUP_BRANCH_CLOBBER );
@@ -328,15 +299,8 @@ static int emulate_sth(struct pt_regs *regs, int frreg)
328"4: ldi -2, %0\n" 299"4: ldi -2, %0\n"
329 FIXUP_BRANCH(3b) 300 FIXUP_BRANCH(3b)
330" .previous\n" 301" .previous\n"
331" .section __ex_table,\"aw\"\n" 302 ASM_EXCEPTIONTABLE_ENTRY(1b,4b)
332#ifdef __LP64__ 303 ASM_EXCEPTIONTABLE_ENTRY(2b,4b)
333" .dword 1b,4b\n"
334" .dword 2b,4b\n"
335#else
336" .word 1b,4b\n"
337" .word 2b,4b\n"
338#endif
339" .previous\n"
340 : "=r" (ret) 304 : "=r" (ret)
341 : "r" (val), "r" (regs->ior), "r" (regs->isr) 305 : "r" (val), "r" (regs->ior), "r" (regs->isr)
342 : "r19", FIXUP_BRANCH_CLOBBER ); 306 : "r19", FIXUP_BRANCH_CLOBBER );
@@ -382,15 +346,8 @@ static int emulate_stw(struct pt_regs *regs, int frreg, int flop)
382"4: ldi -2, %0\n" 346"4: ldi -2, %0\n"
383 FIXUP_BRANCH(3b) 347 FIXUP_BRANCH(3b)
384" .previous\n" 348" .previous\n"
385" .section __ex_table,\"aw\"\n" 349 ASM_EXCEPTIONTABLE_ENTRY(1b,4b)
386#ifdef __LP64__ 350 ASM_EXCEPTIONTABLE_ENTRY(2b,4b)
387" .dword 1b,4b\n"
388" .dword 2b,4b\n"
389#else
390" .word 1b,4b\n"
391" .word 2b,4b\n"
392#endif
393" .previous\n"
394 : "=r" (ret) 351 : "=r" (ret)
395 : "r" (val), "r" (regs->ior), "r" (regs->isr) 352 : "r" (val), "r" (regs->ior), "r" (regs->isr)
396 : "r19", "r20", "r21", "r22", "r1", FIXUP_BRANCH_CLOBBER ); 353 : "r19", "r20", "r21", "r22", "r1", FIXUP_BRANCH_CLOBBER );
@@ -413,7 +370,7 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop)
413 val, regs->isr, regs->ior); 370 val, regs->isr, regs->ior);
414 371
415#ifdef CONFIG_PA20 372#ifdef CONFIG_PA20
416#ifndef __LP64__ 373#ifndef CONFIG_64BIT
417 if (!flop) 374 if (!flop)
418 return -1; 375 return -1;
419#endif 376#endif
@@ -439,19 +396,10 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop)
439"6: ldi -2, %0\n" 396"6: ldi -2, %0\n"
440 FIXUP_BRANCH(5b) 397 FIXUP_BRANCH(5b)
441" .previous\n" 398" .previous\n"
442" .section __ex_table,\"aw\"\n" 399 ASM_EXCEPTIONTABLE_ENTRY(1b,6b)
443#ifdef __LP64__ 400 ASM_EXCEPTIONTABLE_ENTRY(2b,6b)
444" .dword 1b,6b\n" 401 ASM_EXCEPTIONTABLE_ENTRY(3b,6b)
445" .dword 2b,6b\n" 402 ASM_EXCEPTIONTABLE_ENTRY(4b,6b)
446" .dword 3b,6b\n"
447" .dword 4b,6b\n"
448#else
449" .word 1b,6b\n"
450" .word 2b,6b\n"
451" .word 3b,6b\n"
452" .word 4b,6b\n"
453#endif
454" .previous\n"
455 : "=r" (ret) 403 : "=r" (ret)
456 : "r" (val), "r" (regs->ior), "r" (regs->isr) 404 : "r" (val), "r" (regs->ior), "r" (regs->isr)
457 : "r19", "r20", "r21", "r22", "r1", FIXUP_BRANCH_CLOBBER ); 405 : "r19", "r20", "r21", "r22", "r1", FIXUP_BRANCH_CLOBBER );
@@ -482,21 +430,11 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop)
482"7: ldi -2, %0\n" 430"7: ldi -2, %0\n"
483 FIXUP_BRANCH(6b) 431 FIXUP_BRANCH(6b)
484" .previous\n" 432" .previous\n"
485" .section __ex_table,\"aw\"\n" 433 ASM_EXCEPTIONTABLE_ENTRY(1b,7b)
486#ifdef __LP64__ 434 ASM_EXCEPTIONTABLE_ENTRY(2b,7b)
487" .dword 1b,7b\n" 435 ASM_EXCEPTIONTABLE_ENTRY(3b,7b)
488" .dword 2b,7b\n" 436 ASM_EXCEPTIONTABLE_ENTRY(4b,7b)
489" .dword 3b,7b\n" 437 ASM_EXCEPTIONTABLE_ENTRY(5b,7b)
490" .dword 4b,7b\n"
491" .dword 5b,7b\n"
492#else
493" .word 1b,7b\n"
494" .word 2b,7b\n"
495" .word 3b,7b\n"
496" .word 4b,7b\n"
497" .word 5b,7b\n"
498#endif
499" .previous\n"
500 : "=r" (ret) 438 : "=r" (ret)
501 : "r" (valh), "r" (vall), "r" (regs->ior), "r" (regs->isr) 439 : "r" (valh), "r" (vall), "r" (regs->ior), "r" (regs->isr)
502 : "r19", "r20", "r21", "r1", FIXUP_BRANCH_CLOBBER ); 440 : "r19", "r20", "r21", "r1", FIXUP_BRANCH_CLOBBER );