Commit c2a4c406 authored by Catalin Marinas's avatar Catalin Marinas Committed by Russell King

[ARM] 3533/1: Implement the __raw_(read|write)_can_lock functions on ARM

Patch from Catalin Marinas

Recent patches introduced the write_can_lock() call in the kernel/ptrace.c
file. Implement the __raw_* variants on ARM (SMP) as well.
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent ec64152f
...@@ -142,6 +142,9 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) ...@@ -142,6 +142,9 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
: "cc"); : "cc");
} }
/* write_can_lock - would write_trylock() succeed? */
#define __raw_write_can_lock(x) ((x)->lock == 0x80000000)
/* /*
* Read locks are a bit more hairy: * Read locks are a bit more hairy:
* - Exclusively load the lock value. * - Exclusively load the lock value.
...@@ -198,4 +201,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw) ...@@ -198,4 +201,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw)
#define __raw_read_trylock(lock) generic__raw_read_trylock(lock) #define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
/* read_can_lock - would read_trylock() succeed? */
#define __raw_read_can_lock(x) ((x)->lock < 0x80000000)
#endif /* __ASM_SPINLOCK_H */ #endif /* __ASM_SPINLOCK_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment