diff options
author | Robin Holt <holt@sgi.com> | 2009-04-02 19:59:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-02 22:05:11 -0400 |
commit | f5f7eac41db827a47b2163330eecd7bb55ae9f12 (patch) | |
tree | ae8ab45dba49c1b3d5f2088051389e6fd3e4a24c /include | |
parent | e8c158bb313c1df421eab7dc4299cd39cbbf5895 (diff) |
Allow rwlocks to re-enable interrupts
Pass the original flags to rwlock arch-code, so that it can re-enable
interrupts if implemented for that architecture.
Initially, make __raw_read_lock_flags and __raw_write_lock_flags stubs
which just do the same thing as non-flags variants.
Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Signed-off-by: Robin Holt <holt@sgi.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: <linux-arch@vger.kernel.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-m32r/spinlock.h | 3 | ||||
-rw-r--r-- | include/linux/spinlock.h | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-m32r/spinlock.h b/include/asm-m32r/spinlock.h index f5cfba81ee10..dded923883b2 100644 --- a/include/asm-m32r/spinlock.h +++ b/include/asm-m32r/spinlock.h | |||
@@ -316,6 +316,9 @@ static inline int __raw_write_trylock(raw_rwlock_t *lock) | |||
316 | return 0; | 316 | return 0; |
317 | } | 317 | } |
318 | 318 | ||
319 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | ||
320 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | ||
321 | |||
319 | #define _raw_spin_relax(lock) cpu_relax() | 322 | #define _raw_spin_relax(lock) cpu_relax() |
320 | #define _raw_read_relax(lock) cpu_relax() | 323 | #define _raw_read_relax(lock) cpu_relax() |
321 | #define _raw_write_relax(lock) cpu_relax() | 324 | #define _raw_write_relax(lock) cpu_relax() |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index a0c66a2e00ad..252b245cfcf4 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -153,9 +153,11 @@ do { \ | |||
153 | extern int _raw_spin_trylock(spinlock_t *lock); | 153 | extern int _raw_spin_trylock(spinlock_t *lock); |
154 | extern void _raw_spin_unlock(spinlock_t *lock); | 154 | extern void _raw_spin_unlock(spinlock_t *lock); |
155 | extern void _raw_read_lock(rwlock_t *lock); | 155 | extern void _raw_read_lock(rwlock_t *lock); |
156 | #define _raw_read_lock_flags(lock, flags) _raw_read_lock(lock) | ||
156 | extern int _raw_read_trylock(rwlock_t *lock); | 157 | extern int _raw_read_trylock(rwlock_t *lock); |
157 | extern void _raw_read_unlock(rwlock_t *lock); | 158 | extern void _raw_read_unlock(rwlock_t *lock); |
158 | extern void _raw_write_lock(rwlock_t *lock); | 159 | extern void _raw_write_lock(rwlock_t *lock); |
160 | #define _raw_write_lock_flags(lock, flags) _raw_write_lock(lock) | ||
159 | extern int _raw_write_trylock(rwlock_t *lock); | 161 | extern int _raw_write_trylock(rwlock_t *lock); |
160 | extern void _raw_write_unlock(rwlock_t *lock); | 162 | extern void _raw_write_unlock(rwlock_t *lock); |
161 | #else | 163 | #else |
@@ -165,9 +167,13 @@ do { \ | |||
165 | # define _raw_spin_trylock(lock) __raw_spin_trylock(&(lock)->raw_lock) | 167 | # define _raw_spin_trylock(lock) __raw_spin_trylock(&(lock)->raw_lock) |
166 | # define _raw_spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock) | 168 | # define _raw_spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock) |
167 | # define _raw_read_lock(rwlock) __raw_read_lock(&(rwlock)->raw_lock) | 169 | # define _raw_read_lock(rwlock) __raw_read_lock(&(rwlock)->raw_lock) |
170 | # define _raw_read_lock_flags(lock, flags) \ | ||
171 | __raw_read_lock_flags(&(lock)->raw_lock, *(flags)) | ||
168 | # define _raw_read_trylock(rwlock) __raw_read_trylock(&(rwlock)->raw_lock) | 172 | # define _raw_read_trylock(rwlock) __raw_read_trylock(&(rwlock)->raw_lock) |
169 | # define _raw_read_unlock(rwlock) __raw_read_unlock(&(rwlock)->raw_lock) | 173 | # define _raw_read_unlock(rwlock) __raw_read_unlock(&(rwlock)->raw_lock) |
170 | # define _raw_write_lock(rwlock) __raw_write_lock(&(rwlock)->raw_lock) | 174 | # define _raw_write_lock(rwlock) __raw_write_lock(&(rwlock)->raw_lock) |
175 | # define _raw_write_lock_flags(lock, flags) \ | ||
176 | __raw_write_lock_flags(&(lock)->raw_lock, *(flags)) | ||
171 | # define _raw_write_trylock(rwlock) __raw_write_trylock(&(rwlock)->raw_lock) | 177 | # define _raw_write_trylock(rwlock) __raw_write_trylock(&(rwlock)->raw_lock) |
172 | # define _raw_write_unlock(rwlock) __raw_write_unlock(&(rwlock)->raw_lock) | 178 | # define _raw_write_unlock(rwlock) __raw_write_unlock(&(rwlock)->raw_lock) |
173 | #endif | 179 | #endif |