diff options
Diffstat (limited to 'arch/arm/vfp/vfphw.S')
-rw-r--r-- | arch/arm/vfp/vfphw.S | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S index a62dcf7098ba..c92a08bd6a86 100644 --- a/arch/arm/vfp/vfphw.S +++ b/arch/arm/vfp/vfphw.S | |||
@@ -101,9 +101,12 @@ ENTRY(vfp_support_entry) | |||
101 | VFPFSTMIA r4, r5 @ save the working registers | 101 | VFPFSTMIA r4, r5 @ save the working registers |
102 | VFPFMRX r5, FPSCR @ current status | 102 | VFPFMRX r5, FPSCR @ current status |
103 | tst r1, #FPEXC_EX @ is there additional state to save? | 103 | tst r1, #FPEXC_EX @ is there additional state to save? |
104 | VFPFMRX r6, FPINST, NE @ FPINST (only if FPEXC.EX is set) | 104 | beq 1f |
105 | tstne r1, #FPEXC_FP2V @ is there an FPINST2 to read? | 105 | VFPFMRX r6, FPINST @ FPINST (only if FPEXC.EX is set) |
106 | VFPFMRX r8, FPINST2, NE @ FPINST2 if needed (and present) | 106 | tst r1, #FPEXC_FP2V @ is there an FPINST2 to read? |
107 | beq 1f | ||
108 | VFPFMRX r8, FPINST2 @ FPINST2 if needed (and present) | ||
109 | 1: | ||
107 | stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2 | 110 | stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2 |
108 | @ and point r4 at the word at the | 111 | @ and point r4 at the word at the |
109 | @ start of the register dump | 112 | @ start of the register dump |
@@ -117,9 +120,12 @@ no_old_VFP_process: | |||
117 | @ FPEXC is in a safe state | 120 | @ FPEXC is in a safe state |
118 | ldmia r10, {r1, r5, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2 | 121 | ldmia r10, {r1, r5, r6, r8} @ load FPEXC, FPSCR, FPINST, FPINST2 |
119 | tst r1, #FPEXC_EX @ is there additional state to restore? | 122 | tst r1, #FPEXC_EX @ is there additional state to restore? |
120 | VFPFMXR FPINST, r6, NE @ restore FPINST (only if FPEXC.EX is set) | 123 | beq 1f |
121 | tstne r1, #FPEXC_FP2V @ is there an FPINST2 to write? | 124 | VFPFMXR FPINST, r6 @ restore FPINST (only if FPEXC.EX is set) |
122 | VFPFMXR FPINST2, r8, NE @ FPINST2 if needed (and present) | 125 | tst r1, #FPEXC_FP2V @ is there an FPINST2 to write? |
126 | beq 1f | ||
127 | VFPFMXR FPINST2, r8 @ FPINST2 if needed (and present) | ||
128 | 1: | ||
123 | VFPFMXR FPSCR, r5 @ restore status | 129 | VFPFMXR FPSCR, r5 @ restore status |
124 | 130 | ||
125 | check_for_exception: | 131 | check_for_exception: |
@@ -166,7 +172,7 @@ process_exception: | |||
166 | @ retry the faulted instruction | 172 | @ retry the faulted instruction |
167 | ENDPROC(vfp_support_entry) | 173 | ENDPROC(vfp_support_entry) |
168 | 174 | ||
169 | #ifdef CONFIG_SMP | 175 | #if defined(CONFIG_SMP) || defined(CONFIG_PM) |
170 | ENTRY(vfp_save_state) | 176 | ENTRY(vfp_save_state) |
171 | @ Save the current VFP state | 177 | @ Save the current VFP state |
172 | @ r0 - save location | 178 | @ r0 - save location |
@@ -175,9 +181,12 @@ ENTRY(vfp_save_state) | |||
175 | VFPFSTMIA r0, r2 @ save the working registers | 181 | VFPFSTMIA r0, r2 @ save the working registers |
176 | VFPFMRX r2, FPSCR @ current status | 182 | VFPFMRX r2, FPSCR @ current status |
177 | tst r1, #FPEXC_EX @ is there additional state to save? | 183 | tst r1, #FPEXC_EX @ is there additional state to save? |
178 | VFPFMRX r3, FPINST, NE @ FPINST (only if FPEXC.EX is set) | 184 | beq 1f |
179 | tstne r1, #FPEXC_FP2V @ is there an FPINST2 to read? | 185 | VFPFMRX r3, FPINST @ FPINST (only if FPEXC.EX is set) |
180 | VFPFMRX r12, FPINST2, NE @ FPINST2 if needed (and present) | 186 | tst r1, #FPEXC_FP2V @ is there an FPINST2 to read? |
187 | beq 1f | ||
188 | VFPFMRX r12, FPINST2 @ FPINST2 if needed (and present) | ||
189 | 1: | ||
181 | stmia r0, {r1, r2, r3, r12} @ save FPEXC, FPSCR, FPINST, FPINST2 | 190 | stmia r0, {r1, r2, r3, r12} @ save FPEXC, FPSCR, FPINST, FPINST2 |
182 | mov pc, lr | 191 | mov pc, lr |
183 | ENDPROC(vfp_save_state) | 192 | ENDPROC(vfp_save_state) |