NMSIS-Core  Version 1.2.0
NMSIS-Core support for Nuclei processor-based devices
Interrupts and Exceptions

Functions that manage interrupts and exceptions via the ECLIC. More...

Macros

#define ECLIC_SetCfgNlbits   __ECLIC_SetCfgNlbits
 
#define ECLIC_GetCfgNlbits   __ECLIC_GetCfgNlbits
 
#define ECLIC_GetInfoVer   __ECLIC_GetInfoVer
 
#define ECLIC_GetInfoCtlbits   __ECLIC_GetInfoCtlbits
 
#define ECLIC_GetInfoNum   __ECLIC_GetInfoNum
 
#define ECLIC_SetMth   __ECLIC_SetMth
 
#define ECLIC_GetMth   __ECLIC_GetMth
 
#define ECLIC_EnableIRQ   __ECLIC_EnableIRQ
 
#define ECLIC_GetEnableIRQ   __ECLIC_GetEnableIRQ
 
#define ECLIC_DisableIRQ   __ECLIC_DisableIRQ
 
#define ECLIC_SetPendingIRQ   __ECLIC_SetPendingIRQ
 
#define ECLIC_GetPendingIRQ   __ECLIC_GetPendingIRQ
 
#define ECLIC_ClearPendingIRQ   __ECLIC_ClearPendingIRQ
 
#define ECLIC_SetTrigIRQ   __ECLIC_SetTrigIRQ
 
#define ECLIC_GetTrigIRQ   __ECLIC_GetTrigIRQ
 
#define ECLIC_SetShvIRQ   __ECLIC_SetShvIRQ
 
#define ECLIC_GetShvIRQ   __ECLIC_GetShvIRQ
 
#define ECLIC_SetCtrlIRQ   __ECLIC_SetCtrlIRQ
 
#define ECLIC_GetCtrlIRQ   __ECLIC_GetCtrlIRQ
 
#define ECLIC_SetLevelIRQ   __ECLIC_SetLevelIRQ
 
#define ECLIC_GetLevelIRQ   __ECLIC_GetLevelIRQ
 
#define ECLIC_SetPriorityIRQ   __ECLIC_SetPriorityIRQ
 
#define ECLIC_GetPriorityIRQ   __ECLIC_GetPriorityIRQ
 
#define ECLIC_SetModeIRQ   __ECLIC_SetModeIRQ
 
#define ECLIC_SetSth   __ECLIC_SetSth
 
#define ECLIC_GetSth   __ECLIC_GetSth
 
#define ECLIC_SetTrigIRQ_S   __ECLIC_SetTrigIRQ_S
 
#define ECLIC_GetTrigIRQ_S   __ECLIC_GetTrigIRQ_S
 
#define ECLIC_SetShvIRQ_S   __ECLIC_SetShvIRQ_S
 
#define ECLIC_GetShvIRQ_S   __ECLIC_GetShvIRQ_S
 
#define ECLIC_SetCtrlIRQ_S   __ECLIC_SetCtrlIRQ_S
 
#define ECLIC_GetCtrlIRQ_S   __ECLIC_GetCtrlIRQ_S
 
#define ECLIC_SetLevelIRQ_S   __ECLIC_SetLevelIRQ_S
 
#define ECLIC_GetLevelIRQ_S   __ECLIC_GetLevelIRQ_S
 
#define ECLIC_SetPriorityIRQ_S   __ECLIC_SetPriorityIRQ_S
 
#define ECLIC_GetPriorityIRQ_S   __ECLIC_GetPriorityIRQ_S
 
#define ECLIC_EnableIRQ_S   __ECLIC_EnableIRQ_S
 
#define ECLIC_GetEnableIRQ_S   __ECLIC_GetEnableIRQ_S
 
#define ECLIC_DisableIRQ_S   __ECLIC_DisableIRQ_S
 
#define ECLIC_SetVector   __ECLIC_SetVector
 
#define ECLIC_GetVector   __ECLIC_GetVector
 
#define ECLIC_SetVector_S   __ECLIC_SetVector_S
 
#define ECLIC_GetVector_S   __ECLIC_GetVector_S
 
#define SAVE_IRQ_CSR_CONTEXT()
 Save necessary CSRs into variables for vector interrupt nesting. More...
 
#define SAVE_IRQ_CSR_CONTEXT_S()
 Save necessary CSRs into variables for vector interrupt nesting in supervisor mode. More...
 
#define RESTORE_IRQ_CSR_CONTEXT()
 Restore necessary CSRs from variables for vector interrupt nesting. More...
 
#define RESTORE_IRQ_CSR_CONTEXT_S()
 Restore necessary CSRs from variables for vector interrupt nesting in supervisor mode. More...
 

Enumerations

enum  IRQn {
  Reserved0_IRQn = 0,
  Reserved1_IRQn = 1,
  Reserved2_IRQn = 2,
  SysTimerSW_IRQn = 3,
  Reserved3_IRQn = 4,
  Reserved4_IRQn = 5,
  Reserved5_IRQn = 6,
  SysTimer_IRQn = 7,
  Reserved6_IRQn = 8,
  Reserved7_IRQn = 9,
  Reserved8_IRQn = 10,
  Reserved9_IRQn = 11,
  Reserved10_IRQn = 12,
  Reserved11_IRQn = 13,
  Reserved12_IRQn = 14,
  Reserved13_IRQn = 15,
  Reserved14_IRQn = 16,
  Reserved15_IRQn = 17,
  Reserved16_IRQn = 18,
  FirstDeviceSpecificInterrupt_IRQn = 19,
  SOC_INT_MAX
}
 Definition of IRQn numbers. More...
 

Functions

__STATIC_FORCEINLINE void __ECLIC_SetCfgNlbits (uint32_t nlbits)
 Set nlbits value. More...
 
__STATIC_FORCEINLINE uint32_t __ECLIC_GetCfgNlbits (void)
 Get nlbits value. More...
 
__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoVer (void)
 Get the ECLIC version number. More...
 
__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoCtlbits (void)
 Get CLICINTCTLBITS. More...
 
__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoNum (void)
 Get number of maximum interrupt inputs supported. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetMth (uint8_t mth)
 Set Machine Mode Interrupt Level Threshold. More...
 
__STATIC_FORCEINLINE uint8_t __ECLIC_GetMth (void)
 Get Machine Mode Interrupt Level Threshold. More...
 
__STATIC_FORCEINLINE void __ECLIC_EnableIRQ (IRQn_Type IRQn)
 Enable a specific interrupt. More...
 
__STATIC_FORCEINLINE uint32_t __ECLIC_GetEnableIRQ (IRQn_Type IRQn)
 Get a specific interrupt enable status. More...
 
__STATIC_FORCEINLINE void __ECLIC_DisableIRQ (IRQn_Type IRQn)
 Disable a specific interrupt. More...
 
__STATIC_FORCEINLINE int32_t __ECLIC_GetPendingIRQ (IRQn_Type IRQn)
 Get the pending specific interrupt. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetPendingIRQ (IRQn_Type IRQn)
 Set a specific interrupt to pending. More...
 
__STATIC_FORCEINLINE void __ECLIC_ClearPendingIRQ (IRQn_Type IRQn)
 Clear a specific interrupt from pending. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetTrigIRQ (IRQn_Type IRQn, uint32_t trig)
 Set trigger mode and polarity for a specific interrupt. More...
 
__STATIC_FORCEINLINE uint32_t __ECLIC_GetTrigIRQ (IRQn_Type IRQn)
 Get trigger mode and polarity for a specific interrupt. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetShvIRQ (IRQn_Type IRQn, uint32_t shv)
 Set interrupt working mode for a specific interrupt. More...
 
__STATIC_FORCEINLINE uint32_t __ECLIC_GetShvIRQ (IRQn_Type IRQn)
 Get interrupt working mode for a specific interrupt. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetCtrlIRQ (IRQn_Type IRQn, uint8_t intctrl)
 Modify ECLIC Interrupt Input Control Register for a specific interrupt. More...
 
__STATIC_FORCEINLINE uint8_t __ECLIC_GetCtrlIRQ (IRQn_Type IRQn)
 Get ECLIC Interrupt Input Control Register value for a specific interrupt. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetLevelIRQ (IRQn_Type IRQn, uint8_t lvl_abs)
 Set ECLIC Interrupt level of a specific interrupt. More...
 
__STATIC_FORCEINLINE uint8_t __ECLIC_GetLevelIRQ (IRQn_Type IRQn)
 Get ECLIC Interrupt level of a specific interrupt. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetPriorityIRQ (IRQn_Type IRQn, uint8_t pri)
 Get ECLIC Interrupt priority of a specific interrupt. More...
 
__STATIC_FORCEINLINE uint8_t __ECLIC_GetPriorityIRQ (IRQn_Type IRQn)
 Get ECLIC Interrupt priority of a specific interrupt. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetVector (IRQn_Type IRQn, rv_csr_t vector)
 Set Interrupt Vector of a specific interrupt. More...
 
__STATIC_FORCEINLINE rv_csr_t __ECLIC_GetVector (IRQn_Type IRQn)
 Get Interrupt Vector of a specific interrupt. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetModeIRQ (IRQn_Type IRQn, uint32_t mode)
 Set privilege mode of a specific interrupt. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetSth (uint8_t sth)
 Set supervisor-mode Interrupt Level Threshold in supervisor mode. More...
 
__STATIC_FORCEINLINE uint8_t __ECLIC_GetSth (void)
 Get supervisor-mode Interrupt Level Threshold in supervisor mode. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetTrigIRQ_S (IRQn_Type IRQn, uint32_t trig)
 Set trigger mode and polarity for a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE uint8_t __ECLIC_GetTrigIRQ_S (IRQn_Type IRQn)
 Get trigger mode and polarity for a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetShvIRQ_S (IRQn_Type IRQn, uint32_t shv)
 Set interrupt working mode for a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE uint8_t __ECLIC_GetShvIRQ_S (IRQn_Type IRQn)
 Get interrupt working mode for a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetCtrlIRQ_S (IRQn_Type IRQn, uint8_t intctrl)
 Modify ECLIC Interrupt Input Control Register for a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE uint8_t __ECLIC_GetCtrlIRQ_S (IRQn_Type IRQn)
 Get ECLIC Interrupt Input Control Register value for a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetLevelIRQ_S (IRQn_Type IRQn, uint8_t lvl_abs)
 Set ECLIC Interrupt level of a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE uint8_t __ECLIC_GetLevelIRQ_S (IRQn_Type IRQn)
 Get ECLIC Interrupt level of a specific interrupt. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetPriorityIRQ_S (IRQn_Type IRQn, uint8_t pri)
 Set ECLIC Interrupt priority of a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE uint8_t __ECLIC_GetPriorityIRQ_S (IRQn_Type IRQn)
 Get ECLIC Interrupt priority of a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE void __ECLIC_EnableIRQ_S (IRQn_Type IRQn)
 Enable a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE uint8_t __ECLIC_GetEnableIRQ_S (IRQn_Type IRQn)
 Get a specific interrupt enable status in supervisor mode. More...
 
__STATIC_FORCEINLINE void __ECLIC_DisableIRQ_S (IRQn_Type IRQn)
 Disable a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE void __ECLIC_SetVector_S (IRQn_Type IRQn, rv_csr_t vector)
 Set Interrupt Vector of a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE rv_csr_t __ECLIC_GetVector_S (IRQn_Type IRQn)
 Get Interrupt Vector of a specific interrupt in supervisor mode. More...
 
__STATIC_FORCEINLINE void __set_exc_entry (rv_csr_t addr)
 Set Exception entry address. More...
 
__STATIC_FORCEINLINE rv_csr_t __get_exc_entry (void)
 Get Exception entry address. More...
 
__STATIC_FORCEINLINE void __set_nonvec_entry (rv_csr_t addr)
 Set Non-vector interrupt entry address. More...
 
__STATIC_FORCEINLINE rv_csr_t __get_nonvec_entry (void)
 Get Non-vector interrupt entry address. More...
 
__STATIC_FORCEINLINE rv_csr_t __get_nmi_entry (void)
 Get NMI interrupt entry from 'CSR_MNVEC'. More...
 

Detailed Description

Functions that manage interrupts and exceptions via the ECLIC.

Macro Definition Documentation

◆ ECLIC_ClearPendingIRQ

#define ECLIC_ClearPendingIRQ   __ECLIC_ClearPendingIRQ

Definition at line 254 of file core_feature_eclic.h.

◆ ECLIC_DisableIRQ

#define ECLIC_DisableIRQ   __ECLIC_DisableIRQ

Definition at line 251 of file core_feature_eclic.h.

◆ ECLIC_DisableIRQ_S

#define ECLIC_DisableIRQ_S   __ECLIC_DisableIRQ_S

Definition at line 283 of file core_feature_eclic.h.

◆ ECLIC_EnableIRQ

#define ECLIC_EnableIRQ   __ECLIC_EnableIRQ

Definition at line 249 of file core_feature_eclic.h.

◆ ECLIC_EnableIRQ_S

#define ECLIC_EnableIRQ_S   __ECLIC_EnableIRQ_S

Definition at line 281 of file core_feature_eclic.h.

◆ ECLIC_GetCfgNlbits

#define ECLIC_GetCfgNlbits   __ECLIC_GetCfgNlbits

Definition at line 243 of file core_feature_eclic.h.

◆ ECLIC_GetCtrlIRQ

#define ECLIC_GetCtrlIRQ   __ECLIC_GetCtrlIRQ

Definition at line 260 of file core_feature_eclic.h.

◆ ECLIC_GetCtrlIRQ_S

#define ECLIC_GetCtrlIRQ_S   __ECLIC_GetCtrlIRQ_S

Definition at line 276 of file core_feature_eclic.h.

◆ ECLIC_GetEnableIRQ

#define ECLIC_GetEnableIRQ   __ECLIC_GetEnableIRQ

Definition at line 250 of file core_feature_eclic.h.

◆ ECLIC_GetEnableIRQ_S

#define ECLIC_GetEnableIRQ_S   __ECLIC_GetEnableIRQ_S

Definition at line 282 of file core_feature_eclic.h.

◆ ECLIC_GetInfoCtlbits

#define ECLIC_GetInfoCtlbits   __ECLIC_GetInfoCtlbits

Definition at line 245 of file core_feature_eclic.h.

◆ ECLIC_GetInfoNum

#define ECLIC_GetInfoNum   __ECLIC_GetInfoNum

Definition at line 246 of file core_feature_eclic.h.

◆ ECLIC_GetInfoVer

#define ECLIC_GetInfoVer   __ECLIC_GetInfoVer

Definition at line 244 of file core_feature_eclic.h.

◆ ECLIC_GetLevelIRQ

#define ECLIC_GetLevelIRQ   __ECLIC_GetLevelIRQ

Definition at line 262 of file core_feature_eclic.h.

◆ ECLIC_GetLevelIRQ_S

#define ECLIC_GetLevelIRQ_S   __ECLIC_GetLevelIRQ_S

Definition at line 278 of file core_feature_eclic.h.

◆ ECLIC_GetMth

#define ECLIC_GetMth   __ECLIC_GetMth

Definition at line 248 of file core_feature_eclic.h.

◆ ECLIC_GetPendingIRQ

#define ECLIC_GetPendingIRQ   __ECLIC_GetPendingIRQ

Definition at line 253 of file core_feature_eclic.h.

◆ ECLIC_GetPriorityIRQ

#define ECLIC_GetPriorityIRQ   __ECLIC_GetPriorityIRQ

Definition at line 264 of file core_feature_eclic.h.

◆ ECLIC_GetPriorityIRQ_S

#define ECLIC_GetPriorityIRQ_S   __ECLIC_GetPriorityIRQ_S

Definition at line 280 of file core_feature_eclic.h.

◆ ECLIC_GetShvIRQ

#define ECLIC_GetShvIRQ   __ECLIC_GetShvIRQ

Definition at line 258 of file core_feature_eclic.h.

◆ ECLIC_GetShvIRQ_S

#define ECLIC_GetShvIRQ_S   __ECLIC_GetShvIRQ_S

Definition at line 274 of file core_feature_eclic.h.

◆ ECLIC_GetSth

#define ECLIC_GetSth   __ECLIC_GetSth

Definition at line 270 of file core_feature_eclic.h.

◆ ECLIC_GetTrigIRQ

#define ECLIC_GetTrigIRQ   __ECLIC_GetTrigIRQ

Definition at line 256 of file core_feature_eclic.h.

◆ ECLIC_GetTrigIRQ_S

#define ECLIC_GetTrigIRQ_S   __ECLIC_GetTrigIRQ_S

Definition at line 272 of file core_feature_eclic.h.

◆ ECLIC_GetVector

#define ECLIC_GetVector   __ECLIC_GetVector

Definition at line 295 of file core_feature_eclic.h.

◆ ECLIC_GetVector_S

#define ECLIC_GetVector_S   __ECLIC_GetVector_S

Definition at line 299 of file core_feature_eclic.h.

◆ ECLIC_SetCfgNlbits

#define ECLIC_SetCfgNlbits   __ECLIC_SetCfgNlbits

Definition at line 242 of file core_feature_eclic.h.

◆ ECLIC_SetCtrlIRQ

#define ECLIC_SetCtrlIRQ   __ECLIC_SetCtrlIRQ

Definition at line 259 of file core_feature_eclic.h.

◆ ECLIC_SetCtrlIRQ_S

#define ECLIC_SetCtrlIRQ_S   __ECLIC_SetCtrlIRQ_S

Definition at line 275 of file core_feature_eclic.h.

◆ ECLIC_SetLevelIRQ

#define ECLIC_SetLevelIRQ   __ECLIC_SetLevelIRQ

Definition at line 261 of file core_feature_eclic.h.

◆ ECLIC_SetLevelIRQ_S

#define ECLIC_SetLevelIRQ_S   __ECLIC_SetLevelIRQ_S

Definition at line 277 of file core_feature_eclic.h.

◆ ECLIC_SetModeIRQ

#define ECLIC_SetModeIRQ   __ECLIC_SetModeIRQ

Definition at line 268 of file core_feature_eclic.h.

◆ ECLIC_SetMth

#define ECLIC_SetMth   __ECLIC_SetMth

Definition at line 247 of file core_feature_eclic.h.

◆ ECLIC_SetPendingIRQ

#define ECLIC_SetPendingIRQ   __ECLIC_SetPendingIRQ

Definition at line 252 of file core_feature_eclic.h.

◆ ECLIC_SetPriorityIRQ

#define ECLIC_SetPriorityIRQ   __ECLIC_SetPriorityIRQ

Definition at line 263 of file core_feature_eclic.h.

◆ ECLIC_SetPriorityIRQ_S

#define ECLIC_SetPriorityIRQ_S   __ECLIC_SetPriorityIRQ_S

Definition at line 279 of file core_feature_eclic.h.

◆ ECLIC_SetShvIRQ

#define ECLIC_SetShvIRQ   __ECLIC_SetShvIRQ

Definition at line 257 of file core_feature_eclic.h.

◆ ECLIC_SetShvIRQ_S

#define ECLIC_SetShvIRQ_S   __ECLIC_SetShvIRQ_S

Definition at line 273 of file core_feature_eclic.h.

◆ ECLIC_SetSth

#define ECLIC_SetSth   __ECLIC_SetSth

Definition at line 269 of file core_feature_eclic.h.

◆ ECLIC_SetTrigIRQ

#define ECLIC_SetTrigIRQ   __ECLIC_SetTrigIRQ

Definition at line 255 of file core_feature_eclic.h.

◆ ECLIC_SetTrigIRQ_S

#define ECLIC_SetTrigIRQ_S   __ECLIC_SetTrigIRQ_S

Definition at line 271 of file core_feature_eclic.h.

◆ ECLIC_SetVector

#define ECLIC_SetVector   __ECLIC_SetVector

Definition at line 294 of file core_feature_eclic.h.

◆ ECLIC_SetVector_S

#define ECLIC_SetVector_S   __ECLIC_SetVector_S

Definition at line 298 of file core_feature_eclic.h.

◆ RESTORE_IRQ_CSR_CONTEXT

#define RESTORE_IRQ_CSR_CONTEXT ( )

Restore necessary CSRs from variables for vector interrupt nesting.

This macro is used restore CSRs(MCAUSE, MEPC, MSUB) from pre-defined variables in SAVE_IRQ_CSR_CONTEXT macro.

Remarks
  • Interrupt will be disabled after this macro is called
  • It need to be used together with SAVE_IRQ_CSR_CONTEXT

Definition at line 1356 of file core_feature_eclic.h.

◆ RESTORE_IRQ_CSR_CONTEXT_S

#define RESTORE_IRQ_CSR_CONTEXT_S ( )

Restore necessary CSRs from variables for vector interrupt nesting in supervisor mode.

Definition at line 1363 of file core_feature_eclic.h.

◆ SAVE_IRQ_CSR_CONTEXT

#define SAVE_IRQ_CSR_CONTEXT ( )

Save necessary CSRs into variables for vector interrupt nesting.

This macro is used to declare variables which are used for saving CSRs(MCAUSE, MEPC, MSUB), and it will read these CSR content into these variables, it need to be used in a vector-interrupt if nesting is required.

Remarks
  • Interrupt will be enabled after this macro is called
  • It need to be used together with RESTORE_IRQ_CSR_CONTEXT
  • Don't use variable names __mcause, __mpec, __msubm in your ISR code
  • If you want to enable interrupt nesting feature for vector interrupt, you can do it like this:
    // __INTERRUPT attribute will generates function entry and exit sequences suitable
    // for use in an interrupt handler when this attribute is present
    __INTERRUPT void eclic_mtip_handler(void)
    {
    // Must call this to save CSRs
    // !!!Interrupt is enabled here!!!
    // !!!Higher priority interrupt could nest it!!!
    // put you own interrupt handling code here
    // Must call this to restore CSRs
    }

Definition at line 1334 of file core_feature_eclic.h.

◆ SAVE_IRQ_CSR_CONTEXT_S

#define SAVE_IRQ_CSR_CONTEXT_S ( )

Save necessary CSRs into variables for vector interrupt nesting in supervisor mode.

Definition at line 1341 of file core_feature_eclic.h.

Enumeration Type Documentation

◆ IRQn

enum IRQn

Definition of IRQn numbers.

The core interrupt enumeration names for IRQn values are defined in the file <Device>.h.

  • Interrupt ID(IRQn) from 0 to 18 are reserved for core internal interrupts.
  • Interrupt ID(IRQn) start from 19 represent device-specific external interrupts.
  • The first device-specific interrupt has the IRQn value 19.

The table below describes the core interrupt names and their availability in various Nuclei Cores.

Enumerator
Reserved0_IRQn 

Internal reserved.

Reserved1_IRQn 

Internal reserved.

Reserved2_IRQn 

Internal reserved.

SysTimerSW_IRQn 

System Timer SW interrupt.

Reserved3_IRQn 

Internal reserved.

Reserved4_IRQn 

Internal reserved.

Reserved5_IRQn 

Internal reserved.

SysTimer_IRQn 

System Timer Interrupt.

Reserved6_IRQn 

Internal reserved.

Reserved7_IRQn 

Internal reserved.

Reserved8_IRQn 

Internal reserved.

Reserved9_IRQn 

Internal reserved.

Reserved10_IRQn 

Internal reserved.

Reserved11_IRQn 

Internal reserved.

Reserved12_IRQn 

Internal reserved.

Reserved13_IRQn 

Internal reserved.

Reserved14_IRQn 

Internal reserved.

Reserved15_IRQn 

Internal reserved.

Reserved16_IRQn 

Internal reserved.

FirstDeviceSpecificInterrupt_IRQn 

First Device Specific Interrupt.

SOC_INT_MAX 

Number of total interrupts.

Definition at line 202 of file core_feature_eclic.h.

202  {
203  /* ========= Nuclei N/NX Core Specific Interrupt Numbers =========== */
204  /* Core Internal Interrupt IRQn definitions */
205  Reserved0_IRQn = 0,
206  Reserved1_IRQn = 1,
207  Reserved2_IRQn = 2,
208  SysTimerSW_IRQn = 3,
209  Reserved3_IRQn = 4,
210  Reserved4_IRQn = 5,
211  Reserved5_IRQn = 6,
212  SysTimer_IRQn = 7,
213  Reserved6_IRQn = 8,
214  Reserved7_IRQn = 9,
215  Reserved8_IRQn = 10,
216  Reserved9_IRQn = 11,
217  Reserved10_IRQn = 12,
218  Reserved11_IRQn = 13,
219  Reserved12_IRQn = 14,
220  Reserved13_IRQn = 15,
221  Reserved14_IRQn = 16,
222  Reserved15_IRQn = 17,
223  Reserved16_IRQn = 18,
225  /* ========= Device Specific Interrupt Numbers =================== */
226  /* ToDo: add here your device specific external interrupt numbers.
227  * 19~max(NUM_INTERRUPT, 1023) is reserved number for user.
228  * Maxmum interrupt supported could get from clicinfo.NUM_INTERRUPT.
229  * According the interrupt handlers defined in startup_Device.S
230  * eg.: Interrupt for Timer#1 eclic_tim1_handler -> TIM1_IRQn */
232  SOC_INT_MAX,
233 } IRQn_Type;

Function Documentation

◆ __ECLIC_ClearPendingIRQ()

__STATIC_FORCEINLINE void __ECLIC_ClearPendingIRQ ( IRQn_Type  IRQn)

Clear a specific interrupt from pending.

This function removes the pending state of the specific interrupt IRQn. IRQn cannot be a negative number.

Parameters
[in]IRQnInterrupt number
Remarks
  • IRQn must not be negative.
See also

Definition at line 506 of file core_feature_eclic.h.

507 {
508  ECLIC->CTRL[IRQn].INTIP &= ~CLIC_INTIP_IP_Msk;
509 }

References CLIC_INTIP_IP_Msk, and ECLIC.

◆ __ECLIC_DisableIRQ()

__STATIC_FORCEINLINE void __ECLIC_DisableIRQ ( IRQn_Type  IRQn)

Disable a specific interrupt.

This function disables the specific interrupt IRQn.

Parameters
[in]IRQnNumber of the external interrupt to disable
Remarks
  • IRQn must not be negative.
See also

Definition at line 454 of file core_feature_eclic.h.

455 {
456  ECLIC->CTRL[IRQn].INTIE &= ~CLIC_INTIE_IE_Msk;
457 }

References CLIC_INTIE_IE_Msk, and ECLIC.

◆ __ECLIC_DisableIRQ_S()

__STATIC_FORCEINLINE void __ECLIC_DisableIRQ_S ( IRQn_Type  IRQn)

Disable a specific interrupt in supervisor mode.

This function disables the specific interrupt IRQn.

Parameters
[in]IRQnNumber of the external interrupt to disable
Remarks
  • IRQn must not be negative.
See also

Definition at line 1145 of file core_feature_eclic.h.

1146 {
1147  ECLIC->SCTRL[IRQn].INTIE &= ~CLIC_INTIE_IE_Msk;
1148 }

References CLIC_INTIE_IE_Msk, and ECLIC.

◆ __ECLIC_EnableIRQ()

__STATIC_FORCEINLINE void __ECLIC_EnableIRQ ( IRQn_Type  IRQn)

Enable a specific interrupt.

This function enables the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Remarks
  • IRQn must not be negative.
See also

Definition at line 420 of file core_feature_eclic.h.

421 {
422  ECLIC->CTRL[IRQn].INTIE |= CLIC_INTIE_IE_Msk;
423 }

References CLIC_INTIE_IE_Msk, and ECLIC.

◆ __ECLIC_EnableIRQ_S()

__STATIC_FORCEINLINE void __ECLIC_EnableIRQ_S ( IRQn_Type  IRQn)

Enable a specific interrupt in supervisor mode.

This function enables the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Remarks
  • IRQn must not be negative.
See also

Definition at line 1111 of file core_feature_eclic.h.

1112 {
1113  ECLIC->SCTRL[IRQn].INTIE |= CLIC_INTIE_IE_Msk;
1114 }

References CLIC_INTIE_IE_Msk, and ECLIC.

◆ __ECLIC_GetCfgNlbits()

__STATIC_FORCEINLINE uint32_t __ECLIC_GetCfgNlbits ( void  )

Get nlbits value.

This function get the nlbits value of CLICCFG register.

Returns
nlbits value of CLICCFG register
Remarks
  • nlbits is used to set the width of level in the CLICINTCTL[i].
See also

Definition at line 329 of file core_feature_eclic.h.

330 {
331  return ((uint32_t)((ECLIC->CFG & CLIC_CLICCFG_NLBIT_Msk) >> CLIC_CLICCFG_NLBIT_Pos));
332 }

References CLIC_CLICCFG_NLBIT_Msk, CLIC_CLICCFG_NLBIT_Pos, and ECLIC.

Referenced by __ECLIC_GetLevelIRQ(), __ECLIC_GetLevelIRQ_S(), __ECLIC_GetPriorityIRQ(), __ECLIC_GetPriorityIRQ_S(), __ECLIC_SetLevelIRQ(), __ECLIC_SetLevelIRQ_S(), __ECLIC_SetPriorityIRQ(), and __ECLIC_SetPriorityIRQ_S().

◆ __ECLIC_GetCtrlIRQ()

__STATIC_FORCEINLINE uint8_t __ECLIC_GetCtrlIRQ ( IRQn_Type  IRQn)

Get ECLIC Interrupt Input Control Register value for a specific interrupt.

This function modify ECLIC Interrupt Input Control register of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
value of ECLIC Interrupt Input Control register
Remarks
  • IRQn must not be negative.
See also

Definition at line 617 of file core_feature_eclic.h.

618 {
619  return (ECLIC->CTRL[IRQn].INTCTRL);
620 }

References ECLIC.

Referenced by __ECLIC_GetLevelIRQ(), __ECLIC_GetPriorityIRQ(), __ECLIC_SetLevelIRQ(), and __ECLIC_SetPriorityIRQ().

◆ __ECLIC_GetCtrlIRQ_S()

__STATIC_FORCEINLINE uint8_t __ECLIC_GetCtrlIRQ_S ( IRQn_Type  IRQn)

Get ECLIC Interrupt Input Control Register value for a specific interrupt in supervisor mode.

This function modify ECLIC Interrupt Input Control register of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
value of ECLIC Interrupt Input Control register
Remarks
  • IRQn must not be negative.
See also

Definition at line 970 of file core_feature_eclic.h.

971 {
972  return (ECLIC->SCTRL[IRQn].INTCTRL);
973 }

References ECLIC.

Referenced by __ECLIC_GetLevelIRQ_S(), __ECLIC_GetPriorityIRQ_S(), __ECLIC_SetLevelIRQ_S(), and __ECLIC_SetPriorityIRQ_S().

◆ __ECLIC_GetEnableIRQ()

__STATIC_FORCEINLINE uint32_t __ECLIC_GetEnableIRQ ( IRQn_Type  IRQn)

Get a specific interrupt enable status.

This function returns the interrupt enable status for the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
  • 0 Interrupt is not enabled
  • 1 Interrupt is pending
Remarks
  • IRQn must not be negative.
See also

Definition at line 439 of file core_feature_eclic.h.

440 {
441  return ((uint32_t) (ECLIC->CTRL[IRQn].INTIE) & CLIC_INTIE_IE_Msk);
442 }

References CLIC_INTIE_IE_Msk, and ECLIC.

◆ __ECLIC_GetEnableIRQ_S()

__STATIC_FORCEINLINE uint8_t __ECLIC_GetEnableIRQ_S ( IRQn_Type  IRQn)

Get a specific interrupt enable status in supervisor mode.

This function returns the interrupt enable status for the specific interrupt IRQn in S MODE.

Parameters
[in]IRQnInterrupt number
Returns
  • 0 Interrupt is not masked
  • 1 Interrupt is enabled
Remarks
  • IRQn must not be negative.
See also

Definition at line 1130 of file core_feature_eclic.h.

1131 {
1132  return ((uint8_t) (ECLIC->SCTRL[IRQn].INTIE) & CLIC_INTIE_IE_Msk);
1133 }

References CLIC_INTIE_IE_Msk, and ECLIC.

◆ __ECLIC_GetInfoCtlbits()

__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoCtlbits ( void  )

Get CLICINTCTLBITS.

This function gets CLICINTCTLBITS from CLICINFO register.

Returns
CLICINTCTLBITS from CLICINFO register.
Remarks
  • In the CLICINTCTL[i] registers, with 2 <= CLICINTCTLBITS <= 8.
  • The implemented bits are kept left-justified in the most-significant bits of each 8-bit CLICINTCTL[I] register, with the lower unimplemented bits treated as hardwired to 1.
See also

Definition at line 362 of file core_feature_eclic.h.

363 {
364  return ((uint32_t)((ECLIC->INFO & CLIC_CLICINFO_CTLBIT_Msk) >> CLIC_CLICINFO_CTLBIT_Pos));
365 }

References CLIC_CLICINFO_CTLBIT_Msk, CLIC_CLICINFO_CTLBIT_Pos, and ECLIC.

◆ __ECLIC_GetInfoNum()

__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoNum ( void  )

Get number of maximum interrupt inputs supported.

This function gets number of maximum interrupt inputs supported from CLICINFO register.

Returns
number of maximum interrupt inputs supported from CLICINFO register.
Remarks
  • This function gets number of maximum interrupt inputs supported from CLICINFO register.
  • The num_interrupt field specifies the actual number of maximum interrupt inputs supported in this implementation.
See also

Definition at line 378 of file core_feature_eclic.h.

379 {
380  return ((uint32_t)((ECLIC->INFO & CLIC_CLICINFO_NUM_Msk) >> CLIC_CLICINFO_NUM_Pos));
381 }

References CLIC_CLICINFO_NUM_Msk, CLIC_CLICINFO_NUM_Pos, and ECLIC.

◆ __ECLIC_GetInfoVer()

__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoVer ( void  )

Get the ECLIC version number.

This function gets the hardware version information from CLICINFO register.

Returns
hardware version number in CLICINFO register.
Remarks
  • This function gets harware version information from CLICINFO register.
  • Bit 20:17 for architecture version, bit 16:13 for implementation version.
See also

Definition at line 345 of file core_feature_eclic.h.

346 {
347  return ((uint32_t)((ECLIC->INFO & CLIC_CLICINFO_VER_Msk) >> CLIC_CLICINFO_VER_Pos));
348 }

References CLIC_CLICINFO_VER_Msk, CLIC_CLICINFO_VER_Pos, and ECLIC.

◆ __ECLIC_GetLevelIRQ()

__STATIC_FORCEINLINE uint8_t __ECLIC_GetLevelIRQ ( IRQn_Type  IRQn)

Get ECLIC Interrupt level of a specific interrupt.

This function get interrupt level of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
Interrupt level
Remarks
  • IRQn must not be negative.
See also

Definition at line 671 of file core_feature_eclic.h.

672 {
673  uint8_t nlbits = __ECLIC_GetCfgNlbits();
674  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
675 
676  if (nlbits == 0) {
677  return 0;
678  }
679 
680  if (nlbits > intctlbits) {
681  nlbits = intctlbits;
682  }
683  uint8_t intctrl = __ECLIC_GetCtrlIRQ(IRQn);
684  uint8_t lvl_abs = intctrl >> (ECLIC_MAX_NLBITS - nlbits);
685  return lvl_abs;
686 }

References __ECLIC_GetCfgNlbits(), __ECLIC_GetCtrlIRQ(), and ECLIC_MAX_NLBITS.

◆ __ECLIC_GetLevelIRQ_S()

__STATIC_FORCEINLINE uint8_t __ECLIC_GetLevelIRQ_S ( IRQn_Type  IRQn)

Get ECLIC Interrupt level of a specific interrupt.

This function get interrupt level of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
Interrupt level
Remarks
  • IRQn must not be negative.
See also

Definition at line 1025 of file core_feature_eclic.h.

1026 {
1027  uint8_t nlbits = __ECLIC_GetCfgNlbits();
1028  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
1029 
1030  if (nlbits == 0) {
1031  return 0;
1032  }
1033 
1034  if (nlbits > intctlbits) {
1035  nlbits = intctlbits;
1036  }
1037  uint8_t intctrl = __ECLIC_GetCtrlIRQ_S(IRQn);
1038  uint8_t lvl_abs = intctrl >> (ECLIC_MAX_NLBITS - nlbits);
1039  return lvl_abs;
1040 }

References __ECLIC_GetCfgNlbits(), __ECLIC_GetCtrlIRQ_S(), and ECLIC_MAX_NLBITS.

◆ __ECLIC_GetMth()

__STATIC_FORCEINLINE uint8_t __ECLIC_GetMth ( void  )

Get Machine Mode Interrupt Level Threshold.

This function gets machine mode interrupt level threshold.

Returns
Interrupt Level Threshold.
See also

Definition at line 404 of file core_feature_eclic.h.

405 {
406  return (ECLIC->MTH);
407 }

References ECLIC.

◆ __ECLIC_GetPendingIRQ()

__STATIC_FORCEINLINE int32_t __ECLIC_GetPendingIRQ ( IRQn_Type  IRQn)

Get the pending specific interrupt.

This function returns the pending status of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
  • 0 Interrupt is not pending
  • 1 Interrupt is pending
Remarks
  • IRQn must not be negative.
See also

Definition at line 473 of file core_feature_eclic.h.

474 {
475  return ((uint32_t)(ECLIC->CTRL[IRQn].INTIP) & CLIC_INTIP_IP_Msk);
476 }

References CLIC_INTIP_IP_Msk, and ECLIC.

◆ __ECLIC_GetPriorityIRQ()

__STATIC_FORCEINLINE uint8_t __ECLIC_GetPriorityIRQ ( IRQn_Type  IRQn)

Get ECLIC Interrupt priority of a specific interrupt.

This function get interrupt priority of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
Interrupt priority
Remarks
  • IRQn must not be negative.
See also

Definition at line 732 of file core_feature_eclic.h.

733 {
734  uint8_t nlbits = __ECLIC_GetCfgNlbits();
735  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
736  if (nlbits < intctlbits) {
737  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ(IRQn);
738  uint8_t pri = cur_ctrl << nlbits;
739  pri = pri >> nlbits;
740  pri = pri >> (ECLIC_MAX_NLBITS - intctlbits);
741  return pri;
742  } else {
743  return 0;
744  }
745 }

References __ECLIC_GetCfgNlbits(), __ECLIC_GetCtrlIRQ(), and ECLIC_MAX_NLBITS.

◆ __ECLIC_GetPriorityIRQ_S()

__STATIC_FORCEINLINE uint8_t __ECLIC_GetPriorityIRQ_S ( IRQn_Type  IRQn)

Get ECLIC Interrupt priority of a specific interrupt in supervisor mode.

This function get interrupt priority of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
Interrupt priority
Remarks
  • IRQn must not be negative.
See also

Definition at line 1086 of file core_feature_eclic.h.

1087 {
1088  uint8_t nlbits = __ECLIC_GetCfgNlbits();
1089  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
1090  if (nlbits < intctlbits) {
1091  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ_S(IRQn);
1092  uint8_t pri = cur_ctrl << nlbits;
1093  pri = pri >> nlbits;
1094  pri = pri >> (ECLIC_MAX_NLBITS - intctlbits);
1095  return pri;
1096  } else {
1097  return 0;
1098  }
1099 }

References __ECLIC_GetCfgNlbits(), __ECLIC_GetCtrlIRQ_S(), and ECLIC_MAX_NLBITS.

◆ __ECLIC_GetShvIRQ()

__STATIC_FORCEINLINE uint32_t __ECLIC_GetShvIRQ ( IRQn_Type  IRQn)

Get interrupt working mode for a specific interrupt.

This function get selective hardware vector or non-vector working mode of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
shv
Remarks
  • IRQn must not be negative.
See also

Definition at line 585 of file core_feature_eclic.h.

586 {
587  return ((uint32_t)(((ECLIC->CTRL[IRQn].INTATTR) & CLIC_INTATTR_SHV_Msk) >> CLIC_INTATTR_SHV_Pos));
588 }

References CLIC_INTATTR_SHV_Msk, CLIC_INTATTR_SHV_Pos, and ECLIC.

◆ __ECLIC_GetShvIRQ_S()

__STATIC_FORCEINLINE uint8_t __ECLIC_GetShvIRQ_S ( IRQn_Type  IRQn)

Get interrupt working mode for a specific interrupt in supervisor mode.

This function get selective hardware vector or non-vector working mode of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
shv
Remarks
  • IRQn must not be negative.
See also
  • ECLIC_SMODE_SetShvIRQ

Definition at line 938 of file core_feature_eclic.h.

939 {
940  return ((uint8_t)(((ECLIC->SCTRL[IRQn].INTATTR) & CLIC_INTATTR_SHV_Msk) >> CLIC_INTATTR_SHV_Pos));
941 }

References CLIC_INTATTR_SHV_Msk, CLIC_INTATTR_SHV_Pos, and ECLIC.

◆ __ECLIC_GetSth()

__STATIC_FORCEINLINE uint8_t __ECLIC_GetSth ( void  )

Get supervisor-mode Interrupt Level Threshold in supervisor mode.

This function gets supervisor mode interrupt level threshold.

Returns
Interrupt Level Threshold.
Remarks
  • S-mode ECLIC region sintthresh'sth is a mirror to M-mode ECLIC region's mintthresh.sth, and will be updated synchronously, here operate on mintthresh.sth.
See also

Definition at line 858 of file core_feature_eclic.h.

859 {
860  return (ECLIC->STH);
861 }

References ECLIC.

◆ __ECLIC_GetTrigIRQ()

__STATIC_FORCEINLINE uint32_t __ECLIC_GetTrigIRQ ( IRQn_Type  IRQn)

Get trigger mode and polarity for a specific interrupt.

This function get trigger mode and polarity of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
Remarks
  • IRQn must not be negative.
See also

Definition at line 548 of file core_feature_eclic.h.

549 {
550  return ((uint32_t)(((ECLIC->CTRL[IRQn].INTATTR) & CLIC_INTATTR_TRIG_Msk) >> CLIC_INTATTR_TRIG_Pos));
551 }

References CLIC_INTATTR_TRIG_Msk, CLIC_INTATTR_TRIG_Pos, and ECLIC.

◆ __ECLIC_GetTrigIRQ_S()

__STATIC_FORCEINLINE uint8_t __ECLIC_GetTrigIRQ_S ( IRQn_Type  IRQn)

Get trigger mode and polarity for a specific interrupt in supervisor mode.

This function get trigger mode and polarity of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
Remarks
  • IRQn must not be negative.
See also

Definition at line 900 of file core_feature_eclic.h.

901 {
902  return ((uint8_t)(((ECLIC->SCTRL[IRQn].INTATTR) & CLIC_INTATTR_TRIG_Msk) >> CLIC_INTATTR_TRIG_Pos));
903 }

References CLIC_INTATTR_TRIG_Msk, CLIC_INTATTR_TRIG_Pos, and ECLIC.

◆ __ECLIC_GetVector()

__STATIC_FORCEINLINE rv_csr_t __ECLIC_GetVector ( IRQn_Type  IRQn)

Get Interrupt Vector of a specific interrupt.

This function get interrupt handler address of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
Interrupt handler address
Remarks
  • IRQn must not be negative.
  • You can read CSR_CSR_MTVT to get interrupt vector table entry address.
See also

Definition at line 795 of file core_feature_eclic.h.

796 {
797 #if __RISCV_XLEN == 32
798  return (*(uint32_t *)(__RV_CSR_READ(CSR_MTVT) + IRQn * 4));
799 #elif __RISCV_XLEN == 64
800  return (*(uint64_t *)(__RV_CSR_READ(CSR_MTVT) + IRQn * 8));
801 #else // TODO Need cover for XLEN=128 case in future
802  return (*(uint64_t *)(__RV_CSR_READ(CSR_MTVT) + IRQn * 8));
803 #endif
804 }

References __RV_CSR_READ, and CSR_MTVT.

◆ __ECLIC_GetVector_S()

__STATIC_FORCEINLINE rv_csr_t __ECLIC_GetVector_S ( IRQn_Type  IRQn)

Get Interrupt Vector of a specific interrupt in supervisor mode.

This function get interrupt handler address of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Returns
Interrupt handler address
Remarks
  • IRQn must not be negative.
  • You can read CSR_CSR_MTVT to get interrupt vector table entry address.
See also
  • ECLIC_SMODE_SetVector

Definition at line 1198 of file core_feature_eclic.h.

1199 {
1200 #if __RISCV_XLEN == 32
1201  return (*(uint32_t *)(__RV_CSR_READ(CSR_STVT) + IRQn * 4));
1202 #elif __RISCV_XLEN == 64
1203  return (*(uint64_t *)(__RV_CSR_READ(CSR_STVT) + IRQn * 8));
1204 #else // TODO Need cover for XLEN=128 case in future
1205  return (*(uint64_t *)(__RV_CSR_READ(CSR_STVT) + IRQn * 8));
1206 #endif
1207 }

References __RV_CSR_READ, and CSR_STVT.

◆ __ECLIC_SetCfgNlbits()

__STATIC_FORCEINLINE void __ECLIC_SetCfgNlbits ( uint32_t  nlbits)

Set nlbits value.

This function set the nlbits value of CLICCFG register.

Parameters
[in]nlbitsnlbits value
Remarks
  • nlbits is used to set the width of level in the CLICINTCTL[i].
See also

Definition at line 313 of file core_feature_eclic.h.

314 {
315  ECLIC->CFG &= ~CLIC_CLICCFG_NLBIT_Msk;
316  ECLIC->CFG |= (uint8_t)((nlbits <<CLIC_CLICCFG_NLBIT_Pos) & CLIC_CLICCFG_NLBIT_Msk);
317 }

References CLIC_CLICCFG_NLBIT_Msk, CLIC_CLICCFG_NLBIT_Pos, and ECLIC.

◆ __ECLIC_SetCtrlIRQ()

__STATIC_FORCEINLINE void __ECLIC_SetCtrlIRQ ( IRQn_Type  IRQn,
uint8_t  intctrl 
)

Modify ECLIC Interrupt Input Control Register for a specific interrupt.

This function modify ECLIC Interrupt Input Control(CLICINTCTL[i]) register of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]intctrlSet value for CLICINTCTL[i] register
Remarks
  • IRQn must not be negative.
See also

Definition at line 601 of file core_feature_eclic.h.

602 {
603  ECLIC->CTRL[IRQn].INTCTRL = intctrl;
604 }

References ECLIC.

Referenced by __ECLIC_SetLevelIRQ(), and __ECLIC_SetPriorityIRQ().

◆ __ECLIC_SetCtrlIRQ_S()

__STATIC_FORCEINLINE void __ECLIC_SetCtrlIRQ_S ( IRQn_Type  IRQn,
uint8_t  intctrl 
)

Modify ECLIC Interrupt Input Control Register for a specific interrupt in supervisor mode.

This function modify ECLIC Interrupt Input Control(CLICINTCTL[i]) register of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]intctrlSet value for CLICINTCTL[i] register
Remarks
  • IRQn must not be negative.
See also

Definition at line 954 of file core_feature_eclic.h.

955 {
956  ECLIC->SCTRL[IRQn].INTCTRL = intctrl;
957 }

References ECLIC.

Referenced by __ECLIC_SetLevelIRQ_S(), and __ECLIC_SetPriorityIRQ_S().

◆ __ECLIC_SetLevelIRQ()

__STATIC_FORCEINLINE void __ECLIC_SetLevelIRQ ( IRQn_Type  IRQn,
uint8_t  lvl_abs 
)

Set ECLIC Interrupt level of a specific interrupt.

This function set interrupt level of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]lvl_absInterrupt level
Remarks
  • IRQn must not be negative.
  • If lvl_abs to be set is larger than the max level allowed, it will be force to be max level.
  • When you set level value you need use clciinfo.nlbits to get the width of level. Then we could know the maximum of level. CLICINTCTLBITS is how many total bits are present in the CLICINTCTL register.
See also

Definition at line 637 of file core_feature_eclic.h.

638 {
639  uint8_t nlbits = __ECLIC_GetCfgNlbits();
640  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
641 
642  if (nlbits == 0) {
643  return;
644  }
645 
646  if (nlbits > intctlbits) {
647  nlbits = intctlbits;
648  }
649  uint8_t maxlvl = ((1 << nlbits) - 1);
650  if (lvl_abs > maxlvl) {
651  lvl_abs = maxlvl;
652  }
653  uint8_t lvl = lvl_abs << (ECLIC_MAX_NLBITS - nlbits);
654  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ(IRQn);
655  cur_ctrl = cur_ctrl << nlbits;
656  cur_ctrl = cur_ctrl >> nlbits;
657  __ECLIC_SetCtrlIRQ(IRQn, (cur_ctrl | lvl));
658 }

References __ECLIC_GetCfgNlbits(), __ECLIC_GetCtrlIRQ(), __ECLIC_SetCtrlIRQ(), and ECLIC_MAX_NLBITS.

◆ __ECLIC_SetLevelIRQ_S()

__STATIC_FORCEINLINE void __ECLIC_SetLevelIRQ_S ( IRQn_Type  IRQn,
uint8_t  lvl_abs 
)

Set ECLIC Interrupt level of a specific interrupt in supervisor mode.

This function set interrupt level of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]lvl_absInterrupt level
Remarks
  • IRQn must not be negative.
  • If lvl_abs to be set is larger than the max level allowed, it will be force to be max level.
  • When you set level value you need use clciinfo.nlbits to get the width of level. Then we could know the maximum of level. CLICINTCTLBITS is how many total bits are present in the CLICINTCTL register.
See also

Definition at line 990 of file core_feature_eclic.h.

991 {
992  uint8_t nlbits = __ECLIC_GetCfgNlbits();
993  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
994 
995  if (nlbits == 0) {
996  return;
997  }
998 
999  if (nlbits > intctlbits) {
1000  nlbits = intctlbits;
1001  }
1002  uint8_t maxlvl = ((1 << nlbits) - 1);
1003  if (lvl_abs > maxlvl) {
1004  lvl_abs = maxlvl;
1005  }
1006  uint8_t lvl = lvl_abs << (ECLIC_MAX_NLBITS - nlbits);
1007  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ_S(IRQn);
1008  cur_ctrl = cur_ctrl << nlbits;
1009  cur_ctrl = cur_ctrl >> nlbits;
1010  __ECLIC_SetCtrlIRQ_S(IRQn, (cur_ctrl | lvl));
1011 }

References __ECLIC_GetCfgNlbits(), __ECLIC_GetCtrlIRQ_S(), __ECLIC_SetCtrlIRQ_S(), and ECLIC_MAX_NLBITS.

◆ __ECLIC_SetModeIRQ()

__STATIC_FORCEINLINE void __ECLIC_SetModeIRQ ( IRQn_Type  IRQn,
uint32_t  mode 
)

Set privilege mode of a specific interrupt.

This function set in which privilege mode the interrupts IRQn should be taken.

Parameters
[in]IRQnInterrupt number
[in]modePrivilege mode
Remarks
  • IRQn must not be negative.
  • mode must be 1(Supervisor Mode) or 3(Machine Mode), other values are ignored.
  • M-mode can R/W this field, but S-mode can only read.And ECLIC with TEE does not reply on CSR mideleg to delegate interrupts.
  • Mode of S-mode ECLIC region's clicintattr can be omitted to set, which is mirror to M-mode ECLIC region's. Only the low 6 bits of clicintattr [i] can be written via the S-mode memory region.

Definition at line 821 of file core_feature_eclic.h.

822 {
823  /*
824  * only 1 or 3 can be assigned to mode in one step.the default value of mode is 3,
825  * which can't be clear to 0 firstly, then OR it to 1
826  */
827  ECLIC->CTRL[IRQn].INTATTR = (uint8_t)(mode << CLIC_INTATTR_MODE_Pos) + \
828  (ECLIC->SCTRL[IRQn].INTATTR & (~CLIC_INTATTR_MODE_Msk));
829 }

References CLIC_INTATTR_MODE_Msk, CLIC_INTATTR_MODE_Pos, and ECLIC.

◆ __ECLIC_SetMth()

__STATIC_FORCEINLINE void __ECLIC_SetMth ( uint8_t  mth)

Set Machine Mode Interrupt Level Threshold.

This function sets machine mode interrupt level threshold.

Parameters
[in]mthInterrupt Level Threshold.
See also

Definition at line 391 of file core_feature_eclic.h.

392 {
393  ECLIC->MTH = mth;
394 }

References ECLIC.

◆ __ECLIC_SetPendingIRQ()

__STATIC_FORCEINLINE void __ECLIC_SetPendingIRQ ( IRQn_Type  IRQn)

Set a specific interrupt to pending.

This function sets the pending bit for the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
Remarks
  • IRQn must not be negative.
See also

Definition at line 489 of file core_feature_eclic.h.

490 {
491  ECLIC->CTRL[IRQn].INTIP |= CLIC_INTIP_IP_Msk;
492 }

References CLIC_INTIP_IP_Msk, and ECLIC.

◆ __ECLIC_SetPriorityIRQ()

__STATIC_FORCEINLINE void __ECLIC_SetPriorityIRQ ( IRQn_Type  IRQn,
uint8_t  pri 
)

Get ECLIC Interrupt priority of a specific interrupt.

This function get interrupt priority of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]priInterrupt priority
Remarks
  • IRQn must not be negative.
  • If pri to be set is larger than the max priority allowed, it will be force to be max priority.
  • Priority width is CLICINTCTLBITS minus clciinfo.nlbits if clciinfo.nlbits is less than CLICINTCTLBITS. Otherwise priority width is 0.
See also

Definition at line 702 of file core_feature_eclic.h.

703 {
704  uint8_t nlbits = __ECLIC_GetCfgNlbits();
705  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
706  if (nlbits < intctlbits) {
707  uint8_t maxpri = ((1 << (intctlbits - nlbits)) - 1);
708  if (pri > maxpri) {
709  pri = maxpri;
710  }
711  pri = pri << (ECLIC_MAX_NLBITS - intctlbits);
712  uint8_t mask = ((uint8_t)(-1)) >> intctlbits;
713  pri = pri | mask;
714  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ(IRQn);
715  cur_ctrl = cur_ctrl >> (ECLIC_MAX_NLBITS - nlbits);
716  cur_ctrl = cur_ctrl << (ECLIC_MAX_NLBITS - nlbits);
717  __ECLIC_SetCtrlIRQ(IRQn, (cur_ctrl | pri));
718  }
719 }

References __ECLIC_GetCfgNlbits(), __ECLIC_GetCtrlIRQ(), __ECLIC_SetCtrlIRQ(), and ECLIC_MAX_NLBITS.

◆ __ECLIC_SetPriorityIRQ_S()

__STATIC_FORCEINLINE void __ECLIC_SetPriorityIRQ_S ( IRQn_Type  IRQn,
uint8_t  pri 
)

Set ECLIC Interrupt priority of a specific interrupt in supervisor mode.

This function get interrupt priority of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]priInterrupt priority
Remarks
  • IRQn must not be negative.
  • If pri to be set is larger than the max priority allowed, it will be force to be max priority.
  • Priority width is CLICINTCTLBITS minus clciinfo.nlbits if clciinfo.nlbits is less than CLICINTCTLBITS. Otherwise priority width is 0.
See also

Definition at line 1056 of file core_feature_eclic.h.

1057 {
1058  uint8_t nlbits = __ECLIC_GetCfgNlbits();
1059  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
1060  if (nlbits < intctlbits) {
1061  uint8_t maxpri = ((1 << (intctlbits - nlbits)) - 1);
1062  if (pri > maxpri) {
1063  pri = maxpri;
1064  }
1065  pri = pri << (ECLIC_MAX_NLBITS - intctlbits);
1066  uint8_t mask = ((uint8_t)(-1)) >> intctlbits;
1067  pri = pri | mask;
1068  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ_S(IRQn);
1069  cur_ctrl = cur_ctrl >> (ECLIC_MAX_NLBITS - nlbits);
1070  cur_ctrl = cur_ctrl << (ECLIC_MAX_NLBITS - nlbits);
1071  __ECLIC_SetCtrlIRQ_S(IRQn, (cur_ctrl | pri));
1072  }
1073 }

References __ECLIC_GetCfgNlbits(), __ECLIC_GetCtrlIRQ_S(), __ECLIC_SetCtrlIRQ_S(), and ECLIC_MAX_NLBITS.

◆ __ECLIC_SetShvIRQ()

__STATIC_FORCEINLINE void __ECLIC_SetShvIRQ ( IRQn_Type  IRQn,
uint32_t  shv 
)

Set interrupt working mode for a specific interrupt.

This function set selective hardware vector or non-vector working mode of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]shv
Remarks
  • IRQn must not be negative.
See also

Definition at line 566 of file core_feature_eclic.h.

567 {
568  ECLIC->CTRL[IRQn].INTATTR &= ~CLIC_INTATTR_SHV_Msk;
569  ECLIC->CTRL[IRQn].INTATTR |= (uint8_t)(shv << CLIC_INTATTR_SHV_Pos);
570 }

References CLIC_INTATTR_SHV_Msk, CLIC_INTATTR_SHV_Pos, and ECLIC.

◆ __ECLIC_SetShvIRQ_S()

__STATIC_FORCEINLINE void __ECLIC_SetShvIRQ_S ( IRQn_Type  IRQn,
uint32_t  shv 
)

Set interrupt working mode for a specific interrupt in supervisor mode.

This function set selective hardware vector or non-vector working mode of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]shv
Remarks
  • IRQn must not be negative.
See also

Definition at line 919 of file core_feature_eclic.h.

920 {
921  ECLIC->SCTRL[IRQn].INTATTR &= ~CLIC_INTATTR_SHV_Msk;
922  ECLIC->SCTRL[IRQn].INTATTR |= (uint8_t)(shv << CLIC_INTATTR_SHV_Pos);
923 }

References CLIC_INTATTR_SHV_Msk, CLIC_INTATTR_SHV_Pos, and ECLIC.

◆ __ECLIC_SetSth()

__STATIC_FORCEINLINE void __ECLIC_SetSth ( uint8_t  sth)

Set supervisor-mode Interrupt Level Threshold in supervisor mode.

This function sets supervisor-mode interrupt level threshold.

Parameters
[in]sthInterrupt Level Threshold.
Remarks
  • S-mode ECLIC region sintthresh'sth is a mirror to M-mode ECLIC region's mintthresh.sth, and will be updated synchronously, here operate on mintthresh.sth.
See also

Definition at line 842 of file core_feature_eclic.h.

843 {
844  ECLIC->STH = sth;
845 }

References ECLIC.

◆ __ECLIC_SetTrigIRQ()

__STATIC_FORCEINLINE void __ECLIC_SetTrigIRQ ( IRQn_Type  IRQn,
uint32_t  trig 
)

Set trigger mode and polarity for a specific interrupt.

This function set trigger mode and polarity of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]trig
Remarks
  • IRQn must not be negative.
See also

Definition at line 527 of file core_feature_eclic.h.

528 {
529  ECLIC->CTRL[IRQn].INTATTR &= ~CLIC_INTATTR_TRIG_Msk;
530  ECLIC->CTRL[IRQn].INTATTR |= (uint8_t)(trig << CLIC_INTATTR_TRIG_Pos);
531 }

References CLIC_INTATTR_TRIG_Msk, CLIC_INTATTR_TRIG_Pos, and ECLIC.

◆ __ECLIC_SetTrigIRQ_S()

__STATIC_FORCEINLINE void __ECLIC_SetTrigIRQ_S ( IRQn_Type  IRQn,
uint32_t  trig 
)

Set trigger mode and polarity for a specific interrupt in supervisor mode.

This function set trigger mode and polarity of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]trig
Remarks
  • IRQn must not be negative.
See also

Definition at line 879 of file core_feature_eclic.h.

880 {
881  ECLIC->SCTRL[IRQn].INTATTR &= ~CLIC_INTATTR_TRIG_Msk;
882  ECLIC->SCTRL[IRQn].INTATTR |= (uint8_t)(trig << CLIC_INTATTR_TRIG_Pos);
883 }

References CLIC_INTATTR_TRIG_Msk, CLIC_INTATTR_TRIG_Pos, and ECLIC.

◆ __ECLIC_SetVector()

__STATIC_FORCEINLINE void __ECLIC_SetVector ( IRQn_Type  IRQn,
rv_csr_t  vector 
)

Set Interrupt Vector of a specific interrupt.

This function set interrupt handler address of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]vectorInterrupt handler address
Remarks
  • IRQn must not be negative.
  • You can set the CSR_CSR_MTVT to set interrupt vector table entry address.
  • If your vector table is placed in readonly section, the vector for IRQn will not be modified. For this case, you need to use the correct irq handler name defined in your vector table as your irq handler function name.
  • This function will only work correctly when the vector table is placed in an read-write enabled section.
See also

Definition at line 763 of file core_feature_eclic.h.

764 {
765  volatile unsigned long vec_base;
766  vec_base = ((unsigned long)__RV_CSR_READ(CSR_MTVT));
767  vec_base += ((unsigned long)IRQn) * sizeof(unsigned long);
768  (* (unsigned long *) vec_base) = vector;
769 #if (defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1))
770 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
771  MFlushDCacheLine((unsigned long)vec_base);
772 #endif
773 #endif
774 #if (defined(__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1))
775 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
776  MInvalICacheLine((unsigned long)vec_base);
777 #else
778  __FENCE_I();
779 #endif
780 #endif
781 }

References __FENCE_I(), __RV_CSR_READ, CSR_MTVT, MFlushDCacheLine(), and MInvalICacheLine().

◆ __ECLIC_SetVector_S()

__STATIC_FORCEINLINE void __ECLIC_SetVector_S ( IRQn_Type  IRQn,
rv_csr_t  vector 
)

Set Interrupt Vector of a specific interrupt in supervisor mode.

This function set interrupt handler address of the specific interrupt IRQn.

Parameters
[in]IRQnInterrupt number
[in]vectorInterrupt handler address
Remarks
  • IRQn must not be negative.
  • You can set the CSR_CSR_MTVT to set interrupt vector table entry address.
  • If your vector table is placed in readonly section, the vector for IRQn will not be modified. For this case, you need to use the correct irq handler name defined in your vector table as your irq handler function name.
  • This function will only work correctly when the vector table is placed in an read-write enabled section.
See also

Definition at line 1166 of file core_feature_eclic.h.

1167 {
1168  volatile unsigned long vec_base;
1169  vec_base = ((unsigned long)__RV_CSR_READ(CSR_STVT));
1170  vec_base += ((unsigned long)IRQn) * sizeof(unsigned long);
1171  (* (unsigned long *) vec_base) = vector;
1172 #if (defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1))
1173 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
1174  SFlushDCacheLine((unsigned long)vec_base);
1175 #endif
1176 #endif
1177 #if (defined(__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1))
1178 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
1179  SInvalICacheLine((unsigned long)vec_base);
1180 #else
1181  __FENCE_I();
1182 #endif
1183 #endif
1184 }

References __FENCE_I(), __RV_CSR_READ, CSR_STVT, SFlushDCacheLine(), and SInvalICacheLine().

◆ __get_exc_entry()

__STATIC_FORCEINLINE rv_csr_t __get_exc_entry ( void  )

Get Exception entry address.

This function get exception handler address from 'CSR_MTVEC'.

Returns
Exception handler address
Remarks
  • This function use to get exception handler address from 'CSR_MTVEC'. Address need to be aligned to 64 bytes.
See also

Definition at line 1240 of file core_feature_eclic.h.

1241 {
1242  unsigned long addr = __RV_CSR_READ(CSR_MTVEC);
1243  return (addr & ~ECLIC_MODE_MTVEC_Msk);
1244 }

References __RV_CSR_READ, CSR_MTVEC, and ECLIC_MODE_MTVEC_Msk.

◆ __get_nmi_entry()

__STATIC_FORCEINLINE rv_csr_t __get_nmi_entry ( void  )

Get NMI interrupt entry from 'CSR_MNVEC'.

This function get NMI interrupt address from 'CSR_MNVEC'.

Returns
NMI interrupt handler address
Remarks
  • This function use to get NMI interrupt handler address from 'CSR_MNVEC'. If CSR_MMISC_CTL[9] = 1 'CSR_MNVEC'
  • will be equal as mtvec. If CSR_MMISC_CTL[9] = 0 'CSR_MNVEC' will be equal as reset vector.
  • NMI entry is defined via CSR_MMISC_CTL, writing to CSR_MNVEC will be ignored.

Definition at line 1299 of file core_feature_eclic.h.

1300 {
1301  return __RV_CSR_READ(CSR_MNVEC);
1302 }

References __RV_CSR_READ, and CSR_MNVEC.

◆ __get_nonvec_entry()

__STATIC_FORCEINLINE rv_csr_t __get_nonvec_entry ( void  )

Get Non-vector interrupt entry address.

This function get Non-vector interrupt address.

Returns
Non-vector interrupt handler address
Remarks
  • This function use to get non-vector interrupt entry address from 'CSR_MTVT2' if
  • CSR_MTVT2 bit0 is 1. If 'CSR_MTVT2' bit0 is 0 then get address from 'CSR_MTVEC'.
See also

Definition at line 1279 of file core_feature_eclic.h.

1280 {
1281  if (__RV_CSR_READ(CSR_MTVT2) & 0x1) {
1282  return __RV_CSR_READ(CSR_MTVT2) & (~(rv_csr_t)(0x1));
1283  } else {
1285  return (addr & ~ECLIC_MODE_MTVEC_Msk);
1286  }
1287 }

References __RV_CSR_READ, CSR_MTVEC, CSR_MTVT2, and ECLIC_MODE_MTVEC_Msk.

◆ __set_exc_entry()

__STATIC_FORCEINLINE void __set_exc_entry ( rv_csr_t  addr)

Set Exception entry address.

This function set exception handler address to 'CSR_MTVEC'.

Parameters
[in]addrException handler address
Remarks
  • This function use to set exception handler address to 'CSR_MTVEC'. Address need to be aligned to 64 bytes.
See also

Definition at line 1222 of file core_feature_eclic.h.

1223 {
1224  addr &= (rv_csr_t)(~0x3F);
1225  addr |= ECLIC_MODE_MTVEC_Msk;
1226  __RV_CSR_WRITE(CSR_MTVEC, addr);
1227 }

References __RV_CSR_WRITE, CSR_MTVEC, and ECLIC_MODE_MTVEC_Msk.

◆ __set_nonvec_entry()

__STATIC_FORCEINLINE void __set_nonvec_entry ( rv_csr_t  addr)

Set Non-vector interrupt entry address.

This function set Non-vector interrupt address.

Parameters
[in]addrNon-vector interrupt entry address
Remarks
  • This function use to set non-vector interrupt entry address to 'CSR_MTVT2' if
  • CSR_MTVT2 bit0 is 1. If 'CSR_MTVT2' bit0 is 0 then set address to 'CSR_MTVEC'
See also

Definition at line 1257 of file core_feature_eclic.h.

1258 {
1259  if (__RV_CSR_READ(CSR_MTVT2) & 0x1) {
1260  __RV_CSR_WRITE(CSR_MTVT2, addr | 0x01);
1261  } else {
1262  addr &= (rv_csr_t)(~0x3F);
1263  addr |= ECLIC_MODE_MTVEC_Msk;
1264  __RV_CSR_WRITE(CSR_MTVEC, addr);
1265  }
1266 }

References __RV_CSR_READ, __RV_CSR_WRITE, CSR_MTVEC, CSR_MTVT2, and ECLIC_MODE_MTVEC_Msk.

SysTimer_IRQn
@ SysTimer_IRQn
System Timer Interrupt.
Definition: core_feature_eclic.h:212
Reserved5_IRQn
@ Reserved5_IRQn
Internal reserved.
Definition: core_feature_eclic.h:211
CLIC_INTIE_IE_Msk
#define CLIC_INTIE_IE_Msk
CLIC INTIE: IE Mask.
Definition: core_feature_eclic.h:136
Reserved3_IRQn
@ Reserved3_IRQn
Internal reserved.
Definition: core_feature_eclic.h:209
CLIC_INTATTR_TRIG_Pos
#define CLIC_INTATTR_TRIG_Pos
CLIC INTATTR: TRIG Position.
Definition: core_feature_eclic.h:143
Reserved14_IRQn
@ Reserved14_IRQn
Internal reserved.
Definition: core_feature_eclic.h:221
CLIC_INTATTR_MODE_Msk
#define CLIC_INTATTR_MODE_Msk
CLIC INTATTA: Mode Mask.
Definition: core_feature_eclic.h:140
CSR_MTVEC
#define CSR_MTVEC
Definition: riscv_encoding.h:571
Reserved7_IRQn
@ Reserved7_IRQn
Internal reserved.
Definition: core_feature_eclic.h:214
CLIC_INTATTR_SHV_Pos
#define CLIC_INTATTR_SHV_Pos
CLIC INTATTR: SHV Position.
Definition: core_feature_eclic.h:146
Reserved6_IRQn
@ Reserved6_IRQn
Internal reserved.
Definition: core_feature_eclic.h:213
Reserved0_IRQn
@ Reserved0_IRQn
Internal reserved.
Definition: core_feature_eclic.h:205
CLIC_CLICCFG_NLBIT_Msk
#define CLIC_CLICCFG_NLBIT_Msk
CLIC CLICCFG: NLBIT Mask.
Definition: core_feature_eclic.h:121
RESTORE_IRQ_CSR_CONTEXT
#define RESTORE_IRQ_CSR_CONTEXT()
Restore necessary CSRs from variables for vector interrupt nesting.
Definition: core_feature_eclic.h:1356
SFlushDCacheLine
__STATIC_FORCEINLINE void SFlushDCacheLine(unsigned long addr)
Flush one D-Cache line specified by address in S-Mode.
Definition: core_feature_cache.h:955
Reserved8_IRQn
@ Reserved8_IRQn
Internal reserved.
Definition: core_feature_eclic.h:215
CSR_MTVT
#define CSR_MTVT
Definition: riscv_encoding.h:900
__ECLIC_GetCtrlIRQ_S
__STATIC_FORCEINLINE uint8_t __ECLIC_GetCtrlIRQ_S(IRQn_Type IRQn)
Get ECLIC Interrupt Input Control Register value for a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:970
CSR_STVT
#define CSR_STVT
Definition: riscv_encoding.h:556
ECLIC_MODE_MTVEC_Msk
#define ECLIC_MODE_MTVEC_Msk
ECLIC Mode mask for MTVT CSR Register.
Definition: core_feature_eclic.h:150
CLIC_INTATTR_MODE_Pos
#define CLIC_INTATTR_MODE_Pos
CLIC INTATTA: Mode Position.
Definition: core_feature_eclic.h:139
IRQn
IRQn
Definition of IRQn numbers.
Definition: core_feature_eclic.h:202
MFlushDCacheLine
__STATIC_FORCEINLINE void MFlushDCacheLine(unsigned long addr)
Flush one D-Cache line specified by address in M-Mode.
Definition: core_feature_cache.h:918
ECLIC
#define ECLIC
CLIC configuration struct.
Definition: core_feature_eclic.h:175
__RV_CSR_WRITE
#define __RV_CSR_WRITE(csr, val)
CSR operation Macro for csrw instruction.
Definition: core_feature_base.h:499
__ECLIC_SetCtrlIRQ
__STATIC_FORCEINLINE void __ECLIC_SetCtrlIRQ(IRQn_Type IRQn, uint8_t intctrl)
Modify ECLIC Interrupt Input Control Register for a specific interrupt.
Definition: core_feature_eclic.h:601
CLIC_CLICINFO_CTLBIT_Pos
#define CLIC_CLICINFO_CTLBIT_Pos
CLIC INTINFO: __ECLIC_GetInfoCtlbits() Position.
Definition: core_feature_eclic.h:123
SOC_INT_MAX
@ SOC_INT_MAX
Number of total interrupts.
Definition: core_feature_eclic.h:232
CLIC_INTATTR_SHV_Msk
#define CLIC_INTATTR_SHV_Msk
CLIC INTATTR: SHV Mask.
Definition: core_feature_eclic.h:147
SAVE_IRQ_CSR_CONTEXT
#define SAVE_IRQ_CSR_CONTEXT()
Save necessary CSRs into variables for vector interrupt nesting.
Definition: core_feature_eclic.h:1334
FirstDeviceSpecificInterrupt_IRQn
@ FirstDeviceSpecificInterrupt_IRQn
First Device Specific Interrupt.
Definition: core_feature_eclic.h:231
Reserved16_IRQn
@ Reserved16_IRQn
Internal reserved.
Definition: core_feature_eclic.h:223
Reserved9_IRQn
@ Reserved9_IRQn
Internal reserved.
Definition: core_feature_eclic.h:216
CLIC_CLICINFO_NUM_Msk
#define CLIC_CLICINFO_NUM_Msk
CLIC CLICINFO: NUM Mask.
Definition: core_feature_eclic.h:130
__ECLIC_GetCfgNlbits
__STATIC_FORCEINLINE uint32_t __ECLIC_GetCfgNlbits(void)
Get nlbits value.
Definition: core_feature_eclic.h:329
Reserved15_IRQn
@ Reserved15_IRQn
Internal reserved.
Definition: core_feature_eclic.h:222
ECLIC_MAX_NLBITS
#define ECLIC_MAX_NLBITS
Max nlbit of the CLICINTCTLBITS.
Definition: core_feature_eclic.h:149
Reserved2_IRQn
@ Reserved2_IRQn
Internal reserved.
Definition: core_feature_eclic.h:207
CLIC_CLICCFG_NLBIT_Pos
#define CLIC_CLICCFG_NLBIT_Pos
CLIC CLICCFG: NLBIT Position.
Definition: core_feature_eclic.h:120
CSR_MNVEC
#define CSR_MNVEC
Definition: riscv_encoding.h:915
MInvalICacheLine
__STATIC_FORCEINLINE void MInvalICacheLine(unsigned long addr)
Invalidate one I-Cache line specified by address in M-Mode.
Definition: core_feature_cache.h:284
Reserved11_IRQn
@ Reserved11_IRQn
Internal reserved.
Definition: core_feature_eclic.h:218
__RV_CSR_READ
#define __RV_CSR_READ(csr)
CSR operation Macro for csrr instruction.
Definition: core_feature_base.h:481
CLIC_INTATTR_TRIG_Msk
#define CLIC_INTATTR_TRIG_Msk
CLIC INTATTR: TRIG Mask.
Definition: core_feature_eclic.h:144
Reserved10_IRQn
@ Reserved10_IRQn
Internal reserved.
Definition: core_feature_eclic.h:217
__ECLIC_GetCtrlIRQ
__STATIC_FORCEINLINE uint8_t __ECLIC_GetCtrlIRQ(IRQn_Type IRQn)
Get ECLIC Interrupt Input Control Register value for a specific interrupt.
Definition: core_feature_eclic.h:617
__ECLIC_SetCtrlIRQ_S
__STATIC_FORCEINLINE void __ECLIC_SetCtrlIRQ_S(IRQn_Type IRQn, uint8_t intctrl)
Modify ECLIC Interrupt Input Control Register for a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:954
CSR_MTVT2
#define CSR_MTVT2
Definition: riscv_encoding.h:932
Reserved4_IRQn
@ Reserved4_IRQn
Internal reserved.
Definition: core_feature_eclic.h:210
Reserved13_IRQn
@ Reserved13_IRQn
Internal reserved.
Definition: core_feature_eclic.h:220
SInvalICacheLine
__STATIC_FORCEINLINE void SInvalICacheLine(unsigned long addr)
Invalidate one I-Cache line specified by address in S-Mode.
Definition: core_feature_cache.h:322
Reserved1_IRQn
@ Reserved1_IRQn
Internal reserved.
Definition: core_feature_eclic.h:206
SysTimerSW_IRQn
@ SysTimerSW_IRQn
System Timer SW interrupt.
Definition: core_feature_eclic.h:208
__INTERRUPT
#define __INTERRUPT
Use this attribute to indicate that the specified function is an interrupt handler run in Machine Mod...
Definition: nmsis_gcc.h:187
CLIC_CLICINFO_VER_Pos
#define CLIC_CLICINFO_VER_Pos
CLIC CLICINFO: VERSION Position.
Definition: core_feature_eclic.h:126
CLIC_CLICINFO_CTLBIT_Msk
#define CLIC_CLICINFO_CTLBIT_Msk
CLIC INTINFO: __ECLIC_GetInfoCtlbits() Mask.
Definition: core_feature_eclic.h:124
Reserved12_IRQn
@ Reserved12_IRQn
Internal reserved.
Definition: core_feature_eclic.h:219
__FENCE_I
__STATIC_FORCEINLINE void __FENCE_I(void)
Fence.i Instruction.
Definition: core_feature_base.h:1475
rv_csr_t
unsigned long rv_csr_t
Type of Control and Status Register(CSR), depends on the XLEN defined in RISC-V.
Definition: core_feature_base.h:55
CLIC_INTIP_IP_Msk
#define CLIC_INTIP_IP_Msk
CLIC INTIP: IP Mask.
Definition: core_feature_eclic.h:133
CLIC_CLICINFO_NUM_Pos
#define CLIC_CLICINFO_NUM_Pos
CLIC CLICINFO: NUM Position.
Definition: core_feature_eclic.h:129
CLIC_CLICINFO_VER_Msk
#define CLIC_CLICINFO_VER_Msk
CLIC CLICINFO: VERSION Mask.
Definition: core_feature_eclic.h:127