From b032dff1616fe64a4dfec63e593f0fac634ef3ab Mon Sep 17 00:00:00 2001 From: zhangjun <2281979437@qq.com> Date: Sun, 30 Jul 2017 19:46:28 +0800 Subject: fix bug in rt_hw_context_switch_interrupt_do save sp to old thread clear rt_thread_switch_interrupt_flag always enable interrupt after rt_hw_context_switch judeg the type of interrupt in trap_entry, then call handler(Machine timer interrupt of Machine external interrupt) --- libcpu/risc-v/e310/init.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'libcpu/risc-v/e310/init.c') diff --git a/libcpu/risc-v/e310/init.c b/libcpu/risc-v/e310/init.c index 3a2b39614c..a8db529804 100644 --- a/libcpu/risc-v/e310/init.c +++ b/libcpu/risc-v/e310/init.c @@ -187,26 +187,6 @@ extern void handle_m_ext_interrupt(); extern void handle_m_time_interrupt(); #endif -uintptr_t handle_trap(uintptr_t mcause, uintptr_t epc) -{ - if (0){ -#ifdef USE_PLIC - // External Machine-Level interrupt from PLIC - } else if ((mcause & MCAUSE_INT) && ((mcause & MCAUSE_CAUSE) == IRQ_M_EXT)) { - handle_m_ext_interrupt(); -#endif -#ifdef USE_M_TIME - // External Machine-Level interrupt from PLIC - } else if ((mcause & MCAUSE_INT) && ((mcause & MCAUSE_CAUSE) == IRQ_M_TIMER)){ - handle_m_time_interrupt(); -#endif - } - else { - write(1, "trap\n", 5); - _exit(1 + mcause); - } - return epc; -} void _init() { -- cgit v1.3.1