Skip to content

Commit

Permalink
[ARM] 3533/1: Implement the __raw_(read|write)_can_lock functions on ARM
Browse files Browse the repository at this point in the history
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: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
ctmarinas authored and Russell King committed May 19, 2006
1 parent ec64152 commit c2a4c40
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/asm-arm/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
: "cc");
}

/* write_can_lock - would write_trylock() succeed? */
#define __raw_write_can_lock(x) ((x)->lock == 0x80000000)

/*
* Read locks are a bit more hairy:
* - Exclusively load the lock value.
Expand Down Expand Up @@ -198,4 +201,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw)

#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 */

0 comments on commit c2a4c40

Please sign in to comment.