Subversion Repositories Kolibri OS

Rev

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

Rev 214 Rev 221
Line 1... Line 1...
1
init_fpu:
1
init_fpu:
2
           clts
2
           clts
3
           fninit
3
           fninit
Line 4... Line 4...
4
 
4
 
5
           bt [cpu_caps], CAPS_FXSR
5
           bt [cpu_caps], CAPS_SSE
Line 6... Line 6...
6
           jnc .no_FXSR
6
           jnc .no_SSE
7
 
7
 
Line 8... Line 8...
8
           stdcall kernel_alloc, 512*256
8
           stdcall kernel_alloc, 512*256
Line 29... Line 29...
29
           xorps xmm6, xmm6
29
           xorps xmm6, xmm6
30
           xorps xmm7, xmm7
30
           xorps xmm7, xmm7
31
           fxsave [eax]
31
           fxsave [eax]
32
           ret
32
           ret
33
.no_FXSR:
33
.no_SSE:
34
           stdcall kernel_alloc, 112*256
34
           stdcall kernel_alloc, 112*256
35
           mov [fpu_data], eax
35
           mov [fpu_data], eax
36
           mov ecx, cr0
36
           mov ecx, cr0
37
           and ecx, not CR0_EM
37
           and ecx, not CR0_EM
38
           or ecx, CR0_MP+CR0_NE
38
           or ecx, CR0_MP+CR0_NE
39
           mov cr0, ecx
39
           mov cr0, ecx
Line 48... Line 48...
48
           mov eax, [ebx+PROC_BASE+0x10]
48
           mov eax, [ebx+PROC_BASE+0x10]
49
           mov ebx, [CURRENT_TASK]
49
           mov ebx, [CURRENT_TASK]
50
           mov [fpu_owner], ebx
50
           mov [fpu_owner], ebx
51
 
51
 
Line 52... Line 52...
52
           bt [cpu_caps], CAPS_FXSR
52
           bt [cpu_caps], CAPS_SSE
53
           jnc .no_SSE
53
           jnc .no_SSE
Line 54... Line 54...
54
 
54
 
55
           fxsave [eax]
55
           fxsave [eax]
56
           fninit            ;re-init fpu
56
           fninit            ;re-init fpu
Line 64... Line 64...
64
proc fpu_restore
64
proc fpu_restore
65
           mov ebx, [CURRENT_TASK]
65
           mov ebx, [CURRENT_TASK]
66
           shl ebx, 8
66
           shl ebx, 8
67
           mov eax, [ebx+PROC_BASE+0x10]
67
           mov eax, [ebx+PROC_BASE+0x10]
68
           bt [cpu_caps], CAPS_FXSR
68
           bt [cpu_caps], CAPS_SSE
69
           jnc .no_SSE
69
           jnc .no_SSE
70
 
70
 
Line 71... Line 71...
71
           fxrstor [eax]
71
           fxrstor [eax]
72
           ret
72
           ret
73
.no_SSE:
73
.no_SSE:
Line 89... Line 89...
89
        je .exit
89
        je .exit
90
 
90
 
Line 91... Line 91...
91
        shl ebx, 8
91
        shl ebx, 8
92
        mov eax, [ebx+PROC_BASE+APPDATA.fpu_state]
92
        mov eax, [ebx+PROC_BASE+APPDATA.fpu_state]
93
        bt [cpu_caps], CAPS_FXSR
93
        bt [cpu_caps], CAPS_SSE
94
        jnc .no_SSE
94
        jnc .no_SSE
Line 95... Line 95...
95
 
95
 
96
        fxsave [eax]
96
        fxsave [eax]
97
        mov ebx, [CURRENT_TASK]
97
        mov ebx, [CURRENT_TASK]