PLIC Interrupt

__STATIC_FORCEINLINE void PLIC_SetContextThreshold (uint32_t ctxid, uint32_t thresh)
__STATIC_FORCEINLINE uint32_t PLIC_GetContextThreshold (uint32_t ctxid)
__STATIC_FORCEINLINE void PLIC_EnableContextInterrupt (uint32_t ctxid, uint32_t source)
__STATIC_FORCEINLINE void PLIC_DisableContextInterrupt (uint32_t ctxid, uint32_t source)
__STATIC_FORCEINLINE uint32_t PLIC_GetContextInterruptEnable (uint32_t ctxid, uint32_t source)
__STATIC_FORCEINLINE void PLIC_SetInterruptPending (uint32_t source)
__STATIC_FORCEINLINE void PLIC_ClearInterruptPending (uint32_t source)
__STATIC_FORCEINLINE uint32_t PLIC_GetInterruptPending (uint32_t source)
__STATIC_FORCEINLINE void PLIC_SetPriority (uint32_t source, uint32_t priority)
__STATIC_FORCEINLINE uint32_t PLIC_GetPriority (uint32_t source)
__STATIC_FORCEINLINE uint32_t PLIC_ClaimContextInterrupt (uint32_t ctxid)
__STATIC_FORCEINLINE void PLIC_CompleteContextInterrupt (uint32_t ctxid, uint32_t source)
__STATIC_FORCEINLINE void PLIC_Context_Init (uint32_t ctxid, uint32_t num_sources, uint32_t enable, uint32_t thresh)
__STATIC_FORCEINLINE void __set_trap_entry (rv_csr_t addr)
__STATIC_FORCEINLINE rv_csr_t __get_trap_entry (void)
PLIC_Init(num_sources, enable, thresh) PLIC_Context_Init(PLIC_GetHartMContextID(), (num_sources), (enable), (thresh))
PLIC_Init_S(num_sources, enable, thresh) PLIC_Context_Init(PLIC_GetHartSContextID(), (num_sources), (enable), (thresh))
PLIC_ClaimInterrupt() PLIC_ClaimContextInterrupt(PLIC_GetHartMContextID())
PLIC_ClaimInterrupt_S() PLIC_ClaimContextInterrupt(PLIC_GetHartSContextID())
PLIC_CompleteInterrupt(source) PLIC_CompleteContextInterrupt(PLIC_GetHartMContextID(), (source))
PLIC_CompleteInterrupt_S(source) PLIC_CompleteContextInterrupt(PLIC_GetHartSContextID(), (source))
PLIC_GetInterruptEnable(source) PLIC_GetContextInterruptEnable(PLIC_GetHartMContextID(), (source))
PLIC_GetInterruptEnable_S(source) PLIC_GetContextInterruptEnable(PLIC_GetHartSContextID(), (source))
PLIC_EnableInterrupt(source) PLIC_EnableContextInterrupt(PLIC_GetHartMContextID(), (source))
PLIC_EnableInterrupt_S(source) PLIC_EnableContextInterrupt(PLIC_GetHartSContextID(), (source))
PLIC_DisableInterrupt(source) PLIC_DisableContextInterrupt(PLIC_GetHartMContextID(), (source))
PLIC_DisableInterrupt_S(source) PLIC_DisableContextInterrupt(PLIC_GetHartSContextID(), (source))
PLIC_SetThreshold(source, thresh) PLIC_SetContextThreshold(PLIC_GetHartMContextID(), (source), (thresh))
PLIC_SetThreshold_S(source, thresh) PLIC_SetContextThreshold(PLIC_GetHartSContextID(), (source), (thresh))
PLIC_GetThreshold() PLIC_GetContextThreshold(PLIC_GetHartMContextID())
PLIC_GetThreshold_S() PLIC_GetContextThreshold(PLIC_GetHartSContextID())
group PLIC Interrupt

Functions that manage interrupts via the PLIC.

Defines

PLIC_Init(num_sources, enable, thresh) PLIC_Context_Init(PLIC_GetHartMContextID(), (num_sources), (enable), (thresh))
PLIC_Init_S(num_sources, enable, thresh) PLIC_Context_Init(PLIC_GetHartSContextID(), (num_sources), (enable), (thresh))
PLIC_ClaimInterrupt() PLIC_ClaimContextInterrupt(PLIC_GetHartMContextID())
PLIC_ClaimInterrupt_S() PLIC_ClaimContextInterrupt(PLIC_GetHartSContextID())
PLIC_CompleteInterrupt(source) PLIC_CompleteContextInterrupt(PLIC_GetHartMContextID(), (source))
PLIC_CompleteInterrupt_S(source) PLIC_CompleteContextInterrupt(PLIC_GetHartSContextID(), (source))
PLIC_GetInterruptEnable(source) PLIC_GetContextInterruptEnable(PLIC_GetHartMContextID(), (source))
PLIC_GetInterruptEnable_S(source) PLIC_GetContextInterruptEnable(PLIC_GetHartSContextID(), (source))
PLIC_EnableInterrupt(source) PLIC_EnableContextInterrupt(PLIC_GetHartMContextID(), (source))
PLIC_EnableInterrupt_S(source) PLIC_EnableContextInterrupt(PLIC_GetHartSContextID(), (source))
PLIC_DisableInterrupt(source) PLIC_DisableContextInterrupt(PLIC_GetHartMContextID(), (source))
PLIC_DisableInterrupt_S(source) PLIC_DisableContextInterrupt(PLIC_GetHartSContextID(), (source))
PLIC_SetThreshold(source, thresh) PLIC_SetContextThreshold(PLIC_GetHartMContextID(), (source), (thresh))
PLIC_SetThreshold_S(source, thresh) PLIC_SetContextThreshold(PLIC_GetHartSContextID(), (source), (thresh))
PLIC_GetThreshold() PLIC_GetContextThreshold(PLIC_GetHartMContextID())
PLIC_GetThreshold_S() PLIC_GetContextThreshold(PLIC_GetHartSContextID())

Functions

__STATIC_FORCEINLINE void PLIC_SetContextThreshold (uint32_t ctxid, uint32_t thresh)

Set priority threshold value of plic for selected context.

This function set priority threshold value of plic for selected context.

Remark

See also

  • PLIC_GetContextThreshold

Parameters:
  • ctxid[in] selected context id

  • thresh[in] threshold value

__STATIC_FORCEINLINE uint32_t PLIC_GetContextThreshold (uint32_t ctxid)

Get priority threshold value of plic for selected context.

This function get priority threshold value of plic for selected context.

Remark

See also

  • PLIC_SetContextThreshold

Parameters:

ctxid[in] selected context id

Returns:

priority threshold value for selected context

__STATIC_FORCEINLINE void PLIC_EnableContextInterrupt (uint32_t ctxid, uint32_t source)

Enable interrupt of selected source plic for selected context.

This function enable interrupt of selected source plic for selected context.

Remark

See also

  • PLIC_DisableContextInterrupt

Parameters:
  • ctxid[in] selected context id

  • source[in] interrupt source

__STATIC_FORCEINLINE void PLIC_DisableContextInterrupt (uint32_t ctxid, uint32_t source)

Disable interrupt of selected source plic for selected context.

This function disable interrupt of selected source plic for selected context

Remark

See also

  • PLIC_EnableContextInterrupt

Parameters:
  • ctxid[in] selected context id

  • source[in] interrupt source

__STATIC_FORCEINLINE uint32_t PLIC_GetContextInterruptEnable (uint32_t ctxid, uint32_t source)

Get interrupt enable status of selected source plic for selected context.

This function get interrupt enable of selected source plic for selected context.

Remark

See also

  • PLIC_EnableContextInterrupt

  • PLIC_DisableContextInterrupt

Parameters:
  • ctxid[in] selected context id

  • source[in] interrupt source

Returns:

enable status for selected interrupt source for selected context

__STATIC_FORCEINLINE void PLIC_SetInterruptPending (uint32_t source)

Set interrupt pending of selected source plic.

This function set interrupt pending of selected source plic.

Remark

See also

  • PLIC_GetInterruptPending

  • PLIC_CLearInterruptPending

Parameters:

source[in] interrupt source

__STATIC_FORCEINLINE void PLIC_ClearInterruptPending (uint32_t source)

Clear interrupt pending of selected source plic.

This function clear interrupt pending of selected source plic

Remark

See also

  • PLIC_SetInterruptPending

  • PLIC_GetInterruptPending

Parameters:

source[in] interrupt source

__STATIC_FORCEINLINE uint32_t PLIC_GetInterruptPending (uint32_t source)

Get interrupt pending status of selected source plic.

This function get interrupt pending of selected source plic

Remark

See also

  • PLIC_SetInterruptPending

  • PLIC_ClearInterruptPending

Parameters:

source[in] interrupt source

Returns:

interrupt pending status for selected interrupt source

__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.

Remark

See also

  • PLIC_GetPriority

Parameters:
  • source[in] interrupt source

  • priority[in] interrupt priority

__STATIC_FORCEINLINE uint32_t PLIC_GetPriority (uint32_t source)

Get interrupt priority for selected source plic.

This function get interrupt priority for selected source plic.

Remark

See also

  • PLIC_SetPriority

Parameters:
  • source[in] interrupt source

  • priority[in] interrupt priority

__STATIC_FORCEINLINE uint32_t PLIC_ClaimContextInterrupt (uint32_t ctxid)

Claim interrupt for plic for selected context.

This function claim interrupt for plic for selected context.

Remark

A successful claim will also atomically clear the corresponding pending bit on the interrupt source. The PLIC can perform a claim at any time and the claim operation is not affected by the setting of the priority threshold register.

See also

  • PLIC_CompleteContextInterrupt

Parameters:

ctxid[in] selected context id

Returns:

the ID of the highest priority pending interrupt or zero if there is no pending interrupt

__STATIC_FORCEINLINE void PLIC_CompleteContextInterrupt (uint32_t ctxid, uint32_t source)

Complete interrupt for plic for selected context.

This function complete interrupt for plic for selected context.

Remark

The PLIC signals it has completed executing an interrupt handler by writing the interrupt ID it received from the claim to the claim/complete register. The PLIC does not check whether the completion ID is the same as the last claim ID for that context. If the completion ID does not match an interrupt source that is currently enabled for the context, the completion is silently ignored.

See also

  • PLIC_ClaimContextInterrupt

Parameters:

ctxid[in] selected context id

Returns:

the ID of the highest priority pending interrupt or zero if there is no pending interrupt

__STATIC_FORCEINLINE void PLIC_Context_Init (uint32_t ctxid, uint32_t num_sources, uint32_t enable, uint32_t thresh)

Perform init for plic for selected context.

This function perform initialization steps for plic for selected context.

Remark

  • Disable all interrupts

  • Set priority threshold to value specified by thresh

Parameters:
  • ctxid[in] selected context id

  • num_sources[in] plic interrupt source count number

  • enable[in] plic interrupt enable or not

  • thresh[in] plic interrupt threshold

__STATIC_FORCEINLINE void __set_trap_entry (rv_csr_t addr)

Set Trap entry address.

This function set trap entry address to ‘CSR_MTVEC’.

Remark

  • This function use to set trap entry address to ‘CSR_MTVEC’.

See also

  • __get_trap_entry

Parameters:

addr[in] trap entry address

__STATIC_FORCEINLINE rv_csr_t __get_trap_entry (void)

Get trap entry address.

This function get trap entry address from ‘CSR_MTVEC’.

Remark

  • This function use to get trap entry address from ‘CSR_MTVEC’.

See also

  • __set_trap_entry

Returns:

trap entry address