7bd1550195
* Checkpoint * cpu cycle ffi * Rename * mixnode feature * Bundle libcpucycles
20 lines
359 B
C
20 lines
359 B
C
// version 20230105
|
|
// public domain
|
|
// djb
|
|
// adapted from supercop/cpucycles/armv8.c
|
|
|
|
#include "cpucycles_internal.h"
|
|
|
|
long long ticks(void)
|
|
{
|
|
long long result;
|
|
asm volatile("mrs %0, PMCCNTR_EL0" : "=r" (result));
|
|
return result;
|
|
}
|
|
|
|
long long ticks_setup(void)
|
|
{
|
|
if (!cpucycles_works(ticks)) return cpucycles_SKIP;
|
|
return cpucycles_CYCLECOUNTER;
|
|
}
|