aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/spinlock_types.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-08-21 21:34:31 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-09-20 22:57:51 -0400
commit8a467a529f01c3471b195a0e8989c6177fe145ef (patch)
tree0f3c5bf78acf98c28ebb36110c94d6b8dc2e836b /include/asm-sh/spinlock_types.h
parentb05d1865b46ea72c66ba082598ba370582bb590e (diff)
sh: Overhaul spinlocks and rwlocks for SH-4A SMP.
This rips out some of the old spinlock and rwlock behaviour that the SH-2 parts were using and reworks them for LL/SC semantics on the SH-4A. This is primarily only useful for SH-X3 multi-cores, but can also be used for building CONFIG_SMP=y testing kernels on SH-4A UP. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/spinlock_types.h')
-rw-r--r--include/asm-sh/spinlock_types.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/asm-sh/spinlock_types.h b/include/asm-sh/spinlock_types.h
index 5c58134f2c4..b4d244e7b60 100644
--- a/include/asm-sh/spinlock_types.h
+++ b/include/asm-sh/spinlock_types.h
@@ -6,19 +6,16 @@
6#endif 6#endif
7 7
8typedef struct { 8typedef struct {
9 volatile unsigned long lock; 9 volatile unsigned int lock;
10} raw_spinlock_t; 10} raw_spinlock_t;
11 11
12#define __RAW_SPIN_LOCK_UNLOCKED { 1 } 12#define __RAW_SPIN_LOCK_UNLOCKED { 1 }
13
14#include <asm/atomic.h>
15 13
16typedef struct { 14typedef struct {
17 raw_spinlock_t lock; 15 volatile unsigned int lock;
18 atomic_t counter;
19} raw_rwlock_t; 16} raw_rwlock_t;
20 17
21#define RW_LOCK_BIAS 0x01000000 18#define RW_LOCK_BIAS 0x01000000
22#define __RAW_RW_LOCK_UNLOCKED { { 0 }, { RW_LOCK_BIAS } } 19#define __RAW_RW_LOCK_UNLOCKED { RW_LOCK_BIAS }
23 20
24#endif 21#endif