kprobes.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef __ASM_SH_KPROBES_H
  2. #define __ASM_SH_KPROBES_H
  3. #ifdef CONFIG_KPROBES
  4. #include <linux/types.h>
  5. #include <linux/ptrace.h>
  6. typedef insn_size_t kprobe_opcode_t;
  7. #define BREAKPOINT_INSTRUCTION 0xc33a
  8. #define MAX_INSN_SIZE 16
  9. #define MAX_STACK_SIZE 64
  10. #define MIN_STACK_SIZE(ADDR) (((MAX_STACK_SIZE) < \
  11. (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) \
  12. ? (MAX_STACK_SIZE) \
  13. : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
  14. #define flush_insn_slot(p) do { } while (0)
  15. #define kretprobe_blacklist_size 0
  16. struct kprobe;
  17. void arch_remove_kprobe(struct kprobe *);
  18. void kretprobe_trampoline(void);
  19. void jprobe_return_end(void);
  20. /* Architecture specific copy of original instruction*/
  21. struct arch_specific_insn {
  22. /* copy of the original instruction */
  23. kprobe_opcode_t insn[MAX_INSN_SIZE];
  24. };
  25. struct prev_kprobe {
  26. struct kprobe *kp;
  27. unsigned long status;
  28. };
  29. /* per-cpu kprobe control block */
  30. struct kprobe_ctlblk {
  31. unsigned long kprobe_status;
  32. unsigned long jprobe_saved_r15;
  33. struct pt_regs jprobe_saved_regs;
  34. kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE];
  35. struct prev_kprobe prev_kprobe;
  36. };
  37. extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
  38. extern int kprobe_exceptions_notify(struct notifier_block *self,
  39. unsigned long val, void *data);
  40. extern int kprobe_handle_illslot(unsigned long pc);
  41. #else
  42. #define kprobe_handle_illslot(pc) (-1)
  43. #endif /* CONFIG_KPROBES */
  44. #endif /* __ASM_SH_KPROBES_H */