~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to arch/alpha/include/asm/atomic.h

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
177
177
 
178
178
/**
179
 
 * atomic_add_unless - add unless the number is a given value
 
179
 * __atomic_add_unless - add unless the number is a given value
180
180
 * @v: pointer of type atomic_t
181
181
 * @a: the amount to add to v...
182
182
 * @u: ...unless v is equal to u.
183
183
 *
184
184
 * Atomically adds @a to @v, so long as it was not @u.
185
 
 * Returns non-zero if @v was not @u, and zero otherwise.
 
185
 * Returns the old value of @v.
186
186
 */
187
 
static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
 
187
static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
188
188
{
189
189
        int c, old;
190
190
        c = atomic_read(v);
196
196
                        break;
197
197
                c = old;
198
198
        }
199
 
        return c != (u);
 
199
        return c;
200
200
}
201
201
 
202
 
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
203
202
 
204
203
/**
205
204
 * atomic64_add_unless - add unless the number is a given value
208
207
 * @u: ...unless v is equal to u.
209
208
 *
210
209
 * Atomically adds @a to @v, so long as it was not @u.
211
 
 * Returns non-zero if @v was not @u, and zero otherwise.
 
210
 * Returns the old value of @v.
212
211
 */
213
212
static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
214
213
{
256
255
#define smp_mb__before_atomic_inc()     smp_mb()
257
256
#define smp_mb__after_atomic_inc()      smp_mb()
258
257
 
259
 
#include <asm-generic/atomic-long.h>
260
258
#endif /* _ALPHA_ATOMIC_H */