- The variable the result of rdtsc is placed in also needs to be marked as volatile

to ensure that GCC doesn't optimize the function call away.

SVN r1510 (trunk)
This commit is contained in:
Randy Heit 2009-03-28 03:26:05 +00:00
parent e59ee12f2a
commit 366ed7047a

View file

@ -130,7 +130,7 @@ inline volatile unsigned long long rdtsc()
if (CPU.bRDTSC)
#endif
{
register unsigned long long tsc asm("eax");
register unsigned volatile long long tsc asm("eax");
asm volatile ("\trdtsc\n" : : : "eax", "edx");
return tsc;
}