diff options
-rw-r--r-- | arch/parisc/kernel/entry.S | 95 | ||||
-rw-r--r-- | include/asm-parisc/linkage.h | 20 |
2 files changed, 63 insertions, 52 deletions
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index 67dda1b0d6da..cec65323d216 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S | |||
@@ -37,6 +37,8 @@ | |||
37 | #include <asm/unistd.h> | 37 | #include <asm/unistd.h> |
38 | #include <asm/thread_info.h> | 38 | #include <asm/thread_info.h> |
39 | 39 | ||
40 | #include <linux/linkage.h> | ||
41 | |||
40 | #ifdef CONFIG_64BIT | 42 | #ifdef CONFIG_64BIT |
41 | #define CMPIB cmpib,* | 43 | #define CMPIB cmpib,* |
42 | #define CMPB cmpb,* | 44 | #define CMPB cmpb,* |
@@ -648,13 +650,11 @@ | |||
648 | * the static part of the kernel address space. | 650 | * the static part of the kernel address space. |
649 | */ | 651 | */ |
650 | 652 | ||
651 | .export fault_vector_20 | ||
652 | |||
653 | .text | 653 | .text |
654 | 654 | ||
655 | .align 4096 | 655 | .align 4096 |
656 | 656 | ||
657 | fault_vector_20: | 657 | ENTRY(fault_vector_20) |
658 | /* First vector is invalid (0) */ | 658 | /* First vector is invalid (0) */ |
659 | .ascii "cows can fly" | 659 | .ascii "cows can fly" |
660 | .byte 0 | 660 | .byte 0 |
@@ -695,14 +695,13 @@ fault_vector_20: | |||
695 | def 29 | 695 | def 29 |
696 | def 30 | 696 | def 30 |
697 | def 31 | 697 | def 31 |
698 | END(fault_vector_20) | ||
698 | 699 | ||
699 | #ifndef CONFIG_64BIT | 700 | #ifndef CONFIG_64BIT |
700 | 701 | ||
701 | .export fault_vector_11 | ||
702 | |||
703 | .align 2048 | 702 | .align 2048 |
704 | 703 | ||
705 | fault_vector_11: | 704 | ENTRY(fault_vector_11) |
706 | /* First vector is invalid (0) */ | 705 | /* First vector is invalid (0) */ |
707 | .ascii "cows can fly" | 706 | .ascii "cows can fly" |
708 | .byte 0 | 707 | .byte 0 |
@@ -743,6 +742,7 @@ fault_vector_11: | |||
743 | def 29 | 742 | def 29 |
744 | def 30 | 743 | def 30 |
745 | def 31 | 744 | def 31 |
745 | END(fault_vector_11) | ||
746 | 746 | ||
747 | #endif | 747 | #endif |
748 | 748 | ||
@@ -762,9 +762,8 @@ fault_vector_11: | |||
762 | #define CLONE_VM 0x100 /* Must agree with <linux/sched.h> */ | 762 | #define CLONE_VM 0x100 /* Must agree with <linux/sched.h> */ |
763 | #define CLONE_UNTRACED 0x00800000 | 763 | #define CLONE_UNTRACED 0x00800000 |
764 | 764 | ||
765 | .export __kernel_thread, code | ||
766 | .import do_fork | 765 | .import do_fork |
767 | __kernel_thread: | 766 | ENTRY(__kernel_thread) |
768 | STREG %r2, -RP_OFFSET(%r30) | 767 | STREG %r2, -RP_OFFSET(%r30) |
769 | 768 | ||
770 | copy %r30, %r1 | 769 | copy %r30, %r1 |
@@ -797,6 +796,7 @@ __kernel_thread: | |||
797 | ldo -PT_SZ_ALGN(%r30), %r30 | 796 | ldo -PT_SZ_ALGN(%r30), %r30 |
798 | bv %r0(%r2) | 797 | bv %r0(%r2) |
799 | nop | 798 | nop |
799 | ENDPROC(__kernel_thread) | ||
800 | 800 | ||
801 | /* | 801 | /* |
802 | * Child Returns here | 802 | * Child Returns here |
@@ -805,8 +805,7 @@ __kernel_thread: | |||
805 | * into task save area. | 805 | * into task save area. |
806 | */ | 806 | */ |
807 | 807 | ||
808 | .export ret_from_kernel_thread | 808 | ENTRY(ret_from_kernel_thread) |
809 | ret_from_kernel_thread: | ||
810 | 809 | ||
811 | /* Call schedule_tail first though */ | 810 | /* Call schedule_tail first though */ |
812 | BL schedule_tail, %r2 | 811 | BL schedule_tail, %r2 |
@@ -833,10 +832,10 @@ ret_from_kernel_thread: | |||
833 | bv %r0(%r1) | 832 | bv %r0(%r1) |
834 | #endif | 833 | #endif |
835 | ldi 0, %r26 | 834 | ldi 0, %r26 |
835 | ENDPROC(ret_from_kernel_thread) | ||
836 | 836 | ||
837 | .import sys_execve, code | 837 | .import sys_execve, code |
838 | .export __execve, code | 838 | ENTRY(__execve) |
839 | __execve: | ||
840 | copy %r2, %r15 | 839 | copy %r2, %r15 |
841 | copy %r30, %r16 | 840 | copy %r30, %r16 |
842 | ldo PT_SZ_ALGN(%r30), %r30 | 841 | ldo PT_SZ_ALGN(%r30), %r30 |
@@ -856,16 +855,15 @@ __execve: | |||
856 | copy %r16, %r30 | 855 | copy %r16, %r30 |
857 | bv %r0(%r2) | 856 | bv %r0(%r2) |
858 | nop | 857 | nop |
858 | ENDPROC(__execve) | ||
859 | 859 | ||
860 | .align 4 | ||
861 | 860 | ||
862 | /* | 861 | /* |
863 | * struct task_struct *_switch_to(struct task_struct *prev, | 862 | * struct task_struct *_switch_to(struct task_struct *prev, |
864 | * struct task_struct *next) | 863 | * struct task_struct *next) |
865 | * | 864 | * |
866 | * switch kernel stacks and return prev */ | 865 | * switch kernel stacks and return prev */ |
867 | .export _switch_to, code | 866 | ENTRY(_switch_to) |
868 | _switch_to: | ||
869 | STREG %r2, -RP_OFFSET(%r30) | 867 | STREG %r2, -RP_OFFSET(%r30) |
870 | 868 | ||
871 | callee_save_float | 869 | callee_save_float |
@@ -890,6 +888,7 @@ _switch_to_ret: | |||
890 | LDREG -RP_OFFSET(%r30), %r2 | 888 | LDREG -RP_OFFSET(%r30), %r2 |
891 | bv %r0(%r2) | 889 | bv %r0(%r2) |
892 | copy %r26, %r28 | 890 | copy %r26, %r28 |
891 | ENDPROC(_switch_to) | ||
893 | 892 | ||
894 | /* | 893 | /* |
895 | * Common rfi return path for interruptions, kernel execve, and | 894 | * Common rfi return path for interruptions, kernel execve, and |
@@ -907,8 +906,7 @@ _switch_to_ret: | |||
907 | 906 | ||
908 | .align 4096 | 907 | .align 4096 |
909 | 908 | ||
910 | .export syscall_exit_rfi | 909 | ENTRY(syscall_exit_rfi) |
911 | syscall_exit_rfi: | ||
912 | mfctl %cr30,%r16 | 910 | mfctl %cr30,%r16 |
913 | LDREG TI_TASK(%r16), %r16 /* thread_info -> task_struct */ | 911 | LDREG TI_TASK(%r16), %r16 /* thread_info -> task_struct */ |
914 | ldo TASK_REGS(%r16),%r16 | 912 | ldo TASK_REGS(%r16),%r16 |
@@ -1140,13 +1138,12 @@ intr_extint: | |||
1140 | 1138 | ||
1141 | b do_cpu_irq_mask | 1139 | b do_cpu_irq_mask |
1142 | ldo R%intr_return(%r2), %r2 /* return to intr_return, not here */ | 1140 | ldo R%intr_return(%r2), %r2 /* return to intr_return, not here */ |
1141 | ENDPROC(syscall_exit_rfi) | ||
1143 | 1142 | ||
1144 | 1143 | ||
1145 | /* Generic interruptions (illegal insn, unaligned, page fault, etc) */ | 1144 | /* Generic interruptions (illegal insn, unaligned, page fault, etc) */ |
1146 | 1145 | ||
1147 | .export intr_save, code /* for os_hpmc */ | 1146 | ENTRY(intr_save) /* for os_hpmc */ |
1148 | |||
1149 | intr_save: | ||
1150 | mfsp %sr7,%r16 | 1147 | mfsp %sr7,%r16 |
1151 | CMPIB=,n 0,%r16,1f | 1148 | CMPIB=,n 0,%r16,1f |
1152 | get_stack_use_cr30 | 1149 | get_stack_use_cr30 |
@@ -1221,6 +1218,7 @@ skip_save_ior: | |||
1221 | 1218 | ||
1222 | b handle_interruption | 1219 | b handle_interruption |
1223 | ldo R%intr_check_sig(%r2), %r2 | 1220 | ldo R%intr_check_sig(%r2), %r2 |
1221 | ENDPROC(intr_save) | ||
1224 | 1222 | ||
1225 | 1223 | ||
1226 | /* | 1224 | /* |
@@ -1806,9 +1804,7 @@ dtlb_fault: | |||
1806 | LDREG PT_GR18(\regs),%r18 | 1804 | LDREG PT_GR18(\regs),%r18 |
1807 | .endm | 1805 | .endm |
1808 | 1806 | ||
1809 | .export sys_fork_wrapper | 1807 | ENTRY(sys_fork_wrapper) |
1810 | .export child_return | ||
1811 | sys_fork_wrapper: | ||
1812 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30), %r1 | 1808 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30), %r1 |
1813 | ldo TASK_REGS(%r1),%r1 | 1809 | ldo TASK_REGS(%r1),%r1 |
1814 | reg_save %r1 | 1810 | reg_save %r1 |
@@ -1845,9 +1841,10 @@ wrapper_exit: | |||
1845 | ldi __NR_fork,%r20 | 1841 | ldi __NR_fork,%r20 |
1846 | bv %r0(%r2) | 1842 | bv %r0(%r2) |
1847 | STREG %r20,PT_GR20(%r1) | 1843 | STREG %r20,PT_GR20(%r1) |
1844 | ENDPROC(sys_fork_wrapper) | ||
1848 | 1845 | ||
1849 | /* Set the return value for the child */ | 1846 | /* Set the return value for the child */ |
1850 | child_return: | 1847 | ENTRY(child_return) |
1851 | BL schedule_tail, %r2 | 1848 | BL schedule_tail, %r2 |
1852 | nop | 1849 | nop |
1853 | 1850 | ||
@@ -1855,10 +1852,10 @@ child_return: | |||
1855 | LDREG TASK_PT_GR19(%r1),%r2 | 1852 | LDREG TASK_PT_GR19(%r1),%r2 |
1856 | b wrapper_exit | 1853 | b wrapper_exit |
1857 | copy %r0,%r28 | 1854 | copy %r0,%r28 |
1855 | ENDPROC(child_return) | ||
1858 | 1856 | ||
1859 | 1857 | ||
1860 | .export sys_clone_wrapper | 1858 | ENTRY(sys_clone_wrapper) |
1861 | sys_clone_wrapper: | ||
1862 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 | 1859 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 |
1863 | ldo TASK_REGS(%r1),%r1 /* get pt regs */ | 1860 | ldo TASK_REGS(%r1),%r1 /* get pt regs */ |
1864 | reg_save %r1 | 1861 | reg_save %r1 |
@@ -1879,9 +1876,10 @@ sys_clone_wrapper: | |||
1879 | 1876 | ||
1880 | b wrapper_exit | 1877 | b wrapper_exit |
1881 | LDREG -RP_OFFSET-FRAME_SIZE(%r30),%r2 | 1878 | LDREG -RP_OFFSET-FRAME_SIZE(%r30),%r2 |
1879 | ENDPROC(sys_clone_wrapper) | ||
1882 | 1880 | ||
1883 | .export sys_vfork_wrapper | 1881 | |
1884 | sys_vfork_wrapper: | 1882 | ENTRY(sys_vfork_wrapper) |
1885 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 | 1883 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 |
1886 | ldo TASK_REGS(%r1),%r1 /* get pt regs */ | 1884 | ldo TASK_REGS(%r1),%r1 /* get pt regs */ |
1887 | reg_save %r1 | 1885 | reg_save %r1 |
@@ -1902,6 +1900,7 @@ sys_vfork_wrapper: | |||
1902 | 1900 | ||
1903 | b wrapper_exit | 1901 | b wrapper_exit |
1904 | LDREG -RP_OFFSET-FRAME_SIZE(%r30),%r2 | 1902 | LDREG -RP_OFFSET-FRAME_SIZE(%r30),%r2 |
1903 | ENDPROC(sys_vfork_wrapper) | ||
1905 | 1904 | ||
1906 | 1905 | ||
1907 | .macro execve_wrapper execve | 1906 | .macro execve_wrapper execve |
@@ -1938,22 +1937,19 @@ error_\execve: | |||
1938 | nop | 1937 | nop |
1939 | .endm | 1938 | .endm |
1940 | 1939 | ||
1941 | .export sys_execve_wrapper | ||
1942 | .import sys_execve | 1940 | .import sys_execve |
1943 | 1941 | ENTRY(sys_execve_wrapper) | |
1944 | sys_execve_wrapper: | ||
1945 | execve_wrapper sys_execve | 1942 | execve_wrapper sys_execve |
1943 | ENDPROC(sys_execve_wrapper) | ||
1946 | 1944 | ||
1947 | #ifdef CONFIG_64BIT | 1945 | #ifdef CONFIG_64BIT |
1948 | .export sys32_execve_wrapper | ||
1949 | .import sys32_execve | 1946 | .import sys32_execve |
1950 | 1947 | ENTRY(sys32_execve_wrapper) | |
1951 | sys32_execve_wrapper: | ||
1952 | execve_wrapper sys32_execve | 1948 | execve_wrapper sys32_execve |
1949 | ENDPROC(sys32_execve_wrapper) | ||
1953 | #endif | 1950 | #endif |
1954 | 1951 | ||
1955 | .export sys_rt_sigreturn_wrapper | 1952 | ENTRY(sys_rt_sigreturn_wrapper) |
1956 | sys_rt_sigreturn_wrapper: | ||
1957 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26 | 1953 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26 |
1958 | ldo TASK_REGS(%r26),%r26 /* get pt regs */ | 1954 | ldo TASK_REGS(%r26),%r26 /* get pt regs */ |
1959 | /* Don't save regs, we are going to restore them from sigcontext. */ | 1955 | /* Don't save regs, we are going to restore them from sigcontext. */ |
@@ -1981,9 +1977,9 @@ sys_rt_sigreturn_wrapper: | |||
1981 | */ | 1977 | */ |
1982 | bv %r0(%r2) | 1978 | bv %r0(%r2) |
1983 | LDREG PT_GR28(%r1),%r28 /* reload original r28 for syscall_exit */ | 1979 | LDREG PT_GR28(%r1),%r28 /* reload original r28 for syscall_exit */ |
1980 | ENDPROC(sys_rt_sigreturn_wrapper) | ||
1984 | 1981 | ||
1985 | .export sys_sigaltstack_wrapper | 1982 | ENTRY(sys_sigaltstack_wrapper) |
1986 | sys_sigaltstack_wrapper: | ||
1987 | /* Get the user stack pointer */ | 1983 | /* Get the user stack pointer */ |
1988 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 | 1984 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 |
1989 | ldo TASK_REGS(%r1),%r24 /* get pt regs */ | 1985 | ldo TASK_REGS(%r1),%r24 /* get pt regs */ |
@@ -2002,10 +1998,10 @@ sys_sigaltstack_wrapper: | |||
2002 | LDREG -RP_OFFSET(%r30), %r2 | 1998 | LDREG -RP_OFFSET(%r30), %r2 |
2003 | bv %r0(%r2) | 1999 | bv %r0(%r2) |
2004 | nop | 2000 | nop |
2001 | ENDPROC(sys_sigaltstack_wrapper) | ||
2005 | 2002 | ||
2006 | #ifdef CONFIG_64BIT | 2003 | #ifdef CONFIG_64BIT |
2007 | .export sys32_sigaltstack_wrapper | 2004 | ENTRY(sys32_sigaltstack_wrapper) |
2008 | sys32_sigaltstack_wrapper: | ||
2009 | /* Get the user stack pointer */ | 2005 | /* Get the user stack pointer */ |
2010 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r24 | 2006 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r24 |
2011 | LDREG TASK_PT_GR30(%r24),%r24 | 2007 | LDREG TASK_PT_GR30(%r24),%r24 |
@@ -2018,11 +2014,10 @@ sys32_sigaltstack_wrapper: | |||
2018 | LDREG -RP_OFFSET(%r30), %r2 | 2014 | LDREG -RP_OFFSET(%r30), %r2 |
2019 | bv %r0(%r2) | 2015 | bv %r0(%r2) |
2020 | nop | 2016 | nop |
2017 | ENDPROC(sys32_sigaltstack_wrapper) | ||
2021 | #endif | 2018 | #endif |
2022 | 2019 | ||
2023 | .export syscall_exit | 2020 | ENTRY(syscall_exit) |
2024 | syscall_exit: | ||
2025 | |||
2026 | /* NOTE: HP-UX syscalls also come through here | 2021 | /* NOTE: HP-UX syscalls also come through here |
2027 | * after hpux_syscall_exit fixes up return | 2022 | * after hpux_syscall_exit fixes up return |
2028 | * values. */ | 2023 | * values. */ |
@@ -2251,7 +2246,10 @@ syscall_do_resched: | |||
2251 | #endif | 2246 | #endif |
2252 | b syscall_check_bh /* if resched, we start over again */ | 2247 | b syscall_check_bh /* if resched, we start over again */ |
2253 | nop | 2248 | nop |
2249 | ENDPROC(syscall_exit) | ||
2254 | 2250 | ||
2251 | |||
2252 | ENTRY(get_register) | ||
2255 | /* | 2253 | /* |
2256 | * get_register is used by the non access tlb miss handlers to | 2254 | * get_register is used by the non access tlb miss handlers to |
2257 | * copy the value of the general register specified in r8 into | 2255 | * copy the value of the general register specified in r8 into |
@@ -2262,8 +2260,6 @@ syscall_do_resched: | |||
2262 | * a -1 in it, but that is OK, it just means that we will have | 2260 | * a -1 in it, but that is OK, it just means that we will have |
2263 | * to use the slow path instead). | 2261 | * to use the slow path instead). |
2264 | */ | 2262 | */ |
2265 | |||
2266 | get_register: | ||
2267 | blr %r8,%r0 | 2263 | blr %r8,%r0 |
2268 | nop | 2264 | nop |
2269 | bv %r0(%r25) /* r0 */ | 2265 | bv %r0(%r25) /* r0 */ |
@@ -2330,14 +2326,15 @@ get_register: | |||
2330 | copy %r30,%r1 | 2326 | copy %r30,%r1 |
2331 | bv %r0(%r25) /* r31 */ | 2327 | bv %r0(%r25) /* r31 */ |
2332 | copy %r31,%r1 | 2328 | copy %r31,%r1 |
2329 | ENDPROC(get_register) | ||
2333 | 2330 | ||
2331 | |||
2332 | ENTRY(set_register) | ||
2334 | /* | 2333 | /* |
2335 | * set_register is used by the non access tlb miss handlers to | 2334 | * set_register is used by the non access tlb miss handlers to |
2336 | * copy the value of r1 into the general register specified in | 2335 | * copy the value of r1 into the general register specified in |
2337 | * r8. | 2336 | * r8. |
2338 | */ | 2337 | */ |
2339 | |||
2340 | set_register: | ||
2341 | blr %r8,%r0 | 2338 | blr %r8,%r0 |
2342 | nop | 2339 | nop |
2343 | bv %r0(%r25) /* r0 (silly, but it is a place holder) */ | 2340 | bv %r0(%r25) /* r0 (silly, but it is a place holder) */ |
@@ -2404,3 +2401,5 @@ set_register: | |||
2404 | copy %r1,%r30 | 2401 | copy %r1,%r30 |
2405 | bv %r0(%r25) /* r31 */ | 2402 | bv %r0(%r25) /* r31 */ |
2406 | copy %r1,%r31 | 2403 | copy %r1,%r31 |
2404 | ENDPROC(set_register) | ||
2405 | |||
diff --git a/include/asm-parisc/linkage.h b/include/asm-parisc/linkage.h index 291c2d01c44f..9df3978f8a9b 100644 --- a/include/asm-parisc/linkage.h +++ b/include/asm-parisc/linkage.h | |||
@@ -1,6 +1,18 @@ | |||
1 | #ifndef __ASM_LINKAGE_H | 1 | #ifndef __ASM_PARISC_LINKAGE_H |
2 | #define __ASM_LINKAGE_H | 2 | #define __ASM_PARISC_LINKAGE_H |
3 | |||
4 | /* Nothing to see here... */ | ||
5 | 3 | ||
4 | #ifndef __ALIGN | ||
5 | #define __ALIGN .align 4 | ||
6 | #define __ALIGN_STR ".align 4" | ||
6 | #endif | 7 | #endif |
8 | |||
9 | /* | ||
10 | * In parisc assembly a semicolon marks a comment. | ||
11 | * Because of that we use an exclamation mark to seperate independend lines. | ||
12 | */ | ||
13 | #define ENTRY(name) \ | ||
14 | .globl name !\ | ||
15 | ALIGN !\ | ||
16 | name: | ||
17 | |||
18 | #endif /* __ASM_PARISC_LINKAGE_H */ | ||