[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 11/15] xen/riscv: introduce ns_to_ticks()



Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
---
 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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.