1 /***************************************************************************
2 * Copyright (C) 2013 Andes Technology *
3 * Hsiangkai Wang <hkwang@andestech.com> *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 ***************************************************************************/
19 #ifndef OPENOCD_TARGET_NDS32_REG_H
20 #define OPENOCD_TARGET_NDS32_REG_H
22 #define SRIDX(a, b, c) ((a << 7) | (b << 3) | c)
23 #define NDS32_REGISTER_DISABLE (0x0)
25 enum nds32_reg_number_s
{
26 R0
= 0, /* general registers */
65 CR0
, /* system registers */
184 D0L24
, /* audio registers */
286 enum nds32_reg_type_s
{
287 NDS32_REG_TYPE_GPR
= 0,
298 NDS32_REG_TYPE_SECURE
,
303 const char *simple_mnemonic
;
304 const char *symbolic_mnemonic
;
306 enum nds32_reg_type_s type
;
310 struct nds32_reg_exception_s
{
312 uint32_t ex_value_bit_pos
;
313 uint32_t ex_value_mask
;
317 void nds32_reg_init(void);
318 uint32_t nds32_reg_sr_index(uint32_t number
);
319 enum nds32_reg_type_s
nds32_reg_type(uint32_t number
);
320 uint8_t nds32_reg_size(uint32_t number
);
321 const char *nds32_reg_simple_name(uint32_t number
);
322 const char *nds32_reg_symbolic_name(uint32_t number
);
323 bool nds32_reg_exception(uint32_t number
, uint32_t value
);
325 #endif /* OPENOCD_TARGET_NDS32_REG_H */