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 jne .noevents
call get_event_for_app call get_event_for_app
test eax, eax 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 [event_sched], eax
mov [edi+TASKDATA.state], byte 0 mov [edi+TASKDATA.state], byte 0
.noevents: .noevents:

View File

@ -469,53 +469,34 @@ sys_getevent:
mov [esp+36],eax mov [esp+36],eax
ret 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: sys_waitforevent:
or eax, 0xFFFFFFFF ; infinite timeout
jmp @f
call get_event_for_app sys_wait_event_timeout:
test eax,eax add eax, [timer_ticks]
jne eventoccur @@:
newwait: mov ebx, [current_slot]
mov [ebx + APPDATA.wait_timeout], eax
call get_event_for_app
test eax, eax
jnz eventoccur
mov eax, [TASK_BASE] mov eax, [TASK_BASE]
mov [eax+TASKDATA.state], byte 5 mov [eax+TASKDATA.state], byte 5
call change_task call change_task
mov eax, [event_sched] mov eax, [event_sched]
eventoccur:
eventoccur: mov [esp+36], eax
mov [esp+36],eax ret
ret
get_event_for_app: get_event_for_app:
pushad pushad
mov edi,[TASK_BASE] ; WINDOW REDRAW mov edi,[TASK_BASE] ; WINDOW REDRAW
test [edi+TASKDATA.event_mask],dword 1 test [edi+TASKDATA.event_mask], 1
jz no_eventoccur1 jz no_eventoccur1
;mov edi,[TASK_BASE] ;mov edi,[TASK_BASE]
cmp [edi-twdw+WDATA.fl_redraw],byte 0 cmp [edi-twdw+WDATA.fl_redraw],byte 0

View File

@ -107,7 +107,7 @@ use16
org 0x0 org 0x0
jmp start_of_code 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/bootstr.inc" ; language-independent boot messages
include "boot/preboot.inc" include "boot/preboot.inc"
@ -2286,7 +2286,7 @@ endg
iglobal iglobal
version_inf: 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 UID_KOLIBRI
db 'Kolibri',0 db 'Kolibri',0
version_end: version_end:
@ -2454,7 +2454,7 @@ sys_getbackground:
jnz nogb1 jnz nogb1
mov eax,[BgrDataWidth] mov eax,[BgrDataWidth]
shl eax,16 shl eax,16
mov ax,[BgrDataWidth] mov ax,[BgrDataHeight]
mov [esp+36],eax mov [esp+36],eax
ret ret
nogb1: nogb1:

View File

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