aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-03-10 18:22:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:38 -0500
commit7a0fde8b3b16fcfb2bb4a136c53918f1ca9b35cc (patch)
tree7ba160a85e6193c26b966ce9e63d36d019909be7 /arch/m68knommu
parent857fb252a1858ccded2e31ee98c6c0ab79c07999 (diff)
m68knommu: use generic ptrace_resume code
Use the generic ptrace_resume code for PTRACE_SYSCALL, PTRACE_CONT, PTRACE_KILL and PTRACE_SINGLESTEP. m68knommu already defines the nessecary user_enable_single_step and user_disable_single_step functions for this. Also the TIF_SYSCALL_TRACE thread flag is now cleared on PTRACE_KILL which it previously wasn't which is consistent with all architectures using the modern ptrace code. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Roland McGrath <roland@redhat.com> Acked-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68knommu')
-rw-r--r--arch/m68knommu/kernel/ptrace.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/arch/m68knommu/kernel/ptrace.c b/arch/m68knommu/kernel/ptrace.c
index b100394813a7..f6be1248d216 100644
--- a/arch/m68knommu/kernel/ptrace.c
+++ b/arch/m68knommu/kernel/ptrace.c
@@ -190,62 +190,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
190 } 190 }
191 break; 191 break;
192 192
193 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
194 case PTRACE_CONT: { /* restart after signal. */
195 long tmp;
196
197 ret = -EIO;
198 if (!valid_signal(data))
199 break;
200 if (request == PTRACE_SYSCALL)
201 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
202 else
203 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
204 child->exit_code = data;
205 /* make sure the single step bit is not set. */
206 tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
207 put_reg(child, PT_SR, tmp);
208 wake_up_process(child);
209 ret = 0;
210 break;
211 }
212
213 /*
214 * make the child exit. Best I can do is send it a sigkill.
215 * perhaps it should be put in the status that it wants to
216 * exit.
217 */
218 case PTRACE_KILL: {
219 long tmp;
220
221 ret = 0;
222 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
223 break;
224 child->exit_code = SIGKILL;
225 /* make sure the single step bit is not set. */
226 tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
227 put_reg(child, PT_SR, tmp);
228 wake_up_process(child);
229 break;
230 }
231
232 case PTRACE_SINGLESTEP: { /* set the trap flag. */
233 long tmp;
234
235 ret = -EIO;
236 if (!valid_signal(data))
237 break;
238 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
239 tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16);
240 put_reg(child, PT_SR, tmp);
241
242 child->exit_code = data;
243 /* give it a chance to run. */
244 wake_up_process(child);
245 ret = 0;
246 break;
247 }
248
249 case PTRACE_GETREGS: { /* Get all gp regs from the child. */ 193 case PTRACE_GETREGS: { /* Get all gp regs from the child. */
250 int i; 194 int i;
251 unsigned long tmp; 195 unsigned long tmp;