uprobes.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2012 Rabin Vincent <rabin at rab.in>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef _ASM_UPROBES_H
  9. #define _ASM_UPROBES_H
  10. #include <asm/probes.h>
  11. #include <asm/opcodes.h>
  12. typedef u32 uprobe_opcode_t;
  13. #define MAX_UINSN_BYTES 4
  14. #define UPROBE_XOL_SLOT_BYTES 64
  15. #define UPROBE_SWBP_ARM_INSN 0xe7f001f9
  16. #define UPROBE_SS_ARM_INSN 0xe7f001fa
  17. #define UPROBE_SWBP_INSN __opcode_to_mem_arm(UPROBE_SWBP_ARM_INSN)
  18. #define UPROBE_SWBP_INSN_SIZE 4
  19. struct arch_uprobe_task {
  20. u32 backup;
  21. unsigned long saved_trap_no;
  22. };
  23. struct arch_uprobe {
  24. u8 insn[MAX_UINSN_BYTES];
  25. unsigned long ixol[2];
  26. uprobe_opcode_t bpinsn;
  27. bool simulate;
  28. u32 pcreg;
  29. void (*prehandler)(struct arch_uprobe *auprobe,
  30. struct arch_uprobe_task *autask,
  31. struct pt_regs *regs);
  32. void (*posthandler)(struct arch_uprobe *auprobe,
  33. struct arch_uprobe_task *autask,
  34. struct pt_regs *regs);
  35. struct arch_probes_insn asi;
  36. };
  37. #endif