On Feb 15, 2007, at 1:20 AM, Mathieu Desnoyers wrote:
* Andrew Morton ([email protected]) wrote:
On Sun, 11 Feb 2007 14:18:12 -0500 Mathieu Desnoyers
<[email protected]> 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 <[email protected]>
--- 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]