kernel - fix by forum post=23224

event - small optimization, not more

git-svn-id: svn://kolibrios.org@1067 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Galkov 2009-05-02 08:59:16 +00:00
parent 4ad5e0815b
commit a730579b19
2 changed files with 21 additions and 19 deletions

View File

@ -364,7 +364,7 @@ align 4
sys_sendwindowmsg: ;; f72 sys_sendwindowmsg: ;; f72
dec ebx dec ebx
jnz .ret ;subfunction==1 ? jnz .ret ;subfunction==1 ?
pushfd ;pushfd ;à íàôèãà?
cli cli
sub ecx,2 sub ecx,2
je .sendkey je .sendkey
@ -382,8 +382,8 @@ sys_sendwindowmsg: ;; f72
inc byte[KEY_COUNT] inc byte[KEY_COUNT]
mov [KEY_COUNT+1+eax],dl mov [KEY_COUNT+1+eax],dl
.result: .result:
setae byte[esp+36] ;ñ÷èòàåì, ÷òî èñõîäíî: dword[esp+36]==72 setae byte[esp+32] ;ñ÷èòàåì, ÷òî èñõîäíî: dword[esp+32]==72
.retf: popfd .retf: ;popfd
.ret: ret .ret: ret
align 4 align 4

View File

@ -1013,27 +1013,29 @@ osloop:
checkidle: checkidle:
pushad pushad
mov ebx,[timer_ticks] call change_task
call change_task jmp idle_loop_entry
jmp idle_loop_entry idle_loop:
idle_loop: cmp eax,[idlemem] ; eax == [timer_ticks]
cmp ebx,[timer_ticks] jne idle_exit
jne idle_exit rdtsc ;call _rdtsc
rdtsc ;call _rdtsc mov ecx,eax
mov ecx,eax
hlt hlt
rdtsc ;call _rdtsc rdtsc ;call _rdtsc
sub eax,ecx sub eax,ecx
add [idleuse],eax add [idleuse],eax
idle_loop_entry: idle_loop_entry:
cmp [check_idle_semaphore],0 mov eax,[timer_ticks] ; eax = [timer_ticks]
je idle_loop cmp [check_idle_semaphore],0
dec [check_idle_semaphore] je idle_loop
idle_exit: dec [check_idle_semaphore]
idle_exit:
mov [idlemem],eax ; eax == [timer_ticks]
popad popad
ret ret
uglobal uglobal
idlemem dd 0x0
idleuse dd 0x0 idleuse dd 0x0
idleusesec dd 0x0 idleusesec dd 0x0
check_idle_semaphore dd 0x0 check_idle_semaphore dd 0x0