David A. Long | c18377c | 2014-03-07 11:16:10 -0500 | [diff] [blame] | 1 | /* |
Wang Nan | fca08f3 | 2015-01-09 10:19:49 +0800 | [diff] [blame] | 2 | * arch/arm/probes/decode-arm.h |
David A. Long | c18377c | 2014-03-07 11:16:10 -0500 | [diff] [blame] | 3 | * |
| 4 | * Copyright 2013 Linaro Ltd. |
| 5 | * Written by: David A. Long |
| 6 | * |
| 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: |
| 10 | * |
| 11 | * http://www.opensource.org/licenses/gpl-license.html |
| 12 | * http://www.gnu.org/copyleft/gpl.html |
| 13 | */ |
| 14 | |
| 15 | #ifndef _ARM_KERNEL_PROBES_ARM_H |
| 16 | #define _ARM_KERNEL_PROBES_ARM_H |
| 17 | |
Wang Nan | fca08f3 | 2015-01-09 10:19:49 +0800 | [diff] [blame] | 18 | #include "decode.h" |
| 19 | |
David A. Long | 3e6cd39 | 2014-03-06 18:06:43 -0500 | [diff] [blame] | 20 | enum probes_arm_action { |
David A. Long | 3e6cd39 | 2014-03-06 18:06:43 -0500 | [diff] [blame] | 21 | PROBES_PRELOAD_IMM, |
| 22 | PROBES_PRELOAD_REG, |
| 23 | PROBES_BRANCH_IMM, |
| 24 | PROBES_BRANCH_REG, |
| 25 | PROBES_MRS, |
| 26 | PROBES_CLZ, |
| 27 | PROBES_SATURATING_ARITHMETIC, |
| 28 | PROBES_MUL1, |
| 29 | PROBES_MUL2, |
| 30 | PROBES_SWP, |
| 31 | PROBES_LDRSTRD, |
| 32 | PROBES_LOAD, |
| 33 | PROBES_STORE, |
| 34 | PROBES_LOAD_EXTRA, |
| 35 | PROBES_STORE_EXTRA, |
| 36 | PROBES_MOV_IP_SP, |
| 37 | PROBES_DATA_PROCESSING_REG, |
| 38 | PROBES_DATA_PROCESSING_IMM, |
| 39 | PROBES_MOV_HALFWORD, |
| 40 | PROBES_SEV, |
| 41 | PROBES_WFE, |
| 42 | PROBES_SATURATE, |
| 43 | PROBES_REV, |
| 44 | PROBES_MMI, |
| 45 | PROBES_PACK, |
| 46 | PROBES_EXTEND, |
| 47 | PROBES_EXTEND_ADD, |
| 48 | PROBES_MUL_ADD_LONG, |
| 49 | PROBES_MUL_ADD, |
| 50 | PROBES_BITFIELD, |
| 51 | PROBES_BRANCH, |
| 52 | PROBES_LDMSTM, |
| 53 | NUM_PROBES_ARM_ACTIONS |
| 54 | }; |
| 55 | |
David A. Long | f145d66 | 2014-03-05 21:17:23 -0500 | [diff] [blame] | 56 | void __kprobes simulate_bbl(probes_opcode_t opcode, |
David A. Long | b4cd605 | 2014-03-05 21:41:29 -0500 | [diff] [blame] | 57 | struct arch_probes_insn *asi, struct pt_regs *regs); |
David A. Long | f145d66 | 2014-03-05 21:17:23 -0500 | [diff] [blame] | 58 | void __kprobes simulate_blx1(probes_opcode_t opcode, |
David A. Long | b4cd605 | 2014-03-05 21:41:29 -0500 | [diff] [blame] | 59 | struct arch_probes_insn *asi, struct pt_regs *regs); |
David A. Long | f145d66 | 2014-03-05 21:17:23 -0500 | [diff] [blame] | 60 | void __kprobes simulate_blx2bx(probes_opcode_t opcode, |
David A. Long | b4cd605 | 2014-03-05 21:41:29 -0500 | [diff] [blame] | 61 | struct arch_probes_insn *asi, struct pt_regs *regs); |
David A. Long | f145d66 | 2014-03-05 21:17:23 -0500 | [diff] [blame] | 62 | void __kprobes simulate_mrs(probes_opcode_t opcode, |
David A. Long | b4cd605 | 2014-03-05 21:41:29 -0500 | [diff] [blame] | 63 | struct arch_probes_insn *asi, struct pt_regs *regs); |
David A. Long | f145d66 | 2014-03-05 21:17:23 -0500 | [diff] [blame] | 64 | void __kprobes simulate_mov_ipsp(probes_opcode_t opcode, |
David A. Long | b4cd605 | 2014-03-05 21:41:29 -0500 | [diff] [blame] | 65 | struct arch_probes_insn *asi, struct pt_regs *regs); |
David A. Long | c18377c | 2014-03-07 11:16:10 -0500 | [diff] [blame] | 66 | |
David A. Long | 47e190f | 2014-03-06 18:12:07 -0500 | [diff] [blame] | 67 | extern const union decode_item probes_decode_arm_table[]; |
| 68 | |
| 69 | enum probes_insn arm_probes_decode_insn(probes_opcode_t, |
David A. Long | b4cd605 | 2014-03-05 21:41:29 -0500 | [diff] [blame] | 70 | struct arch_probes_insn *, bool emulate, |
Wang Nan | 83803d9 | 2015-01-05 19:29:18 +0800 | [diff] [blame^] | 71 | const union decode_action *actions, |
| 72 | const struct decode_checker *checkers[]); |
David A. Long | 47e190f | 2014-03-06 18:12:07 -0500 | [diff] [blame] | 73 | |
David A. Long | c18377c | 2014-03-07 11:16:10 -0500 | [diff] [blame] | 74 | #endif |