FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/polarfire_hal/platform/mpfs_hal/common/mss_plic.h
/***************************************************************************/
/**
 * The function PLIC_EnableIRQ() enables the external interrupt for the
 * interrupt number indicated by the parameter IRQn.
 */
The function PLIC_EnableIRQ() enables the external interrupt for the
interrupt number indicated by the parameter IRQn.
The function PLIC_EnableIRQ () enables the external interrupt for the interrupt number indicated by the parameter IRQn .
static inline void PLIC_EnableIRQ(PLIC_IRQn_Type IRQn)
{
    uint32_t current;
    uint64_t hart_id  = read_csr(mhartid);
    switch(hart_id)
    {
        case 0:
            current  = PLIC->HART0_MMODE_ENA[IRQn / 32U];
            current |= (uint32_t)1 << (IRQn % 32U);
            PLIC->HART0_MMODE_ENA[IRQn / 32U]  = current;
            break;
        case 1:
            current  = PLIC->HART1_MMODE_ENA[IRQn / 32U];
            current |= (uint32_t)1 << (IRQn % 32U);
            PLIC->HART1_MMODE_ENA[IRQn / 32U]  = current;
            break;
        case 2:
            current  = PLIC->HART2_MMODE_ENA[IRQn / 32U];
            current |= (uint32_t)1 << (IRQn % 32U);
            PLIC->HART2_MMODE_ENA[IRQn / 32U]  = current;
            break;
        case 3:
            current  = PLIC->HART3_MMODE_ENA[IRQn / 32U];
            current |= (uint32_t)1 << (IRQn % 32U);
            PLIC->HART3_MMODE_ENA[IRQn / 32U]  = current;
            break;
        case 4:
            current  = PLIC->HART4_MMODE_ENA[IRQn / 32U];
            current |= (uint32_t)1 << (IRQn % 32U);
            PLIC->HART4_MMODE_ENA[IRQn / 32U]  = current;
            break;
        default:
            break;
    }
}
static inline void PLIC_EnableIRQ ( PLIC_IRQn_Type IRQn ) { uint32_t current ; uint64_t hart_id = read_csr ( mhartid ) ; switch ( hart_id ) { case 0 : current = PLIC -> HART0_MMODE_ENA [ IRQn / 32U ] ; current |= ( uint32_t ) 1 << ( IRQn % 32U ) ; PLIC -> HART0_MMODE_ENA [ IRQn / 32U ] = current ; break ; case 1 : current = PLIC -> HART1_MMODE_ENA [ IRQn / 32U ] ; current |= ( uint32_t ) 1 << ( IRQn % 32U ) ; PLIC -> HART1_MMODE_ENA [ IRQn / 32U ] = current ; break ; case 2 : current = PLIC -> HART2_MMODE_ENA [ IRQn / 32U ] ; current |= ( uint32_t ) 1 << ( IRQn % 32U ) ; PLIC -> HART2_MMODE_ENA [ IRQn / 32U ] = current ; break ; case 3 : current = PLIC -> HART3_MMODE_ENA [ IRQn / 32U ] ; current |= ( uint32_t ) 1 << ( IRQn % 32U ) ; PLIC -> HART3_MMODE_ENA [ IRQn / 32U ] = current ; break ; case 4 : current = PLIC -> HART4_MMODE_ENA [ IRQn / 32U ] ; current |= ( uint32_t ) 1 << ( IRQn % 32U ) ; PLIC -> HART4_MMODE_ENA [ IRQn / 32U ] = current ; break ; default : break ; } }
The function PLIC_EnableIRQ() enables the external interrupt for the
 interrupt number indicated by the parameter IRQn.
The function PLIC_EnableIRQ () enables the external interrupt for the interrupt number indicated by the parameter IRQn .