Subversion Repositories Kolibri OS

Rev

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

Rev 431 Rev 435
Line 1... Line 1...
1
$Revision: 431 $
1
$Revision: 435 $
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;;                                                              ;;
3
;;                                                              ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
5
;; Distributed under terms of the GNU General Public License    ;;
5
;; Distributed under terms of the GNU General Public License    ;;
6
;;                                                              ;;
6
;;                                                              ;;
Line 57... Line 57...
57
 
57
 
58
           clts
58
           clts
Line 59... Line 59...
59
           mov edi, eax
59
           mov edi, eax
60
 
60
 
61
           mov ecx, [fpu_owner]
61
           mov ecx, [fpu_owner]
62
           mov eax, [CURRENT_TASK]
62
           mov esi, [CURRENT_TASK]
-
 
63
           cmp ecx, esi
-
 
64
           jne .save
-
 
65
 
63
           cmp ecx, eax
66
           call save_context
-
 
67
           jmp .exit
-
 
68
.save:
64
           jne .save
69
           mov [fpu_owner], esi
-
 
70
 
-
 
71
           shl ecx, 8
-
 
72
           mov eax, [ecx+SLOT_BASE+APPDATA.fpu_state]
-
 
73
 
-
 
74
           call save_context
65
.copy:
75
 
66
           shl eax, 8
76
           shl esi, 8
67
           mov esi, [eax+SLOT_BASE+APPDATA.fpu_state]
77
           mov esi, [esi+SLOT_BASE+APPDATA.fpu_state]
68
           mov ecx, 512/4
78
           mov ecx, 512/4
69
           cld
79
           cld
70
           rep movsd
80
           rep movsd
71
           fninit
81
           fninit
72
 
82
.exit:
73
           popfd
83
           popfd
74
           pop edi
84
           pop edi
75
           pop esi
85
           pop esi
76
           pop ecx
-
 
77
           ret
-
 
78
.save:
-
 
79
           mov [fpu_owner], eax
-
 
80
 
-
 
Line -... Line 86...
-
 
86
           pop ecx
-
 
87
           ret
81
           shl ecx, 8
88
 
82
           mov ecx, [ecx+SLOT_BASE+APPDATA.fpu_state]
89
align 4
Line 83... Line 90...
83
 
90
save_context:
84
           bt [cpu_caps], CAPS_SSE
91
           bt [cpu_caps], CAPS_SSE
85
           jnc .no_SSE
92
           jnc .no_SSE
86
 
93
 
87
           fxsave [ecx]
94
           fxsave [eax]
Line 88... Line 95...
88
           jmp .copy
95
           ret
89
.no_SSE:
96
.no_SSE:
90
           fnsave [ecx]
97
           fnsave [eax]
91
           jmp .copy
98
           ret
Line 104... Line 111...
104
           mov eax, [CURRENT_TASK]
111
           mov eax, [CURRENT_TASK]
105
           cmp ecx, eax
112
           cmp ecx, eax
106
           jne .copy
113
           jne .copy
Line 107... Line 114...
107
 
114
 
108
           clts
-
 
109
 
115
           clts
110
           bt [cpu_caps], CAPS_SSE
116
           bt [cpu_caps], CAPS_SSE
Line 111... Line 117...
111
           jnc .no_SSE
117
           jnc .no_SSE
112
 
118