/kernel/trunk/core/memory.inc |
---|
13,6 → 13,7 |
pushfd |
cli |
push ebx |
mov ebx, [page_start] |
mov ecx, [page_end] |
.l1: |
21,6 → 22,7 |
add ebx,4 |
cmp ebx, ecx |
jb .l1 |
pop ebx |
popfd |
xor eax,eax |
ret |
31,6 → 33,7 |
lea eax, [eax+ebx*8] |
shl eax, 12 |
dec [pg_data.pages_free] |
pop ebx |
popfd |
ret |
endp |
38,6 → 41,8 |
align 4 |
proc alloc_pages stdcall, count:dword |
pushfd |
push ebx |
push edi |
cli |
mov eax, [count] |
add eax, 7 |
59,7 → 64,10 |
inc ecx |
cmp ecx,ebx |
jb .match |
.fail: xor eax, eax |
.fail: |
xor eax, eax |
pop edi |
pop ebx |
popfd |
ret |
.next: |
66,6 → 74,8 |
inc ecx |
cmp ecx, ebx |
jb .find |
pop edi |
pop ebx |
popfd |
xor eax, eax |
ret |
81,6 → 91,8 |
mov ebx, [count] |
shl ebx, 3 |
sub [pg_data.pages_free], ebx |
pop edi |
pop ebx |
popfd |
ret |
endp |