Coverage Report

Created: 2024-08-21 06:24

/src/capstonev5/arch/SystemZ/SystemZModule.c
Line
Count
Source
1
/* Capstone Disassembly Engine */
2
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
3
4
#ifdef CAPSTONE_HAS_SYSZ
5
6
#include "../../utils.h"
7
#include "../../MCRegisterInfo.h"
8
#include "SystemZDisassembler.h"
9
#include "SystemZInstPrinter.h"
10
#include "SystemZMapping.h"
11
#include "SystemZModule.h"
12
13
cs_err SystemZ_global_init(cs_struct *ud)
14
3.92k
{
15
3.92k
  MCRegisterInfo *mri;
16
3.92k
  mri = cs_mem_malloc(sizeof(*mri));
17
18
3.92k
  SystemZ_init(mri);
19
3.92k
  ud->printer = SystemZ_printInst;
20
3.92k
  ud->printer_info = mri;
21
3.92k
  ud->getinsn_info = mri;
22
3.92k
  ud->disasm = SystemZ_getInstruction;
23
3.92k
  ud->post_printer = SystemZ_post_printer;
24
25
3.92k
  ud->reg_name = SystemZ_reg_name;
26
3.92k
  ud->insn_id = SystemZ_get_insn_id;
27
3.92k
  ud->insn_name = SystemZ_insn_name;
28
3.92k
  ud->group_name = SystemZ_group_name;
29
30
3.92k
  return CS_ERR_OK;
31
3.92k
}
32
33
cs_err SystemZ_option(cs_struct *handle, cs_opt_type type, size_t value)
34
808
{
35
808
  if (type == CS_OPT_SYNTAX)
36
808
    handle->syntax = (int) value;
37
38
  // Do not set mode because only CS_MODE_BIG_ENDIAN is valid; we cannot
39
  // test for CS_MODE_LITTLE_ENDIAN because it is 0
40
41
808
  return CS_ERR_OK;
42
808
}
43
44
#endif