User Tools

Site Tools


cdc:nos2.source:nam5871:cstrnd

CSTRND

Table Of Contents

  • [00004] PROC CSTRND (SWTESS)
  • [00005] CSTRND - RECEIVE NCF DATA.
  • [00009] RECEIVE NCF DATA.
  • [00086] PROC CSTSNR
  • [00087] PROC MOVE
  • [00088] PROC READLS
  • [00089] PROC READW
  • [00090] PROC SSFCBS
  • [00091] PROC SSSAWR
  • [00092] PROC SSTATS
  • [00093] PROC SSTRTS

Source Code

CSTRND.txt
  1. *DECK CSTRND
  2. USETEXT TEXTCS
  3. USETEXT TXTCTCS
  4. PROC CSTRND (SWTESS);
  5. # TITLE CSTRND - RECEIVE NCF DATA. #
  6.  
  7. BEGIN # CSTRND #
  8. #
  9. ** CSTRND - RECEIVE NCF DATA.
  10. *
  11. * D. G. DEPEW. 81/09/24.
  12. *
  13. * THIS PROCEDURE DEBLOCKS LINE RECORDS FROM THE NCF CIO BUFFER AND
  14. * COMBINES THEM WITH THE CORRESPONDING NCF READ REQUESTS QUEUE
  15. * ENTRIES TO CREATE NCF DATA QUEUE ENTRIES.
  16. *
  17. * PROC CSTRND (SWTESS)
  18. *
  19. * ENTRY THE NCF DATA QUEUE MAY CONTAIN EITHER OF THE FOLLOWING:
  20. * - ZERO (I.E., IT MAY BE EMPTY) OR MORE COMPLETE ENTRIES.
  21. * - ZERO OR MORE COMPLETE ENTRIES FOLLOWED BY A PARTIALLY
  22. * COMPLETED ENTRY. A PARTIALLY COMPLETED ENTRY IS ONE
  23. * WHICH AS YET CONTAINS ONLY A PROTION OR ITS LINE
  24. * RECORD.
  25. * THE NCF READ REQUESTS QUEUE CONTAINS ENTRIES CORRESPONDING
  26. * TO THOSE LINE RECORDS FOR WHICH DEBLOCKING HAS NOT YET
  27. * BEGUN.
  28. * ITEM *RLCOUNT* (IN TXTCTCS) CONTAINS THE NUMBER OF LINE
  29. * RECORDS BEING READ BY THE CURRENT READLS FUNCTION (AND
  30. * THENCE THE NUMBER OF RESULTING NCF DATA QUEUE ENTRIES).
  31. * ITEM *RLIORD* (IN TXTCTCS) POINTS TO THE READ LIST INDEX
  32. * ENTRY CORRESPONDING TO ONE OF THE FOLLOWING:
  33. * - THE LINE RECORD CURRENTLY BEING DEBLOCKED IF THE LAST
  34. * ENTRY IN THE NCF DATA QUEUE IS INCOMPLETE.
  35. * - THE LINE RECORD FOR WHICH DEBLOCKING WILL BEGIN IF THE
  36. * LAST ENTRY IN THE NCF DATA QUEUE IS COMPLETE OR THE
  37. * QUEUE IS EMPTY.
  38. * DATA IS AVAILABLE IN THE NCF CIO BUFFER.
  39. *
  40. * EXIT LINE RECORD DATA AND/OR NEW ENTRIES HAVE BEEN ADDED TO THE
  41. * NCF DATA QUEUE AS DESCRIBED BELOW UNDER *METHOD*.
  42. * NCF READ REQUESTS QUEUE ENTRIES, CORRESPONDING TO THOSE
  43. * NEW ENTRIES (EITHER COMPLETE OR INCOMPLETE) THAT HAVE
  44. * BEEN ADDED TO THE NCF DATA QUEUE THIS TIME (IF ANY),
  45. * HAVE BEEN DELETED.
  46. * FORMAL RETURN PARAMETER ARRAY SWTESS IS SET AS FOLLOWS:
  47. * - IF ALL LINE RECORDS SPECIFIED IN THE CURRENT READLS
  48. * OPERATION HAVE BEEN COMPLETELY PROCESSED, SWTESS IS
  49. * SET SO THAT PROC CSTSNR IS CALLED WHEN AN ENTRY IS
  50. * MADE IN THE CONFIGURE TERMINAL REQUEST QUEUE.
  51. * - IF ALL LINE RECORDS SPECIFIED IN THE CURRENT READLS
  52. * OPERATION HAVE NOT BEEN PROCESSED AND THE NCF CIO
  53. * BUFFER IS EMPTY, SWTESS IS SET SUCH THAT THIS ROUTINE
  54. * WILL AGAIN BE CALLED WHEN THE FET COMPLETE BIT IS SET
  55. * OR THE IN POINTER DOES NOT EQUAL THE OUT POINTER.
  56. * IF WE ARE WAITING FOR DATA TO BE PLACED IN THE BUFFER AND
  57. * THE I/O HAS STOPPED, THE READLS FUNCTION IS REISSUED.
  58. *
  59. * METHOD THIS ROUTINE CONSISTS PRIMARILY OF A LARGE LOOP. EACH
  60. * TIME THROUGH THE LOOP ONE OF THE FOLLOWING OCCURS:
  61. * - A NEW, SKELETON ENTRY IS ADDED TO THE NCF DATA QUEUE.
  62. * THIS ENTRY CONSISTS OF THE CNF/TE/R SM (FROM THE NCF
  63. * READ REQUESTS QUEUE) PLUS THE FIRST TWO WORDS OF THE
  64. * LINE RECORD. (WORD TWO OF A LINE RECORD CONTAINS ITS
  65. * LENGTH, WHICH IS USED TO DETERMINE THE SIZE OF THE
  66. * NCF DATA QUEUE ENTRY.) THE NCF READ REQUESTS QUEUE
  67. * ENTRY IS DELETED.
  68. * - LINE RECORD DATA IS ADDED TO AN INCOMPLETE NCF DATA
  69. * QUEUE ENTRY, BUT BECAUSE OF INSUFFICIENT DATA
  70. * AVAILABILITY, THE ENTRY CANNOT BE COMPLETED.
  71. * - LINE RECORD DATA IS ADDED TO AN INCOMPLETE NCF DATA
  72. * QUEUE ENTRY, COMPLETING IT EXACTLY.
  73. * THE LOOP TERMINATES WHEN ALL LINE RECORDS SPECIFIED IN THE
  74. * READLS FUNCTION HAVE BEEN PROCESSED OR WHEN THE CIO BUFFER
  75. * IS EMPTY. THIS ROUTINE CAN STOP AN INDEFINITE NUMBER OF
  76. * TIMES TO WAIT FOR I/O.
  77. #
  78.  
  79. *CALL SWTESS
  80.  
  81. #
  82. **** PROC CSTRND - XREF LIST BEGIN.
  83. #
  84. XREF
  85. BEGIN
  86. PROC CSTSNR; #START NCF READ REQUESTS #
  87. PROC MOVE; #MOVE STORAGE DIRECT ADDRESSING (MACREL) #
  88. PROC READLS; #ISSUE CIO READLS FUNCTION (MACREL) #
  89. PROC READW; #READ WORDS FROM CIO BUFFER (MACREL) #
  90. PROC SSFCBS; #DETERMINE AVAIL DATA AND SPACE IN BUFFER #
  91. PROC SSSAWR; #ACCEPT WORKLIST REQUEST #
  92. PROC SSTATS; #ALLOCATE STORAGE AT END OF TABLE #
  93. PROC SSTRTS; #REMOVE STORAGE ANYWHERE IN TABLE #
  94. END
  95. #
  96. ****
  97. #
  98.  
  99.  
  100. ITEM I; #LOOP INDUCTION VARIABLE #
  101. ITEM QORD; #CALCULATED ORD LAST ENTRY OF NCF DATA Q #
  102. ITEM RORD; #NDQ ORD TO RD INTO OR CORRES NRQ NTRY ORD#
  103. ITEM NEED; #AMT OF DATA NEEDED TO COMPLETE NDQ ENTRY #
  104. ITEM AVAIL; #AMT OF DATA AVAILABLE IN NCF CIO BUFFER #
  105. ITEM WC; #SIZ NEW NDQ NTRY OR AMT FILLED IN SO FAR #
  106. ITEM SIZ; #SIZ OF CORRESPONDING NCF READ Q ENTRY #
  107. ITEM TEMP; #FOR UNNEEDED GARBAGE #
  108.  
  109. ARRAY LINEHDR [00:00] S(LRHDRL$); #LINE RECORD HEADER WSA #
  110. ITEM LH$LRLEN U(01,48,12); #LINE REC LENGTH EXCLUDING ID WD #
  111.  
  112.  
  113.  
  114.  
  115.  
  116. IF NDQL NQ 0
  117. THEN # AT LEAST ONE ENTRY IN NDQ (MAY BE INC) #
  118. FOR QORD=0 STEP NDQ$ESIZE[QORD]
  119. WHILE (QORD + NDQ$ESIZE[QORD]) LS NDQL
  120. DO # FIND FIRST WD OF LAST NCF DATA Q ENTRY #
  121. BEGIN END
  122.  
  123. FOR I=0 WHILE NF$IN[0] NQ NF$OUT[0]
  124. AND RLIORD LS RLCOUNT
  125. DO # LOOP UNTIL BUF EMPTY OR ALL LINRECS READ#
  126. IF NDQL NQ 0
  127. AND NOT NDQ$CFLAG[QORD]
  128.  
  129. THEN # NDQ NOT EMPTY AND LAST ENTRY INCOMPLETE #
  130. BEGIN # CONTINUE ENTRY IN PROGRESS #
  131. WC = NDQ$TCSIZE[QORD] + NDQ$LRSIZE[QORD]; # TOT DATA SO FAR #
  132. NEED = NDQ$ESIZE[QORD] - WC;
  133. SSFCBS (NCFFET, TEMP, AVAIL); # FIND OUT WHAT'S AVAILABLE #
  134. IF AVAIL GQ NEED
  135. THEN # THE LAST ENTRY CAN BE COMPLETED NOW #
  136. BEGIN
  137. AVAIL = NEED; # WILL ADD EXACT AMOUNT TO COMPLETE ENTRY #
  138. NDQ$CFLAG[QORD] = TRUE; # SET ENTRY COMPLETE #
  139. SSSAWR(CSWDF"CTDNQ") ; # CONFIGUE OR RE-CONFIGUE TERM#
  140. RLIORD = RLIORD + 1; # NEXT READLIST INDEX ENTRY #
  141. END
  142. RORD = QORD + WC; # ORD TO WHICH DATA WILL BE READ #
  143. READW (NCFFET, NDQ[RORD], AVAIL, TEMP); # XFER DATA TO NTRY #
  144. NDQ$LRSIZE[QORD] = NDQ$LRSIZE[QORD] + AVAIL; # AMT RD SO FAR#
  145. END
  146.  
  147. ELSE # NDQ EMPTY OR LAST ENTRY COMPLETE #
  148. BEGIN # CREATE A NEW SKELETON NCF DATA Q ENTRY #
  149. QORD = NDQL; # WHERE NEW NDQ ENTRY WILL BE #
  150. FOR RORD=0 STEP NRQ$ESIZE[RORD]
  151. WHILE NRQ$LRIORD[RORD] NQ RLI$LRIORD [RLIORD]
  152. DO # FND NRQ NTRY CORRESPONDING TO NXT LINREC#
  153. BEGIN END
  154. READW (NCFFET, LINEHDR, LRHDRL$, TEMP); # GET NXT LINREC HDR#
  155. SIZ = NRQ$ESIZE[RORD];
  156. WC = SIZ + LH$LRLEN[0] + 1; # TOTAL SIZE NEW NCF DATA Q NTRY#
  157. SSTATS (P<NDQ>, WC); # ADD NEW ENTRY SPACE TO NCF DATA Q #
  158. MOVE (SIZ, NRQ[RORD], NDQ[QORD]); # START NEW NDQ ENTRY #
  159. SSTRTS (P<NRQ>, RORD, SIZ); # DELETE NCF READ QUEUE ENTRY #
  160. NDQ$CFLAG[QORD] = FALSE;
  161. NDQ$LRSIZE[QORD] = LRHDRL$; # AMT OF LINREC IN NTRY SO FAR #
  162. NDQ$TCSIZE[QORD] = SIZ; # CNF/TE/R SIZ SAME AS NRQ NTRY SIZ #
  163. NDQ$ESIZE[QORD] = WC; # INITIALIZE WITH FINAL ENTRY SIZE #
  164. RORD = QORD + SIZ; # BEGINNING ORDINAL OF LINE RECORD #
  165. MOVE (LRHDRL$, LINEHDR, NDQ[RORD]); # SKELETON NDQ NTRY DONE#
  166. END
  167.  
  168. # SET UP FORMAL RETURN PARAMETER ARRAY SWTESS. #
  169.  
  170. IF RLIORD EQ RLCOUNT
  171. AND NF$CBIT[0]
  172. THEN # ALL LINE RECORDS HAVE BEEN DEBLOCKED #
  173. BEGIN
  174.  
  175. # WE WANT PROC CSTSNR TO BE CALLED WHENEVER AN ENTRY IS PLACED IN #
  176. # THE CONFIGURE TERMINAL REQUEST QUEUE (CTQ) AND IF THERE IS #
  177. # ALREADY AN ENTRY IN THE CTQ, WE WANT CSTSNR CALLED IMMEDIATELY. #
  178. # AT THIS POINT, HOWEVER, THE INTERRUPT CELL FOR PROC CSTSNR (ITEM #
  179. # *ICSTSNR* - WATCHED BY THE STATUS WORKLIST ENTRY PROCESSOR AND #
  180. # INCREMENTED WHENEVER AN ENTRY IS PLACED IN THE CTQ) HAS SOME NON-#
  181. # ZERO VALUE THAT MAY OR MAY NOT ACCURATELY REFLECT THE PRESENSE #
  182. # OF AN ENTRY IN THE CTQ (*ICSTSNR* MAY BE NON-ZERO SOLELY AS A #
  183. # RESULT OF PREVIOUS ENTRIES THAT HAVE ALL BEEN PROCESSED). IF WE #
  184. # SIMPLY CLEAR *ICSTSNR*, RECOLLECTION OF ANY ENTRIES THAT MIGHT #
  185. # ALREADY BE IN THE CTQ WILL BE LOST AND THEY WONT GET PROCESSED #
  186. # UNTIL ANOTHER ENTRY IS PLACED IN THE CTQ (COULD BE A LONG TIME). #
  187. # WHAT WE WANT TO DO IS SET *ICSTSNR* TO ZERO IF THE CTQ IS EMPTY, #
  188. # OR SET IT NON-ZERO (ACTUAL VALUE OF NO CONSEQUENCE) IF THERE IS #
  189. # AT LEAST ONE ENTRY IN THE CTQ. HENCE, THE FOLLOWING CODE LINE. #
  190.  
  191. ICSTSNR = CTQL; # REFLECTS PRESENSE OF CNF/TE/R Q ENTRIES #
  192. STE$ADDR1[0] = LOC (ICSTSNR); # WATCH INTERRUPT CELL #
  193. STE$ADDR2[0] = 0; # WATCH ONE CELL ONLY #
  194. STE$RTN[0] = LOC (CSTSNR); # PROCESSOR OF CNF/TE/R QUEUE #
  195. STE$INIT1[0] = 0; # CALL WHEN NONZERO ENTRIES IN CNF/TE/R Q #
  196. STE$INIT2[0] = 0;
  197. END
  198. ELSE # WE MUST WAIT FOR I/O #
  199. BEGIN
  200. STE$ADDR1[0] = LOC (NCFFET); # WATCH FIRST WORD OF NCF FET #
  201. STE$ADDR2[0] = LOC (NF$IN[0]); # WATCH FET IN POINTER #
  202. STE$RTN[0] = LOC (CSTRND); # RECALL THIS ROUTINE #
  203. STE$INIT1[0] = NF$WORD[0]; # SET UP INIT VALUE OF FET 1ST WD #
  204. STE$CBIT1[0] = FALSE; # RECALL WHEN FET COMP BIT IS SET #
  205. STE$INIT2[0] = NF$OUT[0]; # RECALL WHEN *IN* NQ *OUT* #
  206. IF NF$CBIT[0]
  207. THEN # I/O HAS STOPPED #
  208. READLS (NCFFET); # RESTART CURRENT READLS OPERATION #
  209. END
  210.  
  211. END # CSTRND #
  212.  
  213. TERM
cdc/nos2.source/nam5871/cstrnd.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator