Merge pull request #87 from akopytov/aarch64_timer

Add AArch64 timer support to rdtsc().
ck_pring
Olivier Houchard 8 years ago committed by GitHub
commit d8d5b01a1a

@ -442,6 +442,11 @@ rdtsc(void)
} while (snapshot != high); } while (snapshot != high);
return (((uint64_t)high << 32) | low); return (((uint64_t)high << 32) | low);
#elif defined(__aarch64__)
uint64_t r;
__asm __volatile__ ("mrs %0, cntvct_el0" : "=r" (r) : : "memory");
return r;
#else #else
return 0; return 0;
#endif #endif

Loading…
Cancel
Save