From: Tim Deegan Date: Tue, 13 Mar 2012 15:10:52 +0000 (+0000) Subject: arm: implement udelay() X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=335ba242c55caf5c0259ade192f9e028dcfae9d8;p=xen.git arm: implement udelay() Signed-off-by: Tim Deegan Committed-by: Ian Campbell --- diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S index 3f2cc4b1ca..f096cb55dc 100644 --- a/xen/arch/arm/dummy.S +++ b/xen/arch/arm/dummy.S @@ -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 --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c index 13c1254cd4..437dc71234 100644 --- a/xen/arch/arm/time.c +++ b/xen/arch/arm/time.c @@ -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 --git a/xen/include/asm-arm/delay.h b/xen/include/asm-arm/delay.h index 625077472e..94a712905d 100644 --- a/xen/include/asm-arm/delay.h +++ b/xen/include/asm-arm/delay.h @@ -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) */ /*