284,7 → 284,8 |
cmp eax, [heap_free] |
ja .error |
|
spin_lock_irqsave heap_mutex |
mov ecx, heap_mutex |
call mutex_lock |
|
mov eax, [size] |
|
344,7 → 345,8 |
|
call md.add_to_used |
|
spin_unlock_irqrestore heap_mutex |
mov ecx, heap_mutex |
call mutex_unlock |
mov eax, [esi+block_base] |
pop edi |
pop esi |
362,7 → 364,8 |
jmp .add_used |
|
.error_unlock: |
spin_unlock_irqrestore heap_mutex |
mov ecx, heap_mutex |
call mutex_unlock |
.error: |
xor eax, eax |
pop edi |
374,7 → 377,8 |
align 4 |
proc free_kernel_space stdcall uses ebx ecx edx esi edi, base:dword |
|
spin_lock_irqsave heap_mutex |
mov ecx, heap_mutex |
call mutex_lock |
|
mov eax, [base] |
|
442,7 → 446,8 |
lea edx, [mem_block_list+eax*8] |
list_add edi, edx |
.m_eq: |
spin_unlock_irqrestore heap_mutex |
mov ecx, heap_mutex |
call mutex_unlock |
xor eax, eax |
not eax |
ret |
454,7 → 459,8 |
jmp .add_block |
|
.fail: |
spin_unlock_irqrestore heap_mutex |
mov ecx, heap_mutex |
call mutex_unlock |
xor eax, eax |
ret |
endp |
538,15 → 544,17 |
|
push ebx esi |
|
spin_lock_irqsave heap_mutex |
mov ecx, heap_mutex |
call mutex_lock |
|
mov eax, [base] |
call md.find_used |
|
mov ecx, heap_mutex |
cmp [esi+block_flags], USED_BLOCK |
jne .fail |
|
spin_unlock_irqrestore heap_mutex |
call mutex_unlock |
|
mov eax, [esi+block_base] |
mov ecx, [esi+block_size] |
556,7 → 564,7 |
pop esi ebx |
ret |
.fail: |
spin_unlock_irqrestore heap_mutex |
call mutex_unlock |
xor eax, eax |
pop esi ebx |
ret |