kprobes.h 1.5 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 u16 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 regs_return_value(regs) ((regs)->regs[0])
  15. #define flush_insn_slot(p) do { } while (0)
  16. #define kretprobe_blacklist_size 0
  17. struct kprobe;
  18. void arch_remove_kprobe(struct kprobe *);
  19. void kretprobe_trampoline(void);
  20. void jprobe_return_end(void);
  21. /* Architecture specific copy of original instruction*/
  22. struct arch_specific_insn {
  23. /* copy of the original instruction */
  24. kprobe_opcode_t insn[MAX_INSN_SIZE];
  25. };
  26. struct prev_kprobe {
  27. struct kprobe *kp;
  28. unsigned long status;
  29. };
  30. /* per-cpu kprobe control block */
  31. struct kprobe_ctlblk {
  32. unsigned long kprobe_status;
  33. unsigned long jprobe_saved_r15;
  34. struct pt_regs jprobe_saved_regs;
  35. kprobe_opcode_t jprobes_stack[MAX_STACK_SIZE];
  36. struct prev_kprobe prev_kprobe;
  37. };
  38. extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
  39. extern int kprobe_exceptions_notify(struct notifier_block *self,
  40. unsigned long val, void *data);
  41. extern int kprobe_handle_illslot(unsigned long pc);
  42. #else
  43. #define kprobe_handle_illslot(pc) (-1)
  44. #endif /* CONFIG_KPROBES */
  45. #endif /* __ASM_SH_KPROBES_H */