Rev 379 | Rev 381 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
227 | serge | 1 | |
2 | init_events: |
||
3 | stdcall kernel_alloc, 512*EVENT_SIZE |
||
354 | serge | 4 | mov [events], eax |
227 | serge | 5 | xor eax, eax |
6 | mov [event_uid], eax |
||
354 | serge | 7 | not eax |
227 | serge | 8 | mov edi, event_map |
9 | mov [event_start], edi |
||
10 | mov ecx, 64/4 |
||
354 | serge | 11 | cld |
227 | serge | 12 | rep stosd |
13 | mov [event_end], edi |
||
14 | ret |
||
15 | |||
16 | |||
17 | proc alloc_event |
||
18 | |||
19 | |||
20 | cli |
||
21 | mov ebx, [event_start] |
||
22 | mov ecx, [event_end] |
||
23 | .l1: |
||
24 | bsf eax,[ebx] |
||
25 | jnz .found |
||
26 | add ebx,4 |
||
27 | cmp ebx, ecx |
||
28 | jb .l1 |
||
29 | popfd |
||
30 | xor eax,eax |
||
31 | ret |
||
32 | .found: |
||
33 | btr [ebx], eax |
||
34 | mov [event_start],ebx |
||
35 | inc [event_uid] |
||
354 | serge | 36 | |
37 | |||
227 | serge | 38 | lea eax,[eax+ebx*8] |
254 | serge | 39 | |
354 | serge | 40 | |
41 | shl eax,5 |
||
227 | serge | 42 | lea eax,[eax+ebx*4] ;eax*=52 (EVENT_SIZE) |
354 | serge | 43 | add eax, [events] |
227 | serge | 44 | mov ebx, [event_uid] |
354 | serge | 45 | popfd |
227 | serge | 46 | ret |
47 | endp |
||
48 | |||
49 | |||
50 | free_event: |
||
51 | sub eax, [events] |
||
354 | serge | 52 | mov ecx, EVENT_SIZE |
53 | mov ebx, event_map |
||
54 | cdq |
||
55 | div ecx |
||
56 | |||
57 | |||
227 | serge | 58 | cli |
59 | bts [ebx], eax |
||
60 | shr eax, 3 |
||
61 | and eax, not 3 |
||
62 | add eax, ebx |
||
63 | cmp [event_start], eax |
||
64 | ja @f |
||
65 | popfd |
||
66 | ret |
||
67 | @@: |
||
68 | mov [event_start], eax |
||
69 | popfd |
||
70 | ret |
||
71 | |||
72 | |||
354 | serge | 73 | EVENT_SIGNALED equ 0x20000000 |
74 | MANUAL_RESET equ 0x40000000 |
||
75 | MANUAL_DESTROY equ 0x80000000 |
||
76 | |||
77 | |||
78 | |||
79 | ; eax= event data |
||
80 | ; ebx= flags |
||
81 | ; |
||
82 | ; retval |
||
83 | ; eax= event |
||
84 | ; edx= id |
||
85 | |||
86 | |||
87 | .flags equ esp+4 |
||
88 | .data equ esp |
||
89 | |||
90 | |||
91 | push eax |
||
92 | |||
93 | |||
94 | test eax, eax |
||
95 | jz .fail |
||
96 | |||
97 | |||
98 | mov [eax+APPOBJ.destroy], destroy_event.internal |
||
363 | serge | 99 | mov [eax+EVENT.id], ebx |
354 | serge | 100 | |
101 | |||
102 | shl ebx, 5 |
||
103 | mov ebx, [CURRENT_TASK+ebx+4] |
||
379 | serge | 104 | mov [eax+APPOBJ.pid], ebx |
354 | serge | 105 | mov edx, [.flags] |
106 | mov [eax+EVENT.state], edx |
||
107 | |||
108 | |||
109 | test esi, esi |
||
110 | jz @F |
||
111 | lea edi, [eax+EVENT.code] |
||
112 | mov ecx, 6 |
||
113 | cld |
||
114 | rep movsd |
||
115 | @@: |
||
116 | mov ecx, [CURRENT_TASK] |
||
117 | shl ecx,8 |
||
118 | add ecx, SLOT_BASE+APP_OBJ_OFFSET |
||
380 | serge | 119 | |
354 | serge | 120 | |
121 | cli |
||
122 | mov edx, [ecx+APPOBJ.fd] |
||
123 | mov [eax+APPOBJ.fd], edx |
||
124 | mov [eax+APPOBJ.bk], ecx |
||
125 | mov [ecx+APPOBJ.fd], eax |
||
126 | mov [edx+APPOBJ.bk], eax |
||
127 | popfd |
||
128 | mov edx, [eax+EVENT.id] |
||
129 | .fail: |
||
130 | add esp, 8 |
||
131 | ret |
||
132 | |||
133 | |||
134 | restore .data |
||
135 | |||
136 | |||
137 | ; eax= event |
||
138 | ; ebx= id |
||
139 | |||
140 | |||
141 | |||
142 | |||
143 | jne .fail |
||
144 | cmp [eax+EVENT.id], ebx |
||
145 | jne .fail |
||
146 | .internal: |
||
363 | serge | 147 | mov ebx, [eax+APPOBJ.fd] |
354 | serge | 148 | mov ecx, [eax+APPOBJ.bk] |
149 | mov [ebx+APPOBJ.bk], ecx |
||
150 | mov [ecx+APPOBJ.fd], ebx |
||
151 | .force: |
||
363 | serge | 152 | xor edx, edx ;clear common header |
354 | serge | 153 | mov [eax], edx |
154 | mov [eax+4], edx |
||
155 | mov [eax+8], edx |
||
156 | mov [eax+12], edx |
||
157 | mov [eax+16], edx |
||
158 | |||
159 | |||
160 | .fail: |
||
161 | ret |
||
162 | |||
163 | |||
227 | serge | 164 | proc send_event stdcall pid:dword, event:dword |
165 | locals |
||
166 | slot dd ? |
||
167 | endl |
||
168 | |||
169 | |||
170 | call pid_to_slot |
||
171 | test eax, eax |
||
172 | jz .fail |
||
173 | |||
174 | |||
175 | cmp [SLOT_BASE+eax+APPDATA.ev_count], 32 |
||
380 | serge | 176 | ja .fail |
227 | serge | 177 | |
178 | |||
179 | |||
354 | serge | 180 | |
227 | serge | 181 | test eax, eax |
182 | jz .fail |
||
183 | |||
184 | |||
354 | serge | 185 | mov ecx, 6 |
227 | serge | 186 | mov esi, [event] |
187 | cld |
||
188 | rep movsd |
||
189 | |||
190 | |||
354 | serge | 191 | add ecx, SLOT_BASE+APP_EV_OFFSET |
380 | serge | 192 | |
354 | serge | 193 | |
194 | mov [eax+APPOBJ.destroy], destroy_event |
||
195 | mov ebx, [pid] |
||
196 | mov [eax+APPOBJ.pid], ebx |
||
197 | mov [eax+EVENT.state], EVENT_SIGNALED |
||
198 | |||
199 | |||
200 | cli ;insert event into |
||
201 | mov edx, [ecx+APPOBJ.fd] ;events list |
||
202 | mov [eax+APPOBJ.fd], edx ;and set events flag |
||
203 | mov [eax+APPOBJ.bk], ecx |
||
204 | mov [ecx+APPOBJ.fd], eax |
||
205 | mov [edx+APPOBJ.bk], eax |
||
206 | inc [ecx+APPDATA.ev_count-APP_EV_OFFSET] |
||
207 | or [ecx+APPDATA.event_mask-APP_EV_OFFSET], EVENT_EXTENDED |
||
208 | popfd |
||
209 | .fail: |
||
227 | serge | 210 | ret |
211 | endp |
||
212 | |||
213 | |||
354 | serge | 214 | |
215 | |||
227 | serge | 216 | proc get_event_ex stdcall, p_ev:dword, timeout:dword |
217 | |||
218 | |||
219 | mov edx,[CURRENT_TASK] |
||
354 | serge | 220 | shl edx,8 |
221 | ; cmp [SLOT_BASE+edx+APPDATA.ev_count], 0 |
||
380 | serge | 222 | ; je .switch |
377 | serge | 223 | |
227 | serge | 224 | |
380 | serge | 225 | |
227 | serge | 226 | |
377 | serge | 227 | cmp eax, edx |
354 | serge | 228 | je .switch |
229 | |||
230 | |||
231 | mov edi, [p_ev] ;copy event data |
||
232 | mov ecx, 6 |
||
227 | serge | 233 | cld |
234 | rep movsd |
||
235 | |||
354 | serge | 236 | |
237 | ; |
||
377 | serge | 238 | test [eax+EVENT.state], MANUAL_RESET |
354 | serge | 239 | jnz .done |
240 | |||
241 | |||
242 | cli ;remove event from events |
||
243 | mov ebx, [eax+APPOBJ.fd] ;list (reset event) |
||
244 | mov ecx, [eax+APPOBJ.bk] ;and clear events flag |
||
245 | mov [ebx+APPOBJ.bk], ecx ;if no active events |
||
246 | mov [ecx+APPOBJ.fd], ebx |
||
247 | |||
377 | serge | 248 | |
249 | |||
250 | |||
354 | serge | 251 | jnz @F |
252 | and [edx+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED |
||
253 | @@: |
||
377 | serge | 254 | popfd |
354 | serge | 255 | |
256 | |||
257 | jz .destroy |
||
258 | |||
259 | |||
260 | |||
261 | |||
262 | cli |
||
263 | mov ebx, [edx+APPOBJ.fd] ;insert event into |
||
377 | serge | 264 | mov [eax+APPOBJ.fd], ebx ;objects list |
265 | mov [eax+APPOBJ.bk], edx |
||
266 | mov [edx+APPOBJ.fd], eax |
||
267 | mov [ebx+APPOBJ.bk], eax |
||
268 | popfd |
||
354 | serge | 269 | .done: |
270 | ret |
||
227 | serge | 271 | |
354 | serge | 272 | |
273 | call destroy_event.force |
||
363 | serge | 274 | ret |
354 | serge | 275 | .switch: |
227 | serge | 276 | mov eax, [TASK_BASE] |
379 | serge | 277 | mov [eax+TASKDATA.state], byte 5 |
227 | serge | 278 | call change_task |
279 | jmp .wait |
||
280 | endp |
||
281 | |||
282 | |||
354 | serge | 283 | ; eax= event |
284 | ; ebx= id |
||
285 | |||
286 | |||
287 | wait_event: |
||
288 | .event equ esp |
||
289 | push eax |
||
290 | .wait: |
||
291 | cmp [eax+APPOBJ.magic], 'EVNT' |
||
292 | jne .done |
||
293 | cmp [eax+EVENT.id], ebx |
||
294 | jne .done |
||
295 | |||
296 | |||
297 | jz .switch |
||
298 | |||
299 | |||
300 | jnz .done |
||
301 | |||
302 | |||
303 | shl edx,8 |
||
304 | add edx, SLOT_BASE |
||
380 | serge | 305 | |
354 | serge | 306 | |
307 | cli ;remove event from events |
||
308 | mov ebx, [eax+APPOBJ.fd] ;list (reset event) |
||
309 | mov ecx, [eax+APPOBJ.bk] ;and clear events flag |
||
310 | mov [ebx+APPOBJ.bk], ecx ;if no active events |
||
311 | mov [ecx+APPOBJ.fd], ebx |
||
312 | dec [edx+APPDATA.ev_count] |
||
313 | jnz @F |
||
314 | and [edx+APPDATA.event_mask], not EVENT_EXTENDED |
||
315 | @@: |
||
316 | and [eax+EVENT.state], not (EVENT_SIGNALED+EVENT_WATCHED) |
||
317 | popfd |
||
318 | |||
319 | |||
320 | jz .destroy |
||
321 | |||
322 | |||
323 | |||
324 | |||
325 | cli |
||
326 | mov ecx, [edx+APPOBJ.fd] ;insert event into |
||
327 | mov [eax+APPOBJ.fd], ecx ;objects list |
||
328 | mov [eax+APPOBJ.bk], edx |
||
329 | mov [edx+APPOBJ.fd], eax |
||
330 | mov [ecx+APPOBJ.bk], eax |
||
331 | popfd |
||
332 | .done: |
||
333 | add esp, 4 |
||
334 | ret |
||
335 | .destroy: |
||
336 | call destroy_event.force |
||
363 | serge | 337 | add esp, 4 |
354 | serge | 338 | ret |
339 | .switch: |
||
340 | or [eax+EVENT.state], EVENT_WATCHED |
||
341 | mov eax, [TASK_BASE] |
||
379 | serge | 342 | mov [eax+TASKDATA.state], byte 5 |
354 | serge | 343 | call change_task |
344 | mov eax, [.event] |
||
345 | jmp .wait |
||
346 | restore .event |
||
347 | |||
348 | |||
349 | ; eax= event |
||
350 | ; ebx= id |
||
351 | ; ecx= flags |
||
352 | ; edx= event data |
||
377 | serge | 353 | |
354 | serge | 354 | |
355 | .event equ esp |
||
356 | push eax |
||
357 | |||
358 | |||
359 | jne .fail |
||
360 | cmp [eax+EVENT.id], ebx |
||
361 | jne .fail |
||
362 | |||
363 | |||
364 | call pid_to_slot |
||
365 | test eax, eax |
||
366 | jz .fail |
||
367 | |||
368 | |||
377 | serge | 369 | test esi, esi |
370 | mov edx, [.event] |
||
354 | serge | 371 | jz @F |
377 | serge | 372 | |
373 | |||
374 | lea edi, [edx+EVENT.code] |
||
375 | mov ecx, 6 |
||
376 | cld |
||
377 | rep movsd |
||
378 | pop ecx |
||
379 | @@: |
||
380 | test [edx+EVENT.state], EVENT_SIGNALED |
||
354 | serge | 381 | jnz .done |
382 | |||
383 | |||
384 | jz @F |
||
385 | test [edx+EVENT.state], EVENT_WATCHED |
||
386 | jz .done |
||
387 | @@: |
||
388 | shl eax, 8 |
||
389 | add eax, SLOT_BASE+APP_EV_OFFSET |
||
380 | serge | 390 | |
354 | serge | 391 | |
392 | cli |
||
393 | mov ebx, [edx+APPOBJ.fd] |
||
394 | mov ecx, [edx+APPOBJ.bk] |
||
395 | mov [ebx+APPOBJ.bk], ecx |
||
396 | mov [ecx+APPOBJ.fd], ebx |
||
397 | |||
398 | |||
399 | mov [edx+APPOBJ.fd], ecx |
||
400 | mov [edx+APPOBJ.bk], eax |
||
401 | mov [eax+APPOBJ.fd], edx |
||
402 | mov [ecx+APPOBJ.bk], edx |
||
403 | or [edx+EVENT.state], EVENT_SIGNALED |
||
404 | |||
405 | |||
406 | or [eax+APPDATA.event_mask-APP_EV_OFFSET], EVENT_EXTENDED |
||
407 | popfd |
||
408 | .fail: |
||
409 | .done: |
||
410 | add esp, 4 |
||
411 | ret |
||
412 | restore .event |
||
413 | |||
414 | |||
377 | serge | 415 | ; eax= event |
416 | ; ebx= id |
||
417 | align 4 |
||
418 | clear_event: |
||
419 | .event equ esp |
||
420 | push eax |
||
421 | |||
422 | |||
423 | jne .fail |
||
424 | cmp [eax+EVENT.id], ebx |
||
425 | jne .fail |
||
426 | |||
427 | |||
428 | call pid_to_slot |
||
429 | test eax, eax |
||
430 | jz .fail |
||
431 | |||
432 | |||
433 | add eax, SLOT_BASE+APP_EV_OFFSET |
||
380 | serge | 434 | mov edx, [.event] |
377 | serge | 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 | |||
443 | |||
444 | |||
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 | |||
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 |
||
461 | |||
462 | |||
1 | ha | 463 | |
464 | |||
465 | mov [esp+36],eax |
||
466 | ret |
||
467 | |||
468 | |||
469 | |||
470 | sys_wait_event_timeout: |
||
471 | |||
472 | |||
21 | poddubny | 473 | add ebx,eax |
1 | ha | 474 | cmp ebx,[timer_ticks] |
21 | poddubny | 475 | jna .swfet2 |
1 | ha | 476 | .swfet1: |
227 | serge | 477 | call get_event_for_app |
1 | ha | 478 | test eax,eax |
479 | jne .eventoccur_time |
||
480 | call change_task |
||
481 | cmp ebx,[timer_ticks] |
||
21 | poddubny | 482 | jg .swfet1 |
1 | ha | 483 | .swfet2: |
227 | serge | 484 | xor eax,eax |
1 | ha | 485 | .eventoccur_time: |
227 | serge | 486 | mov [esp+36],eax |
1 | ha | 487 | ret |
488 | |||
489 | |||
490 | |||
491 | |||
492 | |||
493 | |||
494 | |||
495 | test eax,eax |
||
496 | jne eventoccur |
||
497 | newwait: |
||
498 | |||
499 | |||
379 | serge | 500 | mov [eax+TASKDATA.state], byte 5 |
115 | poddubny | 501 | call change_task |
1 | ha | 502 | |
503 | |||
21 | poddubny | 504 | |
505 | |||
1 | ha | 506 | mov [esp+36],eax |
507 | ret |
||
508 | |||
509 | |||
510 | |||
511 | |||
512 | |||
513 | |||
379 | serge | 514 | test [edi+TASKDATA.event_mask],dword 1 |
115 | poddubny | 515 | jz no_eventoccur1 |
1 | ha | 516 | ;mov edi,[TASK_BASE] |
379 | serge | 517 | cmp [edi-twdw+WDATA.fl_redraw],byte 0 |
115 | poddubny | 518 | je no_eventoccur1 |
1 | ha | 519 | popad |
520 | mov eax,1 |
||
521 | ret |
||
522 | no_eventoccur1: |
||
523 | |||
524 | |||
379 | serge | 525 | test [edi+TASKDATA.event_mask],dword 2 |
115 | poddubny | 526 | jz no_eventoccur2 |
1 | ha | 527 | mov ecx, [CURRENT_TASK] |
379 | serge | 528 | movzx edx,word [WIN_STACK+ecx*2] |
380 | serge | 529 | mov eax, [TASK_COUNT] |
379 | serge | 530 | cmp eax,edx |
1 | ha | 531 | jne no_eventoccur2x |
92 | diamond | 532 | cmp [0xf400],byte 0 |
1 | ha | 533 | je no_eventoccur2x |
92 | diamond | 534 | eventoccur2: |
535 | popad |
||
1 | ha | 536 | mov eax,2 |
537 | ret |
||
538 | no_eventoccur2x: |
||
92 | diamond | 539 | mov eax, hotkey_buffer |
540 | @@: |
||
541 | cmp [eax], ecx |
||
542 | jz eventoccur2 |
||
543 | add eax, 8 |
||
544 | cmp eax, hotkey_buffer+120*8 |
||
545 | jb @b |
||
546 | no_eventoccur2: |
||
1 | ha | 547 | |
548 | |||
379 | serge | 549 | test [edi+TASKDATA.event_mask],dword 4 |
115 | poddubny | 550 | jz no_eventoccur3 |
1 | ha | 551 | cmp [0xf500],byte 0 |
21 | poddubny | 552 | je no_eventoccur3 |
553 | mov ecx, [CURRENT_TASK] |
||
379 | serge | 554 | movzx edx, word [WIN_STACK+ecx*2] |
380 | serge | 555 | mov eax, [TASK_COUNT] |
379 | serge | 556 | cmp eax,edx |
1 | ha | 557 | jnz no_eventoccur3 |
558 | popad |
||
559 | mov eax,[0xf501] |
||
560 | cmp eax,65535 |
||
561 | je no_event_1 |
||
562 | mov eax,3 |
||
563 | ret |
||
564 | |||
565 | |||
566 | mov [window_minimize],1 |
||
567 | mov [0xf500],byte 0 |
||
568 | xor eax, eax |
||
569 | ret |
||
570 | |||
571 | |||
572 | |||
227 | serge | 573 | |
574 | |||
379 | serge | 575 | test [edi+TASKDATA.event_mask],dword 00100000b |
115 | poddubny | 576 | jz no_mouse_event |
21 | poddubny | 577 | mov eax,[CURRENT_TASK] |
379 | serge | 578 | shl eax,8 |
21 | poddubny | 579 | test [eax+SLOT_BASE+APPDATA.event_mask],dword 00100000b |
380 | serge | 580 | jz no_mouse_event |
21 | poddubny | 581 | and [eax+SLOT_BASE+APPDATA.event_mask],dword 0xffffffff-00100000b |
380 | serge | 582 | popad |
21 | poddubny | 583 | mov eax,6 |
584 | ret |
||
585 | no_mouse_event: |
||
586 | |||
1 | ha | 587 | |
227 | serge | 588 | |
379 | serge | 589 | test [edi+TASKDATA.event_mask],dword 16 |
115 | poddubny | 590 | jz no_eventoccur5 |
1 | ha | 591 | cmp [0xfff0],byte 2 |
592 | jnz no_eventoccur5 |
||
593 | popad |
||
594 | mov eax,5 |
||
595 | ret |
||
596 | no_eventoccur5: |
||
597 | |||
598 | |||
379 | serge | 599 | test [edi+TASKDATA.event_mask],dword 01000000b |
115 | poddubny | 600 | jz no_ipc |
1 | ha | 601 | mov eax,[CURRENT_TASK] |
379 | serge | 602 | shl eax,8 |
21 | poddubny | 603 | test [eax+SLOT_BASE+APPDATA.event_mask],dword 01000000b |
380 | serge | 604 | jz no_ipc |
1 | ha | 605 | and [eax+SLOT_BASE+APPDATA.event_mask],dword 0xffffffff-01000000b |
380 | serge | 606 | popad |
1 | ha | 607 | mov eax,7 |
608 | ret |
||
609 | no_ipc: |
||
610 | |||
611 | |||
612 | |||
379 | serge | 613 | test [edi+TASKDATA.event_mask],dword 10000000b |
115 | poddubny | 614 | jz no_stack_event |
1 | ha | 615 | mov eax,[CURRENT_TASK] |
379 | serge | 616 | shl eax,8 |
21 | poddubny | 617 | test [eax+SLOT_BASE+APPDATA.event_mask],dword 10000000b |
380 | serge | 618 | jz no_stack_event |
1 | ha | 619 | and [eax+SLOT_BASE+APPDATA.event_mask],dword 0xffffffff-10000000b |
380 | serge | 620 | popad |
1 | ha | 621 | mov eax,8 |
21 | poddubny | 622 | ret |
1 | ha | 623 | no_stack_event: |
624 | |||
625 | |||
115 | poddubny | 626 | jz .test_IRQ |
354 | serge | 627 | mov eax, [CURRENT_TASK] |
379 | serge | 628 | shl eax, 8 |
40 | halyavin | 629 | test byte [eax+SLOT_BASE+APPDATA.event_mask+1], byte 1 |
380 | serge | 630 | jz .test_IRQ |
354 | serge | 631 | and byte [eax+SLOT_BASE+APPDATA.event_mask+1], not 1 |
380 | serge | 632 | popad |
40 | halyavin | 633 | mov eax, 9 |
634 | ret |
||
635 | |||
636 | |||
354 | serge | 637 | ; mov eax, [CURRENT_TASK] |
379 | serge | 638 | ; shl eax, 8 |
354 | serge | 639 | ; test dword [eax+SLOT_BASE+APPDATA.event_mask], EVENT_EXTENDED |
380 | serge | 640 | ; jz .test_IRQ |
354 | serge | 641 | ; popad |
642 | ; mov eax, 10 |
||
643 | ; ret |
||
644 | |||
227 | serge | 645 | |
646 | cmp dword [edi+TASKDATA.event_mask], 0xFFFF |
||
115 | poddubny | 647 | jbe no_events |
21 | poddubny | 648 | |
1 | ha | 649 | |
650 | mov ebx,0x00010000 |
||
651 | xor ecx, ecx |
||
652 | irq_event_test: |
||
653 | mov edi,[TASK_BASE] |
||
379 | serge | 654 | test [edi+TASKDATA.event_mask],ebx |
115 | poddubny | 655 | jz no_irq_event |
1 | ha | 656 | mov edi,ecx |
657 | shl edi,2 |
||
658 | add edi,irq_owner |
||
659 | mov edx,[edi] |
||
660 | mov eax,[TASK_BASE] |
||
379 | serge | 661 | mov eax,[eax+TASKDATA.pid] |
115 | poddubny | 662 | cmp edx,eax |
1 | ha | 663 | jne no_irq_event |
664 | cmp [esi],dword 0 |
||
665 | jz no_irq_event |
||
666 | mov eax,ecx |
||
667 | add eax,16 |
||
668 | mov [esp+28],eax |
||
669 | popad |
||
670 | ret |
||
671 | no_irq_event: |
||
672 | add esi,0x1000 |
||
673 | shl ebx,1 |
||
674 | inc ecx |
||
675 | cmp ecx,16 |
||
676 | jb irq_event_test |
||
677 | |||
678 | |||
21 | poddubny | 679 | popad |
1 | ha | 680 | xor eax, eax |
681 | ret |
||
682 |