2 * arch/arm/probes/decode-thumb.h
4 * Copyright 2013 Linaro Ltd.
5 * Written by: David A. Long
7 * The code contained herein is licensed under the GNU General Public
8 * License. You may obtain a copy of the GNU General Public License
9 * Version 2 or later at the following locations:
11 * http://www.opensource.org/licenses/gpl-license.html
12 * http://www.gnu.org/copyleft/gpl.html
15 #ifndef _ARM_KERNEL_PROBES_THUMB_H
16 #define _ARM_KERNEL_PROBES_THUMB_H
21 * True if current instruction is in an IT block.
23 #define in_it_block(cpsr) ((cpsr & 0x06000c00) != 0x00000000)
26 * Return the condition code to check for the currently executing instruction.
27 * This is in ITSTATE<7:4> which is in CPSR<15:12> but is only valid if
28 * in_it_block returns true.
30 #define current_cond(cpsr) ((cpsr >> 12) & 0xf)
32 enum probes_t32_action
{
33 PROBES_T32_EMULATE_NONE
,
34 PROBES_T32_SIMULATE_NOP
,
37 PROBES_T32_TABLE_BRANCH
,
43 PROBES_T32_ADDWSUBW_PC
,
51 PROBES_T32_BRANCH_COND
,
56 PROBES_T32_SIGN_EXTEND
,
61 PROBES_T32_MUL_ADD_LONG
,
62 NUM_PROBES_T32_ACTIONS
65 enum probes_t16_action
{
68 PROBES_T16_SIGN_EXTEND
,
84 PROBES_T16_BRANCH_COND
,
86 NUM_PROBES_T16_ACTIONS
89 extern const union decode_item probes_decode_thumb32_table
[];
90 extern const union decode_item probes_decode_thumb16_table
[];
92 enum probes_insn __kprobes
93 thumb16_probes_decode_insn(probes_opcode_t insn
, struct arch_probes_insn
*asi
,
94 bool emulate
, const union decode_action
*actions
,
95 const struct decode_checker
*checkers
[]);
96 enum probes_insn __kprobes
97 thumb32_probes_decode_insn(probes_opcode_t insn
, struct arch_probes_insn
*asi
,
98 bool emulate
, const union decode_action
*actions
,
99 const struct decode_checker
*checkers
[]);