summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-09-22 19:58:43 +0000
committermarcel <marcel@FreeBSD.org>2004-09-22 19:58:43 +0000
commit1bbea71b248d2ff07ead9cc31eebcf40654e443a (patch)
tree92ba03cc19198955d18299b99c4c400200a6c0c7 /sys/ia64
parente6d3324397962a33439920b6d079a2da2c2fa177 (diff)
downloadFreeBSD-src-1bbea71b248d2ff07ead9cc31eebcf40654e443a.zip
FreeBSD-src-1bbea71b248d2ff07ead9cc31eebcf40654e443a.tar.gz
For the atomic_{add|clear|set|subtract} family of inlines, return the
old or previous value instead of void. This is not as is documented in atomic(9), but is API (and ABI) compatible and simply makes sense. This feature will primarily be used for atomic PTE updates in PMAP/ng.
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/include/atomic.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/ia64/include/atomic.h b/sys/ia64/include/atomic.h
index f3b496c..79083bf 100644
--- a/sys/ia64/include/atomic.h
+++ b/sys/ia64/include/atomic.h
@@ -139,7 +139,7 @@ ATOMIC_STORE_LOAD(long, 64, "8")
#undef ATOMIC_STORE_LOAD
#define IA64_ATOMIC(sz, type, name, width, op) \
- static __inline void \
+ static __inline type \
atomic_##name##_acq_##width(volatile type *p, type v) \
{ \
type old, ret; \
@@ -147,9 +147,10 @@ ATOMIC_STORE_LOAD(long, 64, "8")
old = *p; \
IA64_CMPXCHG(sz, acq, p, old, old op v, ret); \
} while (ret != old); \
+ return (old); \
} \
\
- static __inline void \
+ static __inline type \
atomic_##name##_rel_##width(volatile type *p, type v) \
{ \
type old, ret; \
@@ -157,6 +158,7 @@ ATOMIC_STORE_LOAD(long, 64, "8")
old = *p; \
IA64_CMPXCHG(sz, rel, p, old, old op v, ret); \
} while (ret != old); \
+ return (old); \
}
IA64_ATOMIC(1, uint8_t, set, 8, |)
OpenPOWER on IntegriCloud