Subversion Repositories Kolibri OS

Rev

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

Rev 285 Rev 291
Line 252... Line 252...
252
proc free_page
252
proc free_page
253
;arg:  eax  page address
253
;arg:  eax  page address
254
           pushfd
254
           pushfd
255
           cli
255
           cli
256
           inc [pg_data.pages_free]
256
           shr eax, 12              ;page index
257
           shr eax, 12              ;page index
-
 
258
           mov ebx, sys_pgmap
257
           mov ebx, sys_pgmap
259
           bts [ebx], eax           ;that's all!
258
           bts [ebx], eax           ;that's all!
260
           shr eax, 3
259
           cmc
-
 
260
           adc [pg_data.pages_free], 0 
-
 
261
           shr eax, 3
261
           and eax, not 3           ;dword offset from page_map
262
           and eax, not 3           ;dword offset from page_map
262
           add eax, ebx
263
           add eax, ebx
263
           cmp [page_start], eax
264
           cmp [page_start], eax
264
           ja @f
265
           ja @f
265
           popfd
266
           popfd
Line 287... Line 288...
287
 
288
 
Line 288... Line 289...
288
align 4
289
align 4
289
release_pages:
290
release_pages:
Line -... Line 291...
-
 
291
    
290
 
292
           push ebp
291
           mov ebx, pg_data.pg_mutex
293
           mov ebx, pg_data.pg_mutex
Line 292... Line 294...
292
           call wait_mutex      ;ebx
294
           call wait_mutex      ;ebx
293
 
295
 
Line 294... Line 296...
294
           mov esi, eax
296
           mov esi, eax
295
           mov edi, eax
297
           mov edi, eax
Line -... Line 298...
-
 
298
 
296
 
299
           shr esi, 10
297
           shr esi, 10
300
           add esi, pages_tab
298
           add esi, pages_tab
301
           
299
 
302
           mov ebp, [pg_data.pages_free] 
300
           mov ebx, [page_start]
303
           mov ebx, [page_start]
Line 308... Line 311...
308
           jz .next
311
           jz .next
309
 
312
 
Line 310... Line 313...
310
           shr eax, 12
313
           shr eax, 12
311
           bts [edx], eax
314
           bts [edx], eax
-
 
315
           cmc
312
           inc [pg_data.pages_free]
316
           adc ebp, 0 
313
           shr eax, 3
317
           shr eax, 3
314
           and eax, -4
318
           and eax, -4
315
           add eax, edx
319
           add eax, edx
316
           cmp eax, ebx
320
           cmp eax, ebx
317
           jae .next
321
           jae .next
Line 321... Line 325...
321
           add edi, 0x1000
325
           add edi, 0x1000
322
           add esi, 4
326
           add esi, 4
323
           dec ecx
327
           dec ecx
324
           jnz @B
328
           jnz @B
325
 
329
           mov [pg_data.pages_free], ebp  
326
           and [pg_data.pg_mutex],0
-
 
-
 
330
           and [pg_data.pg_mutex],0
327
           ret
331
           pop ebp
-
 
332
           ret
328
 
333
 
Line 329... Line 334...
329
align 4
334
align 4
330
proc map_page_table stdcall, lin_addr:dword, phis_addr:dword
335
proc map_page_table stdcall, lin_addr:dword, phis_addr:dword
331
           mov ebx, [lin_addr]
336
           mov ebx, [lin_addr]