From: David van Moolenbroek Date: Wed, 15 Jul 2015 01:10:35 +0000 (+0200) Subject: libsys: add Tomas Hruby's asynsend barrier X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=refs%2Fchanges%2F48%2F3048%2F1;p=minix.git libsys: add Tomas Hruby's asynsend barrier This barrier ensures that all fields of an asynchronously sent message are properly initialized before the message is marked as valid. Change-Id: I7b9590c11c4e040c8f992f1dd2581e54201bf214 --- diff --git a/minix/lib/libsys/asynsend.c b/minix/lib/libsys/asynsend.c index 3f414712f..d6c19eecd 100644 --- a/minix/lib/libsys/asynsend.c +++ b/minix/lib/libsys/asynsend.c @@ -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.