diff options
author | Sven Schnelle <svens@stackframe.org> | 2019-04-07 20:10:57 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2019-05-03 23:47:39 +0200 |
commit | ea1afe339a2b1260aa31a4d100155d4403446704 (patch) | |
tree | be45240ecc2b07201b886994b9ab71059bd90f00 /arch/parisc/include/asm/ptrace.h | |
parent | 82d96bf68e6c2101dfbba2984cd9565643f5d8cb (diff) | |
download | lwn-ea1afe339a2b1260aa31a4d100155d4403446704.tar.gz lwn-ea1afe339a2b1260aa31a4d100155d4403446704.zip |
parisc: add functions required by KPROBE_EVENTS
implement regs_get_register(), regs_get_kernel_stack_nth() and
regs_within_kernel_stack()
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/include/asm/ptrace.h')
-rw-r--r-- | arch/parisc/include/asm/ptrace.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/parisc/include/asm/ptrace.h b/arch/parisc/include/asm/ptrace.h index 9ff033d261ab..143fb2a89dd8 100644 --- a/arch/parisc/include/asm/ptrace.h +++ b/arch/parisc/include/asm/ptrace.h @@ -37,4 +37,17 @@ extern int regs_query_register_offset(const char *name); extern const char *regs_query_register_name(unsigned int offset); #define MAX_REG_OFFSET (offsetof(struct pt_regs, ipsw)) +#define kernel_stack_pointer(regs) ((regs)->gr[30]) + +static inline unsigned long regs_get_register(struct pt_regs *regs, + unsigned int offset) +{ + if (unlikely(offset > MAX_REG_OFFSET)) + return 0; + return *(unsigned long *)((unsigned long)regs + offset); +} + +unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n); +int regs_within_kernel_stack(struct pt_regs *regs, unsigned long addr); + #endif |