ia64/xen-unstable

view xen/arch/x86/delay.c @ 19835:edfdeb150f27

Fix buildsystem to detect udev > version 124

udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.

Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:02:37 2009 +0100 (2009-06-25)
parents 043a4aa24781
children
line source
1 /*
2 * Precise Delay Loops for i386
3 *
4 * Copyright (C) 1993 Linus Torvalds
5 * Copyright (C) 1997 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
6 *
7 * The __delay function must _NOT_ be inlined as its execution time
8 * depends wildly on alignment on many x86 processors. The additional
9 * jump magic is needed to get the timing stable on all the CPU's
10 * we have to worry about.
11 */
13 #include <xen/config.h>
14 #include <xen/delay.h>
15 #include <xen/time.h>
16 #include <asm/msr.h>
17 #include <asm/processor.h>
19 void __udelay(unsigned long usecs)
20 {
21 unsigned long ticks = usecs * (cpu_khz / 1000);
22 unsigned long s, e;
24 rdtscl(s);
25 do
26 {
27 rep_nop();
28 rdtscl(e);
29 } while ((e-s) < ticks);
30 }