![]() |
NMSIS-Core
Version 1.0.0-HummingBird
NMSIS-Core support for HummingBird RISC-V processor-based devices
|
Functions that manage interrupts and exceptions via the PLIC. More...
Enumerations | |
enum | IRQn { Reserved0_IRQn = 0, Reserved1_IRQn = 1, Reserved2_IRQn = 2, SysTimerSW_IRQn = 3, Reserved4_IRQn = 4, Reserved5_IRQn = 5, Reserved6_IRQn = 6, SysTimer_IRQn = 7, Reserved8_IRQn = 8, Reserved9_IRQn = 9, Reserved10_IRQn = 10, Reserved11_IRQn = 11, Reserved12_IRQn = 12, Reserved13_IRQn = 13, Reserved14_IRQn = 14, Reserved15_IRQn = 15, PLIC_INT0_IRQn = 0, PLIC_INT1_IRQn = 1, PLIC_INT_MAX } |
Definition of IRQn numbers. More... | |
Functions | |
__STATIC_FORCEINLINE void | PLIC_SetThreshold (uint32_t thresh) |
Set priority threshold value of plic. More... | |
__STATIC_FORCEINLINE uint32_t | PLIC_GetThreshold (void) |
Get priority threshold value of plic. More... | |
__STATIC_FORCEINLINE void | PLIC_EnableInterrupt (uint32_t source) |
Enable interrupt for selected source plic. More... | |
__STATIC_FORCEINLINE void | PLIC_DisableInterrupt (uint32_t source) |
Disable interrupt for selected source plic. More... | |
__STATIC_FORCEINLINE uint32_t | PLIC_GetInterruptEnable (uint32_t source) |
Get interrupt enable status for selected source plic. More... | |
__STATIC_FORCEINLINE void | PLIC_SetPriority (uint32_t source, uint32_t priority) |
Set interrupt priority for selected source plic. More... | |
__STATIC_FORCEINLINE uint32_t | PLIC_GetPriority (uint32_t source, uint32_t priority) |
Get interrupt priority for selected source plic. More... | |
__STATIC_FORCEINLINE uint32_t | PLIC_ClaimInterrupt (void) |
Claim interrupt for plic of current hart. More... | |
__STATIC_FORCEINLINE void | PLIC_CompleteInterrupt (uint32_t source) |
Complete interrupt for plic of current hart. More... | |
__STATIC_FORCEINLINE void | PLIC_Init (uint32_t num_sources) |
Perform init for plic of current hart. More... | |
__STATIC_FORCEINLINE void | __set_trap_entry (rv_csr_t addr) |
Set Trap entry address. More... | |
__STATIC_FORCEINLINE rv_csr_t | __get_trap_entry (void) |
Get trap entry address. More... | |
Functions that manage interrupts and exceptions via the PLIC.
enum IRQn |
Definition of IRQn numbers.
The core interrupt enumeration names for IRQn values are defined in the file <Device>.h.
The table below describes the core interrupt names and their availability in various Nuclei Cores.
Definition at line 95 of file core_feature_plic.h.
__STATIC_FORCEINLINE rv_csr_t __get_trap_entry | ( | void | ) |
Get trap entry address.
This function get trap entry address from 'CSR_MTVEC'.
Definition at line 351 of file core_feature_plic.h.
References __RV_CSR_READ, and CSR_MTVEC.
__STATIC_FORCEINLINE void __set_trap_entry | ( | rv_csr_t | addr | ) |
Set Trap entry address.
This function set trap entry address to 'CSR_MTVEC'.
[in] | addr | trap entry address |
Definition at line 335 of file core_feature_plic.h.
References __RV_CSR_WRITE, and CSR_MTVEC.
__STATIC_FORCEINLINE uint32_t PLIC_ClaimInterrupt | ( | void | ) |
Claim interrupt for plic of current hart.
This function claim interrupt for plic of current hart.
Definition at line 271 of file core_feature_plic.h.
References __RV_CSR_READ, CSR_MHARTID, PLIC_BASE, PLIC_CLAIM_OFFSET, and PLIC_CLAIM_SHIFT_PER_TARGET.
Referenced by core_trap_handler().
__STATIC_FORCEINLINE void PLIC_CompleteInterrupt | ( | uint32_t | source | ) |
Complete interrupt for plic of current hart.
This function complete interrupt for plic of current hart.
Definition at line 296 of file core_feature_plic.h.
References __RV_CSR_READ, CSR_MHARTID, PLIC_BASE, PLIC_CLAIM_OFFSET, and PLIC_CLAIM_SHIFT_PER_TARGET.
Referenced by core_trap_handler().
__STATIC_FORCEINLINE void PLIC_DisableInterrupt | ( | uint32_t | source | ) |
Disable interrupt for selected source plic.
This function disable interrupt for selected source plic of current hart.
[in] | source | interrupt source |
Definition at line 189 of file core_feature_plic.h.
References __RV_CSR_READ, CSR_MHARTID, PLIC_BASE, PLIC_ENABLE_OFFSET, and PLIC_ENABLE_SHIFT_PER_TARGET.
Referenced by PLIC_Init().
__STATIC_FORCEINLINE void PLIC_EnableInterrupt | ( | uint32_t | source | ) |
Enable interrupt for selected source plic.
This function enable interrupt for selected source plic of current hart.
[in] | source | interrupt source |
Definition at line 169 of file core_feature_plic.h.
References __RV_CSR_READ, CSR_MHARTID, PLIC_BASE, PLIC_ENABLE_OFFSET, and PLIC_ENABLE_SHIFT_PER_TARGET.
Referenced by PLIC_Register_IRQ().
__STATIC_FORCEINLINE uint32_t PLIC_GetInterruptEnable | ( | uint32_t | source | ) |
Get interrupt enable status for selected source plic.
This function get interrupt enable for selected source plic of current hart.
[in] | source | interrupt source |
Definition at line 211 of file core_feature_plic.h.
References __RV_CSR_READ, CSR_MHARTID, PLIC_BASE, PLIC_ENABLE_OFFSET, and PLIC_ENABLE_SHIFT_PER_TARGET.
__STATIC_FORCEINLINE uint32_t PLIC_GetPriority | ( | uint32_t | source, |
uint32_t | priority | ||
) |
Get interrupt priority for selected source plic.
This function get interrupt priority for selected source plic of current hart.
[in] | source | interrupt source |
[in] | priority | interrupt priority |
Definition at line 250 of file core_feature_plic.h.
References PLIC_BASE, PLIC_PRIORITY_OFFSET, and PLIC_PRIORITY_SHIFT_PER_SOURCE.
__STATIC_FORCEINLINE uint32_t PLIC_GetThreshold | ( | void | ) |
Get priority threshold value of plic.
This function get priority threshold value of plic.
Definition at line 151 of file core_feature_plic.h.
References __RV_CSR_READ, CSR_MHARTID, PLIC_BASE, and PLIC_THRESHOLD_SHIFT_PER_TARGET.
__STATIC_FORCEINLINE void PLIC_Init | ( | uint32_t | num_sources | ) |
Perform init for plic of current hart.
This function perform initialization steps for plic of current hart.
Definition at line 314 of file core_feature_plic.h.
References PLIC_DisableInterrupt(), PLIC_SetPriority(), and PLIC_SetThreshold().
__STATIC_FORCEINLINE void PLIC_SetPriority | ( | uint32_t | source, |
uint32_t | priority | ||
) |
Set interrupt priority for selected source plic.
This function set interrupt priority for selected source plic of current hart.
[in] | source | interrupt source |
[in] | priority | interrupt priority |
Definition at line 232 of file core_feature_plic.h.
References PLIC_BASE, PLIC_PRIORITY_OFFSET, and PLIC_PRIORITY_SHIFT_PER_SOURCE.
Referenced by PLIC_Init(), and PLIC_Register_IRQ().
__STATIC_FORCEINLINE void PLIC_SetThreshold | ( | uint32_t | thresh | ) |
Set priority threshold value of plic.
This function set priority threshold value of plic for current hart.
[in] | thresh | threshold value |
Definition at line 133 of file core_feature_plic.h.
References __RV_CSR_READ, CSR_MHARTID, PLIC_BASE, and PLIC_THRESHOLD_SHIFT_PER_TARGET.
Referenced by PLIC_Init().