kprobes.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * arch/arm/kernel/kprobes.h
  3. *
  4. * Contents moved from arch/arm/include/asm/kprobes.h which is
  5. * Copyright (C) 2006, 2007 Motorola Inc.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. */
  16. #ifndef _ARM_KERNEL_KPROBES_H
  17. #define _ARM_KERNEL_KPROBES_H
  18. /*
  19. * This undefined instruction must be unique and
  20. * reserved solely for kprobes' use.
  21. */
  22. #define KPROBE_BREAKPOINT_INSTRUCTION 0xe7f001f8
  23. enum kprobe_insn {
  24. INSN_REJECTED,
  25. INSN_GOOD,
  26. INSN_GOOD_NO_SLOT
  27. };
  28. typedef enum kprobe_insn (kprobe_decode_insn_t)(kprobe_opcode_t,
  29. struct arch_specific_insn *);
  30. #ifdef CONFIG_THUMB2_KERNEL
  31. enum kprobe_insn thumb16_kprobe_decode_insn(kprobe_opcode_t,
  32. struct arch_specific_insn *);
  33. enum kprobe_insn thumb32_kprobe_decode_insn(kprobe_opcode_t,
  34. struct arch_specific_insn *);
  35. #else /* !CONFIG_THUMB2_KERNEL */
  36. enum kprobe_insn arm_kprobe_decode_insn(kprobe_opcode_t,
  37. struct arch_specific_insn *);
  38. #endif
  39. void __init arm_kprobe_decode_init(void);
  40. extern kprobe_check_cc * const kprobe_condition_checks[16];
  41. #if __LINUX_ARM_ARCH__ >= 7
  42. /* str_pc_offset is architecturally defined from ARMv7 onwards */
  43. #define str_pc_offset 8
  44. #define find_str_pc_offset()
  45. #else /* __LINUX_ARM_ARCH__ < 7 */
  46. /* We need a run-time check to determine str_pc_offset */
  47. extern int str_pc_offset;
  48. void __init find_str_pc_offset(void);
  49. #endif
  50. /*
  51. * Test if load/store instructions writeback the address register.
  52. * if P (bit 24) == 0 or W (bit 21) == 1
  53. */
  54. #define is_writeback(insn) ((insn ^ 0x01000000) & 0x01200000)
  55. #endif /* _ARM_KERNEL_KPROBES_H */