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