On Thursday 28 April 2005 6:34 pm, Calkins, Dennis wrote:
Hi, I don't know if this is a compiler question or a platform question but it is definitely a programming question.
On the new M$ 64-bit platform released this week, they support ATOMIC operations on 64-bit values.
Were do I find the equivalent ATOMIC functions on LINUX?
In asm-x86_64/atomic.h I can only find operations that work on 32-bit values.
Do I basically have to roll my own versions of these functions?
Is this something someone is looking to add to atomic.h for various platforms? I have an Itanium system, and in atomic.h there are several functions that utilize longs (eg. 64 bit ). static __inline__ int ia64_atomic64_add (__s64 i, atomic64_t *v) { __s64 old, new; CMPXCHG_BUGCHECK_DECL
do {
CMPXCHG_BUGCHECK(v);
old = atomic_read(v);
new = old + i;
} while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old);
return new;
}
However, while this returns an int eventhough the values are 64-bit. I'm
going to email the author. (BTW: This is in SLES9).
--
Jerry Feldman