| Chris Smith | d39f545 | 2008-09-05 17:15:39 +0900 | [diff] [blame] | 1 | #ifndef __ASM_SH_KPROBES_H | 
|  | 2 | #define __ASM_SH_KPROBES_H | 
|  | 3 |  | 
|  | 4 | #ifdef CONFIG_KPROBES | 
|  | 5 |  | 
|  | 6 | #include <linux/types.h> | 
|  | 7 | #include <linux/ptrace.h> | 
|  | 8 |  | 
| Paul Mundt | 2bcfffa | 2009-05-09 16:02:08 +0900 | [diff] [blame] | 9 | typedef insn_size_t kprobe_opcode_t; | 
| Paul Mundt | 174b5c9 | 2008-09-08 18:10:10 +0900 | [diff] [blame] | 10 | #define BREAKPOINT_INSTRUCTION	0xc33a | 
| Chris Smith | d39f545 | 2008-09-05 17:15:39 +0900 | [diff] [blame] | 11 |  | 
|  | 12 | #define MAX_INSN_SIZE 16 | 
|  | 13 | #define MAX_STACK_SIZE 64 | 
|  | 14 | #define MIN_STACK_SIZE(ADDR) (((MAX_STACK_SIZE) < \ | 
|  | 15 | (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) \ | 
|  | 16 | ? (MAX_STACK_SIZE) \ | 
|  | 17 | : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) | 
|  | 18 |  | 
| Roel Kluin | dc66ff6 | 2009-01-22 15:16:14 +0000 | [diff] [blame] | 19 | #define regs_return_value(_regs)		((_regs)->regs[0]) | 
| Chris Smith | d39f545 | 2008-09-05 17:15:39 +0900 | [diff] [blame] | 20 | #define flush_insn_slot(p)		do { } while (0) | 
|  | 21 | #define kretprobe_blacklist_size	0 | 
|  | 22 |  | 
|  | 23 | struct kprobe; | 
|  | 24 |  | 
|  | 25 | void arch_remove_kprobe(struct kprobe *); | 
|  | 26 | void kretprobe_trampoline(void); | 
|  | 27 | void jprobe_return_end(void); | 
|  | 28 |  | 
|  | 29 | /* Architecture specific copy of original instruction*/ | 
|  | 30 | struct arch_specific_insn { | 
|  | 31 | /* copy of the original instruction */ | 
|  | 32 | kprobe_opcode_t insn[MAX_INSN_SIZE]; | 
|  | 33 | }; | 
|  | 34 |  | 
|  | 35 | struct prev_kprobe { | 
|  | 36 | struct kprobe *kp; | 
|  | 37 | unsigned long status; | 
|  | 38 | }; | 
|  | 39 |  | 
|  | 40 | /* per-cpu kprobe control block */ | 
|  | 41 | struct kprobe_ctlblk { | 
|  | 42 | unsigned long kprobe_status; | 
|  | 43 | unsigned long jprobe_saved_r15; | 
|  | 44 | struct pt_regs jprobe_saved_regs; | 
|  | 45 | kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE]; | 
|  | 46 | struct prev_kprobe prev_kprobe; | 
|  | 47 | }; | 
|  | 48 |  | 
| Paul Mundt | 037c10a | 2008-09-08 12:22:47 +0900 | [diff] [blame] | 49 | extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); | 
| Chris Smith | d39f545 | 2008-09-05 17:15:39 +0900 | [diff] [blame] | 50 | extern int kprobe_exceptions_notify(struct notifier_block *self, | 
|  | 51 | unsigned long val, void *data); | 
|  | 52 | extern int kprobe_handle_illslot(unsigned long pc); | 
|  | 53 | #else | 
|  | 54 |  | 
|  | 55 | #define kprobe_handle_illslot(pc)	(-1) | 
|  | 56 |  | 
|  | 57 | #endif /* CONFIG_KPROBES */ | 
|  | 58 | #endif /* __ASM_SH_KPROBES_H */ |