kprobes.h 1.2 KB

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