From a082b2af624583a7e2dda1ea970e55c5dcade0d3 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Wed, 15 Jul 2015 03:10:35 +0200 Subject: [PATCH] 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 --- minix/lib/libsys/asynsend.c | 1 + 1 file changed, 1 insertion(+) 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. -- 2.44.0