aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/kernel
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2009-07-07 01:54:54 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2009-12-06 05:18:23 -0500
commitf60a5572679ef8508b62bd82063b05ffbe838716 (patch)
tree73f8b9d774df1e700b132f4283758515090d8435 /arch/m68knommu/kernel
parentf195e2bff3000b8bc251ee6f685e0f027eec6f25 (diff)
m68knommu: define arch_has_single_step() and friends
Towards adding CONFIG_UTRACE support for non-mmu m68k add arch_has_single_step, and its support functions user_enable_single_step() and user_disable_single_step(). [Geert] m68k conflict resolution from linux-next Signed-off-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68knommu/kernel')
-rw-r--r--arch/m68knommu/kernel/ptrace.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/arch/m68knommu/kernel/ptrace.c b/arch/m68knommu/kernel/ptrace.c
index ef70ca070ce2..4d3828959fb0 100644
--- a/arch/m68knommu/kernel/ptrace.c
+++ b/arch/m68knommu/kernel/ptrace.c
@@ -86,6 +86,20 @@ static inline int put_reg(struct task_struct *task, int regno,
86 return 0; 86 return 0;
87} 87}
88 88
89void user_enable_single_step(struct task_struct *task)
90{
91 unsigned long srflags;
92 srflags = get_reg(task, PT_SR) | (TRACE_BITS << 16);
93 put_reg(task, PT_SR, srflags);
94}
95
96void user_disable_single_step(struct task_struct *task)
97{
98 unsigned long srflags;
99 srflags = get_reg(task, PT_SR) & ~(TRACE_BITS << 16);
100 put_reg(task, PT_SR, srflags);
101}
102
89/* 103/*
90 * Called by kernel/ptrace.c when detaching.. 104 * Called by kernel/ptrace.c when detaching..
91 * 105 *
@@ -93,10 +107,8 @@ static inline int put_reg(struct task_struct *task, int regno,
93 */ 107 */
94void ptrace_disable(struct task_struct *child) 108void ptrace_disable(struct task_struct *child)
95{ 109{
96 unsigned long tmp;
97 /* make sure the single step bit is not set. */ 110 /* make sure the single step bit is not set. */
98 tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); 111 user_disable_single_step(child);
99 put_reg(child, PT_SR, tmp);
100} 112}
101 113
102long arch_ptrace(struct task_struct *child, long request, long addr, long data) 114long arch_ptrace(struct task_struct *child, long request, long addr, long data)