]> Zhao Yanbai Git Server - minix.git/commitdiff
libsys: add Tomas Hruby's asynsend barrier 48/3048/1
authorDavid van Moolenbroek <david@minix3.org>
Wed, 15 Jul 2015 01:10:35 +0000 (03:10 +0200)
committerDavid van Moolenbroek <david@minix3.org>
Sat, 8 Aug 2015 16:56:20 +0000 (16:56 +0000)
This barrier ensures that all fields of an asynchronously sent
message are properly initialized before the message is marked as
valid.

Change-Id: I7b9590c11c4e040c8f992f1dd2581e54201bf214

minix/lib/libsys/asynsend.c

index 3f414712f7a666d00235dcd198f9b6aba917068e..d6c19eecd8b656133fb9ab1c6748bec2d533838d 100644 (file)
@@ -126,6 +126,7 @@ int fl;
   fl |= AMF_VALID;     /* Mark in use */
   msgtable[next_slot].dst = dst;
   msgtable[next_slot].msg = *mp;
+  __insn_barrier();
   msgtable[next_slot].flags = fl;              /* Has to be last. The kernel 
                                                 * scans this table while we
                                                 * are sleeping.