debuggers.hg

view xen/arch/x86/delay.c @ 3674:fb875591fd72

bitkeeper revision 1.1159.223.63 (42028527-fv-d9BM0_LRp8UKGP19gQ)

Fix NMI deferral.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Thu Feb 03 20:10:15 2005 +0000 (2005-02-03)
parents 92b8e1efa784
children 41a5181f74df
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 <asm/msr.h>
16 #include <asm/processor.h>
18 void __udelay(unsigned long usecs)
19 {
20 unsigned long ticks = usecs * ticks_per_usec;
21 unsigned long s, e;
23 rdtscl(s);
24 do
25 {
26 rep_nop();
27 rdtscl(e);
28 } while ((e-s) < ticks);
29 }