Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/arch Pull up following revision(s) (requested by chs ...



details:   https://anonhg.NetBSD.org/src/rev/eddaed9e01b7
branches:  netbsd-9
changeset: 963883:eddaed9e01b7
user:      martin <martin%NetBSD.org@localhost>
date:      Wed May 13 18:01:49 2020 +0000

description:
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?)

diffstat:

 sys/arch/arm/include/mutex.h |  14 +++++---------
 sys/arch/x86/include/mutex.h |   4 ++--
 2 files changed, 7 insertions(+), 11 deletions(-)

diffs (61 lines):

diff -r 204bd94321d5 -r eddaed9e01b7 sys/arch/arm/include/mutex.h
--- a/sys/arch/arm/include/mutex.h      Wed May 13 12:42:30 2020 +0000
+++ b/sys/arch/arm/include/mutex.h      Wed May 13 18:01:49 2020 +0000
@@ -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 @@
                        __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
diff -r 204bd94321d5 -r eddaed9e01b7 sys/arch/x86/include/mutex.h
--- a/sys/arch/x86/include/mutex.h      Wed May 13 12:42:30 2020 +0000
+++ b/sys/arch/x86/include/mutex.h      Wed May 13 18:01:49 2020 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index