/kernel/trunk/blkdev/disk.inc |
---|
349,10 → 349,8 |
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 |
/kernel/trunk/bus/usb/protocol.inc |
---|
459,10 → 459,7 |
; 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 |
/kernel/trunk/bus/usb/uhci.inc |
---|
1640,12 → 1640,10 |
; 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 |
/kernel/trunk/core/malloc.inc |
---|
22,7 → 22,7 |
; |
align 4 |
malloc: |
push esi |
push ebx esi |
; nb = ((size+7)&~7)+8; |
96,7 → 96,7 |
mov ecx, mst.mutex |
call mutex_unlock |
mov eax, esi |
pop esi |
pop esi ebx |
ret |
.split: |
205,7 → 205,7 |
test eax, eax |
jz .exit |
push edi |
push ebx edi |
mov edi, eax |
add edi, -8 |
298,7 → 298,7 |
mov eax, esi |
pop esi |
.fail: |
pop edi |
pop edi ebx |
.exit: |
ret |
/kernel/trunk/fs/fat32.inc |
---|
166,10 → 166,8 |
; 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] |