1
0

sparccpuinfo.c 264 B

123456789101112131415
  1. #include <stdio.h>
  2. #include <sys/types.h>
  3. #include "osfreq.c"
  4. long long cpucycles_sparccpuinfo(void)
  5. {
  6. long long result;
  7. asm volatile("rd %%tick,%0" : "=r" (result));
  8. return result;
  9. }
  10. long long cpucycles_sparccpuinfo_persecond(void)
  11. {
  12. return osfreq();
  13. }