uprobes.h 948 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2012 Rabin Vincent <rabin at rab.in>
  4. */
  5. #ifndef _ASM_UPROBES_H
  6. #define _ASM_UPROBES_H
  7. #include <asm/probes.h>
  8. #include <asm/opcodes.h>
  9. typedef u32 uprobe_opcode_t;
  10. #define MAX_UINSN_BYTES 4
  11. #define UPROBE_XOL_SLOT_BYTES 64
  12. #define UPROBE_SWBP_ARM_INSN 0xe7f001f9
  13. #define UPROBE_SS_ARM_INSN 0xe7f001fa
  14. #define UPROBE_SWBP_INSN __opcode_to_mem_arm(UPROBE_SWBP_ARM_INSN)
  15. #define UPROBE_SWBP_INSN_SIZE 4
  16. struct arch_uprobe_task {
  17. u32 backup;
  18. unsigned long saved_trap_no;
  19. };
  20. struct arch_uprobe {
  21. u8 insn[MAX_UINSN_BYTES];
  22. unsigned long ixol[2];
  23. uprobe_opcode_t bpinsn;
  24. bool simulate;
  25. u32 pcreg;
  26. void (*prehandler)(struct arch_uprobe *auprobe,
  27. struct arch_uprobe_task *autask,
  28. struct pt_regs *regs);
  29. void (*posthandler)(struct arch_uprobe *auprobe,
  30. struct arch_uprobe_task *autask,
  31. struct pt_regs *regs);
  32. struct arch_probes_insn asi;
  33. };
  34. #endif