summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-05-29 14:19:51 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-05-29 14:19:51 +0000
commit9fbf631ea4d32275e2a0b73042a7f5c42b84dddf (patch)
tree35a6f3a16e30d51a8bcd59b8df375c0d878e41b0 /sys/arch/powerpc
parent3074148f150ad1764336ec65e48c9c96ac9404c9 (diff)
Kill SPINLOCK_SPIN_HOOK, use CPU_BUSY_CYCLE() instead.
ok visa@, kettenis@
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r--sys/arch/powerpc/include/lock.h4
-rw-r--r--sys/arch/powerpc/powerpc/lock_machdep.c8
-rw-r--r--sys/arch/powerpc/powerpc/mutex.c6
3 files changed, 8 insertions, 10 deletions
diff --git a/sys/arch/powerpc/include/lock.h b/sys/arch/powerpc/include/lock.h
index a533cbae429..e3b41ca3188 100644
--- a/sys/arch/powerpc/include/lock.h
+++ b/sys/arch/powerpc/include/lock.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lock.h,v 1.7 2015/08/14 06:14:19 dlg Exp $ */
+/* $OpenBSD: lock.h,v 1.8 2017/05/29 14:19:50 mpi Exp $ */
/* $NetBSD: lock.h,v 1.8 2005/12/28 19:09:29 perry Exp $ */
/*-
@@ -37,6 +37,4 @@
#ifndef _POWERPC_LOCK_H_
#define _POWERPC_LOCK_H_
-#define SPINLOCK_SPIN_HOOK do { } while (0)
-
#endif /* _POWERPC_LOCK_H_ */
diff --git a/sys/arch/powerpc/powerpc/lock_machdep.c b/sys/arch/powerpc/powerpc/lock_machdep.c
index 3ee3c258afb..b78af743d4d 100644
--- a/sys/arch/powerpc/powerpc/lock_machdep.c
+++ b/sys/arch/powerpc/powerpc/lock_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lock_machdep.c,v 1.5 2017/04/30 16:45:45 mpi Exp $ */
+/* $OpenBSD: lock_machdep.c,v 1.6 2017/05/29 14:19:50 mpi Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
@@ -21,7 +21,7 @@
#include <sys/systm.h>
#include <sys/atomic.h>
-#include <machine/lock.h>
+#include <machine/cpu.h>
#include <machine/psl.h>
#include <ddb/db_output.h>
@@ -47,12 +47,12 @@ __mp_lock_spin(struct __mp_lock *mpl)
{
#ifndef MP_LOCKDEBUG
while (mpl->mpl_count != 0)
- SPINLOCK_SPIN_HOOK;
+ CPU_BUSY_CYCLE();
#else
int nticks = __mp_lock_spinout;
while (mpl->mpl_count != 0 && --nticks > 0)
- SPINLOCK_SPIN_HOOK;
+ CPU_BUSY_CYCLE();
if (nticks == 0) {
db_printf("__mp_lock(%p): lock spun out", mpl);
diff --git a/sys/arch/powerpc/powerpc/mutex.c b/sys/arch/powerpc/powerpc/mutex.c
index 7559371675b..5a6a8012931 100644
--- a/sys/arch/powerpc/powerpc/mutex.c
+++ b/sys/arch/powerpc/powerpc/mutex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mutex.c,v 1.5 2017/04/30 16:45:45 mpi Exp $ */
+/* $OpenBSD: mutex.c,v 1.6 2017/05/29 14:19:50 mpi Exp $ */
/*
* Copyright (c) 2004 Artur Grabowski <art@openbsd.org>
@@ -31,7 +31,7 @@
#include <sys/atomic.h>
#include <machine/intr.h>
-#include <machine/lock.h>
+#include <machine/cpu.h>
#include <ddb/db_output.h>
@@ -61,7 +61,7 @@ __mtx_enter(struct mutex *mtx)
#endif
while (__mtx_enter_try(mtx) == 0) {
- SPINLOCK_SPIN_HOOK;
+ CPU_BUSY_CYCLE();
#if defined(MP_LOCKDEBUG)
if (--nticks == 0) {