From f317bc290c14036a44fa5bd89e108b886c5cca9c Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Fri, 25 May 2007 20:48:34 +0000 Subject: Define rw_cas. Trivially simple on amd64 with atomic_cas_ul. miod@ ok --- sys/arch/amd64/include/lock.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/arch/amd64/include') diff --git a/sys/arch/amd64/include/lock.h b/sys/arch/amd64/include/lock.h index 35b1974f910..57674ae58f7 100644 --- a/sys/arch/amd64/include/lock.h +++ b/sys/arch/amd64/include/lock.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lock.h,v 1.1 2004/06/25 11:03:28 art Exp $ */ +/* $OpenBSD: lock.h,v 1.2 2007/05/25 20:48:33 art Exp $ */ /* $NetBSD: lock.h,v 1.1.2.2 2000/05/03 14:40:55 sommerfeld Exp $ */ /*- @@ -114,6 +114,8 @@ __cpu_simple_unlock(__cpu_simple_lock_t *lockp) *lockp = __SIMPLELOCK_UNLOCKED; } +#define rw_cas(p, o, n) (x86_atomic_cas_ul(p, o, n) != o) + #endif /* !LOCKDEBUG */ #endif /* _AMD64_LOCK_H_ */ -- cgit v1.2.3