mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
arm: implement udelay()
Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
77b8dfec88
commit
335ba242c5
3 files changed
+11
-3
No files matched your search
@@ -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);
|
||||
@@ -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
|
||||
|
||||
@@ -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) */
|
||||
/*
|
||||
|
||||