/kernel/branches/Kolibri-acpi/core/dll.inc |
---|
810,15 → 810,7 |
jnz .ok |
stdcall kernel_free, [img_base] |
cmp dword [file_name+13], 'SOUN' |
jnz @f |
cmp dword [file_name+17], 'D.ob' |
jnz @f |
cmp word [file_name+21], 'j' |
jnz @f |
mov esi, aHDA |
jmp .redo |
@@: |
xor eax, eax |
ret |
.ok: |
/kernel/branches/Kolibri-acpi/core/malloc.inc |
---|
341,10 → 341,9 |
; insert_chunk(p,psize); |
mov eax, esi |
pop esi |
mov ecx, edi |
pop edi |
jmp insert_chunk |
call insert_chunk |
jmp .fail2 |
.unl_large: |
; unlink_large_chunk((tchunkptr)next); |
364,10 → 363,9 |
; insert_chunk(p,psize); |
mov eax, esi |
pop esi |
mov ecx, edi |
pop edi |
jmp insert_chunk |
call insert_chunk |
jmp .fail2 |
.fix_next: |
; (p+psize)->prev_foot = psize; |
386,10 → 384,9 |
; insert_chunk(p,psize); |
mov eax, esi |
pop esi |
mov ecx, edi |
pop edi |
jmp insert_chunk |
call insert_chunk |
jmp .fail2 |
; param |
; ecx = chunk |
418,15 → 415,11 |
mov [esi+8], edx ;P->fd = F |
mov [esi+12], eax ;P->bk = B |
pop esi |
mov ecx, mst.mutex |
call mutex_unlock |
ret |
.large: |
mov ebx, eax |
call insert_large_chunk |
pop esi |
mov ecx, mst.mutex |
call mutex_unlock |
ret |
/kernel/branches/Kolibri-acpi/core/memory.inc |
---|
606,8 → 606,12 |
align 4 |
get_pg_addr: |
sub eax, OS_BASE |
cmp eax, 0x400000 |
jb @f |
shr eax, 12 |
mov eax, [page_tabs+eax*4] |
mov eax, [page_tabs+(eax+(OS_BASE shr 12))*4] |
@@: |
and eax, 0xFFFFF000 |
ret |
/kernel/branches/Kolibri-acpi/core/peload.inc |
---|
300,6 → 300,7 |
malloc, 'Kmalloc', \ |
free, 'Kfree', \ |
map_io_mem, 'MapIoMem', \ ; stdcall |
map_page, 'MapPage', \ ; stdcall |
get_pg_addr, 'GetPgAddr', \ ; eax |
\ |
mutex_init, 'MutexInit', \ ; gcc fastcall |
/kernel/branches/Kolibri-acpi/core/test_malloc.asm |
---|
50,12 → 50,12 |
ret |
run_test3: |
; 1024000 times run random operation. |
; 1024 times run random operation. |
; Randomly select malloc(random size from 1 to 1023) |
; or free(random of previously allocated areas) |
mov edi, 0x12345678 |
xor esi, esi ; 0 areas allocated |
mov ebx, 1024000 |
mov ebx, 1024 |
.loop: |
imul edi, 1103515245 |
add edi, 12345 |
78,7 → 78,11 |
push eax |
; mov ecx, [saved_state_num] |
; mov [saved_state+ecx*8], eax |
push edi |
call malloc_with_test |
pop ecx |
cmp ecx, edi |
jnz edi_destroyed |
; mov ecx, [saved_state_num] |
; mov [saved_state+ecx*8+4], eax |
; inc [saved_state_num] |
113,7 → 117,11 |
jnz memory_destroyed |
pop eax edi |
push ebx edx |
push edi |
call free |
pop ecx |
cmp ecx, edi |
jnz edi_destroyed |
pop edx ebx |
dec esi |
pop eax ecx |
150,9 → 158,15 |
ret |
; Stubs for kernel procedures used by heap code |
wait_mutex: |
inc dword [ebx] |
mutex_init: |
and dword [ecx], 0 |
ret |
mutex_lock: |
inc dword [ecx] |
ret |
mutex_unlock: |
dec dword [ecx] |
ret |
kernel_alloc: |
cmp dword [esp+4], bufsize |
174,7 → 188,7 |
jmp error_with_code |
check_mutex: |
cmp [mst.mutex], 0 |
cmp dword [mst.mutex], 0 |
jnz @f |
ret |
@@: |
195,6 → 209,10 |
mov eax, 5 |
jmp error_with_code |
edi_destroyed: |
mov eax, 6 |
jmp error_with_code |
error_with_code: |
mov edx, saved_state_num |
; eax = error code |
208,6 → 226,7 |
; Include main heap code |
include '../proc32.inc' |
include '../struct.inc' |
include '../const.inc' |
include 'malloc.inc' |