The system counter: read in its stub

The SDK's system tick is the game reading the counter register itself (MRS CNTPCT_EL0 or CNTVCT_EL0), which a game that times its work closely does often. Its stub makes no outcall: it reads the host's virtual counter after an ISB, as Linux's vDSO reads it, makes it nanoseconds with a 64.64 factor of the host's frequency (Eden's WriteCntpctHandler scales it the same way), takes away the guest clock's start (or reads where a pause stopped the clock), and makes 19.2 MHz ticks as guest_ticks does (runtime/clock.c). So that these reads and svcGetSystemTick, which still goes through an outcall, never go back against each other, guest time under NCE follows the host's counter too (clock_from_counter), from where it was when NCE started, in the stub's arithmetic.

Limits:


Made from docs/platforms/nx/nce.md at 69237645142c. GPL-3.0-or-later.