summaryrefslogtreecommitdiff
path: root/sys/arch/hppa
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2016-02-09 06:46:03 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2016-02-09 06:46:03 +0000
commitb60a7d63768c9e3e8e86c17de6df63cf01591b54 (patch)
treed2a222609f2ffca2bf47e8eb9a11d9c84098deb4 /sys/arch/hppa
parentc3a251bd16b2ad68484bf62fc81afd2752bbbda8 (diff)
make __cpu_simple_lock provide serialisation of the critical section.
that in turn makes atomic sequences actually atomic, which in turn means the refcnt api asserts wont fire erronously when if_get and if_put are actually used correctly. such embarrassment. reported by landry@ who also let me debug on the affected machines ok jmatthew@
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r--sys/arch/hppa/include/atomic.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/arch/hppa/include/atomic.h b/sys/arch/hppa/include/atomic.h
index a266fafeb0d..e255611d0e8 100644
--- a/sys/arch/hppa/include/atomic.h
+++ b/sys/arch/hppa/include/atomic.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomic.h,v 1.9 2014/09/24 06:34:37 dlg Exp $ */
+/* $OpenBSD: atomic.h,v 1.10 2016/02/09 06:46:02 dlg Exp $ */
/* Public Domain */
@@ -28,13 +28,6 @@ __cpu_simple_lock_ldcws(__cpu_simple_lock_t *l)
return (o);
}
-static inline void
-__cpu_simple_lock(__cpu_simple_lock_t *l)
-{
- while (__cpu_simple_lock_ldcws(l) == __SIMPLELOCK_UNLOCKED)
- ;
-}
-
static inline int
__cpu_simple_lock_try(__cpu_simple_lock_t *l)
{
@@ -42,6 +35,13 @@ __cpu_simple_lock_try(__cpu_simple_lock_t *l)
}
static inline void
+__cpu_simple_lock(__cpu_simple_lock_t *l)
+{
+ while (!__cpu_simple_lock_ldcws(l))
+ ;
+}
+
+static inline void
__cpu_simple_unlock(__cpu_simple_lock_t *l)
{
*l = __SIMPLELOCK_UNLOCKED;