浏览代码

sbi-testing: fix time module build on rv32

TODO: support RV32 where there are time and timeh registers.
Signed-off-by: Zhouqi Jiang <[email protected]>
Zhouqi Jiang 1 年之前
父节点
当前提交
053c23b6a3
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      sbi-testing/src/time.rs

+ 5 - 2
sbi-testing/src/time.rs

@@ -43,8 +43,8 @@ pub fn test(delay: u64, mut f: impl FnMut(Case)) {
         return;
     }
     f(Case::Begin);
-    let begin: u64;
-    let end: u64;
+    let begin: usize;
+    let end: usize;
     let mut ok = 0xffusize;
     unsafe {
         core::arch::asm!(
@@ -62,6 +62,9 @@ pub fn test(delay: u64, mut f: impl FnMut(Case)) {
             ok    = inlateout(reg) ok,
         );
     }
+    // TODO: support RV32 where there are time and timeh registers.
+    let begin: u64 = begin as u64;
+    let end: u64 = end as u64;
     if ok != 0 {
         f(Case::ReadFailed);
         return;