diff options
Diffstat (limited to 'arch/parisc/kernel/entry.S')
-rw-r--r-- | arch/parisc/kernel/entry.S | 241 |
1 files changed, 103 insertions, 138 deletions
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index 340b5e8d67ba..8474f9e5ca10 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 |
@@ -978,11 +976,36 @@ intr_check_resched: | |||
978 | LDREG TI_FLAGS(%r1),%r19 /* sched.h: TIF_NEED_RESCHED */ | 976 | LDREG TI_FLAGS(%r1),%r19 /* sched.h: TIF_NEED_RESCHED */ |
979 | bb,<,n %r19,31-TIF_NEED_RESCHED,intr_do_resched /* forward */ | 977 | bb,<,n %r19,31-TIF_NEED_RESCHED,intr_do_resched /* forward */ |
980 | 978 | ||
979 | .import do_notify_resume,code | ||
981 | intr_check_sig: | 980 | intr_check_sig: |
982 | /* As above */ | 981 | /* As above */ |
983 | mfctl %cr30,%r1 | 982 | mfctl %cr30,%r1 |
984 | LDREG TI_FLAGS(%r1),%r19 /* sched.h: TIF_SIGPENDING */ | 983 | LDREG TI_FLAGS(%r1),%r19 |
985 | bb,<,n %r19, 31-TIF_SIGPENDING, intr_do_signal /* forward */ | 984 | ldi (_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK), %r20 |
985 | and,COND(<>) %r19, %r20, %r0 | ||
986 | b,n intr_restore /* skip past if we've nothing to do */ | ||
987 | |||
988 | /* This check is critical to having LWS | ||
989 | * working. The IASQ is zero on the gateway | ||
990 | * page and we cannot deliver any signals until | ||
991 | * we get off the gateway page. | ||
992 | * | ||
993 | * Only do signals if we are returning to user space | ||
994 | */ | ||
995 | LDREG PT_IASQ0(%r16), %r20 | ||
996 | CMPIB=,n 0,%r20,intr_restore /* backward */ | ||
997 | LDREG PT_IASQ1(%r16), %r20 | ||
998 | CMPIB=,n 0,%r20,intr_restore /* backward */ | ||
999 | |||
1000 | copy %r0, %r25 /* long in_syscall = 0 */ | ||
1001 | #ifdef CONFIG_64BIT | ||
1002 | ldo -16(%r30),%r29 /* Reference param save area */ | ||
1003 | #endif | ||
1004 | |||
1005 | BL do_notify_resume,%r2 | ||
1006 | copy %r16, %r26 /* struct pt_regs *regs */ | ||
1007 | |||
1008 | b,n intr_check_sig | ||
986 | 1009 | ||
987 | intr_restore: | 1010 | intr_restore: |
988 | copy %r16,%r29 | 1011 | copy %r16,%r29 |
@@ -1072,35 +1095,6 @@ intr_do_preempt: | |||
1072 | b,n intr_restore /* ssm PSW_SM_I done by intr_restore */ | 1095 | b,n intr_restore /* ssm PSW_SM_I done by intr_restore */ |
1073 | #endif /* CONFIG_PREEMPT */ | 1096 | #endif /* CONFIG_PREEMPT */ |
1074 | 1097 | ||
1075 | .import do_signal,code | ||
1076 | intr_do_signal: | ||
1077 | /* | ||
1078 | This check is critical to having LWS | ||
1079 | working. The IASQ is zero on the gateway | ||
1080 | page and we cannot deliver any signals until | ||
1081 | we get off the gateway page. | ||
1082 | |||
1083 | Only do signals if we are returning to user space | ||
1084 | */ | ||
1085 | LDREG PT_IASQ0(%r16), %r20 | ||
1086 | CMPIB= 0,%r20,intr_restore /* backward */ | ||
1087 | nop | ||
1088 | LDREG PT_IASQ1(%r16), %r20 | ||
1089 | CMPIB= 0,%r20,intr_restore /* backward */ | ||
1090 | nop | ||
1091 | |||
1092 | copy %r0, %r24 /* unsigned long in_syscall */ | ||
1093 | copy %r16, %r25 /* struct pt_regs *regs */ | ||
1094 | #ifdef CONFIG_64BIT | ||
1095 | ldo -16(%r30),%r29 /* Reference param save area */ | ||
1096 | #endif | ||
1097 | |||
1098 | BL do_signal,%r2 | ||
1099 | copy %r0, %r26 /* sigset_t *oldset = NULL */ | ||
1100 | |||
1101 | b intr_check_sig | ||
1102 | nop | ||
1103 | |||
1104 | /* | 1098 | /* |
1105 | * External interrupts. | 1099 | * External interrupts. |
1106 | */ | 1100 | */ |
@@ -1115,11 +1109,7 @@ intr_extint: | |||
1115 | mfctl %cr31,%r1 | 1109 | mfctl %cr31,%r1 |
1116 | copy %r30,%r17 | 1110 | copy %r30,%r17 |
1117 | /* FIXME! depi below has hardcoded idea of interrupt stack size (32k)*/ | 1111 | /* FIXME! depi below has hardcoded idea of interrupt stack size (32k)*/ |
1118 | #ifdef CONFIG_64BIT | 1112 | DEPI 0,31,15,%r17 |
1119 | depdi 0,63,15,%r17 | ||
1120 | #else | ||
1121 | depi 0,31,15,%r17 | ||
1122 | #endif | ||
1123 | CMPB=,n %r1,%r17,2f | 1113 | CMPB=,n %r1,%r17,2f |
1124 | get_stack_use_cr31 | 1114 | get_stack_use_cr31 |
1125 | b,n 3f | 1115 | b,n 3f |
@@ -1148,13 +1138,12 @@ intr_extint: | |||
1148 | 1138 | ||
1149 | b do_cpu_irq_mask | 1139 | b do_cpu_irq_mask |
1150 | 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) | ||
1151 | 1142 | ||
1152 | 1143 | ||
1153 | /* Generic interruptions (illegal insn, unaligned, page fault, etc) */ | 1144 | /* Generic interruptions (illegal insn, unaligned, page fault, etc) */ |
1154 | 1145 | ||
1155 | .export intr_save, code /* for os_hpmc */ | 1146 | ENTRY(intr_save) /* for os_hpmc */ |
1156 | |||
1157 | intr_save: | ||
1158 | mfsp %sr7,%r16 | 1147 | mfsp %sr7,%r16 |
1159 | CMPIB=,n 0,%r16,1f | 1148 | CMPIB=,n 0,%r16,1f |
1160 | get_stack_use_cr30 | 1149 | get_stack_use_cr30 |
@@ -1229,6 +1218,7 @@ skip_save_ior: | |||
1229 | 1218 | ||
1230 | b handle_interruption | 1219 | b handle_interruption |
1231 | ldo R%intr_check_sig(%r2), %r2 | 1220 | ldo R%intr_check_sig(%r2), %r2 |
1221 | ENDPROC(intr_save) | ||
1232 | 1222 | ||
1233 | 1223 | ||
1234 | /* | 1224 | /* |
@@ -1814,9 +1804,7 @@ dtlb_fault: | |||
1814 | LDREG PT_GR18(\regs),%r18 | 1804 | LDREG PT_GR18(\regs),%r18 |
1815 | .endm | 1805 | .endm |
1816 | 1806 | ||
1817 | .export sys_fork_wrapper | 1807 | ENTRY(sys_fork_wrapper) |
1818 | .export child_return | ||
1819 | sys_fork_wrapper: | ||
1820 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30), %r1 | 1808 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30), %r1 |
1821 | ldo TASK_REGS(%r1),%r1 | 1809 | ldo TASK_REGS(%r1),%r1 |
1822 | reg_save %r1 | 1810 | reg_save %r1 |
@@ -1853,9 +1841,10 @@ wrapper_exit: | |||
1853 | ldi __NR_fork,%r20 | 1841 | ldi __NR_fork,%r20 |
1854 | bv %r0(%r2) | 1842 | bv %r0(%r2) |
1855 | STREG %r20,PT_GR20(%r1) | 1843 | STREG %r20,PT_GR20(%r1) |
1844 | ENDPROC(sys_fork_wrapper) | ||
1856 | 1845 | ||
1857 | /* Set the return value for the child */ | 1846 | /* Set the return value for the child */ |
1858 | child_return: | 1847 | ENTRY(child_return) |
1859 | BL schedule_tail, %r2 | 1848 | BL schedule_tail, %r2 |
1860 | nop | 1849 | nop |
1861 | 1850 | ||
@@ -1863,10 +1852,10 @@ child_return: | |||
1863 | LDREG TASK_PT_GR19(%r1),%r2 | 1852 | LDREG TASK_PT_GR19(%r1),%r2 |
1864 | b wrapper_exit | 1853 | b wrapper_exit |
1865 | copy %r0,%r28 | 1854 | copy %r0,%r28 |
1855 | ENDPROC(child_return) | ||
1866 | 1856 | ||
1867 | 1857 | ||
1868 | .export sys_clone_wrapper | 1858 | ENTRY(sys_clone_wrapper) |
1869 | sys_clone_wrapper: | ||
1870 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 | 1859 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 |
1871 | ldo TASK_REGS(%r1),%r1 /* get pt regs */ | 1860 | ldo TASK_REGS(%r1),%r1 /* get pt regs */ |
1872 | reg_save %r1 | 1861 | reg_save %r1 |
@@ -1887,9 +1876,10 @@ sys_clone_wrapper: | |||
1887 | 1876 | ||
1888 | b wrapper_exit | 1877 | b wrapper_exit |
1889 | LDREG -RP_OFFSET-FRAME_SIZE(%r30),%r2 | 1878 | LDREG -RP_OFFSET-FRAME_SIZE(%r30),%r2 |
1879 | ENDPROC(sys_clone_wrapper) | ||
1880 | |||
1890 | 1881 | ||
1891 | .export sys_vfork_wrapper | 1882 | ENTRY(sys_vfork_wrapper) |
1892 | sys_vfork_wrapper: | ||
1893 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 | 1883 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 |
1894 | ldo TASK_REGS(%r1),%r1 /* get pt regs */ | 1884 | ldo TASK_REGS(%r1),%r1 /* get pt regs */ |
1895 | reg_save %r1 | 1885 | reg_save %r1 |
@@ -1910,6 +1900,7 @@ sys_vfork_wrapper: | |||
1910 | 1900 | ||
1911 | b wrapper_exit | 1901 | b wrapper_exit |
1912 | LDREG -RP_OFFSET-FRAME_SIZE(%r30),%r2 | 1902 | LDREG -RP_OFFSET-FRAME_SIZE(%r30),%r2 |
1903 | ENDPROC(sys_vfork_wrapper) | ||
1913 | 1904 | ||
1914 | 1905 | ||
1915 | .macro execve_wrapper execve | 1906 | .macro execve_wrapper execve |
@@ -1946,22 +1937,19 @@ error_\execve: | |||
1946 | nop | 1937 | nop |
1947 | .endm | 1938 | .endm |
1948 | 1939 | ||
1949 | .export sys_execve_wrapper | ||
1950 | .import sys_execve | 1940 | .import sys_execve |
1951 | 1941 | ENTRY(sys_execve_wrapper) | |
1952 | sys_execve_wrapper: | ||
1953 | execve_wrapper sys_execve | 1942 | execve_wrapper sys_execve |
1943 | ENDPROC(sys_execve_wrapper) | ||
1954 | 1944 | ||
1955 | #ifdef CONFIG_64BIT | 1945 | #ifdef CONFIG_64BIT |
1956 | .export sys32_execve_wrapper | ||
1957 | .import sys32_execve | 1946 | .import sys32_execve |
1958 | 1947 | ENTRY(sys32_execve_wrapper) | |
1959 | sys32_execve_wrapper: | ||
1960 | execve_wrapper sys32_execve | 1948 | execve_wrapper sys32_execve |
1949 | ENDPROC(sys32_execve_wrapper) | ||
1961 | #endif | 1950 | #endif |
1962 | 1951 | ||
1963 | .export sys_rt_sigreturn_wrapper | 1952 | ENTRY(sys_rt_sigreturn_wrapper) |
1964 | sys_rt_sigreturn_wrapper: | ||
1965 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26 | 1953 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26 |
1966 | ldo TASK_REGS(%r26),%r26 /* get pt regs */ | 1954 | ldo TASK_REGS(%r26),%r26 /* get pt regs */ |
1967 | /* 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. */ |
@@ -1989,9 +1977,9 @@ sys_rt_sigreturn_wrapper: | |||
1989 | */ | 1977 | */ |
1990 | bv %r0(%r2) | 1978 | bv %r0(%r2) |
1991 | 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) | ||
1992 | 1981 | ||
1993 | .export sys_sigaltstack_wrapper | 1982 | ENTRY(sys_sigaltstack_wrapper) |
1994 | sys_sigaltstack_wrapper: | ||
1995 | /* Get the user stack pointer */ | 1983 | /* Get the user stack pointer */ |
1996 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 | 1984 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 |
1997 | ldo TASK_REGS(%r1),%r24 /* get pt regs */ | 1985 | ldo TASK_REGS(%r1),%r24 /* get pt regs */ |
@@ -1999,10 +1987,10 @@ sys_sigaltstack_wrapper: | |||
1999 | STREG %r2, -RP_OFFSET(%r30) | 1987 | STREG %r2, -RP_OFFSET(%r30) |
2000 | #ifdef CONFIG_64BIT | 1988 | #ifdef CONFIG_64BIT |
2001 | ldo FRAME_SIZE(%r30), %r30 | 1989 | ldo FRAME_SIZE(%r30), %r30 |
2002 | b,l do_sigaltstack,%r2 | 1990 | BL do_sigaltstack,%r2 |
2003 | ldo -16(%r30),%r29 /* Reference param save area */ | 1991 | ldo -16(%r30),%r29 /* Reference param save area */ |
2004 | #else | 1992 | #else |
2005 | bl do_sigaltstack,%r2 | 1993 | BL do_sigaltstack,%r2 |
2006 | ldo FRAME_SIZE(%r30), %r30 | 1994 | ldo FRAME_SIZE(%r30), %r30 |
2007 | #endif | 1995 | #endif |
2008 | 1996 | ||
@@ -2010,53 +1998,26 @@ sys_sigaltstack_wrapper: | |||
2010 | LDREG -RP_OFFSET(%r30), %r2 | 1998 | LDREG -RP_OFFSET(%r30), %r2 |
2011 | bv %r0(%r2) | 1999 | bv %r0(%r2) |
2012 | nop | 2000 | nop |
2001 | ENDPROC(sys_sigaltstack_wrapper) | ||
2013 | 2002 | ||
2014 | #ifdef CONFIG_64BIT | 2003 | #ifdef CONFIG_64BIT |
2015 | .export sys32_sigaltstack_wrapper | 2004 | ENTRY(sys32_sigaltstack_wrapper) |
2016 | sys32_sigaltstack_wrapper: | ||
2017 | /* Get the user stack pointer */ | 2005 | /* Get the user stack pointer */ |
2018 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r24 | 2006 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r24 |
2019 | LDREG TASK_PT_GR30(%r24),%r24 | 2007 | LDREG TASK_PT_GR30(%r24),%r24 |
2020 | STREG %r2, -RP_OFFSET(%r30) | 2008 | STREG %r2, -RP_OFFSET(%r30) |
2021 | ldo FRAME_SIZE(%r30), %r30 | 2009 | ldo FRAME_SIZE(%r30), %r30 |
2022 | b,l do_sigaltstack32,%r2 | 2010 | BL do_sigaltstack32,%r2 |
2023 | ldo -16(%r30),%r29 /* Reference param save area */ | 2011 | ldo -16(%r30),%r29 /* Reference param save area */ |
2024 | 2012 | ||
2025 | ldo -FRAME_SIZE(%r30), %r30 | 2013 | ldo -FRAME_SIZE(%r30), %r30 |
2026 | LDREG -RP_OFFSET(%r30), %r2 | 2014 | LDREG -RP_OFFSET(%r30), %r2 |
2027 | bv %r0(%r2) | 2015 | bv %r0(%r2) |
2028 | nop | 2016 | nop |
2017 | ENDPROC(sys32_sigaltstack_wrapper) | ||
2029 | #endif | 2018 | #endif |
2030 | 2019 | ||
2031 | .export sys_rt_sigsuspend_wrapper | 2020 | ENTRY(syscall_exit) |
2032 | sys_rt_sigsuspend_wrapper: | ||
2033 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30), %r1 | ||
2034 | ldo TASK_REGS(%r1),%r24 | ||
2035 | reg_save %r24 | ||
2036 | |||
2037 | STREG %r2, -RP_OFFSET(%r30) | ||
2038 | #ifdef CONFIG_64BIT | ||
2039 | ldo FRAME_SIZE(%r30), %r30 | ||
2040 | b,l sys_rt_sigsuspend,%r2 | ||
2041 | ldo -16(%r30),%r29 /* Reference param save area */ | ||
2042 | #else | ||
2043 | bl sys_rt_sigsuspend,%r2 | ||
2044 | ldo FRAME_SIZE(%r30), %r30 | ||
2045 | #endif | ||
2046 | |||
2047 | ldo -FRAME_SIZE(%r30), %r30 | ||
2048 | LDREG -RP_OFFSET(%r30), %r2 | ||
2049 | |||
2050 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30), %r1 | ||
2051 | ldo TASK_REGS(%r1),%r1 | ||
2052 | reg_restore %r1 | ||
2053 | |||
2054 | bv %r0(%r2) | ||
2055 | nop | ||
2056 | |||
2057 | .export syscall_exit | ||
2058 | syscall_exit: | ||
2059 | |||
2060 | /* NOTE: HP-UX syscalls also come through here | 2021 | /* NOTE: HP-UX syscalls also come through here |
2061 | * after hpux_syscall_exit fixes up return | 2022 | * after hpux_syscall_exit fixes up return |
2062 | * values. */ | 2023 | * values. */ |
@@ -2119,9 +2080,35 @@ syscall_check_resched: | |||
2119 | LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19 /* long */ | 2080 | LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19 /* long */ |
2120 | bb,<,n %r19, 31-TIF_NEED_RESCHED, syscall_do_resched /* forward */ | 2081 | bb,<,n %r19, 31-TIF_NEED_RESCHED, syscall_do_resched /* forward */ |
2121 | 2082 | ||
2083 | .import do_signal,code | ||
2122 | syscall_check_sig: | 2084 | syscall_check_sig: |
2123 | LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19 /* get ti flags */ | 2085 | LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19 |
2124 | bb,<,n %r19, 31-TIF_SIGPENDING, syscall_do_signal /* forward */ | 2086 | ldi (_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK), %r26 |
2087 | and,COND(<>) %r19, %r26, %r0 | ||
2088 | b,n syscall_restore /* skip past if we've nothing to do */ | ||
2089 | |||
2090 | syscall_do_signal: | ||
2091 | /* Save callee-save registers (for sigcontext). | ||
2092 | * FIXME: After this point the process structure should be | ||
2093 | * consistent with all the relevant state of the process | ||
2094 | * before the syscall. We need to verify this. | ||
2095 | */ | ||
2096 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 | ||
2097 | ldo TASK_REGS(%r1), %r26 /* struct pt_regs *regs */ | ||
2098 | reg_save %r26 | ||
2099 | |||
2100 | #ifdef CONFIG_64BIT | ||
2101 | ldo -16(%r30),%r29 /* Reference param save area */ | ||
2102 | #endif | ||
2103 | |||
2104 | BL do_notify_resume,%r2 | ||
2105 | ldi 1, %r25 /* long in_syscall = 1 */ | ||
2106 | |||
2107 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 | ||
2108 | ldo TASK_REGS(%r1), %r20 /* reload pt_regs */ | ||
2109 | reg_restore %r20 | ||
2110 | |||
2111 | b,n syscall_check_sig | ||
2125 | 2112 | ||
2126 | syscall_restore: | 2113 | syscall_restore: |
2127 | /* Are we being ptraced? */ | 2114 | /* Are we being ptraced? */ |
@@ -2259,31 +2246,10 @@ syscall_do_resched: | |||
2259 | #endif | 2246 | #endif |
2260 | b syscall_check_bh /* if resched, we start over again */ | 2247 | b syscall_check_bh /* if resched, we start over again */ |
2261 | nop | 2248 | nop |
2249 | ENDPROC(syscall_exit) | ||
2262 | 2250 | ||
2263 | .import do_signal,code | ||
2264 | syscall_do_signal: | ||
2265 | /* Save callee-save registers (for sigcontext). | ||
2266 | FIXME: After this point the process structure should be | ||
2267 | consistent with all the relevant state of the process | ||
2268 | before the syscall. We need to verify this. */ | ||
2269 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 | ||
2270 | ldo TASK_REGS(%r1), %r25 /* struct pt_regs *regs */ | ||
2271 | reg_save %r25 | ||
2272 | |||
2273 | ldi 1, %r24 /* unsigned long in_syscall */ | ||
2274 | |||
2275 | #ifdef CONFIG_64BIT | ||
2276 | ldo -16(%r30),%r29 /* Reference param save area */ | ||
2277 | #endif | ||
2278 | BL do_signal,%r2 | ||
2279 | copy %r0, %r26 /* sigset_t *oldset = NULL */ | ||
2280 | |||
2281 | LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 | ||
2282 | ldo TASK_REGS(%r1), %r20 /* reload pt_regs */ | ||
2283 | reg_restore %r20 | ||
2284 | |||
2285 | b,n syscall_check_sig | ||
2286 | 2251 | ||
2252 | get_register: | ||
2287 | /* | 2253 | /* |
2288 | * 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 |
2289 | * copy the value of the general register specified in r8 into | 2255 | * copy the value of the general register specified in r8 into |
@@ -2294,8 +2260,6 @@ syscall_do_signal: | |||
2294 | * 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 |
2295 | * to use the slow path instead). | 2261 | * to use the slow path instead). |
2296 | */ | 2262 | */ |
2297 | |||
2298 | get_register: | ||
2299 | blr %r8,%r0 | 2263 | blr %r8,%r0 |
2300 | nop | 2264 | nop |
2301 | bv %r0(%r25) /* r0 */ | 2265 | bv %r0(%r25) /* r0 */ |
@@ -2363,13 +2327,13 @@ get_register: | |||
2363 | bv %r0(%r25) /* r31 */ | 2327 | bv %r0(%r25) /* r31 */ |
2364 | copy %r31,%r1 | 2328 | copy %r31,%r1 |
2365 | 2329 | ||
2330 | |||
2331 | set_register: | ||
2366 | /* | 2332 | /* |
2367 | * set_register is used by the non access tlb miss handlers to | 2333 | * set_register is used by the non access tlb miss handlers to |
2368 | * copy the value of r1 into the general register specified in | 2334 | * copy the value of r1 into the general register specified in |
2369 | * r8. | 2335 | * r8. |
2370 | */ | 2336 | */ |
2371 | |||
2372 | set_register: | ||
2373 | blr %r8,%r0 | 2337 | blr %r8,%r0 |
2374 | nop | 2338 | nop |
2375 | bv %r0(%r25) /* r0 (silly, but it is a place holder) */ | 2339 | bv %r0(%r25) /* r0 (silly, but it is a place holder) */ |
@@ -2436,3 +2400,4 @@ set_register: | |||
2436 | copy %r1,%r30 | 2400 | copy %r1,%r30 |
2437 | bv %r0(%r25) /* r31 */ | 2401 | bv %r0(%r25) /* r31 */ |
2438 | copy %r1,%r31 | 2402 | copy %r1,%r31 |
2403 | |||