diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-04-07 09:52:28 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-04-07 09:52:28 +0000 |
commit | f859b41088b071ee70c5694789cbc9d182523113 (patch) | |
tree | e1369409e51208b1bffa8fba7649facf3212a983 /sys | |
parent | 3cf4d8868d5f305350b83b8bae05c88d990dd87b (diff) |
Use appropriate memory barriers.
ok kettenis@, miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/macppc/macppc/lock_machdep.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/macppc/macppc/lock_machdep.c b/sys/arch/macppc/macppc/lock_machdep.c index 0936c82ca12..c0804ff18a7 100644 --- a/sys/arch/macppc/macppc/lock_machdep.c +++ b/sys/arch/macppc/macppc/lock_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lock_machdep.c,v 1.5 2015/02/11 07:05:39 dlg Exp $ */ +/* $OpenBSD: lock_machdep.c,v 1.6 2015/04/07 09:52:27 mpi Exp $ */ /* * Copyright (c) 2007 Artur Grabowski <art@openbsd.org> @@ -19,8 +19,8 @@ #include <sys/param.h> #include <sys/systm.h> +#include <sys/atomic.h> -#include <machine/atomic.h> #include <machine/lock.h> #include <machine/psl.h> @@ -83,7 +83,7 @@ __mp_lock(struct __mp_lock *mpl) s = ppc_intr_disable(); if (__cpu_cas(&mpl->mpl_count, 0, 1) == 0) { - __asm volatile("eieio" ::: "memory"); + membar_enter(); mpl->mpl_cpu = curcpu(); } @@ -113,7 +113,7 @@ __mp_unlock(struct __mp_lock *mpl) s = ppc_intr_disable(); if (--mpl->mpl_count == 1) { mpl->mpl_cpu = NULL; - __asm volatile("eieio" ::: "memory"); + membar_exit(); mpl->mpl_count = 0; } ppc_intr_enable(s); @@ -134,7 +134,7 @@ __mp_release_all(struct __mp_lock *mpl) s = ppc_intr_disable(); mpl->mpl_cpu = NULL; - __asm volatile("eieio" ::: "memory"); + membar_exit(); mpl->mpl_count = 0; ppc_intr_enable(s); |