diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2013-10-16 18:42:15 -0400 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2014-01-14 13:19:53 -0500 |
commit | 5515daa9ca5a0992cc1c55d4c6c7ddb116e829b4 (patch) | |
tree | d02c81a40e1355b1054a16fa4f7452672d978ff6 /arch/xtensa/include | |
parent | ff3849059d787ab2072032800e553c9022c9ab54 (diff) |
xtensa: fix arch spinlock function names
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa/include')
-rw-r--r-- | arch/xtensa/include/asm/spinlock.h | 31 | ||||
-rw-r--r-- | arch/xtensa/include/asm/spinlock_types.h | 20 |
2 files changed, 37 insertions, 14 deletions
diff --git a/arch/xtensa/include/asm/spinlock.h b/arch/xtensa/include/asm/spinlock.h index 03975906b36f..1d95fa5dcd10 100644 --- a/arch/xtensa/include/asm/spinlock.h +++ b/arch/xtensa/include/asm/spinlock.h | |||
@@ -28,13 +28,13 @@ | |||
28 | * 1 somebody owns the spinlock | 28 | * 1 somebody owns the spinlock |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #define __raw_spin_is_locked(x) ((x)->slock != 0) | 31 | #define arch_spin_is_locked(x) ((x)->slock != 0) |
32 | #define __raw_spin_unlock_wait(lock) \ | 32 | #define arch_spin_unlock_wait(lock) \ |
33 | do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) | 33 | do { while (arch_spin_is_locked(lock)) cpu_relax(); } while (0) |
34 | 34 | ||
35 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | 35 | #define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock) |
36 | 36 | ||
37 | static inline void __raw_spin_lock(raw_spinlock_t *lock) | 37 | static inline void arch_spin_lock(arch_spinlock_t *lock) |
38 | { | 38 | { |
39 | unsigned long tmp; | 39 | unsigned long tmp; |
40 | 40 | ||
@@ -51,7 +51,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) | |||
51 | 51 | ||
52 | /* Returns 1 if the lock is obtained, 0 otherwise. */ | 52 | /* Returns 1 if the lock is obtained, 0 otherwise. */ |
53 | 53 | ||
54 | static inline int __raw_spin_trylock(raw_spinlock_t *lock) | 54 | static inline int arch_spin_trylock(arch_spinlock_t *lock) |
55 | { | 55 | { |
56 | unsigned long tmp; | 56 | unsigned long tmp; |
57 | 57 | ||
@@ -67,7 +67,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock) | |||
67 | return tmp == 0 ? 1 : 0; | 67 | return tmp == 0 ? 1 : 0; |
68 | } | 68 | } |
69 | 69 | ||
70 | static inline void __raw_spin_unlock(raw_spinlock_t *lock) | 70 | static inline void arch_spin_unlock(arch_spinlock_t *lock) |
71 | { | 71 | { |
72 | unsigned long tmp; | 72 | unsigned long tmp; |
73 | 73 | ||
@@ -96,9 +96,9 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) | |||
96 | * 0x80000000 one writer owns the rwlock, no other writers, no readers | 96 | * 0x80000000 one writer owns the rwlock, no other writers, no readers |
97 | */ | 97 | */ |
98 | 98 | ||
99 | #define __raw_write_can_lock(x) ((x)->lock == 0) | 99 | #define arch_write_can_lock(x) ((x)->lock == 0) |
100 | 100 | ||
101 | static inline void __raw_write_lock(raw_rwlock_t *rw) | 101 | static inline void arch_write_lock(arch_rwlock_t *rw) |
102 | { | 102 | { |
103 | unsigned long tmp; | 103 | unsigned long tmp; |
104 | 104 | ||
@@ -116,7 +116,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw) | |||
116 | 116 | ||
117 | /* Returns 1 if the lock is obtained, 0 otherwise. */ | 117 | /* Returns 1 if the lock is obtained, 0 otherwise. */ |
118 | 118 | ||
119 | static inline int __raw_write_trylock(raw_rwlock_t *rw) | 119 | static inline int arch_write_trylock(arch_rwlock_t *rw) |
120 | { | 120 | { |
121 | unsigned long tmp; | 121 | unsigned long tmp; |
122 | 122 | ||
@@ -133,7 +133,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) | |||
133 | return tmp == 0 ? 1 : 0; | 133 | return tmp == 0 ? 1 : 0; |
134 | } | 134 | } |
135 | 135 | ||
136 | static inline void __raw_write_unlock(raw_rwlock_t *rw) | 136 | static inline void arch_write_unlock(arch_rwlock_t *rw) |
137 | { | 137 | { |
138 | unsigned long tmp; | 138 | unsigned long tmp; |
139 | 139 | ||
@@ -145,7 +145,7 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) | |||
145 | : "memory"); | 145 | : "memory"); |
146 | } | 146 | } |
147 | 147 | ||
148 | static inline void __raw_read_lock(raw_rwlock_t *rw) | 148 | static inline void arch_read_lock(arch_rwlock_t *rw) |
149 | { | 149 | { |
150 | unsigned long tmp; | 150 | unsigned long tmp; |
151 | unsigned long result; | 151 | unsigned long result; |
@@ -164,7 +164,7 @@ static inline void __raw_read_lock(raw_rwlock_t *rw) | |||
164 | 164 | ||
165 | /* Returns 1 if the lock is obtained, 0 otherwise. */ | 165 | /* Returns 1 if the lock is obtained, 0 otherwise. */ |
166 | 166 | ||
167 | static inline int __raw_read_trylock(raw_rwlock_t *rw) | 167 | static inline int arch_read_trylock(arch_rwlock_t *rw) |
168 | { | 168 | { |
169 | unsigned long result; | 169 | unsigned long result; |
170 | unsigned long tmp; | 170 | unsigned long tmp; |
@@ -184,7 +184,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw) | |||
184 | return result == 0; | 184 | return result == 0; |
185 | } | 185 | } |
186 | 186 | ||
187 | static inline void __raw_read_unlock(raw_rwlock_t *rw) | 187 | static inline void arch_read_unlock(arch_rwlock_t *rw) |
188 | { | 188 | { |
189 | unsigned long tmp1, tmp2; | 189 | unsigned long tmp1, tmp2; |
190 | 190 | ||
@@ -199,4 +199,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw) | |||
199 | : "memory"); | 199 | : "memory"); |
200 | } | 200 | } |
201 | 201 | ||
202 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | ||
203 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | ||
204 | |||
202 | #endif /* _XTENSA_SPINLOCK_H */ | 205 | #endif /* _XTENSA_SPINLOCK_H */ |
diff --git a/arch/xtensa/include/asm/spinlock_types.h b/arch/xtensa/include/asm/spinlock_types.h new file mode 100644 index 000000000000..7ec5ce10c9e9 --- /dev/null +++ b/arch/xtensa/include/asm/spinlock_types.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef __ASM_SPINLOCK_TYPES_H | ||
2 | #define __ASM_SPINLOCK_TYPES_H | ||
3 | |||
4 | #ifndef __LINUX_SPINLOCK_TYPES_H | ||
5 | # error "please don't include this file directly" | ||
6 | #endif | ||
7 | |||
8 | typedef struct { | ||
9 | volatile unsigned int slock; | ||
10 | } arch_spinlock_t; | ||
11 | |||
12 | #define __ARCH_SPIN_LOCK_UNLOCKED { 0 } | ||
13 | |||
14 | typedef struct { | ||
15 | volatile unsigned int lock; | ||
16 | } arch_rwlock_t; | ||
17 | |||
18 | #define __ARCH_RW_LOCK_UNLOCKED { 0 } | ||
19 | |||
20 | #endif | ||