blob: 7ba845320f5c05d0d9450d89cbf2dacf72b72819 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _SPARC64_KPROBES_H
2#define _SPARC64_KPROBES_H
3
4#include <linux/config.h>
5#include <linux/types.h>
Ananth N Mavinakayanahallif215d982005-11-07 01:00:11 -08006#include <linux/percpu.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
8typedef u32 kprobe_opcode_t;
9
10#define BREAKPOINT_INSTRUCTION 0x91d02070 /* ta 0x70 */
11#define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */
12#define MAX_INSN_SIZE 2
13
14#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
15
16/* Architecture specific copy of original instruction*/
17struct arch_specific_insn {
18 /* copy of the original instruction */
19 kprobe_opcode_t insn[MAX_INSN_SIZE];
20};
21
Ananth N Mavinakayanahallif215d982005-11-07 01:00:11 -080022struct prev_kprobe {
23 struct kprobe *kp;
24 unsigned int status;
25 unsigned long orig_tnpc;
26 unsigned long orig_tstate_pil;
27};
28
29/* per-cpu kprobe control block */
30struct kprobe_ctlblk {
31 unsigned long kprobe_status;
32 unsigned long kprobe_orig_tnpc;
33 unsigned long kprobe_orig_tstate_pil;
34 long *jprobe_saved_esp;
35 struct pt_regs jprobe_saved_regs;
36 struct pt_regs *jprobe_saved_regs_location;
37 struct sparc_stackf jprobe_saved_stack;
38 struct prev_kprobe prev_kprobe;
39};
40
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#ifdef CONFIG_KPROBES
42extern int kprobe_exceptions_notify(struct notifier_block *self,
43 unsigned long val, void *data);
44#else /* !CONFIG_KPROBES */
45static inline int kprobe_exceptions_notify(struct notifier_block *self,
46 unsigned long val, void *data)
47{
48 return 0;
49}
50#endif
51
52#endif /* _SPARC64_KPROBES_H */