.TITLE EMST - EMIT STATUS FOR RSX-11M V3.2 .IDENT /010385/ .ENABL GBL .ENABL LC .NLIST BEX ; ;+ ;***** ; ; EMST - defines a psuedo "EMIT STATUS" directive for use ; with RSX-11M V3.2 alternate CLI tasks (Mplus V1.x executive ; defines EMST$). $EMST$ scans the issuing task's offspring ; control block queue (list head @T.OCBH in TCB) for the ; first OCB referencing the parent task named in the ; EMST$ parameter block. Once found, the parent is notified ; of the offspring's status being emitted by the executive ; routine "$QUEXT". Calling task must be privileged and ; map the executive to call $EMST$. ; ; CALL SEQUENCE: ; CALL $EMST$ ; with: ; R5 pointing to the EMST$ parameter block which defines: ; 1) Parent/target task to emit status to ; 2) Status word to be sent to parent/target task ; ; (symbolic offsets within the parameter block are defined by ; EMST$ macro) ; ;***** ; ; Paul Sorenson ; AEP/Operations Control Systems ; Columbus, OH 43215 ; ;***** ; ; Update 1/3/85 -- PRS; Original edit ; ;***** ;- .MCALL EMST$,PKTDF$,TCBDF$ PKTDF$ ; DEFINE OCB OFFSETS TCBDF$ ; DEFINE TCB OFFSETS ; $$$GLB=0 ; DISABLE ALLOCATING PARAMETER BLOCK EMST$ ; DEFINE EMIT-STATUS OFFSETS .PSECT $PCODE,RO,I,LCL,CON,REL $EMST$:: ; GLOBAL ENTRY POINT CALL $SWSTK,20$ ; SWITCH TO SYSTEM STATE ADD #E.MSTN,R5 ;; POINT TO TASK NAME FIELD IN ;; PARAMETER BLOCK MOV $TKTCB,R4 ;; PICKUP OUR TCB ADDRESS ADD #T.OCBH,R4 ;; POINT TO START OF OCB QUEUE MOV R4,R2 ;; COPY LISTHEAD ADDRESS 5$: MOV (R2),R1 ;; GET NEXT OCB ADDRESS BEQ 18$ ;; BRANCH ON END-OF-QUEUE MOV O.PTCB(R1),R0 ;; POINT TO PARENT TCB CMP (R5),T.NAM(R0) ;; TASK NAME MATCH ?? BNE 10$ ;; BRANCH IF NO CMP 2(R5),T.NAM+2(R0) ;; MAYBE ?? BEQ 12$ ;; BRANCH IF YES 10$: MOV R1,R2 ;; STEP TO NEXT OCB BR 5$ ;; LOOP TO END-OF-QUEUE 12$: MOV (R1),(R2) ;; RE-LINK QUEUE BNE 16$ ;; BRANCH IF NOT END MOV R2,2(R4) ;; ELSE, CLOSE LIST 16$: MOV E.MSST-E.MSTN(R5),R0 ;; PICKUP STATUS FOR TARGET TASK CALL $QUEXT ;; QUEUE KERNAL AST TO TARGET MOV #IS.SUC,R0 ;; SHOW SUCCESSFUL COMPLETION BR 19$ ;; AND EXIT 18$: MOV #IE.ITS,R0 ;; SETUP ERROR RETURN 19$: MOV R0,@#$DSW ;; RETURN STATUS IN DSW RETURN ;; BACK TO USER STATE ; 20$: TST @#$DSW ; CHECK DIRECTIVE STATUS BPL 23$ ; RETURN C-BIT CLEAR ON SUCCESS SEC ; ELSE, SHOW FAILURE IN C-BIT 23$: RETURN ; BACK TO CALLER ; .END ;$EMST$