summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2008-02-11 22:43:38 +0100
committerTony Luck <tony.luck@intel.com>2008-03-05 15:49:11 -0800
commit8db3f5254151c3a06a764bbb18283570ba1897bf (patch)
tree3ea87ac42410202946c5c18871ba212c2c8192b2
parenteac738e6cea16bfbd7b9018d60d009aedd2d14b6 (diff)
downloadblackbird-op-linux-8db3f5254151c3a06a764bbb18283570ba1897bf.tar.gz
blackbird-op-linux-8db3f5254151c3a06a764bbb18283570ba1897bf.zip
[IA64] remove duplicate code from arch_ptrace()
Remove all code which does exactly the same thing as ptrace_request(). Signed-off-by: Petr Tesarik <ptesarik@suse.cz> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--arch/ia64/kernel/ptrace.c96
-rw-r--r--include/asm-ia64/ptrace.h7
2 files changed, 36 insertions, 67 deletions
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 1dfff5a8f365..f10c8b40dd3f 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -1454,6 +1454,35 @@ ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr)
return ret;
}
+void
+user_enable_single_step (struct task_struct *child)
+{
+ struct ia64_psr *child_psr = ia64_psr(task_pt_regs(child));
+
+ set_tsk_thread_flag(child, TIF_SINGLESTEP);
+ child_psr->ss = 1;
+}
+
+void
+user_enable_block_step (struct task_struct *child)
+{
+ struct ia64_psr *child_psr = ia64_psr(task_pt_regs(child));
+
+ set_tsk_thread_flag(child, TIF_SINGLESTEP);
+ child_psr->tb = 1;
+}
+
+void
+user_disable_single_step (struct task_struct *child)
+{
+ struct ia64_psr *child_psr = ia64_psr(task_pt_regs(child));
+
+ /* make sure the single step/taken-branch trap bits are not set: */
+ clear_tsk_thread_flag(child, TIF_SINGLESTEP);
+ child_psr->ss = 0;
+ child_psr->tb = 0;
+}
+
/*
* Called by kernel/ptrace.c when detaching..
*
@@ -1528,73 +1557,6 @@ arch_ptrace (struct task_struct *child, long request, long addr, long data)
ret = ptrace_request(child, PTRACE_SETSIGINFO, addr, data);
goto out_tsk;
- case PTRACE_SYSCALL:
- /* continue and stop at next (return from) syscall */
- case PTRACE_CONT:
- /* restart after signal. */
- ret = -EIO;
- if (!valid_signal(data))
- goto out_tsk;
- if (request == PTRACE_SYSCALL)
- set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
- else
- clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
- child->exit_code = data;
-
- /*
- * Make sure the single step/taken-branch trap bits
- * are not set:
- */
- clear_tsk_thread_flag(child, TIF_SINGLESTEP);
- ia64_psr(pt)->ss = 0;
- ia64_psr(pt)->tb = 0;
-
- wake_up_process(child);
- ret = 0;
- goto out_tsk;
-
- case PTRACE_KILL:
- /*
- * Make the child exit. Best I can do is send it a
- * sigkill. Perhaps it should be put in the status
- * that it wants to exit.
- */
- if (child->exit_state == EXIT_ZOMBIE)
- /* already dead */
- return 0;
- child->exit_code = SIGKILL;
-
- ptrace_disable(child);
- wake_up_process(child);
- ret = 0;
- goto out_tsk;
-
- case PTRACE_SINGLESTEP:
- /* let child execute for one instruction */
- case PTRACE_SINGLEBLOCK:
- ret = -EIO;
- if (!valid_signal(data))
- goto out_tsk;
-
- clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
- set_tsk_thread_flag(child, TIF_SINGLESTEP);
- if (request == PTRACE_SINGLESTEP) {
- ia64_psr(pt)->ss = 1;
- } else {
- ia64_psr(pt)->tb = 1;
- }
- child->exit_code = data;
-
- /* give it a chance to run. */
- wake_up_process(child);
- ret = 0;
- goto out_tsk;
-
- case PTRACE_DETACH:
- /* detach a process that was attached. */
- ret = ptrace_detach(child, data);
- goto out_tsk;
-
case PTRACE_GETREGS:
ret = ptrace_getregs(child,
(struct pt_all_user_regs __user *) data);
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h
index 5b5234098783..4b2a8d40ebc5 100644
--- a/include/asm-ia64/ptrace.h
+++ b/include/asm-ia64/ptrace.h
@@ -312,6 +312,13 @@ struct switch_stack {
#define arch_ptrace_attach(child) \
ptrace_attach_sync_user_rbs(child)
+ #define arch_has_single_step() (1)
+ extern void user_enable_single_step(struct task_struct *);
+ extern void user_disable_single_step(struct task_struct *);
+
+ #define arch_has_block_step() (1)
+ extern void user_enable_block_step(struct task_struct *);
+
#endif /* !__KERNEL__ */
/* pt_all_user_regs is used for PTRACE_GETREGS PTRACE_SETREGS */
OpenPOWER on IntegriCloud