/src/capstonenext/arch/LoongArch/LoongArchMapping.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* Capstone Disassembly Engine */ |
2 | | /* By Jiajie Chen <c@jia.je>, 2024 */ |
3 | | /* Yanglin Xun <1109673069@qq.com>, 2024 */ |
4 | | |
5 | | #ifndef CS_LOONGARCH_MAPPING_H |
6 | | #define CS_LOONGARCH_MAPPING_H |
7 | | |
8 | | #include "../../include/capstone/capstone.h" |
9 | | #include "../../utils.h" |
10 | | #include "../../Mapping.h" |
11 | | |
12 | | typedef enum { |
13 | | #include "LoongArchGenCSOpGroup.inc" |
14 | | } loongarch_op_group; |
15 | | |
16 | | void LoongArch_init_mri(MCRegisterInfo *MRI); |
17 | | |
18 | | // return name of register in friendly string |
19 | | const char *LoongArch_reg_name(csh handle, unsigned int reg); |
20 | | |
21 | | void LoongArch_printer(MCInst *MI, SStream *O, |
22 | | void * /* MCRegisterInfo* */ info); |
23 | | |
24 | | // given internal insn id, return public instruction ID |
25 | | void LoongArch_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id); |
26 | | |
27 | | const char *LoongArch_insn_name(csh handle, unsigned int id); |
28 | | |
29 | | const char *LoongArch_group_name(csh handle, unsigned int id); |
30 | | |
31 | | void LoongArch_reg_access(const cs_insn *insn, cs_regs regs_read, |
32 | | uint8_t *regs_read_count, cs_regs regs_write, |
33 | | uint8_t *regs_write_count); |
34 | | |
35 | | bool LoongArch_getInstruction(csh handle, const uint8_t *code, size_t code_len, |
36 | | MCInst *instr, uint16_t *size, uint64_t address, |
37 | | void *info); |
38 | | |
39 | | // cs_detail related functions |
40 | | void LoongArch_init_cs_detail(MCInst *MI); |
41 | | void LoongArch_add_cs_detail(MCInst *MI, int /* loongarch_op_group */ op_group, |
42 | | va_list args); |
43 | | static inline void add_cs_detail(MCInst *MI, |
44 | | int /* loongarch_op_group */ op_group, ...) |
45 | 0 | { |
46 | 0 | if (!MI->flat_insn->detail) |
47 | 0 | return; |
48 | 0 | va_list args; |
49 | 0 | va_start(args, op_group); |
50 | 0 | LoongArch_add_cs_detail(MI, op_group, args); |
51 | 0 | va_end(args); |
52 | 0 | } Unexecuted instantiation: LoongArchModule.c:add_cs_detail Unexecuted instantiation: LoongArchMapping.c:add_cs_detail Unexecuted instantiation: LoongArchInstPrinter.c:add_cs_detail |
53 | | |
54 | | #endif // CS_LOONGARCH_MAPPING_H |