optimizing switching of the FPU context

git-svn-id: svn://kolibrios.org@794 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2008-04-21 19:19:15 +00:00
parent 1fe26ef9de
commit 16b20de954

View File

@ -232,11 +232,17 @@ do_change_task:
; mov [tss._esp0], eax
mov ax, graph_data
mov gs, ax
mov ecx, cr0
or ecx, CR0_TS ;set task switch flag
mov cr0, ecx
inc [context_counter] ;noname & halyavin
mov eax, [CURRENT_TASK]
cmp eax, [fpu_owner]
clts ;clear a task switch flag
je @F
;and set it again if the owner
mov ecx, cr0 ;of a fpu has changed
or ecx, CR0_TS
mov cr0, ecx
@@:
inc [context_counter] ;noname & halyavin
test [ebx+APPDATA.dbg_state], 1
jnz @F
ret