diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-08-18 17:14:20 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-08-18 17:14:20 +0200 |
commit | 26f79d5608fe5cf867559fef95d4ccdaaca1a994 (patch) | |
tree | d022c8c6ed6971fa4f1b7f149cac3c3a28893fc4 /kern | |
parent | e1f856119dae48fcc1b649521ca45e4bdaa80ea9 (diff) |
Add compiler barrier to update_mapped_time
* kern/mach_clock.c (update_mapped_time): Add compiler barriers between
writes to shared memory. Update comment: on SMP, write barriers are
required.
Diffstat (limited to 'kern')
-rw-r--r-- | kern/mach_clock.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kern/mach_clock.c b/kern/mach_clock.c index 04a3115..4ba7c08 100644 --- a/kern/mach_clock.c +++ b/kern/mach_clock.c @@ -91,7 +91,7 @@ int bigadj = 1000000; /* adjust 10*tickadj if adjustment * } while (secs != mtime->check_seconds); * to read the time correctly. (On a multiprocessor this assumes * that processors see each other's writes in the correct order. - * We may have to insert fence operations.) + * We have to insert write fence operations.) FIXME */ mapped_time_value_t *mtime = 0; @@ -100,7 +100,9 @@ mapped_time_value_t *mtime = 0; MACRO_BEGIN \ if (mtime != 0) { \ mtime->check_seconds = (time)->seconds; \ + asm volatile("":::"memory"); \ mtime->microseconds = (time)->microseconds; \ + asm volatile("":::"memory"); \ mtime->seconds = (time)->seconds; \ } \ MACRO_END |