diff options
author | Petr Tesarik <ptesarik@suse.cz> | 2008-02-11 21:43:05 (GMT) |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-03-05 23:48:47 (GMT) |
commit | eac738e6cea16bfbd7b9018d60d009aedd2d14b6 (patch) | |
tree | 479a44d5e39403cfb57432aa57b2d0cfed90f41f /arch/ia64/kernel | |
parent | e868a55c2a8cb72b66d7137fbcc54b82016e98eb (diff) | |
download | linux-fsl-qoriq-eac738e6cea16bfbd7b9018d60d009aedd2d14b6.tar.xz |
[IA64] convert sys_ptrace to arch_ptrace
Convert sys_ptrace() to arch_ptrace().
Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r-- | arch/ia64/kernel/ptrace.c | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c index e82fe29..1dfff5a 100644 --- a/arch/ia64/kernel/ptrace.c +++ b/arch/ia64/kernel/ptrace.c @@ -1470,46 +1470,13 @@ ptrace_disable (struct task_struct *child) child_psr->tb = 0; } -asmlinkage long -sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data) +long +arch_ptrace (struct task_struct *child, long request, long addr, long data) { struct pt_regs *pt; - struct task_struct *child; struct switch_stack *sw; long ret; - lock_kernel(); - ret = -EPERM; - if (request == PTRACE_TRACEME) { - ret = ptrace_traceme(); - goto out; - } - - ret = -ESRCH; - read_lock(&tasklist_lock); - { - child = find_task_by_pid(pid); - if (child) - get_task_struct(child); - } - read_unlock(&tasklist_lock); - if (!child) - goto out; - ret = -EPERM; - if (pid == 1) /* no messing around with init! */ - goto out_tsk; - - if (request == PTRACE_ATTACH) { - ret = ptrace_attach(child); - if (!ret) - arch_ptrace_attach(child); - goto out_tsk; - } - - ret = ptrace_check_attach(child, request == PTRACE_KILL); - if (ret < 0) - goto out_tsk; - pt = task_pt_regs(child); sw = (struct switch_stack *) (child->thread.ksp + 16); @@ -1594,7 +1561,7 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data) */ if (child->exit_state == EXIT_ZOMBIE) /* already dead */ - goto out_tsk; + return 0; child->exit_code = SIGKILL; ptrace_disable(child); @@ -1643,9 +1610,6 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data) goto out_tsk; } out_tsk: - put_task_struct(child); - out: - unlock_kernel(); return ret; } |