Skip to content

Commit

Permalink
riscv/nsbi: fix up_udelay for rv32
Browse files Browse the repository at this point in the history
This fixes riscv_sbi_get_time for rv32 and NuttSBI is used.

Signed-off-by: Yanfeng Liu <[email protected]>
  • Loading branch information
yf13 authored and xiaoxiang781216 committed Aug 5, 2024
1 parent 4ef3eeb commit a36c168
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/risc-v/src/common/supervisor/riscv_sbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ 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);

# ifdef CONFIG_ARCH_RV64
return ret.error;
# else
return (((uint64_t)ret.value << 32) | ret.error);
# endif
#elif defined(CONFIG_ARCH_RV64)
return READ_CSR(CSR_TIME);
#else
Expand Down

0 comments on commit a36c168

Please sign in to comment.