kprobes.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _SPARC64_KPROBES_H
  3. #define _SPARC64_KPROBES_H
  4. #include <asm-generic/kprobes.h>
  5. #define BREAKPOINT_INSTRUCTION 0x91d02070 /* ta 0x70 */
  6. #define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */
  7. #ifdef CONFIG_KPROBES
  8. #include <linux/types.h>
  9. #include <linux/percpu.h>
  10. typedef u32 kprobe_opcode_t;
  11. #define MAX_INSN_SIZE 2
  12. #define kretprobe_blacklist_size 0
  13. #define arch_remove_kprobe(p) do {} while (0)
  14. #define flush_insn_slot(p) \
  15. do { flushi(&(p)->ainsn.insn[0]); \
  16. flushi(&(p)->ainsn.insn[1]); \
  17. } while (0)
  18. void __kretprobe_trampoline(void);
  19. /* Architecture specific copy of original instruction*/
  20. struct arch_specific_insn {
  21. /* copy of the original instruction */
  22. kprobe_opcode_t insn[MAX_INSN_SIZE];
  23. };
  24. struct prev_kprobe {
  25. struct kprobe *kp;
  26. unsigned long status;
  27. unsigned long orig_tnpc;
  28. unsigned long orig_tstate_pil;
  29. };
  30. /* per-cpu kprobe control block */
  31. struct kprobe_ctlblk {
  32. unsigned long kprobe_status;
  33. unsigned long kprobe_orig_tnpc;
  34. unsigned long kprobe_orig_tstate_pil;
  35. struct prev_kprobe prev_kprobe;
  36. };
  37. int kprobe_exceptions_notify(struct notifier_block *self,
  38. unsigned long val, void *data);
  39. int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
  40. asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
  41. struct pt_regs *regs);
  42. #endif /* CONFIG_KPROBES */
  43. #endif /* _SPARC64_KPROBES_H */