aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/traps.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/traps.c')
-rw-r--r--arch/mips/kernel/traps.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 1515b673179d..4c6079f24958 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -25,6 +25,7 @@
25#include <linux/ptrace.h> 25#include <linux/ptrace.h>
26#include <linux/kgdb.h> 26#include <linux/kgdb.h>
27#include <linux/kdebug.h> 27#include <linux/kdebug.h>
28#include <linux/kprobes.h>
28#include <linux/notifier.h> 29#include <linux/notifier.h>
29#include <linux/kdb.h> 30#include <linux/kdb.h>
30 31
@@ -334,7 +335,7 @@ void show_regs(struct pt_regs *regs)
334 __show_regs((struct pt_regs *)regs); 335 __show_regs((struct pt_regs *)regs);
335} 336}
336 337
337void show_registers(const struct pt_regs *regs) 338void show_registers(struct pt_regs *regs)
338{ 339{
339 const int field = 2 * sizeof(unsigned long); 340 const int field = 2 * sizeof(unsigned long);
340 341
@@ -783,6 +784,25 @@ asmlinkage void do_bp(struct pt_regs *regs)
783 if (bcode >= (1 << 10)) 784 if (bcode >= (1 << 10))
784 bcode >>= 10; 785 bcode >>= 10;
785 786
787 /*
788 * notify the kprobe handlers, if instruction is likely to
789 * pertain to them.
790 */
791 switch (bcode) {
792 case BRK_KPROBE_BP:
793 if (notify_die(DIE_BREAK, "debug", regs, bcode, 0, 0) == NOTIFY_STOP)
794 return;
795 else
796 break;
797 case BRK_KPROBE_SSTEPBP:
798 if (notify_die(DIE_SSTEPBP, "single_step", regs, bcode, 0, 0) == NOTIFY_STOP)
799 return;
800 else
801 break;
802 default:
803 break;
804 }
805
786 do_trap_or_bp(regs, bcode, "Break"); 806 do_trap_or_bp(regs, bcode, "Break");
787 return; 807 return;
788 808