Subversion Repositories Kolibri OS

Rev

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

Rev 203 Rev 214
Line 190... Line 190...
190
        mov   byte [edx+TASKDATA.state], 1        ; suspended
190
        mov   byte [edx+TASKDATA.state], 1        ; suspended
191
        call  change_task
191
        call  change_task
192
        restore_ring3_context
192
        restore_ring3_context
193
        iretd
193
        iretd
Line 194... Line -...
194
 
-
 
195
;;;;;;;;;;;;;;;;;;;;;;;
-
 
196
;; FPU ERROR HANDLER ;;
-
 
197
;;;;;;;;;;;;;;;;;;;;;;;
-
 
198
 
-
 
199
align 4
-
 
200
e7:
-
 
201
        save_ring3_context
-
 
202
        clts
-
 
203
        mov ax, os_data
-
 
204
        mov ds, ax
-
 
205
        mov es, ax
-
 
206
 
-
 
207
        mov ebx, [fpu_owner]
-
 
208
        cmp ebx, [CURRENT_TASK]
-
 
209
        je .exit
-
 
210
 
-
 
211
        shl ebx, 8
-
 
212
        mov eax, [ebx+PROC_BASE+APPDATA.fpu_state]
-
 
213
        bt [cpu_caps], CAPS_FXSR
-
 
214
        jnc .no_SSE
-
 
215
 
-
 
216
        fxsave [eax]
-
 
217
        mov ebx, [CURRENT_TASK]
-
 
218
        mov [fpu_owner], ebx
-
 
219
        shl ebx, 8
-
 
220
        cmp dword [ebx+PROC_BASE+APPDATA.fpu_init], 0
-
 
221
        je .init
-
 
222
        mov eax, [ebx+PROC_BASE+APPDATA.fpu_state]
-
 
223
        fxrstor [eax]
-
 
224
        restore_ring3_context
-
 
225
        iret
-
 
226
 
-
 
227
.no_SSE:
-
 
228
        fnsave [eax]
-
 
229
        mov ebx, [CURRENT_TASK]
-
 
230
        mov [fpu_owner], ebx
-
 
231
        shl ebx, 8
-
 
232
        cmp dword [ebx+PROC_BASE+APPDATA.fpu_init], 0
-
 
233
        je .ready
-
 
234
 
-
 
235
        mov eax, [ebx+PROC_BASE+APPDATA.fpu_state]
-
 
236
        frstor [eax]
-
 
237
        restore_ring3_context
-
 
238
        iret
-
 
239
.init:
-
 
240
        fninit                      ;­ ¬ ­¥ ­ã¦­ë ­¥¬ áª¨à®¢ ­­ë¥ ¨áª«î祭¨ï
-
 
241
.ready:
-
 
242
        mov dword [ebx+PROC_BASE+APPDATA.fpu_init], 1
-
 
243
.exit:
-
 
244
        restore_ring3_context
-
 
245
        iret
-
 
246
 
-
 
247
iglobal
-
 
248
  fpu_owner dd 1
-
 
249
 endg
-
 
250
 
-
 
251
 
194
 
252
writehex:
195
writehex:
Line 253... Line 196...
253
      pusha
196
      pusha
254
 
197