Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha/include Move the simple lock used for spin mu...



details:   https://anonhg.NetBSD.org/src/rev/1a09698ff504
branches:  trunk
changeset: 955183:1a09698ff504
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Sep 23 00:51:59 2020 +0000

description:
Move the simple lock used for spin mutexes into the sub-structure that
contains the spin lock IPL field.  This shrinks kmutex_t to sizeof(uintptr_t)
on Alpha.

This should have been done in rev 1.3 when the lock ID field was removed,
but better late than never, I guess.

diffstat:

 sys/arch/alpha/include/mutex.h |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 85507b7f97c7 -r 1a09698ff504 sys/arch/alpha/include/mutex.h
--- a/sys/arch/alpha/include/mutex.h    Wed Sep 23 00:46:17 2020 +0000
+++ b/sys/arch/alpha/include/mutex.h    Wed Sep 23 00:51:59 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.6 2019/11/29 22:55:33 riastradh Exp $      */
+/*     $NetBSD: mutex.h,v 1.7 2020/09/23 00:51:59 thorpej Exp $        */
 
 /*-
  * Copyright (c) 2002, 2006, 2007 The NetBSD Foundation, Inc.
@@ -36,7 +36,6 @@
 
 struct kmutex {
        uintptr_t       mtx_pad1;
-       uint32_t        mtx_pad2;
 };
 
 #else  /* __MUTEX_PRIVATE */
@@ -48,14 +47,17 @@
                        volatile uint8_t        mtxs_flags;
                        ipl_cookie_t            mtxs_ipl;
                        volatile uint16_t       mtxs_unused;
+                       __cpu_simple_lock_t     mtxs_lock;
                } s;
        } u;
-       __cpu_simple_lock_t     mtx_lock;
 };
 
+__CTASSERT(sizeof(struct kmutex) == sizeof(uintptr_t));
+
 #define        mtx_owner                       u.mtxa_owner
 #define        mtx_flags                       u.s.mtxs_flags
 #define        mtx_ipl                         u.s.mtxs_ipl
+#define        mtx_lock                        u.s.mtxs_lock
 
 #define        __HAVE_SIMPLE_MUTEXES           1
 #define        __HAVE_MUTEX_STUBS              1



Home | Main Index | Thread Index | Old Index