Rev 387 | 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_slot] |
||
427 | serge | 117 | add ecx, APP_OBJ_OFFSET |
118 | |||
354 | serge | 119 | |
120 | cli |
||
121 | mov edx, [ecx+APPOBJ.fd] |
||
122 | mov [eax+APPOBJ.fd], edx |
||
123 | mov [eax+APPOBJ.bk], ecx |
||
124 | mov [ecx+APPOBJ.fd], eax |
||
125 | mov [edx+APPOBJ.bk], eax |
||
126 | popfd |
||
127 | mov edx, [eax+EVENT.id] |
||
128 | .fail: |
||
129 | add esp, 8 |
||
130 | ret |
||
131 | |||
132 | |||
133 | restore .data |
||
134 | |||
135 | |||
136 | ; eax= event |
||
137 | ; ebx= id |
||
138 | |||
139 | |||
140 | |||
141 | |||
142 | jne .fail |
||
143 | cmp [eax+EVENT.id], ebx |
||
144 | jne .fail |
||
145 | .internal: |
||
363 | serge | 146 | mov ebx, [eax+APPOBJ.fd] |
354 | serge | 147 | mov ecx, [eax+APPOBJ.bk] |
148 | mov [ebx+APPOBJ.bk], ecx |
||
149 | mov [ecx+APPOBJ.fd], ebx |
||
150 | .force: |
||
363 | serge | 151 | xor edx, edx ;clear common header |
354 | serge | 152 | mov [eax], edx |
153 | mov [eax+4], edx |
||
154 | mov [eax+8], edx |
||
155 | mov [eax+12], edx |
||
156 | mov [eax+16], edx |
||
157 | |||
158 | |||
159 | .fail: |
||
160 | ret |
||
161 | |||
162 | |||
227 | serge | 163 | proc send_event stdcall pid:dword, event:dword |
164 | locals |
||
165 | slot dd ? |
||
166 | endl |
||
167 | |||
168 | |||
169 | call pid_to_slot |
||
170 | test eax, eax |
||
171 | jz .fail |
||
172 | |||
173 | |||
174 | cmp [SLOT_BASE+eax+APPDATA.ev_count], 32 |
||
380 | serge | 175 | ja .fail |
227 | serge | 176 | |
177 | |||
178 | |||
354 | serge | 179 | |
227 | serge | 180 | test eax, eax |
181 | jz .fail |
||
182 | |||
183 | |||
354 | serge | 184 | mov ecx, 6 |
227 | serge | 185 | mov esi, [event] |
186 | cld |
||
187 | rep movsd |
||
188 | |||
189 | |||
354 | serge | 190 | add ecx, SLOT_BASE+APP_EV_OFFSET |
380 | serge | 191 | |
354 | serge | 192 | |
193 | mov [eax+APPOBJ.destroy], destroy_event |
||
194 | mov ebx, [pid] |
||
195 | mov [eax+APPOBJ.pid], ebx |
||
196 | mov [eax+EVENT.state], EVENT_SIGNALED |
||
197 | |||
198 | |||
199 | cli ;insert event into |
||
200 | mov edx, [ecx+APPOBJ.fd] ;events list |
||
201 | mov [eax+APPOBJ.fd], edx ;and set events flag |
||
202 | mov [eax+APPOBJ.bk], ecx |
||
203 | mov [ecx+APPOBJ.fd], eax |
||
204 | mov [edx+APPOBJ.bk], eax |
||
205 | inc [ecx+APPDATA.ev_count-APP_EV_OFFSET] |
||
206 | or [ecx+APPDATA.event_mask-APP_EV_OFFSET], EVENT_EXTENDED |
||
207 | popfd |
||
208 | .fail: |
||
227 | serge | 209 | ret |
210 | endp |
||
211 | |||
212 | |||
354 | serge | 213 | |
214 | |||
227 | serge | 215 | proc get_event_ex stdcall, p_ev:dword, timeout:dword |
216 | |||
217 | |||
218 | mov edx,[current_slot] |
||
427 | serge | 219 | ; cmp [SLOT_BASE+edx+APPDATA.ev_count], 0 |
380 | serge | 220 | ; je .switch |
377 | serge | 221 | |
227 | serge | 222 | |
427 | serge | 223 | |
227 | serge | 224 | |
377 | serge | 225 | cmp eax, edx |
354 | serge | 226 | je .switch |
227 | |||
228 | |||
229 | mov edi, [p_ev] ;copy event data |
||
230 | mov ecx, 6 |
||
227 | serge | 231 | cld |
232 | rep movsd |
||
233 | |||
354 | serge | 234 | |
235 | ; |
||
377 | serge | 236 | test [eax+EVENT.state], MANUAL_RESET |
354 | serge | 237 | jnz .done |
238 | |||
239 | |||
240 | cli ;remove event from events |
||
241 | mov ebx, [eax+APPOBJ.fd] ;list (reset event) |
||
242 | mov ecx, [eax+APPOBJ.bk] ;and clear events flag |
||
243 | mov [ebx+APPOBJ.bk], ecx ;if no active events |
||
244 | mov [ecx+APPOBJ.fd], ebx |
||
245 | |||
377 | serge | 246 | |
247 | |||
248 | |||
354 | serge | 249 | jnz @F |
250 | and [edx+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED |
||
251 | @@: |
||
377 | serge | 252 | popfd |
354 | serge | 253 | |
254 | |||
255 | jz .destroy |
||
256 | |||
257 | |||
258 | |||
259 | |||
260 | cli |
||
261 | mov ebx, [edx+APPOBJ.fd] ;insert event into |
||
377 | serge | 262 | mov [eax+APPOBJ.fd], ebx ;objects list |
263 | mov [eax+APPOBJ.bk], edx |
||
264 | mov [edx+APPOBJ.fd], eax |
||
265 | mov [ebx+APPOBJ.bk], eax |
||
266 | popfd |
||
354 | serge | 267 | .done: |
268 | ret |
||
227 | serge | 269 | |
354 | serge | 270 | |
271 | call destroy_event.force |
||
363 | serge | 272 | ret |
354 | serge | 273 | .switch: |
227 | serge | 274 | mov eax, [TASK_BASE] |
379 | serge | 275 | mov [eax+TASKDATA.state], byte 5 |
227 | serge | 276 | call change_task |
277 | jmp .wait |
||
278 | endp |
||
279 | |||
280 | |||
354 | serge | 281 | ; eax= event |
282 | ; ebx= id |
||
283 | |||
284 | |||
285 | wait_event: |
||
286 | .event equ esp |
||
287 | push eax |
||
288 | .wait: |
||
289 | cmp [eax+APPOBJ.magic], 'EVNT' |
||
290 | jne .done |
||
291 | cmp [eax+EVENT.id], ebx |
||
292 | jne .done |
||
293 | |||
294 | |||
295 | jz .switch |
||
296 | |||
297 | |||
298 | jnz .done |
||
299 | |||
300 | |||
427 | serge | 301 | |
354 | serge | 302 | |
303 | cli ;remove event from events |
||
304 | mov ebx, [eax+APPOBJ.fd] ;list (reset event) |
||
305 | mov ecx, [eax+APPOBJ.bk] ;and clear events flag |
||
306 | mov [ebx+APPOBJ.bk], ecx ;if no active events |
||
307 | mov [ecx+APPOBJ.fd], ebx |
||
308 | dec [edx+APPDATA.ev_count] |
||
309 | jnz @F |
||
310 | and [edx+APPDATA.event_mask], not EVENT_EXTENDED |
||
311 | @@: |
||
312 | and [eax+EVENT.state], not (EVENT_SIGNALED+EVENT_WATCHED) |
||
313 | popfd |
||
314 | |||
315 | |||
316 | jz .destroy |
||
317 | |||
318 | |||
319 | |||
320 | |||
321 | cli |
||
322 | mov ecx, [edx+APPOBJ.fd] ;insert event into |
||
323 | mov [eax+APPOBJ.fd], ecx ;objects list |
||
324 | mov [eax+APPOBJ.bk], edx |
||
325 | mov [edx+APPOBJ.fd], eax |
||
326 | mov [ecx+APPOBJ.bk], eax |
||
327 | popfd |
||
328 | .done: |
||
329 | add esp, 4 |
||
330 | ret |
||
331 | .destroy: |
||
332 | call destroy_event.force |
||
363 | serge | 333 | add esp, 4 |
354 | serge | 334 | ret |
335 | .switch: |
||
336 | or [eax+EVENT.state], EVENT_WATCHED |
||
337 | mov eax, [TASK_BASE] |
||
379 | serge | 338 | mov [eax+TASKDATA.state], byte 5 |
354 | serge | 339 | call change_task |
340 | mov eax, [.event] |
||
341 | jmp .wait |
||
342 | restore .event |
||
343 | |||
344 | |||
345 | ; eax= event |
||
346 | ; ebx= id |
||
347 | ; ecx= flags |
||
348 | ; edx= event data |
||
377 | serge | 349 | |
354 | serge | 350 | |
351 | .event equ esp |
||
352 | push eax |
||
353 | |||
354 | |||
355 | jne .fail |
||
356 | cmp [eax+EVENT.id], ebx |
||
357 | jne .fail |
||
358 | |||
359 | |||
360 | call pid_to_slot |
||
361 | test eax, eax |
||
362 | jz .fail |
||
363 | |||
364 | |||
377 | serge | 365 | test esi, esi |
366 | mov edx, [.event] |
||
354 | serge | 367 | jz @F |
377 | serge | 368 | |
369 | |||
370 | lea edi, [edx+EVENT.code] |
||
371 | mov ecx, 6 |
||
372 | cld |
||
373 | rep movsd |
||
374 | pop ecx |
||
375 | @@: |
||
376 | test [edx+EVENT.state], EVENT_SIGNALED |
||
354 | serge | 377 | jnz .done |
378 | |||
379 | |||
380 | jz @F |
||
381 | test [edx+EVENT.state], EVENT_WATCHED |
||
382 | jz .done |
||
383 | @@: |
||
384 | shl eax, 8 |
||
385 | add eax, SLOT_BASE+APP_EV_OFFSET |
||
380 | serge | 386 | |
354 | serge | 387 | |
388 | cli |
||
389 | mov ebx, [edx+APPOBJ.fd] |
||
390 | mov ecx, [edx+APPOBJ.bk] |
||
391 | mov [ebx+APPOBJ.bk], ecx |
||
392 | mov [ecx+APPOBJ.fd], ebx |
||
393 | |||
394 | |||
395 | mov [edx+APPOBJ.fd], ecx |
||
396 | mov [edx+APPOBJ.bk], eax |
||
397 | mov [eax+APPOBJ.fd], edx |
||
398 | mov [ecx+APPOBJ.bk], edx |
||
399 | or [edx+EVENT.state], EVENT_SIGNALED |
||
400 | |||
401 | |||
402 | or [eax+APPDATA.event_mask-APP_EV_OFFSET], EVENT_EXTENDED |
||
403 | popfd |
||
404 | .fail: |
||
405 | .done: |
||
406 | add esp, 4 |
||
407 | ret |
||
408 | restore .event |
||
409 | |||
410 | |||
377 | serge | 411 | ; eax= event |
412 | ; ebx= id |
||
413 | align 4 |
||
414 | clear_event: |
||
415 | .event equ esp |
||
416 | push eax |
||
417 | |||
418 | |||
419 | jne .fail |
||
420 | cmp [eax+EVENT.id], ebx |
||
421 | jne .fail |
||
422 | |||
423 | |||
424 | call pid_to_slot |
||
425 | test eax, eax |
||
426 | jz .fail |
||
427 | |||
428 | |||
429 | add eax, SLOT_BASE+APP_EV_OFFSET |
||
380 | serge | 430 | mov edx, [.event] |
377 | serge | 431 | pushfd |
432 | cli ;remove event from events |
||
433 | mov ebx, [edx+APPOBJ.fd] ;list (reset event) |
||
434 | mov ecx, [edx+APPOBJ.bk] ;and clear events flag |
||
435 | mov [ebx+APPOBJ.bk], ecx ;if no active events |
||
436 | mov [ecx+APPOBJ.fd], ebx |
||
437 | |||
438 | |||
439 | |||
440 | |||
441 | jnz @F |
||
442 | and [eax+APPDATA.event_mask-APP_EV_OFFSET], not EVENT_EXTENDED |
||
443 | @@: |
||
444 | add eax, (APP_OBJ_OFFSET-APP_EV_OFFSET) |
||
445 | |||
446 | |||
447 | mov [edx+APPOBJ.fd], ecx ;objects list |
||
448 | mov [edx+APPOBJ.bk], eax |
||
449 | mov [eax+APPOBJ.fd], edx |
||
450 | mov [ecx+APPOBJ.bk], edx |
||
451 | popfd |
||
452 | .fail: |
||
453 | .done: |
||
454 | add esp, 4 |
||
455 | ret |
||
456 | restore .event |
||
457 | |||
458 | |||
1 | ha | 459 | |
460 | |||
461 | mov [esp+36],eax |
||
462 | ret |
||
463 | |||
464 | |||
465 | |||
466 | sys_wait_event_timeout: |
||
467 | |||
468 | |||
21 | poddubny | 469 | add ebx,eax |
1 | ha | 470 | cmp ebx,[timer_ticks] |
21 | poddubny | 471 | jna .swfet2 |
1 | ha | 472 | .swfet1: |
227 | serge | 473 | call get_event_for_app |
1 | ha | 474 | test eax,eax |
475 | jne .eventoccur_time |
||
476 | call change_task |
||
477 | cmp ebx,[timer_ticks] |
||
21 | poddubny | 478 | jg .swfet1 |
1 | ha | 479 | .swfet2: |
227 | serge | 480 | xor eax,eax |
1 | ha | 481 | .eventoccur_time: |
227 | serge | 482 | mov [esp+36],eax |
1 | ha | 483 | ret |
484 | |||
485 | |||
486 | |||
487 | |||
488 | |||
489 | |||
490 | |||
491 | test eax,eax |
||
492 | jne eventoccur |
||
493 | newwait: |
||
494 | |||
495 | |||
379 | serge | 496 | mov [eax+TASKDATA.state], byte 5 |
115 | poddubny | 497 | call change_task |
1 | ha | 498 | |
499 | |||
21 | poddubny | 500 | |
501 | |||
1 | ha | 502 | mov [esp+36],eax |
503 | ret |
||
504 | |||
505 | |||
506 | |||
507 | |||
508 | |||
509 | |||
379 | serge | 510 | test [edi+TASKDATA.event_mask],dword 1 |
115 | poddubny | 511 | jz no_eventoccur1 |
1 | ha | 512 | ;mov edi,[TASK_BASE] |
379 | serge | 513 | cmp [edi-twdw+WDATA.fl_redraw],byte 0 |
115 | poddubny | 514 | je no_eventoccur1 |
1 | ha | 515 | popad |
516 | mov eax,1 |
||
517 | ret |
||
518 | no_eventoccur1: |
||
519 | |||
520 | |||
379 | serge | 521 | test [edi+TASKDATA.event_mask],dword 2 |
115 | poddubny | 522 | jz no_eventoccur2 |
1 | ha | 523 | mov ecx, [CURRENT_TASK] |
379 | serge | 524 | movzx edx,word [WIN_STACK+ecx*2] |
380 | serge | 525 | mov eax, [TASK_COUNT] |
379 | serge | 526 | cmp eax,edx |
1 | ha | 527 | jne no_eventoccur2x |
92 | diamond | 528 | cmp [KEY_COUNT],byte 0 |
381 | serge | 529 | je no_eventoccur2x |
92 | diamond | 530 | eventoccur2: |
531 | popad |
||
1 | ha | 532 | mov eax,2 |
533 | ret |
||
534 | no_eventoccur2x: |
||
92 | diamond | 535 | mov eax, hotkey_buffer |
536 | @@: |
||
537 | cmp [eax], ecx |
||
538 | jz eventoccur2 |
||
539 | add eax, 8 |
||
540 | cmp eax, hotkey_buffer+120*8 |
||
541 | jb @b |
||
542 | no_eventoccur2: |
||
1 | ha | 543 | |
544 | |||
379 | serge | 545 | test [edi+TASKDATA.event_mask],dword 4 |
115 | poddubny | 546 | jz no_eventoccur3 |
1 | ha | 547 | cmp [BTN_COUNT],byte 0 |
381 | serge | 548 | je no_eventoccur3 |
21 | poddubny | 549 | mov ecx, [CURRENT_TASK] |
379 | serge | 550 | movzx edx, word [WIN_STACK+ecx*2] |
380 | serge | 551 | mov eax, [TASK_COUNT] |
379 | serge | 552 | cmp eax,edx |
1 | ha | 553 | jnz no_eventoccur3 |
554 | popad |
||
555 | mov eax,[BTN_BUFF] |
||
381 | serge | 556 | cmp eax,65535 |
1 | ha | 557 | je no_event_1 |
558 | mov eax,3 |
||
559 | ret |
||
560 | |||
561 | |||
562 | mov [window_minimize],1 |
||
563 | mov [BTN_COUNT],byte 0 |
||
381 | serge | 564 | xor eax, eax |
1 | ha | 565 | ret |
566 | |||
567 | |||
568 | |||
227 | serge | 569 | |
570 | |||
379 | serge | 571 | test [edi+TASKDATA.event_mask],dword 00100000b |
115 | poddubny | 572 | jz no_mouse_event |
21 | poddubny | 573 | mov eax,[current_slot] |
427 | serge | 574 | test [eax+APPDATA.event_mask],dword 00100000b |
575 | jz no_mouse_event |
||
21 | poddubny | 576 | and [eax+APPDATA.event_mask],dword 0xffffffff-00100000b |
427 | serge | 577 | popad |
21 | poddubny | 578 | mov eax,6 |
579 | ret |
||
580 | no_mouse_event: |
||
427 | serge | 581 | |
1 | ha | 582 | |
227 | serge | 583 | |
379 | serge | 584 | test [edi+TASKDATA.event_mask],dword 16 |
115 | poddubny | 585 | jz no_eventoccur5 |
1 | ha | 586 | cmp [REDRAW_BACKGROUND],byte 2 |
381 | serge | 587 | jnz no_eventoccur5 |
1 | ha | 588 | popad |
589 | mov eax,5 |
||
590 | ret |
||
591 | no_eventoccur5: |
||
427 | serge | 592 | |
1 | ha | 593 | |
379 | serge | 594 | test [edi+TASKDATA.event_mask],dword 01000000b |
115 | poddubny | 595 | jz no_ipc |
1 | ha | 596 | mov eax,[current_slot] |
427 | serge | 597 | test [eax+APPDATA.event_mask],dword 01000000b |
598 | jz no_ipc |
||
1 | ha | 599 | and [eax+APPDATA.event_mask],dword 0xffffffff-01000000b |
427 | serge | 600 | popad |
1 | ha | 601 | mov eax,7 |
602 | ret |
||
603 | no_ipc: |
||
427 | serge | 604 | |
1 | ha | 605 | |
606 | |||
379 | serge | 607 | test [edi+TASKDATA.event_mask],dword 10000000b |
115 | poddubny | 608 | jz no_stack_event |
1 | ha | 609 | mov eax,[current_slot] |
427 | serge | 610 | test [eax+APPDATA.event_mask],dword 10000000b |
611 | jz no_stack_event |
||
1 | ha | 612 | and [eax+APPDATA.event_mask],dword 0xffffffff-10000000b |
427 | serge | 613 | popad |
1 | ha | 614 | mov eax,8 |
21 | poddubny | 615 | ret |
1 | ha | 616 | no_stack_event: |
427 | serge | 617 | |
1 | ha | 618 | |
115 | poddubny | 619 | jz .test_IRQ |
354 | serge | 620 | mov eax, [current_slot] |
427 | serge | 621 | test byte [eax+APPDATA.event_mask+1], byte 1 |
622 | jz .test_IRQ |
||
354 | serge | 623 | and byte [eax+APPDATA.event_mask+1], not 1 |
427 | serge | 624 | popad |
40 | halyavin | 625 | mov eax, 9 |
626 | ret |
||
627 | |||
628 | |||
354 | serge | 629 | ; mov eax, [CURRENT_TASK] |
379 | serge | 630 | ; shl eax, 8 |
354 | serge | 631 | ; test dword [eax+SLOT_BASE+APPDATA.event_mask], EVENT_EXTENDED |
380 | serge | 632 | ; jz .test_IRQ |
354 | serge | 633 | ; popad |
634 | ; mov eax, 10 |
||
635 | ; ret |
||
636 | |||
227 | serge | 637 | |
638 | cmp dword [edi+TASKDATA.event_mask], 0xFFFF |
||
115 | poddubny | 639 | jbe no_events |
21 | poddubny | 640 | |
1 | ha | 641 | |
381 | serge | 642 | mov ebx,0x00010000 |
1 | ha | 643 | xor ecx, ecx |
644 | irq_event_test: |
||
645 | mov edi,[TASK_BASE] |
||
379 | serge | 646 | test [edi+TASKDATA.event_mask],ebx |
115 | poddubny | 647 | jz no_irq_event |
1 | ha | 648 | mov edi,ecx |
649 | shl edi,2 |
||
650 | add edi,irq_owner |
||
651 | mov edx,[edi] |
||
652 | mov eax,[TASK_BASE] |
||
379 | serge | 653 | mov eax,[eax+TASKDATA.pid] |
115 | poddubny | 654 | cmp edx,eax |
1 | ha | 655 | jne no_irq_event |
656 | cmp [esi],dword 0 |
||
657 | jz no_irq_event |
||
658 | mov eax,ecx |
||
659 | add eax,16 |
||
660 | mov [esp+28],eax |
||
661 | popad |
||
662 | ret |
||
663 | no_irq_event: |
||
664 | add esi,0x1000 |
||
665 | shl ebx,1 |
||
666 | inc ecx |
||
667 | cmp ecx,16 |
||
668 | jb irq_event_test |
||
669 | |||
670 | |||
21 | poddubny | 671 | popad |
1 | ha | 672 | xor eax, eax |
673 | ret |
||
674 |