]> Zhao Yanbai Git Server - minix.git/commitdiff
Fix for FPU broken by r6131
authorTomas Hruby <tom@minix3.org>
Fri, 5 Mar 2010 22:23:03 +0000 (22:23 +0000)
committerTomas Hruby <tom@minix3.org>
Fri, 5 Mar 2010 22:23:03 +0000 (22:23 +0000)
- cycles accounting must be called earlier, firstly not to clobber the %ebx
  register, secondly to be correctly called in both branches.

kernel/arch/i386/mpx386.S

index 7866c8d520aaa3f25122de2e95c1a2202d564477..d5809252ebb6cb1d693697aee468e435b11c649f 100644 (file)
@@ -621,16 +621,16 @@ copr_not_available:
        clts
        cld                             /* set direction flag to a known value */
        SAVE_PROCESS_CTX_NON_LAZY(0)
+       /* stop user process cycles */
+       push    %ebp
+       call    cycles_accounting_stop
+       pop     %ebp
        lea     P_MISC_FLAGS(%ebp), %ebx
        movw    (%ebx), %cx
        and     $MF_FPU_INITIALIZED, %cx
        jnz     0f                      /* jump if FPU is already initialized */
        orw     $MF_FPU_INITIALIZED, (%ebx)
        fninit
-       /* stop user process cycles */
-       push    %ebp
-       call    cycles_accounting_stop
-       add     $4, %esp
        jmp     copr_return
 0:                                     /* load FPU context for current process */
        mov     %ss:FP_SAVE_AREA_P(%ebp), %eax