/src/capstonenext/arch/ARM/ARMMapping.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* Capstone Disassembly Engine */ |
2 | | /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2019 */ |
3 | | |
4 | | #ifndef CS_ARM_MAPPING_H |
5 | | #define CS_ARM_MAPPING_H |
6 | | |
7 | | #include "../../include/capstone/capstone.h" |
8 | | #include "../../utils.h" |
9 | | #include "ARMBaseInfo.h" |
10 | | |
11 | | typedef enum { |
12 | | #include "ARMGenCSOpGroup.inc" |
13 | | } arm_op_group; |
14 | | |
15 | | extern const ARMBankedReg_BankedReg * |
16 | | ARMBankedReg_lookupBankedRegByEncoding(uint8_t Encoding); |
17 | | extern const ARMSysReg_MClassSysReg * |
18 | | ARMSysReg_lookupMClassSysRegByEncoding(uint16_t Encoding); |
19 | | |
20 | | // return name of register in friendly string |
21 | | const char *ARM_reg_name(csh handle, unsigned int reg); |
22 | | |
23 | | void ARM_printer(MCInst *MI, SStream *O, void * /* MCRegisterInfo* */ info); |
24 | | |
25 | | // given internal insn id, return public instruction ID |
26 | | void ARM_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id); |
27 | | |
28 | | const char *ARM_insn_name(csh handle, unsigned int id); |
29 | | |
30 | | const char *ARM_group_name(csh handle, unsigned int id); |
31 | | |
32 | | // check if this insn is relative branch |
33 | | bool ARM_rel_branch(cs_struct *h, unsigned int insn_id); |
34 | | |
35 | | bool ARM_blx_to_arm_mode(cs_struct *h, unsigned int insn_id); |
36 | | |
37 | | void ARM_reg_access(const cs_insn *insn, cs_regs regs_read, |
38 | | uint8_t *regs_read_count, cs_regs regs_write, |
39 | | uint8_t *regs_write_count); |
40 | | |
41 | | const ARMBankedReg_BankedReg * |
42 | | ARMBankedReg_lookupBankedRegByEncoding(uint8_t encoding); |
43 | | |
44 | | bool ARM_getInstruction(csh handle, const uint8_t *code, size_t code_len, |
45 | | MCInst *instr, uint16_t *size, uint64_t address, |
46 | | void *info); |
47 | | void ARM_set_instr_map_data(MCInst *MI); |
48 | | |
49 | | void ARM_init_mri(MCRegisterInfo *MRI); |
50 | | |
51 | | // cs_detail related functions |
52 | | void ARM_init_cs_detail(MCInst *MI); |
53 | | void ARM_add_cs_detail(MCInst *MI, int /* arm_op_group */ op_group, |
54 | | va_list args); |
55 | | static inline void add_cs_detail(MCInst *MI, int /* arm_op_group */ op_group, |
56 | | ...) |
57 | 2.84M | { |
58 | 2.84M | if (!MI->flat_insn->detail) |
59 | 0 | return; |
60 | 2.84M | va_list args; |
61 | 2.84M | va_start(args, op_group); |
62 | 2.84M | ARM_add_cs_detail(MI, op_group, args); |
63 | 2.84M | va_end(args); |
64 | 2.84M | } Unexecuted instantiation: ARMModule.c:add_cs_detail Unexecuted instantiation: ARMMapping.c:add_cs_detail Unexecuted instantiation: ARMDisassembler.c:add_cs_detail ARMInstPrinter.c:add_cs_detail Line | Count | Source | 57 | 2.84M | { | 58 | 2.84M | if (!MI->flat_insn->detail) | 59 | 0 | return; | 60 | 2.84M | va_list args; | 61 | 2.84M | va_start(args, op_group); | 62 | 2.84M | ARM_add_cs_detail(MI, op_group, args); | 63 | 2.84M | va_end(args); | 64 | 2.84M | } |
|
65 | | |
66 | | void ARM_insert_detail_op_reg_at(MCInst *MI, unsigned index, arm_reg Reg, |
67 | | cs_ac_type access); |
68 | | void ARM_insert_detail_op_imm_at(MCInst *MI, unsigned index, int64_t Val, |
69 | | cs_ac_type access); |
70 | | void ARM_set_detail_op_reg(MCInst *MI, unsigned OpNum, arm_reg Reg); |
71 | | void ARM_set_detail_op_sysop(MCInst *MI, int SysReg, arm_op_type type, |
72 | | bool IsOutReg, uint8_t Mask, uint16_t Sysm); |
73 | | void ARM_set_detail_op_imm(MCInst *MI, unsigned OpNum, arm_op_type ImmType, |
74 | | int64_t Imm); |
75 | | void ARM_set_detail_op_float(MCInst *MI, unsigned OpNum, uint64_t Imm); |
76 | | void ARM_set_detail_op_mem(MCInst *MI, unsigned OpNum, bool is_index_reg, |
77 | | int scale, uint64_t Val); |
78 | | void ARM_set_detail_op_mem_offset(MCInst *MI, unsigned OpNum, uint64_t Val, |
79 | | bool subtracted); |
80 | | void ARM_set_detail_op_neon_lane(MCInst *MI, unsigned OpNum); |
81 | | |
82 | | void ARM_check_updates_flags(MCInst *MI); |
83 | | |
84 | | void ARM_setup_op(cs_arm_op *op); |
85 | | void ARM_add_vector_data(MCInst *MI, arm_vectordata_type data_type); |
86 | | void ARM_add_vector_size(MCInst *MI, unsigned size); |
87 | | |
88 | | #endif // CS_ARM_MAPPING_H |