• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Capstone Disassembly Engine */
2 /* By Dang Hoang Vu <danghvu@gmail.com> 2013 */
3 
4 #ifdef CAPSTONE_HAS_ARM64
5 
6 #include "../../utils.h"
7 #include "../../MCRegisterInfo.h"
8 #include "AArch64Disassembler.h"
9 #include "AArch64InstPrinter.h"
10 #include "AArch64Mapping.h"
11 #include "AArch64Module.h"
12 
AArch64_global_init(cs_struct * ud)13 cs_err AArch64_global_init(cs_struct *ud)
14 {
15 	MCRegisterInfo *mri;
16 	mri = cs_mem_malloc(sizeof(*mri));
17 
18 	AArch64_init(mri);
19 	ud->printer = AArch64_printInst;
20 	ud->printer_info = mri;
21 	ud->getinsn_info = mri;
22 	ud->disasm = AArch64_getInstruction;
23 	ud->reg_name = AArch64_reg_name;
24 	ud->insn_id = AArch64_get_insn_id;
25 	ud->insn_name = AArch64_insn_name;
26 	ud->group_name = AArch64_group_name;
27 	ud->post_printer = AArch64_post_printer;
28 #ifndef CAPSTONE_DIET
29 	ud->reg_access = AArch64_reg_access;
30 #endif
31 
32 	return CS_ERR_OK;
33 }
34 
AArch64_option(cs_struct * handle,cs_opt_type type,size_t value)35 cs_err AArch64_option(cs_struct *handle, cs_opt_type type, size_t value)
36 {
37 	if (type == CS_OPT_MODE) {
38 		handle->mode = (cs_mode)value;
39 	}
40 
41 	return CS_ERR_OK;
42 }
43 
44 #endif
45