diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-12-03 14:08:46 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-12-14 17:55:32 -0500 |
commit | e5931943d02bf751b1ec849c0d2ade23d76a8d41 (patch) | |
tree | 119fe3bc583d0d043d97cb9edd98bad52692a546 /arch/sh/include/asm | |
parent | fb3a6bbc912b12347614e5742c7c61416cdb0ca0 (diff) |
locking: Convert raw_rwlock functions to arch_rwlock
Name space cleanup for rwlock functions. No functional change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: linux-arch@vger.kernel.org
Diffstat (limited to 'arch/sh/include/asm')
-rw-r--r-- | arch/sh/include/asm/spinlock.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/arch/sh/include/asm/spinlock.h b/arch/sh/include/asm/spinlock.h index 7f3626aac869..bdc0f3b6c56a 100644 --- a/arch/sh/include/asm/spinlock.h +++ b/arch/sh/include/asm/spinlock.h | |||
@@ -100,21 +100,21 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock) | |||
100 | * read_can_lock - would read_trylock() succeed? | 100 | * read_can_lock - would read_trylock() succeed? |
101 | * @lock: the rwlock in question. | 101 | * @lock: the rwlock in question. |
102 | */ | 102 | */ |
103 | #define __raw_read_can_lock(x) ((x)->lock > 0) | 103 | #define arch_read_can_lock(x) ((x)->lock > 0) |
104 | 104 | ||
105 | /** | 105 | /** |
106 | * write_can_lock - would write_trylock() succeed? | 106 | * write_can_lock - would write_trylock() succeed? |
107 | * @lock: the rwlock in question. | 107 | * @lock: the rwlock in question. |
108 | */ | 108 | */ |
109 | #define __raw_write_can_lock(x) ((x)->lock == RW_LOCK_BIAS) | 109 | #define arch_write_can_lock(x) ((x)->lock == RW_LOCK_BIAS) |
110 | 110 | ||
111 | static inline void __raw_read_lock(arch_rwlock_t *rw) | 111 | static inline void arch_read_lock(arch_rwlock_t *rw) |
112 | { | 112 | { |
113 | unsigned long tmp; | 113 | unsigned long tmp; |
114 | 114 | ||
115 | __asm__ __volatile__ ( | 115 | __asm__ __volatile__ ( |
116 | "1: \n\t" | 116 | "1: \n\t" |
117 | "movli.l @%1, %0 ! __raw_read_lock \n\t" | 117 | "movli.l @%1, %0 ! arch_read_lock \n\t" |
118 | "cmp/pl %0 \n\t" | 118 | "cmp/pl %0 \n\t" |
119 | "bf 1b \n\t" | 119 | "bf 1b \n\t" |
120 | "add #-1, %0 \n\t" | 120 | "add #-1, %0 \n\t" |
@@ -126,13 +126,13 @@ static inline void __raw_read_lock(arch_rwlock_t *rw) | |||
126 | ); | 126 | ); |
127 | } | 127 | } |
128 | 128 | ||
129 | static inline void __raw_read_unlock(arch_rwlock_t *rw) | 129 | static inline void arch_read_unlock(arch_rwlock_t *rw) |
130 | { | 130 | { |
131 | unsigned long tmp; | 131 | unsigned long tmp; |
132 | 132 | ||
133 | __asm__ __volatile__ ( | 133 | __asm__ __volatile__ ( |
134 | "1: \n\t" | 134 | "1: \n\t" |
135 | "movli.l @%1, %0 ! __raw_read_unlock \n\t" | 135 | "movli.l @%1, %0 ! arch_read_unlock \n\t" |
136 | "add #1, %0 \n\t" | 136 | "add #1, %0 \n\t" |
137 | "movco.l %0, @%1 \n\t" | 137 | "movco.l %0, @%1 \n\t" |
138 | "bf 1b \n\t" | 138 | "bf 1b \n\t" |
@@ -142,13 +142,13 @@ static inline void __raw_read_unlock(arch_rwlock_t *rw) | |||
142 | ); | 142 | ); |
143 | } | 143 | } |
144 | 144 | ||
145 | static inline void __raw_write_lock(arch_rwlock_t *rw) | 145 | static inline void arch_write_lock(arch_rwlock_t *rw) |
146 | { | 146 | { |
147 | unsigned long tmp; | 147 | unsigned long tmp; |
148 | 148 | ||
149 | __asm__ __volatile__ ( | 149 | __asm__ __volatile__ ( |
150 | "1: \n\t" | 150 | "1: \n\t" |
151 | "movli.l @%1, %0 ! __raw_write_lock \n\t" | 151 | "movli.l @%1, %0 ! arch_write_lock \n\t" |
152 | "cmp/hs %2, %0 \n\t" | 152 | "cmp/hs %2, %0 \n\t" |
153 | "bf 1b \n\t" | 153 | "bf 1b \n\t" |
154 | "sub %2, %0 \n\t" | 154 | "sub %2, %0 \n\t" |
@@ -160,23 +160,23 @@ static inline void __raw_write_lock(arch_rwlock_t *rw) | |||
160 | ); | 160 | ); |
161 | } | 161 | } |
162 | 162 | ||
163 | static inline void __raw_write_unlock(arch_rwlock_t *rw) | 163 | static inline void arch_write_unlock(arch_rwlock_t *rw) |
164 | { | 164 | { |
165 | __asm__ __volatile__ ( | 165 | __asm__ __volatile__ ( |
166 | "mov.l %1, @%0 ! __raw_write_unlock \n\t" | 166 | "mov.l %1, @%0 ! arch_write_unlock \n\t" |
167 | : | 167 | : |
168 | : "r" (&rw->lock), "r" (RW_LOCK_BIAS) | 168 | : "r" (&rw->lock), "r" (RW_LOCK_BIAS) |
169 | : "t", "memory" | 169 | : "t", "memory" |
170 | ); | 170 | ); |
171 | } | 171 | } |
172 | 172 | ||
173 | static inline int __raw_read_trylock(arch_rwlock_t *rw) | 173 | static inline int arch_read_trylock(arch_rwlock_t *rw) |
174 | { | 174 | { |
175 | unsigned long tmp, oldval; | 175 | unsigned long tmp, oldval; |
176 | 176 | ||
177 | __asm__ __volatile__ ( | 177 | __asm__ __volatile__ ( |
178 | "1: \n\t" | 178 | "1: \n\t" |
179 | "movli.l @%2, %0 ! __raw_read_trylock \n\t" | 179 | "movli.l @%2, %0 ! arch_read_trylock \n\t" |
180 | "mov %0, %1 \n\t" | 180 | "mov %0, %1 \n\t" |
181 | "cmp/pl %0 \n\t" | 181 | "cmp/pl %0 \n\t" |
182 | "bf 2f \n\t" | 182 | "bf 2f \n\t" |
@@ -193,13 +193,13 @@ static inline int __raw_read_trylock(arch_rwlock_t *rw) | |||
193 | return (oldval > 0); | 193 | return (oldval > 0); |
194 | } | 194 | } |
195 | 195 | ||
196 | static inline int __raw_write_trylock(arch_rwlock_t *rw) | 196 | static inline int arch_write_trylock(arch_rwlock_t *rw) |
197 | { | 197 | { |
198 | unsigned long tmp, oldval; | 198 | unsigned long tmp, oldval; |
199 | 199 | ||
200 | __asm__ __volatile__ ( | 200 | __asm__ __volatile__ ( |
201 | "1: \n\t" | 201 | "1: \n\t" |
202 | "movli.l @%2, %0 ! __raw_write_trylock \n\t" | 202 | "movli.l @%2, %0 ! arch_write_trylock \n\t" |
203 | "mov %0, %1 \n\t" | 203 | "mov %0, %1 \n\t" |
204 | "cmp/hs %3, %0 \n\t" | 204 | "cmp/hs %3, %0 \n\t" |
205 | "bf 2f \n\t" | 205 | "bf 2f \n\t" |
@@ -216,8 +216,8 @@ static inline int __raw_write_trylock(arch_rwlock_t *rw) | |||
216 | return (oldval > (RW_LOCK_BIAS - 1)); | 216 | return (oldval > (RW_LOCK_BIAS - 1)); |
217 | } | 217 | } |
218 | 218 | ||
219 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | 219 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
220 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | 220 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
221 | 221 | ||
222 | #define arch_spin_relax(lock) cpu_relax() | 222 | #define arch_spin_relax(lock) cpu_relax() |
223 | #define arch_read_relax(lock) cpu_relax() | 223 | #define arch_read_relax(lock) cpu_relax() |