summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/alpha/include/atomic.h14
-rw-r--r--sys/arch/amd64/include/atomic.h29
-rw-r--r--sys/arch/arm/include/atomic.h20
-rw-r--r--sys/arch/armish/include/atomic.h9
-rw-r--r--sys/arch/aviion/include/atomic.h9
-rw-r--r--sys/arch/cats/include/atomic.h9
-rw-r--r--sys/arch/hp300/include/atomic.h9
-rw-r--r--sys/arch/hppa/include/atomic.h20
-rw-r--r--sys/arch/hppa64/include/atomic.h20
-rw-r--r--sys/arch/i386/include/atomic.h26
-rw-r--r--sys/arch/landisk/include/atomic.h9
-rw-r--r--sys/arch/luna88k/include/atomic.h9
-rw-r--r--sys/arch/m68k/include/atomic.h20
-rw-r--r--sys/arch/m88k/include/atomic.h20
-rw-r--r--sys/arch/mac68k/include/atomic.h9
-rw-r--r--sys/arch/macppc/include/atomic.h9
-rw-r--r--sys/arch/mips64/include/atomic.h20
-rw-r--r--sys/arch/mvme68k/include/atomic.h9
-rw-r--r--sys/arch/mvme88k/include/atomic.h9
-rw-r--r--sys/arch/mvmeppc/include/atomic.h9
-rw-r--r--sys/arch/powerpc/include/atomic.h20
-rw-r--r--sys/arch/sgi/include/atomic.h9
-rw-r--r--sys/arch/sh/include/atomic.h20
-rw-r--r--sys/arch/solbourne/include/atomic.h9
-rw-r--r--sys/arch/sparc/include/atomic.h20
-rw-r--r--sys/arch/sparc64/include/atomic.h20
-rw-r--r--sys/arch/vax/include/atomic.h20
-rw-r--r--sys/arch/zaurus/include/atomic.h9
28 files changed, 405 insertions, 10 deletions
diff --git a/sys/arch/alpha/include/atomic.h b/sys/arch/alpha/include/atomic.h
index 2588dd34a82..0e9bec993fb 100644
--- a/sys/arch/alpha/include/atomic.h
+++ b/sys/arch/alpha/include/atomic.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomic.h,v 1.3 2002/02/15 15:31:58 art Exp $ */
+/* $OpenBSD: atomic.h,v 1.4 2007/02/06 17:13:33 art Exp $ */
/* $NetBSD: atomic.h,v 1.7 2001/12/17 23:34:57 thorpej Exp $ */
/*-
@@ -177,4 +177,16 @@ atomic_loadlatch_ulong(__volatile unsigned long *ulp, unsigned long v)
return (v0);
}
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
#endif /* _ALPHA_ATOMIC_H_ */
diff --git a/sys/arch/amd64/include/atomic.h b/sys/arch/amd64/include/atomic.h
index 37664d33bc7..693e242c5b6 100644
--- a/sys/arch/amd64/include/atomic.h
+++ b/sys/arch/amd64/include/atomic.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomic.h,v 1.3 2004/02/23 06:25:14 mickey Exp $ */
+/* $OpenBSD: atomic.h,v 1.4 2007/02/06 17:13:33 art Exp $ */
/* $NetBSD: atomic.h,v 1.1 2003/04/26 18:39:37 fvdl Exp $ */
/*
@@ -39,8 +39,22 @@
#ifndef _ATOMIC_H
#define _ATOMIC_H
+/*
+ * Perform atomic operations on memory. Should be atomic with respect
+ * to interrupts and multiple processors.
+ *
+ * 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
+#ifdef MULTIPROCESSOR
+#define LOCK "lock"
+#else
+#define LOCK
+#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));
@@ -65,12 +79,12 @@ x86_atomic_testset_i32(volatile int32_t *ptr, int32_t 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));
+ __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));
+ __asm __volatile(LOCK " andl %1,%0" : "=m" (*ptr) : "ir" (~bits));
}
@@ -83,12 +97,12 @@ x86_atomic_clearbits_u32(volatile u_int32_t *ptr, u_int32_t bits) {
*/
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));
+ __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));
+ __asm __volatile(LOCK " andq %1,%0" : "=m" (*ptr) : "ir" (~bits));
}
#define x86_atomic_testset_ul x86_atomic_testset_u32
@@ -98,5 +112,10 @@ x86_atomic_clearbits_u64(volatile u_int64_t *ptr, u_int64_t bits) {
#define x86_atomic_clearbits_l x86_atomic_clearbits_u32
#define x86_atomic_clearbits_ul x86_atomic_clearbits_u32
+#define atomic_setbits_int x86_atomic_setbits_u32
+#define atomic_clearbits_int x86_atomic_clearbits_u32
+
+#undef LOCK
+
#endif
#endif
diff --git a/sys/arch/arm/include/atomic.h b/sys/arch/arm/include/atomic.h
new file mode 100644
index 00000000000..8bf37567652
--- /dev/null
+++ b/sys/arch/arm/include/atomic.h
@@ -0,0 +1,20 @@
+/* $OpenBSD: atomic.h,v 1.3 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+
+#ifndef __ARM_ATOMIC_H__
+#define __ARM_ATOMIC_H__
+
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
+#endif
diff --git a/sys/arch/armish/include/atomic.h b/sys/arch/armish/include/atomic.h
new file mode 100644
index 00000000000..68d17a94d4e
--- /dev/null
+++ b/sys/arch/armish/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.3 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __ARMISH_ATOMIC_H__
+#define __ARMISH_ATOMIC_H__
+
+#include <arm/atomic.h>
+
+#endif
diff --git a/sys/arch/aviion/include/atomic.h b/sys/arch/aviion/include/atomic.h
new file mode 100644
index 00000000000..b6ba4a3f2e7
--- /dev/null
+++ b/sys/arch/aviion/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __AVIION_ATOMIC_H__
+#define __AVIION_ATOMIC_H__
+
+#include <m88k/atomic.h>
+
+#endif
diff --git a/sys/arch/cats/include/atomic.h b/sys/arch/cats/include/atomic.h
new file mode 100644
index 00000000000..49c16c33358
--- /dev/null
+++ b/sys/arch/cats/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.3 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __CATS_ATOMIC_H__
+#define __CATS_ATOMIC_H__
+
+#include <arm/atomic.h>
+
+#endif
diff --git a/sys/arch/hp300/include/atomic.h b/sys/arch/hp300/include/atomic.h
new file mode 100644
index 00000000000..8e4d78700d0
--- /dev/null
+++ b/sys/arch/hp300/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __HP300_ATOMIC_H__
+#define __HP300_ATOMIC_H__
+
+#include <m68k/atomic.h>
+
+#endif
diff --git a/sys/arch/hppa/include/atomic.h b/sys/arch/hppa/include/atomic.h
new file mode 100644
index 00000000000..d04b7ec382c
--- /dev/null
+++ b/sys/arch/hppa/include/atomic.h
@@ -0,0 +1,20 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+
+#ifndef __HPPA_ATOMIC_H__
+#define __HPPA_ATOMIC_H__
+
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
+#endif
diff --git a/sys/arch/hppa64/include/atomic.h b/sys/arch/hppa64/include/atomic.h
new file mode 100644
index 00000000000..d0846609fa2
--- /dev/null
+++ b/sys/arch/hppa64/include/atomic.h
@@ -0,0 +1,20 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+
+#ifndef __HPPA64_ATOMIC_H__
+#define __HPPA64_ATOMIC_H__
+
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
+#endif
diff --git a/sys/arch/i386/include/atomic.h b/sys/arch/i386/include/atomic.h
index a06878e87b0..baf3d7bde01 100644
--- a/sys/arch/i386/include/atomic.h
+++ b/sys/arch/i386/include/atomic.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomic.h,v 1.3 2006/04/27 15:37:53 mickey Exp $ */
+/* $OpenBSD: atomic.h,v 1.4 2007/02/06 17:13:33 art Exp $ */
/* $NetBSD: atomic.h,v 1.1.2.2 2000/02/21 18:54:07 sommerfeld Exp $ */
/*-
@@ -42,11 +42,24 @@
#ifndef _ATOMIC_H_
#define _ATOMIC_H_
+/*
+ * Perform atomic operations on memory. Should be atomic with respect
+ * to interrupts and multiple processors.
+ *
+ * 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
+#ifdef MULTIPROCESSOR
+#define LOCK "lock"
+#else
+#define LOCK
+#endif
+
static __inline u_int64_t
i386_atomic_testset_uq (volatile u_int64_t *ptr, u_int64_t val) {
- __asm__ volatile ("\n1:\tlock; cmpxchg8b (%1); jnz 1b" : "+A" (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;
}
@@ -65,15 +78,20 @@ i386_atomic_testset_i (volatile int *ptr, unsigned long 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));
+ __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 ; and %1,%0" : "=m" (*ptr) : "ir" (bits));
+ __asm __volatile(LOCK " andl %1,%0" : "=m" (*ptr) : "ir" (bits));
}
+#define atomic_setbits_int i386_atomic_setbits_l
+#define atomic_clearbits_int i386_atomic_clearbits_l
+
+#undef LOCK
+
#endif
#endif
diff --git a/sys/arch/landisk/include/atomic.h b/sys/arch/landisk/include/atomic.h
new file mode 100644
index 00000000000..86e78a36ba8
--- /dev/null
+++ b/sys/arch/landisk/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __LANDISK_ATOMIC_H__
+#define __LANDISK_ATOMIC_H__
+
+#include <sh/atomic.h>
+
+#endif
diff --git a/sys/arch/luna88k/include/atomic.h b/sys/arch/luna88k/include/atomic.h
new file mode 100644
index 00000000000..b1881839d03
--- /dev/null
+++ b/sys/arch/luna88k/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __LUNA88K_ATOMIC_H__
+#define __LUNA88K_ATOMIC_H__
+
+#include <m88k/atomic.h>
+
+#endif
diff --git a/sys/arch/m68k/include/atomic.h b/sys/arch/m68k/include/atomic.h
new file mode 100644
index 00000000000..7973d236677
--- /dev/null
+++ b/sys/arch/m68k/include/atomic.h
@@ -0,0 +1,20 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+
+#ifndef __M68K_ATOMIC_H__
+#define __M68K_ATOMIC_H__
+
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
+#endif
diff --git a/sys/arch/m88k/include/atomic.h b/sys/arch/m88k/include/atomic.h
new file mode 100644
index 00000000000..70b93c94960
--- /dev/null
+++ b/sys/arch/m88k/include/atomic.h
@@ -0,0 +1,20 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+
+#ifndef __M88K_ATOMIC_H__
+#define __M88K_ATOMIC_H__
+
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
+#endif
diff --git a/sys/arch/mac68k/include/atomic.h b/sys/arch/mac68k/include/atomic.h
new file mode 100644
index 00000000000..8de2987e482
--- /dev/null
+++ b/sys/arch/mac68k/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __MAC68K_ATOMIC_H__
+#define __MAC68K_ATOMIC_H__
+
+#include <m68k/atomic.h>
+
+#endif
diff --git a/sys/arch/macppc/include/atomic.h b/sys/arch/macppc/include/atomic.h
new file mode 100644
index 00000000000..dc77a07f76f
--- /dev/null
+++ b/sys/arch/macppc/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __MACPPC_ATOMIC_H__
+#define __MACPPC_ATOMIC_H__
+
+#include <powerpc/atomic.h>
+
+#endif
diff --git a/sys/arch/mips64/include/atomic.h b/sys/arch/mips64/include/atomic.h
new file mode 100644
index 00000000000..6874e5d5e20
--- /dev/null
+++ b/sys/arch/mips64/include/atomic.h
@@ -0,0 +1,20 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+
+#ifndef __MIPS64_ATOMIC_H__
+#define __MIPS64_ATOMIC_H__
+
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
+#endif
diff --git a/sys/arch/mvme68k/include/atomic.h b/sys/arch/mvme68k/include/atomic.h
new file mode 100644
index 00000000000..8fb790d5142
--- /dev/null
+++ b/sys/arch/mvme68k/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __MVME68K_ATOMIC_H__
+#define __MVME68K_ATOMIC_H__
+
+#include <m68k/atomic.h>
+
+#endif
diff --git a/sys/arch/mvme88k/include/atomic.h b/sys/arch/mvme88k/include/atomic.h
new file mode 100644
index 00000000000..4ea3bbbe3a6
--- /dev/null
+++ b/sys/arch/mvme88k/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __MVME88K_ATOMIC_H__
+#define __MVME88K_ATOMIC_H__
+
+#include <m88k/atomic.h>
+
+#endif
diff --git a/sys/arch/mvmeppc/include/atomic.h b/sys/arch/mvmeppc/include/atomic.h
new file mode 100644
index 00000000000..26253aec0d3
--- /dev/null
+++ b/sys/arch/mvmeppc/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __MVMEPPC_ATOMIC_H__
+#define __MVMEPPC_ATOMIC_H__
+
+#include <powerpc/atomic.h>
+
+#endif
diff --git a/sys/arch/powerpc/include/atomic.h b/sys/arch/powerpc/include/atomic.h
new file mode 100644
index 00000000000..b502bc61d1e
--- /dev/null
+++ b/sys/arch/powerpc/include/atomic.h
@@ -0,0 +1,20 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+
+#ifndef __POWERPC_ATOMIC_H__
+#define __POWERPC_ATOMIC_H__
+
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
+#endif
diff --git a/sys/arch/sgi/include/atomic.h b/sys/arch/sgi/include/atomic.h
new file mode 100644
index 00000000000..b2c6df33bba
--- /dev/null
+++ b/sys/arch/sgi/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __SGI_ATOMIC_H__
+#define __SGI_ATOMIC_H__
+
+#include <mips64/atomic.h>
+
+#endif
diff --git a/sys/arch/sh/include/atomic.h b/sys/arch/sh/include/atomic.h
new file mode 100644
index 00000000000..7b9b8aed390
--- /dev/null
+++ b/sys/arch/sh/include/atomic.h
@@ -0,0 +1,20 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+
+#ifndef __SH_ATOMIC_H__
+#define __SH_ATOMIC_H__
+
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
+#endif
diff --git a/sys/arch/solbourne/include/atomic.h b/sys/arch/solbourne/include/atomic.h
new file mode 100644
index 00000000000..38b96a2ad37
--- /dev/null
+++ b/sys/arch/solbourne/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __SOLBOURNE_ATOMIC_H__
+#define __SOLBOURNE_ATOMIC_H__
+
+#include <sparc/atomic.h>
+
+#endif
diff --git a/sys/arch/sparc/include/atomic.h b/sys/arch/sparc/include/atomic.h
new file mode 100644
index 00000000000..9f4e454b806
--- /dev/null
+++ b/sys/arch/sparc/include/atomic.h
@@ -0,0 +1,20 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+
+#ifndef __SPARC_ATOMIC_H__
+#define __SPARC_ATOMIC_H__
+
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
+#endif
diff --git a/sys/arch/sparc64/include/atomic.h b/sys/arch/sparc64/include/atomic.h
new file mode 100644
index 00000000000..4e1d5e949ce
--- /dev/null
+++ b/sys/arch/sparc64/include/atomic.h
@@ -0,0 +1,20 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+
+#ifndef __SPARC64_ATOMIC_H__
+#define __SPARC64_ATOMIC_H__
+
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
+#endif
diff --git a/sys/arch/vax/include/atomic.h b/sys/arch/vax/include/atomic.h
new file mode 100644
index 00000000000..b5c4f8d98a7
--- /dev/null
+++ b/sys/arch/vax/include/atomic.h
@@ -0,0 +1,20 @@
+/* $OpenBSD: atomic.h,v 1.1 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+
+#ifndef __VAX_ATOMIC_H__
+#define __VAX_ATOMIC_H__
+
+static __inline void
+atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip |= v;
+}
+
+static __inline void
+atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
+{
+ *uip &= ~v;
+}
+
+#endif
diff --git a/sys/arch/zaurus/include/atomic.h b/sys/arch/zaurus/include/atomic.h
new file mode 100644
index 00000000000..72a3eb8249e
--- /dev/null
+++ b/sys/arch/zaurus/include/atomic.h
@@ -0,0 +1,9 @@
+/* $OpenBSD: atomic.h,v 1.3 2007/02/06 17:13:33 art Exp $ */
+
+/* Public Domain */
+#ifndef __ZAURUS_ATOMIC_H__
+#define __ZAURUS_ATOMIC_H__
+
+#include <arm/atomic.h>
+
+#endif