kprobes.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef _SPARC64_KPROBES_H
  2. #define _SPARC64_KPROBES_H
  3. #include <linux/config.h>
  4. #include <linux/types.h>
  5. #include <linux/percpu.h>
  6. typedef u32 kprobe_opcode_t;
  7. #define BREAKPOINT_INSTRUCTION 0x91d02070 /* ta 0x70 */
  8. #define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */
  9. #define MAX_INSN_SIZE 2
  10. #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
  11. /* Architecture specific copy of original instruction*/
  12. struct arch_specific_insn {
  13. /* copy of the original instruction */
  14. kprobe_opcode_t insn[MAX_INSN_SIZE];
  15. };
  16. struct prev_kprobe {
  17. struct kprobe *kp;
  18. unsigned int status;
  19. unsigned long orig_tnpc;
  20. unsigned long orig_tstate_pil;
  21. };
  22. /* per-cpu kprobe control block */
  23. struct kprobe_ctlblk {
  24. unsigned long kprobe_status;
  25. unsigned long kprobe_orig_tnpc;
  26. unsigned long kprobe_orig_tstate_pil;
  27. long *jprobe_saved_esp;
  28. struct pt_regs jprobe_saved_regs;
  29. struct pt_regs *jprobe_saved_regs_location;
  30. struct sparc_stackf jprobe_saved_stack;
  31. struct prev_kprobe prev_kprobe;
  32. };
  33. #ifdef CONFIG_KPROBES
  34. extern int kprobe_exceptions_notify(struct notifier_block *self,
  35. unsigned long val, void *data);
  36. #else /* !CONFIG_KPROBES */
  37. static inline int kprobe_exceptions_notify(struct notifier_block *self,
  38. unsigned long val, void *data)
  39. {
  40. return 0;
  41. }
  42. #endif
  43. #endif /* _SPARC64_KPROBES_H */