kprobes.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * arch/parisc/include/asm/kprobes.h
  4. *
  5. * PA-RISC kprobes implementation
  6. *
  7. * Copyright (c) 2019 Sven Schnelle <[email protected]>
  8. */
  9. #ifndef _PARISC_KPROBES_H
  10. #define _PARISC_KPROBES_H
  11. #ifdef CONFIG_KPROBES
  12. #include <asm-generic/kprobes.h>
  13. #include <linux/types.h>
  14. #include <linux/ptrace.h>
  15. #include <linux/notifier.h>
  16. #define PARISC_KPROBES_BREAK_INSN 0x3ff801f
  17. #define PARISC_KPROBES_BREAK_INSN2 0x3ff801e
  18. #define __ARCH_WANT_KPROBES_INSN_SLOT
  19. #define MAX_INSN_SIZE 2
  20. typedef u32 kprobe_opcode_t;
  21. struct kprobe;
  22. void arch_remove_kprobe(struct kprobe *p);
  23. #define flush_insn_slot(p) \
  24. flush_icache_range((unsigned long)&(p)->ainsn.insn[0], \
  25. (unsigned long)&(p)->ainsn.insn[0] + \
  26. MAX_INSN_SIZE*sizeof(kprobe_opcode_t))
  27. #define kretprobe_blacklist_size 0
  28. struct arch_specific_insn {
  29. kprobe_opcode_t *insn;
  30. };
  31. struct prev_kprobe {
  32. struct kprobe *kp;
  33. unsigned long status;
  34. };
  35. struct kprobe_ctlblk {
  36. unsigned int kprobe_status;
  37. struct prev_kprobe prev_kprobe;
  38. unsigned long iaoq[2];
  39. };
  40. int __kprobes parisc_kprobe_break_handler(struct pt_regs *regs);
  41. int __kprobes parisc_kprobe_ss_handler(struct pt_regs *regs);
  42. static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
  43. {
  44. return 0;
  45. }
  46. #endif /* CONFIG_KPROBES */
  47. #endif /* _PARISC_KPROBES_H */