/* Query and Distribution Entry for Exception and Interrupt Sources */
rt_weak void rt_rv32_system_irq_handler(rt_uint32_t mcause)
/* Query and Distribution Entry for Exception and Interrupt Sources */
rt_weak void rt_rv32_system_irq_handler(rt_uint32_t mcause)
{
    rt_uint32_t mscratch = read_csr(0x340);
    rt_uint32_t irq_id = (mcause & 0x1F);
    rt_uint32_t exception = !(mcause & 0x80000000);
    if(exception)
    {
        s_stack_frame = (rt_hw_stack_frame_t *)mscratch;
        rt_show_stack_frame();
    }
    else
    {
        rv32irq_table[irq_id].handler(irq_id, rv32irq_table[irq_id].param);
    }
}