Messages in this thread Patch in this message | | | Date | Mon, 14 Nov 2005 08:29:56 -0800 | From | Paul Jackson <> | Subject | Re: [patch 3/5] atomic: atomic_inc_not_zero |
| |
On Oct 30, and again on Nov 4, Nick wrote:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Index: linux-2.6/arch/sparc/lib/atomic32.c =================================================================== --- linux-2.6.orig/arch/sparc/lib/atomic32.c +++ linux-2.6/arch/sparc/lib/atomic32.c @@ -52,6 +52,20 @@ int atomic_cmpxchg(atomic_t *v, int old, return ret; }
+int atomic_add_unless(atomic_t *v, int a, int u) +{ + int ret; + unsigned long flags; + spin_lock_irqsave(ATOMIC_HASH(v), flags); + ret = v->counter; + if (ret != u) + v->counter += a; + spin_unlock_irqrestore(ATOMIC_HASH(v), flags); + return ret != u; +} + +static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) +/* Atomic operations are already serializing */ void atomic_set(atomic_t *v, int i) { unsigned long flags; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Whatever is the meaning of that "static inline ..." line, and is this the cause of my crosstool sparc compile failure:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ CC arch/sparc/lib/atomic32.o arch/sparc/lib/atomic32.c: In function `atomic_clear_mask': arch/sparc/lib/atomic32.c:72: error: parse error before '{' token arch/sparc/lib/atomic32.c:71: error: parm types given both in parmlist and separately arch/sparc/lib/atomic32.c:75: error: `flags' undeclared (first use in this function) arch/sparc/lib/atomic32.c:75: error: (Each undeclared identifier is reported only once arch/sparc/lib/atomic32.c:75: error: for each function it appears in.) arch/sparc/lib/atomic32.c: At top level: arch/sparc/lib/atomic32.c:75: error: parse error before "while" make[1]: *** [arch/sparc/lib/atomic32.o] Error 1 make: *** [arch/sparc/lib] Error 2 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <pj@sgi.com> 1.925.600.0401 - 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/
| |