diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-12 19:48:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-12 19:48:29 -0500 |
commit | 0e670506668a43e1355b8f10c33d081a676bd521 (patch) | |
tree | 236d238cc234da1e6d375b5c2864cbac836fd71f /include/asm-ia64/spinlock.h | |
parent | 238523e1a15874b88955ff9c8f63e35597ae2857 (diff) | |
parent | bf7ececa9b68f4720f1ce344f442435660bcdae7 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Diffstat (limited to 'include/asm-ia64/spinlock.h')
-rw-r--r-- | include/asm-ia64/spinlock.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h index 5b78611411c3..0c91a76c5ea3 100644 --- a/include/asm-ia64/spinlock.h +++ b/include/asm-ia64/spinlock.h | |||
@@ -201,6 +201,16 @@ static inline void __raw_write_unlock(raw_rwlock_t *x) | |||
201 | 201 | ||
202 | #endif /* !ASM_SUPPORTED */ | 202 | #endif /* !ASM_SUPPORTED */ |
203 | 203 | ||
204 | #define __raw_read_trylock(lock) generic__raw_read_trylock(lock) | 204 | static inline int __raw_read_trylock(raw_rwlock_t *x) |
205 | { | ||
206 | union { | ||
207 | raw_rwlock_t lock; | ||
208 | __u32 word; | ||
209 | } old, new; | ||
210 | old.lock = new.lock = *x; | ||
211 | old.lock.write_lock = new.lock.write_lock = 0; | ||
212 | ++new.lock.read_counter; | ||
213 | return (u32)ia64_cmpxchg4_acq((__u32 *)(x), new.word, old.word) == old.word; | ||
214 | } | ||
205 | 215 | ||
206 | #endif /* _ASM_IA64_SPINLOCK_H */ | 216 | #endif /* _ASM_IA64_SPINLOCK_H */ |