summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2017-05-19 00:52:49 +0000
committervisa <visa@openbsd.org>2017-05-19 00:52:49 +0000
commitb053005b0eb2b27b62a4b5fd8f8ed4a551423f75 (patch)
tree0d744df437ef5d968e4337ed97ad2ce2f1c98cfe
parentImplement copyin32(9) for mips64. (diff)
downloadwireguard-openbsd-b053005b0eb2b27b62a4b5fd8f8ed4a551423f75.tar.xz
wireguard-openbsd-b053005b0eb2b27b62a4b5fd8f8ed4a551423f75.zip
Replace __cpu_cas() with atomic_cas_ulong().
OK kettenis@
-rw-r--r--sys/arch/mips64/include/lock.h8
-rw-r--r--sys/arch/mips64/mips64/lock_machdep.c4
2 files changed, 3 insertions, 9 deletions
diff --git a/sys/arch/mips64/include/lock.h b/sys/arch/mips64/include/lock.h
index ee927014ad7..e98851abdb1 100644
--- a/sys/arch/mips64/include/lock.h
+++ b/sys/arch/mips64/include/lock.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lock.h,v 1.7 2015/02/11 00:14:11 dlg Exp $ */
+/* $OpenBSD: lock.h,v 1.8 2017/05/19 00:52:49 visa Exp $ */
/* public domain */
@@ -7,10 +7,4 @@
#include <sys/atomic.h>
-static __inline int
-__cpu_cas(volatile unsigned long *addr, unsigned long old, unsigned long new)
-{
- return (atomic_cas_ulong(addr, old, new) != old);
-}
-
#endif /* _MIPS64_LOCK_H_ */
diff --git a/sys/arch/mips64/mips64/lock_machdep.c b/sys/arch/mips64/mips64/lock_machdep.c
index af0bb3db68b..e27cf8d209a 100644
--- a/sys/arch/mips64/mips64/lock_machdep.c
+++ b/sys/arch/mips64/mips64/lock_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lock_machdep.c,v 1.3 2017/04/30 16:45:45 mpi Exp $ */
+/* $OpenBSD: lock_machdep.c,v 1.4 2017/05/19 00:52:49 visa Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
@@ -82,7 +82,7 @@ __mp_lock(struct __mp_lock *mpl)
*/
while (1) {
sr = disableintr();
- if (__cpu_cas(&mpl->mpl_count, 0, 1) == 0) {
+ if (atomic_cas_ulong(&mpl->mpl_count, 0, 1) == 0) {
mips_sync();
mpl->mpl_cpu = ci;
}