Re: [patch] __volatile__ needed in get_cycles()?

Richard Henderson (rth@twiddle.net)
Sat, 27 Mar 1999 19:40:17 -0800


On Sat, Mar 27, 1999 at 12:44:22PM +0000, Tigran Aivazian wrote:
> x = get_cycles();
> __asm__("cpuid");
> y = get_cycles();
[...]
> - __asm__("rdtsc":"=a" (eax), "=d" (edx));
> + __asm__ __volatile__ ("rdtsc":"=a" (eax), "=d" (edx));

Yes, volatile is needed to keep the asm from being moved "too far".

r~

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/