From bb2c454ebe7e77cc19373f6f97f2a9fc5b068767 Mon Sep 17 00:00:00 2001 From: Doczom Date: Fri, 7 Jan 2022 21:53:56 +0000 Subject: [PATCH] replacing TASKDATA.cpu_usage with APPDATA.cpu_usage git-svn-id: svn://kolibrios.org@9590 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/sched.inc | 9 ++++++--- kernel/trunk/kernel.asm | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/kernel/trunk/core/sched.inc b/kernel/trunk/core/sched.inc index 2b1d94b05e..6f119e9c4c 100644 --- a/kernel/trunk/core/sched.inc +++ b/kernel/trunk/core/sched.inc @@ -76,12 +76,15 @@ update_counters: align 4 updatecputimes: mov ecx, [thread_count] - mov edi, TASK_DATA + ;mov edi, TASK_DATA + mov edi, SLOT_BASE .newupdate: xor eax, eax xchg eax, [edi+TASKDATA.counter_sum] - mov [edi+TASKDATA.cpu_usage], eax - add edi, 0x20 + ;mov [edi+TASKDATA.cpu_usage], eax + ;add edi, 0x20 + mov [edi+APPDATA.cpu_usage], eax + add edi, 0x100 ;sizeof.APPDATA loop .newupdate ret diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 09c3b890e6..b4d16b3c0e 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -2235,7 +2235,8 @@ sysfn_zmodif: ;------------------------------------------------------------------------------ sysfn_getidletime: ; 18.4 = GET IDLETIME - mov eax, [TASK_TABLE+32+TASKDATA.cpu_usage] + ;mov eax, [TASK_TABLE+32+TASKDATA.cpu_usage] + mov eax, [SLOT_BASE+APPDATA.cpu_usage] mov [esp+32], eax ret ;------------------------------------------------------------------------------ @@ -2620,10 +2621,11 @@ sys_cpuusage: mov ax, [WIN_POS + ecx * 2] mov [ebx+6], ax - shl ecx, 5 + shl ecx, 8 ;5=32 8=256 ; +0: dword: memory usage - mov eax, [ecx+TASK_TABLE+TASKDATA.cpu_usage] + ;mov eax, [ecx+TASK_TABLE+TASKDATA.cpu_usage] + mov eax, [ecx+SLOT_BASE+APPDATA.cpu_usage] mov [ebx], eax ; +10: 11 bytes: name of the process push ecx