atomic_t: unify all arch definitions
The atomic_t type cannot currently be used in some header files because it would create an include loop with asm/atomic.h. Move the type definition to linux/types.h to break the loop. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
f99ebf0a86
commit
ea43546750
@@ -2,6 +2,7 @@
|
||||
#define __ARCH_S390_ATOMIC__
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* include/asm-s390/atomic.h
|
||||
@@ -23,9 +24,6 @@
|
||||
* S390 uses 'Compare And Swap' for atomicity in SMP enviroment
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
int counter;
|
||||
} __attribute__ ((aligned (4))) atomic_t;
|
||||
#define ATOMIC_INIT(i) { (i) }
|
||||
|
||||
#ifdef __KERNEL__
|
||||
@@ -149,9 +147,6 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
|
||||
#undef __CS_LOOP
|
||||
|
||||
#ifdef __s390x__
|
||||
typedef struct {
|
||||
long long counter;
|
||||
} __attribute__ ((aligned (8))) atomic64_t;
|
||||
#define ATOMIC64_INIT(i) { (i) }
|
||||
|
||||
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
|
||||
|
Reference in New Issue
Block a user