kprobes.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 arch_remove_kprobe(p) do {} while (0)
  10. #define flush_insn_slot(p) \
  11. do { flushi(&(p)->ainsn.insn[0]); \
  12. flushi(&(p)->ainsn.insn[1]); \
  13. } while (0)
  14. /* Architecture specific copy of original instruction*/
  15. struct arch_specific_insn {
  16. /* copy of the original instruction */
  17. kprobe_opcode_t insn[MAX_INSN_SIZE];
  18. };
  19. struct prev_kprobe {
  20. struct kprobe *kp;
  21. unsigned long status;
  22. unsigned long orig_tnpc;
  23. unsigned long orig_tstate_pil;
  24. };
  25. /* per-cpu kprobe control block */
  26. struct kprobe_ctlblk {
  27. unsigned long kprobe_status;
  28. unsigned long kprobe_orig_tnpc;
  29. unsigned long kprobe_orig_tstate_pil;
  30. struct pt_regs jprobe_saved_regs;
  31. struct prev_kprobe prev_kprobe;
  32. };
  33. extern int kprobe_exceptions_notify(struct notifier_block *self,
  34. unsigned long val, void *data);
  35. extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
  36. #endif /* _SPARC64_KPROBES_H */