t2080rdb TSC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

t2080rdb TSC

163 Views
hongyuanzhao
Contributor I

Convert the value of TSC to time


static __inline__ unsigned long long rdtsc(void)
{
unsigned long long int result=0;
unsigned long int upper, lower,tmp;
__asm__ volatile(
"0: \n"
"\tmftbu %0 \n"
"\tmftb %1 \n"
"\tmftbu %2 \n"
"\tcmpw %2,%0 \n"
"\tbne 0b \n"
: "=r"(upper),"=r"(lower),"=r"(tmp)
);
result = upper;
result = result<<32;
result = result|lower;

return(result);
}

0 Kudos
Reply
0 Replies