From c4ef443d30554eebd3f2710a48ff02737aa1d575 Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Wed, 7 Aug 2024 15:11:39 +0800 Subject: [PATCH] NMSIS/Core: Rename mdcause bitfields to ptyp of MDCAUSE csr ptyp is the new name of MDCAUSE bit 2:0 Signed-off-by: Huaqi Fang <578567190@qq.com> --- NMSIS/Core/Include/core_feature_base.h | 4 ++-- NMSIS/Core/Include/riscv_encoding.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NMSIS/Core/Include/core_feature_base.h b/NMSIS/Core/Include/core_feature_base.h index 79f36cdc..bfbea599 100644 --- a/NMSIS/Core/Include/core_feature_base.h +++ b/NMSIS/Core/Include/core_feature_base.h @@ -219,8 +219,8 @@ typedef union { */ typedef union { struct { - rv_csr_t mdcause:2; /*!< bit: 0..1 More detailed exception information as MCAUSE supplement */ - rv_csr_t _reserved0:__RISCV_XLEN-2; /*!< bit: 2..XLEN-1 Reserved */ + rv_csr_t ptyp:3; /*!< bit: 0..2 More detailed exception information as MCAUSE supplement */ + rv_csr_t _reserved0:__RISCV_XLEN-3; /*!< bit: 3..XLEN-1 Reserved */ } b; /*!< Structure used for bit access */ rv_csr_t d; /*!< Type used for csr data access */ } CSR_MDCAUSE_Type; diff --git a/NMSIS/Core/Include/riscv_encoding.h b/NMSIS/Core/Include/riscv_encoding.h index e1210145..e84c0a1b 100644 --- a/NMSIS/Core/Include/riscv_encoding.h +++ b/NMSIS/Core/Include/riscv_encoding.h @@ -226,7 +226,8 @@ #define MSUBM_PTYP (0x3<<8) #define MSUBM_TYP (0x3<<6) -#define MDCAUSE_MDCAUSE (0x3) +#define MDCAUSE_MDCAUSE (0x7) +#define MDCAUSE_PTYP (0x7) #define MMISC_CTL_LDSPEC_ENABLE (1<<12) #define MMISC_CTL_SIJUMP_ENABLE (1<<11)