Mailinglist Archive: opensuse-programming (118 mails)
| < Previous | Next > |
Re: [suse-programming-e] Porting from M$
- From: Jerry Feldman <gaf@xxxxxxx>
- Date: Fri, 29 Apr 2005 08:02:04 -0400
- Message-id: <200504290802.05011.gaf@xxxxxxx>
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 <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
> 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 <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
| < Previous | Next > |