fix cpu_usage

git-svn-id: svn://kolibrios.org@9591 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Doczom 2022-01-07 23:03:51 +00:00
parent bb2c454ebe
commit 3d6209fb37
2 changed files with 8 additions and 6 deletions

View File

@ -76,15 +76,16 @@ update_counters:
align 4 align 4
updatecputimes: updatecputimes:
mov ecx, [thread_count] mov ecx, [thread_count]
;mov edi, TASK_DATA mov edi, TASK_DATA
mov edi, SLOT_BASE ;mov dword[edi+TASKDATA.cpu_usage], 0
mov esi, SLOT_BASE
.newupdate: .newupdate:
xor eax, eax xor eax, eax
xchg eax, [edi+TASKDATA.counter_sum] xchg eax, [edi+TASKDATA.counter_sum]
;mov [edi+TASKDATA.cpu_usage], eax ;mov [edi+TASKDATA.cpu_usage], eax
;add edi, 0x20 add edi, 0x20
mov [edi+APPDATA.cpu_usage], eax mov [esi+APPDATA.cpu_usage], eax
add edi, 0x100 ;sizeof.APPDATA add esi, 0x100 ;sizeof.APPDATA
loop .newupdate loop .newupdate
ret ret

View File

@ -2629,12 +2629,13 @@ sys_cpuusage:
mov [ebx], eax mov [ebx], eax
; +10: 11 bytes: name of the process ; +10: 11 bytes: name of the process
push ecx push ecx
lea eax, [ecx*8+SLOT_BASE+APPDATA.app_name] lea eax, [ecx+SLOT_BASE+APPDATA.app_name]
add ebx, 10 add ebx, 10
mov ecx, 11 mov ecx, 11
call memmove call memmove
pop ecx pop ecx
shr ecx, 3
; +22: address of the process in memory ; +22: address of the process in memory
; +26: size of used memory - 1 ; +26: size of used memory - 1
push edi push edi