From 7378d8481a7f0ed0a48c47c12fa53df87df6a12b Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Tue, 1 Jan 2008 23:37:17 +0000 Subject: Implement an MP-safe rw_cas() based upon the casx instruction; ok kettenis@ --- sys/arch/sparc64/include/lock.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/arch/sparc64') diff --git a/sys/arch/sparc64/include/lock.h b/sys/arch/sparc64/include/lock.h index c880043998b..7c8d35490a4 100644 --- a/sys/arch/sparc64/include/lock.h +++ b/sys/arch/sparc64/include/lock.h @@ -1,10 +1,11 @@ -/* $OpenBSD: lock.h,v 1.2 2007/11/05 20:19:22 miod Exp $ */ +/* $OpenBSD: lock.h,v 1.3 2008/01/01 23:37:16 miod Exp $ */ /* public domain */ #ifndef _SPARC64_LOCK_H_ #define _SPARC64_LOCK_H_ +#include #include typedef volatile u_int8_t __cpu_simple_lock_t; @@ -50,4 +51,6 @@ __cpu_simple_unlock(__cpu_simple_lock_t *l) *l = __SIMPLELOCK_UNLOCKED; } +#define rw_cas_sparc64 (sparc64_casx(p, o, n) != o) + #endif /* _SPARC64_LOCK_H_ */ -- cgit v1.2.3