]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/x86_64/machine_remote_time.c
xnu-6153.81.5.tar.gz
[apple/xnu.git] / osfmk / x86_64 / machine_remote_time.c
index 3c834c04142979bc4cc6867a1b1b1ba29226e6e4..6172f3181186a720ceaae26a8feb00011851cbad 100644 (file)
@@ -27,7 +27,7 @@
  */
 #include <kern/misc_protos.h>
 #include <x86_64/machine_remote_time.h>
-#include <stdatomic.h>
+#include <machine/atomic.h>
 #include <kern/locks.h>
 #include <kern/clock.h>
 
@@ -55,10 +55,10 @@ mach_bridge_register_regwrite_timestamp_callback(mach_bridge_regwrite_timestamp_
 {
        static uint64_t delay_amount = 0;
 
-       if (!atomic_load(&bt_init_flag)) {
+       if (!os_atomic_load(&bt_init_flag, relaxed)) {
                mach_bridge_timer_init();
                nanoseconds_to_absolutetime(DELAY_INTERVAL_NS, &delay_amount);
-               bt_init_flag = 1;
+               os_atomic_store(&bt_init_flag, 1, release);
        }
 
        lck_spin_lock(bt_maintenance_lock);