Rev 8840 | Rev 8858 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8840 | Rev 8851 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License. ;; |
4 | ;; Distributed under terms of the GNU General Public License. ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 8840 $ |
8 | $Revision: 8851 $ |
Line 9... | Line 9... | ||
9 | 9 | ||
Line 482... | Line 482... | ||
482 | ; eax - slot of process or 0 if process don't exists |
482 | ; eax - slot of process or 0 if process don't exists |
483 | ;Search process by PID. |
483 | ;Search process by PID. |
484 | push ebx |
484 | push ebx |
485 | push ecx |
485 | push ecx |
486 | mov ebx, [TASK_COUNT] |
486 | mov ebx, [TASK_COUNT] |
- | 487 | shl ebx, 5 ; ebx *= 32 (32 is size of TASKDATA struct) |
|
487 | shl ebx, 5 |
488 | ; add 2*32 cause: |
- | 489 | ; 0x80003000 - 0x80003020 isnt a task actually |
|
- | 490 | ; skip first process in the task table |
|
488 | mov ecx, 2*32 |
491 | mov ecx, 2*32 |
Line 489... | Line 492... | ||
489 | 492 | ||
490 | .loop: |
493 | .loop: |
491 | ;ecx=offset of current process info entry |
494 | ;ecx = offset of current process info entry |
- | 495 | ;ebx = maximum permitted offset |
|
492 | ;ebx=maximum permitted offset |
496 | ; state 9 means "not used" |
493 | cmp byte [CURRENT_TASK+ecx+0xa], 9 |
497 | cmp byte [TASK_TABLE+ecx+TASKDATA.state], 9 |
494 | jz .endloop ;skip empty slots |
498 | jz .endloop ;skip empty slots |
495 | cmp [CURRENT_TASK+ecx+0x4], eax;check PID |
499 | cmp [TASK_TABLE+ecx+TASKDATA.pid], eax;check PID |
496 | jz .pid_found |
500 | jz .pid_found |
497 | .endloop: |
501 | .endloop: |
498 | add ecx, 32 |
502 | add ecx, 32 |
499 | cmp ecx, ebx |
503 | cmp ecx, ebx |