cdc:nos2.source:nam5871:majptr
Table of Contents
MAJPTR
Table Of Contents
- [00027] PROC MAJPTR
- [00092] PROC ABORT
- [00093] PROC MCHKPTR
- [00094] PROC MDRPTR
- [00095] PROC OMSG
- [00096] PROC RDUMP
- [00097] PROC XTRACE
Source Code
- MAJPTR.txt
- *DECK MAJPTR
- USETEXT NIPDEF
- USETEXT ACB
- USETEXT ACKHEAD
- USETEXT ACNB
- USETEXT ACNT
- USETEXT AT
- USETEXT DEQCOM
- USETEXT DISTAIL
- USETEXT DUMPFLG
- USETEXT DRHDR
- USETEXT FLIST
- USETEXT FREETAB
- USETEXT KDIS
- USETEXT KHDRX
- USETEXT KINITBF
- USETEXT KSTTAB
- USETEXT LLCB
- USETEXT NBT
- USETEXT NCNB
- USETEXT NCNT
- USETEXT PCNB
- USETEXT PRUBUFF
- USETEXT PT
- USETEXT TNT
- USETEXT MSGIDX
- PROC MAJPTR; # ADJUST BUFFER POINTERS AFTER MEMORY MOVE#
- STARTIMS;
- #
- *1DC MAJPTR
- * 1. PROC NAME AUTHOR DATE
- * MAJPTR P.C.TAM 80/01/17
- *
- * 2. FUNCTIONAL DESCRIPTION.
- * THIS ROUTINE IS RESPONSIBLE FOR ADJUSTING THE POINTERS
- * POINT TO BUFFERS JUST MOVED BY GARBAGE COLLECTION ROUTINE
- * MGBGCLT.
- *
- * 3. METHOD USED.
- * START FROM THE FIRST BUFFER IN THE BLOCK JUST MOVED.
- * JUMP TO THE CORRESPONDING MODULES TO ADJUST POINTERS BASED ON
- * BUFFER ID.
- * CALL PROCEDURE MCHKPTR TO CHECK WHETHER THE BUFFER WHICH
- * CONTAINS THE POINTERS HAS ALSO BEEN MOVED. IF SO, MODIFY
- * THE BUFFER ADDRESS BEFORE RESETTING THE POINTERS.
- *
- * 4. ENTRY PARAMETERS. NONE
- *
- * 5. EXIT PARAMETERS. NONE
- *
- * 6. SYMPL TEXTS USED.
- * ACB ACNB ACNT AT ACKHEAD
- * NCNB NCNT PBT PCNB PIT TNT
- * FLIST FREETAB LLCB NBT
- * PT NIPDEF DISTAIL
- * DUMPFLG KDIS KHDRX KINITBF
- * KSTTAB MSGIDX OSIZE DRHDR
- *
- * 7. ROUTINES CALLED.
- * ABORT ABORT NIP WITH MESSAGE LOGGED
- * MCHKPTR CHECK MCHG IN MOVED RANGE OR NOT
- * OMSG ISSUE DAYFILE MESSAGE
- * MDRPTR UPDATE DATA RING POINTERS
- * XTRACE RECORD CALL
- *
- * 8. DAYFILE MESSAGES.
- * MAJPTR FOUND BAD BLK ID
- * HIT GARBAGE IN KDIS BUF
- *
- * W A R N I N G - THE TOTAL SIZE OF 4 GARBAGE COLLECTION
- * ROUTINES (MAJPTR, MCHKPTR, AND MGBGCLT)
- * WITH THE DELAY OPTION TURNED ON
- * CAN NOT EXCEED THE PRIMARY AND SECONDARY
- *CALL OSIZE
- *
- * THIS PROCEDURE IS CALLED BY MGBGCLT.
- *
- #
- STOPIMS;
- #
- PARAMETERS
- #
- # INPUT PARAMETERS #
- # NONE #
- # OUTPUT PARAMETERS #
- # NONE #
- #
- EXTERNAL VARIABLES
- #
- XREF BEGIN
- PROC ABORT; # ABORT NIP WITH LOG MESSAGES #
- PROC MCHKPTR; # CHECK POINTER IN MOVED RANGE OR NOT #
- PROC MDRPTR; # UPDATE DATA RING #
- PROC OMSG; # DAYFILE MESSAGE #
- PROC RDUMP; # DUMP NIP FL #
- PROC XTRACE; # RECORD CALL #
- END
- #
- LOCAL VARIABLES
- #
- ITEM MEND, # LWA+1 OF BLOCK BEEN MOVED TO #
- MCUROLD, # NEXT BUFFER POINTER OF OLD BLOCK #
- I, # TEMP VARIABLE #
- MPTR, # TEMP VARIABLE #
- MPTR2, # TEMP VARIABLE #
- MPTR3, # TEMP VARIABLE #
- MPTR4; # TEMP VARIABLE #
- ITEM STYPE; # TYPE OF STATUS BUFFER #
- BASED ARRAY ADDRWORD S(1) ;
- BEGIN
- ITEM ADDRESSB U(0,12,24) ;
- ITEM ADDRESSF U(0,42,18) ;
- END
- CONTROL IFEQ DEBUG,1;
- # DAYFILE MSG TO ISSUE IF BLK ID UNKNOWN #
- ARRAY BADID P(3);
- BEGIN
- ITEM BADMSG C(0,0,23)=["MAJPTR FOUND BAD BLK ID"];
- ITEM BADZRO I(2,18,42)=[0];
- END
- CONTROL FI;
- BASED ARRAY STPTRX [1:1] P(1);
- ITEM STPTR U(00,00,18);
- # LIST FOR SWITCHING TO DIFFERENT LABELS
- ACCORDING TO THE BUFFER ID #
- LABEL MPRU ;
- SWITCH BUFID
- MERR, # ID = 0, INVALID BUFFER TYPE #
- MAT, # ID = 1, APPLICATION TABLE #
- MACNT, # ID = 2, APPLICATION CONNECTION TABLE #
- MACK, # ID = 3, ACKNOWLEDGE QUEUE ENTRY #
- MFLIST, # ID = 4, FUNCTION LIST #
- MACB, # ID = 5, APPLICATION CONTROL TABLE #
- MACNB, # ID = 6, APPLICATION CONNECTION BLOCK #
- MMSG, # ID = 7, MESSAGE BUFFER #
- MTNT, # ID = 8, LOGICAL LINK TABLE #
- MLLCB, # ID = 9, LOGICAL LINK CONTROL BLOCK #
- MNCNT, # ID = 10, NETWORK CONNECTION NUMBER TBL #
- MNCNB, # ID = 11, NETWK CONN CONTROL BLOCK #
- MPCNB, # ID = 12, PRU CONN CONTROL BLOCK #
- MERR, # ID = 13, PIP INTERFACE TABLE #
- MERR, # ID = 14, PRU BUFFER TABLE #
- MERR, # ID = 15, NETWK BUFFER TABLE #
- MKDIS, # ID = 16, K-DISPLAY BUFFER #
- MPRU; # ID = 17, PRU BUFFER #
- #**********************************************************************#
- BEGIN
- CONTROL IFEQ DEBUG,1;
- XTRACE("MAJPT") ;
- CONTROL FI;
- P<AT> = 0;
- P<ACB> = 0;
- P<ACNT> = 0;
- P<ACNB> = 0;
- P<DRHDRWD> = 0;
- P<TNT> = 0;
- P<LLCB> = 0;
- P<NCNT> = 0;
- P<NCNB> = 0;
- P<PCNB> = 0;
- P<PRUBUFF> = 0 ;
- P<ACKHEAD> = 0;
- P<FLHEAD> = 0;
- P<KINITBF> = 0;
- MEND = MNEW + MSIZE; # LWA+1 OF BLOCK MOVED #
- MSIZE = MOLD + MSIZE; # LWA+1 OF OLD BLOCK MOVED #
- MCUROLD = MOLD; # PRESET NEXT BUFFER LOCATION #
- # CHECK WHETHER MORE BUFFERS IN THE BLOCK MOVED #
- FOR MCUR = 0 DO
- BEGIN
- IF MCUR EQ 0
- THEN
- MCUR = MNEW; # FIRST BUFFER LOCATION #
- ELSE
- BEGIN
- MCUROLD = MCUROLD + BLKBS[MCUR];# NEXT OLD BUFFER LOCATION #
- MCUR = MCUR + BLKBS[MCUR]; # CURRENT BUFFER LOCATION #
- END
- IF MCUR EQ MEND
- THEN
- RETURN;
- IF BLKID[MCUR] LQ MOVEABLEIDS # VALID BUFFER TYPE #
- THEN
- GOTO BUFID[BLKID[MCUR]]; # ADJUST PTRS BASED ON ID #
- #
- ERROR CONDITION -- BUFFER ID INVALID
- #
- MERR:
- CONTROL IFEQ DEBUG,1;
- ABORT(BADID,0); # ABORT NIP WITH ERROR MESSAGE #
- CONTROL FI;
- RETURN; # CONTINUE PROCESSING #
- #
- APPLICATION TABLE
- #
- MAT:
- PTAT[0] = MCUR; # MODIFY POINTER IN POINTER TAB #
- TEST;
- #
- APPLICATION CONNECTION NUMBER TABLE
- #
- MACNT:
- MPTR = ACNTAN[MCUR]; # GET APP NUMBER #
- MCHG = PTAT[0]; # APPLICATION TABLE ADDR #
- MCHKPTR;
- MCHG = ATACBA[MPTR+MCHG];# APPLICATION CONTROL BLOCK ADDR #
- MCHKPTR;
- ACBACNT[MCHG] = MCUR;# MODIFY ACNT ADDRESS IN ACB #
- TEST;
- #
- ACKNOWLEDGE QUEUE ENTRY MOVED
- #
- MACK:
- MCHG = ACKNCNB[MCUR];# GET NCNB ADDRESS #
- MCHKPTR;
- NCNBACKQ[MCHG] = MCUR;
- TEST;
- #
- FUNCTION LIST BUFFER MOVED
- #
- MFLIST:
- FLCB[MCUR] = 0; # CLEAR SCP COMPL BIT #
- IF FLFC[MCUR] EQ SFLIST
- THEN # MODIFY SCPA FOR A SFLIST #
- FLSCPA[MCUR] = LOC(FLWD0[MCUR]) +
- FLSCPA[MCUROLD] -
- LOC(FLWD0[MCUROLD]);
- MCHG = PTAT[0]; # GET APP TABLE ADDR #
- MCHKPTR;
- MCHG = ATACBA[MCHG+FLAN[MCUR]];# GET CORR ACB ADDR #
- MCHKPTR;
- ACBFLIST[MCHG] = MCUR;# MODIFY ACB FLIST ADDRESS #
- TEST;
- #
- APPLICATION CONTROL BLOCK
- #
- MACB:
- MCHG = PTAT[0]; # GET APP TABLE ADDRESS #
- MCHKPTR;
- ATACBA[MCHG+ACBAN[MCUR]] = MCUR;# MODIFY ACB ADDR IN AT #
- ACBIASCPA[MCUR] = LOC(ACBAAVAL[MCUR]); # UPDATE SCP ADDR #
- MDRPTR(ACBDRFP[MCUR],ACBDRBP[MCUR],LOC(ACBDRBP[MCUR]));
- MDRPTR(ACBPWLFP[MCUR],ACBPWLBP[MCUR],LOC(ACBPWLFP[MCUR]));
- TEST;
- #
- APPLICATION CONNECTION BLOCK
- #
- MACNB:
- MCHG = PTAT[0]; # GET APP TABLE ADDRESS #
- MCHKPTR;
- MCHG = ATACBA[MCHG+ACNBAN[MCUR]];# GET ACB ADDRESS #
- MCHKPTR;
- IF ACBCDRP[MCHG] EQ MCUROLD
- THEN # ACNB PROCESSED IN LAST NETGET #
- BEGIN
- ACBCDRP[MCHG] = MCUR; # UPDATE LAST ACNB #
- END
- MCHG = ACBACNT[MCHG];# GET APP CONN TABLE ADDRESS #
- MCHKPTR;
- MPTR = ACNBACN[MCUR] - ACNTMINACN[MCHG] + ACNTHSIZE;
- ACNTACNB[MCHG+MPTR] = MCUR;# MODIFY APP CONN BK ADDR IN ACNT #
- MCHG = ACNBNCNB[MCUR];# CHANGE ACNB/NCNB POINTERS #
- IF MCHG NQ 0
- THEN
- BEGIN
- MCHKPTR;
- NCNBACNB[MCHG] = MCUR;
- END
- MCHG = ACNBCDRFP[MCUR]; # NEXT ACNB IN CONNECTION DATA RING #
- IF MCHG NQ 0
- THEN
- BEGIN
- MCHKPTR; # UPDATE POINTER IF MOVED #
- ACNBCDRBP[MCHG] = MCUR; # UPDATE BACK PTR OF NEXT ACNB #
- MCHG = ACNBCDRBP[MCUR]; # PREVIOUS ACNB IN CON DATA RING #
- MCHKPTR; # UPDATE ACNB ADDR IF MOVED #
- ACNBCDRFP[MCHG] = MCUR; # UPDATE FP OF PREV. ACNB #
- END
- MDRPTR(ACNBDRFP[MCUR],ACNBDRBP[MCUR],LOC(ACNBDRFP[MCUR]));
- TEST;
- #
- MESSAGE HAS BEEN MOVED
- #
- MMSG:
- MDRPTR(NEXTPTR[MCUR],BACKPTR[MCUR],MCUR);
- TEST;
- #
- TERMINAL NODE TABLE
- #
- MTNT:
- PTTNT[0] = MCUR; # MODIFY TERMINAL NODE TABLE ADDR IN PT #
- TEST;
- #
- LOGICAL LINK CONTROL BLOCK
- #
- MLLCB:
- MCHG = LLCBBP[MCUR]; # UPDATE PREV BLOCK BKPTR #
- IF MCHG EQ 0
- THEN
- BEGIN # FIRST LLCB IN CHAIN #
- MCHG = PTTNT[0];
- MCHKPTR;
- MPTR = LLCBTN[MCUR];
- TNTLLAD[MPTR+MCHG] = MCUR;# 1 ST LLCB IN CHAIN #
- END
- ELSE
- BEGIN # NOT 1ST LLCB IN CHAIN #
- MCHKPTR;
- LLCBFP[MCHG] = MCUR;
- END
- MCHG = LLCBFP[MCUR]; # UPDATE BKPTR OF NEXT LLCB #
- IF MCHG NQ 0
- THEN
- BEGIN
- MCHKPTR;
- LLCBBP[MCHG] = MCUR;
- END
- TEST;
- #
- NETWORK CONNECTION NUMBER TABLE
- #
- MNCNT:
- MCHG = PTTNT[0]; # GET TERMINAL NODE TABLE ADDR #
- MCHKPTR;
- MCHG = TNTLLAD[NCNTTN[MCUR]+MCHG];# GET CORR LLCB ADDR IN TNT #
- FOR I = 0 STEP 1 WHILE MCHG NQ 0
- DO
- BEGIN # LOOP TO SEARCH FOR RIGHT LLCB #
- MCHKPTR;
- IF LLCBHN[MCHG] EQ NCNTHN[MCUR]
- THEN
- BEGIN
- MPTR3 = MCHG;
- MCHG = 0;
- END
- ELSE
- MCHG = LLCBFP[MCHG];
- END
- MPTR = NCNTCI[MCUR]+LLCBHSIZE; # NCNT ADDR IN LLCB W CORR HN #
- LLCBNCNT[MPTR+MPTR3] = MCUR;
- MPTR2 = NCNTSIZE - NCNTHSIZE;
- FOR MPTR = NCNTHSIZE STEP 1 UNTIL MPTR2
- DO
- BEGIN # LOOP TO MODIFY NCNT ADDR IN NCNB/PCNB #
- MCHG = NCNTNCNB[MCUR+MPTR];
- IF MCHG NQ 0
- THEN
- BEGIN
- MCHKPTR;
- NCNBCTAD[MCHG] = MCUR; # UPDATE NCNT ADDR #
- END
- END
- TEST;
- #
- NETWORK CONNECTION CONTROL BLOCK
- #
- MNCNB:
- MPCNB:
- MCHG = NCNBCTAD[MCUR];# GET NCNT ADDR IN NCNB #
- MCHKPTR;
- MPTR = NCNBCN[MCUR]; # CONN NUMBER IN NCNB #
- MPTR2 = MPTR/16;
- MPTR2 = MPTR - MPTR2*16 + NCNTHSIZE;
- NCNTNCNB[MCHG+MPTR2] = MCUR;# MODIFY NCNB ADDR IN NCNT #
- MCHG = NCNBACNB[MCUR];# GET ACNB ADDR FOR THIS NCNB #
- IF MCHG NQ 0
- THEN
- BEGIN
- MCHKPTR;
- ACNBNCNB[MCHG] = MCUR; # MODIFY NCNB ADDRESS IN ACNB #
- END
- IF BLKID[MCUR] EQ NCNBIDVALUE
- THEN
- BEGIN
- MDRPTR(NCNBDRFP[MCUR],NCNBDRBP[MCUR],LOC(NCNBDRFP[MCUR]));
- MCHG = NCNBACKQ[MCUR]; # MODIFY ACKQ ADDR #
- IF MCHG NQ 0
- THEN
- BEGIN # ACKQ EXISTS #
- MCHKPTR;
- ACKNCNB[MCHG] = MCUR;
- END
- END
- ELSE
- BEGIN # PRU CONNECTION CONTROL BLOCK #
- MCHG = PCNBPCFP[MCUR];
- MPTR = PCNBNBTE[MCUR] * NBTFETNO;
- MPTR2 = LOC(NBTFIRST[MPTR]);
- IF MCHG EQ MPTR2
- THEN # LAST PCNB IN RING #
- NBTPCRB[MPTR] = MCUR;
- ELSE # NOT LAST PCNB #
- BEGIN
- MCHKPTR;
- PCNBPCBP[MCHG] = MCUR;
- END
- MCHG = PCNBPCBP[MCUR];
- IF MCHG EQ MPTR2
- THEN # FIRST PCNB IN RING #
- NBTPCRF[MPTR] = MCUR;
- ELSE
- BEGIN
- MCHKPTR;
- PCNBPCFP[MCHG] = MCUR;
- END
- END
- TEST;
- #
- K-DISPLAY BUFFER
- #
- MKDIS:
- MCHG = BACKPTR[MCUR]; # ADDRESS OF PREVIOUS BUFFER #
- MCHKPTR; # CHECK IF IN RANGE OF MOVE #
- NEXTPTR[MCHG] = MCUR; # UPDATE FRONT POINTER #
- MPTR = MCHG + BLKBS[MCHG] - 1; # LWA OF BUFFER #
- CONTROL IFEQ DEBUG,1;
- IF K7777[MPTR] NQ O"7777"
- THEN
- BEGIN
- ABORT(DFMSG18,0); # ABORT NIP, BAD BLOCK #
- END
- CONTROL FI;
- MCHG = KDSTAIL[MPTR]; # FWA OF DATA #
- MCHKPTR; # RESET DATA POINTER #
- KDSTAIL[MPTR] = MCHG; # UPDATE FWA OF DATA #
- MCHG = NEXTPTR[MCUR]; # ADDRESS OF NEXT BUFFER #
- MCHKPTR; # CHECK IF IN RANGE OF MOVE #
- BACKPTR[MCHG] = MCUR; # UPDATE BACK POINTER #
- TEST;
- MPRU:
- # PRU BUFFER IN FREE CHAIN #
- MCHG = PRUBBACK[MCUR] ; # PREVIOUS BUFF OF THIS NEW BUF #
- MCHKPTR ;
- PRUBDLFP[MCHG] = MCUR; # NEXT OF PREV IS CURRENT #
- MCHG = PRUBDLFP[MCUR]; # NEXT OF CURRENT BUFFER #
- MCHKPTR ;
- PRUBBACK[MCHG] = MCUR ; # BACK OF NEXT IS CURRENT #
- # UPDATE FET POINTERS IN THE NEW BUFFER #
- MPTR2 = PRUBFIRST[MCUR] ; # FIRST OF OLD BUFFER #
- MPTR3 = PRUBIN[MCUR] - MPTR2 ; # IN - FIRST = DIFFERENCE #
- PRUBFIRST[MCUR] = MCUR + PBHSIZE - 1 ;
- PRUBIN[MCUR] = MCUR + PBHSIZE + MPTR3 ; # IN = NEW FIRST + DIF#
- MPTR3 = PRUBOUT[MCUR] - MPTR2 ; # OUT - FIRST = DIF #
- PRUBOUT[MCUR] = MCUR + PBHSIZE + MPTR3 ; # OUT = NEW FIRST+DIF #
- MPTR3 = PRUBLIMIT[MCUR] - MPTR2 ; # DEFERRENCE OF LIMIT #
- PRUBLIMIT[MCUR] = MCUR + PBHSIZE + MPTR3 - 1;
- #
- PRU CHAIN HAS BEEN SET UP FROM A LIST STRUCTURE, THEREFORE THE
- FORWARD OF CHAIN IS SAME AS THE (PTR OF LIST+1), EXCEPT THE FST
- BUFFER IN THE LIST, PTR OF LIST POINTING BACK TO THE OWNNING
- BUFFER ( SEE MSETPTR ).
- I.E. - IF PRUBDLFP OF MOVED BUFFER IS ZERO, MEANS THAT IT IS THE
- LAST BUFFER IN LIST. AND THIS BUFFER BELONGED TO PIT CHAIN
- THEN UPDATE THE LAST LIMBO POINTER IN PIT, THE PIT ENTRY
- SLOTH IS POINTED BACK BY THIS PRUBDLFP ( SEE MSETPTR ).
- - IF PRUBDLFP OF MOVED BUFFER IS NON-ZERO, AND NOT EQUAL TO
- FORWARD PTR OF DATA RING THEN IT IS THE FIRST BUFFER OF
- THE LIST. UPDATE THE PCBPTR ENTRY OF INTERLOCK TABLE OR FST
- LIMBO PTR OF PIT ENTRY. THIS ENTRY ALSO IS POINTED BY
- THE CURRENT PRUBDLFP.
- #
- IF PRUBFSTB[MCUR] # FIRST BUFFER MARK IS TRUE #
- AND PRUBDLFP[MCUR] NQ 0
- THEN
- BEGIN # THIS MOVED BUFFER IS THE FST#
- P<ADDRWORD> = PRUBDLFP[MCUR] ; # UPDATE THE OWNNING BUFFER #
- # OWNNING NOW POINTS TO NEW BF#
- END
- TEST ;
- END
- END
- TERM
cdc/nos2.source/nam5871/majptr.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator