OpenOCD
nds32_reg.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Copyright (C) 2013 Andes Technology *
5  * Hsiangkai Wang <hkwang@andestech.com> *
6  ***************************************************************************/
7 
8 #ifndef OPENOCD_TARGET_NDS32_REG_H
9 #define OPENOCD_TARGET_NDS32_REG_H
10 
11 #define SRIDX(a, b, c) ((a << 7) | (b << 3) | c)
12 #define NDS32_REGISTER_DISABLE (0x0)
13 
15  R0 = 0, /* general registers */
16  R1,
17  R2,
18  R3,
19  R4,
20  R5,
21  R6,
22  R7,
23  R8,
24  R9,
25  R10,
26  R11,
27  R12,
28  R13,
29  R14,
30  R15,
31  R16,
32  R17,
33  R18,
34  R19,
35  R20,
36  R21,
37  R22,
38  R23,
39  R24,
40  R25,
41  R26,
42  R27,
43  R28,
44  R29,
45  R30,
46  R31,
47  PC,
52  ITB,
54  CR0, /* system registers */
55  CR1,
56  CR2,
57  CR3,
58  CR4,
59  CR5,
60  CR6,
61  IR0,
62  IR1,
63  IR2,
64  IR3,
65  IR4,
66  IR5,
67  IR6,
68  IR7,
69  IR8,
70  IR9,
92  MR0,
93  MR1,
94  MR2,
95  MR3,
96  MR4,
97  MR5,
98  MR6,
99  MR7,
173  D0L24, /* audio registers */
175  I0,
176  I1,
177  I2,
178  I3,
179  I4,
180  I5,
181  I6,
182  I7,
183  M1,
184  M2,
185  M3,
186  M5,
187  M6,
188  M7,
191  LE,
192  LC,
205  FPCSR, /* fpu */
271 
273 };
274 
289 };
290 
291 struct nds32_reg_s {
292  const char *simple_mnemonic;
293  const char *symbolic_mnemonic;
294  uint32_t sr_index;
295  enum nds32_reg_type_s type;
296  uint8_t size;
297 };
298 
300  uint32_t reg_num;
302  uint32_t ex_value_mask;
303  uint32_t ex_value;
304 };
305 
306 void nds32_reg_init(void);
307 uint32_t nds32_reg_sr_index(uint32_t number);
308 enum nds32_reg_type_s nds32_reg_type(uint32_t number);
309 uint8_t nds32_reg_size(uint32_t number);
310 const char *nds32_reg_simple_name(uint32_t number);
311 const char *nds32_reg_symbolic_name(uint32_t number);
312 bool nds32_reg_exception(uint32_t number, uint32_t value);
313 
314 #endif /* OPENOCD_TARGET_NDS32_REG_H */
enum esirisc_reg_num number
Definition: esirisc.c:87
const char * nds32_reg_symbolic_name(uint32_t number)
Definition: nds32_reg.c:340
uint8_t nds32_reg_size(uint32_t number)
Definition: nds32_reg.c:330
nds32_reg_type_s
Definition: nds32_reg.h:275
@ NDS32_REG_TYPE_SECURE
Definition: nds32_reg.h:287
@ NDS32_REG_TYPE_AUMR
Definition: nds32_reg.h:286
@ NDS32_REG_TYPE_IR
Definition: nds32_reg.h:279
@ NDS32_REG_TYPE_CR
Definition: nds32_reg.h:278
@ NDS32_REG_TYPE_GPR
Definition: nds32_reg.h:276
@ NDS32_REG_TYPE_PFR
Definition: nds32_reg.h:282
@ NDS32_REG_TYPE_MR
Definition: nds32_reg.h:280
@ NDS32_REG_TYPE_FPU
Definition: nds32_reg.h:288
@ NDS32_REG_TYPE_DMAR
Definition: nds32_reg.h:283
@ NDS32_REG_TYPE_IDR
Definition: nds32_reg.h:285
@ NDS32_REG_TYPE_RACR
Definition: nds32_reg.h:284
@ NDS32_REG_TYPE_DR
Definition: nds32_reg.h:281
@ NDS32_REG_TYPE_SPR
Definition: nds32_reg.h:277
uint32_t nds32_reg_sr_index(uint32_t number)
Definition: nds32_reg.c:320
enum nds32_reg_type_s nds32_reg_type(uint32_t number)
Definition: nds32_reg.c:325
void nds32_reg_init(void)
Definition: nds32_reg.c:41
bool nds32_reg_exception(uint32_t number, uint32_t value)
Definition: nds32_reg.c:345
nds32_reg_number_s
Definition: nds32_reg.h:14
@ FD9
Definition: nds32_reg.h:248
@ FD1
Definition: nds32_reg.h:240
@ FD13
Definition: nds32_reg.h:252
@ R7
Definition: nds32_reg.h:22
@ R30
Definition: nds32_reg.h:45
@ DR44
Definition: nds32_reg.h:148
@ FS26
Definition: nds32_reg.h:233
@ DR42
Definition: nds32_reg.h:146
@ DMAR9
Definition: nds32_reg.h:166
@ M6
Definition: nds32_reg.h:187
@ DR16
Definition: nds32_reg.h:120
@ DR29
Definition: nds32_reg.h:133
@ FD31
Definition: nds32_reg.h:270
@ FS11
Definition: nds32_reg.h:218
@ DR10
Definition: nds32_reg.h:114
@ FD26
Definition: nds32_reg.h:265
@ D0L24
Definition: nds32_reg.h:173
@ MOD
Definition: nds32_reg.h:189
@ M5
Definition: nds32_reg.h:186
@ FS16
Definition: nds32_reg.h:223
@ MR4
Definition: nds32_reg.h:96
@ DR37
Definition: nds32_reg.h:141
@ DR20
Definition: nds32_reg.h:124
@ IR3
Definition: nds32_reg.h:64
@ D0HI
Definition: nds32_reg.h:49
@ R15
Definition: nds32_reg.h:30
@ FS18
Definition: nds32_reg.h:225
@ FS24
Definition: nds32_reg.h:231
@ IR17
Definition: nds32_reg.h:78
@ R13
Definition: nds32_reg.h:28
@ MR9
Definition: nds32_reg.h:101
@ FS28
Definition: nds32_reg.h:235
@ CBB0
Definition: nds32_reg.h:197
@ FS9
Definition: nds32_reg.h:216
@ FS30
Definition: nds32_reg.h:237
@ DMAR1
Definition: nds32_reg.h:158
@ FPCSR
Definition: nds32_reg.h:205
@ FS4
Definition: nds32_reg.h:211
@ CR2
Definition: nds32_reg.h:56
@ ITB
Definition: nds32_reg.h:52
@ R16
Definition: nds32_reg.h:31
@ MR2
Definition: nds32_reg.h:94
@ FD4
Definition: nds32_reg.h:243
@ FD2
Definition: nds32_reg.h:241
@ LBE
Definition: nds32_reg.h:190
@ D1HI
Definition: nds32_reg.h:51
@ IR30
Definition: nds32_reg.h:91
@ FD30
Definition: nds32_reg.h:269
@ DR39
Definition: nds32_reg.h:143
@ DR41
Definition: nds32_reg.h:145
@ DR34
Definition: nds32_reg.h:138
@ R17
Definition: nds32_reg.h:32
@ IR6
Definition: nds32_reg.h:67
@ LC
Definition: nds32_reg.h:192
@ FS8
Definition: nds32_reg.h:215
@ MR1
Definition: nds32_reg.h:93
@ DR11
Definition: nds32_reg.h:115
@ FD5
Definition: nds32_reg.h:244
@ IR13
Definition: nds32_reg.h:74
@ DR45
Definition: nds32_reg.h:149
@ IR15
Definition: nds32_reg.h:76
@ FD21
Definition: nds32_reg.h:260
@ DR28
Definition: nds32_reg.h:132
@ R26
Definition: nds32_reg.h:41
@ R4
Definition: nds32_reg.h:19
@ M3
Definition: nds32_reg.h:185
@ DR1
Definition: nds32_reg.h:105
@ CR4
Definition: nds32_reg.h:58
@ CBE2
Definition: nds32_reg.h:203
@ DR27
Definition: nds32_reg.h:131
@ CBB1
Definition: nds32_reg.h:198
@ DR12
Definition: nds32_reg.h:116
@ DR2
Definition: nds32_reg.h:106
@ SHFT_CTL1
Definition: nds32_reg.h:195
@ R31
Definition: nds32_reg.h:46
@ CR0
Definition: nds32_reg.h:54
@ IR16
Definition: nds32_reg.h:77
@ FD8
Definition: nds32_reg.h:247
@ R24
Definition: nds32_reg.h:39
@ DMAR0
Definition: nds32_reg.h:157
@ DR22
Definition: nds32_reg.h:126
@ R20
Definition: nds32_reg.h:35
@ R22
Definition: nds32_reg.h:37
@ R12
Definition: nds32_reg.h:27
@ IR26
Definition: nds32_reg.h:87
@ FD18
Definition: nds32_reg.h:257
@ MR3
Definition: nds32_reg.h:95
@ FD20
Definition: nds32_reg.h:259
@ DR6
Definition: nds32_reg.h:110
@ R9
Definition: nds32_reg.h:24
@ R23
Definition: nds32_reg.h:38
@ IDR1
Definition: nds32_reg.h:171
@ FS3
Definition: nds32_reg.h:210
@ R28
Definition: nds32_reg.h:43
@ FD28
Definition: nds32_reg.h:267
@ FD22
Definition: nds32_reg.h:261
@ FS1
Definition: nds32_reg.h:208
@ R2
Definition: nds32_reg.h:17
@ FS27
Definition: nds32_reg.h:234
@ DR18
Definition: nds32_reg.h:122
@ M2
Definition: nds32_reg.h:184
@ DR35
Definition: nds32_reg.h:139
@ DR13
Definition: nds32_reg.h:117
@ LE
Definition: nds32_reg.h:191
@ M7
Definition: nds32_reg.h:188
@ DR17
Definition: nds32_reg.h:121
@ IDR0
Definition: nds32_reg.h:170
@ IR1
Definition: nds32_reg.h:62
@ IR21
Definition: nds32_reg.h:82
@ D1L24
Definition: nds32_reg.h:174
@ FS6
Definition: nds32_reg.h:213
@ DR43
Definition: nds32_reg.h:147
@ FD12
Definition: nds32_reg.h:251
@ IR22
Definition: nds32_reg.h:83
@ DR8
Definition: nds32_reg.h:112
@ FS7
Definition: nds32_reg.h:214
@ CBB3
Definition: nds32_reg.h:200
@ IR27
Definition: nds32_reg.h:88
@ IR23
Definition: nds32_reg.h:84
@ MR8
Definition: nds32_reg.h:100
@ FD0
Definition: nds32_reg.h:239
@ DR0
Definition: nds32_reg.h:104
@ FD24
Definition: nds32_reg.h:263
@ FS15
Definition: nds32_reg.h:222
@ R25
Definition: nds32_reg.h:40
@ DMAR3
Definition: nds32_reg.h:160
@ DMAR5
Definition: nds32_reg.h:162
@ IR9
Definition: nds32_reg.h:70
@ DR14
Definition: nds32_reg.h:118
@ FD11
Definition: nds32_reg.h:250
@ FD3
Definition: nds32_reg.h:242
@ FUCPR
Definition: nds32_reg.h:169
@ CBE0
Definition: nds32_reg.h:201
@ FD6
Definition: nds32_reg.h:245
@ I5
Definition: nds32_reg.h:180
@ FS22
Definition: nds32_reg.h:229
@ R5
Definition: nds32_reg.h:20
@ FS10
Definition: nds32_reg.h:217
@ PFR2
Definition: nds32_reg.h:155
@ CBE3
Definition: nds32_reg.h:204
@ DR26
Definition: nds32_reg.h:130
@ MR0
Definition: nds32_reg.h:92
@ R0
Definition: nds32_reg.h:15
@ R6
Definition: nds32_reg.h:21
@ FD25
Definition: nds32_reg.h:264
@ SECUR0
Definition: nds32_reg.h:172
@ CBE1
Definition: nds32_reg.h:202
@ DR36
Definition: nds32_reg.h:140
@ IR14
Definition: nds32_reg.h:75
@ M1
Definition: nds32_reg.h:183
@ MR11
Definition: nds32_reg.h:103
@ FD7
Definition: nds32_reg.h:246
@ MR10
Definition: nds32_reg.h:102
@ FS29
Definition: nds32_reg.h:236
@ DR23
Definition: nds32_reg.h:127
@ PC
Definition: nds32_reg.h:47
@ FS5
Definition: nds32_reg.h:212
@ DR9
Definition: nds32_reg.h:113
@ MR5
Definition: nds32_reg.h:97
@ CR6
Definition: nds32_reg.h:60
@ ADM_VBASE
Definition: nds32_reg.h:193
@ DR4
Definition: nds32_reg.h:108
@ DMAR6
Definition: nds32_reg.h:163
@ TOTAL_REG_NUM
Definition: nds32_reg.h:272
@ CR1
Definition: nds32_reg.h:55
@ DMAR4
Definition: nds32_reg.h:161
@ FS0
Definition: nds32_reg.h:207
@ R3
Definition: nds32_reg.h:18
@ R29
Definition: nds32_reg.h:44
@ IR29
Definition: nds32_reg.h:90
@ DR15
Definition: nds32_reg.h:119
@ R21
Definition: nds32_reg.h:36
@ DMAR7
Definition: nds32_reg.h:164
@ DR48
Definition: nds32_reg.h:152
@ PFR0
Definition: nds32_reg.h:153
@ I1
Definition: nds32_reg.h:176
@ DR46
Definition: nds32_reg.h:150
@ DR21
Definition: nds32_reg.h:125
@ R27
Definition: nds32_reg.h:42
@ FD19
Definition: nds32_reg.h:258
@ MR7
Definition: nds32_reg.h:99
@ IR25
Definition: nds32_reg.h:86
@ FS19
Definition: nds32_reg.h:226
@ IR28
Definition: nds32_reg.h:89
@ IR4
Definition: nds32_reg.h:65
@ CBB2
Definition: nds32_reg.h:199
@ DR19
Definition: nds32_reg.h:123
@ R14
Definition: nds32_reg.h:29
@ IR0
Definition: nds32_reg.h:61
@ SHFT_CTL0
Definition: nds32_reg.h:194
@ FPCFG
Definition: nds32_reg.h:206
@ DMAR2
Definition: nds32_reg.h:159
@ CR5
Definition: nds32_reg.h:59
@ FS21
Definition: nds32_reg.h:228
@ FS25
Definition: nds32_reg.h:232
@ DR24
Definition: nds32_reg.h:128
@ IR10
Definition: nds32_reg.h:71
@ IR8
Definition: nds32_reg.h:69
@ IR19
Definition: nds32_reg.h:80
@ DR40
Definition: nds32_reg.h:144
@ I4
Definition: nds32_reg.h:179
@ D1LO
Definition: nds32_reg.h:50
@ PFR1
Definition: nds32_reg.h:154
@ FS17
Definition: nds32_reg.h:224
@ I6
Definition: nds32_reg.h:181
@ I0
Definition: nds32_reg.h:175
@ MR6
Definition: nds32_reg.h:98
@ FD14
Definition: nds32_reg.h:253
@ FS14
Definition: nds32_reg.h:221
@ DR5
Definition: nds32_reg.h:109
@ FS13
Definition: nds32_reg.h:220
@ DR7
Definition: nds32_reg.h:111
@ DR32
Definition: nds32_reg.h:136
@ CR3
Definition: nds32_reg.h:57
@ FS2
Definition: nds32_reg.h:209
@ FS23
Definition: nds32_reg.h:230
@ IR20
Definition: nds32_reg.h:81
@ R8
Definition: nds32_reg.h:23
@ IFC_LP
Definition: nds32_reg.h:53
@ FD10
Definition: nds32_reg.h:249
@ FD17
Definition: nds32_reg.h:256
@ DR47
Definition: nds32_reg.h:151
@ FD23
Definition: nds32_reg.h:262
@ DMAR8
Definition: nds32_reg.h:165
@ FD16
Definition: nds32_reg.h:255
@ RACR
Definition: nds32_reg.h:168
@ FD29
Definition: nds32_reg.h:268
@ DR3
Definition: nds32_reg.h:107
@ FS20
Definition: nds32_reg.h:227
@ D0LO
Definition: nds32_reg.h:48
@ FD27
Definition: nds32_reg.h:266
@ R18
Definition: nds32_reg.h:33
@ IR24
Definition: nds32_reg.h:85
@ IR2
Definition: nds32_reg.h:63
@ DR33
Definition: nds32_reg.h:137
@ R11
Definition: nds32_reg.h:26
@ DR25
Definition: nds32_reg.h:129
@ R19
Definition: nds32_reg.h:34
@ I7
Definition: nds32_reg.h:182
@ DR30
Definition: nds32_reg.h:134
@ R10
Definition: nds32_reg.h:25
@ I3
Definition: nds32_reg.h:178
@ DR31
Definition: nds32_reg.h:135
@ FS12
Definition: nds32_reg.h:219
@ IR7
Definition: nds32_reg.h:68
@ FS31
Definition: nds32_reg.h:238
@ DMAR10
Definition: nds32_reg.h:167
@ I2
Definition: nds32_reg.h:177
@ PFR3
Definition: nds32_reg.h:156
@ DR38
Definition: nds32_reg.h:142
@ R1
Definition: nds32_reg.h:16
@ IR18
Definition: nds32_reg.h:79
@ IR11
Definition: nds32_reg.h:72
@ IR5
Definition: nds32_reg.h:66
@ CB_CTL
Definition: nds32_reg.h:196
@ IR12
Definition: nds32_reg.h:73
@ FD15
Definition: nds32_reg.h:254
const char * nds32_reg_simple_name(uint32_t number)
Definition: nds32_reg.c:335
uint32_t ex_value_mask
Definition: nds32_reg.h:302
uint32_t ex_value_bit_pos
Definition: nds32_reg.h:301
const char * simple_mnemonic
Definition: nds32_reg.h:292
uint8_t size
Definition: nds32_reg.h:296
uint32_t sr_index
Definition: nds32_reg.h:294
enum nds32_reg_type_s type
Definition: nds32_reg.h:295
const char * symbolic_mnemonic
Definition: nds32_reg.h:293