mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-23 13:22:40 +02:00
19 lines
381 B
C
19 lines
381 B
C
/**
|
|
* @file counter.h
|
|
* @brief AArch64 system counter-timer.
|
|
* @author fincs
|
|
* @copyright libnx Authors
|
|
*/
|
|
#pragma once
|
|
#include "../types.h"
|
|
|
|
/**
|
|
* @brief Gets the current system tick.
|
|
* @return The current system tick.
|
|
*/
|
|
static inline u64 armGetSystemTick(void) {
|
|
u64 ret;
|
|
__asm__ __volatile__ ("mrs %x[data], cntpct_el0" : [data] "=r" (ret));
|
|
return ret;
|
|
}
|