17
17
18
18
// map instruction to its characteristics
19
19
typedef struct insn_map {
20
- unsigned short id ; // The LLVM instruction id
21
- unsigned short mapid ; // The Capstone instruction id
20
+ unsigned short id ; // The LLVM instruction id
21
+ unsigned short mapid ; // The Capstone instruction id
22
22
#ifndef CAPSTONE_DIET
23
23
uint16_t regs_use [MAX_IMPL_R_REGS ]; ///< list of implicit registers used by
24
- ///< this instruction
24
+ ///< this instruction
25
25
uint16_t regs_mod [MAX_IMPL_W_REGS ]; ///< list of implicit registers modified
26
- ///< by this instruction
26
+ ///< by this instruction
27
27
unsigned char groups
28
28
[MAX_NUM_GROUPS ]; ///< list of group this instruction belong to
29
- bool branch ; // branch instruction?
30
- bool indirect_branch ; // indirect branch instruction?
29
+ bool branch ; // branch instruction?
30
+ bool indirect_branch ; // indirect branch instruction?
31
31
#endif
32
32
} insn_map ;
33
33
@@ -43,11 +43,11 @@ unsigned int find_cs_id(unsigned MC_Opcode, const insn_map *imap,
43
43
44
44
///< A LLVM<->CS Mapping entry of an MCOperand.
45
45
typedef struct {
46
- uint8_t /* cs_op_type */ type ; ///< Operand type (e.g.: reg, imm, mem)
46
+ uint8_t /* cs_op_type */ type ; ///< Operand type (e.g.: reg, imm, mem)
47
47
uint8_t /* cs_ac_type */ access ; ///< The access type (read, write)
48
- uint8_t /* cs_data_type */
48
+ uint8_t /* cs_data_type */
49
49
dtypes [MAX_NO_DATA_TYPES ]; ///< List of op types. Terminated by
50
- ///< CS_DATA_TYPE_LAST
50
+ ///< CS_DATA_TYPE_LAST
51
51
} mapping_op ;
52
52
53
53
#define MAX_NO_INSN_MAP_OPS 16
@@ -71,16 +71,16 @@ const cs_ac_type mapping_get_op_access(MCInst *MI, unsigned OpNum,
71
71
/// Macro for easier access of operand types from the map.
72
72
/// Assumes the istruction operands map is called "insn_operands"
73
73
/// Only usable by `auto-sync` archs!
74
- #define map_get_op_type (MI , OpNum ) \
74
+ #define map_get_op_type (MI , OpNum ) \
75
75
mapping_get_op_type(MI, OpNum, (const map_insn_ops *)insn_operands, \
76
76
sizeof(insn_operands) / sizeof(insn_operands[0]))
77
77
78
78
/// Macro for easier access of operand access flags from the map.
79
79
/// Assumes the istruction operands map is called "insn_operands"
80
80
/// Only usable by `auto-sync` archs!
81
- #define map_get_op_access (MI , OpNum ) \
81
+ #define map_get_op_access (MI , OpNum ) \
82
82
mapping_get_op_access(MI, OpNum, (const map_insn_ops *)insn_operands, \
83
- sizeof(insn_operands) / \
83
+ sizeof(insn_operands) / \
84
84
sizeof(insn_operands[0]))
85
85
86
86
///< Map for ids to their string
@@ -115,17 +115,17 @@ DECL_get_detail_op(ppc, PPC);
115
115
DECL_get_detail_op (tricore , TriCore );
116
116
117
117
/// Increments the detail->arch.op_count by one.
118
- #define DEFINE_inc_detail_op_count (arch , ARCH ) \
118
+ #define DEFINE_inc_detail_op_count (arch , ARCH ) \
119
119
static inline void ARCH##_inc_op_count(MCInst *MI) \
120
- { \
121
- MI->flat_insn->detail->arch.op_count++; \
120
+ { \
121
+ MI->flat_insn->detail->arch.op_count++; \
122
122
}
123
123
124
124
/// Decrements the detail->arch.op_count by one.
125
- #define DEFINE_dec_detail_op_count (arch , ARCH ) \
125
+ #define DEFINE_dec_detail_op_count (arch , ARCH ) \
126
126
static inline void ARCH##_dec_op_count(MCInst *MI) \
127
- { \
128
- MI->flat_insn->detail->arch.op_count--; \
127
+ { \
128
+ MI->flat_insn->detail->arch.op_count--; \
129
129
}
130
130
131
131
DEFINE_inc_detail_op_count (arm , ARM );
@@ -148,11 +148,11 @@ static inline void set_doing_mem(const MCInst *MI, bool status)
148
148
}
149
149
150
150
/// Returns detail->arch
151
- #define DEFINE_get_arch_detail (arch , ARCH ) \
152
- static inline cs_##arch *ARCH##_get_detail(const MCInst *MI) \
153
- { \
151
+ #define DEFINE_get_arch_detail (arch , ARCH ) \
152
+ static inline cs_##arch *ARCH##_get_detail(const MCInst *MI) \
153
+ { \
154
154
assert(MI && MI->flat_insn && MI->flat_insn->detail); \
155
- return &MI->flat_insn->detail->arch; \
155
+ return &MI->flat_insn->detail->arch; \
156
156
}
157
157
158
158
DEFINE_get_arch_detail (arm , ARM );
0 commit comments