Signed-off-by: Oleksii Kurochko <[email protected]>
---
 xen/arch/riscv/include/asm/time.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/riscv/include/asm/time.h 
b/xen/arch/riscv/include/asm/time.h
index 63bdd471ccac..3d013a3ace0f 100644
--- a/xen/arch/riscv/include/asm/time.h
+++ b/xen/arch/riscv/include/asm/time.h
@@ -29,6 +29,11 @@ static inline s_time_t ticks_to_ns(uint64_t ticks)
     return muldiv64(ticks, MILLISECS(1), cpu_khz);
 }
 
+static inline uint64_t ns_to_ticks(s_time_t ns)
+{
+    return muldiv64(ns, cpu_khz, MILLISECS(1));
+}
+
 void preinit_xen_time(void);
 
 #endif /* ASM__RISCV__TIME_H */
-- 
2.52.0


Reply via email to