aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/vfp/vfphw.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/vfp/vfphw.S')
-rw-r--r--arch/arm/vfp/vfphw.S20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index 9897dcfc16d..404538ae591 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -77,15 +77,12 @@ ENTRY(vfp_support_entry)
77 bne look_for_VFP_exceptions @ VFP is already enabled 77 bne look_for_VFP_exceptions @ VFP is already enabled
78 78
79 DBGSTR1 "enable %x", r10 79 DBGSTR1 "enable %x", r10
80 ldr r3, last_VFP_context_address 80 ldr r3, vfp_current_hw_state_address
81 orr r1, r1, #FPEXC_EN @ user FPEXC has the enable bit set 81 orr r1, r1, #FPEXC_EN @ user FPEXC has the enable bit set
82 ldr r4, [r3, r11, lsl #2] @ last_VFP_context pointer 82 ldr r4, [r3, r11, lsl #2] @ vfp_current_hw_state pointer
83 bic r5, r1, #FPEXC_EX @ make sure exceptions are disabled 83 bic r5, r1, #FPEXC_EX @ make sure exceptions are disabled
84 cmp r4, r10 84 cmp r4, r10 @ this thread owns the hw context?
85 beq check_for_exception @ we are returning to the same 85 beq vfp_hw_state_valid
86 @ process, so the registers are
87 @ still there. In this case, we do
88 @ not want to drop a pending exception.
89 86
90 VFPFMXR FPEXC, r5 @ enable VFP, disable any pending 87 VFPFMXR FPEXC, r5 @ enable VFP, disable any pending
91 @ exceptions, so we can get at the 88 @ exceptions, so we can get at the
@@ -116,7 +113,7 @@ ENTRY(vfp_support_entry)
116 113
117no_old_VFP_process: 114no_old_VFP_process:
118 DBGSTR1 "load state %p", r10 115 DBGSTR1 "load state %p", r10
119 str r10, [r3, r11, lsl #2] @ update the last_VFP_context pointer 116 str r10, [r3, r11, lsl #2] @ update the vfp_current_hw_state pointer
120 @ Load the saved state back into the VFP 117 @ Load the saved state back into the VFP
121 VFPFLDMIA r10, r5 @ reload the working registers while 118 VFPFLDMIA r10, r5 @ reload the working registers while
122 @ FPEXC is in a safe state 119 @ FPEXC is in a safe state
@@ -132,7 +129,8 @@ no_old_VFP_process:
132#endif 129#endif
133 VFPFMXR FPSCR, r5 @ restore status 130 VFPFMXR FPSCR, r5 @ restore status
134 131
135check_for_exception: 132@ The context stored in the VFP hardware is up to date with this thread
133vfp_hw_state_valid:
136 tst r1, #FPEXC_EX 134 tst r1, #FPEXC_EX
137 bne process_exception @ might as well handle the pending 135 bne process_exception @ might as well handle the pending
138 @ exception before retrying branch 136 @ exception before retrying branch
@@ -207,8 +205,8 @@ ENTRY(vfp_save_state)
207ENDPROC(vfp_save_state) 205ENDPROC(vfp_save_state)
208 206
209 .align 207 .align
210last_VFP_context_address: 208vfp_current_hw_state_address:
211 .word last_VFP_context 209 .word vfp_current_hw_state
212 210
213 .macro tbl_branch, base, tmp, shift 211 .macro tbl_branch, base, tmp, shift
214#ifdef CONFIG_THUMB2_KERNEL 212#ifdef CONFIG_THUMB2_KERNEL