Rizin
unix-like reverse engineering framework and cli tools
|
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <stdbool.h>
#include "ansidecl.h"
#include "sysdep.h"
#include "opcode/tricore.h"
#include "disas-asm.h"
#include "libiberty.h"
Go to the source code of this file.
Classes | |
struct | insnlist |
struct | pcplist |
struct | sfrlist |
struct | decoded_insn |
Macros | |
#define | REGPREFIX "" |
#define | NUMOPCS tricore_numopcodes |
#define | NUMSFRS tricore_numsfrs |
#define | NUMPCPOPCS pcp_numopcodes |
#define | MAX_OPS 5 |
#define | MATCHES_ISA(isa) |
#define | NO_AREG 16 |
#define | DPRINT (*info->fprintf_func) |
#define | DFILE info->stream |
#define | DPRINT (*info->fprintf_func) |
#define | DFILE info->stream |
Typedefs | |
typedef struct tricore_opcode | opcode_t |
typedef struct pcp_opcode | pcp_opcode_t |
typedef const struct tricore_core_register | sfr_t |
Functions | |
static void decode_abs | PARAMS ((void)) |
static const char *find_core_reg | PARAMS ((unsigned long)) |
static void print_decoded_insn | PARAMS ((bfd_vma, struct disassemble_info *)) |
static int decode_tricore_insn | PARAMS ((bfd_vma, unsigned long, int, struct disassemble_info *)) |
static int decode_pcp_insn | PARAMS ((bfd_vma, bfd_byte[4], struct disassemble_info *)) |
static unsigned long | extract_off18 () |
static void | decode_abs () |
static void | decode_absb () |
static void | decode_b () |
static void | decode_bit () |
static void | decode_bo () |
static void | decode_bol () |
static void | decode_brc () |
static void | decode_brn () |
static void | decode_brr () |
static void | decode_rc () |
static void | decode_rcpw () |
static void | decode_rcr () |
static void | decode_rcrr () |
static void | decode_rcrw () |
static void | decode_rlc () |
static void | decode_rr () |
static void | decode_rr1 () |
static void | decode_rr2 () |
static void | decode_rrpw () |
static void | decode_rrr () |
static void | decode_rrr1 () |
static void | decode_rrr2 () |
static void | decode_rrrr () |
static void | decode_rrrw () |
static void | decode_sys () |
static void | decode_sb () |
static void | decode_sbc () |
static void | decode_sbr () |
static void | decode_sbrn () |
static void | decode_sc () |
static void | decode_slr () |
static void | decode_slro () |
static void | decode_sr () |
static void | decode_src () |
static void | decode_sro () |
static void | decode_srr () |
static void | decode_srrs () |
static void | decode_ssr () |
static void | decode_ssro () |
static void | init_hash_tables () |
static const char * | find_core_reg (unsigned long addr) |
static void | print_decoded_insn (bfd_vma memaddr, struct disassemble_info *info) |
static int | decode_tricore_insn (bfd_vma memaddr, unsigned long insn, int len32, struct disassemble_info *info) |
static int | decode_pcp_insn (bfd_vma memaddr, buffer, struct disassemble_info *info) |
int | print_insn_tricore (bfd_vma memaddr, struct disassemble_info *info) |
Variables | |
static struct insnlist * | insns [64] |
static struct insnlist * | insnlink |
static struct pcplist * | pcpinsns [32] |
static struct pcplist * | pcplink |
static struct sfrlist * | sfrs [256] |
static struct sfrlist * | sfrlink |
static int | initialized = 0 |
static tricore_isa | current_isa = TRICORE_RIDER_B |
static struct decoded_insn | dec_insn |
#define DPRINT (*info->fprintf_func) |
#define DPRINT (*info->fprintf_func) |
#define MATCHES_ISA | ( | isa | ) |
Definition at line 48 of file tricore-dis.c.
#define MAX_OPS 5 |
Definition at line 47 of file tricore-dis.c.
#define NO_AREG 16 |
#define NUMOPCS tricore_numopcodes |
Definition at line 44 of file tricore-dis.c.
#define NUMPCPOPCS pcp_numopcodes |
Definition at line 46 of file tricore-dis.c.
#define NUMSFRS tricore_numsfrs |
Definition at line 45 of file tricore-dis.c.
#define REGPREFIX "" |
Definition at line 41 of file tricore-dis.c.
typedef struct tricore_opcode opcode_t |
Definition at line 1 of file tricore-dis.c.
typedef struct pcp_opcode pcp_opcode_t |
Definition at line 1 of file tricore-dis.c.
typedef const struct tricore_core_register sfr_t |
Definition at line 1 of file tricore-dis.c.
|
static |
Definition at line 204 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, extract_off18(), FMT_ABS_OFF18, FMT_ABS_S1_D, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 222 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, extract_off18(), FMT_ABSB_B, FMT_ABSB_BPOS3, FMT_ABSB_OFF18, i, and decoded_insn::opcode.
|
static |
Definition at line 244 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_B_DISP24, i, o1, o2, and decoded_insn::opcode.
|
static |
Definition at line 261 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_BIT_D, FMT_BIT_P1, FMT_BIT_P2, FMT_BIT_S1, FMT_BIT_S2, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 291 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_BO_OFF10, FMT_BO_S1_D, FMT_BO_S2, i, o1, o2, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 316 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_BOL_OFF16, FMT_BOL_S1_D, FMT_BOL_S2, i, o1, o2, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 342 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_BRC_CONST4, FMT_BRC_DISP15, FMT_BRC_S1, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 364 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_BRN_DISP15, FMT_BRN_N, FMT_BRN_S1, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 387 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_BRR_DISP15, FMT_BRR_S1, FMT_BRR_S2, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 1596 of file tricore-dis.c.
References pcp_opcode::args, bfd_getl16(), pcplist::code, DFILE, DPRINT, fail, pcp_opcode::fmt_group, setup::idx, info(), pcp_opcode::len32, pcp_opcode::lose, pcp_opcode::name, pcplist::next, pcp_opcode::nr_operands, NULL, pcp_opcode::opcode, pcpinsns, and val.
Referenced by print_insn_tricore().
|
static |
Definition at line 409 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RC_CONST9, FMT_RC_D, FMT_RC_S1, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 430 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RCPW_CONST4, FMT_RCPW_D, FMT_RCPW_P, FMT_RCPW_S1, FMT_RCPW_W, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 460 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RCR_CONST9, FMT_RCR_D, FMT_RCR_S1, FMT_RCR_S3, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 486 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RCRR_CONST4, FMT_RCRR_D, FMT_RCRR_S1, FMT_RCRR_S3, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 512 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RCRW_CONST4, FMT_RCRW_D, FMT_RCRW_S1, FMT_RCRW_S3, FMT_RCRW_W, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 542 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RLC_CONST16, FMT_RLC_D, FMT_RLC_S1, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 564 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RR_D, FMT_RR_N, FMT_RR_S1, FMT_RR_S2, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 590 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RR1_D, FMT_RR1_N, FMT_RR1_S1, FMT_RR1_S2, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 616 of file tricore-dis.c.
References decoded_insn::code, dec_insn, FMT_RR2_D, FMT_RR2_S1, FMT_RR2_S2, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 638 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RRPW_D, FMT_RRPW_P, FMT_RRPW_S1, FMT_RRPW_S2, FMT_RRPW_W, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 668 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RRR_D, FMT_RRR_N, FMT_RRR_S1, FMT_RRR_S2, FMT_RRR_S3, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 698 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RRR1_D, FMT_RRR1_N, FMT_RRR1_S1, FMT_RRR1_S2, FMT_RRR1_S3, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 728 of file tricore-dis.c.
References decoded_insn::code, dec_insn, FMT_RRR2_D, FMT_RRR2_S1, FMT_RRR2_S2, FMT_RRR2_S3, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 754 of file tricore-dis.c.
References decoded_insn::code, dec_insn, FMT_RRRR_D, FMT_RRRR_S1, FMT_RRRR_S2, FMT_RRRR_S3, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 780 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_RRRW_D, FMT_RRRW_S1, FMT_RRRW_S2, FMT_RRRW_S3, FMT_RRRW_W, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 824 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_SB_DISP8, i, and decoded_insn::opcode.
|
static |
Definition at line 838 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_SBC_CONST4, FMT_SBC_DISP4, i, and decoded_insn::opcode.
|
static |
Definition at line 859 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_SBR_DISP4, FMT_SBR_S2, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 880 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_SBRN_DISP4, FMT_SBRN_N, i, and decoded_insn::opcode.
|
static |
Definition at line 903 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_SC_CONST8, i, and decoded_insn::opcode.
|
static |
Definition at line 917 of file tricore-dis.c.
References decoded_insn::code, dec_insn, FMT_SLR_D, FMT_SLR_S2, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 935 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_SLRO_D, FMT_SLRO_OFF4, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 953 of file tricore-dis.c.
References decoded_insn::code, dec_insn, FMT_SR_S1_D, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 967 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_SRC_CONST4, FMT_SRC_S1_D, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 985 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_SRO_OFF4, FMT_SRO_S2, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 1003 of file tricore-dis.c.
References decoded_insn::code, dec_insn, FMT_SRR_S1_D, FMT_SRR_S2, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 1021 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_SRRS_N, FMT_SRRS_S1_D, FMT_SRRS_S2, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 1043 of file tricore-dis.c.
References decoded_insn::code, dec_insn, FMT_SSR_S1, FMT_SSR_S2, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 1061 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, dec_insn, FMT_SSRO_OFF4, FMT_SSRO_S1, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 810 of file tricore-dis.c.
References decoded_insn::code, dec_insn, FMT_SYS_S1_D, i, decoded_insn::opcode, and decoded_insn::regs.
|
static |
Definition at line 1547 of file tricore-dis.c.
References insnlist::code, decoded_insn::code, dec_insn, setup::idx, info(), insns, mask, insnlist::next, NULL, decoded_insn::opcode, print_decoded_insn(), and tricore_opmask.
Referenced by print_insn_tricore().
Definition at line 191 of file tricore-dis.c.
References dec_insn, o1, o2, o4, decoded_insn::opcode, and val.
Referenced by decode_abs(), and decode_absb().
Definition at line 1140 of file tricore-dis.c.
References tricore_core_register::addr, addr, setup::idx, tricore_core_register::isa, MATCHES_ISA, tricore_core_register::name, sfrlist::next, NULL, sfrlist::sfr, and sfrs.
Referenced by print_decoded_insn().
|
static |
Definition at line 1081 of file tricore-dis.c.
References tricore_core_register::addr, insnlist::code, pcplist::code, i, setup::idx, insnlink, insns, tricore_core_register::isa, MATCHES_ISA, memset(), insnlist::next, pcplist::next, sfrlist::next, NUMOPCS, NUMPCPOPCS, NUMSFRS, pcp_opcode::opcode, pcp_opcodes, pcpinsns, pcplink, sfrlist::sfr, sfrlink, sfrs, tricore_opcodes, tricore_sfrs, and xmalloc.
Referenced by print_insn_tricore().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 1158 of file tricore-dis.c.
References decoded_insn::cexp, decoded_insn::code, creg, dec_insn, DFILE, DPRINT, find_core_reg(), i, info(), opcode_t::name, NO_AREG, REGPREFIX, and decoded_insn::regs.
Referenced by decode_tricore_insn().
int print_insn_tricore | ( | bfd_vma | memaddr, |
struct disassemble_info * | info | ||
) |
Definition at line 1884 of file tricore-dis.c.
References bfd_getl16(), bfd_getl32(), bfd_mach_rider_2, bfd_mach_rider_a, bfd_mach_rider_b, bfd_mach_rider_mask, current_isa, decode_pcp_insn(), decode_tricore_insn(), info(), init_hash_tables(), initialized, memset(), SEC_ARCH_BIT_0, tricore_init_arch_vars(), TRICORE_RIDER_A, TRICORE_RIDER_B, and TRICORE_V2.
Referenced by disassemble().
|
static |
Definition at line 100 of file tricore-dis.c.
Referenced by print_insn_tricore().
|
static |
Definition at line 100 of file tricore-dis.c.
Referenced by decode_abs(), decode_absb(), decode_b(), decode_bit(), decode_bo(), decode_bol(), decode_brc(), decode_brn(), decode_brr(), decode_rc(), decode_rcpw(), decode_rcr(), decode_rcrr(), decode_rcrw(), decode_rlc(), decode_rr(), decode_rr1(), decode_rr2(), decode_rrpw(), decode_rrr(), decode_rrr1(), decode_rrr2(), decode_rrrr(), decode_rrrw(), decode_sb(), decode_sbc(), decode_sbr(), decode_sbrn(), decode_sc(), decode_slr(), decode_slro(), decode_sr(), decode_src(), decode_sro(), decode_srr(), decode_srrs(), decode_ssr(), decode_ssro(), decode_sys(), decode_tricore_insn(), extract_off18(), and print_decoded_insn().
|
static |
Definition at line 96 of file tricore-dis.c.
Referenced by aarch64_logical_immediate_p(), ARC_CGEN_EXTRACT_FN(), initialize_sym_api(), and print_insn_tricore().
|
static |
Definition at line 70 of file tricore-dis.c.
Referenced by init_hash_tables().
|
static |
Definition at line 69 of file tricore-dis.c.
Referenced by decode_tricore_insn(), init_hash_tables(), insn_find(), and make_id2insn().
|
static |
Definition at line 80 of file tricore-dis.c.
Referenced by decode_pcp_insn(), and init_hash_tables().
|
static |
Definition at line 81 of file tricore-dis.c.
Referenced by init_hash_tables().
|
static |
Definition at line 92 of file tricore-dis.c.
Referenced by init_hash_tables().
|
static |
Definition at line 91 of file tricore-dis.c.
Referenced by find_core_reg(), and init_hash_tables().