Source-Changes-HG archive

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

[src/trunk]: src/sys Largely eliminate the MD rwlock.h header file.



details:   https://anonhg.NetBSD.org/src/rev/bfa11a900eba
branches:  trunk
changeset: 461535:bfa11a900eba
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Nov 29 20:04:52 2019 +0000

description:
Largely eliminate the MD rwlock.h header file.

This was full of definitions that have been obsolete for over a
decade.  The file still remains for __HAVE_RW_STUBS but that's all.
Used only internally in kern_rwlock.c now, not by <sys/rwlock.h>.

diffstat:

 sys/arch/alpha/include/rwlock.h    |  53 +-------------------------------
 sys/arch/arm/include/rwlock.h      |  62 +-------------------------------------
 sys/arch/hppa/include/rwlock.h     |  57 +----------------------------------
 sys/arch/ia64/include/rwlock.h     |  62 +-------------------------------------
 sys/arch/m68k/include/rwlock.h     |  51 +------------------------------
 sys/arch/mips/include/rwlock.h     |  54 +--------------------------------
 sys/arch/or1k/include/rwlock.h     |  57 +----------------------------------
 sys/arch/powerpc/include/rwlock.h  |  53 +-------------------------------
 sys/arch/riscv/include/rwlock.h    |  57 +----------------------------------
 sys/arch/sh3/include/rwlock.h      |  53 +-------------------------------
 sys/arch/sparc/include/rwlock.h    |  55 +---------------------------------
 sys/arch/sparc64/include/rwlock.h  |  55 +---------------------------------
 sys/arch/usermode/include/rwlock.h |  62 +-------------------------------------
 sys/arch/vax/include/rwlock.h      |  18 +----------
 sys/arch/x86/include/rwlock.h      |  27 +---------------
 sys/kern/kern_rwlock.c             |   6 ++-
 sys/sys/rwlock.h                   |   6 ++-
 17 files changed, 23 insertions(+), 765 deletions(-)

diffs (truncated from 903 to 300 lines):

diff -r dadb8226c67c -r bfa11a900eba sys/arch/alpha/include/rwlock.h
--- a/sys/arch/alpha/include/rwlock.h   Fri Nov 29 19:44:59 2019 +0000
+++ b/sys/arch/alpha/include/rwlock.h   Fri Nov 29 20:04:52 2019 +0000
@@ -1,52 +1,1 @@
-/*     $NetBSD: rwlock.h,v 1.4 2008/04/28 20:23:11 martin Exp $        */
-
-/*-
- * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe and Andrew Doran.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _ALPHA_RWLOCK_H_
-#define        _ALPHA_RWLOCK_H_
-
-struct krwlock {
-       volatile uintptr_t      rw_owner;
-};
-
-#ifdef __RWLOCK_PRIVATE
-
-#define        __HAVE_SIMPLE_RW_LOCKS          1
-
-#define        RW_RECEIVE(rw)                  /* nothing */
-#define        RW_GIVE(rw)                     /* nothing */
-
-#define        RW_CAS(p, o, n)                 _lock_cas((p), (o), (n))
-
-int    _lock_cas(volatile uintptr_t *, uintptr_t, uintptr_t);
-
-#endif /* __RWLOCK_PRIVATE */
-
-#endif /* _ALPHA_RWLOCK_H_ */
+/*     $NetBSD: rwlock.h,v 1.5 2019/11/29 20:04:52 riastradh Exp $     */
diff -r dadb8226c67c -r bfa11a900eba sys/arch/arm/include/rwlock.h
--- a/sys/arch/arm/include/rwlock.h     Fri Nov 29 19:44:59 2019 +0000
+++ b/sys/arch/arm/include/rwlock.h     Fri Nov 29 20:04:52 2019 +0000
@@ -1,61 +1,1 @@
-/*     $NetBSD: rwlock.h,v 1.9 2015/02/25 13:52:42 joerg Exp $ */
-
-/*-
- * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe and Andrew Doran.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _ARM_RWLOCK_H_
-#define        _ARM_RWLOCK_H_
-
-struct krwlock {
-       volatile uintptr_t      rw_owner;
-};
-
-#ifdef __RWLOCK_PRIVATE
-
-#define        __HAVE_SIMPLE_RW_LOCKS          1
-
-#ifdef MULTIPROCESSOR
-#ifdef _ARM_ARCH_7
-#define        RW_RECEIVE(rw)                  __asm __volatile("dmb" ::: "memory")
-#define        RW_GIVE(rw)                     __asm __volatile("dsb" ::: "memory")
-#else
-#define        RW_RECEIVE(rw)                  membar_consumer()
-#define        RW_GIVE(rw)                     membar_producer()
-#endif
-#else
-#define        RW_RECEIVE(rw)                  /* nothing */
-#define        RW_GIVE(rw)                     /* nothing */
-#endif
-
-#define        RW_CAS(p, o, n)                 \
-    (atomic_cas_ulong((volatile unsigned long *)(p), (o), (n)) == (o))
-
-#endif /* __RWLOCK_PRIVATE */
-
-#endif /* _ARM_RWLOCK_H_ */
+/*     $NetBSD: rwlock.h,v 1.10 2019/11/29 20:04:52 riastradh Exp $    */
diff -r dadb8226c67c -r bfa11a900eba sys/arch/hppa/include/rwlock.h
--- a/sys/arch/hppa/include/rwlock.h    Fri Nov 29 19:44:59 2019 +0000
+++ b/sys/arch/hppa/include/rwlock.h    Fri Nov 29 20:04:52 2019 +0000
@@ -1,56 +1,1 @@
-/*     $NetBSD: rwlock.h,v 1.5 2008/04/28 20:23:23 martin Exp $        */
-
-/*-
- * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe and Andrew Doran.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _HPPA_RWLOCK_H_
-#define        _HPPA_RWLOCK_H_
-
-struct krwlock {
-       volatile uintptr_t      rw_owner;
-};
-
-#ifdef __RWLOCK_PRIVATE
-
-#define        __HAVE_SIMPLE_RW_LOCKS          1
-
-/*
- * _lock_cas() will take care of any memory barrier that is needed.
- */
-#define        RW_RECEIVE(rw)                  /* nothing */
-#define        RW_GIVE(rw)                     /* nothing */
-
-uintptr_t      _lock_cas(volatile uintptr_t *, uintptr_t, uintptr_t);
-
-#define        RW_CAS(p, o, n)                 \
-    (_lock_cas((volatile uintptr_t *)(p), (o), (n)) == (o))
-
-#endif /* __RWLOCK_PRIVATE */
-
-#endif /* _HPPA_RWLOCK_H_ */
+/*     $NetBSD: rwlock.h,v 1.6 2019/11/29 20:04:52 riastradh Exp $     */
diff -r dadb8226c67c -r bfa11a900eba sys/arch/ia64/include/rwlock.h
--- a/sys/arch/ia64/include/rwlock.h    Fri Nov 29 19:44:59 2019 +0000
+++ b/sys/arch/ia64/include/rwlock.h    Fri Nov 29 20:04:52 2019 +0000
@@ -1,61 +1,1 @@
-/*     $NetBSD: rwlock.h,v 1.3 2008/04/28 20:23:25 martin Exp $        */
-
-/*-
- * Copyright (c) 2008 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Takayoshi Kochi.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *      
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _IA64_RWLOCK_H_
-#define        _IA64_RWLOCK_H_
-
-#include <sys/atomic.h>
-
-struct krwlock {
-       volatile uintptr_t      rw_owner;
-};
-
-#ifdef __RWLOCK_PRIVATE
-
-#define        __HAVE_SIMPLE_RW_LOCKS          1
-/* #define     __HAVE_RW_STUBS                 1 */
-
-/*
- * RW_RECEIVE: no memory barrier required, as 'ret' implies a load fence. 
- */
-#define        RW_RECEIVE(rw)                  /* nothing */
-
-/*
- * RW_GIVE: no memory barrier required, as _lock_cas() will take care of it.
- */
-#define        RW_GIVE(rw)                     /* nothing */
-
-#define        RW_CAS(p, o, n)                 \
-    (atomic_cas_ulong((volatile unsigned long *)(p), (o), (n)) == (o))
-
-#endif /* __RWLOCK_PRIVATE */
-
-#endif /* _IA64_RWLOCK_H_ */
+/*     $NetBSD: rwlock.h,v 1.4 2019/11/29 20:04:52 riastradh Exp $     */
diff -r dadb8226c67c -r bfa11a900eba sys/arch/m68k/include/rwlock.h
--- a/sys/arch/m68k/include/rwlock.h    Fri Nov 29 19:44:59 2019 +0000
+++ b/sys/arch/m68k/include/rwlock.h    Fri Nov 29 20:04:52 2019 +0000
@@ -1,50 +1,1 @@
-/*     $NetBSD: rwlock.h,v 1.5 2008/04/28 20:23:26 martin Exp $        */
-
-/*-
- * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe and Andrew Doran.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _M68K_RWLOCK_H_
-#define        _M68K_RWLOCK_H_
-
-struct krwlock {
-       volatile uintptr_t      rw_owner;
-};
-
-#ifdef __RWLOCK_PRIVATE
-
-#define        __HAVE_SIMPLE_RW_LOCKS          1
-
-#define        RW_RECEIVE(rw)                  /* nothing */
-#define        RW_GIVE(rw)                     /* nothing */
-
-#define        RW_CAS(p, o, n)                 (atomic_cas_uint((p), (o), (n)) == (o))



Home | Main Index | Thread Index | Old Index