summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/swp_emulate.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-07-04 15:49:05 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-07-18 13:29:49 +0200
commit7397aa48fff47c2386867a3fbfce8f3e664843a9 (patch)
treeedbbcea793a361542cb1be9ec2b15bb15b87862c /arch/arm/kernel/swp_emulate.c
parentARM: SWP emulation: always enable when SMP is enabled (diff)
downloadlinux-7397aa48fff47c2386867a3fbfce8f3e664843a9.tar.xz
linux-7397aa48fff47c2386867a3fbfce8f3e664843a9.zip
ARM: SWP emulation: only initialise on ARMv7 CPUs
Previous CPUs do not have the ability to trap SWP instructions, so it's pointless initialising this code there. Tested-by: Tony Lindgren <tony@atomide.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/swp_emulate.c')
-rw-r--r--arch/arm/kernel/swp_emulate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c
index b1b89882b113..67ca8578c6d8 100644
--- a/arch/arm/kernel/swp_emulate.c
+++ b/arch/arm/kernel/swp_emulate.c
@@ -27,6 +27,7 @@
#include <linux/perf_event.h>
#include <asm/opcodes.h>
+#include <asm/system_info.h>
#include <asm/traps.h>
#include <asm/uaccess.h>
@@ -266,6 +267,9 @@ static struct undef_hook swp_hook = {
*/
static int __init swp_emulation_init(void)
{
+ if (cpu_architecture() < CPU_ARCH_ARMv7)
+ return 0;
+
#ifdef CONFIG_PROC_FS
if (!proc_create("cpu/swp_emulation", S_IRUGO, NULL, &proc_status_fops))
return -ENOMEM;