From f5e647de0d9e135379a22642767dc43a38691178 Mon Sep 17 00:00:00 2001 From: Stephen Marz Date: Sun, 24 May 2020 13:34:39 -0400 Subject: [PATCH] Add gettime to syscalls --- risc_v/src/syscall.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/risc_v/src/syscall.rs b/risc_v/src/syscall.rs index f8de764..b070e8b 100755 --- a/risc_v/src/syscall.rs +++ b/risc_v/src/syscall.rs @@ -204,6 +204,11 @@ pub unsafe fn do_syscall(mepc: usize, frame: *mut TrapFrame) -> usize { // println!("TX: {} {} {} {} {}", dev, x, y, width, height); gpu::transfer(dev, x, y, width, height); + mepc + 4 + }, + 1062 => { + // gettime + (*frame).regs[Registers::A0 as usize] = crate::cpu::get_mtime(); mepc + 4 } _ => {