diff options
Diffstat (limited to 'arch/parisc/kernel/syscall.S')
| -rw-r--r-- | arch/parisc/kernel/syscall.S | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 8c7a7185cd3b..b29b76b42bb7 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | * thanks to Philipp Rumpf, Mike Shaver and various others | 6 | * thanks to Philipp Rumpf, Mike Shaver and various others |
| 7 | * sorry about the wall, puffin.. | 7 | * sorry about the wall, puffin.. |
| 8 | */ | 8 | */ |
| 9 | #include <linux/config.h> /* for CONFIG_SMP */ | ||
| 9 | 10 | ||
| 10 | #include <asm/asm-offsets.h> | 11 | #include <asm/asm-offsets.h> |
| 11 | #include <asm/unistd.h> | 12 | #include <asm/unistd.h> |
| @@ -22,15 +23,13 @@ | |||
| 22 | */ | 23 | */ |
| 23 | #define KILL_INSN break 0,0 | 24 | #define KILL_INSN break 0,0 |
| 24 | 25 | ||
| 25 | #include <linux/config.h> /* for CONFIG_SMP */ | 26 | #ifdef CONFIG_64BIT |
| 26 | |||
| 27 | #ifdef __LP64__ | ||
| 28 | .level 2.0w | 27 | .level 2.0w |
| 29 | #else | 28 | #else |
| 30 | .level 1.1 | 29 | .level 1.1 |
| 31 | #endif | 30 | #endif |
| 32 | 31 | ||
| 33 | #ifndef __LP64__ | 32 | #ifndef CONFIG_64BIT |
| 34 | .macro fixup_branch,lbl | 33 | .macro fixup_branch,lbl |
| 35 | b \lbl | 34 | b \lbl |
| 36 | .endm | 35 | .endm |
| @@ -103,7 +102,7 @@ linux_gateway_entry: | |||
| 103 | mfsp %sr7,%r1 /* save user sr7 */ | 102 | mfsp %sr7,%r1 /* save user sr7 */ |
| 104 | mtsp %r1,%sr3 /* and store it in sr3 */ | 103 | mtsp %r1,%sr3 /* and store it in sr3 */ |
| 105 | 104 | ||
| 106 | #ifdef __LP64__ | 105 | #ifdef CONFIG_64BIT |
| 107 | /* for now we can *always* set the W bit on entry to the syscall | 106 | /* for now we can *always* set the W bit on entry to the syscall |
| 108 | * since we don't support wide userland processes. We could | 107 | * since we don't support wide userland processes. We could |
| 109 | * also save the current SM other than in r0 and restore it on | 108 | * also save the current SM other than in r0 and restore it on |
| @@ -155,7 +154,7 @@ linux_gateway_entry: | |||
| 155 | STREG %r19, TASK_PT_GR19(%r1) | 154 | STREG %r19, TASK_PT_GR19(%r1) |
| 156 | 155 | ||
| 157 | LDREGM -FRAME_SIZE(%r30), %r2 /* get users sp back */ | 156 | LDREGM -FRAME_SIZE(%r30), %r2 /* get users sp back */ |
| 158 | #ifdef __LP64__ | 157 | #ifdef CONFIG_64BIT |
| 159 | extrd,u %r2,63,1,%r19 /* W hidden in bottom bit */ | 158 | extrd,u %r2,63,1,%r19 /* W hidden in bottom bit */ |
| 160 | #if 0 | 159 | #if 0 |
| 161 | xor %r19,%r2,%r2 /* clear bottom bit */ | 160 | xor %r19,%r2,%r2 /* clear bottom bit */ |
| @@ -186,7 +185,7 @@ linux_gateway_entry: | |||
| 186 | 185 | ||
| 187 | loadgp | 186 | loadgp |
| 188 | 187 | ||
| 189 | #ifdef __LP64__ | 188 | #ifdef CONFIG_64BIT |
| 190 | ldo -16(%r30),%r29 /* Reference param save area */ | 189 | ldo -16(%r30),%r29 /* Reference param save area */ |
| 191 | copy %r19,%r2 /* W bit back to r2 */ | 190 | copy %r19,%r2 /* W bit back to r2 */ |
| 192 | #else | 191 | #else |
| @@ -205,7 +204,7 @@ linux_gateway_entry: | |||
| 205 | /* Note! We cannot use the syscall table that is mapped | 204 | /* Note! We cannot use the syscall table that is mapped |
| 206 | nearby since the gateway page is mapped execute-only. */ | 205 | nearby since the gateway page is mapped execute-only. */ |
| 207 | 206 | ||
| 208 | #ifdef __LP64__ | 207 | #ifdef CONFIG_64BIT |
| 209 | ldil L%sys_call_table, %r1 | 208 | ldil L%sys_call_table, %r1 |
| 210 | or,= %r2,%r2,%r2 | 209 | or,= %r2,%r2,%r2 |
| 211 | addil L%(sys_call_table64-sys_call_table), %r1 | 210 | addil L%(sys_call_table64-sys_call_table), %r1 |
| @@ -321,7 +320,7 @@ tracesys_next: | |||
| 321 | LDREG TASK_PT_GR25(%r1), %r25 | 320 | LDREG TASK_PT_GR25(%r1), %r25 |
| 322 | LDREG TASK_PT_GR24(%r1), %r24 | 321 | LDREG TASK_PT_GR24(%r1), %r24 |
| 323 | LDREG TASK_PT_GR23(%r1), %r23 | 322 | LDREG TASK_PT_GR23(%r1), %r23 |
| 324 | #ifdef __LP64__ | 323 | #ifdef CONFIG_64BIT |
| 325 | LDREG TASK_PT_GR22(%r1), %r22 | 324 | LDREG TASK_PT_GR22(%r1), %r22 |
| 326 | LDREG TASK_PT_GR21(%r1), %r21 | 325 | LDREG TASK_PT_GR21(%r1), %r21 |
| 327 | ldo -16(%r30),%r29 /* Reference param save area */ | 326 | ldo -16(%r30),%r29 /* Reference param save area */ |
| @@ -350,7 +349,7 @@ tracesys_next: | |||
| 350 | tracesys_exit: | 349 | tracesys_exit: |
| 351 | ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ | 350 | ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ |
| 352 | LDREG TI_TASK(%r1), %r1 | 351 | LDREG TI_TASK(%r1), %r1 |
| 353 | #ifdef __LP64__ | 352 | #ifdef CONFIG_64BIT |
| 354 | ldo -16(%r30),%r29 /* Reference param save area */ | 353 | ldo -16(%r30),%r29 /* Reference param save area */ |
| 355 | #endif | 354 | #endif |
| 356 | bl syscall_trace, %r2 | 355 | bl syscall_trace, %r2 |
| @@ -371,7 +370,7 @@ tracesys_exit: | |||
| 371 | tracesys_sigexit: | 370 | tracesys_sigexit: |
| 372 | ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ | 371 | ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */ |
| 373 | LDREG 0(%r1), %r1 | 372 | LDREG 0(%r1), %r1 |
| 374 | #ifdef __LP64__ | 373 | #ifdef CONFIG_64BIT |
| 375 | ldo -16(%r30),%r29 /* Reference param save area */ | 374 | ldo -16(%r30),%r29 /* Reference param save area */ |
| 376 | #endif | 375 | #endif |
| 377 | bl syscall_trace, %r2 | 376 | bl syscall_trace, %r2 |
| @@ -404,7 +403,7 @@ lws_start: | |||
| 404 | gate .+8, %r0 | 403 | gate .+8, %r0 |
| 405 | depi 3, 31, 2, %r31 /* Ensure we return to userspace */ | 404 | depi 3, 31, 2, %r31 /* Ensure we return to userspace */ |
| 406 | 405 | ||
| 407 | #ifdef __LP64__ | 406 | #ifdef CONFIG_64BIT |
| 408 | /* FIXME: If we are a 64-bit kernel just | 407 | /* FIXME: If we are a 64-bit kernel just |
| 409 | * turn this on unconditionally. | 408 | * turn this on unconditionally. |
| 410 | */ | 409 | */ |
| @@ -440,7 +439,7 @@ lws_exit_nosys: | |||
| 440 | /* Fall through: Return to userspace */ | 439 | /* Fall through: Return to userspace */ |
| 441 | 440 | ||
| 442 | lws_exit: | 441 | lws_exit: |
| 443 | #ifdef __LP64__ | 442 | #ifdef CONFIG_64BIT |
| 444 | /* decide whether to reset the wide mode bit | 443 | /* decide whether to reset the wide mode bit |
| 445 | * | 444 | * |
| 446 | * For a syscall, the W bit is stored in the lowest bit | 445 | * For a syscall, the W bit is stored in the lowest bit |
| @@ -486,7 +485,7 @@ lws_exit: | |||
| 486 | 485 | ||
| 487 | /* ELF64 Process entry path */ | 486 | /* ELF64 Process entry path */ |
| 488 | lws_compare_and_swap64: | 487 | lws_compare_and_swap64: |
| 489 | #ifdef __LP64__ | 488 | #ifdef CONFIG_64BIT |
| 490 | b,n lws_compare_and_swap | 489 | b,n lws_compare_and_swap |
| 491 | #else | 490 | #else |
| 492 | /* If we are not a 64-bit kernel, then we don't | 491 | /* If we are not a 64-bit kernel, then we don't |
| @@ -497,7 +496,7 @@ lws_compare_and_swap64: | |||
| 497 | 496 | ||
| 498 | /* ELF32 Process entry path */ | 497 | /* ELF32 Process entry path */ |
| 499 | lws_compare_and_swap32: | 498 | lws_compare_and_swap32: |
| 500 | #ifdef __LP64__ | 499 | #ifdef CONFIG_64BIT |
| 501 | /* Clip all the input registers */ | 500 | /* Clip all the input registers */ |
| 502 | depdi 0, 31, 32, %r26 | 501 | depdi 0, 31, 32, %r26 |
| 503 | depdi 0, 31, 32, %r25 | 502 | depdi 0, 31, 32, %r25 |
| @@ -608,7 +607,7 @@ cas_action: | |||
| 608 | the other for the store. Either return -EFAULT. | 607 | the other for the store. Either return -EFAULT. |
| 609 | Each of the entries must be relocated. */ | 608 | Each of the entries must be relocated. */ |
| 610 | .section __ex_table,"aw" | 609 | .section __ex_table,"aw" |
| 611 | #ifdef __LP64__ | 610 | #ifdef CONFIG_64BIT |
| 612 | /* Pad the address calculation */ | 611 | /* Pad the address calculation */ |
| 613 | .word 0,(2b - linux_gateway_page) | 612 | .word 0,(2b - linux_gateway_page) |
| 614 | .word 0,(3b - linux_gateway_page) | 613 | .word 0,(3b - linux_gateway_page) |
| @@ -619,7 +618,7 @@ cas_action: | |||
| 619 | .previous | 618 | .previous |
| 620 | 619 | ||
| 621 | .section __ex_table,"aw" | 620 | .section __ex_table,"aw" |
| 622 | #ifdef __LP64__ | 621 | #ifdef CONFIG_64BIT |
| 623 | /* Pad the address calculation */ | 622 | /* Pad the address calculation */ |
| 624 | .word 0,(1b - linux_gateway_page) | 623 | .word 0,(1b - linux_gateway_page) |
| 625 | .word 0,(3b - linux_gateway_page) | 624 | .word 0,(3b - linux_gateway_page) |
| @@ -638,7 +637,7 @@ end_linux_gateway_page: | |||
| 638 | 637 | ||
| 639 | /* Relocate symbols assuming linux_gateway_page is mapped | 638 | /* Relocate symbols assuming linux_gateway_page is mapped |
| 640 | to virtual address 0x0 */ | 639 | to virtual address 0x0 */ |
| 641 | #ifdef __LP64__ | 640 | #ifdef CONFIG_64BIT |
| 642 | /* FIXME: The code will always be on the gateay page | 641 | /* FIXME: The code will always be on the gateay page |
| 643 | and thus it will be on the first 4k, the | 642 | and thus it will be on the first 4k, the |
| 644 | assembler seems to think that the final | 643 | assembler seems to think that the final |
| @@ -666,7 +665,7 @@ lws_table: | |||
| 666 | sys_call_table: | 665 | sys_call_table: |
| 667 | #include "syscall_table.S" | 666 | #include "syscall_table.S" |
| 668 | 667 | ||
| 669 | #ifdef __LP64__ | 668 | #ifdef CONFIG_64BIT |
| 670 | .align 4096 | 669 | .align 4096 |
| 671 | .export sys_call_table64 | 670 | .export sys_call_table64 |
| 672 | .Lsys_call_table64: | 671 | .Lsys_call_table64: |
