diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-08-05 17:04:01 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-08-05 17:04:01 -0300 |
commit | 57f0f512b273f60d52568b8c6b77e17f5636edc0 (patch) | |
tree | 5e910f0e82173f4ef4f51111366a3f1299037a7b /arch/arm/include/asm/mutex.h |
Initial import
Diffstat (limited to 'arch/arm/include/asm/mutex.h')
-rw-r--r-- | arch/arm/include/asm/mutex.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/include/asm/mutex.h b/arch/arm/include/asm/mutex.h new file mode 100644 index 000000000..87c044910 --- /dev/null +++ b/arch/arm/include/asm/mutex.h @@ -0,0 +1,21 @@ +/* + * arch/arm/include/asm/mutex.h + * + * 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 +/* + * On pre-ARMv6 hardware this results in a swp-based implementation, + * 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. + */ +#if __LINUX_ARM_ARCH__ < 6 +#include <asm-generic/mutex-xchg.h> +#else +#include <asm-generic/mutex-dec.h> +#endif +#endif /* _ASM_MUTEX_H */ |