diff options
Diffstat (limited to 'include/linux/spinlock_api_up.h')
-rw-r--r-- | include/linux/spinlock_api_up.h | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/include/linux/spinlock_api_up.h b/include/linux/spinlock_api_up.h index 04e1d3164576..af1f47229e70 100644 --- a/include/linux/spinlock_api_up.h +++ b/include/linux/spinlock_api_up.h | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | #define in_lock_functions(ADDR) 0 | 17 | #define in_lock_functions(ADDR) 0 |
18 | 18 | ||
19 | #define assert_spin_locked(lock) do { (void)(lock); } while (0) | 19 | #define assert_raw_spin_locked(lock) do { (void)(lock); } while (0) |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * In the UP-nondebug case there's no real locking going on, so the | 22 | * In the UP-nondebug case there's no real locking going on, so the |
@@ -40,7 +40,8 @@ | |||
40 | do { preempt_enable(); __release(lock); (void)(lock); } while (0) | 40 | do { preempt_enable(); __release(lock); (void)(lock); } while (0) |
41 | 41 | ||
42 | #define __UNLOCK_BH(lock) \ | 42 | #define __UNLOCK_BH(lock) \ |
43 | do { preempt_enable_no_resched(); local_bh_enable(); __release(lock); (void)(lock); } while (0) | 43 | do { preempt_enable_no_resched(); local_bh_enable(); \ |
44 | __release(lock); (void)(lock); } while (0) | ||
44 | 45 | ||
45 | #define __UNLOCK_IRQ(lock) \ | 46 | #define __UNLOCK_IRQ(lock) \ |
46 | do { local_irq_enable(); __UNLOCK(lock); } while (0) | 47 | do { local_irq_enable(); __UNLOCK(lock); } while (0) |
@@ -48,34 +49,37 @@ | |||
48 | #define __UNLOCK_IRQRESTORE(lock, flags) \ | 49 | #define __UNLOCK_IRQRESTORE(lock, flags) \ |
49 | do { local_irq_restore(flags); __UNLOCK(lock); } while (0) | 50 | do { local_irq_restore(flags); __UNLOCK(lock); } while (0) |
50 | 51 | ||
51 | #define _spin_lock(lock) __LOCK(lock) | 52 | #define _raw_spin_lock(lock) __LOCK(lock) |
52 | #define _spin_lock_nested(lock, subclass) __LOCK(lock) | 53 | #define _raw_spin_lock_nested(lock, subclass) __LOCK(lock) |
53 | #define _read_lock(lock) __LOCK(lock) | 54 | #define _raw_read_lock(lock) __LOCK(lock) |
54 | #define _write_lock(lock) __LOCK(lock) | 55 | #define _raw_write_lock(lock) __LOCK(lock) |
55 | #define _spin_lock_bh(lock) __LOCK_BH(lock) | 56 | #define _raw_spin_lock_bh(lock) __LOCK_BH(lock) |
56 | #define _read_lock_bh(lock) __LOCK_BH(lock) | 57 | #define _raw_read_lock_bh(lock) __LOCK_BH(lock) |
57 | #define _write_lock_bh(lock) __LOCK_BH(lock) | 58 | #define _raw_write_lock_bh(lock) __LOCK_BH(lock) |
58 | #define _spin_lock_irq(lock) __LOCK_IRQ(lock) | 59 | #define _raw_spin_lock_irq(lock) __LOCK_IRQ(lock) |
59 | #define _read_lock_irq(lock) __LOCK_IRQ(lock) | 60 | #define _raw_read_lock_irq(lock) __LOCK_IRQ(lock) |
60 | #define _write_lock_irq(lock) __LOCK_IRQ(lock) | 61 | #define _raw_write_lock_irq(lock) __LOCK_IRQ(lock) |
61 | #define _spin_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) | 62 | #define _raw_spin_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) |
62 | #define _read_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) | 63 | #define _raw_read_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) |
63 | #define _write_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) | 64 | #define _raw_write_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags) |
64 | #define _spin_trylock(lock) ({ __LOCK(lock); 1; }) | 65 | #define _raw_spin_trylock(lock) ({ __LOCK(lock); 1; }) |
65 | #define _read_trylock(lock) ({ __LOCK(lock); 1; }) | 66 | #define _raw_read_trylock(lock) ({ __LOCK(lock); 1; }) |
66 | #define _write_trylock(lock) ({ __LOCK(lock); 1; }) | 67 | #define _raw_write_trylock(lock) ({ __LOCK(lock); 1; }) |
67 | #define _spin_trylock_bh(lock) ({ __LOCK_BH(lock); 1; }) | 68 | #define _raw_spin_trylock_bh(lock) ({ __LOCK_BH(lock); 1; }) |
68 | #define _spin_unlock(lock) __UNLOCK(lock) | 69 | #define _raw_spin_unlock(lock) __UNLOCK(lock) |
69 | #define _read_unlock(lock) __UNLOCK(lock) | 70 | #define _raw_read_unlock(lock) __UNLOCK(lock) |
70 | #define _write_unlock(lock) __UNLOCK(lock) | 71 | #define _raw_write_unlock(lock) __UNLOCK(lock) |
71 | #define _spin_unlock_bh(lock) __UNLOCK_BH(lock) | 72 | #define _raw_spin_unlock_bh(lock) __UNLOCK_BH(lock) |
72 | #define _write_unlock_bh(lock) __UNLOCK_BH(lock) | 73 | #define _raw_write_unlock_bh(lock) __UNLOCK_BH(lock) |
73 | #define _read_unlock_bh(lock) __UNLOCK_BH(lock) | 74 | #define _raw_read_unlock_bh(lock) __UNLOCK_BH(lock) |
74 | #define _spin_unlock_irq(lock) __UNLOCK_IRQ(lock) | 75 | #define _raw_spin_unlock_irq(lock) __UNLOCK_IRQ(lock) |
75 | #define _read_unlock_irq(lock) __UNLOCK_IRQ(lock) | 76 | #define _raw_read_unlock_irq(lock) __UNLOCK_IRQ(lock) |
76 | #define _write_unlock_irq(lock) __UNLOCK_IRQ(lock) | 77 | #define _raw_write_unlock_irq(lock) __UNLOCK_IRQ(lock) |
77 | #define _spin_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) | 78 | #define _raw_spin_unlock_irqrestore(lock, flags) \ |
78 | #define _read_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) | 79 | __UNLOCK_IRQRESTORE(lock, flags) |
79 | #define _write_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags) | 80 | #define _raw_read_unlock_irqrestore(lock, flags) \ |
81 | __UNLOCK_IRQRESTORE(lock, flags) | ||
82 | #define _raw_write_unlock_irqrestore(lock, flags) \ | ||
83 | __UNLOCK_IRQRESTORE(lock, flags) | ||
80 | 84 | ||
81 | #endif /* __LINUX_SPINLOCK_API_UP_H */ | 85 | #endif /* __LINUX_SPINLOCK_API_UP_H */ |