From ecf1a36d485d25fd30ff64580ab6594415c4cc6f Mon Sep 17 00:00:00 2001 From: Tomas Hruby Date: Fri, 5 Mar 2010 22:23:03 +0000 Subject: [PATCH] Fix for FPU broken by r6131 - 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/arch/i386/mpx386.S b/kernel/arch/i386/mpx386.S index 7866c8d52..d5809252e 100644 --- a/kernel/arch/i386/mpx386.S +++ b/kernel/arch/i386/mpx386.S @@ -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