Rizin
unix-like reverse engineering framework and cli tools
xcore.h File Reference
#include "platform.h"

Go to the source code of this file.

Classes

struct  xcore_op_mem
 
struct  cs_xcore_op
 Instruction operand. More...
 
struct  cs_xcore
 Instruction structure. More...
 

Typedefs

typedef enum xcore_op_type xcore_op_type
 Operand type for instruction's operands. More...
 
typedef enum xcore_reg xcore_reg
 XCore registers. More...
 
typedef struct xcore_op_mem xcore_op_mem
 
typedef struct cs_xcore_op cs_xcore_op
 Instruction operand. More...
 
typedef struct cs_xcore cs_xcore
 Instruction structure. More...
 
typedef enum xcore_insn xcore_insn
 XCore instruction. More...
 
typedef enum xcore_insn_group xcore_insn_group
 Group of XCore instructions. More...
 

Enumerations

enum  xcore_op_type { XCORE_OP_INVALID = 0 , XCORE_OP_REG , XCORE_OP_IMM , XCORE_OP_MEM }
 Operand type for instruction's operands. More...
 
enum  xcore_reg {
  XCORE_REG_INVALID = 0 , XCORE_REG_CP , XCORE_REG_DP , XCORE_REG_LR ,
  XCORE_REG_SP , XCORE_REG_R0 , XCORE_REG_R1 , XCORE_REG_R2 ,
  XCORE_REG_R3 , XCORE_REG_R4 , XCORE_REG_R5 , XCORE_REG_R6 ,
  XCORE_REG_R7 , XCORE_REG_R8 , XCORE_REG_R9 , XCORE_REG_R10 ,
  XCORE_REG_R11 , XCORE_REG_PC , XCORE_REG_SCP , XCORE_REG_SSR ,
  XCORE_REG_ET , XCORE_REG_ED , XCORE_REG_SED , XCORE_REG_KEP ,
  XCORE_REG_KSP , XCORE_REG_ID , XCORE_REG_ENDING
}
 XCore registers. More...
 
enum  xcore_insn {
  XCORE_INS_INVALID = 0 , XCORE_INS_ADD , XCORE_INS_ANDNOT , XCORE_INS_AND ,
  XCORE_INS_ASHR , XCORE_INS_BAU , XCORE_INS_BITREV , XCORE_INS_BLA ,
  XCORE_INS_BLAT , XCORE_INS_BL , XCORE_INS_BF , XCORE_INS_BT ,
  XCORE_INS_BU , XCORE_INS_BRU , XCORE_INS_BYTEREV , XCORE_INS_CHKCT ,
  XCORE_INS_CLRE , XCORE_INS_CLRPT , XCORE_INS_CLRSR , XCORE_INS_CLZ ,
  XCORE_INS_CRC8 , XCORE_INS_CRC32 , XCORE_INS_DCALL , XCORE_INS_DENTSP ,
  XCORE_INS_DGETREG , XCORE_INS_DIVS , XCORE_INS_DIVU , XCORE_INS_DRESTSP ,
  XCORE_INS_DRET , XCORE_INS_ECALLF , XCORE_INS_ECALLT , XCORE_INS_EDU ,
  XCORE_INS_EEF , XCORE_INS_EET , XCORE_INS_EEU , XCORE_INS_ENDIN ,
  XCORE_INS_ENTSP , XCORE_INS_EQ , XCORE_INS_EXTDP , XCORE_INS_EXTSP ,
  XCORE_INS_FREER , XCORE_INS_FREET , XCORE_INS_GETD , XCORE_INS_GET ,
  XCORE_INS_GETN , XCORE_INS_GETR , XCORE_INS_GETSR , XCORE_INS_GETST ,
  XCORE_INS_GETTS , XCORE_INS_INCT , XCORE_INS_INIT , XCORE_INS_INPW ,
  XCORE_INS_INSHR , XCORE_INS_INT , XCORE_INS_IN , XCORE_INS_KCALL ,
  XCORE_INS_KENTSP , XCORE_INS_KRESTSP , XCORE_INS_KRET , XCORE_INS_LADD ,
  XCORE_INS_LD16S , XCORE_INS_LD8U , XCORE_INS_LDA16 , XCORE_INS_LDAP ,
  XCORE_INS_LDAW , XCORE_INS_LDC , XCORE_INS_LDW , XCORE_INS_LDIVU ,
  XCORE_INS_LMUL , XCORE_INS_LSS , XCORE_INS_LSUB , XCORE_INS_LSU ,
  XCORE_INS_MACCS , XCORE_INS_MACCU , XCORE_INS_MJOIN , XCORE_INS_MKMSK ,
  XCORE_INS_MSYNC , XCORE_INS_MUL , XCORE_INS_NEG , XCORE_INS_NOT ,
  XCORE_INS_OR , XCORE_INS_OUTCT , XCORE_INS_OUTPW , XCORE_INS_OUTSHR ,
  XCORE_INS_OUTT , XCORE_INS_OUT , XCORE_INS_PEEK , XCORE_INS_REMS ,
  XCORE_INS_REMU , XCORE_INS_RETSP , XCORE_INS_SETCLK , XCORE_INS_SET ,
  XCORE_INS_SETC , XCORE_INS_SETD , XCORE_INS_SETEV , XCORE_INS_SETN ,
  XCORE_INS_SETPSC , XCORE_INS_SETPT , XCORE_INS_SETRDY , XCORE_INS_SETSR ,
  XCORE_INS_SETTW , XCORE_INS_SETV , XCORE_INS_SEXT , XCORE_INS_SHL ,
  XCORE_INS_SHR , XCORE_INS_SSYNC , XCORE_INS_ST16 , XCORE_INS_ST8 ,
  XCORE_INS_STW , XCORE_INS_SUB , XCORE_INS_SYNCR , XCORE_INS_TESTCT ,
  XCORE_INS_TESTLCL , XCORE_INS_TESTWCT , XCORE_INS_TSETMR , XCORE_INS_START ,
  XCORE_INS_WAITEF , XCORE_INS_WAITET , XCORE_INS_WAITEU , XCORE_INS_XOR ,
  XCORE_INS_ZEXT , XCORE_INS_ENDING
}
 XCore instruction. More...
 
enum  xcore_insn_group { XCORE_GRP_INVALID = 0 , XCORE_GRP_JUMP , XCORE_GRP_ENDING }
 Group of XCore instructions. More...
 

Typedef Documentation

◆ cs_xcore

typedef struct cs_xcore cs_xcore

Instruction structure.

◆ cs_xcore_op

typedef struct cs_xcore_op cs_xcore_op

Instruction operand.

◆ xcore_insn

typedef enum xcore_insn xcore_insn

XCore instruction.

◆ xcore_insn_group

Group of XCore instructions.

◆ xcore_op_mem

typedef struct xcore_op_mem xcore_op_mem

Instruction's operand referring to memory This is associated with XCORE_OP_MEM operand type above

◆ xcore_op_type

Operand type for instruction's operands.

◆ xcore_reg

typedef enum xcore_reg xcore_reg

XCore registers.

Enumeration Type Documentation

◆ xcore_insn

enum xcore_insn

XCore instruction.

Enumerator
XCORE_INS_INVALID 
XCORE_INS_ADD 
XCORE_INS_ANDNOT 
XCORE_INS_AND 
XCORE_INS_ASHR 
XCORE_INS_BAU 
XCORE_INS_BITREV 
XCORE_INS_BLA 
XCORE_INS_BLAT 
XCORE_INS_BL 
XCORE_INS_BF 
XCORE_INS_BT 
XCORE_INS_BU 
XCORE_INS_BRU 
XCORE_INS_BYTEREV 
XCORE_INS_CHKCT 
XCORE_INS_CLRE 
XCORE_INS_CLRPT 
XCORE_INS_CLRSR 
XCORE_INS_CLZ 
XCORE_INS_CRC8 
XCORE_INS_CRC32 
XCORE_INS_DCALL 
XCORE_INS_DENTSP 
XCORE_INS_DGETREG 
XCORE_INS_DIVS 
XCORE_INS_DIVU 
XCORE_INS_DRESTSP 
XCORE_INS_DRET 
XCORE_INS_ECALLF 
XCORE_INS_ECALLT 
XCORE_INS_EDU 
XCORE_INS_EEF 
XCORE_INS_EET 
XCORE_INS_EEU 
XCORE_INS_ENDIN 
XCORE_INS_ENTSP 
XCORE_INS_EQ 
XCORE_INS_EXTDP 
XCORE_INS_EXTSP 
XCORE_INS_FREER 
XCORE_INS_FREET 
XCORE_INS_GETD 
XCORE_INS_GET 
XCORE_INS_GETN 
XCORE_INS_GETR 
XCORE_INS_GETSR 
XCORE_INS_GETST 
XCORE_INS_GETTS 
XCORE_INS_INCT 
XCORE_INS_INIT 
XCORE_INS_INPW 
XCORE_INS_INSHR 
XCORE_INS_INT 
XCORE_INS_IN 
XCORE_INS_KCALL 
XCORE_INS_KENTSP 
XCORE_INS_KRESTSP 
XCORE_INS_KRET 
XCORE_INS_LADD 
XCORE_INS_LD16S 
XCORE_INS_LD8U 
XCORE_INS_LDA16 
XCORE_INS_LDAP 
XCORE_INS_LDAW 
XCORE_INS_LDC 
XCORE_INS_LDW 
XCORE_INS_LDIVU 
XCORE_INS_LMUL 
XCORE_INS_LSS 
XCORE_INS_LSUB 
XCORE_INS_LSU 
XCORE_INS_MACCS 
XCORE_INS_MACCU 
XCORE_INS_MJOIN 
XCORE_INS_MKMSK 
XCORE_INS_MSYNC 
XCORE_INS_MUL 
XCORE_INS_NEG 
XCORE_INS_NOT 
XCORE_INS_OR 
XCORE_INS_OUTCT 
XCORE_INS_OUTPW 
XCORE_INS_OUTSHR 
XCORE_INS_OUTT 
XCORE_INS_OUT 
XCORE_INS_PEEK 
XCORE_INS_REMS 
XCORE_INS_REMU 
XCORE_INS_RETSP 
XCORE_INS_SETCLK 
XCORE_INS_SET 
XCORE_INS_SETC 
XCORE_INS_SETD 
XCORE_INS_SETEV 
XCORE_INS_SETN 
XCORE_INS_SETPSC 
XCORE_INS_SETPT 
XCORE_INS_SETRDY 
XCORE_INS_SETSR 
XCORE_INS_SETTW 
XCORE_INS_SETV 
XCORE_INS_SEXT 
XCORE_INS_SHL 
XCORE_INS_SHR 
XCORE_INS_SSYNC 
XCORE_INS_ST16 
XCORE_INS_ST8 
XCORE_INS_STW 
XCORE_INS_SUB 
XCORE_INS_SYNCR 
XCORE_INS_TESTCT 
XCORE_INS_TESTLCL 
XCORE_INS_TESTWCT 
XCORE_INS_TSETMR 
XCORE_INS_START 
XCORE_INS_WAITEF 
XCORE_INS_WAITET 
XCORE_INS_WAITEU 
XCORE_INS_XOR 
XCORE_INS_ZEXT 
XCORE_INS_ENDING 

Definition at line 93 of file xcore.h.

93  {
95 
104  XCORE_INS_BL,
105  XCORE_INS_BF,
106  XCORE_INS_BT,
107  XCORE_INS_BU,
132  XCORE_INS_EQ,
149  XCORE_INS_IN,
175  XCORE_INS_OR,
216 
217  XCORE_INS_ENDING, // <-- mark the end of the list of instructions
218 } xcore_insn;
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.

Enumerator
XCORE_GRP_INVALID 

= CS_GRP_INVALID

XCORE_GRP_JUMP 

= CS_GRP_JUMP

XCORE_GRP_ENDING 

Definition at line 221 of file xcore.h.

221  {
222  XCORE_GRP_INVALID = 0,
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
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

◆ xcore_op_type

Operand type for instruction's operands.

Enumerator
XCORE_OP_INVALID 

= CS_OP_INVALID (Uninitialized).

XCORE_OP_REG 

= CS_OP_REG (Register operand).

XCORE_OP_IMM 

= CS_OP_IMM (Immediate operand).

XCORE_OP_MEM 

= CS_OP_MEM (Memory operand).

Definition at line 18 of file xcore.h.

18  {
19  XCORE_OP_INVALID = 0,
20  XCORE_OP_REG,
21  XCORE_OP_IMM,
22  XCORE_OP_MEM,
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

◆ xcore_reg

enum xcore_reg

XCore registers.

Enumerator
XCORE_REG_INVALID 
XCORE_REG_CP 
XCORE_REG_DP 
XCORE_REG_LR 
XCORE_REG_SP 
XCORE_REG_R0 
XCORE_REG_R1 
XCORE_REG_R2 
XCORE_REG_R3 
XCORE_REG_R4 
XCORE_REG_R5 
XCORE_REG_R6 
XCORE_REG_R7 
XCORE_REG_R8 
XCORE_REG_R9 
XCORE_REG_R10 
XCORE_REG_R11 
XCORE_REG_PC 

pc

XCORE_REG_SCP 

save pc

XCORE_REG_SSR 
XCORE_REG_ET 
XCORE_REG_ED 
XCORE_REG_SED 
XCORE_REG_KEP 
XCORE_REG_KSP 
XCORE_REG_ID 
XCORE_REG_ENDING 

Definition at line 26 of file xcore.h.

26  {
28 
45 
46  // pseudo registers
47  XCORE_REG_PC,
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
61 } xcore_reg;
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