Require that each each MACHINE/MACHINE_ARCH supply a lock.h. This file

contains the values __SIMPLELOCK_LOCKED and __SIMPLELOCK_UNLOCKED, which
replace the old SIMPLELOCK_LOCKED and SIMPLELOCK_UNLOCKED.  These files
are also required to supply inline functions __cpu_simple_lock(),
__cpu_simple_lock_try(), and __cpu_simple_unlock() if locking is to be
supported on that platform (i.e. if MULTIPROCESSOR is defined in the
_KERNEL case).  Change these functions to take an int * (&alp->lock_data)
rather than the struct simplelock * itself.

These changes make it possible for userland to use the locking primitives
by including <machine/lock.h>.
This commit is contained in:
thorpej 2000-04-29 03:31:45 +00:00
parent 2228799172
commit f51470a514
62 changed files with 694 additions and 264 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lock.h,v 1.4 1999/12/03 01:11:34 thorpej Exp $ */
/* $NetBSD: lock.h,v 1.5 2000/04/29 03:31:46 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -39,39 +39,37 @@
/*
* Machine-dependent spin lock operations.
*
* NOTE: We assume that SIMPLELOCK_UNLOCKED == 0, so we can simply
* store `zero' to release a lock.
*/
#ifndef _ALPHA_LOCK_H_
#define _ALPHA_LOCK_H_
static __inline void cpu_simple_lock_init __P((__volatile struct simplelock *))
#define __SIMPLELOCK_LOCKED 1
#define __SIMPLELOCK_UNLOCKED 0
static __inline void __cpu_simple_lock_init __P((__volatile int *))
__attribute__((__unused__));
static __inline void cpu_simple_lock __P((__volatile struct simplelock *))
static __inline void __cpu_simple_lock __P((__volatile int *))
__attribute__((__unused__));
static __inline int cpu_simple_lock_try __P((__volatile struct simplelock *))
static __inline int __cpu_simple_lock_try __P((__volatile int *))
__attribute__((__unused__));
static __inline void cpu_simple_unlock __P((__volatile struct simplelock *))
static __inline void __cpu_simple_unlock __P((__volatile int *))
__attribute__((__unused__));
static __inline void
cpu_simple_lock_init(alp)
__volatile struct simplelock *alp;
__cpu_simple_lock_init(__volatile int *alp)
{
__asm __volatile(
"# BEGIN cpu_simple_lock_init\n"
"# BEGIN __cpu_simple_lock_init\n"
" stl $31, %0 \n"
" mb \n"
" # END cpu_simple_lock_init"
: "=m" (alp->lock_data));
" # END __cpu_simple_lock_init"
: "=m" (*alp));
}
static __inline void
cpu_simple_lock(alp)
__volatile struct simplelock *alp;
__cpu_simple_lock(__volatile int *alp)
{
unsigned long t0;
@ -83,7 +81,7 @@ cpu_simple_lock(alp)
*/
__asm __volatile(
"# BEGIN cpu_simple_lock\n"
"# BEGIN __cpu_simple_lock\n"
"1: ldl_l %0, %3 \n"
" bne %0, 2f \n"
" bis $31, %2, %0 \n"
@ -96,19 +94,18 @@ cpu_simple_lock(alp)
" br 2b \n"
"3: br 1b \n"
"4: \n"
" # END cpu_simple_lock\n"
: "=r" (t0), "=m" (alp->lock_data)
: "i" (SIMPLELOCK_LOCKED), "1" (alp->lock_data));
" # END __cpu_simple_lock\n"
: "=r" (t0), "=m" (*alp)
: "i" (__SIMPLELOCK_LOCKED), "1" (*alp));
}
static __inline int
cpu_simple_lock_try(alp)
__volatile struct simplelock *alp;
__cpu_simple_lock_try(__volatile int *alp)
{
unsigned long t0, v0;
__asm __volatile(
"# BEGIN cpu_simple_lock_try\n"
"# BEGIN __cpu_simple_lock_try\n"
"1: ldl_l %0, %4 \n"
" bne %0, 2f \n"
" bis $31, %3, %0 \n"
@ -121,24 +118,23 @@ cpu_simple_lock_try(alp)
" br 4f \n"
"3: br 1b \n"
"4: \n"
" # END cpu_simple_lock_try"
: "=r" (t0), "=r" (v0), "=m" (alp->lock_data)
: "i" (SIMPLELOCK_LOCKED), "2" (alp->lock_data));
" # END __cpu_simple_lock_try"
: "=r" (t0), "=r" (v0), "=m" (*alp)
: "i" (__SIMPLELOCK_LOCKED), "2" (*alp));
return (v0);
}
static __inline void
cpu_simple_unlock(alp)
__volatile struct simplelock *alp;
__cpu_simple_unlock(__volatile int *alp)
{
__asm __volatile(
"# BEGIN cpu_simple_unlock\n"
"# BEGIN __cpu_simple_unlock\n"
" stl $31, %0 \n"
" mb \n"
" # END cpu_simple_unlock"
: "=m" (alp->lock_data));
" # END __cpu_simple_unlock"
: "=m" (*alp));
}
#endif /* _ALPHA_LOCK_H_ */

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 2000/03/17 22:36:32 tron Exp $
# $NetBSD: Makefile,v 1.8 2000/04/29 03:31:47 thorpej Exp $
KDIR= /sys/arch/amiga/include
INCSDIR= /usr/include/amiga
@ -6,8 +6,8 @@ INCSDIR= /usr/include/amiga
INCS= ansi.h aout_machdep.h asm.h bswap.h bus.h cdefs.h conf.h cpu.h \
cpufunc.h db_machdep.h disklabel.h elf_machdep.h endian.h \
endian_machdep.h fbio.h float.h frame.h ieee.h ieeefp.h intr.h \
kcore.h limits.h math.h mtpr.h param.h pcb.h pmap.h proc.h profile.h \
psl.h pte.h ptrace.h reg.h setjmp.h signal.h stdarg.h svr4_machdep.h \
trap.h types.h varargs.h vmparam.h
kcore.h limits.h lock.h math.h mtpr.h param.h pcb.h pmap.h proc.h \
profile.h psl.h pte.h ptrace.h reg.h setjmp.h signal.h stdarg.h \
svr4_machdep.h trap.h types.h varargs.h vmparam.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:46 thorpej Exp $ */
/* Just use the common m68k definition */
#include <m68k/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.14 2000/03/31 11:44:05 soda Exp $
# $NetBSD: Makefile,v 1.15 2000/04/29 03:31:47 thorpej Exp $
KDIR= /sys/arch/arc/include
INCSDIR= /usr/include/arc
@ -8,7 +8,7 @@ INCSDIR= /usr/include/arc
INCS= ansi.h aout_machdep.h asm.h autoconf.h bswap.h bsd-aout.h \
cdefs.h cpu.h cpuregs.h disklabel.h display.h ecoff_machdep.h \
elf_machdep.h endian.h endian_machdep.h float.h ieee.h ieeefp.h \
kcore.h kdbparam.h limits.h math.h mips_opcode.h \
kcore.h kdbparam.h limits.h lock.h math.h mips_opcode.h \
mouse.h param.h pcb.h pccons.h pmap.h proc.h profile.h psl.h \
pte.h ptrace.h reg.h regdef.h regnum.h reloc.h setjmp.h signal.h \
stdarg.h trap.h types.h varargs.h vmparam.h

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:47 thorpej Exp $ */
/* Just use the common mips definition */
#include <mips/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 2000/03/17 22:36:32 tron Exp $
# $NetBSD: Makefile,v 1.9 2000/04/29 03:31:47 thorpej Exp $
KDIR= /sys/arch/arm32/include
INCSDIR= /usr/include/arm32
@ -7,7 +7,7 @@ INCS= ansi.h aout_machdep.h asm.h beep.h bootconfig.h bswap.h bus.h cdefs.h \
conf.h cpu.h cpufunc.h cpus.h db_machdep.h devmap.h disklabel.h \
disklabel_acorn.h endian.h endian_machdep.h float.h fp.h frame.h \
ieee.h ieeefp.h iic.h intr.h io.h ipkdb.h irqhandler.h joystick.h \
katelib.h kbd.h limits.h math.h mouse.h \
katelib.h kbd.h limits.h lock.h math.h mouse.h \
param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h \
rtc.h setjmp.h signal.h stdarg.h sysarch.h trap.h types.h undefined.h \
varargs.h vconsole.h vidc.h vmparam.h

View File

@ -0,0 +1,49 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:47 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 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.
*/
/*
* Machine-dependent spin lock operations.
*/
#ifndef _ARM32_LOCK_H_
#define _ARM32_LOCK_H_
#define __SIMPLELOCK_LOCKED 1
#define __SIMPLELOCK_UNLOCKED 0
#endif /* _ARM32_LOCK_H_ */

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.10 2000/03/17 22:36:32 tron Exp $
# $NetBSD: Makefile,v 1.11 2000/04/29 03:31:47 thorpej Exp $
KDIR= /sys/arch/atari/include
INCSDIR= /usr/include/atari
@ -6,7 +6,7 @@ INCSDIR= /usr/include/atari
INCS= ahdilabel.h ansi.h aout_machdep.h asm.h bswap.h cdefs.h cpu.h \
cpufunc.h db_machdep.h disklabel.h elf_machdep.h endian.h \
endian_machdep.h float.h frame.h intr.h ieee.h ieeefp.h kcore.h \
limits.h math.h msioctl.h mtpr.h param.h pcb.h pmap.h proc.h \
limits.h lock.h math.h msioctl.h mtpr.h param.h pcb.h pmap.h proc.h \
profile.h psl.h pte.h ptrace.h reg.h setjmp.h signal.h stdarg.h \
svr4_machdep.h trap.h types.h varargs.h vmparam.h

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:47 thorpej Exp $ */
/* Just use the common m68k definition */
#include <m68k/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2000/03/17 22:36:33 tron Exp $
# $NetBSD: Makefile,v 1.7 2000/04/29 03:31:48 thorpej Exp $
KDIR= /sys/arch/bebox/include
INCSDIR= /usr/include/bebox
@ -6,9 +6,9 @@ INCSDIR= /usr/include/bebox
INCS= ansi.h aout_machdep.h asm.h bat.h bootinfo.h bswap.h bus.h cdefs.h \
conf.h cpu.h cpufunc.h db_machdep.h disklabel.h elf_machdep.h \
endian.h endian_machdep.h float.h fpu.h frame.h ieee.h ieeefp.h \
intr.h ipkdb.h kcore.h kgdb.h limits.h machine_type.h math.h mouse.h \
param.h pcb.h pccons.h pio.h pmap.h powerpc.h proc.h profile.h psl.h \
pte.h ptrace.h reg.h reloc.h setjmp.h signal.h spkr.h stdarg.h trap.h \
types.h varargs.h vmparam.h
intr.h ipkdb.h kcore.h kgdb.h limits.h lock.h machine_type.h math.h \
mouse.h param.h pcb.h pccons.h pio.h pmap.h powerpc.h proc.h \
profile.h psl.h pte.h ptrace.h reg.h reloc.h setjmp.h signal.h \
spkr.h stdarg.h trap.h types.h varargs.h vmparam.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:48 thorpej Exp $ */
/* Just use the common PowerPC definition */
#include <powerpc/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.3 2000/03/30 21:33:30 soren Exp $
# $NetBSD: Makefile,v 1.4 2000/04/29 03:31:48 thorpej Exp $
KDIR= /sys/arch/cobalt/include
INCSDIR= /usr/include/cobalt
@ -6,9 +6,9 @@ INCSDIR= /usr/include/cobalt
INCS= ansi.h aout_machdep.h asm.h autoconf.h bsd-aout.h bswap.h cdefs.h \
conf.h cpu.h db_machdep.h disklabel.h ecoff_machdep.h elf_machdep.h \
endian.h endian_machdep.h float.h ieee.h ieeefp.h intr.h kcore.h \
kdbparam.h leds.h limits.h locore.h math.h mips_opcode.h nvram.h \
param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h \
regdef.h regnum.h reloc.h setjmp.h signal.h stdarg.h trap.h types.h \
varargs.h vmparam.h
kdbparam.h leds.h limits.h lock.h locore.h math.h mips_opcode.h \
nvram.h param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h \
reg.h regdef.h regnum.h reloc.h setjmp.h signal.h stdarg.h trap.h \
types.h varargs.h vmparam.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:48 thorpej Exp $ */
/* Just use the common mips definition */
#include <mips/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.5 2000/03/17 22:36:33 tron Exp $
# $NetBSD: Makefile,v 1.6 2000/04/29 03:31:48 thorpej Exp $
KDIR= /sys/arch/evbsh3/include
INCSDIR= /usr/include/evbsh3
@ -6,7 +6,7 @@ INCSDIR= /usr/include/evbsh3
INCS= ansi.h aout_machdep.h asm.h bootinfo.h bswap.h bus.h cdefs.h \
coff_machdep.h conf.h cpu.h cpufunc.h cputypes.h db_machdep.h \
disklabel.h elf_machdep.h endian.h endian_machdep.h float.h frame.h \
ieee.h ieeefp.h intr.h limits.h math.h mmeye.h param.h pcb.h \
ieee.h ieeefp.h intr.h limits.h lock.h math.h mmeye.h param.h pcb.h \
pio.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h segments.h \
setjmp.h shbvar.h signal.h stdarg.h \
trap.h types.h varargs.h vmparam.h

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:48 thorpej Exp $ */
/* Just use the common sh3 definition */
#include <sh3/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.9 2000/03/17 22:36:33 tron Exp $
# $NetBSD: Makefile,v 1.10 2000/04/29 03:31:49 thorpej Exp $
KDIR= /sys/arch/hp300/include
INCSDIR= /usr/include/hp300
@ -6,8 +6,8 @@ INCSDIR= /usr/include/hp300
INCS= ansi.h aout_machdep.h asm.h autoconf.h bswap.h bus.h cdefs.h cpu.h \
db_machdep.h disklabel.h elf_machdep.h endian.h endian_machdep.h \
float.h frame.h hp300spu.h hpux_machdep.h ieee.h ieeefp.h intr.h \
kcore.h limits.h math.h param.h pcb.h pmap.h proc.h profile.h psl.h \
pte.h ptrace.h reg.h setjmp.h signal.h stdarg.h svr4_machdep.h trap.h \
types.h varargs.h vmparam.h
kcore.h limits.h lock.h math.h param.h pcb.h pmap.h proc.h profile.h \
psl.h pte.h ptrace.h reg.h setjmp.h signal.h stdarg.h svr4_machdep.h \
trap.h types.h varargs.h vmparam.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:49 thorpej Exp $ */
/* Just use the common m68k definition */
#include <m68k/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.4 2000/03/17 22:36:33 tron Exp $
# $NetBSD: Makefile,v 1.5 2000/04/29 03:31:49 thorpej Exp $
KDIR= /sys/arch/hpcmips/include
INCSDIR= /usr/include/hpcmips
@ -6,9 +6,9 @@ INCSDIR= /usr/include/hpcmips
INCS= ansi.h aout_machdep.h asm.h autoconf.h bootinfo.h bswap.h bus.h \
cdefs.h clock_machdep.h cpu.h db_machdep.h disklabel.h \
ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h intr.h \
kcore.h limits.h locore.h math.h param.h pcb.h pmap.h proc.h psl.h \
pte.h ptrace.h reg.h regdef.h regnum.h reloc.h signal.h stdarg.h \
sysconf.h types.h vmparam.h setjmp.h float.h ieeefp.h ieee.h \
kcore.h limits.h lock.h locore.h math.h param.h pcb.h pmap.h proc.h \
psl.h pte.h ptrace.h reg.h regdef.h regnum.h reloc.h signal.h \
stdarg.h sysconf.h types.h vmparam.h setjmp.h float.h ieeefp.h ieee.h \
bsd-aout.h kdbparam.h mips_opcode.h profile.h trap.h varargs.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:49 thorpej Exp $ */
/* Just use the common mips definition */
#include <mips/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.11 2000/03/17 17:22:57 tron Exp $
# $NetBSD: Makefile,v 1.12 2000/04/29 03:31:49 thorpej Exp $
KDIR= /sys/arch/i386/include
INCSDIR= /usr/include/i386
@ -7,8 +7,8 @@ INCS= ansi.h aout_machdep.h apmvar.h asm.h bioscall.h bootinfo.h bswap.h \
byte_swap.h bus.h cdefs.h conf.h cpu.h cpufunc.h cputypes.h \
db_machdep.h disklabel.h elf_machdep.h endian.h endian_machdep.h \
float.h frame.h freebsd_machdep.h gdt.h ibcs2_machdep.h ieee.h \
ieeefp.h intr.h joystick.h kcore.h limits.h math.h mouse.h npx.h \
param.h pcb.h pccons.h pio.h pmap.h \
ieeefp.h intr.h joystick.h kcore.h limits.h lock.h math.h mouse.h \
npx.h param.h pcb.h pccons.h pio.h pmap.h \
proc.h profile.h psl.h pte.h ptrace.h reg.h segments.h \
setjmp.h signal.h specialreg.h spkr.h stdarg.h svr4_machdep.h \
sysarch.h trap.h tss.h types.h varargs.h vm86.h vmparam.h

View File

@ -0,0 +1,49 @@
/* $NetBSD: lock.h,v 1.2 2000/04/29 03:31:49 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 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.
*/
/*
* Machine-dependent spin lock operations.
*/
#ifndef _I386_LOCK_H_
#define _I386_LOCK_H_
#define __SIMPLELOCK_LOCKED 1
#define __SIMPLELOCK_UNLOCKED 0
#endif /* _I386_LOCK_H_ */

View File

@ -1,12 +1,12 @@
# $NetBSD: Makefile,v 1.2 2000/03/17 22:36:34 tron Exp $
# $NetBSD: Makefile,v 1.3 2000/04/29 03:31:50 thorpej Exp $
KDIR= /sys/arch/luna68k/include
INCSDIR= /usr/include/luna68k
INCS= ansi.h aout_machdep.h asm.h autoconf.h bswap.h bus.h cdefs.h \
cpu.h db_machdep.h disklabel.h endian.h endian_machdep.h float.h \
frame.h ieee.h ieeefp.h intr.h kcore.h limits.h math.h param.h pcb.h \
pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h setjmp.h signal.h \
stdarg.h trap.h types.h varargs.h vmparam.h
frame.h ieee.h ieeefp.h intr.h kcore.h limits.h lock.h math.h \
param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h \
setjmp.h signal.h stdarg.h trap.h types.h varargs.h vmparam.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:50 thorpej Exp $ */
/* Just use the common m68k definition */
#include <m68k/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 2000/03/17 22:36:34 tron Exp $
# $NetBSD: Makefile,v 1.8 2000/04/29 03:31:50 thorpej Exp $
KDIR= /sys/arch/m68k/include
INCSDIR= /usr/include/m68k
@ -6,8 +6,8 @@ INCSDIR= /usr/include/m68k
INCS= ansi.h aout_machdep.h asm.h asm_single.h bswap.h cacheops.h \
cacheops_20.h cacheops_30.h cacheops_40.h cacheops_60.h cdefs.h \
cpu.h db_machdep.h elf_machdep.h endian.h endian_machdep.h float.h \
frame.h ieee.h ieeefp.h kcore.h limits.h m68k.h math.h param.h pcb.h \
profile.h psl.h ptrace.h reg.h setjmp.h signal.h stdarg.h \
svr4_machdep.h sync_icache.h sysctl.h trap.h types.h varargs.h
frame.h ieee.h ieeefp.h kcore.h limits.h lock.h m68k.h math.h \
param.h pcb.h profile.h psl.h ptrace.h reg.h setjmp.h signal.h \
stdarg.h svr4_machdep.h sync_icache.h sysctl.h trap.h types.h varargs.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,49 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:50 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 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.
*/
/*
* Machine-dependent spin lock operations.
*/
#ifndef _M68K_LOCK_H_
#define _M68K_LOCK_H_
#define __SIMPLELOCK_LOCKED 1
#define __SIMPLELOCK_UNLOCKED 0
#endif /* _M68K_LOCK_H_ */

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.7 2000/03/17 22:36:34 tron Exp $
# $NetBSD: Makefile,v 1.8 2000/04/29 03:31:50 thorpej Exp $
KDIR= /sys/arch/mac68k/include
INCSDIR= /usr/include/mac68k
@ -6,9 +6,9 @@ INCSDIR= /usr/include/mac68k
INCS= adbsys.h ansi.h aout_machdep.h asm.h autoconf.h bswap.h bus.h cdefs.h \
cpu.h db_machdep.h disklabel.h elf_machdep.h endian.h \
endian_machdep.h float.h frame.h grfioctl.h ieee.h ieeefp.h intr.h \
iteioctl.h kcore.h keyboard.h limits.h param.h math.h pcb.h pio.h \
pmap.h proc.h profile.h psc.h psl.h pte.h ptrace.h reg.h scsi_5380.h \
setjmp.h signal.h stdarg.h svr4_machdep.h trap.h types.h varargs.h \
viareg.h vmparam.h z8530var.h
iteioctl.h kcore.h keyboard.h limits.h lock.h param.h math.h pcb.h \
pio.h pmap.h proc.h profile.h psc.h psl.h pte.h ptrace.h reg.h \
scsi_5380.h setjmp.h signal.h stdarg.h svr4_machdep.h trap.h \
types.h varargs.h viareg.h vmparam.h z8530var.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:50 thorpej Exp $ */
/* Just use the common m68k definition */
#include <m68k/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2000/03/17 22:36:34 tron Exp $
# $NetBSD: Makefile,v 1.7 2000/04/29 03:31:51 thorpej Exp $
KDIR= /sys/arch/macppc/include
INCSDIR= /usr/include/macppc
@ -6,9 +6,9 @@ INCSDIR= /usr/include/macppc
INCS= adbsys.h ansi.h aout_machdep.h asm.h autoconf.h bat.h bswap.h bus.h \
cdefs.h cpu.h db_machdep.h disklabel.h elf_machdep.h endian.h \
endian_machdep.h float.h fpu.h frame.h grfioctl.h ieee.h ieeefp.h \
intr.h ipkdb.h kcore.h keyboard.h limits.h machine_type.h math.h \
param.h pcb.h pio.h pmap.h powerpc.h proc.h profile.h psl.h pte.h \
ptrace.h reg.h reloc.h setjmp.h signal.h stdarg.h trap.h types.h \
varargs.h vmparam.h z8530var.h
intr.h ipkdb.h kcore.h keyboard.h limits.h lock.h machine_type.h \
math.h param.h pcb.h pio.h pmap.h powerpc.h proc.h profile.h psl.h \
pte.h ptrace.h reg.h reloc.h setjmp.h signal.h stdarg.h trap.h \
types.h varargs.h vmparam.h z8530var.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:51 thorpej Exp $ */
/* Just use the common PowerPC definition */
#include <powerpc/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.13 2000/03/17 22:36:35 tron Exp $
# $NetBSD: Makefile,v 1.14 2000/04/29 03:31:51 thorpej Exp $
KDIR= /sys/arch/mips/include
INCSDIR= /usr/include/mips
@ -6,8 +6,8 @@ INCSDIR= /usr/include/mips
INCS= ansi.h aout_machdep.h asm.h bswap.h bsd-aout.h cachectl.h \
cdefs.h cpu.h cpuregs.h db_machdep.h ecoff_machdep.h \
elf_machdep.h endian.h endian_machdep.h float.h ieee.h ieeefp.h \
kcore.h kdbparam.h limits.h locore.h math.h mips1_pte.h mips3_pte.h \
mips_opcode.h mips_param.h pcb.h pmap.h proc.h profile.h \
kcore.h kdbparam.h limits.h lock.h locore.h math.h mips1_pte.h \
mips3_pte.h mips_opcode.h mips_param.h pcb.h pmap.h proc.h profile.h \
psl.h pte.h ptrace.h reg.h regdef.h regnum.h reloc.h setjmp.h \
signal.h stdarg.h sysarch.h trap.h types.h varargs.h \
vmparam.h

View File

@ -0,0 +1,49 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:51 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 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.
*/
/*
* Machine-dependent spin lock operations.
*/
#ifndef _MIPS_LOCK_H_
#define _MIPS_LOCK_H_
#define __SIMPLELOCK_LOCKED 1
#define __SIMPLELOCK_UNLOCKED 0
#endif /* _MIPS_LOCK_H_ */

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.5 2000/03/17 22:36:35 tron Exp $
# $NetBSD: Makefile,v 1.6 2000/04/29 03:31:51 thorpej Exp $
KDIR= /sys/arch/mmeye/include
INCSDIR= /usr/include/mmeye
@ -6,9 +6,9 @@ INCSDIR= /usr/include/mmeye
INCS= ansi.h aout_machdep.h asm.h bootinfo.h bswap.h bus.h cdefs.h \
coff_machdep.h conf.h cpu.h cpufunc.h cputypes.h db_machdep.h \
disklabel.h elf_machdep.h endian.h endian_machdep.h float.h frame.h \
ieee.h ieeefp.h intr.h limits.h loadfile_machdep.h math.h mmeye.h \
param.h pcb.h pio.h pmap.h proc.h profile.h psl.h pte.h ptrace.h \
reg.h segments.h setjmp.h shbvar.h signal.h stdarg.h \
ieee.h ieeefp.h intr.h limits.h lock.h loadfile_machdep.h math.h \
mmeye.h param.h pcb.h pio.h pmap.h proc.h profile.h psl.h pte.h \
ptrace.h reg.h segments.h setjmp.h shbvar.h signal.h stdarg.h \
trap.h types.h varargs.h vmparam.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:51 thorpej Exp $ */
/* Just use the common sh3 definition */
#include <sh3/lock.h>

View File

@ -1,11 +1,11 @@
# $NetBSD: Makefile,v 1.8 2000/04/15 21:20:35 scw Exp $
# $NetBSD: Makefile,v 1.9 2000/04/29 03:31:51 thorpej Exp $
KDIR= /sys/arch/mvme68k/include
INCSDIR= /usr/include/mvme68k
INCS= ansi.h aout_machdep.h asm.h autoconf.h bswap.h cdefs.h cpu.h \
db_machdep.h disklabel.h elf_machdep.h endian.h endian_machdep.h \
float.h frame.h ieee.h ieeefp.h intr.h kcore.h limits.h math.h \
float.h frame.h ieee.h ieeefp.h intr.h kcore.h limits.h lock.h math.h \
param.h pcb.h pmap.h proc.h profile.h prom.h psl.h pte.h ptrace.h \
reg.h setjmp.h signal.h stdarg.h svr4_machdep.h trap.h types.h \
varargs.h vmparam.h z8530var.h

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:51 thorpej Exp $ */
/* Just use the common m68k definition */
#include <m68k/lock.h>

View File

@ -1,11 +1,11 @@
# $NetBSD: Makefile,v 1.3 2000/03/17 22:36:36 tron Exp $
# $NetBSD: Makefile,v 1.4 2000/04/29 03:31:52 thorpej Exp $
KDIR= /sys/arch/news68k/include
INCSDIR= /usr/include/news68k
INCS= ansi.h aout_machdep.h asm.h autoconf.h bswap.h cdefs.h cpu.h \
db_machdep.h disklabel.h elf_machdep.h endian.h endian_machdep.h \
float.h frame.h ieee.h ieeefp.h intr.h kcore.h limits.h math.h \
float.h frame.h ieee.h ieeefp.h intr.h kcore.h limits.h lock.h math.h \
param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h \
setjmp.h signal.h stdarg.h svr4_machdep.h trap.h \
types.h varargs.h vmparam.h

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:52 thorpej Exp $ */
/* Just use the common m68k definition */
#include <m68k/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.15 2000/03/30 21:33:30 soren Exp $
# $NetBSD: Makefile,v 1.16 2000/04/29 03:31:52 thorpej Exp $
KDIR= /sys/arch/newsmips/include
INCSDIR= /usr/include/newsmips
@ -7,9 +7,9 @@ INCS= adrsmap.h ansi.h asm.h aout_machdep.h apbus.h apcall.h autoconf.h \
bswap.h bsd-aout.h cdefs.h conf.h cpu.h db_machdep.h disklabel.h \
ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h float.h \
framebuf.h ieee.h ieeefp.h intr.h kcore.h kdbparam.h keyboard.h \
limits.h locore.h machConst.h math.h mips_opcode.h mouse.h param.h \
pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h regdef.h \
regnum.h reloc.h romcall.h setjmp.h signal.h stdarg.h trap.h types.h \
varargs.h vmparam.h z8530var.h
limits.h lock.h locore.h machConst.h math.h mips_opcode.h mouse.h \
param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h \
regdef.h regnum.h reloc.h romcall.h setjmp.h signal.h stdarg.h \
trap.h types.h varargs.h vmparam.h z8530var.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:52 thorpej Exp $ */
/* Just use the common mips definition */
#include <mips/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2000/03/17 22:36:36 tron Exp $
# $NetBSD: Makefile,v 1.7 2000/04/29 03:31:52 thorpej Exp $
KDIR= /sys/arch/next68k/include
INCSDIR= /usr/include/next68k
@ -6,8 +6,8 @@ INCSDIR= /usr/include/next68k
INCS= ansi.h aout_machdep.h asm.h autoconf.h bswap.h bus.h bus_dma.h \
bus_space.h cdefs.h cpu.h db_machdep.h disklabel.h elf_machdep.h \
endian.h endian_machdep.h float.h frame.h ieee.h ieeefp.h intr.h \
kcore.h limits.h math.h param.h pcb.h pmap.h proc.h profile.h psl.h \
pte.h ptrace.h reg.h setjmp.h signal.h stdarg.h svr4_machdep.h trap.h \
types.h varargs.h vmparam.h z8530var.h
kcore.h limits.h lock.h math.h param.h pcb.h pmap.h proc.h profile.h \
psl.h pte.h ptrace.h reg.h setjmp.h signal.h stdarg.h svr4_machdep.h \
trap.h types.h varargs.h vmparam.h z8530var.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:52 thorpej Exp $ */
/* Just use the common m68k definition */
#include <m68k/lock.h>

View File

@ -1,13 +1,13 @@
# $NetBSD: Makefile,v 1.5 2000/03/17 22:36:37 tron Exp $
# $NetBSD: Makefile,v 1.6 2000/04/29 03:31:53 thorpej Exp $
KDIR= /sys/arch/ofppc/include
INCSDIR= /usr/include/ofppc
INCS= ansi.h aout_machdep.h asm.h bat.h bswap.h cdefs.h cpu.h db_machdep.h \
disklabel.h elf_machdep.h endian.h endian_machdep.h float.h fpu.h \
frame.h ieee.h ieeefp.h ipkdb.h irq.h kcore.h limits.h machine_type.h \
math.h param.h pcb.h pmap.h powerpc.h proc.h profile.h psl.h pte.h \
ptrace.h reg.h reloc.h setjmp.h signal.h stdarg.h trap.h types.h \
varargs.h vmparam.h
frame.h ieee.h ieeefp.h ipkdb.h irq.h kcore.h limits.h lock.h \
machine_type.h math.h param.h pcb.h pmap.h powerpc.h proc.h \
profile.h psl.h pte.h ptrace.h reg.h reloc.h setjmp.h signal.h \
stdarg.h trap.h types.h varargs.h vmparam.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:53 thorpej Exp $ */
/* Just use the common PowerPC definition */
#include <powerpc/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2000/03/17 22:36:37 tron Exp $
# $NetBSD: Makefile,v 1.7 2000/04/29 03:31:53 thorpej Exp $
KDIR= /sys/arch/pc532/include
INCSDIR= /usr/include/pc532
@ -6,8 +6,8 @@ INCSDIR= /usr/include/pc532
INCS= ansi.h aout_machdep.h asm.h autoconf.h bswap.h byte_swap.h cdefs.h \
conf.h cpu.h cpufunc.h db_machdep.h disklabel.h endian.h \
endian_machdep.h float.h fpu.h frame.h icu.h ieee.h ieeefp.h jmpbuf.h \
kcore.h limits.h math.h mtpr.h param.h pcb.h pmap.h proc.h profile.h \
psl.h pte.h ptrace.h reg.h setjmp.h signal.h stdarg.h trap.h types.h \
varargs.h vmparam.h
kcore.h limits.h lock.h math.h mtpr.h param.h pcb.h pmap.h proc.h \
profile.h psl.h pte.h ptrace.h reg.h setjmp.h signal.h stdarg.h \
trap.h types.h varargs.h vmparam.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,49 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:53 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 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.
*/
/*
* Machine-dependent spin lock operations.
*/
#ifndef _PC532_LOCK_H_
#define _PC532_LOCK_H_
#define __SIMPLELOCK_LOCKED 1
#define __SIMPLELOCK_UNLOCKED 0
#endif /* _PC532_LOCK_H_ */

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.16 2000/03/30 21:33:30 soren Exp $
# $NetBSD: Makefile,v 1.17 2000/04/29 03:31:53 thorpej Exp $
KDIR= /sys/arch/pmax/include
INCSDIR= /usr/include/pmax
@ -7,9 +7,9 @@ INCS= ansi.h aout_machdep.h asm.h autoconf.h bswap.h bsd-aout.h bus.h \
cdefs.h clock_machdep.h conf.h cpu.h db_machdep.h dc7085cons.h \
disklabel.h ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \
fbio.h fbvar.h float.h ieee.h ieeefp.h intr.h kcore.h kdbparam.h \
limits.h locore.h math.h mips_opcode.h param.h pcb.h pmap.h pmioctl.h \
proc.h profile.h psl.h pte.h ptrace.h reg.h regdef.h regnum.h reloc.h \
setjmp.h signal.h stdarg.h tc_machdep.h trap.h types.h varargs.h \
vmparam.h
limits.h lock.h locore.h math.h mips_opcode.h param.h pcb.h pmap.h \
pmioctl.h proc.h profile.h psl.h pte.h ptrace.h reg.h regdef.h \
regnum.h reloc.h setjmp.h signal.h stdarg.h tc_machdep.h trap.h \
types.h varargs.h vmparam.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:53 thorpej Exp $ */
/* Just use the common mips definition */
#include <mips/lock.h>

View File

@ -1,12 +1,13 @@
# $NetBSD: Makefile,v 1.9 2000/03/17 22:36:40 tron Exp $
# $NetBSD: Makefile,v 1.10 2000/04/29 03:31:54 thorpej Exp $
KDIR= /sys/arch/powerpc/include
INCSDIR= /usr/include/powerpc
INCS= ansi.h aout_machdep.h asm.h bat.h bswap.h cdefs.h cpu.h db_machdep.h \
elf_machdep.h endian.h endian_machdep.h float.h fpu.h frame.h \
hid_601.h ieee.h ieeefp.h ipkdb.h kcore.h limits.h machine_type.h \
math.h param.h pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h \
reg.h reloc.h setjmp.h signal.h stdarg.h trap.h types.h varargs.h
hid_601.h ieee.h ieeefp.h ipkdb.h kcore.h limits.h lock.h \
machine_type.h math.h param.h pcb.h pmap.h proc.h profile.h \
psl.h pte.h ptrace.h reg.h reloc.h setjmp.h signal.h stdarg.h \
trap.h types.h varargs.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,49 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:54 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 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.
*/
/*
* Machine-dependent spin lock operations.
*/
#ifndef _POWERPC_LOCK_H_
#define _POWERPC_LOCK_H_
#define __SIMPLELOCK_LOCKED 1
#define __SIMPLELOCK_UNLOCKED 0
#endif /* _POWERPC_LOCK_H_ */

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2000/03/17 22:36:40 tron Exp $
# $NetBSD: Makefile,v 1.3 2000/04/29 03:31:54 thorpej Exp $
KDIR= /sys/arch/prep/include
INCSDIR= /usr/include/prep
@ -6,9 +6,9 @@ INCSDIR= /usr/include/prep
INCS= ansi.h aout_machdep.h asm.h bat.h bootinfo.h bswap.h bus.h cdefs.h \
conf.h cpu.h cpufunc.h db_machdep.h disklabel.h elf_machdep.h \
endian.h endian_machdep.h float.h fpu.h frame.h ieee.h ieeefp.h \
intr.h ipkdb.h kcore.h kgdb.h limits.h machine_type.h math.h mouse.h \
param.h pcb.h pccons.h pio.h pmap.h powerpc.h proc.h profile.h psl.h \
pte.h ptrace.h reg.h reloc.h setjmp.h signal.h spkr.h stdarg.h trap.h \
types.h varargs.h vmparam.h
intr.h ipkdb.h kcore.h kgdb.h limits.h lock.h machine_type.h \
math.h mouse.h param.h pcb.h pccons.h pio.h pmap.h powerpc.h \
proc.h profile.h psl.h pte.h ptrace.h reg.h reloc.h setjmp.h \
signal.h spkr.h stdarg.h trap.h types.h varargs.h vmparam.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:54 thorpej Exp $ */
/* Just use the common PowerPC definition */
#include <powerpc/lock.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2000/03/17 22:36:40 tron Exp $
# $NetBSD: Makefile,v 1.7 2000/04/29 03:31:54 thorpej Exp $
KDIR= /sys/arch/sh3/include
INCSDIR= /usr/include/sh3
@ -7,10 +7,10 @@ INCS= ansi.h aout_machdep.h asm.h bootinfo.h bscreg.h bswap.h bus.h \
ccrreg.h cdefs.h coff_machdep.h cpgreg.h cpu.h cpufunc.h cputypes.h \
db_disasm.h db_machdep.h disklabel.h elf_machdep.h endian.h \
endian_machdep.h float.h frame.h ieee.h ieeefp.h intcreg.h intr.h \
limits.h math.h mmureg.h param.h pcb.h pfcreg.h pio.h pmap.h proc.h \
profile.h psl.h pte.h ptrace.h reg.h rtcreg.h scifreg.h scireg.h \
segments.h setjmp.h sh_opcode.h shbvar.h signal.h stdarg.h tmureg.h \
trap.h trapreg.h types.h ubcreg.h va-sh.h varargs.h vmparam.h \
wdogvar.h wdtreg.h
limits.h lock.h math.h mmureg.h param.h pcb.h pfcreg.h pio.h pmap.h \
proc.h profile.h psl.h pte.h ptrace.h reg.h rtcreg.h scifreg.h \
scireg.h segments.h setjmp.h sh_opcode.h shbvar.h signal.h stdarg.h \
tmureg.h trap.h trapreg.h types.h ubcreg.h va-sh.h varargs.h \
vmparam.h wdogvar.h wdtreg.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,49 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:54 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 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.
*/
/*
* Machine-dependent spin lock operations.
*/
#ifndef _SH3_LOCK_H_
#define _SH3_LOCK_H_
#define __SIMPLELOCK_LOCKED 1
#define __SIMPLELOCK_UNLOCKED 0
#endif /* _SH3_LOCK_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: lock.h,v 1.6 1999/07/27 23:45:14 thorpej Exp $ */
/* $NetBSD: lock.h,v 1.7 2000/04/29 03:31:55 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -43,64 +43,71 @@
* Machine dependent spin lock operations.
*/
#if defined(_KERNEL)
#include <sparc/sparc/asm.h>
/*
* The value for SIMPLELOCK_LOCKED is what ldstub() naturally stores
* The value for __SIMPLELOCK_LOCKED is what ldstub() naturally stores
* `lock_data' given its address (and the fact that SPARC is big-endian).
*/
#undef SIMPLELOCK_LOCKED
#define SIMPLELOCK_LOCKED 0xff000000
#define __SIMPLELOCK_LOCKED 0xff000000
#define __SIMPLELOCK_UNLOCKED 0
static void cpu_simple_lock_init __P((__volatile struct simplelock *));
static void cpu_simple_lock __P((__volatile struct simplelock *));
static int cpu_simple_lock_try __P((__volatile struct simplelock *));
static void cpu_simple_unlock __P((__volatile struct simplelock *));
/* XXX So we can expose this to userland. */
#define __ldstub(__addr) \
({ \
__v; \
\
__asm __volatile("ldstub [%1],%0" \
: "=r" (__v) \
: "r" (__addr) \
: "memory"); \
\
__v; \
})
static __inline__ void
cpu_simple_lock_init (alp)
__volatile struct simplelock *alp;
static __inline void __cpu_simple_lock_init __P((__volatile int *))
__attribute__((__unused__));
static __inline void __cpu_simple_lock __P((__volatile int *))
__attribute__((__unused__));
static __inline int __cpu_simple_lock_try __P((__volatile int *))
__attribute__((__unused__));
static __inline void __cpu_simple_unlock __P((__volatile int *))
__attribute__((__unused__));
static __inline void
__cpu_simple_lock_init(__volatile int *alp)
{
alp->lock_data = SIMPLELOCK_UNLOCKED;
*alp = __SIMPLELOCK_UNLOCKED;
}
static __inline__ void
cpu_simple_lock (alp)
__volatile struct simplelock *alp;
static __inline void
__cpu_simple_lock(__volatile int *alp)
{
/*
* If someone else holds the lock use simple
* reads until it is released, then retry the
* atomic operation. This reduces memory bus contention
* becaused the cache-coherency logic does not have to
* broadcast invalidates on the lock while we spin on it.
* If someone else holds the lock use simple reads until it
* is released, then retry the atomic operation. This reduces
* memory bus contention because the cache-coherency logic
* does not have to broadcast invalidates on the lock while
* we spin on it.
*/
while (ldstub(&alp->lock_data) != SIMPLELOCK_UNLOCKED) {
while (alp->lock_data != SIMPLELOCK_UNLOCKED)
/*void*/;
while (__ldstub(alp) != __SIMPLELOCK_UNLOCKED) {
while (*alp != __SIMPLELOCK_UNLOCKED)
/* spin */ ;
}
}
static __inline__ int
cpu_simple_lock_try (alp)
__volatile struct simplelock *alp;
static __inline int
__cpu_simple_lock_try(__volatile int *alp)
{
return (ldstub(&alp->lock_data) == SIMPLELOCK_UNLOCKED);
return (__ldstub(alp) == __SIMPLELOCK_UNLOCKED);
}
static __inline__ void
cpu_simple_unlock (alp)
__volatile struct simplelock *alp;
static __inline void
__cpu_simple_unlock(__volatile int *alp)
{
alp->lock_data = SIMPLELOCK_UNLOCKED;
*alp = __SIMPLELOCK_UNLOCKED;
}
#endif /* _KERNEL */
#endif /* _MACHINE_LOCK_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: lock.h,v 1.4 1999/07/27 23:45:14 thorpej Exp $ */
/* $NetBSD: lock.h,v 1.5 2000/04/29 03:31:55 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -43,64 +43,71 @@
* Machine dependent spin lock operations.
*/
#if defined(_KERNEL)
#include <sparc64/sparc64/asm.h>
/*
* The value for SIMPLELOCK_LOCKED is what ldstub() naturally stores
* The value for __SIMPLELOCK_LOCKED is what ldstub() naturally stores
* `lock_data' given its address (and the fact that SPARC is big-endian).
*/
#undef SIMPLELOCK_LOCKED
#define SIMPLELOCK_LOCKED 0xff000000
#define __SIMPLELOCK_LOCKED 0xff000000
#define __SIMPLELOCK_UNLOCKED 0
static void cpu_simple_lock_init __P((__volatile struct simplelock *));
static void cpu_simple_lock __P((__volatile struct simplelock *));
static int cpu_simple_lock_try __P((__volatile struct simplelock *));
static void cpu_simple_unlock __P((__volatile struct simplelock *));
/* XXX So we can expose this to userland. */
#define __ldstub(__addr) \
({ \
__v; \
\
__asm __volatile("ldstub [%1],%0" \
: "=r" (__v) \
: "r" (__addr) \
: "memory"); \
\
__v; \
})
static __inline__ void
cpu_simple_lock_init (alp)
__volatile struct simplelock *alp;
static __inline void __cpu_simple_lock_init __P((__volatile int *))
__attribute__((__unused__));
static __inline void __cpu_simple_lock __P((__volatile int *))
__attribute__((__unused__));
static __inline int __cpu_simple_lock_try __P((__volatile int *))
__attribute__((__unused__));
static __inline void __cpu_simple_unlock __P((__volatile int *))
__attribute__((__unused__));
static __inline void
__cpu_simple_lock_init(__volatile int *alp)
{
alp->lock_data = SIMPLELOCK_UNLOCKED;
*alp = __SIMPLELOCK_UNLOCKED;
}
static __inline__ void
cpu_simple_lock (alp)
__volatile struct simplelock *alp;
static __inline void
__cpu_simple_lock(__volatile int *alp)
{
/*
* If someone else holds the lock use simple
* reads until it is released, then retry the
* atomic operation. This reduces memory bus contention
* becaused the cache-coherency logic does not have to
* broadcast invalidates on the lock while we spin on it.
* If someone else holds the lock use simple reads until it
* is released, then retry the atomic operation. This reduces
* memory bus contention because the cache-coherency logic
* does not have to broadcast invalidates on the lock while
* we spin on it.
*/
while (ldstub(&alp->lock_data) != SIMPLELOCK_UNLOCKED) {
while (alp->lock_data != SIMPLELOCK_UNLOCKED)
/*void*/;
while (__ldstub(alp) != __SIMPLELOCK_UNLOCKED) {
while (*alp != __SIMPLELOCK_UNLOCKED)
/* spin */ ;
}
}
static __inline__ int
cpu_simple_lock_try (alp)
__volatile struct simplelock *alp;
static __inline int
__cpu_simple_lock_try(__volatile int *alp)
{
return (ldstub(&alp->lock_data) == SIMPLELOCK_UNLOCKED);
return (__ldstub(alp) == __SIMPLELOCK_UNLOCKED);
}
static __inline__ void
cpu_simple_unlock (alp)
__volatile struct simplelock *alp;
static __inline void
__cpu_simple_unlock(__volatile int *alp)
{
alp->lock_data = SIMPLELOCK_UNLOCKED;
*alp = __SIMPLELOCK_UNLOCKED;
}
#endif /* _KERNEL */
#endif /* _MACHINE_LOCK_H */

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 2000/03/17 22:36:41 tron Exp $
# $NetBSD: Makefile,v 1.9 2000/04/29 03:31:55 thorpej Exp $
KDIR= /sys/arch/sun3/include
INCSDIR= /usr/include/sun3
@ -6,10 +6,10 @@ INCSDIR= /usr/include/sun3
INCS= ansi.h aout_machdep.h asm.h autoconf.h bswap.h cdefs.h cg2reg.h cpu.h \
db_machdep.h disklabel.h dvma.h dvma3.h dvma3x.h eeprom.h \
elf_machdep.h endian.h endian_machdep.h fbio.h float.h frame.h \
idprom.h ieee.h ieeefp.h kbd.h kbio.h kcore.h leds.h limits.h math.h \
mc68851.h mon.h param.h param3.h param3x.h pcb.h pmap.h pmap3.h \
pmap3x.h proc.h profile.h psl.h pte.h pte3.h pte3x.h ptrace.h reg.h \
setjmp.h signal.h stdarg.h svr4_machdep.h trap.h types.h varargs.h \
vmparam.h vmparam3.h vmparam3x.h vuid_event.h z8530var.h
idprom.h ieee.h ieeefp.h kbd.h kbio.h kcore.h leds.h limits.h lock.h \
math.h mc68851.h mon.h param.h param3.h param3x.h pcb.h pmap.h \
pmap3.h pmap3x.h proc.h profile.h psl.h pte.h pte3.h pte3x.h ptrace.h \
reg.h setjmp.h signal.h stdarg.h svr4_machdep.h trap.h types.h \
varargs.h vmparam.h vmparam3.h vmparam3x.h vuid_event.h z8530var.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:55 thorpej Exp $ */
/* Just use the common m68k definition */
#include <m68k/lock.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/03/19 14:56:53 ragge Exp $ */
/* $NetBSD: lock.h,v 1.2 2000/04/29 03:31:55 thorpej Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden.
@ -33,37 +33,36 @@
#ifndef _VAX_LOCK_H_
#define _VAX_LOCK_H_
static __inline__ void
cpu_simple_lock_init(__volatile struct simplelock *alp)
static __inline void
__cpu_simple_lock_init(__volatile int *alp)
{
alp->lock_data = SIMPLELOCK_UNLOCKED;
*alp = __SIMPLELOCK_UNLOCKED;
}
static __inline__ void
cpu_simple_lock(__volatile struct simplelock *alp)
static __inline void
__cpu_simple_lock(__volatile int *alp)
{
__asm__ __volatile ("1:;bbssi $0, (%0), 1b"
: /* No output */
: "r"(&alp->lock_data));
: "r"(alp));
}
static __inline__ void
cpu_simple_unlock(__volatile struct simplelock *alp)
static __inline void
__cpu_simple_unlock(__volatile int *alp)
{
alp->lock_data = SIMPLELOCK_UNLOCKED;
*alp = __SIMPLELOCK_UNLOCKED;
}
static __inline__ int
cpu_simple_lock_try(__volatile struct simplelock *alp)
static __inline int
__cpu_simple_lock_try(__volatile int *alp)
{
register int ret;
__asm__ __volatile ("movl $0,%0;bbssi $0,(%1),1f;incl %0;1:"
: "&=r"(ret)
: "r"(&alp->lock_data));
: "r"(alp));
return ret;
}
#endif /* _VAX_LOCK_H_ */

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.12 2000/03/17 22:36:42 tron Exp $
# $NetBSD: Makefile,v 1.13 2000/04/29 03:31:56 thorpej Exp $
KDIR= /sys/arch/x68k/include
INCSDIR= /usr/include/x68k
@ -6,10 +6,10 @@ INCSDIR= /usr/include/x68k
INCS= ansi.h aout_machdep.h asm.h bootinfo.h bswap.h bsd_audioio.h bus.h \
cdefs.h cpu.h cpufunc.h db_machdep.h disklabel.h elf_machdep.h \
endian.h endian_machdep.h float.h frame.h grfioctl.h ieee.h ieeefp.h \
intr.h iteioctl.h kbd.h kbio.h kcore.h math.h limits.h opmbellio.h \
param.h parioctl.h pcb.h pci_machdep.h pmap.h powioctl.h proc.h \
profile.h psl.h pte.h ptrace.h reg.h remote-sl.h setjmp.h signal.h \
sram.h stdarg.h svr4_machdep.h trap.h types.h varargs.h vmparam.h \
vuid_event.h
intr.h iteioctl.h kbd.h kbio.h kcore.h math.h lock.h limits.h \
opmbellio.h param.h parioctl.h pcb.h pci_machdep.h pmap.h powioctl.h \
proc.h profile.h psl.h pte.h ptrace.h reg.h remote-sl.h setjmp.h \
signal.h sram.h stdarg.h svr4_machdep.h trap.h types.h varargs.h \
vmparam.h vuid_event.h
.include <bsd.kinc.mk>

View File

@ -0,0 +1,4 @@
/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:56 thorpej Exp $ */
/* Just use the common m68k definition */
#include <m68k/lock.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_lock.c,v 1.26 2000/02/09 16:46:09 sommerfeld Exp $ */
/* $NetBSD: kern_lock.c,v 1.27 2000/04/29 03:31:46 thorpej Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -201,9 +201,11 @@ do { \
#if defined(MULTIPROCESSOR) /* { */
struct simplelock spinlock_list_slock = SIMPLELOCK_INITIALIZER;
#define SPINLOCK_LIST_LOCK() cpu_simple_lock(&spinlock_list_slock)
#define SPINLOCK_LIST_LOCK() \
__cpu_simple_lock(&spinlock_list_slock->lock_data)
#define SPINLOCK_LIST_UNLOCK() cpu_simple_unlock(&spinlock_list_slock)
#define SPINLOCK_LIST_UNLOCK() \
__cpu_simple_unlock(&spinlock_list_slock->lock_data)
#else
#define SPINLOCK_LIST_LOCK() /* nothing */
@ -665,10 +667,10 @@ TAILQ_HEAD(, simplelock) simplelock_list =
struct simplelock simplelock_list_slock = SIMPLELOCK_INITIALIZER;
#define SLOCK_LIST_LOCK() \
cpu_simple_lock(&simplelock_list_slock)
__cpu_simple_lock(&simplelock_list_slock->lock_data)
#define SLOCK_LIST_UNLOCK() \
cpu_simple_unlock(&simplelock_list_slock)
__cpu_simple_unlock(&simplelock_list_slock->lock_data)
#define SLOCK_COUNT(x) \
/* atomic_add_ulong(&curcpu()->ci_simple_locks, (x)) */
@ -719,9 +721,9 @@ simple_lock_init(alp)
{
#if defined(MULTIPROCESSOR) /* { */
cpu_simple_lock_init(alp);
__cpu_simple_lock_init(&alp->lock_data);
#else
alp->lock_data = SIMPLELOCK_UNLOCKED;
alp->lock_data = __SIMPLELOCK_UNLOCKED;
#endif /* } */
alp->lock_file = NULL;
alp->lock_line = 0;
@ -745,7 +747,7 @@ _simple_lock(alp, id, l)
* MULTIPROCESSOR case: This is `safe' since if it's not us, we
* don't take any action, and just fall into the normal spin case.
*/
if (alp->lock_data == SIMPLELOCK_LOCKED) {
if (alp->lock_data == __SIMPLELOCK_LOCKED) {
#if defined(MULTIPROCESSOR) /* { */
if (alp->lock_holder == cpu_id) {
SLOCK_WHERE("simple_lock: locking against myself\n",
@ -760,9 +762,9 @@ _simple_lock(alp, id, l)
#if defined(MULTIPROCESSOR) /* { */
/* Acquire the lock before modifying any fields. */
cpu_simple_lock(alp);
__cpu_simple_lock(&alp->lock_data);
#else
alp->lock_data = SIMPLELOCK_LOCKED;
alp->lock_data = __SIMPLELOCK_LOCKED;
#endif /* } */
alp->lock_file = id;
@ -796,18 +798,18 @@ _simple_lock_try(alp, id, l)
* don't take any action.
*/
#if defined(MULTIPROCESSOR) /* { */
if ((rv = cpu_simple_lock_try(alp)) == 0) {
if ((rv = __cpu_simple_lock_try(&alp->lock_data)) == 0) {
if (alp->lock_holder == cpu_id)
SLOCK_WHERE("simple_lock_try: locking against myself\n",
alp, id, l);
goto out;
}
#else
if (alp->lock_data == SIMPLELOCK_LOCKED) {
if (alp->lock_data == __SIMPLELOCK_LOCKED) {
SLOCK_WHERE("simple_lock_try: lock held\n", alp, id, l);
goto out;
}
alp->lock_data = SIMPLELOCK_LOCKED;
alp->lock_data = __SIMPLELOCK_LOCKED;
#endif /* MULTIPROCESSOR */ /* } */
/*
@ -846,7 +848,7 @@ _simple_unlock(alp, id, l)
* MULTIPROCESSOR case: This is `safe' because we think we hold
* the lock, and if we don't, we don't take any action.
*/
if (alp->lock_data == SIMPLELOCK_UNLOCKED) {
if (alp->lock_data == __SIMPLELOCK_UNLOCKED) {
SLOCK_WHERE("simple_unlock: lock not held\n",
alp, id, l);
goto out;
@ -867,9 +869,9 @@ _simple_unlock(alp, id, l)
#if defined(MULTIPROCESSOR) /* { */
alp->lock_holder = LK_NOCPU;
/* Now that we've modified all fields, release the lock. */
cpu_simple_unlock(alp);
__cpu_simple_unlock(&alp->lock_data);
#else
alp->lock_data = SIMPLELOCK_UNLOCKED;
alp->lock_data = __SIMPLELOCK_UNLOCKED;
#endif /* } */
out:

View File

@ -1,4 +1,4 @@
/* $NetBSD: lock.h,v 1.25 1999/10/23 23:00:06 ross Exp $ */
/* $NetBSD: lock.h,v 1.26 2000/04/29 03:31:45 thorpej Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -88,6 +88,7 @@
#endif
#include <sys/queue.h>
#include <machine/lock.h>
/*
* The simple lock. Provides a simple spinning mutex. Note the
@ -106,21 +107,11 @@ struct simplelock {
#endif
};
/*
* Machine-dependent code may #undef and override these.
*/
#define SIMPLELOCK_LOCKED 1
#define SIMPLELOCK_UNLOCKED 0
#if defined(MULTIPROCESSOR)
#include <machine/lock.h>
#endif
#ifdef LOCKDEBUG
#define SIMPLELOCK_INITIALIZER { SIMPLELOCK_UNLOCKED, NULL, 0, NULL, 0, \
#define SIMPLELOCK_INITIALIZER { __SIMPLELOCK_UNLOCKED, NULL, 0, NULL, 0, \
{ NULL, NULL }, 0 }
#else
#define SIMPLELOCK_INITIALIZER { SIMPLELOCK_UNLOCKED }
#define SIMPLELOCK_INITIALIZER { __SIMPLELOCK_UNLOCKED }
#endif
/* XXXCDC: kill typedefs later? */
@ -307,12 +298,12 @@ void simple_lock_init __P((struct simplelock *));
void simple_lock_dump __P((void));
void simple_lock_freecheck __P((void *, void *));
#elif defined(MULTIPROCESSOR)
#define simple_lock_init(alp) cpu_simple_lock_init((alp))
#define simple_lock(alp) cpu_simple_lock((alp))
#define simple_lock_try(alp) cpu_simple_lock_try((alp))
#define simple_unlock(alp) cpu_simple_unlock((alp))
#define simple_lock_init(alp) __cpu_simple_lock_init(&(alp)->lock_data)
#define simple_lock(alp) __cpu_simple_lock(&(alp)->lock_data)
#define simple_lock_try(alp) __cpu_simple_lock_try(&(alp)->lock_data)
#define simple_unlock(alp) __cpu_simple_unlock(&(alp)->lock_data)
#else
#define simple_lock_init(alp) (alp)->lock_data = SIMPLELOCK_UNLOCKED
#define simple_lock_init(alp) (alp)->lock_data = __SIMPLELOCK_UNLOCKED
#define simple_lock(alp) /* nothing */
#define simple_lock_try(alp) (1) /* always succeeds */
#define simple_unlock(alp) /* nothing */