summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-05-25 20:48:34 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-05-25 20:48:34 +0000
commitf317bc290c14036a44fa5bd89e108b886c5cca9c (patch)
tree993db71979e0e68aae9c4e1a59e60b378b997a2a /sys
parent0e4c5975b636d3696b08d94d38e766e642a96f3a (diff)
Define rw_cas. Trivially simple on amd64 with atomic_cas_ul.
miod@ ok
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/include/lock.h4
1 files changed, 3 insertions, 1 deletions
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_ */