aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel/traps.c
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-01-22 06:33:59 -0500
committerVineet Gupta <vgupta@synopsys.com>2013-02-15 12:46:05 -0500
commit4d86dfbbda09b3c67bcaeb370f22a2cc7f39205b (patch)
tree689785c7e0cc853f52b55ba10d0546313c2335a9 /arch/arc/kernel/traps.c
parente65ab5a875d9e8ad8ff37529c2ae844699fefad1 (diff)
ARC: kprobes support
Origin port done by Rajeshwar Ranga Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Rajeshwar Ranga <rajeshwar.ranga@gmail.com>
Diffstat (limited to 'arch/arc/kernel/traps.c')
-rw-r--r--arch/arc/kernel/traps.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arc/kernel/traps.c b/arch/arc/kernel/traps.c
index fd2457cec226..c6396b48fcd2 100644
--- a/arch/arc/kernel/traps.c
+++ b/arch/arc/kernel/traps.c
@@ -15,6 +15,7 @@
15#include <linux/uaccess.h> 15#include <linux/uaccess.h>
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17#include <asm/setup.h> 17#include <asm/setup.h>
18#include <asm/kprobes.h>
18 19
19void __init trap_init(void) 20void __init trap_init(void)
20{ 21{
@@ -90,6 +91,7 @@ void do_machine_check_fault(unsigned long cause, unsigned long address,
90 die("Machine Check Exception", regs, address, cause); 91 die("Machine Check Exception", regs, address, cause);
91} 92}
92 93
94
93/* 95/*
94 * Entry point for traps induced by ARCompact TRAP_S <n> insn 96 * Entry point for traps induced by ARCompact TRAP_S <n> insn
95 * This is same family as TRAP0/SWI insn (use the same vector). 97 * 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,
109 trap_is_brkpt(cause, address, regs); 111 trap_is_brkpt(cause, address, regs);
110 break; 112 break;
111 113
114 case 2:
115 trap_is_kprobe(param, address, regs);
116 break;
117
112 default: 118 default:
113 break; 119 break;
114 } 120 }
@@ -116,10 +122,17 @@ void do_non_swi_trap(unsigned long cause, unsigned long address,
116 122
117/* 123/*
118 * Entry point for Instruction Error Exception 124 * Entry point for Instruction Error Exception
125 * -For a corner case, ARC kprobes implementation resorts to using
126 * this exception, hence the check
119 */ 127 */
120void do_insterror_or_kprobe(unsigned long cause, 128void do_insterror_or_kprobe(unsigned long cause,
121 unsigned long address, 129 unsigned long address,
122 struct pt_regs *regs) 130 struct pt_regs *regs)
123{ 131{
132 /* Check if this exception is caused by kprobes */
133 if (notify_die(DIE_IERR, "kprobe_ierr", regs, address,
134 cause, SIGILL) == NOTIFY_STOP)
135 return;
136
124 insterror_is_error(cause, address, regs); 137 insterror_is_error(cause, address, regs);
125} 138}