* 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
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
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
* 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.
>
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
5 matches
Mail list logo