NMSIS-Core
Version 1.3.1
NMSIS-Core support for Nuclei processor-based devices
|
Functions that related to the RISCV Phyiscal Memory Protection. More...
Data Structures | |
struct | PMP_CONFIG |
Functions | |
__STATIC_INLINE rv_csr_t | __get_PMPCFGx (uint32_t csr_idx) |
Get PMPCFGx Register by csr index. More... | |
__STATIC_INLINE void | __set_PMPCFGx (uint32_t csr_idx, rv_csr_t pmpcfg) |
Set PMPCFGx by csr index. More... | |
__STATIC_INLINE uint8_t | __get_PMPxCFG (uint32_t entry_idx) |
Get 8bit PMPxCFG Register by PMP entry index. More... | |
__STATIC_INLINE void | __set_PMPxCFG (uint32_t entry_idx, uint8_t pmpxcfg) |
Set 8bit PMPxCFG by pmp entry index. More... | |
__STATIC_INLINE rv_csr_t | __get_PMPADDRx (uint32_t csr_idx) |
Get PMPADDRx Register by CSR index. More... | |
__STATIC_INLINE void | __set_PMPADDRx (uint32_t csr_idx, rv_csr_t pmpaddr) |
Set PMPADDRx by CSR index. More... | |
__STATIC_INLINE void | __set_PMPENTRYx (uint32_t entry_idx, const pmp_config *pmp_cfg) |
Set PMP entry by entry idx. More... | |
__STATIC_INLINE int | __get_PMPENTRYx (unsigned int entry_idx, pmp_config *pmp_cfg) |
Get PMP entry by entry idx. More... | |
Functions that related to the RISCV Phyiscal Memory Protection.
Optional physical memory protection (PMP) unit provides per-hart machine-mode control registers to allow physical memory access privileges (read, write, execute) to be specified for each physical memory region.
The PMP can supports region access control settings as small as four bytes.
__STATIC_INLINE rv_csr_t __get_PMPADDRx | ( | uint32_t | csr_idx | ) |
Get PMPADDRx Register by CSR index.
Return the content of the PMPADDRx Register.
[in] | csr_idx | PMP region CSR index(0-15) |
Definition at line 206 of file core_feature_pmp.h.
References __RV_CSR_READ, CSR_PMPADDR0, CSR_PMPADDR1, CSR_PMPADDR10, CSR_PMPADDR11, CSR_PMPADDR12, CSR_PMPADDR13, CSR_PMPADDR14, CSR_PMPADDR15, CSR_PMPADDR2, CSR_PMPADDR3, CSR_PMPADDR4, CSR_PMPADDR5, CSR_PMPADDR6, CSR_PMPADDR7, CSR_PMPADDR8, and CSR_PMPADDR9.
Referenced by __get_PMPENTRYx().
__STATIC_INLINE rv_csr_t __get_PMPCFGx | ( | uint32_t | csr_idx | ) |
Get PMPCFGx Register by csr index.
Return the content of the PMPCFGx Register.
[in] | csr_idx | PMPCFG CSR index(0-3) |
Definition at line 89 of file core_feature_pmp.h.
References __RV_CSR_READ, CSR_PMPCFG0, CSR_PMPCFG1, CSR_PMPCFG2, and CSR_PMPCFG3.
Referenced by __get_PMPENTRYx(), __get_PMPxCFG(), __set_PMPENTRYx(), and __set_PMPxCFG().
__STATIC_INLINE int __get_PMPENTRYx | ( | unsigned int | entry_idx, |
pmp_config * | pmp_cfg | ||
) |
Get PMP entry by entry idx.
Write the given value to the PMPxCFG Register and PMPADDRx.
[in] | entry_idx | PMP entry index(0-15) |
[out] | pmp_cfg | structure of L, X, W, R, A field of PMP configuration register, memory region base address and size of memory region as power of 2 |
Definition at line 330 of file core_feature_pmp.h.
References __CTZ(), __get_PMPADDRx(), __get_PMPCFGx(), PMP_A, PMP_A_NAPOT, and PMP_SHIFT.
__STATIC_INLINE uint8_t __get_PMPxCFG | ( | uint32_t | entry_idx | ) |
Get 8bit PMPxCFG Register by PMP entry index.
Return the content of the PMPxCFG Register.
[in] | entry_idx | PMP region index(0-15) |
Definition at line 129 of file core_feature_pmp.h.
References __get_PMPCFGx().
__STATIC_INLINE void __set_PMPADDRx | ( | uint32_t | csr_idx, |
rv_csr_t | pmpaddr | ||
) |
Set PMPADDRx by CSR index.
Write the given value to the PMPADDRx Register.
[in] | csr_idx | PMP region CSR index(0-15) |
[in] | pmpaddr | PMPADDRx Register value to set |
Definition at line 235 of file core_feature_pmp.h.
References __RV_CSR_WRITE, CSR_PMPADDR0, CSR_PMPADDR1, CSR_PMPADDR10, CSR_PMPADDR11, CSR_PMPADDR12, CSR_PMPADDR13, CSR_PMPADDR14, CSR_PMPADDR15, CSR_PMPADDR2, CSR_PMPADDR3, CSR_PMPADDR4, CSR_PMPADDR5, CSR_PMPADDR6, CSR_PMPADDR7, CSR_PMPADDR8, and CSR_PMPADDR9.
Referenced by __set_PMPENTRYx().
__STATIC_INLINE void __set_PMPCFGx | ( | uint32_t | csr_idx, |
rv_csr_t | pmpcfg | ||
) |
Set PMPCFGx by csr index.
Write the given value to the PMPCFGx Register.
[in] | csr_idx | PMPCFG CSR index(0-3) |
[in] | pmpcfg | PMPCFGx Register value to set |
Definition at line 112 of file core_feature_pmp.h.
References __RV_CSR_WRITE, CSR_PMPCFG0, CSR_PMPCFG1, CSR_PMPCFG2, and CSR_PMPCFG3.
Referenced by __set_PMPENTRYx(), and __set_PMPxCFG().
__STATIC_INLINE void __set_PMPENTRYx | ( | uint32_t | entry_idx, |
const pmp_config * | pmp_cfg | ||
) |
Set PMP entry by entry idx.
Write the given value to the PMPxCFG Register and PMPADDRx.
[in] | entry_idx | PMP entry index(0-15) |
[in] | pmp_cfg | structure of L, X, W, R field of PMP configuration register, memory region base address and size of memory region as power of 2 |
Definition at line 269 of file core_feature_pmp.h.
References __get_PMPCFGx(), __RISCV_XLEN, __set_PMPADDRx(), __set_PMPCFGx(), PMP_A_NA4, PMP_A_NAPOT, and PMP_SHIFT.
__STATIC_INLINE void __set_PMPxCFG | ( | uint32_t | entry_idx, |
uint8_t | pmpxcfg | ||
) |
Set 8bit PMPxCFG by pmp entry index.
Set the given pmpxcfg value to the PMPxCFG Register.
[in] | entry_idx | PMPx region index(0-15) |
[in] | pmpxcfg | PMPxCFG register value to set |
Definition at line 169 of file core_feature_pmp.h.
References __get_PMPCFGx(), and __set_PMPCFGx().