Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80023
b: refs/heads/master
c: 01c57fb
h: refs/heads/master
i:
  80021: 363a58f
  80019: 23cb557
  80015: 95aa07a
v: v3
  • Loading branch information
Harvey Harrison authored and Ingo Molnar committed Jan 30, 2008
1 parent 3b88343 commit ff2f306
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5638f99394d478bcba6384ac7c51e763d1a3a448
refs/heads/master: 01c57fb6a3eefc34da17be1399453c0800bcff68
17 changes: 8 additions & 9 deletions trunk/include/asm-x86/local.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
#include <asm/atomic.h>
#include <asm/asm.h>

typedef struct
{
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_set(l, i) atomic_long_set(&(l)->a, (i))

static inline void local_inc(local_t *l)
{
Expand Down Expand Up @@ -137,7 +136,7 @@ static inline long local_add_return(long i, local_t *l)
long __i;
#ifdef CONFIG_M386
unsigned long flags;
if(unlikely(boot_cpu_data.x86 <= 3))
if (unlikely(boot_cpu_data.x86 <= 3))
goto no_xadd;
#endif
/* Modern 486+ processor */
Expand All @@ -160,11 +159,11 @@ static inline long local_add_return(long i, local_t *l)

static inline long local_sub_return(long i, local_t *l)
{
return local_add_return(-i,l);
return local_add_return(-i, l);
}

#define local_inc_return(l) (local_add_return(1,l))
#define local_dec_return(l) (local_sub_return(1,l))
#define local_inc_return(l) (local_add_return(1, l))
#define local_dec_return(l) (local_sub_return(1, l))

#define local_cmpxchg(l, o, n) \
(cmpxchg_local(&((l)->a.counter), (o), (n)))
Expand Down Expand Up @@ -202,8 +201,8 @@ static inline long local_sub_return(long i, local_t *l)
*/
#define __local_inc(l) local_inc(l)
#define __local_dec(l) local_dec(l)
#define __local_add(i,l) local_add((i),(l))
#define __local_sub(i,l) local_sub((i),(l))
#define __local_add(i, l) local_add((i), (l))
#define __local_sub(i, l) local_sub((i), (l))

/* Use these for per-cpu local_t variables: on some archs they are
* much more efficient than these naive implementations. Note they take
Expand Down

0 comments on commit ff2f306

Please sign in to comment.