;+ ; #.#.# ; ; ; Get Task Information (TINFO) ; ; FUNCTION: ; Scan tcb's and return task specific information. ; ; ; CALLING SEQUENCE: ; ; TSKSTS = TINFO ( TNAME, TBUF) ; where: ; argument description pa/re ; -------- ----------- ----- ; TSKSTS Status of task RE ; 0 = not installed ; 1 = installed but not active (dormant) ; 2 = installed and active ; -1 = task is exiting ; ; TNAME Task name in RAD50 PA ; ; TBUF Buffer for tcb status words 1,2,3,4 RE ; ; ; SUBROUTINES REFERENCED: ; $SWSTK $SRSTD ; ; ; DESCRIPTION: ; TINFO searches the tcb list for the specified task name. ; If the task is installed, TINFO tests the tcb status bits ; to determine the state of the task. ; ; ; SPECIAL CONSIDERATIONS: ; 1. The calling task must be privileged (PR:5)since ; TINFO maps to executive space. ; ;- .TITLE tinfo .MCALL TCBDF$ TCBDF$ ; ; CODE SECTION ; ------------------------------------ ; .PSECT ELF$I,RO,I,LCL,REL,CON ; TINFO:: MOV 2(R5),TNAME ; get task name address MOV 4(R5),TBUF ; address of tcb status buffer CALL $SWSTK,30$ ; system state CLR STATE ; task state MOV TNAME,R3 ; get task name address CALL $SRSTD ; search for the tcb BCS 20$ ; cs -> not found MOV TBUF,R1 MOV T.STAT(R0),(R1)+ MOV T.ST2(R0),(R1)+ MOV T.ST3(R0),(R1)+ MOV T.ST4(R0),(R1) CMP #S.CEXT,T.EFLG(R0) ; check for exiting BNE 10$ BIT #TS.EXE,T.STAT(R0) ; is it active BNE 10$ ; no, installed task DEC STATE ; exiting, set state to -1 BR 20$ 10$: INC STATE ; set it installed BIT #TS.EXE,T.STAT(R0) ; running ? BNE 20$ ; no INC STATE ; yes, increment state 20$: RETURN ; back to user state 30$: MOV STATE,R0 ; get task state RETURN ; ; DATA AREA ; ------------------------------------ ; .PSECT ELF$D,RW,D,LCL,REL,CON TNAME: .WORD 0 STATE: .WORD 0 TBUF: .WORD 0 .END