forked from KolibriOS/kolibrios
Changes from Maxis:
* Fixed sysfunction 18.20 (bug #13) * wait_mutex optimized (bug #10) git-svn-id: svn://kolibrios.org@1072 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
be9e2b43f3
commit
3d76ee5a5b
@ -960,29 +960,29 @@ endp
|
|||||||
align 4
|
align 4
|
||||||
sysfn_meminfo:
|
sysfn_meminfo:
|
||||||
|
|
||||||
; add ebx, new_app_base
|
; add ecx, new_app_base
|
||||||
cmp ebx, OS_BASE
|
cmp ecx, OS_BASE
|
||||||
jae .fail
|
jae .fail
|
||||||
|
|
||||||
mov eax, [pg_data.pages_count]
|
mov eax, [pg_data.pages_count]
|
||||||
mov [ebx], eax
|
mov [ecx], eax
|
||||||
shl eax, 12
|
shl eax, 12
|
||||||
mov [esp+36], eax
|
mov [esp+32], eax
|
||||||
mov ecx, [pg_data.pages_free]
|
mov eax, [pg_data.pages_free]
|
||||||
mov [ebx+4], ecx
|
mov [ecx+4], eax
|
||||||
mov edx, [pg_data.pages_faults]
|
mov eax, [pg_data.pages_faults]
|
||||||
mov [ebx+8], edx
|
mov [ecx+8], eax
|
||||||
mov esi, [heap_size]
|
mov eax, [heap_size]
|
||||||
mov [ebx+12], esi
|
mov [ecx+12], eax
|
||||||
mov edi, [heap_free]
|
mov eax, [heap_free]
|
||||||
mov [ebx+16], edi
|
mov [ecx+16], eax
|
||||||
mov eax, [heap_blocks]
|
mov eax, [heap_blocks]
|
||||||
mov [ebx+20], eax
|
mov [ecx+20], eax
|
||||||
mov ecx, [free_blocks]
|
mov eax, [free_blocks]
|
||||||
mov [ebx+24], ecx
|
mov [ecx+24], eax
|
||||||
ret
|
ret
|
||||||
.fail:
|
.fail:
|
||||||
mov dword [esp+36], -1
|
mov dword [esp+32], -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
|
@ -918,18 +918,15 @@ endp
|
|||||||
|
|
||||||
align 4
|
align 4
|
||||||
wait_mutex:
|
wait_mutex:
|
||||||
|
;;Maxis use atomic bts for mutex 4.4.2009
|
||||||
push eax
|
push eax
|
||||||
push ebx
|
push ebx
|
||||||
.do_wait:
|
.do_wait:
|
||||||
cmp dword [ebx],0
|
bts dword [ebx],0
|
||||||
je .get_lock
|
jnc .locked
|
||||||
call change_task
|
call change_task
|
||||||
jmp .do_wait
|
jmp .do_wait
|
||||||
.get_lock:
|
.locked:
|
||||||
mov eax, 1
|
|
||||||
xchg eax, [ebx]
|
|
||||||
test eax, eax
|
|
||||||
jnz .do_wait
|
|
||||||
pop ebx
|
pop ebx
|
||||||
pop eax
|
pop eax
|
||||||
ret
|
ret
|
||||||
|
Loading…
Reference in New Issue
Block a user