Subversion Repositories Kolibri OS

Rev

Rev 8858 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8858 Rev 8866
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
;;  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: 8858 $
8
$Revision: 8866 $
Line 9... Line 9...
9
 
9
 
Line 279... Line 279...
279
;  none
279
;  none
280
;result:
280
;result:
281
;  eax=[new_thread_slot]<>0 - ok
281
;  eax=[new_thread_slot]<>0 - ok
282
;      0 - failed.
282
;      0 - failed.
283
;This function find least empty slot.
283
;This function find least empty slot.
284
;It doesn't increase [TASK_COUNT]!
284
;It doesn't increase [thread_count]!
Line 285... Line 285...
285
 
285
 
286
 
286
 
287
        mov     edx, thr_slot_map
287
        mov     edx, thr_slot_map
Line 481... Line 481...
481
;Output:
481
;Output:
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, [thread_count]
487
        shl     ebx, BSF sizeof.TASKDATA ; multiply by size 
487
        shl     ebx, BSF sizeof.TASKDATA ; multiply by size 
488
        ; add 2*32 cause:
488
        ; add 2*32 cause:
489
        ; [TASK_TABLE; TASK_TABLE + 32) isnt a task actually
489
        ; [TASK_TABLE; TASK_TABLE + 32) isnt a task actually
490
        ; skip first process in the task table
490
        ; skip first process in the task table
491
        mov     ecx, 2*32
491
        mov     ecx, 2*32
Line 939... Line 939...
939
        mov     ecx, [xsave_area_size]
939
        mov     ecx, [xsave_area_size]
940
        add     ecx, 3
940
        add     ecx, 3
941
        shr     ecx, 2
941
        shr     ecx, 2
942
        rep movsd
942
        rep movsd
Line 943... Line 943...
943
 
943
 
944
        cmp     [TASK_COUNT], ebx
944
        cmp     [thread_count], ebx
945
        adc     dword [TASK_COUNT], 0   ; update number of processes
945
        adc     dword [thread_count], 0   ; update number of processes
946
        shl     ebx, 8
946
        shl     ebx, 8
947
        lea     edx, [ebx+SLOT_BASE+APP_EV_OFFSET]
947
        lea     edx, [ebx+SLOT_BASE+APP_EV_OFFSET]
948
        mov     [SLOT_BASE+APPDATA.fd_ev+ebx], edx
948
        mov     [SLOT_BASE+APPDATA.fd_ev+ebx], edx