summaryrefslogtreecommitdiffstats
path: root/sys/i386/include
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-11-12 18:40:22 +0000
committerjhb <jhb@FreeBSD.org>2004-11-12 18:40:22 +0000
commitba0a3a16d668889c5d91cda6494213380d2564ae (patch)
treec2e076ee5bf81cf214facbf0c3921bc7b6b4d339 /sys/i386/include
parentdcb9e1376165c69a2ace175067eab35c0a335d9f (diff)
downloadFreeBSD-src-ba0a3a16d668889c5d91cda6494213380d2564ae.zip
FreeBSD-src-ba0a3a16d668889c5d91cda6494213380d2564ae.tar.gz
- Use the SMP style ops for atomic_load/store() in userland so that
libraries and binaries will work on both UP and SMP machines. - Remove unnecessary gcc memory barrier from the UP atomic_store() op. Submitted by: bde
Diffstat (limited to 'sys/i386/include')
-rw-r--r--sys/i386/include/atomic.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h
index 5f5f197..4d21b38 100644
--- a/sys/i386/include/atomic.h
+++ b/sys/i386/include/atomic.h
@@ -172,7 +172,7 @@ atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src)
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
-#if !defined(SMP)
+#if defined(KERNEL) && !defined(SMP)
/*
* We assume that a = b will do atomic loads and stores. However, on a
@@ -191,7 +191,6 @@ atomic_load_acq_##TYPE(volatile u_##TYPE *p) \
static __inline void \
atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
{ \
- __asm __volatile("" : : : "memory"); \
*p = v; \
} \
struct __hack
OpenPOWER on IntegriCloud