From: Paul Semel <phen...@amazon.de>

Signed-off-by: Paul Semel <phen...@amazon.de>
---
 common/time.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/common/time.c b/common/time.c
index 1f0f289..1d7fef5 100644
--- a/common/time.c
+++ b/common/time.c
@@ -110,6 +110,15 @@ int gettimeofday(struct timeval *tp)
     return 0;
 }
 
+static inline void nspin_sleep(uint64_t t)
+{
+    uint64_t curr = since_boot_time();
+    uint64_t end = curr + t;
+
+    while ( curr < end )
+        curr = since_boot_time();
+}
+
 /*
  * Local variables:
  * mode: C
-- 
2.16.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to