blob: a04145b77f9635e8a7a30504bef7f1b2cfdcc1e1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _SPARC64_KPROBES_H
2#define _SPARC64_KPROBES_H
3
Linus Torvalds1da177e2005-04-16 15:20:36 -07004#include <linux/types.h>
Ananth N Mavinakayanahallif215d982005-11-07 01:00:11 -08005#include <linux/percpu.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
7typedef 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
Ananth N Mavinakayanahalli0498b632006-01-09 20:52:46 -080013#define arch_remove_kprobe(p) do {} while (0)
David S. Millerf0882582006-12-10 02:42:03 -080014
15#define flush_insn_slot(p) \
16do { flushi(&(p)->ainsn.insn[0]); \
17 flushi(&(p)->ainsn.insn[1]); \
18} while (0)
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
20/* Architecture specific copy of original instruction*/
21struct arch_specific_insn {
22 /* copy of the original instruction */
23 kprobe_opcode_t insn[MAX_INSN_SIZE];
24};
25
Ananth N Mavinakayanahallif215d982005-11-07 01:00:11 -080026struct prev_kprobe {
27 struct kprobe *kp;
David S. Millerf0882582006-12-10 02:42:03 -080028 unsigned long status;
Ananth N Mavinakayanahallif215d982005-11-07 01:00:11 -080029 unsigned long orig_tnpc;
30 unsigned long orig_tstate_pil;
31};
32
33/* per-cpu kprobe control block */
34struct kprobe_ctlblk {
35 unsigned long kprobe_status;
36 unsigned long kprobe_orig_tnpc;
37 unsigned long kprobe_orig_tstate_pil;
Ananth N Mavinakayanahallif215d982005-11-07 01:00:11 -080038 struct pt_regs jprobe_saved_regs;
Ananth N Mavinakayanahallif215d982005-11-07 01:00:11 -080039 struct prev_kprobe prev_kprobe;
40};
41
Linus Torvalds1da177e2005-04-16 15:20:36 -070042extern int kprobe_exceptions_notify(struct notifier_block *self,
43 unsigned long val, void *data);
David S. Miller127cda12007-05-08 18:25:14 -070044extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#endif /* _SPARC64_KPROBES_H */