diff --git a/src/arch/riscv/port.c b/src/arch/riscv/port.c index dbed4c3..aa4e870 100644 --- a/src/arch/riscv/port.c +++ b/src/arch/riscv/port.c @@ -35,6 +35,8 @@ #include "task.h" #include "portmacro.h" #include +#include +#include /* Standard includes. */ #include "string.h" @@ -223,3 +225,7 @@ void freertos_risc_v_application_interrupt_handler( void ) { extern void plic_handle(); plic_handle(); } + +void riscv_timer_interrupt_handler( void ) { + timer_set(uxTimerIncrementsForOneTick); +} diff --git a/src/arch/riscv/portASM.S b/src/arch/riscv/portASM.S index 451da8f..953c6fe 100644 --- a/src/arch/riscv/portASM.S +++ b/src/arch/riscv/portASM.S @@ -384,15 +384,7 @@ handle_interrupt: addi t1, t0, 5 /* 0x8000[]0005 == sueprvisor timer interrupt. */ bne a0, t1, application_interrupt_handler - csrr t1, time - ld a0, uxTimerIncrementsForOneTick -#define SBI_EXTID_TIME (0x54494D45) -#define SBI_SET_TIMER_FID (0x0) - /* ecall to sbi_set_timer */ - add a0, a0, t1 - li a6, SBI_SET_TIMER_FID - li a7, SBI_EXTID_TIME - ecall + jal riscv_timer_interrupt_handler jal xTaskIncrementTick beqz a0, processed_source /* Don't switch context if incrementing tick didn't unblock a task. */ diff --git a/src/baremetal-runtime b/src/baremetal-runtime index f384f84..3dc57ca 160000 --- a/src/baremetal-runtime +++ b/src/baremetal-runtime @@ -1 +1 @@ -Subproject commit f384f846ededc0da4dff86231e8ad2d97c363bc1 +Subproject commit 3dc57cad6e9212ea3ea50aa7bf9bee80a90c2f65