aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/include/asm
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/include/asm
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/include/asm')
-rw-r--r--arch/arc/include/asm/kprobes.h62
-rw-r--r--arch/arc/include/asm/ptrace.h5
2 files changed, 67 insertions, 0 deletions
diff --git a/arch/arc/include/asm/kprobes.h b/arch/arc/include/asm/kprobes.h
new file mode 100644
index 000000000000..4d9c211fce70
--- /dev/null
+++ b/arch/arc/include/asm/kprobes.h
@@ -0,0 +1,62 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _ARC_KPROBES_H
10#define _ARC_KPROBES_H
11
12#ifdef CONFIG_KPROBES
13
14typedef u16 kprobe_opcode_t;
15
16#define UNIMP_S_INSTRUCTION 0x79e0
17#define TRAP_S_2_INSTRUCTION 0x785e
18
19#define MAX_INSN_SIZE 8
20#define MAX_STACK_SIZE 64
21
22struct arch_specific_insn {
23 int is_short;
24 kprobe_opcode_t *t1_addr, *t2_addr;
25 kprobe_opcode_t t1_opcode, t2_opcode;
26};
27
28#define flush_insn_slot(p) do { } while (0)
29
30#define kretprobe_blacklist_size 0
31
32struct kprobe;
33
34void arch_remove_kprobe(struct kprobe *p);
35
36int kprobe_exceptions_notify(struct notifier_block *self,
37 unsigned long val, void *data);
38
39struct prev_kprobe {
40 struct kprobe *kp;
41 unsigned long status;
42};
43
44struct kprobe_ctlblk {
45 unsigned int kprobe_status;
46 struct pt_regs jprobe_saved_regs;
47 char jprobes_stack[MAX_STACK_SIZE];
48 struct prev_kprobe prev_kprobe;
49};
50
51int kprobe_fault_handler(struct pt_regs *regs, unsigned long cause);
52void kretprobe_trampoline(void);
53void trap_is_kprobe(unsigned long cause, unsigned long address,
54 struct pt_regs *regs);
55#else
56static void trap_is_kprobe(unsigned long cause, unsigned long address,
57 struct pt_regs *regs)
58{
59}
60#endif
61
62#endif
diff --git a/arch/arc/include/asm/ptrace.h b/arch/arc/include/asm/ptrace.h
index a98957a95fb3..063ed0040ef7 100644
--- a/arch/arc/include/asm/ptrace.h
+++ b/arch/arc/include/asm/ptrace.h
@@ -111,6 +111,11 @@ struct callee_regs {
111 (struct pt_regs *)(pg_start + THREAD_SIZE - 4) - 1; \ 111 (struct pt_regs *)(pg_start + THREAD_SIZE - 4) - 1; \
112}) 112})
113 113
114static inline long regs_return_value(struct pt_regs *regs)
115{
116 return regs->r0;
117}
118
114#endif /* !__ASSEMBLY__ */ 119#endif /* !__ASSEMBLY__ */
115 120
116#define orig_r8_IS_SCALL 0x0001 121#define orig_r8_IS_SCALL 0x0001