Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83906
b: refs/heads/master
c: 80af4ee
h: refs/heads/master
v: v3
  • Loading branch information
Mathieu Desnoyers authored and Linus Torvalds committed Feb 7, 2008
1 parent f8c07e4 commit 2a17bd0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 405321d3ab2b41960e2874f2f74609daffbc7a4c
refs/heads/master: 80af4eeb726f038eddc32826e4238feba5b1dfb4
29 changes: 29 additions & 0 deletions trunk/include/asm-sparc64/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#ifndef __ASSEMBLY__

#include <linux/irqflags.h>
#include <asm-generic/cmpxchg-local.h>

/*
* Sparc (general) CPU types
Expand Down Expand Up @@ -315,6 +316,34 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
(unsigned long)_n_, sizeof(*(ptr))); \
})

/*
* cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
* them available.
*/

static inline unsigned long __cmpxchg_local(volatile void *ptr,
unsigned long old,
unsigned long new, int size)
{
switch (size) {
case 4:
case 8: return __cmpxchg(ptr, old, new, size);
default:
return __cmpxchg_local_generic(ptr, old, new, size);
}

return old;
}

#define cmpxchg_local(ptr, o, n) \
((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
(unsigned long)(n), sizeof(*(ptr))))
#define cmpxchg64_local(ptr, o, n) \
({ \
BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
cmpxchg_local((ptr), (o), (n)); \
})

#endif /* !(__ASSEMBLY__) */

#define arch_align_stack(x) (x)
Expand Down

0 comments on commit 2a17bd0

Please sign in to comment.