smol-gilbraltar/include/cpu_aarch64.h

14 lines
235 B
C
Raw Permalink Normal View History

2024-12-23 00:46:17 +00:00
#ifndef __GILBRALTAR_CPU_AARCH64__
#define __GILBRALTAR_CPU_AARCH64__
#include <stdint.h>
static inline uint64_t cpu_cntpct(void) {
uint64_t val;
__asm__ __volatile("mrs %0, cntpct_el0" : "=r"(val)::);
return (val);
}
#endif