aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/spinlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/spinlock.c')
-rw-r--r--kernel/spinlock.c192
1 files changed, 96 insertions, 96 deletions
diff --git a/kernel/spinlock.c b/kernel/spinlock.c
index 795240b81224..be6517fb9c14 100644
--- a/kernel/spinlock.c
+++ b/kernel/spinlock.c
@@ -44,7 +44,7 @@
44 * towards that other CPU that it should break the lock ASAP. 44 * towards that other CPU that it should break the lock ASAP.
45 */ 45 */
46#define BUILD_LOCK_OPS(op, locktype) \ 46#define BUILD_LOCK_OPS(op, locktype) \
47void __lockfunc __##op##_lock(locktype##_t *lock) \ 47void __lockfunc __raw_##op##_lock(locktype##_t *lock) \
48{ \ 48{ \
49 for (;;) { \ 49 for (;;) { \
50 preempt_disable(); \ 50 preempt_disable(); \
@@ -60,7 +60,7 @@ void __lockfunc __##op##_lock(locktype##_t *lock) \
60 (lock)->break_lock = 0; \ 60 (lock)->break_lock = 0; \
61} \ 61} \
62 \ 62 \
63unsigned long __lockfunc __##op##_lock_irqsave(locktype##_t *lock) \ 63unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \
64{ \ 64{ \
65 unsigned long flags; \ 65 unsigned long flags; \
66 \ 66 \
@@ -81,12 +81,12 @@ unsigned long __lockfunc __##op##_lock_irqsave(locktype##_t *lock) \
81 return flags; \ 81 return flags; \
82} \ 82} \
83 \ 83 \
84void __lockfunc __##op##_lock_irq(locktype##_t *lock) \ 84void __lockfunc __raw_##op##_lock_irq(locktype##_t *lock) \
85{ \ 85{ \
86 _##op##_lock_irqsave(lock); \ 86 _raw_##op##_lock_irqsave(lock); \
87} \ 87} \
88 \ 88 \
89void __lockfunc __##op##_lock_bh(locktype##_t *lock) \ 89void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \
90{ \ 90{ \
91 unsigned long flags; \ 91 unsigned long flags; \
92 \ 92 \
@@ -95,7 +95,7 @@ void __lockfunc __##op##_lock_bh(locktype##_t *lock) \
95 /* irq-disabling. We use the generic preemption-aware */ \ 95 /* irq-disabling. We use the generic preemption-aware */ \
96 /* function: */ \ 96 /* function: */ \
97 /**/ \ 97 /**/ \
98 flags = _##op##_lock_irqsave(lock); \ 98 flags = _raw_##op##_lock_irqsave(lock); \
99 local_bh_disable(); \ 99 local_bh_disable(); \
100 local_irq_restore(flags); \ 100 local_irq_restore(flags); \
101} \ 101} \
@@ -116,240 +116,240 @@ BUILD_LOCK_OPS(write, rwlock);
116#endif 116#endif
117 117
118#ifndef CONFIG_INLINE_SPIN_TRYLOCK 118#ifndef CONFIG_INLINE_SPIN_TRYLOCK
119int __lockfunc _spin_trylock(raw_spinlock_t *lock) 119int __lockfunc _raw_spin_trylock(raw_spinlock_t *lock)
120{ 120{
121 return __spin_trylock(lock); 121 return __raw_spin_trylock(lock);
122} 122}
123EXPORT_SYMBOL(_spin_trylock); 123EXPORT_SYMBOL(_raw_spin_trylock);
124#endif 124#endif
125 125
126#ifndef CONFIG_INLINE_SPIN_TRYLOCK_BH 126#ifndef CONFIG_INLINE_SPIN_TRYLOCK_BH
127int __lockfunc _spin_trylock_bh(raw_spinlock_t *lock) 127int __lockfunc _raw_spin_trylock_bh(raw_spinlock_t *lock)
128{ 128{
129 return __spin_trylock_bh(lock); 129 return __raw_spin_trylock_bh(lock);
130} 130}
131EXPORT_SYMBOL(_spin_trylock_bh); 131EXPORT_SYMBOL(_raw_spin_trylock_bh);
132#endif 132#endif
133 133
134#ifndef CONFIG_INLINE_SPIN_LOCK 134#ifndef CONFIG_INLINE_SPIN_LOCK
135void __lockfunc _spin_lock(raw_spinlock_t *lock) 135void __lockfunc _raw_spin_lock(raw_spinlock_t *lock)
136{ 136{
137 __spin_lock(lock); 137 __raw_spin_lock(lock);
138} 138}
139EXPORT_SYMBOL(_spin_lock); 139EXPORT_SYMBOL(_raw_spin_lock);
140#endif 140#endif
141 141
142#ifndef CONFIG_INLINE_SPIN_LOCK_IRQSAVE 142#ifndef CONFIG_INLINE_SPIN_LOCK_IRQSAVE
143unsigned long __lockfunc _spin_lock_irqsave(raw_spinlock_t *lock) 143unsigned long __lockfunc _raw_spin_lock_irqsave(raw_spinlock_t *lock)
144{ 144{
145 return __spin_lock_irqsave(lock); 145 return __raw_spin_lock_irqsave(lock);
146} 146}
147EXPORT_SYMBOL(_spin_lock_irqsave); 147EXPORT_SYMBOL(_raw_spin_lock_irqsave);
148#endif 148#endif
149 149
150#ifndef CONFIG_INLINE_SPIN_LOCK_IRQ 150#ifndef CONFIG_INLINE_SPIN_LOCK_IRQ
151void __lockfunc _spin_lock_irq(raw_spinlock_t *lock) 151void __lockfunc _raw_spin_lock_irq(raw_spinlock_t *lock)
152{ 152{
153 __spin_lock_irq(lock); 153 __raw_spin_lock_irq(lock);
154} 154}
155EXPORT_SYMBOL(_spin_lock_irq); 155EXPORT_SYMBOL(_raw_spin_lock_irq);
156#endif 156#endif
157 157
158#ifndef CONFIG_INLINE_SPIN_LOCK_BH 158#ifndef CONFIG_INLINE_SPIN_LOCK_BH
159void __lockfunc _spin_lock_bh(raw_spinlock_t *lock) 159void __lockfunc _raw_spin_lock_bh(raw_spinlock_t *lock)
160{ 160{
161 __spin_lock_bh(lock); 161 __raw_spin_lock_bh(lock);
162} 162}
163EXPORT_SYMBOL(_spin_lock_bh); 163EXPORT_SYMBOL(_raw_spin_lock_bh);
164#endif 164#endif
165 165
166#ifndef CONFIG_INLINE_SPIN_UNLOCK 166#ifndef CONFIG_INLINE_SPIN_UNLOCK
167void __lockfunc _spin_unlock(raw_spinlock_t *lock) 167void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock)
168{ 168{
169 __spin_unlock(lock); 169 __raw_spin_unlock(lock);
170} 170}
171EXPORT_SYMBOL(_spin_unlock); 171EXPORT_SYMBOL(_raw_spin_unlock);
172#endif 172#endif
173 173
174#ifndef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE 174#ifndef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE
175void __lockfunc _spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags) 175void __lockfunc _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
176{ 176{
177 __spin_unlock_irqrestore(lock, flags); 177 __raw_spin_unlock_irqrestore(lock, flags);
178} 178}
179EXPORT_SYMBOL(_spin_unlock_irqrestore); 179EXPORT_SYMBOL(_raw_spin_unlock_irqrestore);
180#endif 180#endif
181 181
182#ifndef CONFIG_INLINE_SPIN_UNLOCK_IRQ 182#ifndef CONFIG_INLINE_SPIN_UNLOCK_IRQ
183void __lockfunc _spin_unlock_irq(raw_spinlock_t *lock) 183void __lockfunc _raw_spin_unlock_irq(raw_spinlock_t *lock)
184{ 184{
185 __spin_unlock_irq(lock); 185 __raw_spin_unlock_irq(lock);
186} 186}
187EXPORT_SYMBOL(_spin_unlock_irq); 187EXPORT_SYMBOL(_raw_spin_unlock_irq);
188#endif 188#endif
189 189
190#ifndef CONFIG_INLINE_SPIN_UNLOCK_BH 190#ifndef CONFIG_INLINE_SPIN_UNLOCK_BH
191void __lockfunc _spin_unlock_bh(raw_spinlock_t *lock) 191void __lockfunc _raw_spin_unlock_bh(raw_spinlock_t *lock)
192{ 192{
193 __spin_unlock_bh(lock); 193 __raw_spin_unlock_bh(lock);
194} 194}
195EXPORT_SYMBOL(_spin_unlock_bh); 195EXPORT_SYMBOL(_raw_spin_unlock_bh);
196#endif 196#endif
197 197
198#ifndef CONFIG_INLINE_READ_TRYLOCK 198#ifndef CONFIG_INLINE_READ_TRYLOCK
199int __lockfunc _read_trylock(rwlock_t *lock) 199int __lockfunc _raw_read_trylock(rwlock_t *lock)
200{ 200{
201 return __read_trylock(lock); 201 return __raw_read_trylock(lock);
202} 202}
203EXPORT_SYMBOL(_read_trylock); 203EXPORT_SYMBOL(_raw_read_trylock);
204#endif 204#endif
205 205
206#ifndef CONFIG_INLINE_READ_LOCK 206#ifndef CONFIG_INLINE_READ_LOCK
207void __lockfunc _read_lock(rwlock_t *lock) 207void __lockfunc _raw_read_lock(rwlock_t *lock)
208{ 208{
209 __read_lock(lock); 209 __raw_read_lock(lock);
210} 210}
211EXPORT_SYMBOL(_read_lock); 211EXPORT_SYMBOL(_raw_read_lock);
212#endif 212#endif
213 213
214#ifndef CONFIG_INLINE_READ_LOCK_IRQSAVE 214#ifndef CONFIG_INLINE_READ_LOCK_IRQSAVE
215unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) 215unsigned long __lockfunc _raw_read_lock_irqsave(rwlock_t *lock)
216{ 216{
217 return __read_lock_irqsave(lock); 217 return __raw_read_lock_irqsave(lock);
218} 218}
219EXPORT_SYMBOL(_read_lock_irqsave); 219EXPORT_SYMBOL(_raw_read_lock_irqsave);
220#endif 220#endif
221 221
222#ifndef CONFIG_INLINE_READ_LOCK_IRQ 222#ifndef CONFIG_INLINE_READ_LOCK_IRQ
223void __lockfunc _read_lock_irq(rwlock_t *lock) 223void __lockfunc _raw_read_lock_irq(rwlock_t *lock)
224{ 224{
225 __read_lock_irq(lock); 225 __raw_read_lock_irq(lock);
226} 226}
227EXPORT_SYMBOL(_read_lock_irq); 227EXPORT_SYMBOL(_raw_read_lock_irq);
228#endif 228#endif
229 229
230#ifndef CONFIG_INLINE_READ_LOCK_BH 230#ifndef CONFIG_INLINE_READ_LOCK_BH
231void __lockfunc _read_lock_bh(rwlock_t *lock) 231void __lockfunc _raw_read_lock_bh(rwlock_t *lock)
232{ 232{
233 __read_lock_bh(lock); 233 __raw_read_lock_bh(lock);
234} 234}
235EXPORT_SYMBOL(_read_lock_bh); 235EXPORT_SYMBOL(_raw_read_lock_bh);
236#endif 236#endif
237 237
238#ifndef CONFIG_INLINE_READ_UNLOCK 238#ifndef CONFIG_INLINE_READ_UNLOCK
239void __lockfunc _read_unlock(rwlock_t *lock) 239void __lockfunc _raw_read_unlock(rwlock_t *lock)
240{ 240{
241 __read_unlock(lock); 241 __raw_read_unlock(lock);
242} 242}
243EXPORT_SYMBOL(_read_unlock); 243EXPORT_SYMBOL(_raw_read_unlock);
244#endif 244#endif
245 245
246#ifndef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE 246#ifndef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE
247void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) 247void __lockfunc _raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
248{ 248{
249 __read_unlock_irqrestore(lock, flags); 249 __raw_read_unlock_irqrestore(lock, flags);
250} 250}
251EXPORT_SYMBOL(_read_unlock_irqrestore); 251EXPORT_SYMBOL(_raw_read_unlock_irqrestore);
252#endif 252#endif
253 253
254#ifndef CONFIG_INLINE_READ_UNLOCK_IRQ 254#ifndef CONFIG_INLINE_READ_UNLOCK_IRQ
255void __lockfunc _read_unlock_irq(rwlock_t *lock) 255void __lockfunc _raw_read_unlock_irq(rwlock_t *lock)
256{ 256{
257 __read_unlock_irq(lock); 257 __raw_read_unlock_irq(lock);
258} 258}
259EXPORT_SYMBOL(_read_unlock_irq); 259EXPORT_SYMBOL(_raw_read_unlock_irq);
260#endif 260#endif
261 261
262#ifndef CONFIG_INLINE_READ_UNLOCK_BH 262#ifndef CONFIG_INLINE_READ_UNLOCK_BH
263void __lockfunc _read_unlock_bh(rwlock_t *lock) 263void __lockfunc _raw_read_unlock_bh(rwlock_t *lock)
264{ 264{
265 __read_unlock_bh(lock); 265 __raw_read_unlock_bh(lock);
266} 266}
267EXPORT_SYMBOL(_read_unlock_bh); 267EXPORT_SYMBOL(_raw_read_unlock_bh);
268#endif 268#endif
269 269
270#ifndef CONFIG_INLINE_WRITE_TRYLOCK 270#ifndef CONFIG_INLINE_WRITE_TRYLOCK
271int __lockfunc _write_trylock(rwlock_t *lock) 271int __lockfunc _raw_write_trylock(rwlock_t *lock)
272{ 272{
273 return __write_trylock(lock); 273 return __raw_write_trylock(lock);
274} 274}
275EXPORT_SYMBOL(_write_trylock); 275EXPORT_SYMBOL(_raw_write_trylock);
276#endif 276#endif
277 277
278#ifndef CONFIG_INLINE_WRITE_LOCK 278#ifndef CONFIG_INLINE_WRITE_LOCK
279void __lockfunc _write_lock(rwlock_t *lock) 279void __lockfunc _raw_write_lock(rwlock_t *lock)
280{ 280{
281 __write_lock(lock); 281 __raw_write_lock(lock);
282} 282}
283EXPORT_SYMBOL(_write_lock); 283EXPORT_SYMBOL(_raw_write_lock);
284#endif 284#endif
285 285
286#ifndef CONFIG_INLINE_WRITE_LOCK_IRQSAVE 286#ifndef CONFIG_INLINE_WRITE_LOCK_IRQSAVE
287unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) 287unsigned long __lockfunc _raw_write_lock_irqsave(rwlock_t *lock)
288{ 288{
289 return __write_lock_irqsave(lock); 289 return __raw_write_lock_irqsave(lock);
290} 290}
291EXPORT_SYMBOL(_write_lock_irqsave); 291EXPORT_SYMBOL(_raw_write_lock_irqsave);
292#endif 292#endif
293 293
294#ifndef CONFIG_INLINE_WRITE_LOCK_IRQ 294#ifndef CONFIG_INLINE_WRITE_LOCK_IRQ
295void __lockfunc _write_lock_irq(rwlock_t *lock) 295void __lockfunc _raw_write_lock_irq(rwlock_t *lock)
296{ 296{
297 __write_lock_irq(lock); 297 __raw_write_lock_irq(lock);
298} 298}
299EXPORT_SYMBOL(_write_lock_irq); 299EXPORT_SYMBOL(_raw_write_lock_irq);
300#endif 300#endif
301 301
302#ifndef CONFIG_INLINE_WRITE_LOCK_BH 302#ifndef CONFIG_INLINE_WRITE_LOCK_BH
303void __lockfunc _write_lock_bh(rwlock_t *lock) 303void __lockfunc _raw_write_lock_bh(rwlock_t *lock)
304{ 304{
305 __write_lock_bh(lock); 305 __raw_write_lock_bh(lock);
306} 306}
307EXPORT_SYMBOL(_write_lock_bh); 307EXPORT_SYMBOL(_raw_write_lock_bh);
308#endif 308#endif
309 309
310#ifndef CONFIG_INLINE_WRITE_UNLOCK 310#ifndef CONFIG_INLINE_WRITE_UNLOCK
311void __lockfunc _write_unlock(rwlock_t *lock) 311void __lockfunc _raw_write_unlock(rwlock_t *lock)
312{ 312{
313 __write_unlock(lock); 313 __raw_write_unlock(lock);
314} 314}
315EXPORT_SYMBOL(_write_unlock); 315EXPORT_SYMBOL(_raw_write_unlock);
316#endif 316#endif
317 317
318#ifndef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE 318#ifndef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE
319void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) 319void __lockfunc _raw_write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
320{ 320{
321 __write_unlock_irqrestore(lock, flags); 321 __raw_write_unlock_irqrestore(lock, flags);
322} 322}
323EXPORT_SYMBOL(_write_unlock_irqrestore); 323EXPORT_SYMBOL(_raw_write_unlock_irqrestore);
324#endif 324#endif
325 325
326#ifndef CONFIG_INLINE_WRITE_UNLOCK_IRQ 326#ifndef CONFIG_INLINE_WRITE_UNLOCK_IRQ
327void __lockfunc _write_unlock_irq(rwlock_t *lock) 327void __lockfunc _raw_write_unlock_irq(rwlock_t *lock)
328{ 328{
329 __write_unlock_irq(lock); 329 __raw_write_unlock_irq(lock);
330} 330}
331EXPORT_SYMBOL(_write_unlock_irq); 331EXPORT_SYMBOL(_raw_write_unlock_irq);
332#endif 332#endif
333 333
334#ifndef CONFIG_INLINE_WRITE_UNLOCK_BH 334#ifndef CONFIG_INLINE_WRITE_UNLOCK_BH
335void __lockfunc _write_unlock_bh(rwlock_t *lock) 335void __lockfunc _raw_write_unlock_bh(rwlock_t *lock)
336{ 336{
337 __write_unlock_bh(lock); 337 __raw_write_unlock_bh(lock);
338} 338}
339EXPORT_SYMBOL(_write_unlock_bh); 339EXPORT_SYMBOL(_raw_write_unlock_bh);
340#endif 340#endif
341 341
342#ifdef CONFIG_DEBUG_LOCK_ALLOC 342#ifdef CONFIG_DEBUG_LOCK_ALLOC
343 343
344void __lockfunc _spin_lock_nested(raw_spinlock_t *lock, int subclass) 344void __lockfunc _raw_spin_lock_nested(raw_spinlock_t *lock, int subclass)
345{ 345{
346 preempt_disable(); 346 preempt_disable();
347 spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); 347 spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
348 LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); 348 LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock);
349} 349}
350EXPORT_SYMBOL(_spin_lock_nested); 350EXPORT_SYMBOL(_raw_spin_lock_nested);
351 351
352unsigned long __lockfunc _spin_lock_irqsave_nested(raw_spinlock_t *lock, 352unsigned long __lockfunc _raw_spin_lock_irqsave_nested(raw_spinlock_t *lock,
353 int subclass) 353 int subclass)
354{ 354{
355 unsigned long flags; 355 unsigned long flags;
@@ -361,16 +361,16 @@ unsigned long __lockfunc _spin_lock_irqsave_nested(raw_spinlock_t *lock,
361 do_raw_spin_lock_flags, &flags); 361 do_raw_spin_lock_flags, &flags);
362 return flags; 362 return flags;
363} 363}
364EXPORT_SYMBOL(_spin_lock_irqsave_nested); 364EXPORT_SYMBOL(_raw_spin_lock_irqsave_nested);
365 365
366void __lockfunc _spin_lock_nest_lock(raw_spinlock_t *lock, 366void __lockfunc _raw_spin_lock_nest_lock(raw_spinlock_t *lock,
367 struct lockdep_map *nest_lock) 367 struct lockdep_map *nest_lock)
368{ 368{
369 preempt_disable(); 369 preempt_disable();
370 spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_); 370 spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_);
371 LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); 371 LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock);
372} 372}
373EXPORT_SYMBOL(_spin_lock_nest_lock); 373EXPORT_SYMBOL(_raw_spin_lock_nest_lock);
374 374
375#endif 375#endif
376 376