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
This commit is contained in:
David van Moolenbroek 2015-07-15 03:10:35 +02:00
parent 3091b8cf26
commit a082b2af62

View 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.