ARM: consolidate last remaining open-coded alignment trap enable
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 13 Apr 2014 19:24:51 +0000 (20:24 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 2 Jun 2014 08:20:20 +0000 (09:20 +0100)
We can use the alignment_trap assembly macro here too.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/entry-armv.S
arch/arm/kernel/entry-common.S
arch/arm/kernel/entry-header.S

index cac5b88216e68464a2bc41e83be8bd0255b83e8e..cb6fa30c22a749f888412a67cf5527ed9d7648b1 100644 (file)
@@ -344,7 +344,7 @@ ENDPROC(__pabt_svc)
        @
        @ Enable the alignment trap while in kernel mode
        @
-       alignment_trap r0
+       alignment_trap r0, .LCcralign
 
        @
        @ Clear FP to mark the first stack frame
index a2dcafdf1bc89a176f80dda748625a615717979a..7139d4a7dea7d5ad3628084f8732a08a5a9bfeb4 100644 (file)
@@ -365,13 +365,7 @@ ENTRY(vector_swi)
        str     r0, [sp, #S_OLD_R0]             @ Save OLD_R0
 #endif
        zero_fp
-
-#ifdef CONFIG_ALIGNMENT_TRAP
-       ldr     ip, __cr_alignment
-       ldr     ip, [ip]
-       mcr     p15, 0, ip, c1, c0              @ update control register
-#endif
-
+       alignment_trap ip, __cr_alignment
        enable_irq
        ct_user_exit
        get_thread_info tsk
index 1420725142cab1817d26bc3ff7003ae4a4833732..45a1df9bf7592e267a7fea827fbbb676a32a2c1e 100644 (file)
@@ -37,9 +37,9 @@
 #endif
        .endm
 
-       .macro  alignment_trap, rtemp
+       .macro  alignment_trap, rtemp, label
 #ifdef CONFIG_ALIGNMENT_TRAP
-       ldr     \rtemp, .LCcralign
+       ldr     \rtemp, \label
        ldr     \rtemp, [\rtemp]
        mcr     p15, 0, \rtemp, c1, c0
 #endif