t2080rdb TSC

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

t2080rdb TSC

950件の閲覧回数
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 返答(返信)