Debian Codegraph @

arch/X86/X86Mapping.h

raw symbols SCIP
1 /* Capstone Disassembly Engine */cxx . . $ `<file>/arch/X86/X86Mapping.h`/
2 /* By Nguyen Anh Quynh <[email protected]>, 2013-2019 */
3
4 #ifndef CS_X86_MAP_H
5 #define CS_X86_MAP_Hcxx . . $ `arch/X86/X86Mapping.h:5:9`!
6
7 #include "capstone/capstone.h"cxx . . $ `<file>/include/capstone/capstone.h`/
8 #include "../../cs_priv.h"cxx . . $ `<file>/cs_priv.h`/
9
10 // map instruction to its characteristics
11 typedef struct insn_map_x86cxx . . $ insn_map_x86# {
12 unsigned short idcxx . . $ insn_map_x86#id.;
13 unsigned short mapidcxx . . $ insn_map_x86#mapid.;
14 unsigned char is64bitcxx . . $ insn_map_x86#is64bit.;
15 #ifndef CAPSTONE_DIET
16 uint16_tcxx . . $ uint16_t# regs_usecxx . . $ insn_map_x86#regs_use.[12]; // list of implicit registers used by this instruction
17 uint16_tcxx . . $ uint16_t# regs_modcxx . . $ insn_map_x86#regs_mod.[20]; // list of implicit registers modified by this instruction
18 unsigned char groupscxx . . $ insn_map_x86#groups.[8]; // list of group this instruction belong to
19 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! branchcxx . . $ insn_map_x86#branch.; // branch instruction?
20 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! indirect_branchcxx . . $ insn_map_x86#indirect_branch.; // indirect branch instruction?
21 #endif
22 } insn_map_x86cxx . . $ insn_map_x86#;
23
24 extern const insn_map_x86cxx . . $ insn_map_x86# insnscxx . . $ insns.[];
25
26 // map sib_base to x86_reg
27 x86_regcxx . . $ x86_reg# x86_map_sib_basecxx . . $ x86_map_sib_base(37ad6efd5b145422).(int r);
28
29 // map sib_index to x86_reg
30 x86_regcxx . . $ x86_reg# x86_map_sib_indexcxx . . $ x86_map_sib_index(37ad6efd5b145422).(int r);
31
32 // map seg_override to x86_reg
33 x86_regcxx . . $ x86_reg# x86_map_segmentcxx . . $ x86_map_segment(37ad6efd5b145422).(int r);
34
35 // return name of regiser in friendly string
36 const char *X86_reg_namecxx . . $ X86_reg_name(efd1348d9ae5172e).(cshcxx . . $ csh# handle, unsigned int reg);
37
38 // given internal insn id, return public instruction info
39 void X86_get_insn_idcxx . . $ X86_get_insn_id(b32a94ba649bfb5a).(cs_structcxx . . $ cs_struct# *h, cs_insncxx . . $ cs_insn# *insn, unsigned int id);
40
41 // return insn name, given insn id
42 const char *X86_insn_namecxx . . $ X86_insn_name(efd1348d9ae5172e).(cshcxx . . $ csh# handle, unsigned int id);
43
44 // return group name, given group id
45 const char *X86_group_namecxx . . $ X86_group_name(efd1348d9ae5172e).(cshcxx . . $ csh# handle, unsigned int id);
46
47 // return register of given instruction id
48 // return 0 if not found
49 // this is to handle instructions embedding accumulate registers into AsmStrs[]
50 x86_regcxx . . $ x86_reg# X86_insn_reg_intelcxx . . $ X86_insn_reg_intel(efe9bfc932ab5f49).(unsigned int id, enum cs_ac_typecxx . . $ cs_ac_type# *access);
51 x86_regcxx . . $ x86_reg# X86_insn_reg_intel_hcxx . . $ X86_insn_reg_intel_h(b0b1cdf4b49b8d60).(cs_structcxx . . $ cs_struct# *h, unsigned int id, enum cs_ac_typecxx . . $ cs_ac_type# *access);
52 x86_regcxx . . $ x86_reg# X86_insn_reg_attcxx . . $ X86_insn_reg_att(efe9bfc932ab5f49).(unsigned int id, enum cs_ac_typecxx . . $ cs_ac_type# *access);
53 x86_regcxx . . $ x86_reg# X86_insn_reg_att_hcxx . . $ X86_insn_reg_att_h(b0b1cdf4b49b8d60).(cs_structcxx . . $ cs_struct# *h, unsigned int id, enum cs_ac_typecxx . . $ cs_ac_type# *access);
54 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! X86_insn_reg_intel2cxx . . $ X86_insn_reg_intel2(4bad68c8aa453789).(unsigned int id, x86_regcxx . . $ x86_reg# *reg1, enum cs_ac_typecxx . . $ cs_ac_type# *access1, x86_regcxx . . $ x86_reg# *reg2, enum cs_ac_typecxx . . $ cs_ac_type# *access2);
55 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! X86_insn_reg_att2cxx . . $ X86_insn_reg_att2(4bad68c8aa453789).(unsigned int id, x86_regcxx . . $ x86_reg# *reg1, enum cs_ac_typecxx . . $ cs_ac_type# *access1, x86_regcxx . . $ x86_reg# *reg2, enum cs_ac_typecxx . . $ cs_ac_type# *access2);
56
57 extern const uint64_tcxx . . $ uint64_t# arch_maskscxx . . $ arch_masks.[9];
58
59 // handle LOCK/REP/REPNE prefixes
60 // return True if we patch mnemonic, like in MULPD case
61 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! X86_lockrepcxx . . $ X86_lockrep(9dc196ebf468fb30).(MCInstcxx . . $ MCInst# *MI, SStreamcxx . . $ SStream# *O);
62
63 // map registers to sizes
64 extern const uint8_tcxx . . $ uint8_t# regsize_map_32cxx . . $ regsize_map_32.[];
65 extern const uint8_tcxx . . $ uint8_t# regsize_map_64cxx . . $ regsize_map_64.[];
66
67 void op_addRegcxx . . $ op_addReg(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int reg);
68 void op_addImmcxx . . $ op_addImm(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int v);
69
70 void op_addAvxBroadcastcxx . . $ op_addAvxBroadcast(3ffada843a4d19dc).(MCInstcxx . . $ MCInst# *MI, x86_avx_bcastcxx . . $ x86_avx_bcast# v);
71
72 void op_addXopCCcxx . . $ op_addXopCC(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int v);
73 void op_addSseCCcxx . . $ op_addSseCC(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int v);
74 void op_addAvxCCcxx . . $ op_addAvxCC(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int v);
75
76 void op_addAvxZeroOpmaskcxx . . $ op_addAvxZeroOpmask(94c8a3269074abe9).(MCInstcxx . . $ MCInst# *MI);
77
78 void op_addAvxSaecxx . . $ op_addAvxSae(94c8a3269074abe9).(MCInstcxx . . $ MCInst# *MI);
79
80 void op_addAvxRoundingModecxx . . $ op_addAvxRoundingMode(cff03ea8bb8460e7).(MCInstcxx . . $ MCInst# *MI, int v);
81
82 // given internal insn id, return operand access info
83 const uint8_tcxx . . $ uint8_t# *X86_get_op_accesscxx . . $ X86_get_op_access(5cb490f2be29a92d).(cs_structcxx . . $ cs_struct# *h, unsigned int id, uint64_tcxx . . $ uint64_t# *eflags);
84
85 void X86_reg_accesscxx . . $ X86_reg_access(a4e53139cd2f126c).(const cs_insncxx . . $ cs_insn# *insn,
86 cs_regscxx . . $ cs_regs# regs_read, uint8_tcxx . . $ uint8_t# *regs_read_count,
87 cs_regscxx . . $ cs_regs# regs_write, uint8_tcxx . . $ uint8_t# *regs_write_count);
88
89 // given the instruction id, return the size of its immediate operand (or 0)
90 uint8_tcxx . . $ uint8_t# X86_immediate_sizecxx . . $ X86_immediate_size(395827a3978c0abb).(unsigned int id, uint8_tcxx . . $ uint8_t# *enc_size);
91
92 unsigned short X86_register_mapcxx . . $ X86_register_map(a18c05e4017afb3d).(unsigned short id);
93
94 unsigned int find_insncxx . . $ find_insn(2141b656ce2cc063).(unsigned int id);
95
96 // Build per-handle O(1) lookup tables for x86. Called from X86_global_init().
97 void X86_build_lookup_tablescxx . . $ X86_build_lookup_tables(b55400182e2a5869).(cs_structcxx . . $ cs_struct# *h);
98
99 void X86_postprintercxx . . $ X86_postprinter(1e4eab0813f35322).(cshcxx . . $ csh# handle, cs_insncxx . . $ cs_insn# *insn, char *mnem, MCInstcxx . . $ MCInst# *mci);
100
101 #endif