Coverage Report

Created: 2024-09-08 06:22

/src/capstonenext/arch/PowerPC/PPCMapping.h
Line
Count
Source (jump to first uncovered line)
1
/* Capstone Disassembly Engine */
2
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
3
4
#ifndef CS_PPC_MAP_H
5
#define CS_PPC_MAP_H
6
7
#include "../../cs_priv.h"
8
#include "../../MCDisassembler.h"
9
#include "capstone/capstone.h"
10
11
typedef enum {
12
#include "PPCGenCSOpGroup.inc"
13
} ppc_op_group;
14
15
void PPC_init_mri(MCRegisterInfo *MRI);
16
17
void PPC_init_cs_detail(MCInst *MI);
18
19
// return name of register in friendly string
20
const char *PPC_reg_name(csh handle, unsigned int reg);
21
22
void PPC_printer(MCInst *MI, SStream *O, void * /* MCRegisterInfo* */ info);
23
bool PPC_getInstruction(csh handle, const uint8_t *code, size_t code_len,
24
      MCInst *instr, uint16_t *size, uint64_t address,
25
      void *info);
26
27
// given internal insn id, return public instruction info
28
void PPC_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id);
29
30
const char *PPC_insn_name(csh handle, unsigned int id);
31
const char *PPC_group_name(csh handle, unsigned int id);
32
33
typedef struct {
34
  unsigned int id; // instruction id
35
  const char *mnem;
36
} ppc_alias_id;
37
38
void PPC_set_mem_access(MCInst *MI, bool status);
39
static inline void set_mem_access(MCInst *MI, bool status)
40
44.0k
{
41
44.0k
  PPC_set_mem_access(MI, status);
42
44.0k
}
Unexecuted instantiation: PPCModule.c:set_mem_access
PPCMapping.c:set_mem_access
Line
Count
Source
40
4.19k
{
41
4.19k
  PPC_set_mem_access(MI, status);
42
4.19k
}
Unexecuted instantiation: PPCDisassembler.c:set_mem_access
PPCInstPrinter.c:set_mem_access
Line
Count
Source
40
39.8k
{
41
39.8k
  PPC_set_mem_access(MI, status);
42
39.8k
}
43
44
// map internal raw register to 'public' register
45
ppc_reg PPC_map_register(unsigned int r);
46
47
bool PPC_getFeatureBits(unsigned int mode, unsigned int feature);
48
49
void PPC_add_cs_detail(MCInst *MI, ppc_op_group op_group, va_list args);
50
51
static inline void add_cs_detail(MCInst *MI, ppc_op_group op_group, ...)
52
225k
{
53
225k
  if (!MI->flat_insn->detail)
54
0
    return;
55
225k
  va_list args;
56
225k
  va_start(args, op_group);
57
225k
  PPC_add_cs_detail(MI, op_group, args);
58
225k
  va_end(args);
59
225k
}
Unexecuted instantiation: PPCModule.c:add_cs_detail
Unexecuted instantiation: PPCMapping.c:add_cs_detail
Unexecuted instantiation: PPCDisassembler.c:add_cs_detail
PPCInstPrinter.c:add_cs_detail
Line
Count
Source
52
225k
{
53
225k
  if (!MI->flat_insn->detail)
54
0
    return;
55
225k
  va_list args;
56
225k
  va_start(args, op_group);
57
225k
  PPC_add_cs_detail(MI, op_group, args);
58
225k
  va_end(args);
59
225k
}
60
61
void PPC_set_detail_op_reg(MCInst *MI, unsigned OpNum, ppc_reg Reg);
62
void PPC_set_detail_op_imm(MCInst *MI, unsigned OpNum, int64_t Imm);
63
void PPC_set_detail_op_mem(MCInst *MI, unsigned OpNum, uint64_t Val,
64
         bool is_off_reg);
65
66
void PPC_insert_detail_op_imm_at(MCInst *MI, unsigned index, int64_t Val,
67
         cs_ac_type access);
68
69
void PPC_setup_op(cs_ppc_op *op);
70
71
void PPC_check_updates_cr0(MCInst *MI);
72
void PPC_set_instr_map_data(MCInst *MI, const uint8_t *Bytes, size_t BytesLen);
73
74
#endif