]> git.saurik.com Git - apple/xnu.git/blobdiff - libsyscall/wrappers/mach_continuous_time.c
xnu-6153.81.5.tar.gz
[apple/xnu.git] / libsyscall / wrappers / mach_continuous_time.c
index 353ef0d87d9cef4f548c937fae0b93c47eb1cd75..c128ac1b7fd4bf134edd1f9ffaf4d0d068d54c8b 100644 (file)
@@ -59,11 +59,11 @@ kern_return_t
 _mach_continuous_hwclock(uint64_t *cont_time __unused)
 {
 #if defined(__arm64__)
+#define ISB_SY          0xf
        uint8_t cont_hwclock = *((uint8_t*)_COMM_PAGE_CONT_HWCLOCK);
-       uint64_t timebase;
        if (cont_hwclock) {
-               __asm__ volatile ("isb\n" "mrs %0, CNTPCT_EL0" : "=r"(timebase));
-               *cont_time = timebase;
+               __builtin_arm_isb(ISB_SY);
+               *cont_time = __builtin_arm_rsr64("CNTPCT_EL0");
                return KERN_SUCCESS;
        }
 #endif