probes.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * arch/arm/include/asm/probes.h
  4. *
  5. * Original contents copied from arch/arm/include/asm/kprobes.h
  6. * which contains the following notice...
  7. *
  8. * Copyright (C) 2006, 2007 Motorola Inc.
  9. */
  10. #ifndef _ASM_PROBES_H
  11. #define _ASM_PROBES_H
  12. #ifndef __ASSEMBLY__
  13. typedef u32 probes_opcode_t;
  14. struct arch_probes_insn;
  15. typedef void (probes_insn_handler_t)(probes_opcode_t,
  16. struct arch_probes_insn *,
  17. struct pt_regs *);
  18. typedef unsigned long (probes_check_cc)(unsigned long);
  19. typedef void (probes_insn_singlestep_t)(probes_opcode_t,
  20. struct arch_probes_insn *,
  21. struct pt_regs *);
  22. typedef void (probes_insn_fn_t)(void);
  23. /* Architecture specific copy of original instruction. */
  24. struct arch_probes_insn {
  25. probes_opcode_t *insn;
  26. probes_insn_handler_t *insn_handler;
  27. probes_check_cc *insn_check_cc;
  28. probes_insn_singlestep_t *insn_singlestep;
  29. probes_insn_fn_t *insn_fn;
  30. int stack_space;
  31. unsigned long register_usage_flags;
  32. bool kprobe_direct_exec;
  33. };
  34. #endif /* __ASSEMBLY__ */
  35. /*
  36. * We assume one instruction can consume at most 64 bytes stack, which is
  37. * 'push {r0-r15}'. Instructions consume more or unknown stack space like
  38. * 'str r0, [sp, #-80]' and 'str r0, [sp, r1]' should be prohibit to probe.
  39. */
  40. #define MAX_STACK_SIZE 64
  41. #endif