mirror of
https://github.com/capstone-engine/capstone.git
synced 2026-10-12 02:11:43 +00:00
* Add ARC files * Added ARC files for successful compilation * Refactor ARC files * Add ARC c/cs tests * Add ARC python test/bindings * Add ARC to CI/CD * Avoid omitting parameter names * Update cs files * Fix ARC bugs * Update ARC python bindings * Refactor and update ARC test files * Add detail flag to arc test * Fix ARC test problems * Fix ARCMapping compile error * Replace __CHAR_BIT__ to CHAR_BIT * Add credits and ARC info * Update ARC to match the latest next * Python formatting * Remove asserts on 'Unknown condition code passed' * Add ARC to some more documentation * Add ARC to Targets constants * Add ARC support to llvm-tblgen * Replace asserts & add Expr handling * Check DecodeGPR32RegisterClass return value * Fix fieldFromInstruction patch * Refactor ARC * Reformat python files * Fix incorrect import * Update inc files and insn names * Update python files * Disable AArch64 Linux wheel build due to https://github.com/capstone-engine/capstone/issues/2615. --------- Co-authored-by: R33v0LT <[email protected]>
52 lines
967 B
C
52 lines
967 B
C
/* Capstone Disassembly Engine */
|
|
/* By Dmitry Sibirtsev <[email protected]>, 2024 */
|
|
|
|
#ifdef CAPSTONE_HAS_ARC
|
|
|
|
#include <capstone/capstone.h>
|
|
|
|
#include "ARCModule.h"
|
|
#include "../../MCRegisterInfo.h"
|
|
#include "../../cs_priv.h"
|
|
#include "ARCMapping.h"
|
|
|
|
cs_err ARC_global_init(cs_struct *ud)
|
|
{
|
|
MCRegisterInfo *mri;
|
|
mri = cs_mem_malloc(sizeof(*mri));
|
|
|
|
ARC_init_mri(mri);
|
|
|
|
ud->printer = ARC_printer;
|
|
ud->printer_info = mri;
|
|
ud->reg_name = ARC_reg_name;
|
|
ud->insn_id = ARC_get_insn_id;
|
|
ud->insn_name = ARC_insn_name;
|
|
ud->group_name = ARC_group_name;
|
|
ud->post_printer = NULL;
|
|
#ifndef CAPSTONE_DIET
|
|
ud->reg_access = ARC_reg_access;
|
|
#endif
|
|
|
|
ud->disasm = ARC_getInstruction;
|
|
|
|
return CS_ERR_OK;
|
|
}
|
|
|
|
cs_err ARC_option(cs_struct *handle, cs_opt_type type, size_t value)
|
|
{
|
|
switch (type) {
|
|
case CS_OPT_MODE:
|
|
handle->mode = (cs_mode)value;
|
|
break;
|
|
case CS_OPT_SYNTAX:
|
|
handle->syntax |= (int)value;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
return CS_ERR_OK;
|
|
}
|
|
|
|
#endif |