User Tools

Site Tools


cdc:nos2.source:nam5871:nvfvdcd

NVFVDCD

Table Of Contents

  • [00005] PROC NVFVDCD(SWTESS)
  • [00006] NVFVDCD - DISPATCH CIO DATA.
  • [00010] DISPATCH VCB DATA FROM CIO BUFFER.
  • [00068] PROC ABORT
  • [00069] PROC MESSAGE
  • [00070] PROC MOVE
  • [00071] PROC NVFUMVD
  • [00072] PROC NVFVFSD
  • [00073] PROC NVFVRVF
  • [00074] PROC NVFVWVF
  • [00075] PROC READLS
  • [00076] PROC READW
  • [00077] PROC SSTAQE
  • [00078] PROC SSTATS
  • [00079] PROC SSTRTS
  • [00099] DUMMY - DUMMY BASED ARRAY.
  • [00109] WCWD - WORD COUNT ARRAY.
  • [00123] HDR - HEADER ARRAY.

Source Code

NVFVDCD.txt
  1. *DECK NVFVDCD
  2. USETEXT TEXTNVF
  3. USETEXT TXVCBNV
  4.  
  5. PROC NVFVDCD(SWTESS);
  6. # TITLE NVFVDCD - DISPATCH CIO DATA. #
  7.  
  8. BEGIN # NVFVDCD #
  9. #
  10. ** NVFVDCD - DISPATCH VCB DATA FROM CIO BUFFER.
  11. *
  12. * A. LIM. 81/11/20.
  13. *
  14. * THIS PROCEDURE DISPATCHES VCB DATA FROM CIO BUFFER TO THE
  15. * APPROPRIATE QUEUE, OR CALL THE APPROPRIATE ROUTINE TO
  16. * PROCESS IT.
  17. *
  18. * PROC NVFVDCD(SWTESS)
  19. *
  20. * ENTRY *AVRT* (ACTIVE-VCB-REQUEST-TABLE) CONTAINS THE ACTIVE
  21. * VCB READ REQUESTS READ BY THE CURRENT READLS FUNCTION.
  22. * *AVCOUNT* CONTAINS THE NUMBER OF ENTRIES IN AVRT.
  23. * *READLIST* IS THE ACTUAL READ LIST USED BY THE CIO
  24. * READLS FUNCTION. *RLCOUNT* CONTAINS THE NUMBER OF
  25. * ENTRIES IN READLIST.
  26. * *AVRT*, *AVCOUNT*, *READLIST*, *RLCOUNT* ARE IN
  27. * COMMON BLOCK *VCBIO* IN *TXVCBNV*.
  28. * *VWT* (IN TEXTNVF) CONTAINS THE VCB WRITE REQUESTS.
  29. * DATA IS AVAILABLE IN THE VCB CIO BUFFER.
  30. *
  31. * EXIT VCB DATA FROM THE VCB CIO BUFFER ARE DISPATCHED TO
  32. * THE APPROPRIATE QUEUE, OR THE APPROPRIATE ROUTINE
  33. * IS CALLED TO PROCESS THE DATA.
  34. * FORMAL RETURN PARAMETER ARRAY SWTESS IS SET AS FOLLOWS:
  35. * - IF ALL VCB RECORDS SPECIFIED IN THE CURRENT READLS
  36. * OPERATION HAVE BEEN PROCESSED, AND
  37. * *VWBT* (VCB-WRITE-BLOCK-TABLE) NOT EMPTY, SWTESS IS
  38. * SET SO THAT PROC NVFVWVF IS CALLED TO WRITE THE
  39. * RECORD BACK TO DISK. ELSE IF *VWBT* EMPTY, SET
  40. * SWTESS TO GO BACK TO THE INITIAL STATE, I.E.
  41. * CALL PROC NVFVRVF TO READ THE VCB FILE AGAIN.
  42. * - IF CIO READLS NOT COMPLETE, AND CIO IDLE, REISSUE
  43. * READLS FUNCTION.
  44. * EITHER CIO READLS NOT COMPLETE AND CIO IDLE, OR
  45. * JUST CIO READLS NOT COMPLETE, SET SWTESS SUCH
  46. * THAT THIS ROUTINE WILL AGAIN BE CALLED WHEN THE
  47. * FET COMPLET BIT IS SET OR THE IN POINTER
  48. * DOES NOT EQUAL TO THE OUT POINTER.
  49. *
  50. * METHOD THIS ROUTINE CONSISTS PRIMARILY OF A LARGE LOOP. EACH
  51. * TIME THROUGH THE LOOP, A REQUEST IN THE AVRT WILL BE
  52. * PROCESSED.
  53. * THE LOOP TERMINATES WHEN ALL ENTRIES IN THE AVRT HAVE
  54. * BEEN PROCESSED OR WHEN THE CIO BUFFER IS EMPTY.
  55. #
  56.  
  57.  
  58.  
  59.  
  60.  
  61. *CALL SWTESS
  62.  
  63. #
  64. **** PROC NVFVDCD - XREF LIST BEGIN.
  65. #
  66. XREF
  67. BEGIN
  68. PROC ABORT; # MACREL- ABORT TASK #
  69. PROC MESSAGE; # MACREL- DAYFILE MESSAGE #
  70. PROC MOVE; # MACREL - MOVE CM WORDS #
  71. PROC NVFUMVD; # NVF - MARK VCB DATA VALID/INVALID #
  72. PROC NVFVFSD; # NVF - FILTER SS DATA BLOCK #
  73. PROC NVFVRVF; # NVF - READ VCB FILE #
  74. PROC NVFVWVF; # NVF - WRITE VCB FILE #
  75. PROC READLS; # MACREL - CIO READLS FUNCTION CALL #
  76. PROC READW; # MACREL - CIO READW FUNCTION CALL #
  77. PROC SSTAQE; # SS - ACCEPT QUEUE ENTRY #
  78. PROC SSTATS; # SS - ALLOCATE STORAGE AT END OF TABLE #
  79. PROC SSTRTS; # SS - REMOVE TABLE SPACE #
  80. END
  81. #
  82. ****
  83. #
  84.  
  85. # ITEM #
  86.  
  87. ITEM AINDX I = 0; # AVRT INDEX, PRESET TO 0 #
  88. ITEM CURBLK I = -1; # CURRENT DATA BLOCK #
  89. ITEM I,II,J,L I; # INDUCTION VARIABLES #
  90. ITEM K I; # INDEX #
  91. ITEM MATCHE B; # FLAG FOR MATCH ON ENTRY #
  92. ITEM P I; # ACTUAL PARAMETER FOR SSTRTS #
  93. ITEM TEMP I; # FOR UNNEEDED GARBAGE #
  94. ITEM VWTFLAG B; # FLAG FOR TERMINATING VWT SEARCH LOOP #
  95. ITEM WRSAMBLK B; # FLAG FOR WRITTING ON SAME BLOCK #
  96.  
  97.  
  98. #
  99. ** DUMMY - DUMMY BASED ARRAY.
  100. *
  101. * DUMMY IS A BASED ARRAY USED TO STORE AN ADDRESS INTO THE
  102. * PARAMETER LIST.
  103. #
  104.  
  105. BASED ARRAY DUMMY[00:00] S(1);;
  106.  
  107.  
  108. #
  109. ** WCWD - WORD COUNT ARRAY.
  110. *
  111. * WCWD ARRAY IS THE FIRST PORTION OF A MANAGED QUEUE ENTRY. IT
  112. * CONTAINS THE WORD COUNT OF QUEUE ENTRY SIZE + 2 WORDS.
  113. * (ITSELF AND HEADER WORD).
  114. #
  115. ARRAY WCWD[00:00] S(1);
  116. BEGIN
  117. ITEM WC$WORD U(00,00,60); # FULL WORD REFERENCE #
  118. ITEM WC$WC U(00,48,12); # ENTRY SIZE #
  119. END
  120.  
  121.  
  122. #
  123. ** HDR - HEADER ARRAY.
  124. *
  125. * HDR ARRAY IS THE SECOND PORTION OF A MANAGED QUEUE ENTRY. IT
  126. * CONTAINS THE HEADER INFORMATION OF THE ENTRY.
  127. #
  128. ARRAY HDR[00:00] S(1);
  129. BEGIN
  130. ITEM HDR$WORD U(00,00,60); # FULL WORD REFERENCE #
  131. END
  132.  
  133. #
  134. * TEMPB- THIS IS A TEMPBORARY BUFFER TO GET THE CONTENT OF
  135. * AN ADDRESS.
  136. #
  137.  
  138. BASED ARRAY TEMPB[00:00] S(1);
  139. BEGIN
  140. ITEM TEM$LA U(00,42,18); # LIST ADDRESS FOR CIO READLS #
  141. END
  142.  
  143.  
  144. #
  145. * RDLSMSG- DAYFILE MESSAGE.
  146. #
  147.  
  148. ARRAY RDLSMSG[00:00] S(4);
  149. BEGIN
  150. ITEM RDL$MSG C(00,00,31) =
  151. [" NVFVDCD- ERRONEOUS READLS CALL"];
  152. ITEM RDL$ZERO U(03,06,54) = [0];
  153. END
  154.  
  155.  
  156. CONTROL EJECT;
  157.  
  158. P<TEMPB> = VB$LA[0];
  159. FOR I = AINDX STEP 1 WHILE ((VB$IN[0] NQ VB$OUT[0]) OR
  160. (AVR$RPA[I] EQ CURBLK))
  161. AND (I LS AVCOUNT)
  162. DO # LOOP AS LONG AS BUFFER HAS DATA OR READ #
  163. BEGIN # ON CURRENT BLOCK AND AVRT NOT EXHAUSTED #
  164. IF AVR$RPA[I] NQ CURBLK
  165. THEN
  166. BEGIN # TIME TO TRFR A NEW BLK OF DATA INTO WSA #
  167. READW(VCBFET,VCBWSA,VBRECD$,TEMP);
  168. CURBLK = VBW$RPA[1]; # SAVE THE CURRENT BLK NUMBER #
  169. END
  170. IF AVR$RPA[I] EQ VBW$RPA[1]
  171. THEN
  172. BEGIN # AVRT RPA MATCH VCBWSA RPA #
  173. IF AVR$TYPE[I] NQ MARKED$
  174. THEN
  175. BEGIN # A REQUEST THAT HAS NOT BEEN PROCESSED #
  176. IF AVR$TYPE[I] EQ RDWRITE$
  177. THEN
  178. BEGIN # READ FOR A WRITE #
  179. WRSAMBLK = TRUE; # MIGHT BE OTHER WRITE ON SAME BLK #
  180. FOR II = I STEP 1 WHILE II LS AVCOUNT
  181. AND WRSAMBLK
  182. DO # LOOP UNTIL AVRT EXHSTD OR NOT SAME BLK#
  183. BEGIN
  184. IF AVR$TYPE[II] EQ RDWRITE$
  185. THEN
  186. BEGIN
  187. IF AVR$RPA[II] EQ VBW$RPA[1]
  188. THEN
  189. BEGIN # WRITE ON SAME BLK MERGE DATA FR VWT TO WSA#
  190. IF VWTLNGTH NQ 0
  191. THEN
  192. BEGIN
  193. VWTFLAG = FALSE;
  194. FOR J = 0 STEP 1 WHILE J LS VWTLNGTH/VBESIZ$
  195. AND NOT VWTFLAG
  196. DO
  197. BEGIN
  198. IF AVR$ORD[II] EQ VWT$ORD[J]
  199. THEN
  200. BEGIN # MATCH ON VCB ORD #
  201. MOVE(VBESIZ$,VWT[J],VCBWSA[AVR$ENTRY[II]]);
  202. P = J * VBESIZ$;
  203. SSTRTS(P<VWT>,P,VBESIZ$); # REMOVE SPS FR VWT#
  204. NVFUMVD(AVR$ORD[II],VALID$); # MRK DATA VALID#
  205. AVR$TYPE[II] = MARKED$; # MARK NTRY AS PROCD#
  206. VWTFLAG = TRUE; # TERMINATE LOOP #
  207. END
  208. END
  209. $BEGIN
  210. IF NOT VWTFLAG THEN ABORT;
  211. $END
  212. END
  213. ELSE
  214. BEGIN
  215. $BEGIN # VWT EMPTY #
  216. ABORT;
  217. $END
  218. END
  219. END
  220. ELSE
  221. BEGIN
  222. WRSAMBLK = FALSE;
  223. END
  224. END
  225. END
  226. SSTATS(P<VWBT>,VBRECD$); # ALLOC SPS AT END OF VWBT#
  227. K = VWBLNGTH/VBRECD$ - 1; # CALCULATE INDEX #
  228. MOVE(VBRECD$,VCBWSA,VWBT[K]); #MOV BLK FR WSA TO VWBT#
  229. END # READ FOR A WRITE #
  230. ELSE IF AVR$TYPE[I] EQ RDSS$
  231. THEN
  232. BEGIN # READ FOR SERIAL SEARCH #
  233. NVFVFSD; # CALL PROC TO PROCESS THE BLK #
  234. END
  235. ELSE IF AVR$TYPE[I] EQ RDREAD$
  236. THEN
  237. BEGIN # READ FOR READING OF AN ENTRY #
  238. MATCHE = FALSE; # INIT FLAG #
  239. FOR L = 1 STEP 1 WHILE L LQ VBMXENTRY$
  240. AND NOT MATCHE
  241. DO
  242. BEGIN # SEARCH WSA FOR THE ENTRY #
  243. IF AVR$ENTRY[I] EQ VBW$ENTRY[L]
  244. THEN
  245. BEGIN # FOUND #
  246. WC$WC[0] = VBESIZ$ + 2;
  247. HDR$WORD[0] = AVR$WORD[I]; # PUT AVRT ENTRY IN HDR #
  248. P<DUMMY> = AVR$QADDR[I]; # GET DESTINATION Q ADDR #
  249. SSTAQE(DUMMY,WCWD,HDR,VCBWSA[L]); # TRFR ENTRY TO Q #
  250. NVFUMVD(AVR$ORD[I],INVALID$); # MARK DATA INVALID #
  251. MATCHE = TRUE;
  252. END
  253. END
  254. $BEGIN # CANNOT FIND THE ENTRY, IMPOSSIBLE... #
  255. IF NOT MATCHE THEN ABORT;
  256. $END
  257. END # READ FOR READING OF AN ENTRY #
  258. END # AVRT READ TYPE NOT MARKED #
  259. END # AVRT RPA MATCH VCBWSA RPA #
  260. END # FOR I LOOP #
  261. AINDX = I; # SET AVRT INDEX #
  262.  
  263. #
  264. * SET UP FORMAL RETURN PARAMETER ARRAY SWTESS.
  265. #
  266.  
  267. IF AINDX EQ AVCOUNT
  268. THEN
  269. BEGIN # AVRT EXHAUSTED, IMPLIES CIO READLS COMPL#
  270. AINDX = 0; # RESET AVRT INDEX #
  271. CURBLK = -1; # RESET CURRENT BLOCK #
  272. IF VWBLNGTH NQ 0
  273. THEN
  274. BEGIN # VWBT NOT EMPTY #
  275. STE$ADDR1[0] = LOC(VCBFET); # WATCH FET COMPLETE BIT #
  276. STE$ADDR2[0] = 0; # AND WATCH ONE LOCATION ONLY#
  277. STE$RTN[0] = LOC(NVFVWVF); # WAKE UP PROC *NVFVWVF* #
  278. STE$INIT1[0] = VB$WORD[0];
  279. STE$CBIT1[0] = FALSE;
  280. STE$INIT2[0] = 0;
  281. END
  282. ELSE
  283. #GO BACK TO INITIAL STATE: READ VCB FILE WHEN VRQ NON-EMPTY #
  284. BEGIN
  285. STE$ADDR1[0] = LOC(INVVRVF); # WATCH INTERRUPT CELL FOR VRQ #
  286. STE$ADDR2[0] = 0;
  287. STE$RTN[0] = LOC(NVFVRVF);
  288. STE$INIT1[0] = 0;
  289. STE$INIT2[0] = 0;
  290. IF NOT VB$CBIT[0]
  291. THEN
  292. BEGIN
  293. STE$ADDR1[0] = LOC(VCBFET);
  294. STE$ADDR2[0] = 0;
  295. STE$RTN[0] = LOC(NVFVRVF);
  296. STE$INIT1[0] = VB$WORD[0];
  297. STE$CBIT1[0] = FALSE;
  298. STE$INIT2[0] = 0;
  299. END
  300. END
  301. END
  302. ELSE
  303. BEGIN # CIO READLS INCOMPLETE #
  304. IF VB$CBIT[0]
  305. THEN
  306. BEGIN # CIO IDLE #
  307. IF TEM$LA[0] EQ 0
  308. THEN
  309. BEGIN # READLS LA IS SET TO TERMINATOR WORD #
  310. MESSAGE(RDLSMSG[0], 0);
  311. ABORT;
  312. END
  313. ELSE
  314. BEGIN
  315. READLS(VCBFET); # REISSUE READLS REQUEST #
  316. END
  317. END
  318. STE$ADDR1[0] = LOC(VCBFET); # WATCH COMPLETE BIT IN FET+0 #
  319. STE$ADDR2[0] = LOC(VB$IN[0]); # AND WATCH FET *IN* POINTER #
  320. STE$RTN[0] = LOC(NVFVDCD); # WAKE UP *NVFVDCD* WHEN ONE CHG#
  321. STE$INIT1[0] = VB$WORD[0]; # SET UP INIT VALUE OF FET + 0 #
  322. STE$CBIT1[0] = FALSE; # WAKE SELF UP AGAIN WHEN CBIT ST#
  323. STE$INIT2[0] = VB$OUT[0];
  324. END
  325.  
  326. END # NVFVDCD #
  327. TERM
cdc/nos2.source/nam5871/nvfvdcd.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator