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 117adb1..a6ab663 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 *); */ struct task_struct; -#ifdef CONFIG_MMU #define arch_has_single_step() (1) extern void user_enable_single_step(struct task_struct *); extern void user_disable_single_step(struct task_struct *); +#ifdef CONFIG_MMU #define arch_has_block_step() (1) extern void user_enable_block_step(struct task_struct *); #endif diff --git a/arch/m68knommu/kernel/ptrace.c b/arch/m68knommu/kernel/ptrace.c index ef70ca0..4d38289 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, return 0; } +void user_enable_single_step(struct task_struct *task) +{ + unsigned long srflags; + srflags = get_reg(task, PT_SR) | (TRACE_BITS << 16); + put_reg(task, PT_SR, srflags); +} + +void user_disable_single_step(struct task_struct *task) +{ + unsigned long srflags; + srflags = get_reg(task, PT_SR) & ~(TRACE_BITS << 16); + put_reg(task, PT_SR, srflags); +} + /* * Called by kernel/ptrace.c when detaching.. * @@ -93,10 +107,8 @@ static inline int put_reg(struct task_struct *task, int regno, */ void ptrace_disable(struct task_struct *child) { - unsigned long tmp; /* make sure the single step bit is not set. */ - tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); - put_reg(child, PT_SR, tmp); + user_disable_single_step(child); } long arch_ptrace(struct task_struct *child, long request, long addr, long data) |