diff options
author | Helge Deller <deller@gmx.de> | 2007-01-28 08:52:57 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@athena.road.mcmartin.ca> | 2007-02-17 01:16:26 -0500 |
commit | 0b3d643f9ead9b5141dedbb2d1b06ce15469fc4a (patch) | |
tree | 3be51559fb366dea87dc0eacfea2f94c15190875 /arch/parisc/kernel | |
parent | 8e9e9844b44dd9f855d824d035b3097b199e44ed (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')
-rw-r--r-- | arch/parisc/kernel/pacache.S | 9 | ||||
-rw-r--r-- | arch/parisc/kernel/syscall.S | 26 | ||||
-rw-r--r-- | arch/parisc/kernel/unaligned.c | 112 |
3 files changed, 29 insertions, 118 deletions
diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S index 75d522e2d058..90b240878520 100644 --- a/arch/parisc/kernel/pacache.S +++ b/arch/parisc/kernel/pacache.S | |||
@@ -27,20 +27,11 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifdef CONFIG_64BIT | 29 | #ifdef CONFIG_64BIT |
30 | #define ADDIB addib,* | ||
31 | #define CMPB cmpb,* | ||
32 | #define ANDCM andcm,* | ||
33 | |||
34 | .level 2.0w | 30 | .level 2.0w |
35 | #else | 31 | #else |
36 | #define ADDIB addib, | ||
37 | #define CMPB cmpb, | ||
38 | #define ANDCM andcm | ||
39 | |||
40 | .level 2.0 | 32 | .level 2.0 |
41 | #endif | 33 | #endif |
42 | 34 | ||
43 | |||
44 | #include <asm/psw.h> | 35 | #include <asm/psw.h> |
45 | #include <asm/assembly.h> | 36 | #include <asm/assembly.h> |
46 | #include <asm/pgtable.h> | 37 | #include <asm/pgtable.h> |
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index de1812de5183..10859f53e94f 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S | |||
@@ -23,19 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | #define KILL_INSN break 0,0 | 24 | #define KILL_INSN break 0,0 |
25 | 25 | ||
26 | #ifdef CONFIG_64BIT | 26 | .level LEVEL |
27 | .level 2.0w | ||
28 | #else | ||
29 | .level 1.1 | ||
30 | #endif | ||
31 | |||
32 | /* on 64bit pad to 64bit values */ | ||
33 | #ifdef CONFIG_64BIT | ||
34 | #define ULONG_WORD(x) .word 0, x | ||
35 | #else | ||
36 | #define ULONG_WORD(x) .word x | ||
37 | #endif | ||
38 | |||
39 | 27 | ||
40 | .text | 28 | .text |
41 | 29 | ||
@@ -603,16 +591,10 @@ cas_action: | |||
603 | the other for the store. Either return -EFAULT. | 591 | the other for the store. Either return -EFAULT. |
604 | Each of the entries must be relocated. */ | 592 | Each of the entries must be relocated. */ |
605 | .section __ex_table,"aw" | 593 | .section __ex_table,"aw" |
606 | ULONG_WORD(2b - linux_gateway_page) | 594 | ASM_ULONG_INSN (1b - linux_gateway_page), (3b - linux_gateway_page) |
607 | ULONG_WORD(3b - linux_gateway_page) | 595 | ASM_ULONG_INSN (2b - linux_gateway_page), (3b - linux_gateway_page) |
608 | .previous | ||
609 | |||
610 | .section __ex_table,"aw" | ||
611 | ULONG_WORD(1b - linux_gateway_page) | ||
612 | ULONG_WORD(3b - linux_gateway_page) | ||
613 | .previous | 596 | .previous |
614 | 597 | ||
615 | end_compare_and_swap: | ||
616 | 598 | ||
617 | /* Make sure nothing else is placed on this page */ | 599 | /* Make sure nothing else is placed on this page */ |
618 | .align ASM_PAGE_SIZE | 600 | .align ASM_PAGE_SIZE |
@@ -622,7 +604,7 @@ ENTRY(end_linux_gateway_page) | |||
622 | /* Relocate symbols assuming linux_gateway_page is mapped | 604 | /* Relocate symbols assuming linux_gateway_page is mapped |
623 | to virtual address 0x0 */ | 605 | to virtual address 0x0 */ |
624 | 606 | ||
625 | #define LWS_ENTRY(_name_) ULONG_WORD(lws_##_name_ - linux_gateway_page) | 607 | #define LWS_ENTRY(_name_) ASM_ULONG_INSN (lws_##_name_ - linux_gateway_page) |
626 | 608 | ||
627 | .section .rodata,"a" | 609 | .section .rodata,"a" |
628 | 610 | ||
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 ); |