Re: [PATCH 7/10] local_t : powerpc

2007-01-24 Thread Mathieu Desnoyers
* Paul Mackerras ([EMAIL PROTECTED]) wrote: > Mathieu Desnoyers writes: > > > +static __inline__ int local_dec_if_positive(local_t *l) > > +{ > > + int t; > > + > > + __asm__ __volatile__( > > +"1:lwarx %0,0,%1 # local_dec_if_positive\n\ > > + addic. %0,%0,-1\n\ > > + bl

Re: [PATCH 7/10] local_t : powerpc

2007-01-24 Thread Gabriel Paubert
On Wed, Jan 24, 2007 at 08:08:12PM +1100, Paul Mackerras wrote: > Mathieu Desnoyers writes: > > > +static __inline__ int local_dec_if_positive(local_t *l) > > +{ > > + int t; > > + > > + __asm__ __volatile__( > > +"1:lwarx %0,0,%1 # local_dec_if_positive\n\ > > + addic. %0

Re: [PATCH 7/10] local_t : powerpc

2007-01-24 Thread Paul Mackerras
Mathieu Desnoyers writes: > +static __inline__ int local_dec_if_positive(local_t *l) > +{ > + int t; > + > + __asm__ __volatile__( > +"1: lwarx %0,0,%1 # local_dec_if_positive\n\ > + addic. %0,%0,-1\n\ > + blt-2f\n" > + PPC405_ERR77(0,%1) > +"stwcx. %0,0,%1

Re: [Ltt-dev] [PATCH 7/10] local_t : powerpc

2006-12-20 Thread Mathieu Desnoyers
* Mathieu Desnoyers ([EMAIL PROTECTED]) wrote: > --- a/include/asm-powerpc/local.h > +++ b/include/asm-powerpc/local.h > +/** > + * local_add_unless - add unless the number is a given value > + * @l: pointer of type local_t > + * @a: the amount to add to l... > + * @u: ...unless l is equal to u. >

[PATCH 7/10] local_t : powerpc

2006-12-20 Thread Mathieu Desnoyers
PowerPC local_t extension. Signed-off-by: Mathieu Desnoyers <[EMAIL PROTECTED]> --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h @@ -226,6 +226,29 @@ __xchg_u32(volatile void *p, unsigned lo return prev; } +/* + * Atomic exchange + * + * Changes the memory location