![]() | |||||||||||||
Messages in this thread
|
On Wed, Dec 12, 2007 at 12:31:18AM +0100, Rene Herman wrote:
> asm volatile ("rdtsc": "=A" (tsc));
rdtsc returns a 64-bit value in two 32-bit regs, you need to do
inline unsigned long long rdtsc(void)
{
unsigned int lo, hi;
asm volatile ("rdtsc": "=a" (lo), "=d" (hi));
return (unsigned long long)hi << 32 | lo;
}
as in msr.h, otherwise you'll only be looking at the value in %rax.
cheers,
Kyle
| ||||||||||||
| Last update: 2007-12-12 06:25 [from the cache] ©2003-2008 | |||||||||||||