xen-vtx-unstable

view xen/arch/x86/delay.c @ 6759:b5d91089e42c

Newer binutils is a bit stricter and errors out when you try
to use movl on a 16 bit word on x86_64. Using just a "mov"
compiles fine and should result in the same code.

{standard input}: Assembler messages:
{standard input}:2138: Error: suffix or operands invalid for `mov'
{standard input}:2140: Error: suffix or operands invalid for `mov'
{standard input}:2142: Error: suffix or operands invalid for `mov'
{standard input}:2144: Error: suffix or operands invalid for `mov'

Signed-off-by: Rik van Riel <riel@redhat.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Sep 13 10:21:22 2005 +0000 (2005-09-13)
parents 41a5181f74df
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 }