uprobes.h 927 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef __ASM_LOONGARCH_UPROBES_H
  3. #define __ASM_LOONGARCH_UPROBES_H
  4. #include <asm/inst.h>
  5. typedef u32 uprobe_opcode_t;
  6. #define MAX_UINSN_BYTES 8
  7. #define UPROBE_XOL_SLOT_BYTES MAX_UINSN_BYTES
  8. #define UPROBE_SWBP_INSN __emit_break(BRK_UPROBE_BP)
  9. #define UPROBE_SWBP_INSN_SIZE LOONGARCH_INSN_SIZE
  10. #define UPROBE_XOLBP_INSN __emit_break(BRK_UPROBE_XOLBP)
  11. struct arch_uprobe {
  12. u32 insn[2];
  13. u32 ixol[2];
  14. bool simulate;
  15. };
  16. struct arch_uprobe_task {
  17. unsigned long saved_trap_nr;
  18. };
  19. #ifdef CONFIG_UPROBES
  20. bool uprobe_breakpoint_handler(struct pt_regs *regs);
  21. bool uprobe_singlestep_handler(struct pt_regs *regs);
  22. #else /* !CONFIG_UPROBES */
  23. static inline bool uprobe_breakpoint_handler(struct pt_regs *regs) { return false; }
  24. static inline bool uprobe_singlestep_handler(struct pt_regs *regs) { return false; }
  25. #endif /* CONFIG_UPROBES */
  26. #endif /* __ASM_LOONGARCH_UPROBES_H */