Rev 294 | Rev 357 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 294 | Rev 321 | ||
---|---|---|---|
Line 364... | Line 364... | ||
364 | ret |
364 | ret |
365 | endp |
365 | endp |
366 | 366 | ||
Line 367... | Line 367... | ||
367 | align 4 |
367 | align 4 |
368 | proc free_kernel_space stdcall, base:dword |
368 | proc free_kernel_space stdcall uses ebx ecx edx esi edi, base:dword |
Line 369... | Line 369... | ||
369 | 369 | ||
370 | mov ebx, heap_mutex |
370 | mov ebx, heap_mutex |
Line 371... | Line 371... | ||
371 | call wait_mutex ;ebx |
371 | call wait_mutex ;ebx |
Line 459... | Line 459... | ||
459 | bts [mem_block_mask], eax |
459 | bts [mem_block_mask], eax |
460 | .m_eq: |
460 | .m_eq: |
461 | xor eax, eax |
461 | xor eax, eax |
462 | mov [heap_mutex], eax |
462 | mov [heap_mutex], eax |
463 | not eax |
463 | dec eax |
464 | ret |
464 | ret |
465 | .insert: |
465 | .insert: |
466 | remove_from_used esi |
466 | remove_from_used esi |
467 | 467 | ||
Line 468... | Line 468... | ||
468 | mov eax, [esi+block_size] |
468 | mov eax, [esi+block_size] |
Line 478... | Line 478... | ||
478 | bts [mem_block_mask], eax |
478 | bts [mem_block_mask], eax |
479 | mov [esi+block_flags],FREE_BLOCK |
479 | mov [esi+block_flags],FREE_BLOCK |
480 | xor eax, eax |
480 | xor eax, eax |
481 | mov [heap_mutex], eax |
481 | mov [heap_mutex], eax |
482 | not eax |
482 | dec eax |
483 | ret |
483 | ret |
484 | .fail: |
484 | .fail: |
485 | xor eax, eax |
485 | xor eax, eax |
486 | mov [heap_mutex], eax |
486 | mov [heap_mutex], eax |
487 | ret |
487 | ret |
488 | endp |
488 | endp |
Line 555... | Line 555... | ||
555 | endp |
555 | endp |
556 | 556 | ||
Line 557... | Line 557... | ||
557 | align 4 |
557 | align 4 |
558 | proc kernel_free stdcall, base:dword |
558 | proc kernel_free stdcall, base:dword |
- | 559 | push ebx esi |
|
Line 559... | Line 560... | ||
559 | 560 | ||
560 | mov ebx, heap_mutex |
561 | mov ebx, heap_mutex |
Line 561... | Line 562... | ||
561 | call wait_mutex ;ebx |
562 | call wait_mutex ;ebx |
Line 575... | Line 576... | ||
575 | jne .fail |
576 | jne .fail |
576 | 577 | ||
Line 577... | Line 578... | ||
577 | and [heap_mutex], 0 |
578 | and [heap_mutex], 0 |
Line -... | Line 579... | ||
- | 579 | ||
578 | 580 | push ecx |
|
579 | mov ecx, [esi+block_size]; |
581 | mov ecx, [esi+block_size]; |
580 | shr ecx, 12 |
582 | shr ecx, 12 |
- | 583 | call release_pages ;eax, ecx |
|
581 | call release_pages ;eax, ecx |
584 | pop ecx |
- | 585 | stdcall free_kernel_space, [base] |
|
582 | stdcall free_kernel_space, [base] |
586 | pop esi ebx |
583 | ret |
587 | ret |
584 | .fail: |
588 | .fail: |
- | 589 | and [heap_mutex], 0 |
|
585 | and [heap_mutex], 0 |
590 | pop esi ebx |
586 | ret |
591 | ret |
Line 587... | Line 592... | ||
587 | endp |
592 | endp |
588 | 593 |