From 100cb041bb438f69cf9692eb3aefd34611d5c882 Mon Sep 17 00:00:00 2001 From: Doczom Date: Sat, 8 Jan 2022 15:19:20 +0000 Subject: [PATCH] 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 --- kernel/trunk/core/sched.inc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kernel/trunk/core/sched.inc b/kernel/trunk/core/sched.inc index 6d78b7ebe9..173e71715f 100644 --- a/kernel/trunk/core/sched.inc +++ b/kernel/trunk/core/sched.inc @@ -69,23 +69,25 @@ endg align 4 update_counters: mov edi, [TASK_BASE] + mov esi, [current_slot] rdtsc 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 align 4 updatecputimes: mov ecx, [thread_count] - mov edi, TASK_DATA - ;mov dword[edi+TASKDATA.cpu_usage], 0 + ;mov edi, TASK_DATA mov esi, SLOT_BASE .newupdate: xor eax, eax - xchg eax, [edi+TASKDATA.counter_sum] + ;xchg eax, [edi+TASKDATA.counter_sum] ;mov [edi+TASKDATA.cpu_usage], eax - add edi, 0x20 + xchg eax, [esi+APPDATA.counter_sum] + ;add edi, 0x20 mov [esi+APPDATA.cpu_usage], eax - add esi, 0x100 ;sizeof.APPDATA + add esi, sizeof.APPDATA loop .newupdate ret