aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/h8300/kernel')
-rw-r--r--arch/h8300/kernel/ptrace.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c
index a569fe4aa284..0ff6f79b0fed 100644
--- a/arch/h8300/kernel/ptrace.c
+++ b/arch/h8300/kernel/ptrace.c
@@ -57,43 +57,10 @@ void ptrace_disable(struct task_struct *child)
57 h8300_disable_trace(child); 57 h8300_disable_trace(child);
58} 58}
59 59
60asmlinkage long sys_ptrace(long request, long pid, long addr, long data) 60long arch_ptrace(struct task_struct *child, long request, long addr, long data)
61{ 61{
62 struct task_struct *child;
63 int ret; 62 int ret;
64 63
65 lock_kernel();
66 ret = -EPERM;
67 if (request == PTRACE_TRACEME) {
68 /* are we already being traced? */
69 if (current->ptrace & PT_PTRACED)
70 goto out;
71 /* set the ptrace bit in the process flags. */
72 current->ptrace |= PT_PTRACED;
73 ret = 0;
74 goto out;
75 }
76 ret = -ESRCH;
77 read_lock(&tasklist_lock);
78 child = find_task_by_pid(pid);
79 if (child)
80 get_task_struct(child);
81 read_unlock(&tasklist_lock);
82 if (!child)
83 goto out;
84
85 ret = -EPERM;
86 if (pid == 1) /* you may not mess with init */
87 goto out_tsk;
88
89 if (request == PTRACE_ATTACH) {
90 ret = ptrace_attach(child);
91 goto out_tsk;
92 }
93 ret = ptrace_check_attach(child, request == PTRACE_KILL);
94 if (ret < 0)
95 goto out_tsk;
96
97 switch (request) { 64 switch (request) {
98 case PTRACE_PEEKTEXT: /* read word at location addr. */ 65 case PTRACE_PEEKTEXT: /* read word at location addr. */
99 case PTRACE_PEEKDATA: { 66 case PTRACE_PEEKDATA: {
@@ -251,10 +218,6 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
251 ret = -EIO; 218 ret = -EIO;
252 break; 219 break;
253 } 220 }
254out_tsk:
255 put_task_struct(child);
256out:
257 unlock_kernel();
258 return ret; 221 return ret;
259} 222}
260 223