Skip to content

Commit 3a2bdad

Browse files
ardbiesheuvelRussell King (Oracle)
authored andcommitted
ARM: 9293/1: vfp: Pass successful return address via register R3
In preparation for reimplementing the do_vfp()->vfp_support_entry() handover in C code, switch to using R3 to pass the 'success' return address, rather than R9, as it cannot be used for parameter passing. 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 dae904d commit 3a2bdad

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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
@
2424
ENTRY(do_vfp)
2525
mov r1, r10
26+
mov r3, r9
2627
ldr r4, .LCvfp
2728
ldr pc, [r4] @ call VFP entry point
2829
ENDPROC(do_vfp)

arch/arm/vfp/vfphw.S

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* This code is called from the kernel's undefined instruction trap.
99
* r1 holds the thread_info pointer
10-
* r9 holds the return address for successful handling.
10+
* r3 holds the return address for successful handling.
1111
* lr holds the return address for unrecognised instructions.
1212
* sp points to a struct pt_regs (as defined in include/asm/proc/ptrace.h)
1313
*/
@@ -71,7 +71,7 @@
7171
@ r0 = instruction opcode (32-bit ARM or two 16-bit Thumb)
7272
@ r1 = thread_info pointer
7373
@ r2 = PC value to resume execution after successful emulation
74-
@ r9 = normal "successful" return address
74+
@ r3 = normal "successful" return address
7575
@ lr = unrecognised instruction return address
7676
@ IRQs enabled.
7777
ENTRY(vfp_support_entry)
@@ -89,9 +89,9 @@ ENTRY(vfp_support_entry)
8989
bne look_for_VFP_exceptions @ VFP is already enabled
9090

9191
DBGSTR1 "enable %x", r10
92-
ldr r3, vfp_current_hw_state_address
92+
ldr r9, vfp_current_hw_state_address
9393
orr r1, r1, #FPEXC_EN @ user FPEXC has the enable bit set
94-
ldr r4, [r3, r11, lsl #2] @ vfp_current_hw_state pointer
94+
ldr r4, [r9, r11, lsl #2] @ vfp_current_hw_state pointer
9595
bic r5, r1, #FPEXC_EX @ make sure exceptions are disabled
9696
cmp r4, r10 @ this thread owns the hw context?
9797
#ifndef CONFIG_SMP
@@ -150,7 +150,7 @@ vfp_reload_hw:
150150
#endif
151151

152152
DBGSTR1 "load state %p", r10
153-
str r10, [r3, r11, lsl #2] @ update the vfp_current_hw_state pointer
153+
str r10, [r9, r11, lsl #2] @ update the vfp_current_hw_state pointer
154154
@ Load the saved state back into the VFP
155155
VFPFLDMIA r10, r5 @ reload the working registers while
156156
@ FPEXC is in a safe state
@@ -180,7 +180,7 @@ vfp_hw_state_valid:
180180
@ always subtract 4 from the following
181181
@ instruction address.
182182
local_bh_enable_ti r10, r4
183-
ret r9 @ we think we have handled things
183+
ret r3 @ we think we have handled things
184184

185185

186186
look_for_VFP_exceptions:
@@ -210,7 +210,7 @@ skip:
210210
process_exception:
211211
DBGSTR "bounce"
212212
mov r2, sp @ nothing stacked - regdump is at TOS
213-
mov lr, r9 @ setup for a return to the user code.
213+
mov lr, r3 @ setup for a return to the user code.
214214

215215
@ Now call the C code to package up the bounce to the support code
216216
@ r0 holds the trigger instruction

0 commit comments

Comments
 (0)