Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 20
CXX_VISIBILITY_PRESET hidden
CXX_STANDARD_REQUIRED ON
C_STANDARD 99
C_STANDARD 11
C_STANDARD_REQUIRED ON
C_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/disassembler/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ int aarch64_decompose(uint32_t instructionValue, Instruction* instr, uint64_t ad
ctx.halted = 1; // enable disassembly of exception instructions like DCPS1
ctx.insword = instructionValue;
ctx.address = address;
ctx.features0 = ARCH_FEATURES_ALL;
ctx.features1 = ARCH_FEATURES_ALL;
ARCH_FEATURES_ENABLE_ALL(ctx.decode_features);
ARCH_FEATURES_ENABLE_ALL(ctx.pcode_features);
ctx.EDSCR_HDE = 1;

/* have the spec-generated code populate all the pcode variables */
Expand Down
69 changes: 66 additions & 3 deletions arch/arm64/disassembler/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ typedef struct context_
{
uint32_t insword;
uint64_t address;
uint64_t features0; // bitmask of ARCH_FEATURE_XXX
uint64_t features1; // bitmask of ARCH_FEATURE_XXX
uint64_t decode_features[2]; // bitmask of ARCH_FEATURE_XXX
uint64_t pcode_features[2]; // bitmask of ARCH_FEATURE_XXX
// uint32_t exception_level; // used by AArch64.CheckSystemAccess()
// uint32_t security_state;
uint8_t pstate_btype; // used by BTypeCompatible_BTI()
Expand Down Expand Up @@ -193,19 +193,28 @@ typedef struct context_
uint64_t acc;
uint64_t acctype;
uint64_t accumulate;
bool acqrel;
bool acquire;
bool acquirepc;
uint64_t alias;
uint64_t amount;
uint64_t and_test;
uint64_t asimdimm;
bool auth_combined;
bool auth_then_branch;
bool autia1716;
bool autib1716;
uint64_t b;
uint64_t b40;
uint64_t b5;
uint64_t bit_pos;
uint64_t bit_val;
uint64_t branch_type;
uint64_t c;
uint64_t cc;
uint64_t cmode;
uint64_t cmp, cmph, cmpl, cmp_eq, cmp_with_zero;
uint64_t cmp_op;
uint64_t comment;
uint64_t comparison;
uint64_t cond; /* careful! this is the pcode scratchpad .cond, NOT the .cond field of a struct
Expand All @@ -216,16 +225,20 @@ typedef struct context_
uint64_t countop;
uint64_t crc32c;
uint64_t csize;
uint64_t d0;
uint64_t d1;
uint64_t d, da, data, datasize, double_table;
uint64_t dtype, dtypeh, dtypel;
uint64_t d_esize;
uint64_t decode_fltsize;
uint64_t decrypt;
uint64_t destsize;
uint64_t dm;
uint64_t dn;
uint64_t domain;
uint64_t dst_index;
uint64_t dst_unsigned;
uint64_t dstride;
uint64_t dstsize;
uint64_t e;
uint64_t elements;
Expand All @@ -240,6 +253,7 @@ typedef struct context_
uint64_t extend_type;
uint64_t f, ff;
uint64_t field;
uint64_t flagmask;
uint64_t flags;
uint64_t fltsize;
uint64_t fpop;
Expand All @@ -252,6 +266,13 @@ typedef struct context_
uint64_t hw;
uint64_t i, i1, i2, i2h, i2l, i3h, i3l;
uint64_t idxdsize;
uint64_t i3;
uint64_t i4;
uint64_t i4A;
uint64_t i4B;
uint64_t i4C;
uint64_t i4h;
uint64_t i4l;
uint64_t imm;
uint64_t imm1;
uint64_t imm12;
Expand Down Expand Up @@ -288,7 +309,11 @@ typedef struct context_
uint64_t inzero;
uint64_t isBefore;
uint64_t is_tbl;
bool ispair;
bool issrc2;
uint64_t isize;
uint64_t iszero;
uint64_t K;
uint64_t ldacctype;
uint64_t len;
uint64_t level;
Expand All @@ -298,10 +323,19 @@ typedef struct context_
uint64_t mask;
uint64_t mbytes;
uint64_t memop;
uint64_t memcpy_d;
uint64_t memcpy_n;
uint64_t memcpy_s;
uint64_t memcpy_stage;
uint64_t memset_stage;
uint64_t memset_d;
uint64_t memset_n;
uint64_t memset_s;
uint64_t merging;
uint64_t min;
uint64_t min_EL;
uint64_t minimum;
uint64_t mreg;
uint64_t msb;
uint64_t msize;
uint64_t msz;
Expand All @@ -313,13 +347,21 @@ typedef struct context_
uint64_t neg_i;
uint64_t neg_r;
uint64_t negated;
uint64_t ngrp;
uint64_t nvec;
bool nontemporal;
uint64_t nreg;
uint64_t ntblr;
uint64_t num;
uint64_t nzcv;
uint64_t nXS;
uint64_t o0, o1, o2, o3;
uint64_t offs_size;
uint64_t offs_unsigned;
uint64_t offset;
uint64_t off2;
uint64_t off3;
uint64_t off4;
uint64_t op1_neg;
uint64_t op1_unsigned;
uint64_t op, op0, op1, op2, op3, op4, op21, op31, op54;
Expand All @@ -328,32 +370,43 @@ typedef struct context_
uint64_t opa_neg;
uint64_t opc;
uint64_t opc2;
uint64_t opc3;
uint64_t opcode, opcode2;
uint64_t operand;
uint64_t operation_;
uint64_t opt, option;
uint64_t options;
uint64_t osize;
uint64_t pac;
bool pacia1716;
bool pacib1716;
uint64_t page;
uint64_t pair;
uint64_t pairs;
uint64_t part;
uint64_t part1;
uint64_t pat;
uint64_t pattern;
uint64_t PNd;
uint64_t PNg;
uint64_t PNn;
uint64_t Pv;
uint64_t poly;
uint64_t pos;
uint64_t position;
uint64_t postindex;
uint64_t pref_hint;
uint64_t prfop;
uint64_t ptype;
uint64_t r;
uint64_t rd;
uint64_t read;
uint64_t regs;
uint64_t regsize;
bool release;
uint64_t replicate;
uint64_t rmode;
bool rnontemporal;
uint64_t rot;
uint64_t round;
uint64_t rounding;
Expand All @@ -379,6 +432,7 @@ typedef struct context_
uint64_t signed_;
uint64_t simm7;
uint64_t size;
bool soft;
uint64_t source_is_sp;
uint64_t src_index;
uint64_t src_unsigned;
Expand All @@ -395,16 +449,20 @@ typedef struct context_
uint64_t sys_op0;
uint64_t sys_op1;
uint64_t sys_op2;
uint64_t sys_L;
uint64_t sz;
uint64_t t, t2, tb;
uint64_t tagchecked;
uint64_t tag_checked;
uint64_t tag_offset;
uint64_t target_level;
uint64_t tmask;
uint64_t tsize;
uint64_t tstride;
uint64_t tsz;
uint64_t tszh;
uint64_t tszl;
uint64_t TT;
uint64_t types;
uint64_t u0, u1;
uint64_t uimm4;
Expand All @@ -416,9 +474,15 @@ typedef struct context_
uint64_t use_key_a;
uint64_t user_access_override;
uint64_t v, vertical;
uint64_t value2;
uint64_t vl;
uint64_t VR;
uint64_t wback;
uint64_t wb_unknown;
uint64_t width;
bool withstatus;
uint64_t wmask;
bool wnontemporal;
uint64_t writeback;
uint64_t xs;
uint64_t ZAda, ZAd, ZAn, ZAt, Zk, zero_data;
Expand Down Expand Up @@ -837,7 +901,6 @@ extern "C"

int aarch64_decompose(uint32_t instructionValue, Instruction* instr, uint64_t address);
size_t get_register_size(enum Register);
// const char* tlbi_op(int32_t op);

#ifdef __cplusplus
}
Expand Down
Loading