/src/capstonenext/arch/Mips/MipsMapping.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* Capstone Disassembly Engine */ |
2 | | /* By Giovanni Dante Grazioli, deroad <wargio@libero.it>, 2024 */ |
3 | | |
4 | | #ifndef CS_MIPS_MAPPING_H |
5 | | #define CS_MIPS_MAPPING_H |
6 | | |
7 | | #include "../../include/capstone/capstone.h" |
8 | | #include "../../utils.h" |
9 | | #include "../../Mapping.h" |
10 | | |
11 | | typedef enum { |
12 | | #include "MipsGenCSOpGroup.inc" |
13 | | } mips_op_group; |
14 | | |
15 | | void Mips_init_mri(MCRegisterInfo *MRI); |
16 | | |
17 | | // return name of register in friendly string |
18 | | const char *Mips_reg_name(csh handle, unsigned int reg); |
19 | | |
20 | | void Mips_printer(MCInst *MI, SStream *O, |
21 | | void * /* MCRegisterInfo* */ info); |
22 | | |
23 | | // given internal insn id, return public instruction ID |
24 | | void Mips_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id); |
25 | | |
26 | | const char *Mips_insn_name(csh handle, unsigned int id); |
27 | | |
28 | | const char *Mips_group_name(csh handle, unsigned int id); |
29 | | |
30 | | bool Mips_getInstruction(csh handle, const uint8_t *code, size_t code_len, |
31 | | MCInst *instr, uint16_t *size, uint64_t address, |
32 | | void *info); |
33 | | |
34 | | void Mips_reg_access(const cs_insn *insn, cs_regs regs_read, |
35 | | uint8_t *regs_read_count, cs_regs regs_write, |
36 | | uint8_t *regs_write_count); |
37 | | |
38 | | // cs_detail related functions |
39 | | void Mips_init_cs_detail(MCInst *MI); |
40 | | |
41 | | void Mips_set_mem_access(MCInst *MI, bool status); |
42 | | |
43 | | void Mips_add_cs_detail(MCInst *MI, mips_op_group op_group, va_list args); |
44 | | |
45 | | static inline void add_cs_detail(MCInst *MI, mips_op_group op_group, ...) |
46 | 205k | { |
47 | 205k | if (!detail_is_set(MI)) |
48 | 0 | return; |
49 | 205k | va_list args; |
50 | 205k | va_start(args, op_group); |
51 | 205k | Mips_add_cs_detail(MI, op_group, args); |
52 | 205k | va_end(args); |
53 | 205k | } Unexecuted instantiation: MipsModule.c:add_cs_detail Unexecuted instantiation: MipsMapping.c:add_cs_detail MipsInstPrinter.c:add_cs_detail Line | Count | Source | 46 | 205k | { | 47 | 205k | if (!detail_is_set(MI)) | 48 | 0 | return; | 49 | 205k | va_list args; | 50 | 205k | va_start(args, op_group); | 51 | 205k | Mips_add_cs_detail(MI, op_group, args); | 52 | 205k | va_end(args); | 53 | 205k | } |
|
54 | | |
55 | | static inline void set_mem_access(MCInst *MI, bool status) |
56 | 51.9k | { |
57 | 51.9k | if (!detail_is_set(MI)) |
58 | 0 | return; |
59 | 51.9k | Mips_set_mem_access(MI, status); |
60 | 51.9k | } Unexecuted instantiation: MipsModule.c:set_mem_access Unexecuted instantiation: MipsMapping.c:set_mem_access MipsInstPrinter.c:set_mem_access Line | Count | Source | 56 | 51.9k | { | 57 | 51.9k | if (!detail_is_set(MI)) | 58 | 0 | return; | 59 | 51.9k | Mips_set_mem_access(MI, status); | 60 | 51.9k | } |
|
61 | | |
62 | | #endif // CS_MIPS_MAPPING_H |