From: Jan Janssen Date: Thu, 26 Jan 2023 22:10:53 +0000 (+0100) Subject: boot: Use aarch64 virtual counter X-Git-Tag: v253-rc2~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2df8574af035ce4f515beb7c0adf83973440a8a6;p=thirdparty%2Fsystemd.git boot: Use aarch64 virtual counter This should be used in VMs and should also yield the same value when running on real devices. It is also what grub uses. Fixes: #26224 --- diff --git a/src/boot/efi/ticks.c b/src/boot/efi/ticks.c index 2f6ff878ca9..65492969989 100644 --- a/src/boot/efi/ticks.c +++ b/src/boot/efi/ticks.c @@ -33,7 +33,7 @@ static uint64_t ticks_read(void) { #elif defined(__aarch64__) static uint64_t ticks_read(void) { uint64_t val; - __asm__ volatile ("mrs %0, cntpct_el0" : "=r" (val)); + asm volatile("mrs %0, cntvct_el0" : "=r"(val)); return val; } #else @@ -45,7 +45,7 @@ static uint64_t ticks_read(void) { #if defined(__aarch64__) static uint64_t ticks_freq(void) { uint64_t freq; - __asm__ volatile ("mrs %0, cntfrq_el0": "=r" (freq)); + asm volatile("mrs %0, cntfrq_el0" : "=r"(freq)); return freq; } #else