From a730579b19c1f6444efada4d6f11796a73d3a5f0 Mon Sep 17 00:00:00 2001 From: Galkov Date: Sat, 2 May 2009 08:59:16 +0000 Subject: [PATCH] kernel - fix by forum post=23224 event - small optimization, not more git-svn-id: svn://kolibrios.org@1067 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/gui/event.inc | 6 +++--- kernel/trunk/kernel.asm | 34 ++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/kernel/trunk/gui/event.inc b/kernel/trunk/gui/event.inc index 96a6ee7ae6..2046feac41 100644 --- a/kernel/trunk/gui/event.inc +++ b/kernel/trunk/gui/event.inc @@ -364,7 +364,7 @@ align 4 sys_sendwindowmsg: ;; f72 dec ebx jnz .ret ;subfunction==1 ? - pushfd + ;pushfd ;а нафига? cli sub ecx,2 je .sendkey @@ -382,8 +382,8 @@ sys_sendwindowmsg: ;; f72 inc byte[KEY_COUNT] mov [KEY_COUNT+1+eax],dl .result: - setae byte[esp+36] ;считаем, что исходно: dword[esp+36]==72 -.retf: popfd + setae byte[esp+32] ;считаем, что исходно: dword[esp+32]==72 +.retf: ;popfd .ret: ret align 4 diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index f5be39cc64..733b16bd35 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -1013,27 +1013,29 @@ osloop: checkidle: pushad - mov ebx,[timer_ticks] - call change_task - jmp idle_loop_entry - idle_loop: - cmp ebx,[timer_ticks] - jne idle_exit - rdtsc ;call _rdtsc - mov ecx,eax + call change_task + jmp idle_loop_entry + idle_loop: + cmp eax,[idlemem] ; eax == [timer_ticks] + jne idle_exit + rdtsc ;call _rdtsc + mov ecx,eax hlt - rdtsc ;call _rdtsc - sub eax,ecx - add [idleuse],eax - idle_loop_entry: - cmp [check_idle_semaphore],0 - je idle_loop - dec [check_idle_semaphore] - idle_exit: + rdtsc ;call _rdtsc + sub eax,ecx + add [idleuse],eax + idle_loop_entry: + mov eax,[timer_ticks] ; eax = [timer_ticks] + cmp [check_idle_semaphore],0 + je idle_loop + dec [check_idle_semaphore] + idle_exit: + mov [idlemem],eax ; eax == [timer_ticks] popad ret uglobal + idlemem dd 0x0 idleuse dd 0x0 idleusesec dd 0x0 check_idle_semaphore dd 0x0