diff options
author | Sandeepa Prabhu <sandeepa.prabhu@linaro.org> | 2013-12-04 00:50:20 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2013-12-19 12:43:11 -0500 |
commit | ee6214cec7818867f368c35843ea1f3dffcbb57c (patch) | |
tree | dc85030cc4fee90004063af8401489f5091af3a6 /arch/arm64/include | |
parent | 26920dd2da79a3207803da9453c0e6c82ac968ca (diff) |
arm64: support single-step and breakpoint handler hooks
AArch64 Single Steping and Breakpoint debug exceptions will be
used by multiple debug framworks like kprobes & kgdb.
This patch implements the hooks for those frameworks to register
their own handlers for handling breakpoint and single step events.
Reworked the debug exception handler in entry.S: do_dbg to route
software breakpoint (BRK64) exception to do_debug_exception()
Signed-off-by: Sandeepa Prabhu <sandeepa.prabhu@linaro.org>
Signed-off-by: Deepak Saxena <dsaxena@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r-- | arch/arm64/include/asm/debug-monitors.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/debug-monitors.h b/arch/arm64/include/asm/debug-monitors.h index a2232d07be9d..62314791570c 100644 --- a/arch/arm64/include/asm/debug-monitors.h +++ b/arch/arm64/include/asm/debug-monitors.h | |||
@@ -62,6 +62,27 @@ struct task_struct; | |||
62 | 62 | ||
63 | #define DBG_ARCH_ID_RESERVED 0 /* In case of ptrace ABI updates. */ | 63 | #define DBG_ARCH_ID_RESERVED 0 /* In case of ptrace ABI updates. */ |
64 | 64 | ||
65 | #define DBG_HOOK_HANDLED 0 | ||
66 | #define DBG_HOOK_ERROR 1 | ||
67 | |||
68 | struct step_hook { | ||
69 | struct list_head node; | ||
70 | int (*fn)(struct pt_regs *regs, unsigned int esr); | ||
71 | }; | ||
72 | |||
73 | void register_step_hook(struct step_hook *hook); | ||
74 | void unregister_step_hook(struct step_hook *hook); | ||
75 | |||
76 | struct break_hook { | ||
77 | struct list_head node; | ||
78 | u32 esr_val; | ||
79 | u32 esr_mask; | ||
80 | int (*fn)(struct pt_regs *regs, unsigned int esr); | ||
81 | }; | ||
82 | |||
83 | void register_break_hook(struct break_hook *hook); | ||
84 | void unregister_break_hook(struct break_hook *hook); | ||
85 | |||
65 | u8 debug_monitors_arch(void); | 86 | u8 debug_monitors_arch(void); |
66 | 87 | ||
67 | void enable_debug_monitors(enum debug_el el); | 88 | void enable_debug_monitors(enum debug_el el); |