diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2014-04-02 05:57:48 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-04-09 08:08:07 -0400 |
commit | 39ad04ccd6e1b235601e9ac5a7f508d05728a97a (patch) | |
tree | d50dbff0e4d813aaf3ee0199e2ec853422145ba3 /arch/arm | |
parent | a5d4506d070adb785459bf142ef707d7c5fe3b84 (diff) |
ARM: 8017/1: Move asm macro get_thread_info to asm/assembler.h
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/assembler.h | 10 | ||||
-rw-r--r-- | arch/arm/kernel/entry-header.S | 11 | ||||
-rw-r--r-- | arch/arm/vfp/entry.S | 5 | ||||
-rw-r--r-- | arch/arm/vfp/vfphw.S | 5 |
4 files changed, 18 insertions, 13 deletions
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 380ac4f20000..9a4965ad6867 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h | |||
@@ -174,6 +174,16 @@ | |||
174 | restore_irqs_notrace \oldcpsr | 174 | restore_irqs_notrace \oldcpsr |
175 | .endm | 175 | .endm |
176 | 176 | ||
177 | /* | ||
178 | * Get current thread_info. | ||
179 | */ | ||
180 | .macro get_thread_info, rd | ||
181 | ARM( mov \rd, sp, lsr #13 ) | ||
182 | THUMB( mov \rd, sp ) | ||
183 | THUMB( lsr \rd, \rd, #13 ) | ||
184 | mov \rd, \rd, lsl #13 | ||
185 | .endm | ||
186 | |||
177 | #define USER(x...) \ | 187 | #define USER(x...) \ |
178 | 9999: x; \ | 188 | 9999: x; \ |
179 | .pushsection __ex_table,"a"; \ | 189 | .pushsection __ex_table,"a"; \ |
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index 39f89fbd5111..1420725142ca 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -236,11 +236,6 @@ | |||
236 | movs pc, lr @ return & move spsr_svc into cpsr | 236 | movs pc, lr @ return & move spsr_svc into cpsr |
237 | .endm | 237 | .endm |
238 | 238 | ||
239 | .macro get_thread_info, rd | ||
240 | mov \rd, sp, lsr #13 | ||
241 | mov \rd, \rd, lsl #13 | ||
242 | .endm | ||
243 | |||
244 | @ | 239 | @ |
245 | @ 32-bit wide "mov pc, reg" | 240 | @ 32-bit wide "mov pc, reg" |
246 | @ | 241 | @ |
@@ -306,12 +301,6 @@ | |||
306 | .endm | 301 | .endm |
307 | #endif /* ifdef CONFIG_CPU_V7M / else */ | 302 | #endif /* ifdef CONFIG_CPU_V7M / else */ |
308 | 303 | ||
309 | .macro get_thread_info, rd | ||
310 | mov \rd, sp | ||
311 | lsr \rd, \rd, #13 | ||
312 | mov \rd, \rd, lsl #13 | ||
313 | .endm | ||
314 | |||
315 | @ | 304 | @ |
316 | @ 32-bit wide "mov pc, reg" | 305 | @ 32-bit wide "mov pc, reg" |
317 | @ | 306 | @ |
diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S index 46e17492fd1f..9cc290ae4e3b 100644 --- a/arch/arm/vfp/entry.S +++ b/arch/arm/vfp/entry.S | |||
@@ -8,9 +8,12 @@ | |||
8 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | #include <linux/init.h> | ||
12 | #include <linux/linkage.h> | ||
11 | #include <asm/thread_info.h> | 13 | #include <asm/thread_info.h> |
12 | #include <asm/vfpmacros.h> | 14 | #include <asm/vfpmacros.h> |
13 | #include "../kernel/entry-header.S" | 15 | #include <asm/assembler.h> |
16 | #include <asm/asm-offsets.h> | ||
14 | 17 | ||
15 | @ VFP entry point. | 18 | @ VFP entry point. |
16 | @ | 19 | @ |
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S index 3e5d3115a2a6..98f6246c9002 100644 --- a/arch/arm/vfp/vfphw.S +++ b/arch/arm/vfp/vfphw.S | |||
@@ -14,10 +14,13 @@ | |||
14 | * r10 points at the start of the private FP workspace in the thread structure | 14 | * r10 points at the start of the private FP workspace in the thread structure |
15 | * sp points to a struct pt_regs (as defined in include/asm/proc/ptrace.h) | 15 | * sp points to a struct pt_regs (as defined in include/asm/proc/ptrace.h) |
16 | */ | 16 | */ |
17 | #include <linux/init.h> | ||
18 | #include <linux/linkage.h> | ||
17 | #include <asm/thread_info.h> | 19 | #include <asm/thread_info.h> |
18 | #include <asm/vfpmacros.h> | 20 | #include <asm/vfpmacros.h> |
19 | #include <linux/kern_levels.h> | 21 | #include <linux/kern_levels.h> |
20 | #include "../kernel/entry-header.S" | 22 | #include <asm/assembler.h> |
23 | #include <asm/asm-offsets.h> | ||
21 | 24 | ||
22 | .macro DBGSTR, str | 25 | .macro DBGSTR, str |
23 | #ifdef DEBUG | 26 | #ifdef DEBUG |