xref: /linux/arch/sparc/include/asm/kprobes.h (revision f05a68653e56ca2f23bccf7e50be69486886f052)
1a439fe51SSam Ravnborg #ifndef _SPARC64_KPROBES_H
2a439fe51SSam Ravnborg #define _SPARC64_KPROBES_H
3a439fe51SSam Ravnborg 
4a439fe51SSam Ravnborg #include <linux/types.h>
5a439fe51SSam Ravnborg #include <linux/percpu.h>
6a439fe51SSam Ravnborg 
7a439fe51SSam Ravnborg typedef u32 kprobe_opcode_t;
8a439fe51SSam Ravnborg 
9a439fe51SSam Ravnborg #define BREAKPOINT_INSTRUCTION   0x91d02070 /* ta 0x70 */
10a439fe51SSam Ravnborg #define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */
11a439fe51SSam Ravnborg #define MAX_INSN_SIZE 2
12a439fe51SSam Ravnborg 
13a439fe51SSam Ravnborg #define kretprobe_blacklist_size 0
14a439fe51SSam Ravnborg 
15a439fe51SSam Ravnborg #define arch_remove_kprobe(p)	do {} while (0)
16a439fe51SSam Ravnborg 
17a439fe51SSam Ravnborg #define flush_insn_slot(p)		\
18a439fe51SSam Ravnborg do { 	flushi(&(p)->ainsn.insn[0]);	\
19a439fe51SSam Ravnborg 	flushi(&(p)->ainsn.insn[1]);	\
20a439fe51SSam Ravnborg } while (0)
21a439fe51SSam Ravnborg 
22a439fe51SSam Ravnborg void kretprobe_trampoline(void);
23a439fe51SSam Ravnborg 
24a439fe51SSam Ravnborg /* Architecture specific copy of original instruction*/
25a439fe51SSam Ravnborg struct arch_specific_insn {
26a439fe51SSam Ravnborg 	/* copy of the original instruction */
27a439fe51SSam Ravnborg 	kprobe_opcode_t insn[MAX_INSN_SIZE];
28a439fe51SSam Ravnborg };
29a439fe51SSam Ravnborg 
30a439fe51SSam Ravnborg struct prev_kprobe {
31a439fe51SSam Ravnborg 	struct kprobe *kp;
32a439fe51SSam Ravnborg 	unsigned long status;
33a439fe51SSam Ravnborg 	unsigned long orig_tnpc;
34a439fe51SSam Ravnborg 	unsigned long orig_tstate_pil;
35a439fe51SSam Ravnborg };
36a439fe51SSam Ravnborg 
37a439fe51SSam Ravnborg /* per-cpu kprobe control block */
38a439fe51SSam Ravnborg struct kprobe_ctlblk {
39a439fe51SSam Ravnborg 	unsigned long kprobe_status;
40a439fe51SSam Ravnborg 	unsigned long kprobe_orig_tnpc;
41a439fe51SSam Ravnborg 	unsigned long kprobe_orig_tstate_pil;
42a439fe51SSam Ravnborg 	struct pt_regs jprobe_saved_regs;
43a439fe51SSam Ravnborg 	struct prev_kprobe prev_kprobe;
44a439fe51SSam Ravnborg };
45a439fe51SSam Ravnborg 
46*f05a6865SSam Ravnborg int kprobe_exceptions_notify(struct notifier_block *self,
47a439fe51SSam Ravnborg 			     unsigned long val, void *data);
48*f05a6865SSam Ravnborg int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
49a439fe51SSam Ravnborg #endif /* _SPARC64_KPROBES_H */
50