*DECK NS$NAI
USETEXT COM$NS
USETEXT DEF$NS
USETEXT LTSB$NS
USETEXT NAT$NS
USETEXT NPT$NS
USETEXT NST$NS
USETEXT SMB$NS
PROC NS$NAI; # PERFORM NPU ACTIVITY INITIALIZATION #
# TITLE NS$NAI - PERFORM NPU ACTIVITY INITIALIZATION. #
BEGIN # NS$NSI #
#
** NS$NAI - PERFORM NPU ACTIVITY INITIALIZATION.
*
* J.C. LEE 1981
*
* THIS ROUTINE PERFORMS NPU ACTIVITY INITIALIZATION.
*
* PROC NS$NAI
*
* ENTRY:
* NONE.
*
* EXIT:
* NONE.
*
* METHOD:
* REQUEST A TSB FOR NAT.
* FORMAT NAT FOR LOAD ACTIVITY
* QUEUE NAT TO NAT LIST.
* FORMAT NPU STATUS TABLE.
* UPDATE LOAD TSB.
* INCREMENT LOAD ACTIVITY COUNT.
*
#
$BEGIN
XREF
BEGIN
PROC NS$DBG; # TRACE PROCEDURE CALL #
END
$END
XREF
BEGIN
PROC MOVEOK; # ALLOW TSB TO MOVE #
PROC REQTSB; # REQUEST TSB #
PROC TSBINFO; # LOCATE TSB #
END
ITEM NATFWA U; # FWA OF NAT TSB #
ITEM TSBFWA U; # FWA OF A TSB #
ITEM TSBN U; # TSB NUMBER OF TSB #
ITEM TSBSIZE U; # SIZE OF TSB #
CONTROL EJECT;
$BEGIN
NS$DBG("NAI"); # TRACE CALL #
$END
#
FORMAT NAT FOR LOAD ACTIVITY
#
REQTSB(NAT$SIZE,NATFWA,NATTSBN); # REQUEST A TSB FOR NAT #
NPT$NATTSB[NTORD] = NATTSBN; # SAVE NAT TSB NUMBER IN NPT #
P<NAT> = NATFWA; # FWA OF NPU ACTIVITY TABLE #
NAT$ID[0] = NAT$IDENT; # IDENTIFIER #
NAT$BS[0] = NAT$SIZE; # BLOCK SIZE #
NAT$NCTORD[0] = NPT$NCTORD[NTORD]; # NCT ORDINAL OF LOAD PATH #
NAT$SN[0] = ABHSN[0]; # TERMINAL NODE NUMBER OF LOAD PATH #
NAT$HN[0] = ABHDN[0]; # TERMINAL NODE NUMBER OF LOAD PATH #
NAT$NTORD[0] = NTORD; # NPU TABLE ORDINAL #
NPT$F$LF[NTORD] = FALSE; # CLEAR LOAD FAILURE FLAG #
#
QUEUE NAT TO NAT LIST
#
TSBN = NPT$NLTAIL[0];
IF TSBN EQ 0
THEN # NO ENTRY IN NAT LIST #
NPT$NLHEAD[0] = NATTSBN; # SET HEAD PTR OF NAT LIST #
ELSE
BEGIN # QUEUE NAT TO LIST #
TSBINFO(TSBSIZE,TSBFWA,TSBN); # LOCATE LAST NAT IN LIST #
P<NAT> = TSBFWA;
NAT$NLFP[0] = NATTSBN;
MOVEOK(TSBN); # ALLOW LAST NAT IN LIST TO MOVE#
P<NAT> = NATFWA; # RESET BASED PTR TO CURRENT NAT#
NAT$NLBP[0] = TSBN;
END
NPT$NLTAIL[0] = NATTSBN; # UPDATE TAIL PTR OF NAT LIST #
#
FORMAT NPU STATUS TABLE
#
IF NPT$NSTTSB[NTORD] EQ 0
THEN # NST NOT YET EXISTS #
BEGIN
REQTSB(NST$ISIZE,TSBFWA,TSBN); # REQUEST A TSB FOR NST #
P<NST> = TSBFWA; # FWA OF NPU STATUS TABLE #
NPT$NSTTSB[NTORD] = TSBN; # STORE NST TSB NO IN NPT ENTRY #
NST$ID[0] = NST$IDENT; # IDENTIFIER #
NST$BS[0] = NST$ISIZE; # NST INITIAL SIZE #
NST$NTORD[0] = NTORD; # NPU TABLE ORDINAL #
MOVEOK(TSBN); # ALLOW NST TO MOVE #
END
#
UPDATE LOAD TSB
#
IF LTW$LTSBN[0] EQ 0
THEN # LOAD TSB NOT YET EXISTS #
BEGIN
REQTSB(L$LTSB,TSBFWA,TSBN); # REQUEST A TSB FOR LOAD TSB #
LTW$LTSBN[0] = TSBN; # STORE TSB NO OF LOAD TSB #
P<LTSB$HDR> = TSBFWA; # FWA OF LOAD TSB #
LTSB$ID[0] = LTSB$IDENT; # LOAD TSB IDENTIFIER #
LTSB$BS[0] = L$LTSB; # LOAD TSB SIZE #
P<LTSB$FET> = TSBFWA + L$LTSBHDR; # FWA OF LOAD FET #
LFET$FM[0] = TRUE; # SET BINARY FILE MODE #
LFET$COMP[0] = TRUE; # INITIALIZE FET COMPLETION BIT #
LFET$RAN[0] = TRUE; # SET RANDOM ACCESS BIT #
LFET$LEN[0] = L$LFET - 5; # SET ADDITIONAL FET LENGTH #
MOVEOK(TSBN); # ALLOW LOAD TSB TO MOVE #
END
LTW$ACOUNT[0] = LTW$ACOUNT[0] + 1; # INCREMENT ACTIVITY COUNT #
RETURN;
END # NS$NAI #
TERM