Subversion Repositories Kolibri OS

Rev

Rev 7276 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7276 Rev 8869
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2017. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2017. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 7276 $
8
$Revision: 8869 $
9
 
9
 
10
 
10
 
Line 166... Line 166...
166
 
166
 
167
        clts
167
        clts
Line 168... Line 168...
168
        mov     edi, eax
168
        mov     edi, eax
169
 
169
 
170
        mov     ecx, [fpu_owner]
170
        mov     ecx, [fpu_owner]
171
        mov     esi, [CURRENT_TASK]
171
        mov     esi, [current_slot_idx]
Line 172... Line 172...
172
        cmp     ecx, esi
172
        cmp     ecx, esi
173
        jne     .save
173
        jne     .save
Line 214... Line 214...
214
 
214
 
215
        clts
215
        clts
Line 216... Line 216...
216
        mov     edi, eax
216
        mov     edi, eax
217
 
217
 
218
        mov     ecx, [fpu_owner]
218
        mov     ecx, [fpu_owner]
219
        mov     esi, [CURRENT_TASK]
219
        mov     esi, [current_slot_idx]
Line 220... Line 220...
220
        cmp     ecx, esi
220
        cmp     ecx, esi
221
        jne     .save
221
        jne     .save
Line 274... Line 274...
274
 
274
 
275
        pushfd
275
        pushfd
Line 276... Line 276...
276
        cli
276
        cli
277
 
277
 
278
        mov     ecx, [fpu_owner]
278
        mov     ecx, [fpu_owner]
279
        mov     eax, [CURRENT_TASK]
279
        mov     eax, [current_slot_idx]
Line 280... Line 280...
280
        cmp     ecx, eax
280
        cmp     ecx, eax
281
        jne     .copy
281
        jne     .copy
Line 316... Line 316...
316
 
316
 
317
        pushfd
317
        pushfd
Line 318... Line 318...
318
        cli
318
        cli
319
 
319
 
320
        mov     ecx, [fpu_owner]
320
        mov     ecx, [fpu_owner]
321
        mov     eax, [CURRENT_TASK]
321
        mov     eax, [current_slot_idx]
Line 322... Line 322...
322
        cmp     ecx, eax
322
        cmp     ecx, eax
323
        jne     .copy
323
        jne     .copy
Line 370... Line 370...
370
        mov     ax, app_data;
370
        mov     ax, app_data;
371
        mov     ds, ax
371
        mov     ds, ax
372
        mov     es, ax
372
        mov     es, ax
Line 373... Line 373...
373
 
373
 
374
        mov     ebx, [fpu_owner]
374
        mov     ebx, [fpu_owner]
375
        cmp     ebx, [CURRENT_TASK]
375
        cmp     ebx, [current_slot_idx]
Line 376... Line 376...
376
        je      .exit
376
        je      .exit
377
 
377
 
378
        shl     ebx, 8
378
        shl     ebx, 8
379
        mov     eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
379
        mov     eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
380
        bt      [cpu_caps+(CAPS_OSXSAVE/32)*4], CAPS_OSXSAVE mod 32
380
        bt      [cpu_caps+(CAPS_OSXSAVE/32)*4], CAPS_OSXSAVE mod 32
381
        jnc     .no_xsave
381
        jnc     .no_xsave
382
        mov     ecx, eax
382
        mov     ecx, eax
383
        mov     eax, [xsave_eax]
383
        mov     eax, [xsave_eax]
384
        mov     edx, [xsave_edx]
384
        mov     edx, [xsave_edx]
385
        xsave   [ecx]
385
        xsave   [ecx]
386
        mov     ebx, [CURRENT_TASK]
386
        mov     ebx, [current_slot_idx]
387
        mov     [fpu_owner], ebx
387
        mov     [fpu_owner], ebx
388
        shl     ebx, 8
388
        shl     ebx, 8
389
        mov     ecx, [ebx+SLOT_BASE+APPDATA.fpu_state]
389
        mov     ecx, [ebx+SLOT_BASE+APPDATA.fpu_state]
Line 394... Line 394...
394
.no_xsave:
394
.no_xsave:
395
        bt      [cpu_caps], CAPS_SSE
395
        bt      [cpu_caps], CAPS_SSE
396
        jnc     .no_SSE
396
        jnc     .no_SSE
Line 397... Line 397...
397
 
397
 
398
        fxsave  [eax]
398
        fxsave  [eax]
399
        mov     ebx, [CURRENT_TASK]
399
        mov     ebx, [current_slot_idx]
400
        mov     [fpu_owner], ebx
400
        mov     [fpu_owner], ebx
401
        shl     ebx, 8
401
        shl     ebx, 8
402
        mov     eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
402
        mov     eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
403
        fxrstor [eax]
403
        fxrstor [eax]
404
        restore_ring3_context
404
        restore_ring3_context
Line 405... Line 405...
405
        iret
405
        iret
406
 
406
 
407
.no_SSE:
407
.no_SSE:
408
        fnsave  [eax]
408
        fnsave  [eax]
409
        mov     ebx, [CURRENT_TASK]
409
        mov     ebx, [current_slot_idx]
410
        mov     [fpu_owner], ebx
410
        mov     [fpu_owner], ebx
411
        shl     ebx, 8
411
        shl     ebx, 8
412
        mov     eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
412
        mov     eax, [ebx+SLOT_BASE+APPDATA.fpu_state]