/***************************************************************************
- * Copyright (C) 2013 by Andes Technology *
+ * Copyright (C) 2013 Andes Technology *
* Hsiangkai Wang <hkwang@andestech.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
-#ifndef __NDS32_REG_H__
-#define __NDS32_REG_H__
+
+#ifndef OPENOCD_TARGET_NDS32_REG_H
+#define OPENOCD_TARGET_NDS32_REG_H
#define SRIDX(a, b, c) ((a << 7) | (b << 3) | c)
#define NDS32_REGISTER_DISABLE (0x0)
enum nds32_reg_number_s {
- /* general registers */
- R0 = 0,
+ R0 = 0, /* general registers */
R1,
R2,
R3,
D1HI,
ITB,
IFC_LP,
-
- /* system registers */
- CR0,
+ CR0, /* system registers */
CR1,
CR2,
CR3,
IR23,
IR24,
IR25,
+ IR26,
+ IR27,
+ IR28,
+ IR29,
+ IR30,
MR0,
MR1,
MR2,
IDR0,
IDR1,
SECUR0,
-
- /* audio registers */
- D0L24,
+ D0L24, /* audio registers */
D1L24,
I0,
I1,
CBE1,
CBE2,
CBE3,
-
- /* fpu */
- FPCSR,
+ FPCSR, /* fpu */
FPCFG,
FS0,
FS1,
uint8_t size;
};
+struct nds32_reg_exception_s {
+ uint32_t reg_num;
+ uint32_t ex_value_bit_pos;
+ uint32_t ex_value_mask;
+ uint32_t ex_value;
+};
+
void nds32_reg_init(void);
uint32_t nds32_reg_sr_index(uint32_t number);
enum nds32_reg_type_s nds32_reg_type(uint32_t number);
uint8_t nds32_reg_size(uint32_t number);
const char *nds32_reg_simple_name(uint32_t number);
const char *nds32_reg_symbolic_name(uint32_t number);
+bool nds32_reg_exception(uint32_t number, uint32_t value);
-#endif
+#endif /* OPENOCD_TARGET_NDS32_REG_H */