/kernel/trunk/core/heap.inc |
---|
20,6 → 20,7 |
MEM_LIST_OFFSET equ 8 |
FREE_BLOCK equ 4 |
USED_BLOCK equ 8 |
DONT_FREE_BLOCK equ 10h |
virtual at 0 |
MEM_BLOCK MEM_BLOCK |
728,8 → 729,10 |
sub esi, 4096 |
shr esi, 12 |
mov eax, [page_tabs+esi*4] |
test eax, USED_BLOCK |
test al, USED_BLOCK |
jz .not_used |
test al, DONT_FREE_BLOCK |
jnz .cantfree |
and eax, not 4095 |
mov ecx, eax |
765,6 → 768,9 |
xor eax, eax |
inc eax |
ret |
.cantfree: |
xor eax, eax |
ret |
endp |
user_normalize: |
836,6 → 842,8 |
xor eax, eax |
ret |
@@: |
test edx, DONT_FREE_BLOCK |
jnz .ret0 |
add ebx, 0x1FFF |
shr edx, 12 |
shr ebx, 12 |