Commit f60a5572 authored by Greg Ungerer's avatar Greg Ungerer Committed by Geert Uytterhoeven

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: default avatarGreg Ungerer <gerg@uclinux.org>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent f195e2bf
...@@ -90,11 +90,11 @@ extern void show_regs(struct pt_regs *); ...@@ -90,11 +90,11 @@ extern void show_regs(struct pt_regs *);
*/ */
struct task_struct; struct task_struct;
#ifdef CONFIG_MMU
#define arch_has_single_step() (1) #define arch_has_single_step() (1)
extern void user_enable_single_step(struct task_struct *); extern void user_enable_single_step(struct task_struct *);
extern void user_disable_single_step(struct task_struct *); extern void user_disable_single_step(struct task_struct *);
#ifdef CONFIG_MMU
#define arch_has_block_step() (1) #define arch_has_block_step() (1)
extern void user_enable_block_step(struct task_struct *); extern void user_enable_block_step(struct task_struct *);
#endif #endif
......
...@@ -86,6 +86,20 @@ static inline int put_reg(struct task_struct *task, int regno, ...@@ -86,6 +86,20 @@ static inline int put_reg(struct task_struct *task, int regno,
return 0; 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.. * Called by kernel/ptrace.c when detaching..
* *
...@@ -93,10 +107,8 @@ static inline int put_reg(struct task_struct *task, int regno, ...@@ -93,10 +107,8 @@ static inline int put_reg(struct task_struct *task, int regno,
*/ */
void ptrace_disable(struct task_struct *child) void ptrace_disable(struct task_struct *child)
{ {
unsigned long tmp;
/* make sure the single step bit is not set. */ /* make sure the single step bit is not set. */
tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); user_disable_single_step(child);
put_reg(child, PT_SR, tmp);
} }
long arch_ptrace(struct task_struct *child, long request, long addr, long data) long arch_ptrace(struct task_struct *child, long request, long addr, long data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment