diff options
Diffstat (limited to 'arch/sh/kernel/hw_breakpoint.c')
-rw-r--r-- | arch/sh/kernel/hw_breakpoint.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/sh/kernel/hw_breakpoint.c b/arch/sh/kernel/hw_breakpoint.c index 022d8ed66bd6..c515a3ecf562 100644 --- a/arch/sh/kernel/hw_breakpoint.c +++ b/arch/sh/kernel/hw_breakpoint.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <asm/hw_breakpoint.h> | 21 | #include <asm/hw_breakpoint.h> |
22 | #include <asm/mmu_context.h> | 22 | #include <asm/mmu_context.h> |
23 | #include <asm/ptrace.h> | ||
23 | 24 | ||
24 | struct ubc_context { | 25 | struct ubc_context { |
25 | unsigned long pc; | 26 | unsigned long pc; |
@@ -372,7 +373,7 @@ static int __kprobes hw_breakpoint_handler(struct die_args *args) | |||
372 | rcu_read_unlock(); | 373 | rcu_read_unlock(); |
373 | } | 374 | } |
374 | 375 | ||
375 | if (bp) { | 376 | if (bp && bp->overflow_handler != ptrace_triggered) { |
376 | struct arch_hw_breakpoint *info = counter_arch_bp(bp); | 377 | struct arch_hw_breakpoint *info = counter_arch_bp(bp); |
377 | 378 | ||
378 | __raw_writel(UBC_CBR_CE | info->len | info->type, UBC_CBR0); | 379 | __raw_writel(UBC_CBR_CE | info->len | info->type, UBC_CBR0); |
@@ -387,9 +388,19 @@ static int __kprobes hw_breakpoint_handler(struct die_args *args) | |||
387 | BUILD_TRAP_HANDLER(breakpoint) | 388 | BUILD_TRAP_HANDLER(breakpoint) |
388 | { | 389 | { |
389 | unsigned long ex = lookup_exception_vector(); | 390 | unsigned long ex = lookup_exception_vector(); |
391 | siginfo_t info; | ||
392 | int err; | ||
390 | TRAP_HANDLER_DECL; | 393 | TRAP_HANDLER_DECL; |
391 | 394 | ||
392 | notify_die(DIE_BREAKPOINT, "breakpoint", regs, 0, ex, SIGTRAP); | 395 | err = notify_die(DIE_BREAKPOINT, "breakpoint", regs, 0, ex, SIGTRAP); |
396 | if (err == NOTIFY_STOP) | ||
397 | return; | ||
398 | |||
399 | /* Deliver the signal to userspace */ | ||
400 | info.si_signo = SIGTRAP; | ||
401 | info.si_errno = 0; | ||
402 | info.si_code = TRAP_HWBKPT; | ||
403 | force_sig_info(SIGTRAP, &info, current); | ||
393 | } | 404 | } |
394 | 405 | ||
395 | /* | 406 | /* |