Re: [PATCH 1/2] FRV: Implement atomic64_t

From: David Howells
Date: Wed Jul 01 2009 - 19:49:03 EST


Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> > +#define atomic64_read(v) ((v)->counter)
> > +#define atomic64_set(v, i) (((v)->counter) = (i))

This is now:

static inline long long atomic64_read(atomic64_t *v)
{
long long counter;

asm("ldd%I1 %M1,%0"
: "=e"(counter)
: "m"(v->counter));
return counter;
}

static inline void atomic64_set(atomic64_t *v, long long i)
{
asm volatile("std%I0 %1,%M0"
: "=m"(v->counter)
: "e"(i));
}

which causes the CPU to do 64-bit loads and stores to register pairs.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/