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
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

View File

@ -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