t2080rdb TSC

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

t2080rdb TSC

911 次查看
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 项奖励
回复
0 回复数