Rizin
unix-like reverse engineering framework and cli tools
|
#include <stdio.h>
#include <string.h>
#include <rz_util.h>
#include <rz_types.h>
#include <sdb.h>
#include "tms320_dasm.h"
#include "c55x_plus/c55plus.h"
#include "c55x/table.h"
Go to the source code of this file.
Macros | |
#define | get_bits(av, af, an) (((av) >> (af)) & ((2 << (an - 1)) - 1)) |
Variables | |
static ut8 | c55x_e_list [] |
#define get_bits | ( | av, | |
af, | |||
an | |||
) | (((av) >> (af)) & ((2 << (an - 1)) - 1)) |
Definition at line 18 of file tms320_dasm.c.
Definition at line 21 of file tms320_dasm.c.
Referenced by decode_addresses(), and decode_constants().
void decode_addresses | ( | tms320_dasm_t * | dasm | ) |
Definition at line 749 of file tms320_dasm.c.
References be16(), be24(), field_valid, field_value, substitute(), and tms320_dasm_t::syntax.
Referenced by decode_insn().
void decode_addressing_modes | ( | tms320_dasm_t * | dasm | ) |
Definition at line 955 of file tms320_dasm.c.
References field_valid, field_value, get_cmem_str(), get_mmm_str(), get_smem_str(), tms320_dasm_t::length, NULL, rz_read_be16(), rz_read_be24(), snprintf, cmd_descs_generate::str, tms320_dasm_t::stream, substitute(), tms320_dasm_t::syntax, and autogen_x86imm::tmp.
Referenced by decode_insn().
void decode_bits | ( | tms320_dasm_t * | dasm | ) |
Definition at line 620 of file tms320_dasm.c.
References field_valid, field_value, g, R, substitute(), and tms320_dasm_t::syntax.
Referenced by decode_insn().
void decode_braces | ( | tms320_dasm_t * | dasm | ) |
Definition at line 642 of file tms320_dasm.c.
References field_valid, field_value, pos, R, replace(), substitute(), and tms320_dasm_t::syntax.
Referenced by decode_insn().
void decode_cond | ( | tms320_dasm_t * | dasm | ) |
Definition at line 801 of file tms320_dasm.c.
References field_valid, field_value, get_cond_str(), substitute(), tms320_dasm_t::syntax, and autogen_x86imm::tmp.
Referenced by decode_insn().
void decode_constants | ( | tms320_dasm_t * | dasm | ) |
Definition at line 694 of file tms320_dasm.c.
References be16(), field_valid, field_value, substitute(), and tms320_dasm_t::syntax.
Referenced by decode_insn().
insn_item_t* decode_insn | ( | tms320_dasm_t * | dasm | ) |
Definition at line 1042 of file tms320_dasm.c.
References decode_addresses(), decode_addressing_modes(), decode_bits(), decode_braces(), decode_cond(), decode_constants(), decode_qualifiers(), decode_registers(), decode_relop(), decode_swap(), E, field_valid, field_value, finalize(), tms320_dasm_t::head, tms320_dasm_t::insn, tms320_dasm_t::length, tms320_instruction_head::size, snprintf, tms320_instruction::syntax, and tms320_dasm_t::syntax.
Referenced by decode_insn_head().
insn_item_t* decode_insn_head | ( | tms320_dasm_t * | dasm | ) |
Definition at line 1065 of file tms320_dasm.c.
References decode_insn(), tms320_instruction::i_list, i_list_last, tms320_dasm_t::insn, NULL, run_f_list(), and run_m_list().
Referenced by tms320_dasm().
void decode_qualifiers | ( | tms320_dasm_t * | dasm | ) |
Definition at line 1001 of file tms320_dasm.c.
References tms320_dasm_t::length, set_field_value, and tms320_dasm_t::stream.
Referenced by decode_insn().
void decode_registers | ( | tms320_dasm_t * | dasm | ) |
Definition at line 811 of file tms320_dasm.c.
References dd, field_valid, field_value, get_freg_str(), get_t_str(), get_v_str(), get_xreg_str(), NULL, r, substitute(), and tms320_dasm_t::syntax.
Referenced by decode_insn().
void decode_relop | ( | tms320_dasm_t * | dasm | ) |
Definition at line 795 of file tms320_dasm.c.
References field_valid, field_value, get_relop_str(), NULL, substitute(), and tms320_dasm_t::syntax.
Referenced by decode_insn().
void decode_swap | ( | tms320_dasm_t * | dasm | ) |
Definition at line 787 of file tms320_dasm.c.
References field_valid, field_value, get_swap_str(), substitute(), tms320_dasm_t::syntax, and autogen_x86imm::tmp.
Referenced by decode_insn().
|
static |
Definition at line 1025 of file tms320_dasm.c.
References field_value, tms320_dasm_t::insn, replace(), substitute(), and tms320_dasm_t::syntax.
Referenced by decode_insn().
|
static |
Definition at line 1137 of file tms320_dasm.c.
References field_value, and tms320_dasm_t::length.
Referenced by tms320_dasm().
Definition at line 493 of file tms320_dasm.c.
References key.
Referenced by decode_addressing_modes().
Definition at line 425 of file tms320_dasm.c.
References get_freg_str(), key, NULL, sprintf, and cmd_descs_generate::str.
Referenced by decode_cond().
Definition at line 370 of file tms320_dasm.c.
References key.
Referenced by decode_registers(), and get_cond_str().
Definition at line 590 of file tms320_dasm.c.
References key.
Referenced by decode_addressing_modes().
Definition at line 504 of file tms320_dasm.c.
References key, sprintf, and cmd_descs_generate::str.
Referenced by decode_addressing_modes().
|
static |
Definition at line 1124 of file tms320_dasm.c.
References tms320_dasm_t::f, tms320_dasm_t::head, tms320_dasm_t::insn, len, tms320_dasm_t::length, memcpy(), memset(), NULL, RZ_MIN, tms320_dasm_t::status, tms320_dasm_t::stream, and tms320_dasm_t::syntax.
Referenced by tms320_dasm().
insn_head_t* lookup_insn_head | ( | tms320_dasm_t * | dasm | ) |
Definition at line 1100 of file tms320_dasm.c.
References c55x_e_list, tms320_dasm_t::head, tms320_instruction_head::insn, tms320_dasm_t::insn, tms320_dasm_t::map, NULL, tms320_dasm_t::opcode, TMS320_F_CPU_C55X, and tms320_f_get_cpu.
Referenced by tms320_dasm().
Definition at line 325 of file tms320_dasm.c.
References args, and vreplace().
Referenced by __rotate_panel_cmds(), cmd_descs_generate::_escape(), decode_braces(), finalize(), meson_cmake_prefix_dir::main(), TestArm::main(), TestArm64::main(), TestM680x::main(), TestMips::main(), TestPpc::main(), TestSparc::main(), TestSystemz::main(), TestX86::main(), TestXcore::main(), migrateCommand(), and restoreCommand().
int run_f_list | ( | tms320_dasm_t * | dasm | ) |
Definition at line 43 of file tms320_dasm.c.
References dd, E, tms320_instruction_flag::f, tms320_instruction::f_list, f_list_last, field_valid, field_value, g, get_bits, tms320_dasm_t::insn, tms320_dasm_t::opcode64, printf(), R, r, set_field_value, TMS320_FLAG_AAAAAAAI, TMS320_FLAG_cc, TMS320_FLAG_CCCCCCC, TMS320_FLAG_D16, TMS320_FLAG_dd, TMS320_FLAG_DD, TMS320_FLAG_E, TMS320_FLAG_FDDD, TMS320_FLAG_FSSS, TMS320_FLAG_g, TMS320_FLAG_k12, TMS320_FLAG_k16, TMS320_FLAG_K16, TMS320_FLAG_k3, TMS320_FLAG_k4, TMS320_FLAG_k5, TMS320_FLAG_k6, TMS320_FLAG_k8, TMS320_FLAG_K8, TMS320_FLAG_l1, TMS320_FLAG_l16, TMS320_FLAG_L16, TMS320_FLAG_l3, TMS320_FLAG_l7, TMS320_FLAG_L7, TMS320_FLAG_L8, TMS320_FLAG_mm, TMS320_FLAG_MMM, TMS320_FLAG_P24, TMS320_FLAG_P8, TMS320_FLAG_R, TMS320_FLAG_r, TMS320_FLAG_SHFT, TMS320_FLAG_SHIFTW, TMS320_FLAG_ss, TMS320_FLAG_SS, TMS320_FLAG_t, TMS320_FLAG_tt, TMS320_FLAG_U, TMS320_FLAG_u, TMS320_FLAG_uu, TMS320_FLAG_vv, TMS320_FLAG_XACD, TMS320_FLAG_XACS, TMS320_FLAG_XDDD, TMS320_FLAG_XSSS, TMS320_FLAG_XXX, TMS320_FLAG_Y, TMS320_FLAG_YY, and tms320_instruction_flag::v.
Referenced by decode_insn_head().
int run_m_list | ( | tms320_dasm_t * | dasm | ) |
Definition at line 291 of file tms320_dasm.c.
References get_bits, tms320_dasm_t::insn, tms320_instruction::m_list, m_list_last, mask, and tms320_dasm_t::opcode64.
Referenced by decode_insn_head().
Definition at line 336 of file tms320_dasm.c.
References args, and vreplace().
Referenced by decode_addresses(), decode_addressing_modes(), decode_bits(), decode_braces(), decode_cond(), decode_constants(), decode_registers(), decode_relop(), decode_swap(), and finalize().
int tms320_dasm | ( | tms320_dasm_t * | dasm, |
const ut8 * | stream, | ||
int | len | ||
) |
Definition at line 1154 of file tms320_dasm.c.
References c55x_plus_disassemble(), decode_insn_head(), full_insn_size(), init_dasm(), len, tms320_dasm_t::length, lookup_insn_head(), tms320_dasm_t::status, tms320_dasm_t::syntax, TMS320_F_CPU_C55X_PLUS, tms320_f_get_cpu, and TMS320_S_INVAL.
Referenced by tms320_c55x_op(), and tms320_disassemble().
int tms320_dasm_fini | ( | tms320_dasm_t * | dasm | ) |
Definition at line 1202 of file tms320_dasm.c.
References tms320_dasm_t::map, and memset().
Referenced by tms320_fini().
int tms320_dasm_init | ( | tms320_dasm_t * | dasm | ) |
Definition at line 1181 of file tms320_dasm.c.
References tms320_instruction_head::byte, c55x_list, i, tms320_dasm_t::map, RZ_ARRAY_SIZE, TMS320_F_CPU_C55X, and tms320_f_set_cpu.
Referenced by tms320_init().
Definition at line 308 of file tms320_dasm.c.
References args, pos, and vsnprintf.
Referenced by replace(), and substitute().
|
static |
Definition at line 1085 of file tms320_dasm.c.
Referenced by lookup_insn_head().