Module Name: src Committed By: riastradh Date: Fri Nov 29 20:04:54 UTC 2019
Modified Files: src/sys/arch/alpha/include: rwlock.h src/sys/arch/arm/include: rwlock.h src/sys/arch/hppa/include: rwlock.h src/sys/arch/ia64/include: rwlock.h src/sys/arch/m68k/include: rwlock.h src/sys/arch/mips/include: rwlock.h src/sys/arch/or1k/include: rwlock.h src/sys/arch/powerpc/include: rwlock.h src/sys/arch/riscv/include: rwlock.h src/sys/arch/sh3/include: rwlock.h src/sys/arch/sparc/include: rwlock.h src/sys/arch/sparc64/include: rwlock.h src/sys/arch/usermode/include: rwlock.h src/sys/arch/vax/include: rwlock.h src/sys/arch/x86/include: rwlock.h src/sys/kern: kern_rwlock.c src/sys/sys: rwlock.h Log Message: 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>. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/alpha/include/rwlock.h cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/include/rwlock.h cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hppa/include/rwlock.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/include/rwlock.h cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/rwlock.h cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/include/rwlock.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/or1k/include/rwlock.h cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/include/rwlock.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/include/rwlock.h cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sh3/include/rwlock.h cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc/include/rwlock.h cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/include/rwlock.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/usermode/include/rwlock.h cvs rdiff -u -r1.6 -r1.7 src/sys/arch/vax/include/rwlock.h cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/include/rwlock.h cvs rdiff -u -r1.55 -r1.56 src/sys/kern/kern_rwlock.c cvs rdiff -u -r1.10 -r1.11 src/sys/sys/rwlock.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/alpha/include/rwlock.h diff -u src/sys/arch/alpha/include/rwlock.h:1.4 src/sys/arch/alpha/include/rwlock.h:1.5 --- src/sys/arch/alpha/include/rwlock.h:1.4 Mon Apr 28 20:23:11 2008 +++ src/sys/arch/alpha/include/rwlock.h Fri Nov 29 20:04:52 2019 @@ -1,52 +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 $ */ Index: src/sys/arch/arm/include/rwlock.h diff -u src/sys/arch/arm/include/rwlock.h:1.9 src/sys/arch/arm/include/rwlock.h:1.10 --- src/sys/arch/arm/include/rwlock.h:1.9 Wed Feb 25 13:52:42 2015 +++ src/sys/arch/arm/include/rwlock.h Fri Nov 29 20:04:52 2019 @@ -1,61 +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 $ */ Index: src/sys/arch/hppa/include/rwlock.h diff -u src/sys/arch/hppa/include/rwlock.h:1.5 src/sys/arch/hppa/include/rwlock.h:1.6 --- src/sys/arch/hppa/include/rwlock.h:1.5 Mon Apr 28 20:23:23 2008 +++ src/sys/arch/hppa/include/rwlock.h Fri Nov 29 20:04:52 2019 @@ -1,56 +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 $ */ Index: src/sys/arch/ia64/include/rwlock.h diff -u src/sys/arch/ia64/include/rwlock.h:1.3 src/sys/arch/ia64/include/rwlock.h:1.4 --- src/sys/arch/ia64/include/rwlock.h:1.3 Mon Apr 28 20:23:25 2008 +++ src/sys/arch/ia64/include/rwlock.h Fri Nov 29 20:04:52 2019 @@ -1,61 +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 $ */ Index: src/sys/arch/m68k/include/rwlock.h diff -u src/sys/arch/m68k/include/rwlock.h:1.5 src/sys/arch/m68k/include/rwlock.h:1.6 --- src/sys/arch/m68k/include/rwlock.h:1.5 Mon Apr 28 20:23:26 2008 +++ src/sys/arch/m68k/include/rwlock.h Fri Nov 29 20:04:52 2019 @@ -1,50 +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)) - -#endif /* __RWLOCK_PRIVATE */ - -#endif /* _M68K_RWLOCK_H_ */ +/* $NetBSD: rwlock.h,v 1.6 2019/11/29 20:04:52 riastradh Exp $ */ Index: src/sys/arch/mips/include/rwlock.h diff -u src/sys/arch/mips/include/rwlock.h:1.8 src/sys/arch/mips/include/rwlock.h:1.9 --- src/sys/arch/mips/include/rwlock.h:1.8 Sun Feb 20 07:45:47 2011 +++ src/sys/arch/mips/include/rwlock.h Fri Nov 29 20:04:53 2019 @@ -1,53 +1 @@ -/* $NetBSD: rwlock.h,v 1.8 2011/02/20 07:45:47 matt 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 _MIPS_RWLOCK_H_ -#define _MIPS_RWLOCK_H_ - -struct krwlock { - volatile uintptr_t rw_owner; -}; - -#ifdef __RWLOCK_PRIVATE - -#include <mips/lock.h> - -#define __HAVE_SIMPLE_RW_LOCKS 1 - -#define RW_RECEIVE(rw) membar_enter() -#define RW_GIVE(rw) membar_exit() - -#define RW_CAS(p, o, n) \ - (atomic_cas_ulong((volatile u_long *)(p), (o), (n)) == (o)) - -#endif /* __RWLOCK_PRIVATE */ - -#endif /* _MIPS_RWLOCK_H_ */ +/* $NetBSD: rwlock.h,v 1.9 2019/11/29 20:04:53 riastradh Exp $ */ Index: src/sys/arch/or1k/include/rwlock.h diff -u src/sys/arch/or1k/include/rwlock.h:1.1 src/sys/arch/or1k/include/rwlock.h:1.2 --- src/sys/arch/or1k/include/rwlock.h:1.1 Wed Sep 3 19:34:26 2014 +++ src/sys/arch/or1k/include/rwlock.h Fri Nov 29 20:04:53 2019 @@ -1,56 +1 @@ -/* $NetBSD: rwlock.h,v 1.1 2014/09/03 19:34:26 matt 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 _OR1K_RWLOCK_H_ -#define _OR1K_RWLOCK_H_ - -struct krwlock { - volatile uintptr_t rw_owner; -}; - -#ifdef __RWLOCK_PRIVATE - -#define __HAVE_SIMPLE_RW_LOCKS 1 - -#ifdef MULTIPROCESSOR -#define RW_RECEIVE(rw) membar_consumer() -#define RW_GIVE(rw) membar_producer() -#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 /* _OR1K_RWLOCK_H_ */ +/* $NetBSD: rwlock.h,v 1.2 2019/11/29 20:04:53 riastradh Exp $ */ Index: src/sys/arch/powerpc/include/rwlock.h diff -u src/sys/arch/powerpc/include/rwlock.h:1.4 src/sys/arch/powerpc/include/rwlock.h:1.5 --- src/sys/arch/powerpc/include/rwlock.h:1.4 Mon Apr 28 20:23:32 2008 +++ src/sys/arch/powerpc/include/rwlock.h Fri Nov 29 20:04:53 2019 @@ -1,52 +1 @@ -/* $NetBSD: rwlock.h,v 1.4 2008/04/28 20:23:32 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 _POWERPC_RWLOCK_H_ -#define _POWERPC_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 /* _POWERPC_RWLOCK_H_ */ +/* $NetBSD: rwlock.h,v 1.5 2019/11/29 20:04:53 riastradh Exp $ */ Index: src/sys/arch/riscv/include/rwlock.h diff -u src/sys/arch/riscv/include/rwlock.h:1.1 src/sys/arch/riscv/include/rwlock.h:1.2 --- src/sys/arch/riscv/include/rwlock.h:1.1 Fri Sep 19 17:36:26 2014 +++ src/sys/arch/riscv/include/rwlock.h Fri Nov 29 20:04:53 2019 @@ -1,56 +1 @@ -/* $NetBSD: rwlock.h,v 1.1 2014/09/19 17:36:26 matt 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 _RISCV_RWLOCK_H_ -#define _RISCV_RWLOCK_H_ - -struct krwlock { - volatile uintptr_t rw_owner; -}; - -#ifdef __RWLOCK_PRIVATE - -#define __HAVE_SIMPLE_RW_LOCKS 1 - -#ifdef MULTIPROCESSOR -#define RW_RECEIVE(rw) membar_consumer() -#define RW_GIVE(rw) membar_producer() -#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 /* _RISCV_RWLOCK_H_ */ +/* $NetBSD: rwlock.h,v 1.2 2019/11/29 20:04:53 riastradh Exp $ */ Index: src/sys/arch/sh3/include/rwlock.h diff -u src/sys/arch/sh3/include/rwlock.h:1.5 src/sys/arch/sh3/include/rwlock.h:1.6 --- src/sys/arch/sh3/include/rwlock.h:1.5 Mon Apr 28 20:23:35 2008 +++ src/sys/arch/sh3/include/rwlock.h Fri Nov 29 20:04:53 2019 @@ -1,52 +1 @@ -/* $NetBSD: rwlock.h,v 1.5 2008/04/28 20:23:35 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 _SH3_RWLOCK_H_ -#define _SH3_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)) == (o)) - -uintptr_t _lock_cas(volatile uintptr_t *, uintptr_t, uintptr_t); - -#endif /* __RWLOCK_PRIVATE */ - -#endif /* _SH3_RWLOCK_H_ */ +/* $NetBSD: rwlock.h,v 1.6 2019/11/29 20:04:53 riastradh Exp $ */ Index: src/sys/arch/sparc/include/rwlock.h diff -u src/sys/arch/sparc/include/rwlock.h:1.5 src/sys/arch/sparc/include/rwlock.h:1.6 --- src/sys/arch/sparc/include/rwlock.h:1.5 Mon Apr 28 20:23:36 2008 +++ src/sys/arch/sparc/include/rwlock.h Fri Nov 29 20:04:53 2019 @@ -1,54 +1 @@ -/* $NetBSD: rwlock.h,v 1.5 2008/04/28 20:23:36 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 _SPARC_RWLOCK_H_ -#define _SPARC_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_ulong((volatile unsigned long *)(p), (o), (n)) == (o)) - -unsigned long _atomic_cas_ulong(volatile unsigned long *, - unsigned long, unsigned long); - -#endif /* __RWLOCK_PRIVATE */ - -#endif /* _SPARC_RWLOCK_H_ */ +/* $NetBSD: rwlock.h,v 1.6 2019/11/29 20:04:53 riastradh Exp $ */ Index: src/sys/arch/sparc64/include/rwlock.h diff -u src/sys/arch/sparc64/include/rwlock.h:1.5 src/sys/arch/sparc64/include/rwlock.h:1.6 --- src/sys/arch/sparc64/include/rwlock.h:1.5 Mon Apr 28 20:23:37 2008 +++ src/sys/arch/sparc64/include/rwlock.h Fri Nov 29 20:04:53 2019 @@ -1,54 +1 @@ -/* $NetBSD: rwlock.h,v 1.5 2008/04/28 20:23:37 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 _SPARC64_RWLOCK_H_ -#define _SPARC64_RWLOCK_H_ - -#include <machine/lock.h> - -struct krwlock { - volatile uintptr_t rw_owner; -}; - -#ifdef __RWLOCK_PRIVATE - -#define __HAVE_SIMPLE_RW_LOCKS 1 - -#define RW_RECEIVE(rw) mb_read() -#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 /* _SPARC64_RWLOCK_H_ */ +/* $NetBSD: rwlock.h,v 1.6 2019/11/29 20:04:53 riastradh Exp $ */ Index: src/sys/arch/usermode/include/rwlock.h diff -u src/sys/arch/usermode/include/rwlock.h:1.3 src/sys/arch/usermode/include/rwlock.h:1.4 --- src/sys/arch/usermode/include/rwlock.h:1.3 Mon Apr 28 20:23:39 2008 +++ src/sys/arch/usermode/include/rwlock.h Fri Nov 29 20:04:53 2019 @@ -1,61 +1 @@ -/* $NetBSD: rwlock.h,v 1.3 2008/04/28 20:23:39 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 _ARCH_USERMODE_INCLUDE_RWLOCK_H_ -#define _ARCH_USERMODE_INCLUDE_RWLOCK_H_ - -struct krwlock { - volatile uintptr_t rw_owner; -}; - -#ifdef __RWLOCK_PRIVATE - -#define __HAVE_SIMPLE_RW_LOCKS 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)) - -unsigned long _atomic_cas_ulong(volatile unsigned long *, - unsigned long, unsigned long); - -#endif /* __RWLOCK_PRIVATE */ - -#endif /* _ARCH_USERMODE_INCLUDE_RWLOCK_H_ */ +/* $NetBSD: rwlock.h,v 1.4 2019/11/29 20:04:53 riastradh Exp $ */ Index: src/sys/arch/vax/include/rwlock.h diff -u src/sys/arch/vax/include/rwlock.h:1.6 src/sys/arch/vax/include/rwlock.h:1.7 --- src/sys/arch/vax/include/rwlock.h:1.6 Mon Apr 28 20:23:39 2008 +++ src/sys/arch/vax/include/rwlock.h Fri Nov 29 20:04:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rwlock.h,v 1.6 2008/04/28 20:23:39 martin Exp $ */ +/* $NetBSD: rwlock.h,v 1.7 2019/11/29 20:04:53 riastradh Exp $ */ /*- * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc. @@ -32,22 +32,6 @@ #ifndef _VAX_RWLOCK_H_ #define _VAX_RWLOCK_H_ -struct krwlock { - volatile uintptr_t rw_owner; -}; - -#ifdef __RWLOCK_PRIVATE - -#include <sys/atomic.h> - #define __HAVE_RW_STUBS 1 -#define __HAVE_SIMPLE_RW_LOCKS 1 - -#define RW_RECEIVE(rw) /* nothing */ -#define RW_GIVE(rw) /* nothing */ - -#define RW_CAS(p, o, n) (atomic_cas_ulong((p), (o), (n)) == (o)) - -#endif /* __RWLOCK_PRIVATE */ #endif /* _VAX_RWLOCK_H_ */ Index: src/sys/arch/x86/include/rwlock.h diff -u src/sys/arch/x86/include/rwlock.h:1.5 src/sys/arch/x86/include/rwlock.h:1.6 --- src/sys/arch/x86/include/rwlock.h:1.5 Mon Apr 28 20:23:40 2008 +++ src/sys/arch/x86/include/rwlock.h Fri Nov 29 20:04:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rwlock.h,v 1.5 2008/04/28 20:23:40 martin Exp $ */ +/* $NetBSD: rwlock.h,v 1.6 2019/11/29 20:04:54 riastradh Exp $ */ /*- * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc. @@ -32,31 +32,6 @@ #ifndef _X86_RWLOCK_H_ #define _X86_RWLOCK_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)) - -unsigned long _atomic_cas_ulong(volatile unsigned long *, - unsigned long, unsigned long); - -#endif /* __RWLOCK_PRIVATE */ - #endif /* _X86_RWLOCK_H_ */ Index: src/sys/kern/kern_rwlock.c diff -u src/sys/kern/kern_rwlock.c:1.55 src/sys/kern/kern_rwlock.c:1.56 --- src/sys/kern/kern_rwlock.c:1.55 Mon Nov 25 20:16:22 2019 +++ src/sys/kern/kern_rwlock.c Fri Nov 29 20:04:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_rwlock.c,v 1.55 2019/11/25 20:16:22 ad Exp $ */ +/* $NetBSD: kern_rwlock.c,v 1.56 2019/11/29 20:04:54 riastradh Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.55 2019/11/25 20:16:22 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_rwlock.c,v 1.56 2019/11/29 20:04:54 riastradh Exp $"); #define __RWLOCK_PRIVATE @@ -56,6 +56,8 @@ __KERNEL_RCSID(0, "$NetBSD: kern_rwlock. #include <dev/lockstat.h> +#include <machine/rwlock.h> + /* * LOCKDEBUG */ Index: src/sys/sys/rwlock.h diff -u src/sys/sys/rwlock.h:1.10 src/sys/sys/rwlock.h:1.11 --- src/sys/sys/rwlock.h:1.10 Mon Feb 8 09:54:27 2010 +++ src/sys/sys/rwlock.h Fri Nov 29 20:04:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rwlock.h,v 1.10 2010/02/08 09:54:27 skrll Exp $ */ +/* $NetBSD: rwlock.h,v 1.11 2019/11/29 20:04:54 riastradh Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -93,7 +93,9 @@ void rw_vector_exit(krwlock_t *); int rw_vector_tryenter(krwlock_t *, const krw_t); #endif /* __RWLOCK_PRIVATE */ -#include <machine/rwlock.h> +struct krwlock { + volatile uintptr_t rw_owner; +}; #ifdef _KERNEL