Sysfunction 23v does not require task switch when waiting

git-svn-id: svn://kolibrios.org@531 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2007-06-04 08:58:32 +00:00
parent 957ae391e2
commit 58a419e855
4 changed files with 31 additions and 42 deletions

View File

@ -172,7 +172,14 @@ find_next_task:
jne .noevents
call get_event_for_app
test eax, eax
jz .waiting_for_event
jnz @f
mov eax, ebx
shl eax, 8
mov eax, [SLOT_BASE + APPDATA.wait_timeout + eax]
cmp eax, [timer_ticks]
jae .waiting_for_event
xor eax, eax
@@:
mov [event_sched], eax
mov [edi+TASKDATA.state], byte 0
.noevents:

View File

@ -469,43 +469,24 @@ sys_getevent:
mov [esp+36],eax
ret
align 4
sys_wait_event_timeout:
mov ebx,[timer_ticks]
add ebx,eax
cmp ebx,[timer_ticks]
jna .swfet2
.swfet1:
call get_event_for_app
test eax,eax
jne .eventoccur_time
call change_task
cmp ebx,[timer_ticks]
jg .swfet1
.swfet2:
xor eax,eax
.eventoccur_time:
mov [esp+36],eax
ret
align 4
sys_waitforevent:
or eax, 0xFFFFFFFF ; infinite timeout
jmp @f
sys_wait_event_timeout:
add eax, [timer_ticks]
@@:
mov ebx, [current_slot]
mov [ebx + APPDATA.wait_timeout], eax
call get_event_for_app
test eax, eax
jne eventoccur
newwait:
jnz eventoccur
mov eax, [TASK_BASE]
mov [eax+TASKDATA.state], byte 5
call change_task
mov eax, [event_sched]
eventoccur:
mov [esp+36], eax
ret
@ -515,7 +496,7 @@ get_event_for_app:
pushad
mov edi,[TASK_BASE] ; WINDOW REDRAW
test [edi+TASKDATA.event_mask],dword 1
test [edi+TASKDATA.event_mask], 1
jz no_eventoccur1
;mov edi,[TASK_BASE]
cmp [edi-twdw+WDATA.fl_redraw],byte 0

View File

@ -107,7 +107,7 @@ use16
org 0x0
jmp start_of_code
version db 'Kolibri OS version 0.7.0.0 pre ',13,10,13,10,0
version db 'Kolibri OS version 0.6.5.0 ',13,10,13,10,0
include "boot/bootstr.inc" ; language-independent boot messages
include "boot/preboot.inc"
@ -2286,7 +2286,7 @@ endg
iglobal
version_inf:
db 0,7,0,0 ; version 0.7.0.0
db 0,6,5,0 ; version 0.6.5.0
db UID_KOLIBRI
db 'Kolibri',0
version_end:
@ -2454,7 +2454,7 @@ sys_getbackground:
jnz nogb1
mov eax,[BgrDataWidth]
shl eax,16
mov ax,[BgrDataWidth]
mov ax,[BgrDataHeight]
mov [esp+36],eax
ret
nogb1:

View File

@ -127,8 +127,9 @@ struc APPDATA
.io_map rd 2 ;+68
.dbg_state dd ? ;+76
.cur_dir dd ? ;+80
.wait_timeout dd ? ;+84
db 44 dup(?) ;+84
db 40 dup(?) ;+88
.wnd_shape dd ? ;+128
.wnd_shape_scale dd ? ;+132