summaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/ptrace.c
diff options
context:
space:
mode:
authorKyle McMartin2009-07-05 20:36:16 +0200
committerKyle McMartin2009-09-28 05:07:22 +0200
commit2798af1abb5d560b926fd07ec58c5dcc6d3484d8 (patch)
tree1c3d953ce653784ed8055fad82ef34499c036f27 /arch/parisc/kernel/ptrace.c
parentparisc: add missing TI_TASK macro in syscall.S (diff)
downloadkernel-qcow2-linux-2798af1abb5d560b926fd07ec58c5dcc6d3484d8.tar.gz
kernel-qcow2-linux-2798af1abb5d560b926fd07ec58c5dcc6d3484d8.tar.xz
kernel-qcow2-linux-2798af1abb5d560b926fd07ec58c5dcc6d3484d8.zip
parisc: split syscall_trace into two halves
Instead of fiddling with gr[20], restructure code to return whether or not to -ENOSYS. (Also do a bit of fiddling to let them take pt_regs directly instead of re-computing it.) Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Diffstat (limited to 'arch/parisc/kernel/ptrace.c')
-rw-r--r--arch/parisc/kernel/ptrace.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
index 2118ed02e886..08f6d2cbf0e0 100644
--- a/arch/parisc/kernel/ptrace.c
+++ b/arch/parisc/kernel/ptrace.c
@@ -264,20 +264,19 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
}
#endif
+long do_syscall_trace_enter(struct pt_regs *regs)
+{
+ if (test_thread_flag(TIF_SYSCALL_TRACE) &&
+ tracehook_report_syscall_entry(regs))
+ return -1L;
+
+ return regs->gr[20];
+}
-void syscall_trace(int why)
+void do_syscall_trace_exit(struct pt_regs *regs)
{
- struct pt_regs *regs = &current->thread.regs;
+ int stepping = !!(current->ptrace & (PT_SINGLESTEP|PT_BLOCKSTEP));
- if (!test_thread_flag(TIF_SYSCALL_TRACE))
- return;
- /*
- * Report the system call for tracing. Entry tracing can
- * decide to abort the call. We handle that by setting an
- * invalid syscall number (-1) to force an ENOSYS error.
- */
- if (why)
- tracehook_report_syscall_exit(regs, 0);
- else if (tracehook_report_syscall_entry(regs))
- regs->gr[20] = -1; /* force ENOSYS */
+ if (stepping || test_thread_flag(TIF_SYSCALL_TRACE))
+ tracehook_report_syscall_exit(regs, stepping);
}