diff options
-rw-r--r-- | arch/m68k/include/asm/ptrace.h | 2 | ||||
-rw-r--r-- | arch/m68knommu/kernel/ptrace.c | 18 |
2 files changed, 16 insertions, 4 deletions
diff --git a/arch/m68k/include/asm/ptrace.h b/arch/m68k/include/asm/ptrace.h index 117adb1e4806..a6ab663bcc2e 100644 --- a/arch/m68k/include/asm/ptrace.h +++ b/arch/m68k/include/asm/ptrace.h | |||
@@ -90,11 +90,11 @@ extern void show_regs(struct pt_regs *); | |||
90 | */ | 90 | */ |
91 | struct task_struct; | 91 | struct task_struct; |
92 | 92 | ||
93 | #ifdef CONFIG_MMU | ||
94 | #define arch_has_single_step() (1) | 93 | #define arch_has_single_step() (1) |
95 | extern void user_enable_single_step(struct task_struct *); | 94 | extern void user_enable_single_step(struct task_struct *); |
96 | extern void user_disable_single_step(struct task_struct *); | 95 | extern void user_disable_single_step(struct task_struct *); |
97 | 96 | ||
97 | #ifdef CONFIG_MMU | ||
98 | #define arch_has_block_step() (1) | 98 | #define arch_has_block_step() (1) |
99 | extern void user_enable_block_step(struct task_struct *); | 99 | extern void user_enable_block_step(struct task_struct *); |
100 | #endif | 100 | #endif |
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 | ||
89 | void 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 | |||
96 | void 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 | */ |
94 | void ptrace_disable(struct task_struct *child) | 108 | void 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 | ||
102 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 114 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |