Module Name: src
Committed By: martin
Date: Wed May 13 18:01:50 UTC 2020
Modified Files:
src/sys/arch/arm/include [netbsd-9]: mutex.h
src/sys/arch/x86/include [netbsd-9]: mutex.h
Log Message:
Pull up following revision(s) (requested by chs in ticket #904):
sys/arch/x86/include/mutex.h: revision 1.8
sys/arch/x86/include/mutex.h: revision 1.9
sys/arch/arm/include/mutex.h: revision 1.22
sys/arch/arm/include/mutex.h: revision 1.23
Remove __MUTEX_PRIVATE conditional in definition of struct kmutex.
This doesn't buy us anything but the need to hack around it in
ctfmerge to avoid massive duplication of kernel types -- which only
worked for the x86 definition.
This changes only x86 and arm for now, pending compile-testing the
remaining architectures.
Fix userland build by surrounding stuff with #ifdef _KERNEL.
(...Why does this header file get exposed to userland at all?)
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.22.1 src/sys/arch/arm/include/mutex.h
cvs rdiff -u -r1.6 -r1.6.68.1 src/sys/arch/x86/include/mutex.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/include/mutex.h
diff -u src/sys/arch/arm/include/mutex.h:1.20 src/sys/arch/arm/include/mutex.h:1.20.22.1
--- src/sys/arch/arm/include/mutex.h:1.20 Wed Feb 25 13:52:42 2015
+++ src/sys/arch/arm/include/mutex.h Wed May 13 18:01:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: mutex.h,v 1.20 2015/02/25 13:52:42 joerg Exp $ */
+/* $NetBSD: mutex.h,v 1.20.22.1 2020/05/13 18:01:49 martin Exp $ */
/*-
* Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -46,19 +46,12 @@
*
*/
-#ifndef __MUTEX_PRIVATE
-
-struct kmutex {
- uintptr_t mtx_pad1;
-};
-
-#else /* __MUTEX_PRIVATE */
-
struct kmutex {
union {
/* Adaptive mutex */
volatile uintptr_t mtxa_owner; /* 0-3 */
+#ifdef _KERNEL
/* Spin mutex */
struct {
/*
@@ -71,9 +64,12 @@ struct kmutex {
__cpu_simple_lock_t mtxs_lock;
volatile uint8_t mtxs_unused;
} s;
+#endif
} u;
};
+#ifdef __MUTEX_PRIVATE
+
#define mtx_owner u.mtxa_owner
#define mtx_ipl u.s.mtxs_ipl
#define mtx_lock u.s.mtxs_lock
Index: src/sys/arch/x86/include/mutex.h
diff -u src/sys/arch/x86/include/mutex.h:1.6 src/sys/arch/x86/include/mutex.h:1.6.68.1
--- src/sys/arch/x86/include/mutex.h:1.6 Fri Apr 24 17:49:51 2009
+++ src/sys/arch/x86/include/mutex.h Wed May 13 18:01:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: mutex.h,v 1.6 2009/04/24 17:49:51 ad Exp $ */
+/* $NetBSD: mutex.h,v 1.6.68.1 2020/05/13 18:01:49 martin Exp $ */
/*-
* Copyright (c) 2002, 2006, 2009 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
struct kmutex {
union {
volatile uintptr_t mtxa_owner;
-#ifdef __MUTEX_PRIVATE
+#ifdef _KERNEL
struct {
volatile uint8_t mtxs_dummy;
ipl_cookie_t mtxs_ipl;