diff options
author | Tim Deegan <tim@xen.org> | 2012-03-13 15:10:52 +0000 |
---|---|---|
committer | Tim Deegan <tim@xen.org> | 2012-03-13 15:10:52 +0000 |
commit | 335ba242c55caf5c0259ade192f9e028dcfae9d8 (patch) | |
tree | e6fe022a020ff3bb298a021e9e47265aec8e237c /xen | |
parent | 77b8dfec88acdc71138e3af7e2603ad8d72eb926 (diff) | |
download | xen-335ba242c55caf5c0259ade192f9e028dcfae9d8.tar.gz xen-335ba242c55caf5c0259ade192f9e028dcfae9d8.tar.bz2 xen-335ba242c55caf5c0259ade192f9e028dcfae9d8.zip |
arm: implement udelay()
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen')
-rw-r--r-- | xen/arch/arm/dummy.S | 1 | ||||
-rw-r--r-- | xen/arch/arm/time.c | 10 | ||||
-rw-r--r-- | xen/include/asm-arm/delay.h | 3 |
3 files changed, 11 insertions, 3 deletions
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) */ /* |