summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/include
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-02-06 17:13:34 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-02-06 17:13:34 +0000
commitf362ffa3807abff7ddf02a5444837d99e055118c (patch)
treefadacf8a1cfbb96801c55e8d68bb13d221849937 /sys/arch/alpha/include
parent7db3ee67d9e72670d704be8f59c2fc3c4fe5684a (diff)
Add machine/atomic.h to all architectures and define two operations
right now that are supposed to be atomic with respect to interrupts and SMP: atomic_setbits_int and atomic_clearbits_int. All architectures other than i386 and amd64 get dummy implementations since at first we'll be replacing operations that are done with "a |= bit" and "a &= ~bit" today. More proper implementations will follow kettenis@, miod@ ok
Diffstat (limited to 'sys/arch/alpha/include')
-rw-r--r--sys/arch/alpha/include/atomic.h14
1 files changed, 13 insertions, 1 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_ */