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

[Minios-devel] [UNIKRAFT PATCH 2/7] plat/linuxu: Implement ukplat_wall_clock()



Signed-off-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>
---
 plat/linuxu/time.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/plat/linuxu/time.c b/plat/linuxu/time.c
index 13439ad5..7b88ed4b 100644
--- a/plat/linuxu/time.c
+++ b/plat/linuxu/time.c
@@ -59,6 +59,22 @@ __nsec ukplat_monotonic_clock(void)
        return ret;
 }
 
+__nsec ukplat_wall_clock(void)
+{
+       struct k_timespec tp;
+       __nsec ret;
+       int rc;
+
+       rc = sys_clock_gettime(CLOCK_REALTIME, &tp);
+       if (unlikely(rc != 0))
+               return 0;
+
+       ret = ukarch_time_sec_to_nsec((__nsec) tp.tv_sec);
+       ret += (__nsec) tp.tv_nsec;
+
+       return ret;
+}
+
 static int timer_handler(void *arg __unused)
 {
        /* We only use the timer interrupt to wake up. As we end up here, the
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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