From b60a7d63768c9e3e8e86c17de6df63cf01591b54 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Tue, 9 Feb 2016 06:46:03 +0000 Subject: 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@ --- sys/arch/hppa/include/atomic.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sys/arch/hppa') 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,19 +28,19 @@ __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) { return (__cpu_simple_lock_ldcws(l) == __SIMPLELOCK_UNLOCKED); } +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) { -- cgit v1.2.3