Rev 473 | Rev 593 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 473 | Rev 531 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | $Revision: 473 $ |
1 | $Revision: 531 $ |
2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3 | ;; ;; |
3 | ;; ;; |
4 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
4 | ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
5 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
5 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
6 | ;; Distributed under terms of the GNU General Public License ;; |
6 | ;; Distributed under terms of the GNU General Public License ;; |
Line 467... | Line 467... | ||
467 | 467 | ||
468 | call get_event_for_app |
468 | call get_event_for_app |
469 | mov [esp+36],eax |
469 | mov [esp+36],eax |
Line 470... | Line -... | ||
470 | ret |
- | |
471 | - | ||
472 | - | ||
473 | align 4 |
- | |
474 | sys_wait_event_timeout: |
- | |
475 | - | ||
476 | mov ebx,[timer_ticks] |
- | |
477 | add ebx,eax |
- | |
478 | cmp ebx,[timer_ticks] |
- | |
479 | jna .swfet2 |
- | |
480 | .swfet1: |
- | |
481 | call get_event_for_app |
- | |
482 | test eax,eax |
- | |
483 | jne .eventoccur_time |
- | |
484 | call change_task |
- | |
485 | cmp ebx,[timer_ticks] |
- | |
486 | jg .swfet1 |
- | |
487 | .swfet2: |
- | |
488 | xor eax,eax |
- | |
489 | .eventoccur_time: |
- | |
490 | mov [esp+36],eax |
- | |
491 | ret |
- | |
492 | - | ||
493 | - | ||
494 | align 4 |
470 | ret |
- | 471 | ||
- | 472 | sys_waitforevent: |
|
Line -... | Line 473... | ||
- | 473 | or eax, 0xFFFFFFFF ; infinite timeout |
|
- | 474 | jmp @f |
|
- | 475 | ||
- | 476 | sys_wait_event_timeout: |
|
- | 477 | add eax, [timer_ticks] |
|
495 | 478 | @@: |
|
496 | sys_waitforevent: |
479 | mov ebx, [current_slot] |
497 | 480 | mov [ebx + APPDATA.wait_timeout], eax |
|
498 | call get_event_for_app |
- | |
Line 499... | Line 481... | ||
499 | test eax,eax |
481 | call get_event_for_app |
500 | jne eventoccur |
482 | test eax, eax |
501 | newwait: |
483 | jnz eventoccur |
Line 502... | Line 484... | ||
502 | 484 | ||
503 | mov eax, [TASK_BASE] |
- | |
504 | mov [eax+TASKDATA.state], byte 5 |
485 | mov eax, [TASK_BASE] |
505 | call change_task |
486 | mov [eax+TASKDATA.state], byte 5 |
506 | 487 | call change_task |
|
Line 507... | Line 488... | ||
507 | mov eax, [event_sched] |
488 | |
Line 508... | Line 489... | ||
508 | 489 | mov eax, [event_sched] |
|
Line 509... | Line 490... | ||
509 | eventoccur: |
490 | eventoccur: |
510 | mov [esp+36],eax |
491 | mov [esp+36], eax |
511 | ret |
492 | ret |
512 | 493 | ||
513 | get_event_for_app: |
494 | get_event_for_app: |
514 | 495 | ||
515 | pushad |
496 | pushad |