Nicolas Pitre | 823d0f4 | 2006-01-09 15:59:18 -0800 | [diff] [blame] | 1 | /* |
Russell King | 4baa992 | 2008-08-02 10:55:55 +0100 | [diff] [blame] | 2 | * arch/arm/include/asm/mutex.h |
Nicolas Pitre | 823d0f4 | 2006-01-09 15:59:18 -0800 | [diff] [blame] | 3 | * |
| 4 | * ARM optimized mutex locking primitives |
| 5 | * |
| 6 | * Please look into asm-generic/mutex-xchg.h for a formal definition. |
| 7 | */ |
| 8 | #ifndef _ASM_MUTEX_H |
| 9 | #define _ASM_MUTEX_H |
Nicolas Pitre | 823d0f4 | 2006-01-09 15:59:18 -0800 | [diff] [blame] | 10 | /* |
Will Deacon | a76d7bd | 2012-07-13 19:15:40 +0100 | [diff] [blame] | 11 | * On pre-ARMv6 hardware this results in a swp-based implementation, |
Will Deacon | 08928e7 | 2012-08-16 18:43:04 +0100 | [diff] [blame^] | 12 | * which is the most efficient. For ARMv6+, we have exclusive memory |
| 13 | * accessors and use atomic_dec to avoid the extra xchg operations |
| 14 | * on the locking slowpaths. |
Nicolas Pitre | 823d0f4 | 2006-01-09 15:59:18 -0800 | [diff] [blame] | 15 | */ |
Will Deacon | 08928e7 | 2012-08-16 18:43:04 +0100 | [diff] [blame^] | 16 | #if __LINUX_ARM_ARCH__ < 6 |
Will Deacon | a76d7bd | 2012-07-13 19:15:40 +0100 | [diff] [blame] | 17 | #include <asm-generic/mutex-xchg.h> |
Will Deacon | 08928e7 | 2012-08-16 18:43:04 +0100 | [diff] [blame^] | 18 | #else |
| 19 | #include <asm-generic/mutex-dec.h> |
Nicolas Pitre | 823d0f4 | 2006-01-09 15:59:18 -0800 | [diff] [blame] | 20 | #endif |
Will Deacon | 08928e7 | 2012-08-16 18:43:04 +0100 | [diff] [blame^] | 21 | #endif /* _ASM_MUTEX_H */ |