219,12 → 219,12 |
.wait: |
mov edx,[CURRENT_TASK] |
shl edx,8 |
; cmp [PROC_BASE+edx+APPDATA.ev_count], 0 |
; je .switch |
cmp [PROC_BASE+edx+APPDATA.ev_count], 0 |
je .switch |
|
add edx, PROC_BASE+APP_EV_OFFSET |
|
mov eax, [edx+APPOBJ.fd] |
mov eax, [edx+EVENT.fd] |
cmp eax, edx |
je .switch |
|
236,6 → 236,7 |
|
and dword [edi-24], 0xFF00FFFF ;clear priority field |
; |
|
test [eax+EVENT.state], MANUAL_RESET |
jnz .done |
|
245,13 → 246,9 |
mov ecx, [eax+APPOBJ.bk] ;and clear events flag |
mov [ebx+APPOBJ.bk], ecx ;if no active events |
mov [ecx+APPOBJ.fd], ebx |
|
and [eax+EVENT.state], not (EVENT_SIGNALED+EVENT_WATCHED) |
|
dec [edx+APPDATA.ev_count-APP_EV_OFFSET] |
jnz @F |
and [edx+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED |
@@: |
popfd |
|
test [eax+EVENT.state], MANUAL_DESTROY |
261,11 → 258,11 |
|
pushfd |
cli |
mov ebx, [edx+APPOBJ.fd] ;insert event into |
mov [eax+APPOBJ.fd], ebx ;objects list |
mov [eax+APPOBJ.bk], edx |
mov [edx+APPOBJ.fd], eax |
mov [ebx+APPOBJ.bk], eax |
mov edx, [ecx+APPOBJ.fd] ;insert event into |
mov [eax+APPOBJ.fd], edx ;objects list |
mov [eax+APPOBJ.bk], ecx |
mov [ecx+APPOBJ.fd], eax |
mov [edx+APPOBJ.bk], eax |
popfd |
.done: |
ret |
350,7 → 347,6 |
; eax= event |
; ebx= id |
; ecx= flags |
; edx= event data |
|
raise_event: |
.event equ esp |
366,18 → 362,7 |
test eax, eax |
jz .fail |
|
mov esi, edx |
test esi, esi |
mov edx, [.event] |
jz @F |
|
push ecx |
lea edi, [edx+EVENT.code] |
mov ecx, 6 |
cld |
rep movsd |
pop ecx |
@@: |
test [edx+EVENT.state], EVENT_SIGNALED |
jnz .done |
|
412,54 → 397,6 |
ret |
restore .event |
|
; param |
; eax= event |
; ebx= id |
align 4 |
clear_event: |
.event equ esp |
push eax |
|
cmp [eax+APPOBJ.magic], 'EVNT' |
jne .fail |
cmp [eax+EVENT.id], ebx |
jne .fail |
|
mov eax, [eax+APPOBJ.pid] |
call pid_to_slot |
test eax, eax |
jz .fail |
|
shl eax, 8 |
add eax, PROC_BASE+APP_EV_OFFSET |
mov edx, [.event] |
pushfd |
cli ;remove event from events |
mov ebx, [edx+APPOBJ.fd] ;list (reset event) |
mov ecx, [edx+APPOBJ.bk] ;and clear events flag |
mov [ebx+APPOBJ.bk], ecx ;if no active events |
mov [ecx+APPOBJ.fd], ebx |
|
and [edx+EVENT.state], not (EVENT_SIGNALED+EVENT_WATCHED) |
|
dec [eax+APPDATA.ev_count-APP_EV_OFFSET] |
jnz @F |
and [eax+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED |
@@: |
add eax, (APP_OBJ_OFFSET-APP_EV_OFFSET) |
|
mov ecx, [eax+APPOBJ.fd] ;insert event into |
mov [edx+APPOBJ.fd], ecx ;objects list |
mov [edx+APPOBJ.bk], eax |
mov [eax+APPOBJ.fd], edx |
mov [ecx+APPOBJ.bk], edx |
popfd |
.fail: |
.done: |
add esp, 4 |
ret |
restore .event |
|
sys_getevent: |
|
call get_event_for_app |