diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-01-26 02:33:53 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-03-09 00:30:51 -0500 |
commit | e8f263dfd32a784a816fe68956e564f8ede4a9fc (patch) | |
tree | 58fcc786db192f13c3df7febee705adaaf61012c /arch/blackfin/include/asm/ptrace.h | |
parent | e50e2f25c5b90abd00a1e5871c45094cf5207afc (diff) |
Blackfin: initial tracehook support
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/include/asm/ptrace.h')
-rw-r--r-- | arch/blackfin/include/asm/ptrace.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/blackfin/include/asm/ptrace.h b/arch/blackfin/include/asm/ptrace.h index c1aebdb981c7..aaa1c6c2bc19 100644 --- a/arch/blackfin/include/asm/ptrace.h +++ b/arch/blackfin/include/asm/ptrace.h | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #ifndef __ASSEMBLY__ | 25 | #ifndef __ASSEMBLY__ |
26 | 26 | ||
27 | struct task_struct; | ||
28 | |||
27 | /* this struct defines the way the registers are stored on the | 29 | /* this struct defines the way the registers are stored on the |
28 | stack during a system call. */ | 30 | stack during a system call. */ |
29 | 31 | ||
@@ -101,9 +103,30 @@ struct pt_regs { | |||
101 | master interrupt enable. */ | 103 | master interrupt enable. */ |
102 | #define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1))) | 104 | #define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1))) |
103 | #define instruction_pointer(regs) ((regs)->pc) | 105 | #define instruction_pointer(regs) ((regs)->pc) |
106 | #define user_stack_pointer(regs) ((regs)->usp) | ||
104 | #define profile_pc(regs) instruction_pointer(regs) | 107 | #define profile_pc(regs) instruction_pointer(regs) |
105 | extern void show_regs(struct pt_regs *); | 108 | extern void show_regs(struct pt_regs *); |
106 | 109 | ||
110 | #define arch_has_single_step() (1) | ||
111 | extern void user_enable_single_step(struct task_struct *child); | ||
112 | extern void user_disable_single_step(struct task_struct *child); | ||
113 | /* common code demands this function */ | ||
114 | #define ptrace_disable(child) user_disable_single_step(child) | ||
115 | |||
116 | /* | ||
117 | * Get the address of the live pt_regs for the specified task. | ||
118 | * These are saved onto the top kernel stack when the process | ||
119 | * is not running. | ||
120 | * | ||
121 | * Note: if a user thread is execve'd from kernel space, the | ||
122 | * kernel stack will not be empty on entry to the kernel, so | ||
123 | * ptracing these tasks will fail. | ||
124 | */ | ||
125 | #define task_pt_regs(task) \ | ||
126 | (struct pt_regs *) \ | ||
127 | ((unsigned long)task_stack_page(task) + \ | ||
128 | (THREAD_SIZE - sizeof(struct pt_regs))) | ||
129 | |||
107 | #endif /* __KERNEL__ */ | 130 | #endif /* __KERNEL__ */ |
108 | 131 | ||
109 | #endif /* __ASSEMBLY__ */ | 132 | #endif /* __ASSEMBLY__ */ |