diff options
Diffstat (limited to 'sys/arch')
28 files changed, 159 insertions, 100 deletions
diff --git a/sys/arch/alpha/include/atomic.h b/sys/arch/alpha/include/atomic.h index 0e9bec993fb..ef634f7c1a5 100644 --- a/sys/arch/alpha/include/atomic.h +++ b/sys/arch/alpha/include/atomic.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomic.h,v 1.4 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.5 2007/02/19 17:18:40 deraadt Exp $ */ /* $NetBSD: atomic.h,v 1.7 2001/12/17 23:34:57 thorpej Exp $ */ /*- @@ -45,6 +45,8 @@ #ifndef _ALPHA_ATOMIC_H_ #define _ALPHA_ATOMIC_H_ +#if defined(_KERNEL) + /* * atomic_setbits_ulong: * @@ -189,4 +191,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } +#endif /* defined(_KERNEL) */ #endif /* _ALPHA_ATOMIC_H_ */ diff --git a/sys/arch/amd64/include/atomic.h b/sys/arch/amd64/include/atomic.h index 693e242c5b6..db184d78122 100644 --- a/sys/arch/amd64/include/atomic.h +++ b/sys/arch/amd64/include/atomic.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomic.h,v 1.4 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.5 2007/02/19 17:18:42 deraadt Exp $ */ /* $NetBSD: atomic.h,v 1.1 2003/04/26 18:39:37 fvdl Exp $ */ /* @@ -36,8 +36,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _ATOMIC_H -#define _ATOMIC_H +#ifndef _AMD64_ATOMIC_H +#define _AMD64_ATOMIC_H /* * Perform atomic operations on memory. Should be atomic with respect @@ -47,7 +47,7 @@ * void atomic_clearbits_int(volatile u_int *a, u_int mas) { *a &= ~mask; } */ -#ifndef _LOCORE +#if defined(_KERNEL) && !defined(_LOCORE) #ifdef MULTIPROCESSOR #define LOCK "lock" @@ -56,35 +56,38 @@ #endif static __inline u_int64_t -x86_atomic_testset_u64(volatile u_int64_t *ptr, u_int64_t val) { - __asm__ volatile ("xchgq %0,(%2)" :"=r" (val):"0" (val),"r" (ptr)); - return val; +x86_atomic_testset_u64(volatile u_int64_t *ptr, u_int64_t val) +{ + __asm__ volatile ("xchgq %0,(%2)" :"=r" (val):"0" (val),"r" (ptr)); + return val; } static __inline u_int32_t -x86_atomic_testset_u32(volatile u_int32_t *ptr, u_int32_t val) { - __asm__ volatile ("xchgl %0,(%2)" :"=r" (val):"0" (val),"r" (ptr)); - return val; +x86_atomic_testset_u32(volatile u_int32_t *ptr, u_int32_t val) +{ + __asm__ volatile ("xchgl %0,(%2)" :"=r" (val):"0" (val),"r" (ptr)); + return val; } - - static __inline int32_t -x86_atomic_testset_i32(volatile int32_t *ptr, int32_t val) { - __asm__ volatile ("xchgl %0,(%2)" :"=r" (val):"0" (val),"r" (ptr)); - return val; +x86_atomic_testset_i32(volatile int32_t *ptr, int32_t val) +{ + __asm__ volatile ("xchgl %0,(%2)" :"=r" (val):"0" (val),"r" (ptr)); + return val; } static __inline void -x86_atomic_setbits_u32(volatile u_int32_t *ptr, u_int32_t bits) { - __asm __volatile(LOCK " orl %1,%0" : "=m" (*ptr) : "ir" (bits)); +x86_atomic_setbits_u32(volatile u_int32_t *ptr, u_int32_t bits) +{ + __asm __volatile(LOCK " orl %1,%0" : "=m" (*ptr) : "ir" (bits)); } static __inline void -x86_atomic_clearbits_u32(volatile u_int32_t *ptr, u_int32_t bits) { - __asm __volatile(LOCK " andl %1,%0" : "=m" (*ptr) : "ir" (~bits)); +x86_atomic_clearbits_u32(volatile u_int32_t *ptr, u_int32_t bits) +{ + __asm __volatile(LOCK " andl %1,%0" : "=m" (*ptr) : "ir" (~bits)); } @@ -96,13 +99,15 @@ x86_atomic_clearbits_u32(volatile u_int32_t *ptr, u_int32_t bits) { * is an asm error pending */ static __inline void -x86_atomic_setbits_u64(volatile u_int64_t *ptr, u_int64_t bits) { - __asm __volatile(LOCK " orq %1,%0" : "=m" (*ptr) : "ir" (bits)); +x86_atomic_setbits_u64(volatile u_int64_t *ptr, u_int64_t bits) +{ + __asm __volatile(LOCK " orq %1,%0" : "=m" (*ptr) : "ir" (bits)); } static __inline void -x86_atomic_clearbits_u64(volatile u_int64_t *ptr, u_int64_t bits) { - __asm __volatile(LOCK " andq %1,%0" : "=m" (*ptr) : "ir" (~bits)); +x86_atomic_clearbits_u64(volatile u_int64_t *ptr, u_int64_t bits) +{ + __asm __volatile(LOCK " andq %1,%0" : "=m" (*ptr) : "ir" (~bits)); } #define x86_atomic_testset_ul x86_atomic_testset_u32 @@ -117,5 +122,5 @@ x86_atomic_clearbits_u64(volatile u_int64_t *ptr, u_int64_t bits) { #undef LOCK -#endif -#endif +#endif /* defined(_KERNEL) && !defined(_LOCORE) */ +#endif /* _AMD64_ATOMIC_H_ */ diff --git a/sys/arch/arm/include/atomic.h b/sys/arch/arm/include/atomic.h index 8bf37567652..a3ac330fc85 100644 --- a/sys/arch/arm/include/atomic.h +++ b/sys/arch/arm/include/atomic.h @@ -1,10 +1,12 @@ -/* $OpenBSD: atomic.h,v 1.3 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.4 2007/02/19 17:18:42 deraadt Exp $ */ /* Public Domain */ #ifndef __ARM_ATOMIC_H__ #define __ARM_ATOMIC_H__ +#if defined(_KERNEL) + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -17,4 +19,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } -#endif +#endif /* defined(_KERNEL) */ +#endif /* __ARM_ATOMIC_H__ */ diff --git a/sys/arch/armish/include/atomic.h b/sys/arch/armish/include/atomic.h index 68d17a94d4e..d8fc16eb2d7 100644 --- a/sys/arch/armish/include/atomic.h +++ b/sys/arch/armish/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.3 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.4 2007/02/19 17:18:42 deraadt Exp $ */ /* Public Domain */ + #ifndef __ARMISH_ATOMIC_H__ #define __ARMISH_ATOMIC_H__ #include <arm/atomic.h> -#endif +#endif /* __ARMISH_ATOMIC_H__ */ diff --git a/sys/arch/aviion/include/atomic.h b/sys/arch/aviion/include/atomic.h index b6ba4a3f2e7..62b7808fefb 100644 --- a/sys/arch/aviion/include/atomic.h +++ b/sys/arch/aviion/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:42 deraadt Exp $ */ /* Public Domain */ + #ifndef __AVIION_ATOMIC_H__ #define __AVIION_ATOMIC_H__ #include <m88k/atomic.h> -#endif +#endif /* __AVIION_ATOMIC_H__ */ diff --git a/sys/arch/cats/include/atomic.h b/sys/arch/cats/include/atomic.h index 49c16c33358..d8f88699072 100644 --- a/sys/arch/cats/include/atomic.h +++ b/sys/arch/cats/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.3 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.4 2007/02/19 17:18:42 deraadt Exp $ */ /* Public Domain */ + #ifndef __CATS_ATOMIC_H__ #define __CATS_ATOMIC_H__ #include <arm/atomic.h> -#endif +#endif /* __CATS_ATOMIC_H__ */ diff --git a/sys/arch/hp300/include/atomic.h b/sys/arch/hp300/include/atomic.h index 8e4d78700d0..5750d14bcd7 100644 --- a/sys/arch/hp300/include/atomic.h +++ b/sys/arch/hp300/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:42 deraadt Exp $ */ /* Public Domain */ + #ifndef __HP300_ATOMIC_H__ #define __HP300_ATOMIC_H__ #include <m68k/atomic.h> -#endif +#endif /* __HP300_ATOMIC_H__ */ diff --git a/sys/arch/hppa/include/atomic.h b/sys/arch/hppa/include/atomic.h index d04b7ec382c..ee7b4a4ab27 100644 --- a/sys/arch/hppa/include/atomic.h +++ b/sys/arch/hppa/include/atomic.h @@ -1,10 +1,12 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:42 deraadt Exp $ */ /* Public Domain */ #ifndef __HPPA_ATOMIC_H__ #define __HPPA_ATOMIC_H__ +#if defined(_KERNEL) + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -17,4 +19,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } -#endif +#endif /* defined(_KERNEL) */ +#endif /* __HPPA_ATOMIC_H__ */ diff --git a/sys/arch/hppa64/include/atomic.h b/sys/arch/hppa64/include/atomic.h index d0846609fa2..3b451b8696d 100644 --- a/sys/arch/hppa64/include/atomic.h +++ b/sys/arch/hppa64/include/atomic.h @@ -1,10 +1,12 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:42 deraadt Exp $ */ /* Public Domain */ #ifndef __HPPA64_ATOMIC_H__ #define __HPPA64_ATOMIC_H__ +#if defined(_KERNEL) + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -17,4 +19,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } -#endif +#endif /* defined(_KERNEL) */ +#endif /* __HPPA64_ATOMIC_H__ */ diff --git a/sys/arch/i386/include/atomic.h b/sys/arch/i386/include/atomic.h index baf3d7bde01..44a7be7f52f 100644 --- a/sys/arch/i386/include/atomic.h +++ b/sys/arch/i386/include/atomic.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomic.h,v 1.4 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.5 2007/02/19 17:18:42 deraadt Exp $ */ /* $NetBSD: atomic.h,v 1.1.2.2 2000/02/21 18:54:07 sommerfeld Exp $ */ /*- @@ -39,8 +39,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _ATOMIC_H_ -#define _ATOMIC_H_ +#ifndef _I386_ATOMIC_H_ +#define _I386_ATOMIC_H_ /* * Perform atomic operations on memory. Should be atomic with respect @@ -49,7 +49,7 @@ * void atomic_setbits_int(volatile u_int *a, u_int mask) { *a |= mask; } * void atomic_clearbits_int(volatile u_int *a, u_int mas) { *a &= ~mask; } */ -#ifndef _LOCORE +#if defined(_KERNEL) && !defined(_LOCORE) #ifdef MULTIPROCESSOR #define LOCK "lock" @@ -58,33 +58,38 @@ #endif static __inline u_int64_t -i386_atomic_testset_uq (volatile u_int64_t *ptr, u_int64_t val) { - __asm__ volatile ("\n1:\t" LOCK " cmpxchg8b (%1); jnz 1b" : "+A" (val) : - "r" (ptr), "b" ((u_int32_t)val), "c" ((u_int32_t)(val >> 32))); - return val; +i386_atomic_testset_uq(volatile u_int64_t *ptr, u_int64_t val) +{ + __asm__ volatile ("\n1:\t" LOCK " cmpxchg8b (%1); jnz 1b" : "+A" (val) : + "r" (ptr), "b" ((u_int32_t)val), "c" ((u_int32_t)(val >> 32))); + return val; } static __inline u_int32_t -i386_atomic_testset_ul (volatile u_int32_t *ptr, unsigned long val) { - __asm__ volatile ("xchgl %0,(%2)" :"=r" (val):"0" (val),"r" (ptr)); - return val; +i386_atomic_testset_ul(volatile u_int32_t *ptr, unsigned long val) +{ + __asm__ volatile ("xchgl %0,(%2)" :"=r" (val):"0" (val),"r" (ptr)); + return val; } static __inline int -i386_atomic_testset_i (volatile int *ptr, unsigned long val) { - __asm__ volatile ("xchgl %0,(%2)" :"=r" (val):"0" (val),"r" (ptr)); - return val; +i386_atomic_testset_i(volatile int *ptr, unsigned long val) +{ + __asm__ volatile ("xchgl %0,(%2)" :"=r" (val):"0" (val),"r" (ptr)); + return val; } -static __inline void -i386_atomic_setbits_l (volatile u_int32_t *ptr, unsigned long bits) { - __asm __volatile(LOCK " orl %1,%0" : "=m" (*ptr) : "ir" (bits)); +static __inline void +i386_atomic_setbits_l(volatile u_int32_t *ptr, unsigned long bits) +{ + __asm __volatile(LOCK " orl %1,%0" : "=m" (*ptr) : "ir" (bits)); } -static __inline void -i386_atomic_clearbits_l (volatile u_int32_t *ptr, unsigned long bits) { - bits = ~bits; - __asm __volatile(LOCK " andl %1,%0" : "=m" (*ptr) : "ir" (bits)); +static __inline void +i386_atomic_clearbits_l(volatile u_int32_t *ptr, unsigned long bits) +{ + bits = ~bits; + __asm __volatile(LOCK " andl %1,%0" : "=m" (*ptr) : "ir" (bits)); } #define atomic_setbits_int i386_atomic_setbits_l @@ -92,6 +97,5 @@ i386_atomic_clearbits_l (volatile u_int32_t *ptr, unsigned long bits) { #undef LOCK -#endif -#endif - +#endif /* defined(_KERNEL) && !defined(_LOCORE) */ +#endif /* _I386_ATOMIC_H_ */ diff --git a/sys/arch/landisk/include/atomic.h b/sys/arch/landisk/include/atomic.h index 86e78a36ba8..e3f0a814ad3 100644 --- a/sys/arch/landisk/include/atomic.h +++ b/sys/arch/landisk/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:42 deraadt Exp $ */ /* Public Domain */ + #ifndef __LANDISK_ATOMIC_H__ #define __LANDISK_ATOMIC_H__ #include <sh/atomic.h> -#endif +#endif /* __LANDISK_ATOMIC_H__ */ diff --git a/sys/arch/luna88k/include/atomic.h b/sys/arch/luna88k/include/atomic.h index b1881839d03..0a85c5cc875 100644 --- a/sys/arch/luna88k/include/atomic.h +++ b/sys/arch/luna88k/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ + #ifndef __LUNA88K_ATOMIC_H__ #define __LUNA88K_ATOMIC_H__ #include <m88k/atomic.h> -#endif +#endif /* __LUNA88K_ATOMIC_H__ */ diff --git a/sys/arch/m68k/include/atomic.h b/sys/arch/m68k/include/atomic.h index 7973d236677..712302d48d8 100644 --- a/sys/arch/m68k/include/atomic.h +++ b/sys/arch/m68k/include/atomic.h @@ -1,10 +1,12 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ #ifndef __M68K_ATOMIC_H__ #define __M68K_ATOMIC_H__ +#if defined(_KERNEL) + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -17,4 +19,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } -#endif +#endif /* defined(_KERNEL) */ +#endif /* __M68K_ATOMIC_H__ */ diff --git a/sys/arch/m88k/include/atomic.h b/sys/arch/m88k/include/atomic.h index 70b93c94960..16ebc203af6 100644 --- a/sys/arch/m88k/include/atomic.h +++ b/sys/arch/m88k/include/atomic.h @@ -1,10 +1,12 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ #ifndef __M88K_ATOMIC_H__ #define __M88K_ATOMIC_H__ +#if defined(_KERNEL) + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -17,4 +19,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } -#endif +#endif /* defined(_KERNEL) */ +#endif /* __M88K_ATOMIC_H__ */ diff --git a/sys/arch/mac68k/include/atomic.h b/sys/arch/mac68k/include/atomic.h index 8de2987e482..0f5a329af1e 100644 --- a/sys/arch/mac68k/include/atomic.h +++ b/sys/arch/mac68k/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ + #ifndef __MAC68K_ATOMIC_H__ #define __MAC68K_ATOMIC_H__ #include <m68k/atomic.h> -#endif +#endif /* __MAC68K_ATOMIC_H__ */ diff --git a/sys/arch/macppc/include/atomic.h b/sys/arch/macppc/include/atomic.h index dc77a07f76f..9c2125f6652 100644 --- a/sys/arch/macppc/include/atomic.h +++ b/sys/arch/macppc/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ + #ifndef __MACPPC_ATOMIC_H__ #define __MACPPC_ATOMIC_H__ #include <powerpc/atomic.h> -#endif +#endif /* __MACPPC_ATOMIC_H__ */ diff --git a/sys/arch/mips64/include/atomic.h b/sys/arch/mips64/include/atomic.h index 6874e5d5e20..9b8aead11a0 100644 --- a/sys/arch/mips64/include/atomic.h +++ b/sys/arch/mips64/include/atomic.h @@ -1,10 +1,12 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ #ifndef __MIPS64_ATOMIC_H__ #define __MIPS64_ATOMIC_H__ +#if defined(_KERNEL) + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -17,4 +19,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } -#endif +#endif /* defined(_KERNEL) */ +#endif /* __MIPS64_ATOMIC_H__ */ diff --git a/sys/arch/mvme68k/include/atomic.h b/sys/arch/mvme68k/include/atomic.h index 8fb790d5142..d8f11efa428 100644 --- a/sys/arch/mvme68k/include/atomic.h +++ b/sys/arch/mvme68k/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ + #ifndef __MVME68K_ATOMIC_H__ #define __MVME68K_ATOMIC_H__ #include <m68k/atomic.h> -#endif +#endif /* __MVME68K_ATOMIC_H__ */ diff --git a/sys/arch/mvme88k/include/atomic.h b/sys/arch/mvme88k/include/atomic.h index 4ea3bbbe3a6..51af8ca4d5f 100644 --- a/sys/arch/mvme88k/include/atomic.h +++ b/sys/arch/mvme88k/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ + #ifndef __MVME88K_ATOMIC_H__ #define __MVME88K_ATOMIC_H__ #include <m88k/atomic.h> -#endif +#endif /* __MVME88K_ATOMIC_H__ */ diff --git a/sys/arch/mvmeppc/include/atomic.h b/sys/arch/mvmeppc/include/atomic.h index 26253aec0d3..ca0cd2f12b5 100644 --- a/sys/arch/mvmeppc/include/atomic.h +++ b/sys/arch/mvmeppc/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ + #ifndef __MVMEPPC_ATOMIC_H__ #define __MVMEPPC_ATOMIC_H__ #include <powerpc/atomic.h> -#endif +#endif /* __MVMEPPC_ATOMIC_H__ */ diff --git a/sys/arch/powerpc/include/atomic.h b/sys/arch/powerpc/include/atomic.h index b502bc61d1e..1a73b68e157 100644 --- a/sys/arch/powerpc/include/atomic.h +++ b/sys/arch/powerpc/include/atomic.h @@ -1,10 +1,12 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ #ifndef __POWERPC_ATOMIC_H__ #define __POWERPC_ATOMIC_H__ +#if defined(_KERNEL) + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -17,4 +19,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } -#endif +#endif /* defined(_KERNEL) */ +#endif /* __POWERPC_ATOMIC_H__ */ diff --git a/sys/arch/sgi/include/atomic.h b/sys/arch/sgi/include/atomic.h index b2c6df33bba..a8829697fd6 100644 --- a/sys/arch/sgi/include/atomic.h +++ b/sys/arch/sgi/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ + #ifndef __SGI_ATOMIC_H__ #define __SGI_ATOMIC_H__ #include <mips64/atomic.h> -#endif +#endif /* __SGI_ATOMIC_H__ */ diff --git a/sys/arch/sh/include/atomic.h b/sys/arch/sh/include/atomic.h index 7b9b8aed390..736b0e5b87a 100644 --- a/sys/arch/sh/include/atomic.h +++ b/sys/arch/sh/include/atomic.h @@ -1,10 +1,12 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ #ifndef __SH_ATOMIC_H__ #define __SH_ATOMIC_H__ +#if defined(_KERNEL) + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -17,4 +19,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } -#endif +#endif /* defined(_KERNEL) */ +#endif /* __SH_ATOMIC_H__ */ diff --git a/sys/arch/solbourne/include/atomic.h b/sys/arch/solbourne/include/atomic.h index 38b96a2ad37..5b18dff2233 100644 --- a/sys/arch/solbourne/include/atomic.h +++ b/sys/arch/solbourne/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ + #ifndef __SOLBOURNE_ATOMIC_H__ #define __SOLBOURNE_ATOMIC_H__ #include <sparc/atomic.h> -#endif +#endif /* __SOLBOURNE_ATOMIC_H__ */ diff --git a/sys/arch/sparc/include/atomic.h b/sys/arch/sparc/include/atomic.h index 9f4e454b806..72beef1ec48 100644 --- a/sys/arch/sparc/include/atomic.h +++ b/sys/arch/sparc/include/atomic.h @@ -1,10 +1,12 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ #ifndef __SPARC_ATOMIC_H__ #define __SPARC_ATOMIC_H__ +#if defined(_KERNEL) + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -17,4 +19,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } -#endif +#endif /* defined(_KERNEL) */ +#endif /* __SPARC_ATOMIC_H__ */ diff --git a/sys/arch/sparc64/include/atomic.h b/sys/arch/sparc64/include/atomic.h index 4e1d5e949ce..74206a35bb3 100644 --- a/sys/arch/sparc64/include/atomic.h +++ b/sys/arch/sparc64/include/atomic.h @@ -1,10 +1,12 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ #ifndef __SPARC64_ATOMIC_H__ #define __SPARC64_ATOMIC_H__ +#if defined(_KERNEL) + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -17,4 +19,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } -#endif +#endif /* defined(_KERNEL) */ +#endif /* __SPARC64_ATOMIC_H__ */ diff --git a/sys/arch/vax/include/atomic.h b/sys/arch/vax/include/atomic.h index b5c4f8d98a7..0e390863980 100644 --- a/sys/arch/vax/include/atomic.h +++ b/sys/arch/vax/include/atomic.h @@ -1,10 +1,12 @@ -/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.2 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ #ifndef __VAX_ATOMIC_H__ #define __VAX_ATOMIC_H__ +#if defined(_KERNEL) + static __inline void atomic_setbits_int(__volatile unsigned int *uip, unsigned int v) { @@ -17,4 +19,5 @@ atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v) *uip &= ~v; } -#endif +#endif /* defined(_KERNEL) */ +#endif /* __VAX_ATOMIC_H__ */ diff --git a/sys/arch/zaurus/include/atomic.h b/sys/arch/zaurus/include/atomic.h index 72a3eb8249e..7812833a3f7 100644 --- a/sys/arch/zaurus/include/atomic.h +++ b/sys/arch/zaurus/include/atomic.h @@ -1,9 +1,10 @@ -/* $OpenBSD: atomic.h,v 1.3 2007/02/06 17:13:33 art Exp $ */ +/* $OpenBSD: atomic.h,v 1.4 2007/02/19 17:18:43 deraadt Exp $ */ /* Public Domain */ + #ifndef __ZAURUS_ATOMIC_H__ #define __ZAURUS_ATOMIC_H__ #include <arm/atomic.h> -#endif +#endif /* __ZAURUS_ATOMIC_H__ */ |