diff options
author | Tony Lindgren <tony@atomide.com> | 2010-08-04 07:43:45 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-08-04 07:43:45 -0400 |
commit | 7590d1defdc720a97a9e186f45f529c4ae1b40f7 (patch) | |
tree | e7ffdc043a2847f410d654d8e99e001f3138937a /arch/arm/include/asm/ptrace.h | |
parent | 7e788b4289bb025a96e327c604cb2db92e17108f (diff) | |
parent | 869fef41547db95df8523bf67845a21313709428 (diff) |
Merge branch 'devel-map-io' into omap-for-linus
Diffstat (limited to 'arch/arm/include/asm/ptrace.h')
-rw-r--r-- | arch/arm/include/asm/ptrace.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h index 9dcb11e59026..c974be8913a7 100644 --- a/arch/arm/include/asm/ptrace.h +++ b/arch/arm/include/asm/ptrace.h | |||
@@ -184,6 +184,42 @@ extern unsigned long profile_pc(struct pt_regs *regs); | |||
184 | #define predicate(x) ((x) & 0xf0000000) | 184 | #define predicate(x) ((x) & 0xf0000000) |
185 | #define PREDICATE_ALWAYS 0xe0000000 | 185 | #define PREDICATE_ALWAYS 0xe0000000 |
186 | 186 | ||
187 | /* | ||
188 | * kprobe-based event tracer support | ||
189 | */ | ||
190 | #include <linux/stddef.h> | ||
191 | #include <linux/types.h> | ||
192 | #define MAX_REG_OFFSET (offsetof(struct pt_regs, ARM_ORIG_r0)) | ||
193 | |||
194 | extern int regs_query_register_offset(const char *name); | ||
195 | extern const char *regs_query_register_name(unsigned int offset); | ||
196 | extern bool regs_within_kernel_stack(struct pt_regs *regs, unsigned long addr); | ||
197 | extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, | ||
198 | unsigned int n); | ||
199 | |||
200 | /** | ||
201 | * regs_get_register() - get register value from its offset | ||
202 | * @regs: pt_regs from which register value is gotten | ||
203 | * @offset: offset number of the register. | ||
204 | * | ||
205 | * regs_get_register returns the value of a register whose offset from @regs. | ||
206 | * The @offset is the offset of the register in struct pt_regs. | ||
207 | * If @offset is bigger than MAX_REG_OFFSET, this returns 0. | ||
208 | */ | ||
209 | static inline unsigned long regs_get_register(struct pt_regs *regs, | ||
210 | unsigned int offset) | ||
211 | { | ||
212 | if (unlikely(offset > MAX_REG_OFFSET)) | ||
213 | return 0; | ||
214 | return *(unsigned long *)((unsigned long)regs + offset); | ||
215 | } | ||
216 | |||
217 | /* Valid only for Kernel mode traps. */ | ||
218 | static inline unsigned long kernel_stack_pointer(struct pt_regs *regs) | ||
219 | { | ||
220 | return regs->ARM_sp; | ||
221 | } | ||
222 | |||
187 | #endif /* __KERNEL__ */ | 223 | #endif /* __KERNEL__ */ |
188 | 224 | ||
189 | #endif /* __ASSEMBLY__ */ | 225 | #endif /* __ASSEMBLY__ */ |