diff --git a/sys/arch/alpha/include/lock.h b/sys/arch/alpha/include/lock.h index 3f32deeaa351..536d15ed9eac 100644 --- a/sys/arch/alpha/include/lock.h +++ b/sys/arch/alpha/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.5 2000/04/29 03:31:46 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.6 2000/05/02 04:41:06 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -44,20 +44,22 @@ #ifndef _ALPHA_LOCK_H_ #define _ALPHA_LOCK_H_ +typedef __volatile int __cpu_simple_lock_t; + #define __SIMPLELOCK_LOCKED 1 #define __SIMPLELOCK_UNLOCKED 0 -static __inline void __cpu_simple_lock_init __P((__volatile int *)) +static __inline void __cpu_simple_lock_init __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline void __cpu_simple_lock __P((__volatile int *)) +static __inline void __cpu_simple_lock __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline int __cpu_simple_lock_try __P((__volatile int *)) +static __inline int __cpu_simple_lock_try __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline void __cpu_simple_unlock __P((__volatile int *)) +static __inline void __cpu_simple_unlock __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); static __inline void -__cpu_simple_lock_init(__volatile int *alp) +__cpu_simple_lock_init(__cpu_simple_lock_t *alp) { __asm __volatile( @@ -69,7 +71,7 @@ __cpu_simple_lock_init(__volatile int *alp) } static __inline void -__cpu_simple_lock(__volatile int *alp) +__cpu_simple_lock(__cpu_simple_lock_t *alp) { unsigned long t0; @@ -100,7 +102,7 @@ __cpu_simple_lock(__volatile int *alp) } static __inline int -__cpu_simple_lock_try(__volatile int *alp) +__cpu_simple_lock_try(__cpu_simple_lock_t *alp) { unsigned long t0, v0; @@ -126,7 +128,7 @@ __cpu_simple_lock_try(__volatile int *alp) } static __inline void -__cpu_simple_unlock(__volatile int *alp) +__cpu_simple_unlock(__cpu_simple_lock_t *alp) { __asm __volatile( diff --git a/sys/arch/arm32/include/lock.h b/sys/arch/arm32/include/lock.h index f22c78f44a2f..cb3f9d76163f 100644 --- a/sys/arch/arm32/include/lock.h +++ b/sys/arch/arm32/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:47 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.2 2000/05/02 04:41:06 thorpej Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -43,6 +43,8 @@ #ifndef _ARM32_LOCK_H_ #define _ARM32_LOCK_H_ +typedef int __cpu_simple_lock_t; + #define __SIMPLELOCK_LOCKED 1 #define __SIMPLELOCK_UNLOCKED 0 diff --git a/sys/arch/i386/include/lock.h b/sys/arch/i386/include/lock.h index 08c975c84411..eb0a64eac844 100644 --- a/sys/arch/i386/include/lock.h +++ b/sys/arch/i386/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.3 2000/04/29 19:39:51 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.4 2000/05/02 04:41:06 thorpej Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -43,27 +43,29 @@ #ifndef _I386_LOCK_H_ #define _I386_LOCK_H_ +typedef __volatile int __cpu_simple_lock_t; + #define __SIMPLELOCK_LOCKED 1 #define __SIMPLELOCK_UNLOCKED 0 -static __inline void __cpu_simple_lock_init __P((__volatile int *)) +static __inline void __cpu_simple_lock_init __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline void __cpu_simple_lock __P((__volatile int *)) +static __inline void __cpu_simple_lock __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline int __cpu_simple_lock_try __P((__volatile int *)) +static __inline int __cpu_simple_lock_try __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline void __cpu_simple_unlock __P((__volatile int *)) +static __inline void __cpu_simple_unlock __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); static __inline void -__cpu_simple_lock_init(__volatile int *alp) +__cpu_simple_lock_init(__cpu_simple_lock_t *alp) { *alp = __SIMPLELOCK_UNLOCKED; } static __inline void -__cpu_simple_lock(__volatile int *alp) +__cpu_simple_lock(__cpu_simple_lock_t *alp) { int __val = __SIMPLELOCK_LOCKED; @@ -75,7 +77,7 @@ __cpu_simple_lock(__volatile int *alp) } static __inline int -__cpu_simple_lock_try(__volatile int *alp) +__cpu_simple_lock_try(__cpu_simple_lock_t *alp) { int __val = __SIMPLELOCK_LOCKED; @@ -87,7 +89,7 @@ __cpu_simple_lock_try(__volatile int *alp) } void -__cpu_simple_unlock(__volatile int *alp) +__cpu_simple_unlock(__cpu_simple_lock_t *alp) { *alp = __SIMPLELOCK_UNLOCKED; diff --git a/sys/arch/m68k/include/lock.h b/sys/arch/m68k/include/lock.h index c5dd05d27258..5871b229b663 100644 --- a/sys/arch/m68k/include/lock.h +++ b/sys/arch/m68k/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:50 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.2 2000/05/02 04:41:07 thorpej Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -43,6 +43,8 @@ #ifndef _M68K_LOCK_H_ #define _M68K_LOCK_H_ +typedef __volatile int __cpu_simple_lock_t; + #define __SIMPLELOCK_LOCKED 1 #define __SIMPLELOCK_UNLOCKED 0 diff --git a/sys/arch/mips/include/lock.h b/sys/arch/mips/include/lock.h index a5987c9f887e..17208f376bf8 100644 --- a/sys/arch/mips/include/lock.h +++ b/sys/arch/mips/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:51 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.2 2000/05/02 04:41:07 thorpej Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -43,6 +43,8 @@ #ifndef _MIPS_LOCK_H_ #define _MIPS_LOCK_H_ +typedef __volatile int __cpu_simple_lock_t; + #define __SIMPLELOCK_LOCKED 1 #define __SIMPLELOCK_UNLOCKED 0 diff --git a/sys/arch/pc532/include/lock.h b/sys/arch/pc532/include/lock.h index bf2834945b9a..7fbcdbf89822 100644 --- a/sys/arch/pc532/include/lock.h +++ b/sys/arch/pc532/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:53 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.2 2000/05/02 04:41:08 thorpej Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -43,6 +43,8 @@ #ifndef _PC532_LOCK_H_ #define _PC532_LOCK_H_ +typedef __volatile int __cpu_simple_lock_t; + #define __SIMPLELOCK_LOCKED 1 #define __SIMPLELOCK_UNLOCKED 0 diff --git a/sys/arch/powerpc/include/lock.h b/sys/arch/powerpc/include/lock.h index bc400d7f38da..66edef2cb556 100644 --- a/sys/arch/powerpc/include/lock.h +++ b/sys/arch/powerpc/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:54 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.2 2000/05/02 04:41:10 thorpej Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -43,6 +43,8 @@ #ifndef _POWERPC_LOCK_H_ #define _POWERPC_LOCK_H_ +typedef __volatile int __cpu_simple_lock_t; + #define __SIMPLELOCK_LOCKED 1 #define __SIMPLELOCK_UNLOCKED 0 diff --git a/sys/arch/sh3/include/lock.h b/sys/arch/sh3/include/lock.h index bd80b4cfe1b1..388f8554ee0c 100644 --- a/sys/arch/sh3/include/lock.h +++ b/sys/arch/sh3/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.1 2000/04/29 03:31:54 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.2 2000/05/02 04:41:10 thorpej Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -43,6 +43,8 @@ #ifndef _SH3_LOCK_H_ #define _SH3_LOCK_H_ +typedef __volatile int __cpu_simple_lock_t; + #define __SIMPLELOCK_LOCKED 1 #define __SIMPLELOCK_UNLOCKED 0 diff --git a/sys/arch/sparc/include/lock.h b/sys/arch/sparc/include/lock.h index 1c85526d60d9..c7e451652ceb 100644 --- a/sys/arch/sparc/include/lock.h +++ b/sys/arch/sparc/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.8 2000/04/30 22:15:30 pk Exp $ */ +/* $NetBSD: lock.h,v 1.9 2000/05/02 04:41:11 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -47,6 +47,9 @@ * The value for __SIMPLELOCK_LOCKED is what ldstub() naturally stores * `lock_data' given its address (and the fact that SPARC is big-endian). */ + +typedef __volatile int __cpu_simple_lock_t; + #define __SIMPLELOCK_LOCKED 0xff000000 #define __SIMPLELOCK_UNLOCKED 0 @@ -63,24 +66,24 @@ __v; \ }) -static __inline void __cpu_simple_lock_init __P((__volatile int *)) +static __inline void __cpu_simple_lock_init __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline void __cpu_simple_lock __P((__volatile int *)) +static __inline void __cpu_simple_lock __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline int __cpu_simple_lock_try __P((__volatile int *)) +static __inline int __cpu_simple_lock_try __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline void __cpu_simple_unlock __P((__volatile int *)) +static __inline void __cpu_simple_unlock __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); static __inline void -__cpu_simple_lock_init(__volatile int *alp) +__cpu_simple_lock_init(__cpu_simple_lock_t *alp) { *alp = __SIMPLELOCK_UNLOCKED; } static __inline void -__cpu_simple_lock(__volatile int *alp) +__cpu_simple_lock(__cpu_simple_lock_t *alp) { /* @@ -97,14 +100,14 @@ __cpu_simple_lock(__volatile int *alp) } static __inline int -__cpu_simple_lock_try(__volatile int *alp) +__cpu_simple_lock_try(__cpu_simple_lock_t *alp) { return (__ldstub(alp) == __SIMPLELOCK_UNLOCKED); } static __inline void -__cpu_simple_unlock(__volatile int *alp) +__cpu_simple_unlock(__cpu_simple_lock_t *alp) { *alp = __SIMPLELOCK_UNLOCKED; diff --git a/sys/arch/sparc64/include/lock.h b/sys/arch/sparc64/include/lock.h index df380f703602..488b00ec1227 100644 --- a/sys/arch/sparc64/include/lock.h +++ b/sys/arch/sparc64/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.6 2000/05/01 00:46:29 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.7 2000/05/02 04:41:11 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -47,6 +47,9 @@ * The value for __SIMPLELOCK_LOCKED is what ldstub() naturally stores * `lock_data' given its address (and the fact that SPARC is big-endian). */ + +typedef __volatile int __cpu_simple_lock_t; + #define __SIMPLELOCK_LOCKED 0xff000000 #define __SIMPLELOCK_UNLOCKED 0 @@ -63,24 +66,24 @@ __v; \ }) -static __inline void __cpu_simple_lock_init __P((__volatile int *)) +static __inline void __cpu_simple_lock_init __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline void __cpu_simple_lock __P((__volatile int *)) +static __inline void __cpu_simple_lock __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline int __cpu_simple_lock_try __P((__volatile int *)) +static __inline int __cpu_simple_lock_try __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); -static __inline void __cpu_simple_unlock __P((__volatile int *)) +static __inline void __cpu_simple_unlock __P((__cpu_simple_lock_t *)) __attribute__((__unused__)); static __inline void -__cpu_simple_lock_init(__volatile int *alp) +__cpu_simple_lock_init(__cpu_simple_lock_t *alp) { *alp = __SIMPLELOCK_UNLOCKED; } static __inline void -__cpu_simple_lock(__volatile int *alp) +__cpu_simple_lock(__cpu_simple_lock_t *alp) { /* @@ -97,14 +100,14 @@ __cpu_simple_lock(__volatile int *alp) } static __inline int -__cpu_simple_lock_try(__volatile int *alp) +__cpu_simple_lock_try(__cpu_simple_lock_t *alp) { return (__ldstub(alp) == __SIMPLELOCK_UNLOCKED); } static __inline void -__cpu_simple_unlock(__volatile int *alp) +__cpu_simple_unlock(__cpu_simple_lock_t *alp) { *alp = __SIMPLELOCK_UNLOCKED; diff --git a/sys/arch/vax/include/lock.h b/sys/arch/vax/include/lock.h index fc31206095a4..9be9eabf0fa5 100644 --- a/sys/arch/vax/include/lock.h +++ b/sys/arch/vax/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.3 2000/05/01 12:09:32 ragge Exp $ */ +/* $NetBSD: lock.h,v 1.4 2000/05/02 04:41:11 thorpej Exp $ */ /* * Copyright (c) 2000 Ludd, University of Lule}, Sweden. @@ -33,18 +33,19 @@ #ifndef _VAX_LOCK_H_ #define _VAX_LOCK_H_ +typedef __volatile int __cpu_simple_lock_t; + #define __SIMPLELOCK_LOCKED 1 #define __SIMPLELOCK_UNLOCKED 0 - static __inline void -__cpu_simple_lock_init(__volatile int *alp) +__cpu_simple_lock_init(__cpu_simple_lock_t *alp) { *alp = __SIMPLELOCK_UNLOCKED; } static __inline void -__cpu_simple_lock(__volatile int *alp) +__cpu_simple_lock(__cpu_simple_lock_t *alp) { __asm__ __volatile ("1:;bbssi $0, (%0), 1b" : /* No output */ @@ -52,13 +53,13 @@ __cpu_simple_lock(__volatile int *alp) } static __inline void -__cpu_simple_unlock(__volatile int *alp) +__cpu_simple_unlock(__cpu_simple_lock_t *alp) { *alp = __SIMPLELOCK_UNLOCKED; } static __inline int -__cpu_simple_lock_try(__volatile int *alp) +__cpu_simple_lock_try(__cpu_simple_lock_t *alp) { register int ret; diff --git a/sys/sys/lock.h b/sys/sys/lock.h index 9c7aeb3f5071..9a4cb1c6fa8a 100644 --- a/sys/sys/lock.h +++ b/sys/sys/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.26 2000/04/29 03:31:45 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.27 2000/05/02 04:41:04 thorpej Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -96,7 +96,7 @@ * order for it to work on the widest range of processor types. */ struct simplelock { - int lock_data; + __cpu_simple_lock_t lock_data; #ifdef LOCKDEBUG const char *lock_file; const char *unlock_file;