diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2017-11-03 18:29:27 -0700 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2017-12-18 21:26:19 -0800 |
commit | 168c12b024704400c3398d22e762c9018b6f33be (patch) | |
tree | 832f7ffa95a93dc7baa3ffe93e855b446865b782 /target/xtensa/cpu.h | |
parent | 7f709ce739d46ecd6df98921a20e9dce1dcc421b (diff) |
target/xtensa: extract core opcode translators
Move implementations of core opcodes into separate translation
functions. Introduce data structures for mapping opcode name to
translator function. Make an array of core opcode/translator structures.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'target/xtensa/cpu.h')
-rw-r--r-- | target/xtensa/cpu.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index b17d7d96e9..d8f4034626 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -37,6 +37,7 @@ #include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat.h" +#include "xtensa-isa.h" #define NB_MMU_MODES 4 @@ -205,6 +206,8 @@ enum { #define MEMCTL_DSNP 0x2 #define MEMCTL_IL0EN 0x1 +#define MAX_INSN_LENGTH 64 +#define MAX_OPCODE_ARGS 16 #define MAX_NAREG 64 #define MAX_NINTERRUPT 32 #define MAX_NLEVEL 6 @@ -330,6 +333,23 @@ typedef struct XtensaMemory { } location[MAX_NMEMORY]; } XtensaMemory; +typedef struct DisasContext DisasContext; +typedef void (*XtensaOpcodeOp)(DisasContext *dc, const uint32_t arg[], + const uint32_t par[]); + +typedef struct XtensaOpcodeOps { + const char *name; + XtensaOpcodeOp translate; + const uint32_t *par; +} XtensaOpcodeOps; + +typedef struct XtensaOpcodeTranslators { + unsigned num_opcodes; + const XtensaOpcodeOps *opcode; +} XtensaOpcodeTranslators; + +extern const XtensaOpcodeTranslators xtensa_core_opcodes; + struct XtensaConfig { const char *name; uint64_t options; @@ -370,6 +390,8 @@ struct XtensaConfig { uint32_t configid[2]; + void *isa_internal; + uint32_t clock_freq_khz; xtensa_tlb itlb; @@ -522,6 +544,8 @@ static inline void xtensa_select_static_vectors(CPUXtensaState *env, env->static_vectors = n; } void xtensa_runstall(CPUXtensaState *env, bool runstall); +XtensaOpcodeOps *xtensa_find_opcode_ops(const XtensaOpcodeTranslators *t, + const char *opcode); #define XTENSA_OPTION_BIT(opt) (((uint64_t)1) << (opt)) #define XTENSA_OPTION_ALL (~(uint64_t)0) |