lkml.org 
[lkml]   [2009]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/2] FRV: Implement atomic64_t
Date
Linus Torvalds <torvalds@linux-foundation.org> 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


\
 
 \ /
  Last update: 2009-07-02 01:51    [W:0.384 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site