Rev 363 | Rev 379 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 363 | Rev 377 | ||
---|---|---|---|
Line 217... | Line 217... | ||
217 | 217 | ||
Line 218... | Line 218... | ||
218 | .wait: |
218 | .wait: |
219 | mov edx,[CURRENT_TASK] |
219 | mov edx,[CURRENT_TASK] |
220 | shl edx,8 |
220 | shl edx,8 |
221 | cmp [PROC_BASE+edx+APPDATA.ev_count], 0 |
221 | ; cmp [PROC_BASE+edx+APPDATA.ev_count], 0 |
222 | je .switch |
222 | ; je .switch |
Line 223... | Line 223... | ||
223 | 223 | ||
Line 224... | Line 224... | ||
224 | add edx, PROC_BASE+APP_EV_OFFSET |
224 | add edx, PROC_BASE+APP_EV_OFFSET |
225 | 225 | ||
226 | mov eax, [edx+EVENT.fd] |
226 | mov eax, [edx+APPOBJ.fd] |
Line 227... | Line 227... | ||
227 | cmp eax, edx |
227 | cmp eax, edx |
228 | je .switch |
228 | je .switch |
Line 234... | Line 234... | ||
234 | rep movsd |
234 | rep movsd |
235 | 235 | ||
Line 236... | Line 236... | ||
236 | and dword [edi-24], 0xFF00FFFF ;clear priority field |
236 | and dword [edi-24], 0xFF00FFFF ;clear priority field |
237 | ; |
237 | ; |
238 | - | ||
239 | test [eax+EVENT.state], MANUAL_RESET |
238 | test [eax+EVENT.state], MANUAL_RESET |
240 | jnz .done |
239 | jnz .done |
Line 241... | Line 240... | ||
241 | 240 | ||
242 | pushfd |
241 | pushfd |
243 | cli ;remove event from events |
242 | cli ;remove event from events |
244 | mov ebx, [eax+APPOBJ.fd] ;list (reset event) |
243 | mov ebx, [eax+APPOBJ.fd] ;list (reset event) |
245 | mov ecx, [eax+APPOBJ.bk] ;and clear events flag |
244 | mov ecx, [eax+APPOBJ.bk] ;and clear events flag |
246 | mov [ebx+APPOBJ.bk], ecx ;if no active events |
245 | mov [ebx+APPOBJ.bk], ecx ;if no active events |
- | 246 | mov [ecx+APPOBJ.fd], ebx |
|
- | 247 | ||
- | 248 | and [eax+EVENT.state], not (EVENT_SIGNALED+EVENT_WATCHED) |
|
247 | mov [ecx+APPOBJ.fd], ebx |
249 | |
248 | dec [edx+APPDATA.ev_count-APP_EV_OFFSET] |
250 | dec [edx+APPDATA.ev_count-APP_EV_OFFSET] |
249 | jnz @F |
251 | jnz @F |
- | 252 | and [edx+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED |
|
250 | and [edx+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED |
253 | @@: |
Line 251... | Line 254... | ||
251 | popfd |
254 | popfd |
252 | 255 | ||
Line 253... | Line 256... | ||
253 | test [eax+EVENT.state], MANUAL_DESTROY |
256 | test [eax+EVENT.state], MANUAL_DESTROY |
Line 254... | Line 257... | ||
254 | jz .destroy |
257 | jz .destroy |
255 | 258 | ||
256 | add edx, (APP_OBJ_OFFSET-APP_EV_OFFSET) |
259 | add edx, (APP_OBJ_OFFSET-APP_EV_OFFSET) |
257 | 260 | ||
258 | pushfd |
261 | pushfd |
259 | cli |
262 | cli |
260 | mov edx, [ecx+APPOBJ.fd] ;insert event into |
263 | mov ebx, [edx+APPOBJ.fd] ;insert event into |
261 | mov [eax+APPOBJ.fd], edx ;objects list |
264 | mov [eax+APPOBJ.fd], ebx ;objects list |
262 | mov [eax+APPOBJ.bk], ecx |
265 | mov [eax+APPOBJ.bk], edx |
263 | mov [ecx+APPOBJ.fd], eax |
266 | mov [edx+APPOBJ.fd], eax |
Line 264... | Line 267... | ||
264 | mov [edx+APPOBJ.bk], eax |
267 | mov [ebx+APPOBJ.bk], eax |
Line 345... | Line 348... | ||
345 | ; param |
348 | ; param |
346 | ; eax= event |
349 | ; eax= event |
347 | ; ebx= id |
350 | ; ebx= id |
348 | ; ecx= flags |
351 | ; ecx= flags |
- | 352 | ; edx= event data |
|
Line 349... | Line 353... | ||
349 | 353 | ||
350 | raise_event: |
354 | raise_event: |
351 | .event equ esp |
355 | .event equ esp |
Line 360... | Line 364... | ||
360 | call pid_to_slot |
364 | call pid_to_slot |
361 | test eax, eax |
365 | test eax, eax |
362 | jz .fail |
366 | jz .fail |
363 | 367 | ||
Line -... | Line 368... | ||
- | 368 | mov esi, edx |
|
- | 369 | test esi, esi |
|
364 | mov edx, [.event] |
370 | mov edx, [.event] |
- | 371 | jz @F |
|
- | 372 | ||
- | 373 | push ecx |
|
- | 374 | lea edi, [edx+EVENT.code] |
|
- | 375 | mov ecx, 6 |
|
- | 376 | cld |
|
- | 377 | rep movsd |
|
- | 378 | pop ecx |
|
- | 379 | @@: |
|
365 | test [edx+EVENT.state], EVENT_SIGNALED |
380 | test [edx+EVENT.state], EVENT_SIGNALED |
366 | jnz .done |
381 | jnz .done |
Line 367... | Line 382... | ||
367 | 382 | ||
368 | test ecx, EVENT_WATCHED |
383 | test ecx, EVENT_WATCHED |
Line 393... | Line 408... | ||
393 | .fail: |
408 | .fail: |
394 | .done: |
409 | .done: |
395 | add esp, 4 |
410 | add esp, 4 |
396 | ret |
411 | ret |
397 | restore .event |
412 | restore .event |
- | 413 | ||
- | 414 | ; param |
|
- | 415 | ; eax= event |
|
- | 416 | ; ebx= id |
|
- | 417 | align 4 |
|
- | 418 | clear_event: |
|
- | 419 | .event equ esp |
|
- | 420 | push eax |
|
- | 421 | ||
- | 422 | cmp [eax+APPOBJ.magic], 'EVNT' |
|
- | 423 | jne .fail |
|
- | 424 | cmp [eax+EVENT.id], ebx |
|
- | 425 | jne .fail |
|
- | 426 | ||
- | 427 | mov eax, [eax+APPOBJ.pid] |
|
- | 428 | call pid_to_slot |
|
- | 429 | test eax, eax |
|
- | 430 | jz .fail |
|
- | 431 | ||
- | 432 | shl eax, 8 |
|
- | 433 | add eax, PROC_BASE+APP_EV_OFFSET |
|
- | 434 | mov edx, [.event] |
|
- | 435 | pushfd |
|
- | 436 | cli ;remove event from events |
|
- | 437 | mov ebx, [edx+APPOBJ.fd] ;list (reset event) |
|
- | 438 | mov ecx, [edx+APPOBJ.bk] ;and clear events flag |
|
- | 439 | mov [ebx+APPOBJ.bk], ecx ;if no active events |
|
- | 440 | mov [ecx+APPOBJ.fd], ebx |
|
- | 441 | ||
- | 442 | and [edx+EVENT.state], not (EVENT_SIGNALED+EVENT_WATCHED) |
|
- | 443 | ||
- | 444 | dec [eax+APPDATA.ev_count-APP_EV_OFFSET] |
|
- | 445 | jnz @F |
|
- | 446 | and [eax+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED |
|
- | 447 | @@: |
|
- | 448 | add eax, (APP_OBJ_OFFSET-APP_EV_OFFSET) |
|
- | 449 | ||
- | 450 | mov ecx, [eax+APPOBJ.fd] ;insert event into |
|
- | 451 | mov [edx+APPOBJ.fd], ecx ;objects list |
|
- | 452 | mov [edx+APPOBJ.bk], eax |
|
- | 453 | mov [eax+APPOBJ.fd], edx |
|
- | 454 | mov [ecx+APPOBJ.bk], edx |
|
- | 455 | popfd |
|
- | 456 | .fail: |
|
- | 457 | .done: |
|
- | 458 | add esp, 4 |
|
- | 459 | ret |
|
- | 460 | restore .event |
|
398 | 461 | ||
Line 399... | Line 462... | ||
399 | sys_getevent: |
462 | sys_getevent: |
Line 400... | Line 463... | ||
400 | 463 |