From 81747ac6d3e846d1955edaa94dee9065e541b7d8 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Mon, 7 Sep 2015 13:04:39 +0200 Subject: kern: use proper memory fences when handling the mapped time * include/mach/time_value.h (struct mapped_time_value): Adjust comment. * kern/mach_clock.c (mtime): Likewise. Also make it volatile. (update_mapped_time): Use full hardware barriers. (read_mapped_time): New macro with proper fences. (record_time_stamp, host_get_time): Use the new macro. --- include/mach/time_value.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/mach') diff --git a/include/mach/time_value.h b/include/mach/time_value.h index 61be581..0dfe382 100644 --- a/include/mach/time_value.h +++ b/include/mach/time_value.h @@ -84,7 +84,9 @@ typedef struct time_value time_value_t; * Read this mapped value with * do { * secs = mtime->seconds; + * __sync_synchronize(); * usecs = mtime->microseconds; + * __sync_synchronize(); * } while (secs != mtime->check_seconds); */ -- cgit v1.2.3