Commit 1cc4805a authored by Pete Zaitcev's avatar Pete Zaitcev Committed by David S. Miller

[SPARC]: Fix ptracing of syscalls.

parent 4165cb26
......@@ -22,8 +22,6 @@
int foo(void)
{
DEFINE(AOFF_task_thread, offsetof(struct task_struct, thread));
DEFINE(AOFF_task_ptrace, offsetof(struct task_struct, ptrace));
DEFINE(AOFF_task_blocked, offsetof(struct task_struct, blocked));
BLANK();
/* XXX This is the stuff for sclow.S, kill it. */
DEFINE(AOFF_task_pid, offsetof(struct task_struct, pid));
......
......@@ -1246,9 +1246,8 @@ C_LABEL(sys_ptrace):
call C_LABEL(do_ptrace)
add %sp, STACKFRAME_SZ, %o0
ld [%curptr + TI_TASK], %l5
ld [%l5 + AOFF_task_ptrace], %l5
andcc %l5, 0x02, %g0
ld [%curptr + TI_FLAGS], %l5
andcc %l5, _TIF_SYSCALL_TRACE, %g0
be 1f
nop
......@@ -1297,9 +1296,8 @@ C_LABEL(sys_sigpause):
call C_LABEL(do_sigpause)
add %sp, STACKFRAME_SZ, %o1
ld [%curptr + TI_TASK], %l5
ld [%l5 + AOFF_task_ptrace], %l5
andcc %l5, 0x02, %g0
ld [%curptr + TI_FLAGS], %l5
andcc %l5, _TIF_SYSCALL_TRACE, %g0
be 1f
nop
......@@ -1316,9 +1314,8 @@ C_LABEL(sys_sigsuspend):
call C_LABEL(do_sigsuspend)
add %sp, STACKFRAME_SZ, %o0
ld [%curptr + TI_TASK], %l5
ld [%l5 + AOFF_task_ptrace], %l5
andcc %l5, 0x02, %g0
ld [%curptr + TI_FLAGS], %l5
andcc %l5, _TIF_SYSCALL_TRACE, %g0
be 1f
nop
......@@ -1336,9 +1333,8 @@ C_LABEL(sys_rt_sigsuspend):
call C_LABEL(do_rt_sigsuspend)
add %sp, STACKFRAME_SZ, %o2
ld [%curptr + TI_TASK], %l5
ld [%l5 + AOFF_task_ptrace], %l5
andcc %l5, 0x02, %g0
ld [%curptr + TI_FLAGS], %l5
andcc %l5, _TIF_SYSCALL_TRACE, %g0
be 1f
nop
......@@ -1355,9 +1351,8 @@ C_LABEL(sys_sigreturn):
call C_LABEL(do_sigreturn)
add %sp, STACKFRAME_SZ, %o0
ld [%curptr + TI_TASK], %l5
ld [%l5 + AOFF_task_ptrace], %l5
andcc %l5, 0x02, %g0
ld [%curptr + TI_FLAGS], %l5
andcc %l5, _TIF_SYSCALL_TRACE, %g0
be 1f
nop
......@@ -1376,9 +1371,8 @@ C_LABEL(sys_rt_sigreturn):
call C_LABEL(do_rt_sigreturn)
add %sp, STACKFRAME_SZ, %o0
ld [%curptr + TI_TASK], %l5
ld [%l5 + AOFF_task_ptrace], %l5
andcc %l5, 0x02, %g0
ld [%curptr + TI_FLAGS], %l5
andcc %l5, _TIF_SYSCALL_TRACE, %g0
be 1f
nop
......@@ -1512,10 +1506,9 @@ syscall_is_too_hard:
mov %i1, %o1
mov %i2, %o2
ld [%curptr + TI_TASK], %l5
ld [%l5 + AOFF_task_ptrace], %l5
ld [%curptr + TI_FLAGS], %l5
mov %i3, %o3
andcc %l5, 0x02, %g0
andcc %l5, _TIF_SYSCALL_TRACE, %g0
mov %i4, %o4
bne linux_syscall_trace
mov %i0, %l5
......@@ -1527,13 +1520,12 @@ syscall_is_too_hard:
.globl C_LABEL(ret_sys_call)
C_LABEL(ret_sys_call):
ld [%curptr + TI_TASK], %l6
ld [%l6 + AOFF_task_ptrace], %l6
ld [%curptr + TI_FLAGS], %l6
cmp %o0, -ENOIOCTLCMD
ld [%sp + STACKFRAME_SZ + PT_PSR], %g3
set PSR_C, %g2
bgeu 1f
andcc %l6, 0x02, %l6
andcc %l6, _TIF_SYSCALL_TRACE, %g0
/* System call success, clear Carry condition code. */
andn %g3, %g2, %g3
......
......@@ -521,7 +521,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
addr = 1;
case PTRACE_CONT: { /* restart after signal. */
if ((unsigned long) data > _NSIG) {
if (data > _NSIG) {
pt_error_return(regs, EIO);
goto out_tsk;
}
......@@ -545,11 +545,10 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
child->exit_code = data;
#ifdef DEBUG_PTRACE
printk("CONT: %s [%d]: set exit_code = %x %x %x\n", child->comm,
child->pid, child->exit_code,
printk("CONT: %s [%d]: set exit_code = %x %lx %lx\n",
child->comm, child->pid, child->exit_code,
child->thread.kregs->pc,
child->thread.kregs->npc);
#endif
wake_up_process(child);
pt_succ_return(regs, 0);
......
......@@ -67,27 +67,6 @@ LABEL(sunosgdtsize):
mov 256, %i0
CC_AND_RETT
.globl LABEL(sunossblock)
LABEL(sunossblock):
LOAD_CURRENT(l4, l5)
ld [%l4 + TI_TASK], %l4
set -65793, %l5
and %i0, %l5, %l5
ld [%l4 + AOFF_task_blocked], %i0
or %i0, %l5, %l5
st %l5, [%l4 + AOFF_task_blocked]
CC_AND_RETT
.globl LABEL(sunossmask)
LABEL(sunossmask):
LOAD_CURRENT(l4, l5)
ld [%l4 + TI_TASK], %l4
set -65793, %l5
and %i0, %l5, %l5
ld [%l4 + AOFF_task_blocked], %i0
st %l5, [%l4 + AOFF_task_blocked]
CC_AND_RETT
.globl LABEL(getpagesize)
LABEL(getpagesize):
set PAGE_SIZE, %i0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment