ARM: 8017/1: Move asm macro get_thread_info to asm/assembler.h
authorCatalin Marinas <catalin.marinas@arm.com>
Wed, 2 Apr 2014 09:57:48 +0000 (10:57 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 9 Apr 2014 12:08:07 +0000 (13:08 +0100)
asm/assembler.h is a better place for this macro since it is used by
asm files outside arch/arm/kernel/

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Arun KS <getarunks@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/assembler.h
arch/arm/kernel/entry-header.S
arch/arm/vfp/entry.S
arch/arm/vfp/vfphw.S

index 380ac4f20000c8c33d1744da3898d71e3f4b7c68..9a4965ad6867d52bd191cb03aa593ee15a40752a 100644 (file)
        restore_irqs_notrace \oldcpsr
        .endm
 
+/*
+ * Get current thread_info.
+ */
+       .macro  get_thread_info, rd
+ ARM(  mov     \rd, sp, lsr #13        )
+ THUMB(        mov     \rd, sp                 )
+ THUMB(        lsr     \rd, \rd, #13           )
+       mov     \rd, \rd, lsl #13
+       .endm
+
 #define USER(x...)                             \
 9999:  x;                                      \
        .pushsection __ex_table,"a";            \
index 39f89fbd5111ee9f0a96d6712e1f0f2ba308147d..1420725142cab1817d26bc3ff7003ae4a4833732 100644 (file)
        movs    pc, lr                          @ return & move spsr_svc into cpsr
        .endm
 
-       .macro  get_thread_info, rd
-       mov     \rd, sp, lsr #13
-       mov     \rd, \rd, lsl #13
-       .endm
-
        @
        @ 32-bit wide "mov pc, reg"
        @
        .endm
 #endif /* ifdef CONFIG_CPU_V7M / else */
 
-       .macro  get_thread_info, rd
-       mov     \rd, sp
-       lsr     \rd, \rd, #13
-       mov     \rd, \rd, lsl #13
-       .endm
-
        @
        @ 32-bit wide "mov pc, reg"
        @
index 46e17492fd1f3ecccda92c660474c805707b788b..9cc290ae4e3be2e13e2a61005b2bfc8230f71333 100644 (file)
@@ -8,9 +8,12 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/init.h>
+#include <linux/linkage.h>
 #include <asm/thread_info.h>
 #include <asm/vfpmacros.h>
-#include "../kernel/entry-header.S"
+#include <asm/assembler.h>
+#include <asm/asm-offsets.h>
 
 @ VFP entry point.
 @
index 3e5d3115a2a6847ee41fc3d6d23ffde8fa0a7917..98f6246c90025ba060b1374a740b75c7bbdd9326 100644 (file)
  * r10 points at the start of the private FP workspace in the thread structure
  * sp points to a struct pt_regs (as defined in include/asm/proc/ptrace.h)
  */
+#include <linux/init.h>
+#include <linux/linkage.h>
 #include <asm/thread_info.h>
 #include <asm/vfpmacros.h>
 #include <linux/kern_levels.h>
-#include "../kernel/entry-header.S"
+#include <asm/assembler.h>
+#include <asm/asm-offsets.h>
 
        .macro  DBGSTR, str
 #ifdef DEBUG