diff --git a/kernel/trunk/core/memory.inc b/kernel/trunk/core/memory.inc index 39095115a..0d97232bf 100644 --- a/kernel/trunk/core/memory.inc +++ b/kernel/trunk/core/memory.inc @@ -960,29 +960,29 @@ endp align 4 sysfn_meminfo: - ; add ebx, new_app_base - cmp ebx, OS_BASE + ; add ecx, new_app_base + cmp ecx, OS_BASE jae .fail mov eax, [pg_data.pages_count] - mov [ebx], eax + mov [ecx], eax shl eax, 12 - mov [esp+36], eax - mov ecx, [pg_data.pages_free] - mov [ebx+4], ecx - mov edx, [pg_data.pages_faults] - mov [ebx+8], edx - mov esi, [heap_size] - mov [ebx+12], esi - mov edi, [heap_free] - mov [ebx+16], edi + mov [esp+32], eax + mov eax, [pg_data.pages_free] + mov [ecx+4], eax + mov eax, [pg_data.pages_faults] + mov [ecx+8], eax + mov eax, [heap_size] + mov [ecx+12], eax + mov eax, [heap_free] + mov [ecx+16], eax mov eax, [heap_blocks] - mov [ebx+20], eax - mov ecx, [free_blocks] - mov [ebx+24], ecx + mov [ecx+20], eax + mov eax, [free_blocks] + mov [ecx+24], eax ret .fail: - mov dword [esp+36], -1 + mov dword [esp+32], -1 ret align 4 diff --git a/kernel/trunk/core/taskman.inc b/kernel/trunk/core/taskman.inc index dfce86dfb..35395b7cf 100644 --- a/kernel/trunk/core/taskman.inc +++ b/kernel/trunk/core/taskman.inc @@ -918,18 +918,15 @@ endp align 4 wait_mutex: +;;Maxis use atomic bts for mutex 4.4.2009 push eax push ebx .do_wait: - cmp dword [ebx],0 - je .get_lock + bts dword [ebx],0 + jnc .locked call change_task jmp .do_wait -.get_lock: - mov eax, 1 - xchg eax, [ebx] - test eax, eax - jnz .do_wait +.locked: pop ebx pop eax ret