blob: 87c044910fe0a2274cc7198cdcbe00ca76d05795 [file] [log] [blame]
Nicolas Pitre823d0f42006-01-09 15:59:18 -08001/*
Russell King4baa9922008-08-02 10:55:55 +01002 * arch/arm/include/asm/mutex.h
Nicolas Pitre823d0f42006-01-09 15:59:18 -08003 *
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 Pitre823d0f42006-01-09 15:59:18 -080010/*
Will Deacona76d7bd2012-07-13 19:15:40 +010011 * On pre-ARMv6 hardware this results in a swp-based implementation,
Will Deacon08928e72012-08-16 18:43:04 +010012 * 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 Pitre823d0f42006-01-09 15:59:18 -080015 */
Will Deacon08928e72012-08-16 18:43:04 +010016#if __LINUX_ARM_ARCH__ < 6
Will Deacona76d7bd2012-07-13 19:15:40 +010017#include <asm-generic/mutex-xchg.h>
Will Deacon08928e72012-08-16 18:43:04 +010018#else
19#include <asm-generic/mutex-dec.h>
Nicolas Pitre823d0f42006-01-09 15:59:18 -080020#endif
Will Deacon08928e72012-08-16 18:43:04 +010021#endif /* _ASM_MUTEX_H */