fixed: 1)uncleared fpu exceptions in fpu_save

2)fpu context lose in terminate

git-svn-id: svn://kolibrios.org@203 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2006-10-31 20:19:05 +00:00
parent 4b73c68fff
commit c6d6567ec3
3 changed files with 14 additions and 7 deletions

View File

@ -1038,6 +1038,7 @@ proc fpu_save
jnc .no_SSE
fxsave [eax]
fninit ;re-init fpu
ret
.no_SSE:
fnsave [eax]
@ -1055,6 +1056,7 @@ proc fpu_restore
fxrstor [eax]
ret
.no_SSE:
fnclex ;fix possible problems
frstor [eax]
ret
endp

View File

@ -236,7 +236,6 @@ e7:
frstor [eax]
restore_ring3_context
iret
.init:
fninit ;­ ¬ ­¥ ­ã¦­ë ­¥¬ áª¨à®¢ ­­ë¥ ¨áª«î祭¨ï
.ready:
@ -693,7 +692,16 @@ terminate: ; terminate application
cmp [fpu_owner],esi ; if user fpu last -> fpu user = 1
jne fpu_ok_1
mov [fpu_owner],1
mov eax, [256+PROC_BASE+0x10]
bt [cpu_caps], CAPS_FXSR
jnc .no_SSE
fxrstor [eax]
jmp fpu_ok_1
.no_SSE:
fnclex
frstor [eax]
fpu_ok_1:
mov [0xf400],byte 0 ; empty keyboard buffer

View File

@ -29,12 +29,8 @@ proc new_mix stdcall, output:dword
cmp [play_count], 0
je .exit
; mov eax, fpu_state
; fnsave [eax]
call FpuSave
emms
mov [main_count], 32;
.l00:
mov [mix_buff_map], 0x0000FFFF;
xor eax, eax
@ -98,6 +94,7 @@ proc new_mix stdcall, output:dword
jnz .l00
call update_stream
emms
call FpuRestore
ret
.exit: