Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Nix now-unused definitions of MUTEX_GIVE/MUTEX_RECE...



details:   https://anonhg.NetBSD.org/src/rev/47f01a9a7dcb
branches:  trunk
changeset: 1005131:47f01a9a7dcb
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Nov 29 22:55:33 2019 +0000

description:
Nix now-unused definitions of MUTEX_GIVE/MUTEX_RECEIVE.

diffstat:

 sys/arch/alpha/include/mutex.h    |   5 +----
 sys/arch/arm/include/mutex.h      |  26 +-------------------------
 sys/arch/ia64/include/mutex.h     |  12 +-----------
 sys/arch/m68k/include/mutex.h     |   5 +----
 sys/arch/mips/include/mutex.h     |   5 +----
 sys/arch/or1k/include/mutex.h     |  21 +--------------------
 sys/arch/powerpc/include/mutex.h  |   5 +----
 sys/arch/riscv/include/mutex.h    |  21 +--------------------
 sys/arch/sh3/include/mutex.h      |  13 +------------
 sys/arch/sparc/include/mutex.h    |   5 +----
 sys/arch/sparc64/include/mutex.h  |  13 +------------
 sys/arch/usermode/include/mutex.h |  12 +-----------
 sys/arch/vax/include/mutex.h      |  13 +------------
 sys/arch/x86/include/mutex.h      |  15 +--------------
 14 files changed, 14 insertions(+), 157 deletions(-)

diffs (truncated from 367 to 300 lines):

diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/alpha/include/mutex.h
--- a/sys/arch/alpha/include/mutex.h    Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/alpha/include/mutex.h    Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.5 2019/11/29 20:05:07 riastradh Exp $      */
+/*     $NetBSD: mutex.h,v 1.6 2019/11/29 22:55:33 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2002, 2006, 2007 The NetBSD Foundation, Inc.
@@ -60,9 +60,6 @@
 #define        __HAVE_SIMPLE_MUTEXES           1
 #define        __HAVE_MUTEX_STUBS              1
 
-#define        MUTEX_RECEIVE(mtx)              __asm __volatile("mb" : : : "memory")
-#define        MUTEX_GIVE(mtx)                 __asm __volatile("mb" : : : "memory")
-
 #define        MUTEX_CAS(p, o, n)              _lock_cas((p), (o), (n))
 
 int    _lock_cas(volatile uintptr_t *, uintptr_t, uintptr_t);
diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/arm/include/mutex.h
--- a/sys/arch/arm/include/mutex.h      Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/arm/include/mutex.h      Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.20 2015/02/25 13:52:42 joerg Exp $ */
+/*     $NetBSD: mutex.h,v 1.21 2019/11/29 22:55:33 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -84,30 +84,6 @@
 #endif
 #define        __HAVE_SIMPLE_MUTEXES           1
 
-/*
- * MUTEX_{GIVE,RECEIVE}: no memory barrier is required in the UP case;
- * we're synchronizing against interrupts, not multiple processors.
- */
-#ifdef MULTIPROCESSOR
-#ifdef _ARM_ARCH_7
-#define        MUTEX_RECEIVE(mtx)              __asm __volatile("dmb" ::: "memory")
-#else
-#define        MUTEX_RECEIVE(mtx)              membar_consumer()
-#endif
-#else
-#define        MUTEX_RECEIVE(mtx)              /* nothing */
-#endif
-
-#ifdef MULTIPROCESSOR
-#ifdef _ARM_ARCH_7
-#define        MUTEX_GIVE(mtx)                 __asm __volatile("dsb" ::: "memory")
-#else
-#define        MUTEX_GIVE(mtx)                 membar_producer()
-#endif
-#else
-#define        MUTEX_GIVE(mtx)                 /* nothing */
-#endif
-
 #define        MUTEX_CAS(p, o, n)              \
     (atomic_cas_ulong((volatile unsigned long *)(p), (o), (n)) == (o))
 #ifdef MULTIPROCESSOR
diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/ia64/include/mutex.h
--- a/sys/arch/ia64/include/mutex.h     Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/ia64/include/mutex.h     Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.4 2009/07/20 04:41:37 kiyohara Exp $       */
+/*     $NetBSD: mutex.h,v 1.5 2019/11/29 22:55:33 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -56,16 +56,6 @@
 */
 #define        __HAVE_SIMPLE_MUTEXES           1
 
-/*
- * MUTEX_RECEIVE: no memory barrier required, atomic_cas implies a load fence.
- */
-#define        MUTEX_RECEIVE(mtx)              /* nothing */
-
-/*
- * MUTEX_GIVE: no memory barrier required, as _lock_cas() will take care of it.
- */
-#define        MUTEX_GIVE(mtx)                 /* nothing */
-
 #define        MUTEX_CAS(ptr, old, new)                \
     (atomic_cas_ulong((volatile unsigned long *)(ptr), (old), (new)) == (old))
 
diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/m68k/include/mutex.h
--- a/sys/arch/m68k/include/mutex.h     Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/m68k/include/mutex.h     Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.8 2019/11/29 20:05:49 riastradh Exp $      */
+/*     $NetBSD: mutex.h,v 1.9 2019/11/29 22:55:33 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -62,9 +62,6 @@
 #define        __HAVE_SIMPLE_MUTEXES           1
 #define        __HAVE_MUTEX_STUBS              1
 
-#define        MUTEX_RECEIVE(mtx)              __insn_barrier()
-#define        MUTEX_GIVE(mtx)                 __insn_barrier()
-
 #define        MUTEX_CAS(p, o, n)              (atomic_cas_uint((p), (o), (n)) == (o))
 
 #endif /* __MUTEX_PRIVATE */
diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/mips/include/mutex.h
--- a/sys/arch/mips/include/mutex.h     Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/mips/include/mutex.h     Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.7 2011/02/20 07:45:47 matt Exp $   */
+/*     $NetBSD: mutex.h,v 1.8 2019/11/29 22:55:33 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -55,9 +55,6 @@
 #define        __HAVE_MUTEX_STUBS              1
 #define        __HAVE_SPIN_MUTEX_STUBS         1
 
-#define        MUTEX_RECEIVE(mtx)              membar_enter()
-#define        MUTEX_GIVE(mtx)                 membar_exit()
-
 #define        MUTEX_CAS(p, o, n)              \
     (atomic_cas_ulong((volatile u_long *)(p), (o), (n)) == (o))
 
diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/or1k/include/mutex.h
--- a/sys/arch/or1k/include/mutex.h     Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/or1k/include/mutex.h     Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.1 2014/09/03 19:34:26 matt Exp $   */
+/*     $NetBSD: mutex.h,v 1.2 2019/11/29 22:55:33 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -70,25 +70,6 @@
 #endif
 #define        __HAVE_SIMPLE_MUTEXES           1
 
-/*
- * MUTEX_RECEIVE: no memory barrier required; we're synchronizing against
- * interrupts, not multiple processors.
- */
-#ifdef MULTIPROCESSOR
-#define        MUTEX_RECEIVE(mtx)              membar_consumer()
-#else
-#define        MUTEX_RECEIVE(mtx)              /* nothing */
-#endif
-
-/*
- * MUTEX_GIVE: no memory barrier required; same reason.
- */
-#ifdef MULTIPROCESSOR
-#define        MUTEX_GIVE(mtx)                 membar_producer()
-#else
-#define        MUTEX_GIVE(mtx)                 /* nothing */
-#endif
-
 #define        MUTEX_CAS(p, o, n)              \
     (atomic_cas_ulong((volatile unsigned long *)(p), (o), (n)) == (o))
 
diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/powerpc/include/mutex.h
--- a/sys/arch/powerpc/include/mutex.h  Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/powerpc/include/mutex.h  Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.5 2019/11/29 20:05:59 riastradh Exp $      */
+/*     $NetBSD: mutex.h,v 1.6 2019/11/29 22:55:34 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -61,9 +61,6 @@
 #define        __HAVE_SIMPLE_MUTEXES           1
 #define        __HAVE_MUTEX_STUBS              1
 
-#define        MUTEX_RECEIVE(mtx)              __asm __volatile("isync" ::: "memory")
-#define        MUTEX_GIVE(mtx)                 __asm __volatile("sync" ::: "memory")
-
 #define        MUTEX_CAS(p, o, n)              _lock_cas((p), (o), (n))
 
 int    _lock_cas(volatile uintptr_t *, uintptr_t, uintptr_t);
diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/riscv/include/mutex.h
--- a/sys/arch/riscv/include/mutex.h    Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/riscv/include/mutex.h    Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.2 2019/06/01 12:42:28 maxv Exp $   */
+/*     $NetBSD: mutex.h,v 1.3 2019/11/29 22:55:34 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -113,25 +113,6 @@
 #endif
 #define        __HAVE_SIMPLE_MUTEXES           1
 
-/*
- * MUTEX_RECEIVE: no memory barrier required; we're synchronizing against
- * interrupts, not multiple processors.
- */
-#ifdef MULTIPROCESSOR
-#define        MUTEX_RECEIVE(mtx)              membar_consumer()
-#else
-#define        MUTEX_RECEIVE(mtx)              /* nothing */
-#endif
-
-/*
- * MUTEX_GIVE: no memory barrier required; same reason.
- */
-#ifdef MULTIPROCESSOR
-#define        MUTEX_GIVE(mtx)                 membar_producer()
-#else
-#define        MUTEX_GIVE(mtx)                 /* nothing */
-#endif
-
 #define        MUTEX_CAS(p, o, n)              \
     (atomic_cas_ulong((volatile unsigned long *)(p), (o), (n)) == (o))
 
diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/sh3/include/mutex.h
--- a/sys/arch/sh3/include/mutex.h      Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/sh3/include/mutex.h      Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.9 2008/04/28 20:23:35 martin Exp $ */
+/*     $NetBSD: mutex.h,v 1.10 2019/11/29 22:55:34 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -62,17 +62,6 @@
 #define        __HAVE_SIMPLE_MUTEXES           1
 #define        __HAVE_MUTEX_STUBS              1
 
-/*
- * MUTEX_RECEIVE: no memory barrier required; we're synchronizing against
- * interrupts, not multiple processors.
- */
-#define        MUTEX_RECEIVE(mtx)              /* nothing */
-
-/*
- * MUTEX_GIVE: no memory barrier required; same reason.
- */
-#define        MUTEX_GIVE(mtx)                 /* nothing */
-
 uintptr_t      _lock_cas(volatile uintptr_t *, uintptr_t, uintptr_t);
 
 #define        MUTEX_CAS(p, o, n)              (_lock_cas((p), (o), (n)) == (o))
diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/sparc/include/mutex.h
--- a/sys/arch/sparc/include/mutex.h    Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/sparc/include/mutex.h    Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.10 2008/04/28 20:23:36 martin Exp $        */
+/*     $NetBSD: mutex.h,v 1.11 2019/11/29 22:55:34 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc.
@@ -58,9 +58,6 @@
 
 #define        __HAVE_SIMPLE_MUTEXES           1
 
-#define        MUTEX_RECEIVE(mtx)              /* nothing */
-#define        MUTEX_GIVE(mtx)                 /* nothing */
-
 #define        MUTEX_CAS(p, o, n)              \
     (_atomic_cas_ulong((volatile unsigned long *)(p), (o), (n)) == (o))
 
diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/sparc64/include/mutex.h
--- a/sys/arch/sparc64/include/mutex.h  Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/sparc64/include/mutex.h  Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.5 2019/11/29 20:06:34 riastradh Exp $      */
+/*     $NetBSD: mutex.h,v 1.6 2019/11/29 22:55:34 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -55,17 +55,6 @@
 #define __HAVE_MUTEX_STUBS             1
 #define        __HAVE_SIMPLE_MUTEXES           1
 
-/*
- * XXX Should this be LoadLoad|LoadStore, or does the assumption of a
- * preceding atomic r/m/w operation obviate the need for that?
- */
-#define        MUTEX_RECEIVE(mtx) __asm __volatile("membar #LoadLoad" : : : "memory")
-
-/*
- * MUTEX_GIVE: no memory barrier required, as _lock_cas() will take care of it.
- */
-#define        MUTEX_GIVE(mtx)                 __insn_barrier()
-
 #define        MUTEX_CAS(p, o, n)              _lock_cas((p), (o), (n))
 
 int    _lock_cas(volatile uintptr_t *, uintptr_t, uintptr_t);
diff -r d0dcaf34501c -r 47f01a9a7dcb sys/arch/usermode/include/mutex.h
--- a/sys/arch/usermode/include/mutex.h Fri Nov 29 22:38:28 2019 +0000
+++ b/sys/arch/usermode/include/mutex.h Fri Nov 29 22:55:33 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mutex.h,v 1.3 2008/04/28 20:23:39 martin Exp $ */
+/*     $NetBSD: mutex.h,v 1.4 2019/11/29 22:55:34 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc.
@@ -54,16 +54,6 @@
 
 #define        __HAVE_SIMPLE_MUTEXES           1
 
-/*
- * MUTEX_RECEIVE: no memory barrier required, as 'ret' implies a load fence.



Home | Main Index | Thread Index | Old Index