Rizin
unix-like reverse engineering framework and cli tools
xcore.h
Go to the documentation of this file.
1 #ifndef CAPSTONE_XCORE_H
2 #define CAPSTONE_XCORE_H
3 
4 /* Capstone Disassembly Engine */
5 /* By Nguyen Anh Quynh <aquynh@gmail.com>, 2014-2015 */
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 #include "platform.h"
12 
13 #ifdef _MSC_VER
14 #pragma warning(disable:4201)
15 #endif
16 
18 typedef enum xcore_op_type {
24 
26 typedef enum xcore_reg {
28 
45 
46  // pseudo registers
48 
49  // internal thread registers
50  // see The-XMOS-XS1-Architecture(X7879A).pdf
52  XCORE_REG_SSR, //< save status
53  XCORE_REG_ET, //< exception type
54  XCORE_REG_ED, //< exception data
55  XCORE_REG_SED, //< save exception data
56  XCORE_REG_KEP, //< kernel entry pointer
57  XCORE_REG_KSP, //< kernel stack pointer
58  XCORE_REG_ID, //< thread ID
59 
60  XCORE_REG_ENDING, // <-- mark the end of the list of registers
62 
65 typedef struct xcore_op_mem {
71  int direct;
73 
75 typedef struct cs_xcore_op {
77  union {
81  };
83 
85 typedef struct cs_xcore {
91 
93 typedef enum xcore_insn {
95 
216 
217  XCORE_INS_ENDING, // <-- mark the end of the list of instructions
219 
221 typedef enum xcore_insn_group {
223 
224  // Generic groups
225  // all jump instructions (conditional+direct+indirect jumps)
227 
228  XCORE_GRP_ENDING, // <-- mark the end of the list of groups
230 
231 #ifdef __cplusplus
232 }
233 #endif
234 
235 #endif
struct xcore_op_mem xcore_op_mem
xcore_reg
XCore registers.
Definition: xcore.h:26
@ XCORE_REG_ET
Definition: xcore.h:53
@ XCORE_REG_R2
Definition: xcore.h:35
@ XCORE_REG_INVALID
Definition: xcore.h:27
@ XCORE_REG_R9
Definition: xcore.h:42
@ XCORE_REG_R6
Definition: xcore.h:39
@ XCORE_REG_ID
Definition: xcore.h:58
@ XCORE_REG_KSP
Definition: xcore.h:57
@ XCORE_REG_R7
Definition: xcore.h:40
@ XCORE_REG_ED
Definition: xcore.h:54
@ XCORE_REG_SSR
Definition: xcore.h:52
@ XCORE_REG_R3
Definition: xcore.h:36
@ XCORE_REG_R1
Definition: xcore.h:34
@ XCORE_REG_R10
Definition: xcore.h:43
@ XCORE_REG_ENDING
Definition: xcore.h:60
@ XCORE_REG_SCP
save pc
Definition: xcore.h:51
@ XCORE_REG_PC
pc
Definition: xcore.h:47
@ XCORE_REG_SED
Definition: xcore.h:55
@ XCORE_REG_KEP
Definition: xcore.h:56
@ XCORE_REG_R11
Definition: xcore.h:44
@ XCORE_REG_R4
Definition: xcore.h:37
@ XCORE_REG_R0
Definition: xcore.h:33
@ XCORE_REG_R5
Definition: xcore.h:38
@ XCORE_REG_SP
Definition: xcore.h:32
@ XCORE_REG_DP
Definition: xcore.h:30
@ XCORE_REG_CP
Definition: xcore.h:29
@ XCORE_REG_R8
Definition: xcore.h:41
@ XCORE_REG_LR
Definition: xcore.h:31
xcore_op_type
Operand type for instruction's operands.
Definition: xcore.h:18
@ XCORE_OP_REG
= CS_OP_REG (Register operand).
Definition: xcore.h:20
@ XCORE_OP_IMM
= CS_OP_IMM (Immediate operand).
Definition: xcore.h:21
@ XCORE_OP_MEM
= CS_OP_MEM (Memory operand).
Definition: xcore.h:22
@ XCORE_OP_INVALID
= CS_OP_INVALID (Uninitialized).
Definition: xcore.h:19
struct cs_xcore cs_xcore
Instruction structure.
struct cs_xcore_op cs_xcore_op
Instruction operand.
xcore_insn
XCore instruction.
Definition: xcore.h:93
@ XCORE_INS_BL
Definition: xcore.h:104
@ XCORE_INS_INIT
Definition: xcore.h:145
@ XCORE_INS_GETST
Definition: xcore.h:142
@ XCORE_INS_EEU
Definition: xcore.h:129
@ XCORE_INS_REMS
Definition: xcore.h:182
@ XCORE_INS_LSUB
Definition: xcore.h:165
@ XCORE_INS_OUTT
Definition: xcore.h:179
@ XCORE_INS_MKMSK
Definition: xcore.h:170
@ XCORE_INS_SETC
Definition: xcore.h:187
@ XCORE_INS_LDAP
Definition: xcore.h:158
@ XCORE_INS_START
Definition: xcore.h:210
@ XCORE_INS_SUB
Definition: xcore.h:204
@ XCORE_INS_NOT
Definition: xcore.h:174
@ XCORE_INS_BLA
Definition: xcore.h:102
@ XCORE_INS_CRC32
Definition: xcore.h:116
@ XCORE_INS_WAITEF
Definition: xcore.h:211
@ XCORE_INS_INVALID
Definition: xcore.h:94
@ XCORE_INS_DRESTSP
Definition: xcore.h:122
@ XCORE_INS_PEEK
Definition: xcore.h:181
@ XCORE_INS_MACCU
Definition: xcore.h:168
@ XCORE_INS_LDIVU
Definition: xcore.h:162
@ XCORE_INS_BITREV
Definition: xcore.h:101
@ XCORE_INS_SEXT
Definition: xcore.h:197
@ XCORE_INS_CLRPT
Definition: xcore.h:112
@ XCORE_INS_BT
Definition: xcore.h:106
@ XCORE_INS_LMUL
Definition: xcore.h:163
@ XCORE_INS_DIVS
Definition: xcore.h:120
@ XCORE_INS_OUTCT
Definition: xcore.h:176
@ XCORE_INS_GETN
Definition: xcore.h:139
@ XCORE_INS_TESTLCL
Definition: xcore.h:207
@ XCORE_INS_SYNCR
Definition: xcore.h:205
@ XCORE_INS_KCALL
Definition: xcore.h:150
@ XCORE_INS_OUTPW
Definition: xcore.h:177
@ XCORE_INS_WAITEU
Definition: xcore.h:213
@ XCORE_INS_CLRE
Definition: xcore.h:111
@ XCORE_INS_SETV
Definition: xcore.h:196
@ XCORE_INS_MSYNC
Definition: xcore.h:171
@ XCORE_INS_SSYNC
Definition: xcore.h:200
@ XCORE_INS_MJOIN
Definition: xcore.h:169
@ XCORE_INS_FREER
Definition: xcore.h:135
@ XCORE_INS_EET
Definition: xcore.h:128
@ XCORE_INS_SHR
Definition: xcore.h:199
@ XCORE_INS_REMU
Definition: xcore.h:183
@ XCORE_INS_EXTDP
Definition: xcore.h:133
@ XCORE_INS_BYTEREV
Definition: xcore.h:109
@ XCORE_INS_XOR
Definition: xcore.h:214
@ XCORE_INS_GETTS
Definition: xcore.h:143
@ XCORE_INS_DGETREG
Definition: xcore.h:119
@ XCORE_INS_FREET
Definition: xcore.h:136
@ XCORE_INS_ASHR
Definition: xcore.h:99
@ XCORE_INS_BAU
Definition: xcore.h:100
@ XCORE_INS_NEG
Definition: xcore.h:173
@ XCORE_INS_BRU
Definition: xcore.h:108
@ XCORE_INS_GET
Definition: xcore.h:138
@ XCORE_INS_IN
Definition: xcore.h:149
@ XCORE_INS_MACCS
Definition: xcore.h:167
@ XCORE_INS_BLAT
Definition: xcore.h:103
@ XCORE_INS_ENDIN
Definition: xcore.h:130
@ XCORE_INS_LDAW
Definition: xcore.h:159
@ XCORE_INS_ANDNOT
Definition: xcore.h:97
@ XCORE_INS_ECALLF
Definition: xcore.h:124
@ XCORE_INS_RETSP
Definition: xcore.h:184
@ XCORE_INS_SETEV
Definition: xcore.h:189
@ XCORE_INS_INT
Definition: xcore.h:148
@ XCORE_INS_LDC
Definition: xcore.h:160
@ XCORE_INS_EQ
Definition: xcore.h:132
@ XCORE_INS_KENTSP
Definition: xcore.h:151
@ XCORE_INS_CHKCT
Definition: xcore.h:110
@ XCORE_INS_SETPSC
Definition: xcore.h:191
@ XCORE_INS_DENTSP
Definition: xcore.h:118
@ XCORE_INS_ECALLT
Definition: xcore.h:125
@ XCORE_INS_TESTWCT
Definition: xcore.h:208
@ XCORE_INS_SHL
Definition: xcore.h:198
@ XCORE_INS_ZEXT
Definition: xcore.h:215
@ XCORE_INS_LSU
Definition: xcore.h:166
@ XCORE_INS_SETTW
Definition: xcore.h:195
@ XCORE_INS_ST16
Definition: xcore.h:201
@ XCORE_INS_EEF
Definition: xcore.h:127
@ XCORE_INS_DCALL
Definition: xcore.h:117
@ XCORE_INS_TSETMR
Definition: xcore.h:209
@ XCORE_INS_ADD
Definition: xcore.h:96
@ XCORE_INS_OUTSHR
Definition: xcore.h:178
@ XCORE_INS_INPW
Definition: xcore.h:146
@ XCORE_INS_SETN
Definition: xcore.h:190
@ XCORE_INS_LDA16
Definition: xcore.h:157
@ XCORE_INS_LD16S
Definition: xcore.h:155
@ XCORE_INS_SETSR
Definition: xcore.h:194
@ XCORE_INS_BU
Definition: xcore.h:107
@ XCORE_INS_INCT
Definition: xcore.h:144
@ XCORE_INS_EXTSP
Definition: xcore.h:134
@ XCORE_INS_SETCLK
Definition: xcore.h:185
@ XCORE_INS_GETD
Definition: xcore.h:137
@ XCORE_INS_LD8U
Definition: xcore.h:156
@ XCORE_INS_LDW
Definition: xcore.h:161
@ XCORE_INS_GETR
Definition: xcore.h:140
@ XCORE_INS_DIVU
Definition: xcore.h:121
@ XCORE_INS_OR
Definition: xcore.h:175
@ XCORE_INS_LSS
Definition: xcore.h:164
@ XCORE_INS_CLRSR
Definition: xcore.h:113
@ XCORE_INS_INSHR
Definition: xcore.h:147
@ XCORE_INS_TESTCT
Definition: xcore.h:206
@ XCORE_INS_WAITET
Definition: xcore.h:212
@ XCORE_INS_EDU
Definition: xcore.h:126
@ XCORE_INS_ST8
Definition: xcore.h:202
@ XCORE_INS_KRESTSP
Definition: xcore.h:152
@ XCORE_INS_MUL
Definition: xcore.h:172
@ XCORE_INS_SETD
Definition: xcore.h:188
@ XCORE_INS_DRET
Definition: xcore.h:123
@ XCORE_INS_CLZ
Definition: xcore.h:114
@ XCORE_INS_GETSR
Definition: xcore.h:141
@ XCORE_INS_ENTSP
Definition: xcore.h:131
@ XCORE_INS_BF
Definition: xcore.h:105
@ XCORE_INS_AND
Definition: xcore.h:98
@ XCORE_INS_OUT
Definition: xcore.h:180
@ XCORE_INS_SET
Definition: xcore.h:186
@ XCORE_INS_STW
Definition: xcore.h:203
@ XCORE_INS_SETRDY
Definition: xcore.h:193
@ XCORE_INS_LADD
Definition: xcore.h:154
@ XCORE_INS_CRC8
Definition: xcore.h:115
@ XCORE_INS_ENDING
Definition: xcore.h:217
@ XCORE_INS_SETPT
Definition: xcore.h:192
@ XCORE_INS_KRET
Definition: xcore.h:153
xcore_insn_group
Group of XCore instructions.
Definition: xcore.h:221
@ XCORE_GRP_JUMP
= CS_GRP_JUMP
Definition: xcore.h:226
@ XCORE_GRP_ENDING
Definition: xcore.h:228
@ XCORE_GRP_INVALID
= CS_GRP_INVALID
Definition: xcore.h:222
int int32_t
Definition: sftypes.h:33
unsigned char uint8_t
Definition: sftypes.h:31
Instruction operand.
Definition: xcore.h:75
xcore_reg reg
register value for REG operand
Definition: xcore.h:78
int32_t imm
immediate value for IMM operand
Definition: xcore.h:79
xcore_op_mem mem
base/disp value for MEM operand
Definition: xcore.h:80
xcore_op_type type
operand type
Definition: xcore.h:76
Instruction structure.
Definition: xcore.h:85
uint8_t op_count
Definition: xcore.h:88
uint8_t index
index register, same conditions apply here
Definition: xcore.h:69
uint8_t base
Definition: xcore.h:66
int direct
+1: forward, -1: backward
Definition: xcore.h:71
int32_t disp
displacement/offset value
Definition: xcore.h:70