Merge remote-tracking branch 'remotes/aosp/android-3.0' into develop-3.0
[firefly-linux-kernel-4.4.55.git] / arch / arm / vfp / vfphw.S
index f879b7ac2a4e983981a8e92909e81cc2d14ee8e7..6e26f5db0cb3dad6620c208c785a56dc7ced9207 100644 (file)
@@ -77,15 +77,12 @@ ENTRY(vfp_support_entry)
        bne     look_for_VFP_exceptions @ VFP is already enabled
 
        DBGSTR1 "enable %x", r10
-       ldr     r3, last_VFP_context_address
+       ldr     r3, vfp_current_hw_state_address
        orr     r1, r1, #FPEXC_EN       @ user FPEXC has the enable bit set
-       ldr     r4, [r3, r11, lsl #2]   @ last_VFP_context pointer
+       ldr     r4, [r3, r11, lsl #2]   @ vfp_current_hw_state pointer
        bic     r5, r1, #FPEXC_EX       @ make sure exceptions are disabled
-       cmp     r4, r10
-       beq     check_for_exception     @ we are returning to the same
-                                       @ process, so the registers are
-                                       @ still there.  In this case, we do
-                                       @ not want to drop a pending exception.
+       cmp     r4, r10                 @ this thread owns the hw context?
+       beq     vfp_hw_state_valid
 
        VFPFMXR FPEXC, r5               @ enable VFP, disable any pending
                                        @ exceptions, so we can get at the
@@ -116,7 +113,7 @@ ENTRY(vfp_support_entry)
 
 no_old_VFP_process:
        DBGSTR1 "load state %p", r10
-       str     r10, [r3, r11, lsl #2]  @ update the last_VFP_context pointer
+       str     r10, [r3, r11, lsl #2]  @ update the vfp_current_hw_state pointer
                                        @ Load the saved state back into the VFP
        VFPFLDMIA r10, r5               @ reload the working registers while
                                        @ FPEXC is in a safe state
@@ -132,7 +129,8 @@ no_old_VFP_process:
 #endif
        VFPFMXR FPSCR, r5               @ restore status
 
-check_for_exception:
+@ The context stored in the VFP hardware is up to date with this thread
+vfp_hw_state_valid:
        tst     r1, #FPEXC_EX
        bne     process_exception       @ might as well handle the pending
                                        @ exception before retrying branch
@@ -226,8 +224,8 @@ ENDPROC(vfp_load_state)
 #endif
 
        .align
-last_VFP_context_address:
-       .word   last_VFP_context
+vfp_current_hw_state_address:
+       .word   vfp_current_hw_state
 
        .macro  tbl_branch, base, tmp, shift
 #ifdef CONFIG_THUMB2_KERNEL