summaryrefslogtreecommitdiffstats
path: root/sys/ia64/include/atomic.h
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2000-10-10 14:57:10 +0000
committerdfr <dfr@FreeBSD.org>2000-10-10 14:57:10 +0000
commitf610b17c8dd279232337eb576658970e589f7a1d (patch)
tree8d0b26ae97d3c2ace12a1e77c2be829d9f59047b /sys/ia64/include/atomic.h
parent164f1d6866c8c4a001115b258310116282bf08c5 (diff)
downloadFreeBSD-src-f610b17c8dd279232337eb576658970e589f7a1d.zip
FreeBSD-src-f610b17c8dd279232337eb576658970e589f7a1d.tar.gz
* Add rudimentary DDB support (no kgdb, no backtrace, no single step).
* Track recent changes to SWI code. * Allocate RIDs for pmaps (untested). * Implement assembler version of cpu_switch - its cleaner that way.
Diffstat (limited to 'sys/ia64/include/atomic.h')
-rw-r--r--sys/ia64/include/atomic.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/ia64/include/atomic.h b/sys/ia64/include/atomic.h
index a7b3e21..d4d2bbc 100644
--- a/sys/ia64/include/atomic.h
+++ b/sys/ia64/include/atomic.h
@@ -187,4 +187,27 @@ atomic_cmpset_ptr(volatile void *dst, void *exp, void *src)
(u_long)exp, (u_long)src);
}
+static __inline u_int32_t
+atomic_readandclear_32(volatile u_int32_t* p)
+{
+ u_int32_t val;
+ do {
+ val = *p;
+ } while (!atomic_cmpset_32(p, val, 0));
+ return val;
+}
+
+static __inline u_int64_t
+atomic_readandclear_64(volatile u_int64_t* p)
+{
+ u_int64_t val;
+ do {
+ val = *p;
+ } while (!atomic_cmpset_64(p, val, 0));
+ return val;
+}
+
+#define atomic_readandclear_int atomic_readandclear_32
+#define atomic_readandclear_long atomic_readandclear_64
+
#endif /* ! _MACHINE_ATOMIC_H_ */
OpenPOWER on IntegriCloud