int isTSCAvail(void) { struct sigaction act, oldact; rawTime64 v; int retVal=0; act.sa_handler = int_handler; sigemptyset(&act.sa_mask); act.sa_flags = 0; if(sigaction(SIGSEGV, &act, &oldact) < 0) { perror("isTSCAvail: Error setting up SIGSEGV handler"); exit(1); } if(sigsetjmp(jmpbuf, 1)==0) { jumpok = 1; getTSC(v); retVal=1; } else { retVal=0; } if(sigaction(SIGSEGV, &oldact, NULL) < 0) { perror("isTSCAvail: Error resetting the SIGSEGV handler"); exit(1); } return retVal; }
inline cycle_t get_cycles_now() { return getTSC(); }
rawTime64 getRawTimeTSC() { rawTime64 v; getTSC( v ); return v; } /* end getRawTimeTSC() */