FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/polarfire_hal/platform/mpfs_hal/common/mss_plic.h
/***************************************************************************/
/**
 * This function is only called from one hart on startup
 */
This function is only called from one hart on startup
This function is only called from one hart on startup
static inline void PLIC_init_on_reset(void)
{
    uint32_t inc;
    for(inc = 0U; inc < PLIC_NUM_SOURCES; ++inc)
    {
        PLIC->SOURCE_PRIORITY[inc]  = 0U;
    }
    for(inc = 0U; inc < NUM_CLAIM_REGS; ++inc)
    {
        PLIC->TARGET[inc].PRIORITY_THRESHOLD  = 7U;
    }
    for(inc = 0UL; inc < PLIC_SET_UP_REGISTERS; inc++)
    {
        PLIC->HART0_MMODE_ENA[inc] = 0U;
        PLIC->HART1_MMODE_ENA[inc] = 0U;
        PLIC->HART1_SMODE_ENA[inc] = 0U;
        PLIC->HART2_MMODE_ENA[inc] = 0U;
        PLIC->HART2_SMODE_ENA[inc] = 0U;
        PLIC->HART3_MMODE_ENA[inc] = 0U;
        PLIC->HART3_SMODE_ENA[inc] = 0U;
        PLIC->HART4_MMODE_ENA[inc] = 0U;
        PLIC->HART4_SMODE_ENA[inc] = 0U;
    }
    PLIC_ClearPendingIRQ();
}
static inline void PLIC_init_on_reset ( void ) { uint32_t inc ; for ( inc = 0U ; inc < PLIC_NUM_SOURCES ; ++ inc ) { PLIC -> SOURCE_PRIORITY [ inc ] = 0U ; } for ( inc = 0U ; inc < NUM_CLAIM_REGS ; ++ inc ) { PLIC -> TARGET [ inc ] . PRIORITY_THRESHOLD = 7U ; } for ( inc = 0UL ; inc < PLIC_SET_UP_REGISTERS ; inc ++ ) { PLIC -> HART0_MMODE_ENA [ inc ] = 0U ; PLIC -> HART1_MMODE_ENA [ inc ] = 0U ; PLIC -> HART1_SMODE_ENA [ inc ] = 0U ; PLIC -> HART2_MMODE_ENA [ inc ] = 0U ; PLIC -> HART2_SMODE_ENA [ inc ] = 0U ; PLIC -> HART3_MMODE_ENA [ inc ] = 0U ; PLIC -> HART3_SMODE_ENA [ inc ] = 0U ; PLIC -> HART4_MMODE_ENA [ inc ] = 0U ; PLIC -> HART4_SMODE_ENA [ inc ] = 0U ; } PLIC_ClearPendingIRQ ( ) ; }
This function is only called from one hart on startup
This function is only called from one hart on startup
/* default all priorities so effectively disabled */ /* priority must be greater than threshold to be enabled, so setting to
         * 7 disables */ /* and clear all the enables */ /* clear any pending interrupts- in case already there */