*DECK NS$ERR
USETEXT COM$NS
USETEXT DEF$NS
USETEXT DTSB$NS
USETEXT ERR$NS
USETEXT NAT$NS
USETEXT NDF$NS
USETEXT NDCB$NS
USETEXT NPT$NS
USETEXT NST$NS
USETEXT PFC$NS
USETEXT SMB$NS
USETEXT SMD$NS
USETEXT STC$NS
PROC NS$ERR(ERRCODE); # ERROR PROCESSOR #
# TITLE NS$ERR - ERROR PROCESSOR. #
BEGIN # NS$ERR #
#
** NS$ERR - ERROR PROCESSOR.
*
* J.C. LEE 1981
*
* THIS ROUTINE PERFORMS ERROR PROCESSING.
*
*
* PROC NS$ERR(ERRCODE)
*
* ENTRY:
* ERROR PARAMETER.
*
* EXIT:
* NONE.
*
* METHOD:
* USE ERROR CODE TO SWITCH TO THE APPROPRIATE ERROR
* PROCESSING PARAGRAPH. SEND APPROPRIATE ERROR MESSAGE
* TO DAYFILE.
*
#
ITEM ERRCODE U; # ERROR CODE #
$BEGIN
XREF
BEGIN
PROC NS$DBG; # TRACE PROCEDURE CALL #
END
$END
XREF
BEGIN
PROC NETPUT; # NETPUT #
PROC NS$DFT; # DAYFILE TEXT #
PROC NS$FBH; # FORMAT BLOCK HEADER #
PROC NS$FLN; # FORMAT/LOAD NDCB #
PROC NS$GNW; # GET NPU WORD #
PROC NS$INL; # INITIATE NPU LOAD #
PROC NS$MSG; # DISPATCH MESSAGE #
PROC NS$TNA; # TERMINATE NPU ACTIVITY #
PROC NS$XPD; # PROCESS NEXT PCB DIRECTIVE #
PROC MOVEOK; # ALLOW TSB TO MOVE #
PROC PURGE; # PURGE PERMANENT FILE #
PROC RECALL; # RECALL #
PROC RETERN; # RETURN #
PROC RETTSB; # RELEASE TSB #
PROC TSBINFO; # LOCATE TSB #
PROC WRITEF; # WRITE EOF TO FILE #
END
DEF L$DFTEXT # 6 #; # LENGTH OF DAYFILE TEXT ALLOWED #
ITEM DEC U; # DETAIL ERROR CODE #
ITEM DISCTAB C(10) = "0123456789"; # DISPLAY CODE CONVERSION #
ITEM DISPLAYDEC C(2); # DEC IN DISPLAY-CODED DECIMAL #
ITEM ERC S:EC; # ERROR CODE #
ITEM ERRORCODE U; # ERROR CODE #
ITEM NDTSBN U; # TSB NUMBER OF NDCB DUMP RESPONSE #
ITEM PSTATE U; # PRIMARY NPU STATE #
ITEM ROPTIONS U; # MESSAGE ROUTING OPTIONS #
ITEM TEMP U; # TEMPORARY VARIABLE #
ITEM TLC U; # TEXT LENGTH IN CM WORDS #
ITEM TSBFWA U; # TSB FWA #
ITEM TSBSIZE U; # TSB SIZE #
DEF L$EM23 # 3 #;
DEF DM$EM23 # DM$LOCAL+DM$EVENT+DM$NAMLOG #; # ROUTING OPTIONS#
ARRAY MSG$EM23 [0:0] S(L$EM23);
BEGIN
ITEM EM23$TEXT C(0,0,28) = # MESSAGE TEXT #
["NPUNAME, DUMP XXXXXXX SAVED."];
ITEM EM23$NPNAM C(0,00,7); # NPU NAME #
ITEM EM23$NDPFN C(1,24,7); # NPU DUMP FILE PFN #
ITEM EM23$END U(2,48,12) = [0]; # END OF TEXT #
END
DEF L$FAIL # 5 #;
DEF DM$FAIL # DM$LOCAL+DM$SEVENT+DM$NAMLOG #; # ROUTE OPTIONS #
ARRAY MSG$FAIL [0:0] S(L$FAIL);
BEGIN
ITEM FAIL$TEXT C(0,0,47) = # MESSAGE TEXT #
["NPUNAME, AAAAAAAA ABORTED - EEEEEEEEEEEEEEEEEEE"];
ITEM FAIL$NPNAM C(0,00,7); # NPU NAME #
ITEM FAIL$ATYPE C(0,54,8); # ACTIVITY TYPE #
ITEM FAIL$ERROR C(2,48,19); # ACTIVITY ERROR TYPE #
ITEM FAIL$END U(4,42,18) = [0]; # END OF MESSAGE TEXT #
END
DEF L$LGLERR # 3 #;
DEF DM$LGLERR # DM$LOCAL+DM$NAMLOG #; # ROUTING OPTIONS #
ARRAY MSG$LGLERR [0:0] S(L$LGLERR);
BEGIN
ITEM LGL$TEXT C(0,0,25) = # MESSAGE TEXT #
["SM LOGICAL ERROR RC = NN."];
ITEM LGL$RC C(2,12,2); # REASON CODE #
ITEM LGL$END U(2,30,30) = [0]; # END OF TEXT #
END
DEF L$NPERR # 5 #;
DEF DM$NPERR # DM$LOCAL+DM$EVENT+DM$NAMLOG #; # ROUTING OPTION#
ARRAY MSG$NPERR [0:0] S(L$NPERR);
BEGIN
ITEM NPE$TEXT C(0,0,40) = # MESSAGE TEXT #
["NPUNAME, SM PROTOCOL ERROR AT STATE XXX."];
ITEM NPE$NPNAM C(0,00,7); # NPU NAME #
ITEM NPE$STATE C(3,36,3); # CURRENT NPU STATE #
ITEM NPE$PSTATE U(3,36,6); # NPU PRIMARY STATE #
ITEM NPE$SSTATE U(3,42,6); # NPU SECONDARY STATE #
ITEM NPE$SUDBIT U(3,48,6); # SUD INDICATOR #
ITEM NPE$END U(4,00,60) = [0]; # END OF TEXT #
END
DEF L$SMERR # 4 #;
DEF DM$SMERR # DM$LOCAL+DM$NAMLOG #; # ROUTE OPTIONS #
ARRAY MSG$SMERR [SMEC"NSM$ABH":SMEC"HSM$HOPSM"] S(L$SMERR);
BEGIN # SM ERROR DIAGNOSTICS #
ITEM SME$ERROR C(00,00,35) = [
"SM NETWORK ABH ERROR.",
"SM NETWORK ADDRESS ERROR.",
"SM NETWORK PFC/SFC/LT/CC ERROR.",
"SM NETWORK DUMP RESPONSE ERROR.",
"SM ABH ERROR.",
"SM PFC/SFC ERROR.",
"ILLEGAL HOP SM.",
];
ITEM SME$END U(03,30,30) = [7(0)]; # END OF TEXT #
END
ARRAY ACTIVITYTB [PRISTATE"NPS$LSAM":PRISTATE"NPS$DNDCB"] S(1);
BEGIN
ITEM ACTIVITY C(0,0,8) = [ # ACTIVITY TYPE #
"SAM LOAD", # LOADING SAM #
"DUMP", # DUMPING NPU #
"LOAD", # LOADING NPU #
"DUMP", # DUMPING NDCB #
];
END
ARRAY ACTIVERRTB [EC"ERR$TIMER":EC"ERR$SUDL"] S(2);
BEGIN
ITEM ACTERROR C(0,0,19) = [ # NPU ACTIVITY ERROR #
"TIMEOUT.", # TIMER TIMEOUT #
"FILE ERROR NN.", # FILE FORMAT ERROR NN#
"DUMP INDEX FULL.", # NDF INDEX FULL #
"PREEMPTED.", # ACTIVITY PREEMPTED #
"RETRY LIMIT.", # RETRY LIMIT REACHED #
"ABNORMAL RESPONSE", # ABNORMAL RESPONSE #
"TEST FAILED.", # SUD TEST FAILED #
"CANNOT LOAD TEST.", # SUD LOAD FAILED #
];
END
ARRAY FILERRTEXT [FEC"ERR$DPCB":FEC"ERR$PICBD"] S(2);
BEGIN # FILE ERROR DIAGNOSTICS #
ITEM FILE$ERROR C(00,00,19) = [
"BAD DPCB.",
"BAD LPCB.",
"BAD SPCB.",
"BAD PICB.",
"PICB NOT FOUND.",
"LOAD MOD NOT FOUND.",
"BAD LOAD MODULE.",
"BAD NCB SIZE.",
"BAD PICB DIRECTIVE.",
];
END
CONTROL EJECT;
SWITCH ERRORCASE:EC # STATUS SWITCH FOR ERROR CODE #
LB$NP:ERR$NP, # NETWORK PROTOCAL ERROR #
LB$SM:ERR$SM, # SUPERVISORY MESSAGE ERROR #
LB$LGL:ERR$LGL, # SM LOGICAL ERROR #
LB$NPUACT:ERR$TIMER, # ACTIVITY TIMER EXPIRED #
LB$NPUACT:ERR$FILE, # ACTIVITY FILE FORMAT ERROR #
LB$NPUACT:ERR$DN, # ACTIVITY DUMP INDEX FULL #
LB$NPUACT:ERR$PREEM, # ACTIVITY PREEMPTED #
LB$NPUACT:ERR$RETRYS, # RETRY LIMIT REACHED #
LB$NPUACT:ERR$ABRESP, # ABNORMAL RESPONSE FROM NPU #
LB$NPUACT:ERR$SUDTST, # ACTIVITY SUD TEST FAILED #
LB$NPUACT:ERR$SUDL; # ACTIVITY SUD LOAD FAILED #
CONTROL EJECT;
#
ACTIVITY ERROR STATUS SWITCH FOR VALID NPU PRIMARY STATE
#
SWITCH ERRSCASE:PRISTATE
ERRS$LSAM:NPS$LSAM, # LOADING SAM #
ERRS$DNPU:NPS$DNPU, # DUMPING NPU #
ERRS$LNPU:NPS$LNPU, # LOADING NPU #
ERRS$DNDCB:NPS$DNDCB; # DUMPING NDCB #
#
STATUS SWITCH FOR ACTIVITY ERROR DURING SAM LOAD
#
SWITCH LSAMCASE:EC
A$TNA:ERR$TIMER, # TIMER/RETRY TIMEOUT #
A$IDN:ERR$FILE, # NLF FILE FORMAT ERROR #
A$RSM:ERR$PREEM, # PREEMPTED SAM LOAD #
A$IDN:ERR$RETRYS, # RETRY LIMIT REACHED #
A$IDN:ERR$ABRESP; # ABNORMAL RESPONSE FROM NPU #
#
STATUS SWITCH FOR ACTIVITY ERROR DURING NPU DUMPING
#
SWITCH DNPUCASE:EC
A$INL:ERR$TIMER, # TIMER/RETRY TIMEOUT #
A$IDN:ERR$FILE, # NLF FILE FORMAT ERROR #
A$IDN:ERR$DN, # NPU DUMP FILE INDEX #
A$RSM:ERR$PREEM, # PREEMPT NPU DUMPING #
A$INL:ERR$RETRYS, # RETRY LIMIT REACHED #
A$INL:ERR$ABRESP; # ABNORMAL RESPONSE FROM NPU #
#
STATUS SWITCH FOR ACTIVITY ERROR DURING NPU LOAD
#
SWITCH LNPUCASE:EC
A$IDN:ERR$TIMER, # TIMER/RETRY TIMEOUT #
A$IDN:ERR$FILE, # NLF FILE FORMAT ERROR #
A$RSM:ERR$PREEM, # PREEMPT NPU LOAD #
A$IDN:ERR$RETRYS, # RETRY LIMIT REACHED #
A$IDN:ERR$ABRESP, # ABNORMAL RESPONSE FROM NPU #
A$IDN:ERR$SUDTST, # SUD TEST FAILED #
A$IDN:ERR$SUDL; # SUD LOAD FAILED #
#
STATUS SWITCH FOR ACTIVITY ERROR DURING DUMPING NDCB
#
SWITCH DNDCBCASE:EC
A$INL:ERR$TIMER, # TIMER/RETRY TIMEOUT #
A$IDN:ERR$FILE, # NLF FILE FORMAT ERROR #
A$RSM:ERR$PREEM, # PREEMPT NPU LOADING #
A$INL:ERR$RETRYS; # RETRY LIMIT REACHED #
CONTROL EJECT;
$BEGIN
NS$DBG("ERR"); # TRACE CALL #
$END
ERR$START:
P<ERRORWORD> = LOC(ERRCODE); # FWA OF ERROR CODE #
ERC = ERRW$EC[0]; # ERROR CODE #
DEC = ERRW$DEC[0]; # DETAIL ERROR CODE #
ERRCODE = 0; # RESET ERRCODE TO ZERO #
IF DEC NQ 0
THEN # DEC SPECIFIED #
BEGIN # CONVERT DEC TO 2 DISPLAY-CODED DECIMAL CHARS #
DISPLAYDEC = " "; # CLEAR DISPLAY CODED DEC #
C<0,1>DISPLAYDEC = C<DEC/10,1>DISCTAB;
C<1,1>DISPLAYDEC = C<DEC-DEC/10*10,1>DISCTAB;
END
GOTO ERRORCASE[ERC]; # CASE ON ERROR CODE ERC #
LB$NP: # PROCESS NETWORK PROTOCAL ERROR #
NPT$PECNT[NTORD] = NPT$PECNT[NTORD] + 1; # INCREMENT PEC #
NPE$NPNAM[0] = NPNAM; # SET NPU NAME #
TEMP = NAT$PSTATE[0]; # PRIMARY NPU STATE #
NPE$PSTATE[0] = C<TEMP,1>DISCTAB;
TEMP = NAT$SSTATE[0]; # SECONDARY NPU STATE #
NPE$SSTATE[0] = C<TEMP,1>DISCTAB;
TEMP = NAT$SUD[0]; # SUD INDICATOR #
NPE$SUDBIT[0] = C<TEMP,1>DISCTAB;
NS$MSG(MSG$NPERR,L$NPERR,DM$NPERR); # DISPATCH MESSAGE #
GOTO LB$LOG; # LOG IN TRACE FILE/DAYFILE #
LB$SM: # PROCESS SUPERVISORY MESSAGE ERROR #
IF DEC EQ SMEC"HSM$ABH"
THEN # NAM ERROR #
BEGIN
ROPTIONS = DM$NAMERR + DM$SMERR; # SET NAM ERROR INDICATOR #
END
ELSE # NPU ERROR #
BEGIN
ROPTIONS = DM$SMERR;
END
NS$MSG(MSG$SMERR[DEC],L$SMERR,ROPTIONS); # DISPATCH MESSAGE #
GOTO LB$LOG; # LOG IN TRACE FILE/DAYFILE #
LB$LGL: # PROCESS SM LOGICAL ERROR #
LGL$RC[0] = DISPLAYDEC; # SET LOGICAL ERROR RC #
NS$MSG(MSG$LGLERR,L$LGLERR,DM$LGLERR); # DISPATCH MESSAGE #
GOTO LB$LOG; # LOG IN TRACE FILE/DAYFILE #
LB$LOG:
IF ABHABT[0] EQ APPCMD
THEN # SM ORIGINATED AT HOST #
TLC = ABHTLC[0]; # SM TEXT IN CM WORDS #
ELSE # SM ORIGINATED AT NPU #
TLC = (2*ABHTLC[0] + 14) / 15; # SM TEXT IN CM WORDS #
TLC = TLC + 1; # ADD ONE FOR ABH #
IF TLC GR L$DFTEXT
THEN # TLC EXCEEDS ALLOWED DAYFILE TEXT LENGTH #
TLC = L$DFTEXT;
NS$DFT(LOC(ABH$WORD),TLC); # DAYFILE BAD SM TEXT #
GOTO ERR$EXIT; # RETURN #
CONTROL EJECT;
#
PROCESS NPU ACTIVITY ERRORS
#
LB$NPUACT:
NPNAM = NPT$NPNAME[NTORD]; # GET NPU NAME #
NATTSBN = NPT$NATTSB[NTORD]; # GET NAT TSB NUMBER #
TSBINFO(TSBSIZE,TSBFWA,NATTSBN); # LOCATE NAT #
P<NAT> = TSBFWA; # FWA OF NAT #
PSTATE = NAT$PSTATE[0]; # CURRENT PRIMARY STATE #
FAIL$NPNAM[0] = NPNAM; # SET NPU NAME #
FAIL$ATYPE[0] = ACTIVITY[PSTATE]; # SET ACTIVITY TYPE #
IF ERC EQ S"ERR$FILE"
THEN # NLF/NCF FORMAT ERROR #
ACTERROR[ERC] = FILE$ERROR[DEC]; # FILE ERROR TEXT #
FAIL$ERROR[0] = ACTERROR[ERC]; # SET NPU ACTIVITY ERROR #
NS$MSG(MSG$FAIL,L$FAIL,DM$FAIL); # DISPATCH MESSAGE #
GOTO ERRSCASE[PSTATE]; # CASE ON NPU PRIMARY STATE #
ERRS$LSAM: # LOADING SAM #
IF ERC EQ EC"ERR$PREEM"
THEN # SAM LOAD PREEMPTED #
BEGIN # INCREMENT CONSECUTIVE SAM LOAD PREEMPTION COUNT #
TSBINFO(TSBSIZE,TSBFWA,NPT$NSTTSB[NTORD]); # LOCATE NST #
P<NST> = TSBFWA;
NST$SAMSPC[0] = NST$SAMSPC[0] + 1;
MOVEOK(NPT$NSTTSB[NTORD]); # ALLOW NST TO MOVE #
IF NST$SAMSPC[0] GR 2
THEN # DO NOT PREEMPT CURRENT SAM LOAD #
GOTO ERR$EXIT;
END
GOTO LSAMCASE[ERC]; # SWITCH ON VALID ERROR CODE #
ERRS$DNPU: # DUMPING NPU #
NDTSBN = NAT$NDTSBN[0]; # DUMP TSB NUMBER #
IF NDTSBN NQ 0
THEN # DUMP TSB EXISTS #
BEGIN
TSBINFO(TSBSIZE,TSBFWA,NDTSBN);# LOCATE DUMP TSB #
P<DTSB$HDR> = TSBFWA;
P<DTSB$FET> = TSBFWA + L$DTSBHDR; # FWA OF NDF FET #
WRITEF(DTSB$FET); # FLUSH CIO BUFFER/WRITE EOF #
RECALL(DTSB$FET); # WAIT TILL I/O COMPLETES #
RETERN(DTSB$FET); # RETURN NDF #
RECALL(DTSB$FET); # WAIT TILL RETURN COMPLETES #
IF NAT$F$SNDF[0]
THEN # SAVE INCOMPLETE DUMP FILE #
BEGIN
EM23$NPNAM[0] = NPNAM; # SET NPU NAME #
EM23$NDPFN[0] = DFET$LFN[0]; # SET PFN OF NPU DUMP FILE #
NS$MSG(MSG$EM23,L$EM23,DM$EM23); # DISPATCH MESSAGE #
STC$DUMPS = STC$DUMPS + 1; # INCREMENT DUMPS GENERATED #
TSBINFO(TSBSIZE,TSBFWA,NPT$NSTTSB[NTORD]); # LOCATE NST #
P<NST> = TSBFWA; # FWA OF NST #
TSBINFO(TSBSIZE,TSBFWA,NAT$SMTSBN[0]); # LOCATE NDCB TSB #
P<NDCB> = TSBFWA; # FWA OF NDCB DUMP RESP #
NST$DPDATE[0] = DTSB$PDATE[0]; # MOST RECENT DUMP DATE/TIME #
NST$NDFPFN[0] = DFET$LFN[0]; # MOST RECENT DUMP FILE PFN #
NS$GNW(NDCB,LNPUDTDN,NDCBINDEX"NDCB$HALTC",TEMP);
NST$NHC[0] = TEMP; # SET NPU HALT CODE #
NS$GNW(NDCB,LNPUDTDN,NDCBINDEX"NDCB$PREG",TEMP);
NST$NPR[0] = TEMP; # SET NPU P-REGISTER CONTENT #
MOVEOK(NPT$NSTTSB[NTORD]); # ALLOW NST TO MOVE #
MOVEOK(NAT$SMTSBN[0]); # ALLOW NDCB TSB TO MOVE #
NAT$F$SNDF[0] = FALSE; # CLEAR SAVE DUMP FLAG #
END
ELSE # DO NOT SAVE INCOMPLETE NDF #
BEGIN
PURGE(DFET$LFN[0],NDF$UN,NDF$PW); # PURGE INCOMPLETE NDF #
DN = DN - 1; # DECREMENT DUMP NUMBER #
END
RETTSB(NDTSBN); # RELEASE DUMP TSB #
NAT$NDTSBN[0] = 0; # CLEAR DUMP TSB NUMBER #
END
GOTO DNPUCASE[ERC]; # SWITCH ON ERROR CODE #
ERRS$LNPU: # LOADING NPU #
TSBINFO(TSBSIZE,TSBFWA,NPT$NSTTSB[NTORD]); # LOCATE NST #
P<NST> = TSBFWA; # FWA OF NST #
NST$SLFC[0] = NST$SLFC[0] + 1; # INCREMENT SLFC COUNT #
MOVEOK(NPT$NSTTSB[NTORD]); # ALLOW NST TO MOVE #
GOTO LNPUCASE[ERC]; # SWITCH ON ERROR CODE #
ERRS$DNDCB: # DUMPING NDCB #
GOTO DNDCBCASE[ERC]; # SWITCH ON ERROR CODE #
CONTROL EJECT;
#
ACTIVITY TERMINATION CASES
#
A$INL: # INITIATE NPU LOADING #
NS$INL(ERRORCODE); # INITIATE NPU LOAD #
IF ERRORCODE EQ 0
THEN # NO ERROR ENCOUNTERED #
BEGIN
NS$XPD(ERRORCODE); # PROCESS NEXT PCB DIRECTIVE #
END
IF ERRORCODE NQ 0
THEN # ERROR OCCURRED #
BEGIN
ERRCODE = ERRORCODE;
GOTO ERR$START; # PROCESS NPU LOAD ERROR #
END
ELSE # NO ERROR #
BEGIN
MOVEOK(NATTSBN); # ALLOW NAT TO MOVE #
GOTO ERR$EXIT; # RETURN #
END
A$RSM: # REISSUE SM TO NS #
SM$REISSUE = TRUE;
GOTO A$TNA; # TERMINATE CURRENT ACTIVITY #
A$IDN: # TERMINATE CURRENT ACTIVITY #
IF NAT$F$RMTL[0]
THEN # A REMOTE NPU LOAD GOING #
BEGIN
NS$FBH(LNPUIN,TRUE); # FORMAT ABH #
PFCSFC[0] = NPUINN; # SET PFC/SFC #
NPUPO[0] = NAT$PN[0]; # SET PORT NUMBER #
NPUSP[0] = NAT$SPN[0]; # SET SUBPORT NUMBER #
NPULT[0] = LOADTYPE"LT$REMOT"; # SET LOAD TYPE #
NETPUT(ABH$WORD,SMB$BUFFER); # SEND NPU/IN/N #
END
IF NAT$SMTSBN[0] NQ 0
THEN # TSB FOR NDCB EXISTS #
BEGIN
NPT$F$LF[NTORD] = TRUE; # SET LOAD FAILURE FLAG #
NS$FLN(TRUE); # RELOAD NDCB INTO NPU #
RETTSB(NAT$SMTSBN[0]); # RELEASE NDCB TSB #
NAT$SMTSBN[0] = 0;
END
A$TNA: # CLEANUPS #
NS$TNA;
ERR$EXIT:
RETURN;
END # NS$ERR #
TERM