Skip to content

Commit dae904d

Browse files
ardbiesheuvelRussell King (Oracle)
authored andcommitted
ARM: 9292/1: vfp: Pass thread_info pointer to vfp_support_entry
Instead of dereferencing thread_info in do_vfp, pass the thread_info pointer to vfp_support_entry via R1. That way, we only use a single caller save register, which makes it easier to convert do_vfp to C code in a subsequent patch. Note that, unlike the CPU number, which can change due to preemption, passing the thread_info pointer can safely be done with preemption enabled. Signed-off-by: Ard Biesheuvel <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Tested-by: Guenter Roeck <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 197b6b6 commit dae904d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

arch/arm/vfp/entry.S

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@
2222
@ IRQs enabled.
2323
@
2424
ENTRY(do_vfp)
25-
local_bh_disable r10, r4
25+
mov r1, r10
2626
ldr r4, .LCvfp
27-
ldr r11, [r10, #TI_CPU] @ CPU number
28-
add r10, r10, #TI_VFPSTATE @ r10 = workspace
2927
ldr pc, [r4] @ call VFP entry point
3028
ENDPROC(do_vfp)
3129

3230
ENTRY(vfp_null_entry)
33-
local_bh_enable_ti r10, r4
3431
ret lr
3532
ENDPROC(vfp_null_entry)
3633

arch/arm/vfp/vfphw.S

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* Written by Deep Blue Solutions Limited.
77
*
88
* This code is called from the kernel's undefined instruction trap.
9+
* r1 holds the thread_info pointer
910
* r9 holds the return address for successful handling.
1011
* lr holds the return address for unrecognised instructions.
11-
* r10 points at the start of the private FP workspace in the thread structure
1212
* sp points to a struct pt_regs (as defined in include/asm/proc/ptrace.h)
1313
*/
1414
#include <linux/init.h>
@@ -69,13 +69,17 @@
6969
@ VFP hardware support entry point.
7070
@
7171
@ r0 = instruction opcode (32-bit ARM or two 16-bit Thumb)
72+
@ r1 = thread_info pointer
7273
@ r2 = PC value to resume execution after successful emulation
7374
@ r9 = normal "successful" return address
74-
@ r10 = vfp_state union
75-
@ r11 = CPU number
7675
@ lr = unrecognised instruction return address
7776
@ IRQs enabled.
7877
ENTRY(vfp_support_entry)
78+
local_bh_disable r1, r4
79+
80+
ldr r11, [r1, #TI_CPU] @ CPU number
81+
add r10, r1, #TI_VFPSTATE @ r10 = workspace
82+
7983
DBGSTR3 "instr %08x pc %08x state %p", r0, r2, r10
8084

8185
.fpu vfpv2

0 commit comments

Comments
 (0)