malloc/free do not change ebx now

git-svn-id: svn://kolibrios.org@3681 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
CleverMouse 2013-06-18 10:33:19 +00:00
parent eebdcf71f9
commit 1a7694e453
5 changed files with 5 additions and 14 deletions

View File

@ -349,10 +349,8 @@ disk_add:
inc eax inc eax
cmp byte [ebx+eax-1], 0 cmp byte [ebx+eax-1], 0
jnz @b jnz @b
; 2b. Call the heap manager. Note that it can change ebx. ; 2b. Call the heap manager.
push ebx
call malloc call malloc
pop ebx
; 2c. Check the result. If allocation failed, go to 7. ; 2c. Check the result. If allocation failed, go to 7.
pop esi ; restore allocated pointer to DISK pop esi ; restore allocated pointer to DISK
test eax, eax test eax, eax

View File

@ -459,10 +459,7 @@ proc usb_after_set_endpoint_size
; save length for step 2 ; save length for step 2
push eax push eax
add eax, sizeof.usb_device_data + 8 add eax, sizeof.usb_device_data + 8
; Note that malloc destroys ebx.
push ebx
call malloc call malloc
pop ebx
; 1b. If failed, say something to the debug board and stop the initialization. ; 1b. If failed, say something to the debug board and stop the initialization.
test eax, eax test eax, eax
jz .nomemory jz .nomemory

View File

@ -1640,12 +1640,10 @@ end virtual
; 1c. We need a temporary buffer. Allocate [packetSize]*2 bytes, so that ; 1c. We need a temporary buffer. Allocate [packetSize]*2 bytes, so that
; there must be [packetSize] bytes on one page, ; there must be [packetSize] bytes on one page,
; plus space for a header uhci_original_buffer. ; plus space for a header uhci_original_buffer.
push ebx
mov eax, [.packetSize] mov eax, [.packetSize]
add eax, eax add eax, eax
add eax, sizeof.uhci_original_buffer add eax, sizeof.uhci_original_buffer
call malloc call malloc
pop ebx
; 1d. If failed, return zero. ; 1d. If failed, return zero.
test eax, eax test eax, eax
jz .nothing jz .nothing

View File

@ -22,7 +22,7 @@ $Revision$
; ;
align 4 align 4
malloc: malloc:
push esi push ebx esi
; nb = ((size+7)&~7)+8; ; nb = ((size+7)&~7)+8;
@ -96,7 +96,7 @@ malloc:
mov ecx, mst.mutex mov ecx, mst.mutex
call mutex_unlock call mutex_unlock
mov eax, esi mov eax, esi
pop esi pop esi ebx
ret ret
.split: .split:
@ -205,7 +205,7 @@ free:
test eax, eax test eax, eax
jz .exit jz .exit
push edi push ebx edi
mov edi, eax mov edi, eax
add edi, -8 add edi, -8
@ -298,7 +298,7 @@ free:
mov eax, esi mov eax, esi
pop esi pop esi
.fail: .fail:
pop edi pop edi ebx
.exit: .exit:
ret ret

View File

@ -166,10 +166,8 @@ fat_create_partition:
; FAT size requires knowledge of some calculated values, which are also used ; FAT size requires knowledge of some calculated values, which are also used
; in the normal operation, let's hope for the best and allocate data now; if ; in the normal operation, let's hope for the best and allocate data now; if
; it will prove wrong, just deallocate it. ; it will prove wrong, just deallocate it.
push ebx
movi eax, sizeof.FAT movi eax, sizeof.FAT
call malloc call malloc
pop ebx
test eax, eax test eax, eax
jz .return0 jz .return0
mov ecx, [ebp+8] mov ecx, [ebp+8]