3 #if defined(__ARM_ARCH_7A__) && defined(__GNUC__)
4 unsigned int cycles_lo
, cycles_hi
;
5 asm volatile("mrrc p15, 1, %0, %1, c14" : "=r" (cycles_lo
), "=r" (cycles_hi
));
7 // Return 0 (success) if low or high 32 bits contained anything non-trivial
8 return !(cycles_lo
> 0 || cycles_hi
> 0);
10 #error This architecture/compiler does not support ARMv7 32-bit cycle counters