You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/07/22 15:46:49 UTC

(nuttx) 01/04: riscv/nsbi: unblock up_udelay

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 3b9a346fe770ae5ec3b1f4c0aae8f2ad9e708b43
Author: Yanfeng Liu <yf...@qq.com>
AuthorDate: Mon Jul 22 13:14:52 2024 +0800

    riscv/nsbi: unblock up_udelay
    
    This fixes the always zero time in NuttSBI case as the `error` field
    contains the correct timestamp. This in turn also fixes the block of
    `up_udelay()` which further leads to boot failure of `canmv230:master`
    config.
    
    Signed-off-by: Yanfeng Liu <yf...@qq.com>
---
 arch/risc-v/src/common/supervisor/riscv_sbi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/risc-v/src/common/supervisor/riscv_sbi.c b/arch/risc-v/src/common/supervisor/riscv_sbi.c
index 0daceece06..c8bdd9425e 100644
--- a/arch/risc-v/src/common/supervisor/riscv_sbi.c
+++ b/arch/risc-v/src/common/supervisor/riscv_sbi.c
@@ -111,7 +111,7 @@ uint64_t riscv_sbi_get_time(void)
   sbiret_t ret = sbi_ecall(SBI_EXT_FIRMWARE, SBI_EXT_FIRMWARE_GET_MTIME,
                            0, 0, 0, 0, 0, 0);
 
-  return ret.value;
+  return ret.error;
 #elif defined(CONFIG_ARCH_RV64)
   return READ_CSR(CSR_TIME);
 #else