diff --git a/kernel/trunk/blkdev/disk.inc b/kernel/trunk/blkdev/disk.inc index 356f3d8226..48a3b28d93 100644 --- a/kernel/trunk/blkdev/disk.inc +++ b/kernel/trunk/blkdev/disk.inc @@ -349,10 +349,8 @@ disk_add: inc eax cmp byte [ebx+eax-1], 0 jnz @b -; 2b. Call the heap manager. Note that it can change ebx. - push ebx +; 2b. Call the heap manager. call malloc - pop ebx ; 2c. Check the result. If allocation failed, go to 7. pop esi ; restore allocated pointer to DISK test eax, eax diff --git a/kernel/trunk/bus/usb/protocol.inc b/kernel/trunk/bus/usb/protocol.inc index 10fbcf2e72..8fdebf4c80 100644 --- a/kernel/trunk/bus/usb/protocol.inc +++ b/kernel/trunk/bus/usb/protocol.inc @@ -459,10 +459,7 @@ proc usb_after_set_endpoint_size ; save length for step 2 push eax add eax, sizeof.usb_device_data + 8 -; Note that malloc destroys ebx. - push ebx call malloc - pop ebx ; 1b. If failed, say something to the debug board and stop the initialization. test eax, eax jz .nomemory diff --git a/kernel/trunk/bus/usb/uhci.inc b/kernel/trunk/bus/usb/uhci.inc index 58bd9fa1a5..f269b25d5b 100644 --- a/kernel/trunk/bus/usb/uhci.inc +++ b/kernel/trunk/bus/usb/uhci.inc @@ -1640,12 +1640,10 @@ end virtual ; 1c. We need a temporary buffer. Allocate [packetSize]*2 bytes, so that ; there must be [packetSize] bytes on one page, ; plus space for a header uhci_original_buffer. - push ebx mov eax, [.packetSize] add eax, eax add eax, sizeof.uhci_original_buffer call malloc - pop ebx ; 1d. If failed, return zero. test eax, eax jz .nothing diff --git a/kernel/trunk/core/malloc.inc b/kernel/trunk/core/malloc.inc index 7a1939699d..9b1cf98588 100644 --- a/kernel/trunk/core/malloc.inc +++ b/kernel/trunk/core/malloc.inc @@ -22,7 +22,7 @@ $Revision$ ; align 4 malloc: - push esi + push ebx esi ; nb = ((size+7)&~7)+8; @@ -96,7 +96,7 @@ malloc: mov ecx, mst.mutex call mutex_unlock mov eax, esi - pop esi + pop esi ebx ret .split: @@ -205,7 +205,7 @@ free: test eax, eax jz .exit - push edi + push ebx edi mov edi, eax add edi, -8 @@ -298,7 +298,7 @@ free: mov eax, esi pop esi .fail: - pop edi + pop edi ebx .exit: ret diff --git a/kernel/trunk/fs/fat32.inc b/kernel/trunk/fs/fat32.inc index f4f4624daf..90609fc9e5 100644 --- a/kernel/trunk/fs/fat32.inc +++ b/kernel/trunk/fs/fat32.inc @@ -166,10 +166,8 @@ fat_create_partition: ; 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 ; it will prove wrong, just deallocate it. - push ebx movi eax, sizeof.FAT call malloc - pop ebx test eax, eax jz .return0 mov ecx, [ebp+8]