Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea435467 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds
Browse files

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: default avatarMatthew Wilcox <willy@linux.intel.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f99ebf0a
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
#ifndef _ALPHA_ATOMIC_H
#define _ALPHA_ATOMIC_H

#include <linux/types.h>
#include <asm/barrier.h>
#include <asm/system.h>

@@ -13,14 +14,6 @@
 */


/*
 * Counter is volatile to make sure gcc doesn't try to be clever
 * and move things around on us. We need to use _exactly_ the address
 * the user gave us, not some alias that contains the same information.
 */
typedef struct { volatile int counter; } atomic_t;
typedef struct { volatile long counter; } atomic64_t;

#define ATOMIC_INIT(i)		( (atomic_t) { (i) } )
#define ATOMIC64_INIT(i)	( (atomic64_t) { (i) } )

+1 −2
Original line number Diff line number Diff line
@@ -12,10 +12,9 @@
#define __ASM_ARM_ATOMIC_H

#include <linux/compiler.h>
#include <linux/types.h>
#include <asm/system.h>

typedef struct { volatile int counter; } atomic_t;

#define ATOMIC_INIT(i)	{ (i) }

#ifdef __KERNEL__
+1 −1
Original line number Diff line number Diff line
@@ -14,9 +14,9 @@
#ifndef __ASM_AVR32_ATOMIC_H
#define __ASM_AVR32_ATOMIC_H

#include <linux/types.h>
#include <asm/system.h>

typedef struct { volatile int counter; } atomic_t;
#define ATOMIC_INIT(i)  { (i) }

#define atomic_read(v)		((v)->counter)
+1 −3
Original line number Diff line number Diff line
#ifndef __ARCH_BLACKFIN_ATOMIC__
#define __ARCH_BLACKFIN_ATOMIC__

#include <linux/types.h>
#include <asm/system.h>	/* local_irq_XXX() */

/*
@@ -13,9 +14,6 @@
 * Tony Kou (tonyko@lineo.ca)   Lineo Inc.   2001
 */

typedef struct {
	int counter;
} atomic_t;
#define ATOMIC_INIT(i)	{ (i) }

#define atomic_read(v)		((v)->counter)
+1 −3
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
#define __ASM_CRIS_ATOMIC__

#include <linux/compiler.h>

#include <linux/types.h>
#include <asm/system.h>
#include <arch/atomic.h>

@@ -13,8 +13,6 @@
 * resource counting etc..
 */

typedef struct { volatile int counter; } atomic_t;

#define ATOMIC_INIT(i)  { (i) }

#define atomic_read(v) ((v)->counter)
Loading