Subversion Repositories Kolibri OS

Rev

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

Rev 7168 Rev 7199
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: 7168 $
8
$Revision: 7199 $
9
 
9
 
10
 
10
 
Line 11... Line 11...
11
init_fpu:
11
init_fpu:
12
        clts
12
        clts
Line 13... Line 13...
13
        fninit
13
        fninit
14
 
14
 
15
        bt      [cpu_caps+(CAPS_XSAVE/32)], CAPS_XSAVE mod 32
15
        bt      [cpu_caps+(CAPS_XSAVE/32)*4], CAPS_XSAVE mod 32
Line 226... Line 226...
226
        pop     ecx
226
        pop     ecx
227
        ret
227
        ret
Line 228... Line 228...
228
 
228
 
229
align 4
229
align 4
230
save_context:
230
save_context:
231
        bt      [cpu_caps+(CAPS_OSXSAVE/32)], CAPS_OSXSAVE mod 32
231
        bt      [cpu_caps+(CAPS_OSXSAVE/32)*4], CAPS_OSXSAVE mod 32
232
        jnc     save_fpu_context
232
        jnc     save_fpu_context
233
        xsave   [eax]
233
        xsave   [eax]
234
        ret
234
        ret
235
save_fpu_context:
235
save_fpu_context:
Line 297... Line 297...
297
        mov     eax, [CURRENT_TASK]
297
        mov     eax, [CURRENT_TASK]
298
        cmp     ecx, eax
298
        cmp     ecx, eax
299
        jne     .copy
299
        jne     .copy
Line 300... Line 300...
300
 
300
 
301
        clts
301
        clts
302
        bt      [cpu_caps+(CAPS_OSXSAVE/32)], CAPS_OSXSAVE mod 32
302
        bt      [cpu_caps+(CAPS_OSXSAVE/32)*4], CAPS_OSXSAVE mod 32
303
        jnc     .no_xsave
303
        jnc     .no_xsave
304
        xrstor  [esi]
304
        xrstor  [esi]
305
        popfd
305
        popfd
306
        pop     esi
306
        pop     esi
Line 347... Line 347...
347
        cmp     ebx, [CURRENT_TASK]
347
        cmp     ebx, [CURRENT_TASK]
348
        je      .exit
348
        je      .exit
Line 349... Line 349...
349
 
349
 
350
        shl     ebx, 8
350
        shl     ebx, 8
351
        mov     eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
351
        mov     eax, [ebx+SLOT_BASE+APPDATA.fpu_state]
352
        bt      [cpu_caps+(CAPS_OSXSAVE/32)], CAPS_OSXSAVE mod 32
352
        bt      [cpu_caps+(CAPS_OSXSAVE/32)*4], CAPS_OSXSAVE mod 32
353
        jnc     .no_xsave
353
        jnc     .no_xsave
354
        xsave   [eax]
354
        xsave   [eax]
355
        mov     ebx, [CURRENT_TASK]
355
        mov     ebx, [CURRENT_TASK]
356
        mov     [fpu_owner], ebx
356
        mov     [fpu_owner], ebx