summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-01-14 00:16:17 +0000
committerjhb <jhb@FreeBSD.org>2001-01-14 00:16:17 +0000
commit94588351ce2d8970ce221dba2766deee30ef192b (patch)
tree6028ab46e5728204454b966636f3a72dc0e83fbc /sys
parent458215f24caeff82031e99a7469297488333d8e7 (diff)
downloadFreeBSD-src-94588351ce2d8970ce221dba2766deee30ef192b.zip
FreeBSD-src-94588351ce2d8970ce221dba2766deee30ef192b.tar.gz
Work around the broken atomic_store_rel_ptr() on the i386 arch by just
using atomic_cmpset_rel_ptr() instead for _release_lock_quick(). When atomic_store_rel_ptr() is functional and MP safe, then this can be reverted.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/include/mutex.h4
-rw-r--r--sys/i386/include/mutex.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/amd64/include/mutex.h b/sys/amd64/include/mutex.h
index 95d117a..48a2a84 100644
--- a/sys/amd64/include/mutex.h
+++ b/sys/amd64/include/mutex.h
@@ -62,6 +62,10 @@ extern char STR_SIEN[];
#define mtx_legal2block() (read_eflags() & PSL_I)
+/* Actually release mtx_lock quickly assuming that we own it */
+#define _release_lock_quick(mp) \
+ atomic_cmpset_rel_int(&(mp)->mtx_lock, (mp)->mtx_lock, MTX_UNOWNED)
+
/*
* Assembly macros (for internal use only)
*------------------------------------------------------------------------------
diff --git a/sys/i386/include/mutex.h b/sys/i386/include/mutex.h
index 95d117a..48a2a84 100644
--- a/sys/i386/include/mutex.h
+++ b/sys/i386/include/mutex.h
@@ -62,6 +62,10 @@ extern char STR_SIEN[];
#define mtx_legal2block() (read_eflags() & PSL_I)
+/* Actually release mtx_lock quickly assuming that we own it */
+#define _release_lock_quick(mp) \
+ atomic_cmpset_rel_int(&(mp)->mtx_lock, (mp)->mtx_lock, MTX_UNOWNED)
+
/*
* Assembly macros (for internal use only)
*------------------------------------------------------------------------------
OpenPOWER on IntegriCloud