From 4d86dfbbda09b3c67bcaeb370f22a2cc7f39205b Mon Sep 17 00:00:00 2001 From: Vineet Gupta Date: Tue, 22 Jan 2013 17:03:59 +0530 Subject: ARC: kprobes support Origin port done by Rajeshwar Ranga Signed-off-by: Vineet Gupta Cc: Rajeshwar Ranga --- arch/arc/kernel/traps.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'arch/arc/kernel/traps.c') diff --git a/arch/arc/kernel/traps.c b/arch/arc/kernel/traps.c index fd2457cec22..c6396b48fcd 100644 --- a/arch/arc/kernel/traps.c +++ b/arch/arc/kernel/traps.c @@ -15,6 +15,7 @@ #include #include #include +#include void __init trap_init(void) { @@ -90,6 +91,7 @@ void do_machine_check_fault(unsigned long cause, unsigned long address, die("Machine Check Exception", regs, address, cause); } + /* * Entry point for traps induced by ARCompact TRAP_S insn * This is same family as TRAP0/SWI insn (use the same vector). @@ -109,6 +111,10 @@ void do_non_swi_trap(unsigned long cause, unsigned long address, trap_is_brkpt(cause, address, regs); break; + case 2: + trap_is_kprobe(param, address, regs); + break; + default: break; } @@ -116,10 +122,17 @@ void do_non_swi_trap(unsigned long cause, unsigned long address, /* * Entry point for Instruction Error Exception + * -For a corner case, ARC kprobes implementation resorts to using + * this exception, hence the check */ void do_insterror_or_kprobe(unsigned long cause, unsigned long address, struct pt_regs *regs) { + /* Check if this exception is caused by kprobes */ + if (notify_die(DIE_IERR, "kprobe_ierr", regs, address, + cause, SIGILL) == NOTIFY_STOP) + return; + insterror_is_error(cause, address, regs); } -- cgit v1.2.3-70-g09d2