Subversion Repositories Kolibri OS

Rev

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

Rev 740 Rev 741
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2007. 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: 740 $
8
$Revision: 741 $
9
 
9
 
Line 141... Line 141...
141
           mov [page_start], eax
141
           mov [page_start], eax
142
           popfd
142
           popfd
143
           ret
143
           ret
144
endp
144
endp
Line -... Line 145...
-
 
145
 
-
 
146
proc map_io_mem stdcall, base:dword, size:dword, flags:dword
-
 
147
 
-
 
148
           push ebx
-
 
149
           push edi
-
 
150
           mov eax, [size]
-
 
151
           add eax, 4095
-
 
152
           and eax, -4096
-
 
153
           mov [size], eax
-
 
154
           stdcall alloc_kernel_space, eax
-
 
155
           test eax, eax
-
 
156
           jz .fail
-
 
157
           push eax
-
 
158
 
-
 
159
           mov edi, 0x1000
-
 
160
           mov ebx, eax
-
 
161
           mov ecx,[size]
-
 
162
           mov edx, [base]
-
 
163
           shr eax, 12
-
 
164
           shr ecx, 12
-
 
165
           and edx, -4096
-
 
166
           or edx, [flags]
-
 
167
@@:
-
 
168
           mov [page_tabs+eax*4], edx
-
 
169
           invlpg [ebx]
-
 
170
           inc eax
-
 
171
           add ebx, edi
-
 
172
           add edx, edi
-
 
173
           loop @B
-
 
174
 
-
 
175
           pop eax
-
 
176
           mov edx, [base]
-
 
177
           and edx, 4095
-
 
178
           add eax, edx
-
 
179
.fail:
-
 
180
           pop edi
-
 
181
           pop ebx
-
 
182
           ret
-
 
183
endp
145
 
184
 
146
; param
185
; param
147
;  eax= page base + page flags
186
;  eax= page base + page flags
148
;  ebx= liear address
187
;  ebx= liear address
Line 149... Line 188...
149
;  ecx= count
188
;  ecx= count
150
 
189
 
151
align 4
-
 
-
 
190
align 4
152
commit_pages:
191
commit_pages:
153
 
192
           push edi
Line 154... Line 193...
154
           test ecx, ecx
193
           test ecx, ecx
155
           jz .fail
194
           jz .fail
Line 169... Line 208...
169
           inc ebx
208
           inc ebx
170
           dec ecx
209
           dec ecx
171
           jnz @B
210
           jnz @B
172
           mov [pg_data.pg_mutex],ecx
211
           mov [pg_data.pg_mutex],ecx
173
.fail:
212
.fail:
-
 
213
           pop edi
174
           ret
214
           ret
Line 175... Line 215...
175
 
215
 
176
 
216