User Tools

Site Tools


cdc:nos2.source:nam5871:nvfvpsr

NVFVPSR

Table Of Contents

  • [00007] PROC NVFVPSR(SWTESS)
  • [00012] PROCESS SERIAL-SEARCH REQUEST.
  • [00058] PROC NVFUROS
  • [00059] PROC SSTAQE
  • [00060] PROC SSTRQE
  • [00254] PROC NVFVSRR
  • [00259] NVFVSRR - SET UP VCB-READ REQUEST.

Source Code

NVFVPSR.txt
  1. *DECK NVFVPSR
  2. USETEXT TEXTNVF
  3. USETEXT TEXTSS
  4. USETEXT TXCMDNV
  5. USETEXT TXVCBNV
  6.  
  7. PROC NVFVPSR(SWTESS);
  8. # TITLE NVFVPSR - PROCESS SERIAL-SEARCH REQUEST. #
  9.  
  10. BEGIN # NVFVPSR #
  11. #
  12. ** NVFVPSR - PROCESS SERIAL-SEARCH REQUEST.
  13. *
  14. * A. LIM. 82/04/14.
  15. * C. BRION 83/04/29.
  16. *
  17. * THIS PROCEDURE-S MAIN FUNCTION IS TO PROCESS SERIAL-SEARCH
  18. * REQUEST(S). (PRESENT DESIGN IS THERE IS ONLY ONE REQUEST
  19. * OUTSTANDING AT ONE TIME) IT RECORDS THE REQUEST WITH ADDITIONAL
  20. * INFORMATIONS INTO COMMON TABLE *AVST*. THEN IT CALLS INTERNAL
  21. * PROC TO SET UP TO READ *MAXSSRD$* OR LESS NUMBER OF VCB BLOCKS,
  22. * AND GOES TO IDLE TO BE WAKEN UP BY AN INTERRUPT SET BY
  23. * *NVFVFSD* ROUTINE TO READ MORE BLOCKS, OR INITIALLY WAKEN
  24. * UP BY DATA BEING PUT INTO *VSQ*.
  25. *
  26. * PROC NVFVPSR(SWTESS)
  27. *
  28. * ENTRY THE VCB SERIAL-SEARCH REQUEST(S) IN VCB-SERIAL-SEARCH
  29. * -REQUEST-QUEUE *VSQ*.
  30. *
  31. * EXIT ACTIVE-VCB-SERIAL-SEARCH-REQUEST TABLE *AVST* IS BUILT.
  32. * *MAXSSRD$* OR LESS NUMBER OF VCB READ REQUESTS MADE
  33. * IN VCB-READ-REQUEST QUEUE *VRQ*.
  34. * FORMAL RETURN PARAMETER ARRAY IS SET TO WAKE SELF UP
  35. * TO MAKE REQUESTS IN *VRQ* TO READ MORE VCB BLOCKS, OR
  36. * TO WAKE SELF UP WHEN MORE DATA IS PUT INTO *VSQ*.
  37. *
  38. * METHOD *SSTRQE* IS CALLED TO REMOVE AN ENTRY FROM *VSQ*, THEN
  39. * BUILD AN ENTRY IN THE *AVST* FROM THIS ENTRY.
  40. * *NVFVSRR* IS CALLED TO SET UP TO READ *MAXSSRD$* OR
  41. * LESS VCB BLOCKS.
  42. * FORMAL RETURN PARAMETER ARRAY IS SET SUCH THAT TO
  43. * WAKE SELF UP AFER *NVFVFSD* HAS DONE FILTERING
  44. * ALL THE REQUESTED BLOCKS AND MADE ENTRIES IN
  45. * VCB-SERIAL-SEARCH-DATA-QUEUE *VCBSSQ*.
  46. * WHEN DONE PROCESSING ALL ENTRIES IN *VSQ*,
  47. * FORMAL RETURN PARAMETER ARRAY IS SET SUCH THAT
  48. * TO WAKE SELF UP WHEN A NEW REQUEST IS MADE INTO
  49. * *VSQ*.
  50. #
  51.  
  52.  
  53. #
  54. **** PROC NVFVPSR XREF LIST
  55. #
  56. XREF
  57. BEGIN
  58. PROC NVFUROS; # RETURN VCB ORDINAL STATUS #
  59. PROC SSTAQE; # SS- ACCEPT A QUEUE ENTRY #
  60. PROC SSTRQE; # SS- REMOVE A QUEUE ENTRY #
  61. END
  62. #
  63. ****
  64. #
  65.  
  66. *CALL SWTESS
  67.  
  68.  
  69.  
  70. ITEM EFLAG B; # ERROR FLAG FROM SET UP READ REQUEST #
  71. ITEM I I; # LOOP INDUCTION VARIABLE #
  72. ITEM N I; # INDEX TO 2ND HALF OF MSGBUF #
  73.  
  74.  
  75. CONTROL EJECT;
  76.  
  77. N = (NMSGBUF$ + 1)/2; # INDEX TO 2ND HALF OF MSGBUF #
  78. P<TVSQ> = LOC(MSGBUF[0]); # POINT TVSQ TO 1ST HALF OF MSGBUF #
  79. P<TVCBSSQ> = LOC(MSGBUF[N]); # AND TVCBSSQ TO 2NF HALF OF MSGBUF#
  80. WCB$WORD[1] = 0; # CLEAR WC WORD 1 #
  81. ABH$WORD[1] = 0; # CLEAR ABH WORD 1 #
  82. FOR I = N STEP 1 UNTIL NMSGBUF$
  83. DO
  84. BEGIN # CLEAR 2ND HALF OF MSGBUF #
  85. MSG$WORD[I] = 0;
  86. END
  87.  
  88. #
  89. * IF HOP/BRK OR HOP/END OCCURRED, CLEAR INTERRUPT CELL *INVPSR*
  90. * IN CASE IT IS INVOKED BY *NVFVFSD*. SEND A VCB-SS-DATA ENTRY
  91. * WITH END FLAG AND ERROR RESPONSE FLAG SET TO *VCBSSQ*. EXIT
  92. * WITH FORMAL PARAMETER SET TO WAKE SELF UP WHEN DATA IN PUT
  93. * INTO *VSQ*.
  94. #
  95. TSS$APENDF[0] = AVS$APENDF[0]; # SET LAST APPL FLAG #
  96. IF ABORTCMDF
  97. THEN
  98. BEGIN
  99. INVPSR = 0; # CLEAR INTERRUPT CELL #
  100. WCB$WC[1] = VSSQSIZ$ + 2;
  101. TSS$VENDF[0] = TRUE; # SET VCB SS END FLAG #
  102. TSS$EC[0] = SSEC"ABRT"; # SET THE ERROR CODE #
  103. SSTAQE(P<VCBSSQ>,WCBUF[1],ABHBUF[1],MSGBUF[N]);
  104.  
  105. FOR I=0 WHILE VSQL NQ 0
  106. DO # EMPTY OUT THE SS REQUEST QUEUE#
  107. BEGIN
  108. SSTRQE(P<VSQ>,WCBUF[0],ABHBUF[0],MSGBUF[0]);
  109. END
  110.  
  111. INVVPSR = 0; # CLEAR INTERRUPT CELL #
  112. STE$ADDR1[0] = LOC(INVVPSR); # WATCH INTERRUPT FOR VSQ #
  113. STE$ADDR2[0] = 0; # AND ONE CELL ONLY #
  114. STE$RTN[0] = LOC(NVFVPSR); # INVOKE NVFVPSR WHEN VSQ NQ 0 #
  115. STE$INIT1[0] = 0;
  116. STE$INIT2[0] = 0;
  117. RETURN; # EXIT #
  118. END
  119.  
  120.  
  121. #
  122. * IF INVOKED BY *NVFVFSD* (INVPSR NQ 0), THEN SET UP TO READ MORE
  123. * BLOCKS, IF THERE IS MORE TO READ.
  124. #
  125.  
  126. IF INVPSR NQ 0
  127. THEN
  128. BEGIN
  129. INVPSR = 0; # CLEAR INTERRUPT #
  130. IF AVS$VCBLK[0] - 1 EQ MAXSEC$
  131. THEN
  132. BEGIN # LAST BLK READ ALREADY LAST BLK IN FILE #
  133. IF AVS$MTCHF[0]
  134. THEN
  135. BEGIN # DONE READING AND MATCH FOUND-- DONE #
  136. SSBUSYF = FALSE; # CLEAR SS-BUSY FLAG #
  137. TSS$VENDF[0] = TRUE;
  138. WCB$WC[1] = VSSQSIZ$ + 2;
  139. SSTAQE(P<VCBSSQ>,WCBUF[1],ABHBUF[1],MSGBUF[N]);
  140. END
  141. ELSE
  142. BEGIN # DONE READING VCB FILE, BUT NO MATCH #
  143. TSS$EC[0] = SSEC"NOMATCH";
  144. SSBUSYF = FALSE;
  145. WCB$WC[1] = VSSQSIZ$ + 2;
  146. TSS$VENDF[0] = TRUE; # WITH END FLAG AND #
  147. SSTAQE(P<VCBSSQ>,WCBUF[1],ABHBUF[1],MSGBUF[N]);
  148. END
  149. END
  150. ELSE
  151. BEGIN # MORE VCB BLOCKS TO READ #
  152. IF (AVS$SGLEF[0] AND AVS$MTCHF[0])
  153. THEN
  154. BEGIN # SEARCH FOR SINGLE ENTRY AND MATCH--DONE #
  155. SSBUSYF = FALSE; # CLEAR SS-BUSY FLAG #
  156. TSS$VENDF[0] = TRUE;
  157. WCB$WC[1] = VSSQSIZ$ + 2;
  158. SSTAQE(P<VCBSSQ>,WCBUF[1],ABHBUF[1],MSGBUF[N]);
  159. END
  160. ELSE
  161. BEGIN # NEED TO SEARCH FURTHER #
  162. NVFVSRR; # CALL TO SET UP MORE READ REQUEST #
  163. IF EFLAG
  164. THEN
  165. BEGIN # NONE OF THE BLOCKS LEFT ASSIGNED #
  166. IF AVS$MTCHF[0]
  167. THEN
  168. BEGIN # AT LEAST ONE MATCH FOUND #
  169. SSBUSYF = FALSE;
  170. TSS$VENDF[0] = TRUE;
  171. WCB$WC[1] = VSSQSIZ$ + 2;
  172. SSTAQE(P<VCBSSQ>,WCBUF[1],ABHBUF[1],MSGBUF[N]);
  173. END
  174. ELSE
  175. BEGIN # NO MATCH FOUND YET--BAD #
  176. TSS$EC[0] = SSEC"NOMATCH";
  177. SSBUSYF = FALSE;
  178. WCB$WC[1] = VSSQSIZ$+2; # SEND ENTRY TO VCBSSQ #
  179. TSS$VENDF[0] = TRUE; # WITH END FLAG #
  180. SSTAQE(P<VCBSSQ>,WCBUF[1],ABHBUF[1],MSGBUF[N]);
  181. END
  182. END
  183. ELSE
  184. BEGIN # SET UP TO READ IS GOOD #
  185. # WAKE SELF UP WHEN NVFVFSD DONE WITH ALL BLOCK READ #
  186. STE$ADDR1[0] = LOC(INVPSR);
  187. STE$ADDR2[0] = 0;
  188. STE$RTN[0] = LOC(NVFVPSR);
  189. STE$INIT1[0] = 0;
  190. STE$INIT2[0] = 0;
  191. RETURN; # EXIT #
  192. END
  193. END
  194. END
  195. END
  196.  
  197.  
  198. #
  199. * HERE TO PROCESS A NEW REQUEST IN *VSQ*
  200. #
  201.  
  202. FOR I = 0 WHILE VSQL NQ 0
  203. DO
  204. BEGIN
  205. SSTRQE(P<VSQ>,WCBUF[0],ABHBUF[0],MSGBUF[0]); # GET AN ENTRY #
  206. AVS$WORD0[0] = 0; # CLEAR AVST #
  207. AVS$WORD1[0] = 0;
  208. AVS$WORD2[0] = 0;
  209. AVS$VCBLK[0] = 1; # RESET VCB BLOCK = 1 #
  210. AVS$WORDP[0] = TVS$WORDP[0]; # GET DATA FROM VSQ #
  211. AVS$SGLEF[0] = TVS$SGLEF[0];
  212. AVS$VALUE[0] = TVS$VALUE[0];
  213. AVS$MASK[0] = TVS$MASK[0];
  214. AVS$APENDF[0] = TVS$APENDF[0]; # SET LAST APPL FLAG #
  215. NVFVSRR; # CALL TO SET UP TO READ BLOCKS #
  216. TSS$APENDF[0] = AVS$APENDF[0]; # SET LAST APPL FLAG #
  217. IF EFLAG
  218. THEN
  219. BEGIN # NO BLOCKS IN THE WHOLE VCB FILE ASSIGNED#
  220. TSS$EC[0] = SSEC"NOMATCH";
  221. WCB$WC[1] = VSSQSIZ$+2; # SEND AN ENTRY TO VCBSSQ #
  222. TSS$VENDF[0] = TRUE; # WITH END FLAG #
  223. SSTAQE(P<VCBSSQ>,WCBUF[1],ABHBUF[1],MSGBUF[N]);
  224. END
  225. ELSE
  226. BEGIN # ALREADY SET UP TO READ BLOCKS #
  227. SSBUSYF = TRUE; # SET SS-BUSY FLAG #
  228. # SET UP TO WAKE SELF UP BY NVFVFSD WHEN DONE FILTERING #
  229. STE$ADDR1[0] = LOC(INVPSR);
  230. STE$ADDR2[0] = 0;
  231. STE$RTN[0] = LOC(NVFVPSR);
  232. STE$INIT1[0] = 0;
  233. STE$INIT2[0] = 0;
  234. RETURN; # EXIT #
  235. END
  236. END
  237.  
  238.  
  239. #
  240. * RESTART PROC WHEN *VSQ* HAS DATA.
  241. #
  242.  
  243. INVVPSR = 0; # INSURE INTERRUPT CELL IS CLEAR #
  244. STE$ADDR1[0] = LOC(INVVPSR);
  245. STE$ADDR2[0] = 0;
  246. STE$RTN[0] = LOC(NVFVPSR);
  247. STE$INIT1[0] = 0;
  248. STE$INIT2[0] = 0;
  249. RETURN; # EXIT #
  250.  
  251.  
  252. CONTROL EJECT;
  253.  
  254. PROC NVFVSRR;
  255. # TITLE NVFVSRR - SET UP VCB-READ REQUEST. #
  256.  
  257. BEGIN # NVFVSRR #
  258. #
  259. ** NVFVSRR - SET UP VCB-READ REQUEST.
  260. *
  261. * A. LIM. 82/04/18.
  262. *
  263. * THIS PROCEDURE IS INTERNAL TO *NVFVPSR* AND IS CALLED ONLY
  264. * BY *NVFVPSR*. IT-S MAIN FUNCTION TO SET UP *MAXSSRD$* OR
  265. * LESS NUMBER OF VCB BLOCK READ REQUEST IN *VRQ*.
  266. *
  267. * PROC NVFVSRR
  268. *
  269. * ENTRY NEXT VCB BLOCK TO READ IN *AVST*.
  270. *
  271. * EXIT EFLAG = TRUE - ERROR, FROM NEXT BLOCK TO READ TO END
  272. * OF VCB FILE, THERE IS NO BLOCKS ASSIGNED.
  273. * = FALSE - *MAXSSRD$* OR LESS BLOCKS READ REQUESTS
  274. * MADE IN *VQR*.
  275. *
  276. * METHOD *NVFUROS* IS CALLED TO RETURN THE STATUS(ASSIGNED/
  277. * UNASSIGNED) OF A VCB ORDINAL. ANY ONE VCB ORDINAL
  278. * WITHIN A BLOCK IS ASSIGNED IS GOOD ENOUGH TO JUSTIFY
  279. * THAT BLOCK IS ASSIGNED. THEN A READ REQUEST WILL BE
  280. * MADE IN THE *VRQ*.
  281. * IT LOOPS TILL *MAXSSRD$* OR END OF FILE IS REACHED.
  282. #
  283.  
  284.  
  285. ITEM DUMBUF U; # DUMMY BUFFER FOR BODY OF VCB READ REQ #
  286. ITEM FOUND B; # LOOP EXIT VARIABLE #
  287. ITEM I I; # LOOP INDUCTION VARIABLE #
  288. ITEM J I; # LOOP INDUCTION VARIABLE #
  289. ITEM STATS B; # VCB ORD STATUS, T=UNASSIGNED, F=ASSIGNED#
  290. ITEM VCBORD U; # VCB ORDINAL #
  291.  
  292.  
  293.  
  294.  
  295.  
  296. EFLAG = FALSE; # CLEAR THE ERROR FLAG #
  297. P<TVRQ> = LOC(ABHBUF[1]); # POINT VRQ ENTRY TEMPLATE AT ABHBUF #
  298. FOR I = AVS$VCBLK[0] STEP 1 WHILE I LQ MAXSEC$
  299. AND AVS$RSSCNT[0] LS MAXSSRD$
  300. DO
  301. BEGIN # LOOP TIL BLK LIMIT OR MAX-SS-READ LIMIT #
  302. VCBORD = (I-1)*2**3 + 1; # CALCUL. FIRST VCB ORD IN BLK #
  303. FOUND = FALSE; # INIT LOOP EXIT VAR #
  304. FOR J = 1 STEP 1 WHILE J LQ VBMXENTRY$
  305. AND NOT FOUND
  306. DO
  307. BEGIN # LOOP TIL ALL ENTRIES IN BLK OR FOUND #
  308. NVFUROS(VCBORD,STATS); # CALL FOR STATUS OF ORD #
  309. IF NOT STATS
  310. THEN
  311. BEGIN # AT LEAST ONE ORDINAL IN BLK IS ASSIGNED #
  312. FOUND = TRUE; # EXIT THE LOOP #
  313. END
  314. VCBORD = VCBORD + 1;
  315. END
  316. IF FOUND
  317. THEN
  318. BEGIN # THIS BLOCK IS ASSIGNED #
  319. AVS$RSSCNT[0] = AVS$RSSCNT[0] + 1; # INCREMENT READ-SS-CNT #
  320. # BUILD A VCB READ REQUEST FOR SERIAL SEARCH #
  321. WCB$WORD[1] = 0; # CLEAR WC WORD 1 #
  322. ABH$WORD[1] = 0; # CLEAR ABH WORD 1 #
  323. WCB$WC[1] = 2;
  324. TVR$TYPE[0] = RDSS$;
  325. TVR$ORD[0] = VCBORD - 1;
  326. SSTAQE(P<VRQ>,WCBUF[1],TVRQ,DUMBUF);
  327. END
  328. END
  329. AVS$VCBLK[0] = I; # NEXT BLOCK TO READ #
  330. IF AVS$RSSCNT[0] EQ 0
  331. THEN
  332. BEGIN # NO READ REQUESTS MADE AT ALL--BAD #
  333. EFLAG = TRUE; # SET ERROR FLAG #
  334. END
  335.  
  336. END # NVFVSRR #
  337.  
  338. END # NVFVPSR #
  339.  
  340. TERM
cdc/nos2.source/nam5871/nvfvpsr.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator