2006-01-10 07:59:18 +08:00
|
|
|
/*
|
2008-08-02 17:55:55 +08:00
|
|
|
* arch/arm/include/asm/mutex.h
|
2006-01-10 07:59:18 +08:00
|
|
|
*
|
|
|
|
* ARM optimized mutex locking primitives
|
|
|
|
*
|
|
|
|
* Please look into asm-generic/mutex-xchg.h for a formal definition.
|
|
|
|
*/
|
|
|
|
#ifndef _ASM_MUTEX_H
|
|
|
|
#define _ASM_MUTEX_H
|
|
|
|
/*
|
2012-07-14 02:15:40 +08:00
|
|
|
* On pre-ARMv6 hardware this results in a swp-based implementation,
|
2012-08-17 01:43:04 +08:00
|
|
|
* which is the most efficient. For ARMv6+, we have exclusive memory
|
|
|
|
* accessors and use atomic_dec to avoid the extra xchg operations
|
|
|
|
* on the locking slowpaths.
|
2006-01-10 07:59:18 +08:00
|
|
|
*/
|
2012-08-17 01:43:04 +08:00
|
|
|
#if __LINUX_ARM_ARCH__ < 6
|
2012-07-14 02:15:40 +08:00
|
|
|
#include <asm-generic/mutex-xchg.h>
|
2012-08-17 01:43:04 +08:00
|
|
|
#else
|
|
|
|
#include <asm-generic/mutex-dec.h>
|
2006-01-10 07:59:18 +08:00
|
|
|
#endif
|
2012-08-17 01:43:04 +08:00
|
|
|
#endif /* _ASM_MUTEX_H */
|