diff options
Diffstat (limited to 'arch/parisc/kernel/syscall.S')
-rw-r--r-- | arch/parisc/kernel/syscall.S | 71 |
1 files changed, 27 insertions, 44 deletions
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index a05800429304..de1812de5183 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S | |||
@@ -12,10 +12,11 @@ | |||
12 | #include <asm/errno.h> | 12 | #include <asm/errno.h> |
13 | #include <asm/psw.h> | 13 | #include <asm/psw.h> |
14 | #include <asm/thread_info.h> | 14 | #include <asm/thread_info.h> |
15 | |||
16 | #include <asm/assembly.h> | 15 | #include <asm/assembly.h> |
17 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
18 | 17 | ||
18 | #include <linux/linkage.h> | ||
19 | |||
19 | /* We fill the empty parts of the gateway page with | 20 | /* We fill the empty parts of the gateway page with |
20 | * something that will kill the kernel or a | 21 | * something that will kill the kernel or a |
21 | * userspace application. | 22 | * userspace application. |
@@ -28,11 +29,18 @@ | |||
28 | .level 1.1 | 29 | .level 1.1 |
29 | #endif | 30 | #endif |
30 | 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 | |||
31 | .text | 40 | .text |
32 | 41 | ||
33 | .import syscall_exit,code | 42 | .import syscall_exit,code |
34 | .import syscall_exit_rfi,code | 43 | .import syscall_exit_rfi,code |
35 | .export linux_gateway_page | ||
36 | 44 | ||
37 | /* Linux gateway page is aliased to virtual page 0 in the kernel | 45 | /* Linux gateway page is aliased to virtual page 0 in the kernel |
38 | * address space. Since it is a gateway page it cannot be | 46 | * address space. Since it is a gateway page it cannot be |
@@ -43,7 +51,7 @@ | |||
43 | */ | 51 | */ |
44 | 52 | ||
45 | .align ASM_PAGE_SIZE | 53 | .align ASM_PAGE_SIZE |
46 | linux_gateway_page: | 54 | ENTRY(linux_gateway_page) |
47 | 55 | ||
48 | /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */ | 56 | /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */ |
49 | .rept 44 | 57 | .rept 44 |
@@ -595,73 +603,49 @@ cas_action: | |||
595 | the other for the store. Either return -EFAULT. | 603 | the other for the store. Either return -EFAULT. |
596 | Each of the entries must be relocated. */ | 604 | Each of the entries must be relocated. */ |
597 | .section __ex_table,"aw" | 605 | .section __ex_table,"aw" |
598 | #ifdef CONFIG_64BIT | 606 | ULONG_WORD(2b - linux_gateway_page) |
599 | /* Pad the address calculation */ | 607 | ULONG_WORD(3b - linux_gateway_page) |
600 | .word 0,(2b - linux_gateway_page) | ||
601 | .word 0,(3b - linux_gateway_page) | ||
602 | #else | ||
603 | .word (2b - linux_gateway_page) | ||
604 | .word (3b - linux_gateway_page) | ||
605 | #endif | ||
606 | .previous | 608 | .previous |
607 | 609 | ||
608 | .section __ex_table,"aw" | 610 | .section __ex_table,"aw" |
609 | #ifdef CONFIG_64BIT | 611 | ULONG_WORD(1b - linux_gateway_page) |
610 | /* Pad the address calculation */ | 612 | ULONG_WORD(3b - linux_gateway_page) |
611 | .word 0,(1b - linux_gateway_page) | ||
612 | .word 0,(3b - linux_gateway_page) | ||
613 | #else | ||
614 | .word (1b - linux_gateway_page) | ||
615 | .word (3b - linux_gateway_page) | ||
616 | #endif | ||
617 | .previous | 613 | .previous |
618 | 614 | ||
619 | end_compare_and_swap: | 615 | end_compare_and_swap: |
620 | 616 | ||
621 | /* Make sure nothing else is placed on this page */ | 617 | /* Make sure nothing else is placed on this page */ |
622 | .align ASM_PAGE_SIZE | 618 | .align ASM_PAGE_SIZE |
623 | .export end_linux_gateway_page | 619 | END(linux_gateway_page) |
624 | end_linux_gateway_page: | 620 | ENTRY(end_linux_gateway_page) |
625 | 621 | ||
626 | /* Relocate symbols assuming linux_gateway_page is mapped | 622 | /* Relocate symbols assuming linux_gateway_page is mapped |
627 | to virtual address 0x0 */ | 623 | to virtual address 0x0 */ |
628 | #ifdef CONFIG_64BIT | 624 | |
629 | /* FIXME: The code will always be on the gateay page | 625 | #define LWS_ENTRY(_name_) ULONG_WORD(lws_##_name_ - linux_gateway_page) |
630 | and thus it will be on the first 4k, the | ||
631 | assembler seems to think that the final | ||
632 | subtraction result is only a word in | ||
633 | length, so we pad the value. | ||
634 | */ | ||
635 | #define LWS_ENTRY(_name_) .word 0,(lws_##_name_ - linux_gateway_page) | ||
636 | #else | ||
637 | #define LWS_ENTRY(_name_) .word (lws_##_name_ - linux_gateway_page) | ||
638 | #endif | ||
639 | 626 | ||
640 | .section .rodata,"a" | 627 | .section .rodata,"a" |
641 | 628 | ||
642 | .align ASM_PAGE_SIZE | 629 | .align ASM_PAGE_SIZE |
643 | /* Light-weight-syscall table */ | 630 | /* Light-weight-syscall table */ |
644 | /* Start of lws table. */ | 631 | /* Start of lws table. */ |
645 | .export lws_table | 632 | ENTRY(lws_table) |
646 | .Llws_table: | ||
647 | lws_table: | ||
648 | LWS_ENTRY(compare_and_swap32) /* 0 - ELF32 Atomic compare and swap */ | 633 | LWS_ENTRY(compare_and_swap32) /* 0 - ELF32 Atomic compare and swap */ |
649 | LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic compare and swap */ | 634 | LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic compare and swap */ |
635 | END(lws_table) | ||
650 | /* End of lws table */ | 636 | /* End of lws table */ |
651 | 637 | ||
652 | .align ASM_PAGE_SIZE | 638 | .align ASM_PAGE_SIZE |
653 | .export sys_call_table | 639 | ENTRY(sys_call_table) |
654 | .Lsys_call_table: | ||
655 | sys_call_table: | ||
656 | #include "syscall_table.S" | 640 | #include "syscall_table.S" |
641 | END(sys_call_table) | ||
657 | 642 | ||
658 | #ifdef CONFIG_64BIT | 643 | #ifdef CONFIG_64BIT |
659 | .align ASM_PAGE_SIZE | 644 | .align ASM_PAGE_SIZE |
660 | .export sys_call_table64 | 645 | ENTRY(sys_call_table64) |
661 | .Lsys_call_table64: | ||
662 | sys_call_table64: | ||
663 | #define SYSCALL_TABLE_64BIT | 646 | #define SYSCALL_TABLE_64BIT |
664 | #include "syscall_table.S" | 647 | #include "syscall_table.S" |
648 | END(sys_call_table64) | ||
665 | #endif | 649 | #endif |
666 | 650 | ||
667 | #ifdef CONFIG_SMP | 651 | #ifdef CONFIG_SMP |
@@ -671,9 +655,7 @@ sys_call_table64: | |||
671 | */ | 655 | */ |
672 | .section .data | 656 | .section .data |
673 | .align 4096 | 657 | .align 4096 |
674 | .export lws_lock_start | 658 | ENTRY(lws_lock_start) |
675 | .Llws_lock_start: | ||
676 | lws_lock_start: | ||
677 | /* lws locks */ | 659 | /* lws locks */ |
678 | .align 16 | 660 | .align 16 |
679 | .rept 16 | 661 | .rept 16 |
@@ -683,6 +665,7 @@ lws_lock_start: | |||
683 | .word 0 | 665 | .word 0 |
684 | .word 0 | 666 | .word 0 |
685 | .endr | 667 | .endr |
668 | END(lws_lock_start) | ||
686 | .previous | 669 | .previous |
687 | #endif | 670 | #endif |
688 | /* CONFIG_SMP for lws_lock_start */ | 671 | /* CONFIG_SMP for lws_lock_start */ |