diff options
Diffstat (limited to 'include/linux/spinlock.h')
-rw-r--r-- | include/linux/spinlock.h | 46 |
1 files changed, 6 insertions, 40 deletions
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index da76a06556bd..f0ca7a7a1757 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -259,50 +259,16 @@ static inline void smp_mb__after_lock(void) { smp_mb(); } | |||
259 | 259 | ||
260 | #define spin_lock_irq(lock) _spin_lock_irq(lock) | 260 | #define spin_lock_irq(lock) _spin_lock_irq(lock) |
261 | #define spin_lock_bh(lock) _spin_lock_bh(lock) | 261 | #define spin_lock_bh(lock) _spin_lock_bh(lock) |
262 | |||
263 | #define read_lock_irq(lock) _read_lock_irq(lock) | 262 | #define read_lock_irq(lock) _read_lock_irq(lock) |
264 | #define read_lock_bh(lock) _read_lock_bh(lock) | 263 | #define read_lock_bh(lock) _read_lock_bh(lock) |
265 | |||
266 | #define write_lock_irq(lock) _write_lock_irq(lock) | 264 | #define write_lock_irq(lock) _write_lock_irq(lock) |
267 | #define write_lock_bh(lock) _write_lock_bh(lock) | 265 | #define write_lock_bh(lock) _write_lock_bh(lock) |
268 | 266 | #define spin_unlock(lock) _spin_unlock(lock) | |
269 | /* | 267 | #define read_unlock(lock) _read_unlock(lock) |
270 | * We inline the unlock functions in the nondebug case: | 268 | #define write_unlock(lock) _write_unlock(lock) |
271 | */ | 269 | #define spin_unlock_irq(lock) _spin_unlock_irq(lock) |
272 | #if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || \ | 270 | #define read_unlock_irq(lock) _read_unlock_irq(lock) |
273 | !defined(CONFIG_SMP) | 271 | #define write_unlock_irq(lock) _write_unlock_irq(lock) |
274 | # define spin_unlock(lock) _spin_unlock(lock) | ||
275 | # define read_unlock(lock) _read_unlock(lock) | ||
276 | # define write_unlock(lock) _write_unlock(lock) | ||
277 | # define spin_unlock_irq(lock) _spin_unlock_irq(lock) | ||
278 | # define read_unlock_irq(lock) _read_unlock_irq(lock) | ||
279 | # define write_unlock_irq(lock) _write_unlock_irq(lock) | ||
280 | #else | ||
281 | # define spin_unlock(lock) \ | ||
282 | do {__raw_spin_unlock(&(lock)->raw_lock); __release(lock); } while (0) | ||
283 | # define read_unlock(lock) \ | ||
284 | do {__raw_read_unlock(&(lock)->raw_lock); __release(lock); } while (0) | ||
285 | # define write_unlock(lock) \ | ||
286 | do {__raw_write_unlock(&(lock)->raw_lock); __release(lock); } while (0) | ||
287 | # define spin_unlock_irq(lock) \ | ||
288 | do { \ | ||
289 | __raw_spin_unlock(&(lock)->raw_lock); \ | ||
290 | __release(lock); \ | ||
291 | local_irq_enable(); \ | ||
292 | } while (0) | ||
293 | # define read_unlock_irq(lock) \ | ||
294 | do { \ | ||
295 | __raw_read_unlock(&(lock)->raw_lock); \ | ||
296 | __release(lock); \ | ||
297 | local_irq_enable(); \ | ||
298 | } while (0) | ||
299 | # define write_unlock_irq(lock) \ | ||
300 | do { \ | ||
301 | __raw_write_unlock(&(lock)->raw_lock); \ | ||
302 | __release(lock); \ | ||
303 | local_irq_enable(); \ | ||
304 | } while (0) | ||
305 | #endif | ||
306 | 272 | ||
307 | #define spin_unlock_irqrestore(lock, flags) \ | 273 | #define spin_unlock_irqrestore(lock, flags) \ |
308 | do { \ | 274 | do { \ |