diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-26 23:12:24 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-03 23:07:53 -0500 |
commit | 4b3470d9e43c9826a454eef09b4d45c7a7208915 (patch) | |
tree | 370a9d0c4db58a968ff2693c5c98696f74be604b | |
parent | 914f70a81b346ee5296c5a29fe44fe3789fcfd1d (diff) | |
download | signal-4b3470d9e43c9826a454eef09b4d45c7a7208915.tar.gz |
score: split do_syscall_trace, don't open-code tracehook_report_...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | arch/score/kernel/entry.S | 6 | ||||
-rw-r--r-- | arch/score/kernel/ptrace.c | 31 |
2 files changed, 12 insertions, 25 deletions
diff --git a/arch/score/kernel/entry.S b/arch/score/kernel/entry.S index 7234ed09b7b7e..183c81af55a5f 100644 --- a/arch/score/kernel/entry.S +++ b/arch/score/kernel/entry.S @@ -329,8 +329,7 @@ ENTRY(syscall_exit_work) nop enable_irq mv r4, r0 - li r5, 1 - bl do_syscall_trace + bl do_syscall_trace_leave nop b resume_userspace nop @@ -460,8 +459,7 @@ syscall_return_work: syscall_trace_entry: mv r16, r10 mv r4, r0 - li r5, 0 - bl do_syscall_trace + bl do_syscall_trace_enter mv r8, r16 lw r4, [r0, PT_R4] # Restore argument registers diff --git a/arch/score/kernel/ptrace.c b/arch/score/kernel/ptrace.c index 55836188b217c..300e4fefaf2b4 100644 --- a/arch/score/kernel/ptrace.c +++ b/arch/score/kernel/ptrace.c @@ -28,6 +28,7 @@ #include <linux/mm.h> #include <linux/ptrace.h> #include <linux/regset.h> +#include <linux/tracehook.h> #include <asm/uaccess.h> @@ -358,26 +359,14 @@ arch_ptrace(struct task_struct *child, long request, * Notification of system call entry/exit * - triggered by current->work.syscall_trace */ -asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) +asmlinkage void do_syscall_trace_enter(struct pt_regs *regs) { - if (!(current->ptrace & PT_PTRACED)) - return; - - if (!test_thread_flag(TIF_SYSCALL_TRACE)) - return; - - /* The 0x80 provides a way for the tracing parent to distinguish - between a syscall stop and SIGTRAP delivery. */ - ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ? - 0x80 : 0)); - - /* - * this isn't the same as continuing with a signal, but it will do - * for normal use. strace only continues with a signal if the - * stopping signal is not SIGTRAP. -brl - */ - if (current->exit_code) { - send_sig(current->exit_code, current, 1); - current->exit_code = 0; - } + if (test_thread_flag(TIF_SYSCALL_TRACE)) + tracehook_report_syscall_entry(regs); +} + +asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) +{ + if (test_thread_flag(TIF_SYSCALL_TRACE)) + tracehook_report_syscall_exit(regs, 0); } |