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

[Xen-devel] [PATCH 1 of 9] arm: implement udelay()



# HG changeset patch
# User Tim Deegan <tim@xxxxxxx>
# Date 1331300346 0
# Node ID 7a00e582027ed2793f4ee393f94ddf790b61c39f
# Parent  10c5ba0b5af2dd209d4f7d27649dea5827652d9c
arm: implement udelay()

Signed-off-by: Tim Deegan <tim@xxxxxxx>

diff -r 10c5ba0b5af2 -r 7a00e582027e xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S      Fri Mar 09 09:58:41 2012 +0000
+++ b/xen/arch/arm/dummy.S      Fri Mar 09 13:39:06 2012 +0000
@@ -62,5 +62,4 @@ DUMMY(gmfn_to_mfn);
 DUMMY(hypercall_create_continuation);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
-DUMMY(__udelay);
 DUMMY(wallclock_time);
diff -r 10c5ba0b5af2 -r 7a00e582027e xen/arch/arm/time.c
--- a/xen/arch/arm/time.c       Fri Mar 09 09:58:41 2012 +0000
+++ b/xen/arch/arm/time.c       Fri Mar 09 13:39:06 2012 +0000
@@ -171,6 +171,16 @@ void __cpuinit init_timer_interrupt(void
     request_irq(30, timer_interrupt, 0, "phytimer", NULL);
 }
 
+/* Wait a set number of microseconds */
+void udelay(unsigned long usecs)
+{
+    s_time_t deadline = get_s_time() + 1000 * (s_time_t) usecs;
+    while ( get_s_time() - deadline < 0 )
+        ;
+    dsb();
+    isb();
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 10c5ba0b5af2 -r 7a00e582027e xen/include/asm-arm/delay.h
--- a/xen/include/asm-arm/delay.h       Fri Mar 09 09:58:41 2012 +0000
+++ b/xen/include/asm-arm/delay.h       Fri Mar 09 13:39:06 2012 +0000
@@ -1,8 +1,7 @@
 #ifndef _ARM_DELAY_H
 #define _ARM_DELAY_H
 
-extern void __udelay(unsigned long usecs);
-#define udelay(n) __udelay(n)
+extern void udelay(unsigned long usecs);
 
 #endif /* defined(_ARM_DELAY_H) */
 /*

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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