Rev 9600 | Rev 9709 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9600 | Rev 9611 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 9600 $ |
8 | $Revision: 9611 $ |
9 | 9 | ||
10 | 10 | ||
Line 291... | Line 291... | ||
291 | mov ebx, [scheduler_current+ecx*4] |
291 | mov ebx, [scheduler_current+ecx*4] |
292 | test ebx, ebx |
292 | test ebx, ebx |
293 | jz .priority_next |
293 | jz .priority_next |
294 | .task_loop: |
294 | .task_loop: |
295 | mov ebx, [ebx+APPDATA.in_schedule.next] |
295 | mov ebx, [ebx+APPDATA.in_schedule.next] |
296 | mov edi, ebx |
296 | ;mov al, [ebx+APPDATA.state] |
- | 297 | mov edi, ebx ; |
|
297 | shr edi, 3 |
298 | shr edi, 3 ; |
298 | add edi, TASK_TABLE - (SLOT_BASE shr 3) |
299 | add edi, TASK_TABLE - (SLOT_BASE shr 3) ; on delete |
299 | mov al, [edi+TASKDATA.state] |
300 | mov al, [edi+TASKDATA.state] ; |
300 | test al, al |
301 | test al, al |
301 | jz .task_found ; state == 0 |
302 | jz .task_found ; state == 0 |
302 | cmp al, 5 |
303 | cmp al, 5 |
303 | jne .task_next ; state == 1,2,3,4,9 |
304 | jne .task_next ; state == 1,2,3,4,9 |
304 | ; state == 5 |
305 | ; state == 5 |
Line 314... | Line 315... | ||
314 | cmp eax, [ebx+APPDATA.wait_timeout] |
315 | cmp eax, [ebx+APPDATA.wait_timeout] |
315 | jb .task_next |
316 | jb .task_next |
316 | xor eax, eax |
317 | xor eax, eax |
317 | @@: |
318 | @@: |
318 | mov [ebx+APPDATA.wait_param], eax ; retval for wait |
319 | mov [ebx+APPDATA.wait_param], eax ; retval for wait |
- | 320 | mov [edi+TASKDATA.state], TSTATE_RUNNING ; on delete |
|
319 | mov [edi+TASKDATA.state], TSTATE_RUNNING |
321 | mov [ebx+APPDATA.state], TSTATE_RUNNING |
320 | .task_found: |
322 | .task_found: |
321 | mov [scheduler_current+ecx*4], ebx |
323 | mov [scheduler_current+ecx*4], ebx |
322 | ; If we have selected a thread with higher priority |
324 | ; If we have selected a thread with higher priority |
323 | ; AND rescheduling is due to IRQ, |
325 | ; AND rescheduling is due to IRQ, |
324 | ; turn the current scheduler list one entry back, |
326 | ; turn the current scheduler list one entry back, |