FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/polarfire_hal/platform/mpfs_hal/common/mss_plic.h
/***************************************************************************/
/**
 * The function PLIC_DisableIRQ() disables the external interrupt for the
 * interrupt number indicated by the parameter IRQn.

 * NOTE:
 *     This function can be used to disable the external interrupt from outside
 *     external interrupt handler function.
 *     This function MUST NOT be used from within the External Interrupt
 *     handler.
 *     If you wish to disable the external interrupt while the interrupt handler
 *     for that external interrupt is executing then you must use the return
 *     value EXT_IRQ_DISABLE to return from the extern interrupt handler.
 */
The function PLIC_DisableIRQ() disables the external interrupt for the
interrupt number indicated by the parameter IRQn.

This function can be used to disable the external interrupt from outside
external interrupt handler function.
This function MUST NOT be used from within the External Interrupt
handler.
If you wish to disable the external interrupt while the interrupt handler
for that external interrupt is executing then you must use the return
value EXT_IRQ_DISABLE to return from the extern interrupt handler.
The function PLIC_DisableIRQ () disables the external interrupt for the interrupt number indicated by the parameter IRQn . This function can be used to disable the external interrupt from outside external interrupt handler function . This function MUST NOT be used from within the External Interrupt handler . If you wish to disable the external interrupt while the interrupt handler for that external interrupt is executing then you must use the return value EXT_IRQ_DISABLE to return from the extern interrupt handler .
static inline void PLIC_DisableIRQ(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_DisableIRQ ( 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_DisableIRQ() disables the external interrupt for the
 interrupt number indicated by the parameter IRQn.
The function PLIC_DisableIRQ () disables the external interrupt for the interrupt number indicated by the parameter IRQn .