kprobes.h 1.2 KB

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