PLIC API Calls

plic_set_priority()

Usage void plic_set_priority(u32 plic, u32 gateway, u32 priority)
Include driver/plic.h
Parameters [IN] plic PLIC base address
[IN] gateway interrupt type. Gateway is the interrupt number for a particular peripheral when configuring the Sapphire SoC. The gateway for all peripherals are available in soc.h, i.e., SYSTEM_PLIC_TIMER_INTERRUPTS_0.
[IN] priority interrupt priority. Priority can be set within a range of 0 to 3.
Description Set the interrupt priority.

plic_get_priority()

Usage u32 plic_get_priority(u32 plic, u32 gateway)
Include driver/plic.h
Parameters [IN] plic PLIC base address
[IN] gateway interrupt type
Returns [OUT] 32-bit priority
Description Get the interrupt priority.

plic_set_enable()

Usage void plic_set_enable(u32 plic, u32 target, u32 gateway, u32 enable)
Include driver/plic.h
Parameters [IN] plic PLIC base address
[IN] target HART number
[IN] gateway interrupt type
[IN] enable Enable interrupt for the particular gateway on the selected target.
Description Set the interrupt enable.

plic_set_threshold()

Usage void plic_set_threshold(u32 plic, u32 target, u32 threshold)
Include driver/plic.h
Parameters [IN] plic PLIC base address
[IN] target HART number
[IN] threshold HART interrupt threshold
Description Set the threshold of a particular HART to accept interrupt source.
Example
plic_set_threshold(BSP_PLIC, BSP_PLIC_CPU_0, 0);
// cpu 0 accept all interrupts with priority above 0

plic_claim()

Usage u32 plic_claim(u32 plic, u32 target)
Include driver/plic.h
Parameters [IN] plic PLIC base address
[IN] target HART number
Description Claim the PLIC interrupt for specific HART.

plic_release()

Usage void plic_release(u32 plic, u32 target, u32 gateway)
Include driver/plic.h
Parameters [IN] plic PLIC base address
[IN] target HART number
[IN] gateway interrupt type
Description Release the PLIC interrupt for specific HART.