summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/sparc64/lock_machdep.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/arch/sparc64/sparc64/lock_machdep.c b/sys/arch/sparc64/sparc64/lock_machdep.c
index 7577eda10c1..08b07682b3e 100644
--- a/sys/arch/sparc64/sparc64/lock_machdep.c
+++ b/sys/arch/sparc64/sparc64/lock_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lock_machdep.c,v 1.1 2007/11/27 23:29:57 kettenis Exp $ */
+/* $OpenBSD: lock_machdep.c,v 1.2 2012/08/30 20:57:00 kettenis Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
@@ -43,7 +43,19 @@ __mp_lock_init(struct __mp_lock *lock)
extern int __mp_lock_spinout;
#endif
-#define SPINLOCK_SPIN_HOOK /**/
+static __inline void
+__mp_lock_spin_hook(void)
+{
+ __asm __volatile(
+ "999: nop \n"
+ " .section .sun4u_mtp_patch, \"ax\" \n"
+ " .word 999b \n"
+ " .word 0x81b01060 ! sleep \n"
+ " .previous \n"
+ : : : "memory");
+}
+
+#define SPINLOCK_SPIN_HOOK __mp_lock_spin_hook()
static __inline void
__mp_lock_spin(struct __mp_lock *mpl)