lkml.org 
[lkml]   [2007]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 07/10] local_t : powerpc extension
Date

On Feb 15, 2007, at 1:20 AM, Mathieu Desnoyers wrote:

> * Andrew Morton (akpm@linux-foundation.org) wrote:
>> On Sun, 11 Feb 2007 14:18:12 -0500 Mathieu Desnoyers
>> <mathieu.desnoyers@polymtl.ca> wrote:
>>
>>> local_t : powerpc extension
>>
>> This diff contains changes which are also present in "[PATCH 07/10]
>> atomic.h : Add atomic64 cmpxchg, xchg and add_unless to powerpc",
>> resulting
>> in rather a mess.
>>
>> I dropped the duplicated hunks from the later patch rather than
>> this one,
>> but I haven't tried to compile the result yet.
>>
>
> Yes, sorry about that : the atomic.h diff has been duplicated in both
> the local and atomic changes.
>
> The change to system.h for local.h is to add the xchg_local and
> cmpxchg_local, while the change for atomic.h is to simply remove the
> #include <asm/atomic.h> from system.h.
>
> Here is a proper local.h diff, if it happens to become necessary, but
> simply removing the duplicated asm-powerpc/system.h hunks will be ok.
>
> Thanks,
>
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
>
> --- a/include/asm-powerpc/local.h
> +++ b/include/asm-powerpc/local.h
> @@ -1 +1,342 @@
> -#include <asm-generic/local.h>
> +#ifndef _ARCH_POWERPC_LOCAL_H
> +#define _ARCH_POWERPC_LOCAL_H
> +
> +#include <linux/percpu.h>
> +#include <asm/atomic.h>
> +
> +typedef struct
> +{
> + atomic_long_t a;
> +} local_t;
> +
> +#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
> +
> +#define local_read(l) atomic_long_read(&(l)->a)
> +#define local_set(l,i) atomic_long_set(&(l)->a, (i))
> +
> +#define local_add(i,l) atomic_long_add((i),(&(l)->a))
> +#define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
> +#define local_inc(l) atomic_long_inc(&(l)->a)
> +#define local_dec(l) atomic_long_dec(&(l)->a)
> +
> +#ifndef __powerpc64__
> +
> +static __inline__ int local_add_return(int a, local_t *l)
> +{

is there a reason this isn't local_add_return(long a, local_t *l) on
ppc32?

(same comment for other functions)

- k



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

\
 
 \ /
  Last update: 2007-02-15 16:15    [W:0.073 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site