FreeRTOS/Demo/RISC-V_RV64_PolarFire_SoftConsole/polarfire_hal/platform/mpfs_hal/common/mss_clint.c
/*------------------------------------------------------------------------------
 * RISC-V interrupt handler for machine timer interrupts.
 */
RISC-V interrupt handler for machine timer interrupts.
RISC - V interrupt handler for machine timer interrupts .
void handle_m_timer_interrupt(void)
{
    volatile uint64_t hart_id = read_csr(mhartid);
    volatile uint32_t error_loop;
    clear_csr(mie, MIP_MTIP);
    switch(hart_id)
    {
        case 0U:
            SysTick_Handler_h0_IRQHandler();
            break;
        case 1U:
            SysTick_Handler_h1_IRQHandler();
            break;
        case 2U:
            SysTick_Handler_h2_IRQHandler();
            break;
        case 3U:
            SysTick_Handler_h3_IRQHandler();
            break;
        case 4U:
            SysTick_Handler_h4_IRQHandler();
            break;
        default:
            while (hart_id != 0U)
             {
                 error_loop++;
             }
            break;
    }
    CLINT->MTIMECMP[read_csr(mhartid)] = CLINT->MTIME + g_systick_increment[hart_id];
    set_csr(mie, MIP_MTIP);
}
void handle_m_timer_interrupt ( void ) { volatile uint64_t hart_id = read_csr ( mhartid ) ; volatile uint32_t error_loop ; clear_csr ( mie , MIP_MTIP ) ; switch ( hart_id ) { case 0U : SysTick_Handler_h0_IRQHandler ( ) ; break ; case 1U : SysTick_Handler_h1_IRQHandler ( ) ; break ; case 2U : SysTick_Handler_h2_IRQHandler ( ) ; break ; case 3U : SysTick_Handler_h3_IRQHandler ( ) ; break ; case 4U : SysTick_Handler_h4_IRQHandler ( ) ; break ; default : while ( hart_id != 0U ) { error_loop ++ ; } break ; } CLINT -> MTIMECMP [ read_csr ( mhartid ) ] = CLINT -> MTIME + g_systick_increment [ hart_id ] ; set_csr ( mie , MIP_MTIP ) ; }
RISC-V interrupt handler for machine timer interrupts.
RISC - V interrupt handler for machine timer interrupts .