replacing TASKDATA.counter_sum with APPDATA.counter_sum.

I hope the kernel is working

git-svn-id: svn://kolibrios.org@9593 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Doczom 2022-01-08 15:19:20 +00:00
parent 2db4916440
commit 100cb041bb

View File

@ -69,23 +69,25 @@ endg
align 4 align 4
update_counters: update_counters:
mov edi, [TASK_BASE] mov edi, [TASK_BASE]
mov esi, [current_slot]
rdtsc rdtsc
sub eax, [edi+TASKDATA.counter_add] ; time stamp counter add sub eax, [edi+TASKDATA.counter_add] ; time stamp counter add
add [edi+TASKDATA.counter_sum], eax ; counter sum ;add [edi+TASKDATA.counter_sum], eax ; counter sum
add [esi-sizeof.APPDATA+APPDATA.counter_sum], eax ; counter sum
ret ret
align 4 align 4
updatecputimes: updatecputimes:
mov ecx, [thread_count] mov ecx, [thread_count]
mov edi, TASK_DATA ;mov edi, TASK_DATA
;mov dword[edi+TASKDATA.cpu_usage], 0
mov esi, SLOT_BASE 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 xchg eax, [esi+APPDATA.counter_sum]
;add edi, 0x20
mov [esi+APPDATA.cpu_usage], eax mov [esi+APPDATA.cpu_usage], eax
add esi, 0x100 ;sizeof.APPDATA add esi, sizeof.APPDATA
loop .newupdate loop .newupdate
ret ret