Module Name: src
Committed By: thorpej
Date: Sat Apr 6 15:52:35 UTC 2019
Modified Files:
src/sys/kern: subr_copy.c
Log Message:
Treat _RUMPKERNEL like a __HAVE_UCAS_FULL platform. Add a comment
explaining what's going on. Fixes librump build on sparc.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/kern/subr_copy.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/subr_copy.c
diff -u src/sys/kern/subr_copy.c:1.9 src/sys/kern/subr_copy.c:1.10
--- src/sys/kern/subr_copy.c:1.9 Sat Apr 6 03:06:28 2019
+++ src/sys/kern/subr_copy.c Sat Apr 6 15:52:35 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_copy.c,v 1.9 2019/04/06 03:06:28 thorpej Exp $ */
+/* $NetBSD: subr_copy.c,v 1.10 2019/04/06 15:52:35 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008, 2019
@@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_copy.c,v 1.9 2019/04/06 03:06:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_copy.c,v 1.10 2019/04/06 15:52:35 thorpej Exp $");
#define __UFETCHSTORE_PRIVATE
#define __UCAS_PRIVATE
@@ -375,7 +375,15 @@ do { \
} while (/*CONSTCOND*/0)
#endif /* __NO_STRICT_ALIGNMENT */
-#ifndef __HAVE_UCAS_FULL
+/*
+ * __HAVE_UCAS_FULL platforms provide _ucas_32() and _ucas_64() themselves.
+ * _RUMPKERNEL also provides it's own _ucas_32() and _ucas_64().
+ *
+ * In all other cases, we provide generic implementations that work on
+ * all platforms.
+ */
+
+#if !defined(__HAVE_UCAS_FULL) && !defined(_RUMPKERNEL)
#if !defined(__HAVE_UCAS_MP) && defined(MULTIPROCESSOR)
#include <sys/atomic.h>
#include <sys/cpu.h>
@@ -522,7 +530,7 @@ _ucas_64(volatile uint64_t *uaddr, uint6
return error;
}
#endif /* _LP64 */
-#endif /* ! __HAVE_UCAS_FULL */
+#endif /* ! __HAVE_UCAS_FULL && ! _RUMPKERNEL */
int
ucas_32(volatile uint32_t *uaddr, uint32_t old, uint32_t new, uint32_t *ret)