From 422dcc241651fe5f082b90b4add639156ce0a0a8 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 6 Dec 2008 21:33:44 +0000 Subject: [PATCH] Restore memory clobber, to cause mb on the compiler level too. Use more sane formatting of the assembler. Pointed out by: bde --- sys/i386/include/atomic.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h index e800d0ee6b85..8c0b95ce0694 100644 --- a/sys/i386/include/atomic.h +++ b/sys/i386/include/atomic.h @@ -32,9 +32,9 @@ #error this file needs sys/cdefs.h as a prerequisite #endif -#define mb() __asm __volatile("lock;addl $0,(%esp)") -#define wmb() __asm __volatile("lock;addl $0,(%esp)") -#define rmb() __asm __volatile("lock;addl $0,(%esp)") +#define mb() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory") +#define wmb() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory") +#define rmb() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory") /* * Various simple operations on memory, each of which is atomic in the