]> git.saurik.com Git - apple/xnu.git/blobdiff - libsyscall/wrappers/mach_bridge_remote_time.c
xnu-7195.101.1.tar.gz
[apple/xnu.git] / libsyscall / wrappers / mach_bridge_remote_time.c
index cc56a81b2b8f6171d943b942897bec0c1a0bf2ac..1158c2431eee3639ab7bcfa185ce1e7392266c57 100644 (file)
@@ -50,7 +50,8 @@ mach_bridge_remote_time(__unused uint64_t local_time)
        uint64_t now = 0;
        struct bt_params params = {};
 
-       volatile struct bt_params *commpage_bt_params_p = (struct bt_params *)_COMM_PAGE_REMOTETIME_PARAMS;
+       COMM_PAGE_SLOT_TYPE(struct bt_params) commpage_bt_params_p =
+           COMM_PAGE_SLOT(struct bt_params, REMOTETIME_PARAMS);
        volatile uint64_t *base_local_ts_p = &commpage_bt_params_p->base_local_ts;
        volatile uint64_t *base_remote_ts_p = &commpage_bt_params_p->base_remote_ts;
        volatile double *rate_p = &commpage_bt_params_p->rate;
@@ -71,8 +72,8 @@ mach_bridge_remote_time(__unused uint64_t local_time)
                 * This barrier prevents the second read of base_local_ts from being reordered
                 * w.r.t the reads of other values in bt_params.
                 */
-               __asm__ volatile("dmb ishld" ::: "memory");
-       } while(params.base_local_ts && (params.base_local_ts != commpage_bt_params_p->base_local_ts));
+               __asm__ volatile ("dmb ishld" ::: "memory");
+       } while (params.base_local_ts && (params.base_local_ts != commpage_bt_params_p->base_local_ts));
 
        if (!local_time) {
                local_time = now;