riscv/nsbi: fix up_udelay for rv32

This fixes riscv_sbi_get_time for rv32 and NuttSBI is used.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
Yanfeng Liu 2024-07-23 15:22:44 +08:00 committed by Xiang Xiao
parent 4ef3eeb305
commit a36c168e54
1 changed files with 4 additions and 0 deletions

View File

@ -111,7 +111,11 @@ uint64_t riscv_sbi_get_time(void)
sbiret_t ret = sbi_ecall(SBI_EXT_FIRMWARE, SBI_EXT_FIRMWARE_GET_MTIME, sbiret_t ret = sbi_ecall(SBI_EXT_FIRMWARE, SBI_EXT_FIRMWARE_GET_MTIME,
0, 0, 0, 0, 0, 0); 0, 0, 0, 0, 0, 0);
# ifdef CONFIG_ARCH_RV64
return ret.error; return ret.error;
# else
return (((uint64_t)ret.value << 32) | ret.error);
# endif
#elif defined(CONFIG_ARCH_RV64) #elif defined(CONFIG_ARCH_RV64)
return READ_CSR(CSR_TIME); return READ_CSR(CSR_TIME);
#else #else