aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/syscalls.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/syscalls.S')
-rw-r--r--arch/sparc/kernel/syscalls.S31
1 files changed, 18 insertions, 13 deletions
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
index b0ac10306425..1d7e274f3f2b 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
@@ -212,19 +212,24 @@ linux_sparc_syscall:
2123: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] 2123: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
213ret_sys_call: 213ret_sys_call:
214 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 214 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3
215 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
215 sra %o0, 0, %o0 216 sra %o0, 0, %o0
216 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 217 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
217 sllx %g2, 32, %g2 218 sllx %g2, 32, %g2
218 219
220 /* Check if force_successful_syscall_return()
221 * was invoked.
222 */
223 ldub [%g6 + TI_SYS_NOERROR], %l2
224 brnz,a,pn %l2, 80f
225 stb %g0, [%g6 + TI_SYS_NOERROR]
226
219 cmp %o0, -ERESTART_RESTARTBLOCK 227 cmp %o0, -ERESTART_RESTARTBLOCK
220 bgeu,pn %xcc, 1f 228 bgeu,pn %xcc, 1f
221 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 229 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6
222 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc 23080:
223
2242:
225 /* System call success, clear Carry condition code. */ 231 /* System call success, clear Carry condition code. */
226 andn %g3, %g2, %g3 232 andn %g3, %g2, %g3
2273:
228 stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE] 233 stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
229 bne,pn %icc, linux_syscall_trace2 234 bne,pn %icc, linux_syscall_trace2
230 add %l1, 0x4, %l2 ! npc = npc+4 235 add %l1, 0x4, %l2 ! npc = npc+4
@@ -233,20 +238,20 @@ ret_sys_call:
233 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] 238 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
234 239
2351: 2401:
236 /* Check if force_successful_syscall_return()
237 * was invoked.
238 */
239 ldub [%g6 + TI_SYS_NOERROR], %l2
240 brnz,pn %l2, 2b
241 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
242 /* System call failure, set Carry condition code. 241 /* System call failure, set Carry condition code.
243 * Also, get abs(errno) to return to the process. 242 * Also, get abs(errno) to return to the process.
244 */ 243 */
244 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6
245 sub %g0, %o0, %o0 245 sub %g0, %o0, %o0
246 or %g3, %g2, %g3
246 stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] 247 stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
247 ba,pt %xcc, 3b 248 stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
248 or %g3, %g2, %g3 249 bne,pn %icc, linux_syscall_trace2
250 add %l1, 0x4, %l2 ! npc = npc+4
251 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]
249 252
253 b,pt %xcc, rtrap
254 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
250linux_syscall_trace2: 255linux_syscall_trace2:
251 call syscall_trace_leave 256 call syscall_trace_leave
252 add %sp, PTREGS_OFF, %o0 257 add %sp, PTREGS_OFF, %o0