Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _SPARC64_KPROBES_H |
| 2 | #define _SPARC64_KPROBES_H |
| 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | #include <linux/types.h> |
Ananth N Mavinakayanahalli | f215d98 | 2005-11-07 01:00:11 -0800 | [diff] [blame] | 5 | #include <linux/percpu.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | |
| 7 | typedef u32 kprobe_opcode_t; |
| 8 | |
| 9 | #define BREAKPOINT_INSTRUCTION 0x91d02070 /* ta 0x70 */ |
| 10 | #define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */ |
| 11 | #define MAX_INSN_SIZE 2 |
| 12 | |
Masami Hiramatsu | f438d91 | 2007-10-16 01:27:49 -0700 | [diff] [blame] | 13 | #define kretprobe_blacklist_size 0 |
| 14 | |
Ananth N Mavinakayanahalli | 0498b63 | 2006-01-09 20:52:46 -0800 | [diff] [blame] | 15 | #define arch_remove_kprobe(p) do {} while (0) |
David S. Miller | f088258 | 2006-12-10 02:42:03 -0800 | [diff] [blame] | 16 | |
| 17 | #define flush_insn_slot(p) \ |
| 18 | do { flushi(&(p)->ainsn.insn[0]); \ |
| 19 | flushi(&(p)->ainsn.insn[1]); \ |
| 20 | } while (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | |
David S. Miller | d38f122 | 2008-02-09 03:40:55 -0800 | [diff] [blame] | 22 | void kretprobe_trampoline(void); |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | /* Architecture specific copy of original instruction*/ |
| 25 | struct arch_specific_insn { |
| 26 | /* copy of the original instruction */ |
| 27 | kprobe_opcode_t insn[MAX_INSN_SIZE]; |
| 28 | }; |
| 29 | |
Ananth N Mavinakayanahalli | f215d98 | 2005-11-07 01:00:11 -0800 | [diff] [blame] | 30 | struct prev_kprobe { |
| 31 | struct kprobe *kp; |
David S. Miller | f088258 | 2006-12-10 02:42:03 -0800 | [diff] [blame] | 32 | unsigned long status; |
Ananth N Mavinakayanahalli | f215d98 | 2005-11-07 01:00:11 -0800 | [diff] [blame] | 33 | unsigned long orig_tnpc; |
| 34 | unsigned long orig_tstate_pil; |
| 35 | }; |
| 36 | |
| 37 | /* per-cpu kprobe control block */ |
| 38 | struct kprobe_ctlblk { |
| 39 | unsigned long kprobe_status; |
| 40 | unsigned long kprobe_orig_tnpc; |
| 41 | unsigned long kprobe_orig_tstate_pil; |
Ananth N Mavinakayanahalli | f215d98 | 2005-11-07 01:00:11 -0800 | [diff] [blame] | 42 | struct pt_regs jprobe_saved_regs; |
Ananth N Mavinakayanahalli | f215d98 | 2005-11-07 01:00:11 -0800 | [diff] [blame] | 43 | struct prev_kprobe prev_kprobe; |
| 44 | }; |
| 45 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | extern int kprobe_exceptions_notify(struct notifier_block *self, |
| 47 | unsigned long val, void *data); |
David S. Miller | 127cda1 | 2007-05-08 18:25:14 -0700 | [diff] [blame] | 48 | extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | #endif /* _SPARC64_KPROBES_H */ |