/kernel/trunk/core/fpu.inc |
59,36 → 59,43 |
mov edi, eax |
|
mov ecx, [fpu_owner] |
mov eax, [CURRENT_TASK] |
cmp ecx, eax |
mov esi, [CURRENT_TASK] |
cmp ecx, esi |
jne .save |
.copy: |
shl eax, 8 |
mov esi, [eax+SLOT_BASE+APPDATA.fpu_state] |
|
call save_context |
jmp .exit |
.save: |
mov [fpu_owner], esi |
|
shl ecx, 8 |
mov eax, [ecx+SLOT_BASE+APPDATA.fpu_state] |
|
call save_context |
|
shl esi, 8 |
mov esi, [esi+SLOT_BASE+APPDATA.fpu_state] |
mov ecx, 512/4 |
cld |
rep movsd |
fninit |
|
.exit: |
popfd |
pop edi |
pop esi |
pop ecx |
ret |
.save: |
mov [fpu_owner], eax |
|
shl ecx, 8 |
mov ecx, [ecx+SLOT_BASE+APPDATA.fpu_state] |
|
align 4 |
save_context: |
bt [cpu_caps], CAPS_SSE |
jnc .no_SSE |
|
fxsave [ecx] |
jmp .copy |
fxsave [eax] |
ret |
.no_SSE: |
fnsave [ecx] |
jmp .copy |
fnsave [eax] |
ret |
|
align 4 |
fpu_restore: |
106,7 → 113,6 |
jne .copy |
|
clts |
|
bt [cpu_caps], CAPS_SSE |
jnc .no_SSE |
|