1 /* SunOS's execv() call only specifies the argv argument, the
2 * environment settings are the same as the calling processes.
5 sethi %hi(sparc_execve), %g1
6 ba,pt %xcc, execve_merge
7 or %g1, %lo(sparc_execve), %g1
11 stx %g0, [%sp + PTREGS_OFF + PT_V9_I2]
13 sethi %hi(sparc32_execve), %g1
14 or %g1, %lo(sparc32_execve), %g1
20 add %sp, PTREGS_OFF, %o0
24 ba,pt %xcc, sys_sparc_pipe_real
25 add %sp, PTREGS_OFF, %o0
27 ba,pt %xcc, c_sys_nis_syscall
28 add %sp, PTREGS_OFF, %o0
30 ba,pt %xcc, sparc_memory_ordering
31 add %sp, PTREGS_OFF, %o1
33 ba,pt %xcc, do_sigaltstack
34 add %i6, STACK_BIAS, %o2
37 ba,pt %xcc, do_sys32_sigstack
40 ba,pt %xcc, do_sys32_sigaltstack
46 add %sp, PTREGS_OFF, %o0
52 add %sp, PTREGS_OFF, %o0
58 add %sp, PTREGS_OFF, %o0
59 call do_rt_sigreturn32
64 1: ldx [%g6 + TI_FLAGS], %l5
65 andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0
68 call syscall_trace_leave
69 add %sp, PTREGS_OFF, %o0
74 sys_vfork: /* Under Linux, vfork and fork are just special cases of clone. */
75 sethi %hi(0x4000 | 0x0100 | SIGCHLD), %o0
76 or %o0, %lo(0x4000 | 0x0100 | SIGCHLD), %o0
85 ba,pt %xcc, sparc_do_fork
86 add %sp, PTREGS_OFF, %o2
88 .globl ret_from_syscall
90 /* Clear current_thread_info()->new_child. */
91 stb %g0, [%g6 + TI_NEW_CHILD]
92 ldx [%g6 + TI_FLAGS], %l0
95 ba,pt %xcc, ret_sys_call
96 ldx [%sp + PTREGS_OFF + PT_V9_I0], %o0
99 .type sparc_exit,#function
102 wrpr %g2, PSTATE_IE, %pstate
106 wrpr %g3, 0x0, %cansave
107 wrpr %g0, 0x0, %otherwin
108 wrpr %g2, 0x0, %pstate
110 stb %g0, [%g6 + TI_WSAVED]
111 .size sparc_exit,.-sparc_exit
113 linux_sparc_ni_syscall:
114 sethi %hi(sys_ni_syscall), %l7
116 or %l7, %lo(sys_ni_syscall), %l7
118 linux_syscall_trace32:
119 call syscall_trace_enter
120 add %sp, PTREGS_OFF, %o0
131 call syscall_trace_enter
132 add %sp, PTREGS_OFF, %o0
143 /* Linux 32-bit system calls enter here... */
145 .globl linux_sparc_syscall32
146 linux_sparc_syscall32:
147 /* Direct access to user regs, much faster. */
148 cmp %g1, NR_syscalls ! IEU1 Group
149 bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI
150 srl %i0, 0, %o0 ! IEU0
151 sll %g1, 2, %l4 ! IEU0 Group
152 srl %i4, 0, %o4 ! IEU1
153 lduw [%l7 + %l4], %l7 ! Load
154 srl %i1, 0, %o1 ! IEU0 Group
155 ldx [%g6 + TI_FLAGS], %l0 ! Load
157 srl %i5, 0, %o5 ! IEU1
158 srl %i2, 0, %o2 ! IEU0 Group
159 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0
160 bne,pn %icc, linux_syscall_trace32 ! CTI
162 call %l7 ! CTI Group brk forced
163 srl %i3, 0, %o3 ! IEU0
166 /* Linux native system calls enter here... */
168 .globl linux_sparc_syscall
170 /* Direct access to user regs, much faster. */
171 cmp %g1, NR_syscalls ! IEU1 Group
172 bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI
174 sll %g1, 2, %l4 ! IEU0 Group
176 lduw [%l7 + %l4], %l7 ! Load
177 4: mov %i2, %o2 ! IEU0 Group
178 ldx [%g6 + TI_FLAGS], %l0 ! Load
181 mov %i4, %o4 ! IEU0 Group
182 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0
183 bne,pn %icc, linux_syscall_trace ! CTI Group
185 2: call %l7 ! CTI Group brk forced
189 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
191 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3
192 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
194 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
197 /* Check if force_successful_syscall_return()
200 ldub [%g6 + TI_SYS_NOERROR], %l2
202 stb %g0, [%g6 + TI_SYS_NOERROR]
204 cmp %o0, -ERESTART_RESTARTBLOCK
206 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6
208 /* System call success, clear Carry condition code. */
210 stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
211 bne,pn %icc, linux_syscall_trace2
212 add %l1, 0x4, %l2 ! npc = npc+4
213 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]
215 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
218 /* System call failure, set Carry condition code.
219 * Also, get abs(errno) to return to the process.
221 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6
224 stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
225 stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
226 bne,pn %icc, linux_syscall_trace2
227 add %l1, 0x4, %l2 ! npc = npc+4
228 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]
231 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
232 linux_syscall_trace2:
233 call syscall_trace_leave
234 add %sp, PTREGS_OFF, %o0
235 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]
237 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]