2 * arch/arm/kernel/kprobes.h
4 * Contents moved from arch/arm/include/asm/kprobes.h which is
5 * Copyright (C) 2006, 2007 Motorola Inc.
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.
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.
17 #ifndef _ARM_KERNEL_KPROBES_H
18 #define _ARM_KERNEL_KPROBES_H
21 * These undefined instructions must be unique and
22 * reserved solely for kprobes' use.
24 #define KPROBE_ARM_BREAKPOINT_INSTRUCTION 0xe7f001f8
25 #define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION 0xde18
26 #define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018
35 typedef enum kprobe_insn (kprobe_decode_insn_t)(kprobe_opcode_t,
36 struct arch_specific_insn *);
38 #ifdef CONFIG_THUMB2_KERNEL
40 enum kprobe_insn thumb16_kprobe_decode_insn(kprobe_opcode_t,
41 struct arch_specific_insn *);
42 enum kprobe_insn thumb32_kprobe_decode_insn(kprobe_opcode_t,
43 struct arch_specific_insn *);
45 #else /* !CONFIG_THUMB2_KERNEL */
47 enum kprobe_insn arm_kprobe_decode_insn(kprobe_opcode_t,
48 struct arch_specific_insn *);
51 void __init arm_kprobe_decode_init(void);
53 extern kprobe_check_cc * const kprobe_condition_checks[16];
56 #if __LINUX_ARM_ARCH__ >= 7
58 /* str_pc_offset is architecturally defined from ARMv7 onwards */
59 #define str_pc_offset 8
60 #define find_str_pc_offset()
62 #else /* __LINUX_ARM_ARCH__ < 7 */
64 /* We need a run-time check to determine str_pc_offset */
65 extern int str_pc_offset;
66 void __init find_str_pc_offset(void);
72 * Test if load/store instructions writeback the address register.
73 * if P (bit 24) == 0 or W (bit 21) == 1
75 #define is_writeback(insn) ((insn ^ 0x01000000) & 0x01200000)
77 #endif /* _ARM_KERNEL_KPROBES_H */