Table of Contents

DMSVSR Source

References

Source Listing

DMSVSR.ASSEMBLE.txt
  1. VSR TITLE 'DMSVSR (CMS) VM/370 - RELEASE 6' 00001000
  2. *. 00002000
  3. * MODULE NAME - 00003000
  4. * 00004000
  5. * DMSVSR - ROUTINE TO RELEASE VSAM SYSTEM 00005000
  6. * 00006000
  7. * FUNCTION - 00007000
  8. * 00008000
  9. * TO CLEAN UP AND RELEASE CMS/VSAM 00009000
  10. * 00010000
  11. * COMMAND LINE FORMAT - 00011000
  12. * 00012000
  13. * GPR 1 POINTS TO ... 00013000
  14. * 00014000
  15. * PLIST DS 0F 00015000
  16. * DC CL8'DMSVSR' 00016000
  17. * DC X'FFFFFFFF' 00017000
  18. * 00018000
  19. * ATTRIBUTES - 00019000
  20. * 00020000
  21. * NUCLEUS RESIDENT, RE-ENTRANT 00021000
  22. * 00022000
  23. * ENTRY POINT - 00023000
  24. * 00024000
  25. * DMSVSR 00025000
  26. * 00026000
  27. * ENTRY CONDITIONS - 00027000
  28. * 00028000
  29. * GPR 1 POINTS TO DMSVSR COMMAND LINE (AS ABOVE). 00029000
  30. * GPR 14 = RETURN REGISTER 00030000
  31. * GPR 15 = ADDRESS OF DMSVSR 00031000
  32. * 00032000
  33. * EXIT CONDITIONS - 00033000
  34. * 00034000
  35. * NORMAL RETURN: 00035000
  36. * GPR 14 = RETURN REGISTER 00036000
  37. * GPR 15 = 0 00037000
  38. * 00038000
  39. * ERROR RETURN: 00039000
  40. * GPR 14 = RETURN REGISTER 00040000
  41. * GPR 15 = 1 (IF DOS MODE WAS NOT IN EFFECT 00041000
  42. * OR RECURSIVE CALL TO DMSVSR) 00042000
  43. * 00043000
  44. * DATA CLEARED AS NEEDED IN NUCON, CMSCVT & BGCOM CONTROL BLOCKS 00044000
  45. * 00045000
  46. * CALLS TO OTHER ROUTINES - 00046000
  47. * 00047000
  48. * $$BACLOS - TO CLOSE ALL OPEN ACB'S 00048000
  49. * 00049000
  50. * EXTERNAL REFERENCES - 00050000
  51. * 00051000
  52. * DMSFREE - TO OBTAIN FREE STORAGE 00052000
  53. * DMSFRET - TO RELEASE FREE STORAGE 00053000
  54. EJECT 00054000
  55. * TABLES / WORK AREAS - 00055000
  56. * 00056000
  57. * 'VSRWORK' AREA FOR MODULE RE-ENTRANCY 00057000
  58. * 00058000
  59. * REGISTER USAGE 00059000
  60. * 00060000
  61. * GPR 0 CONTAINS SIZE REQUEST FOR DMSFRET 00061000
  62. * GPR 1 IS USED FOR SVC CALLS, DMSFRET 00062000
  63. * GPR 2 THRU 7 ARE USED FOR WORK REGISTERS. 00063000
  64. * GPR 8 = VSR WORK AREA FOR REENTRANCY 00064000
  65. * GPR 11 = RETURN-REGISTER (R14) SAVED 00065000
  66. * GPR 12 = ADDRESSABILITY 00066000
  67. * GPR 13 = SAVE-AREA PROVIDED BY DMSITS (SVC-INTERRUPT HANDLER) 00067000
  68. * GPR 14 = RETURN REGISTER 00068000
  69. * GPR 15 = LINKING/WORK REGISTER 00069000
  70. * 00070000
  71. * GPR 9 - 10 ARE NOT USED. 00071000
  72. * 00072000
  73. * NOTES - 00073000
  74. * 00074000
  75. * DMSVSR IS CALLED WHEN NECESSARY TO CLOSE ANY VSAM FILES WHICH 00075000
  76. * MAY BE OPEN, AND TO "RESET" CMS/VSAM. 00076000
  77. * 00077000
  78. * OPERATION - 00078000
  79. * 00079000
  80. * 1. IF DOS MODE NOT IN EFFECT OR RECURSIVE CALL OR PPEND=0, 00080000
  81. * EXITS IMMEDIATELY WITH A RETURN CODE OF 1. 00081000
  82. * 00082000
  83. * 2. CALL VSAM AUTOMATIC CLOSE ($$BACLOS) TO CLEANUP ANY 00083000
  84. * OPEN ACB'S. 00084000
  85. * 00085000
  86. * 3. CLEARS 'PPEND' (ADDRESS OF ANCHOR-TABLE) IN BGCOM. 00086000
  87. * 00087000
  88. * 4. CLEAR THE VSAM RESOURCE TABLE IN NUCON. 00088000
  89. * 00089000
  90. * 5. IF A VSAM SAVED SYSTEM IS PRESENT, IT IS PURGED. 00090000
  91. * 00091000
  92. * 6. IF THE OS VSAM INTERFACE (DMSVIP) HAS BEEN INITIALIZED, 00092000
  93. * PREVIOUSLY ALLOCATED FREE STORAGE AREAS ARE RELEASED, 00093000
  94. * THE ADDRESS OF THE INTERFACE BOOTSRAP (DMSVIB) IS RESTORED 00094000
  95. * TO THE CVT CELL AND THE DOS ENVIRONMENT IS SET OFF. 00095000
  96. * 00096000
  97. * 7. RETURNS TO FREE STORAGE LIST OF ACB(S) CREATED BY DMSVIP, 00097000
  98. * IF IT WAS NOT RELEASED BY DMSVIP. 00098000
  99. * 00099000
  100. * 8. RETURNS TO CALLER. 00100000
  101. * 00101000
  102. * RESPONSES - 00102000
  103. * 00103000
  104. * NONE 00104000
  105. * 00105000
  106. * ERROR MESSAGES - 00106000
  107. * 00107000
  108. * NONE 00108000
  109. *. 00109000
  110. EJECT 00110000
  111. DMSVSR CSECT , TRANSIENT (OR MAY BE IN CMS NUC) @V305106 00111000
  112. USING NUCON,R0 @V305106 00112000
  113. USING DMSVSR,R12 @V305106 00113000
  114. LR R12,R15 ADDRESSABILITY IN R11 @V305106 00114000
  115. TM DOSFLAGS,DOSMODE ARE WE IN 'DOS MODE' ? @V305106 00115000
  116. BZ ERROR1 IF NOT, THERE'S NOTHING WE CAN DO@V305106 00116000
  117. SR R2,R2 @V305106 00117000
  118. C R2,AVSRWORK IS THIS A RECURSIVE CALL? @V305106 00118000
  119. BNZ ERROR1 YES, A DEFINITE NO-NO... @V305106 00119000
  120. L R3,ABGCOM REFRENCE BGCOM @V305106 00120000
  121. USING BGCOM,R3 ADDRESS TEMPORARILY @V305106 00121000
  122. C R2,PPEND IS PPEND ZERO ? @V305106 00122000
  123. BE ERROR1 IF ZERO, JUST EXIT WITH R.C. = 1 @V305106 00123000
  124. DROP R3 @V305106 00124000
  125. SPACE 1 00125000
  126. LR R2,R14 HOLD R14 FOR A MINUTE... @V305106 00126000
  127. LA R0,FREESIZ PREPARE TO GET FREE STOR WORKAREA@V305106 00127000
  128. DMSFREE DWORDS=(0),TYPCALL=BALR MAKES ME REENTRANT @V305106 00128000
  129. LR R8,R1 USE R8 FOR STORAGE MAP @V305106 00129000
  130. STCM R8,7,AVSRWORK+1 SAVE THE WORK ADDR IN NUCON @V305106 00130000
  131. XC 0(FREESIZ*8,R8),0(R8) AND CLEAR IT OUT... @V305106 00131000
  132. USING VSRWORK,R8 @V305106 00132000
  133. ST R2,SAVE14 SAVE R14 = RETURN REGISTER @V305106 00133000
  134. SPACE 1 00134000
  135. OI DOSFLAGS,DOSSVC WON'T GET TOO FAR WITHOUT IT.. @V305106 00135000
  136. LA R1,AUTOCLOS PREP TO FETCH VSAM 'AUTOCLOSE' @V305106 00136000
  137. STM R0,R13,REGSAV SAVE OUR IDENTITY @V305106 00137000
  138. SVC SVC2 FETCH $$BACLOS @V305066 00138000
  139. B EXIT AND EXIT UPON RETURN @V305106 00139000
  140. SPACE 1 00140000
  141. $$BEOJ4 DS 0D ACT LIKE DOS EOJ ROUTINE @V305106 00141000
  142. ENTRY $$BEOJ4 @V305106 00142000
  143. DC CL8'$$BEOJ4' @V305106 00143000
  144. L R8,AVSRWORK RESTORE WORK ADDRESSBILITY @V305106 00144000
  145. LM R0,R13,REGSAV RESTORE OUR IDENTITY @V305106 00145000
  146. SPACE 1 00146000
  147. VSR2ND EQU * GET RID OF ANCHOR TABLE @V305106 00147000
  148. SR R15,R15 CLEAR R15, @V305106 00148000
  149. L R2,ABGCOM REFERENCE BGCOM @V305106 00149000
  150. USING BGCOM,R2 ... @V305106 00150000
  151. ST R15,PPEND CLEAR 'PPEND' @V305106 00151000
  152. LH R3,PIB2PTR GET ADDR OF PIB EXT @V305174 00152000
  153. AH R3,PIK GET PIB OF TASK @V305174 00153000
  154. NI ACFLDSP(R3),255-AUTCLFL TURN OFF AUTO CLOSE IN @V305174 00154000
  155. * PROGRESS FLAG IF ON 00155000
  156. DROP R2 THAT'S ALL THERE IS TO IT. @V305106 00156000
  157. SPACE 1 00157000
  158. VSR3RD EQU * CLEAR THE VSAM RESOURCE TABLE @V305106 00158000
  159. SR R1,R1 CLEAR R1 FOR MVCL @V305106 00159000
  160. L R2,ARURTBL ADDRESS OF RESOURCE TABLE @V305106 00160000
  161. LA R3,RURLENG LENGTH IN BYTES @V305106 00161000
  162. MVCL R2,R0 CLEAR ENTIRE TABLE (R0 IMMATL) @V305106 00162000
  163. SPACE 00163000
  164. VSR4TH EQU * PURGE VSAM SHARED SEG(S) - IF ANY@V305106 00164000
  165. TM VSAMFLG1,VSAMRUN IS VSAM RUNNING ? @V305106 00165000
  166. BZ VSR5TH IF NOT, AVOID NEEDLESS CALLS. @V305106 00166000
  167. L R6,ASYSNAMS GET A(SAVED SYS TABLE) @V305106 00167000
  168. USING SYSNAMES,R6 AND MAP IT... @V305106 00168000
  169. LA R1,CMSVSAM POINT TO SAVED VSAM NAME @V305106 00169000
  170. LA R2,PURGESYS R2=8 TO PURGE THE CMSVSAM SYSTEM @V305066 00170000
  171. DC X'83120064' PURGE THE SHARED SYSTEM @V305106 00171000
  172. SR R1,R1 AND @V305106 00172000
  173. ST R1,AVSAMSYS CLEAR VSAMSYS ADDRESS (IN NUCON) @V305106 00173000
  174. NI VSAMFLG1,255-VSAMRUN CLEAR THE VSAM-RUN FLAGBIT @V305106 00174000
  175. L R0,=A(X'FFFFFF') 00FFFFFF INTO R0, @V305106 00175000
  176. SR R1,R1 CLEAR R1, AND RESET @V305106 00176000
  177. STM R0,R1,ADIKQLAB ADIKQLAB/NDIKQLAB=DEFAULT VALUES@V305106 00177000
  178. EJECT 00178000
  179. VSR5TH EQU * DETERMINE WHO CLEANING UP AFTER @V305106 00179000
  180. TM VSAMFLG1,VSAMSERV AMS STILL LOADED? @V305106 00180000
  181. BZ VSR6TH NO, CONTINUE.. @V305106 00181000
  182. L R6,ASYSNAMS POINT TO SAVED SYSTEM TABLE @V305106 00182000
  183. USING SYSNAMES,R6 @V305106 00183000
  184. LA R3,CMSAMS GET NAME OF AMS SYSTEM @V305106 00184000
  185. LA R4,PURGESYS SET THE PURGE CODE @V305066 00185000
  186. DC X'83340064' PURGE SAVED AMS SYSTEM @V305106 00186000
  187. SR R3,R3 AND... @V305106 00187000
  188. ST R3,AAMSSYS CLEAR AMS ADDRESS IN NUCON @V305106 00188000
  189. NI VSAMFLG1,255-VSAMSERV & CLEAR 'AMS ACTIVE' FLAG @V305106 00189000
  190. VSR6TH EQU * @V305106 00190000
  191. ICM R1,15,ACBLIST GET POSSIBLE LIST OF ACB(S) .. @V305106 00191000
  192. BZ VSR7TH IF NOT CREATED BY DMSVIP, BRANCH @V305106 00192000
  193. LR R0,R1 EQUALIZE REGISTERS @V305106 00193000
  194. SRL R0,24 ISOLATE LGTH OF LIST (NO. DWORDS)@V305106 00194000
  195. XC ACBLIST,ACBLIST ZERO OUT LIST ADDRESS @V305106 00195000
  196. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR REL FREED LIST@V305106 00196000
  197. VSR7TH EQU * @V305106 00197000
  198. TM VSAMFLG1,VIPINIT OS VSAM USER (INTERFACE INIT)? @V305106 00198000
  199. BZ SVC11 IF NOT, SKIP ALL OVERHEAD... @V305106 00199000
  200. L R5,AVIPWORK GET ADDR OF INTFC WORK AREA @V305106 00200000
  201. L R6,VIPOVFL(,R5) LOAD POSSIBLE OVERFLOW BLK ADDR @V305106 00201000
  202. LTR R6,R6 ANY? @V305106 00202000
  203. BZ FRETWORK NO, GO RELEASE WORK AREA STORAGE @V305106 00203000
  204. OCHAIN L R7,OVFLNEXT(,R6) LOAD ADDR OF NEXT BLOCK, IF ANY@V305106 00204000
  205. LR R1,R6 PRIME LOC REG FOR DMSFRET @V305106 00205000
  206. LA R0,NINE NINE DOUBLEWORDS OF STORAGE @V305106 00206000
  207. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR REL FREED STOR@V305106 00207000
  208. LTR R7,R7 WAS THIS LAST ON CHAIN? @V305106 00208000
  209. BZ FRETWORK YES @V305106 00209000
  210. LR R6,R7 NO, CONTINUE @V305106 00210000
  211. B OCHAIN RELEASING OVERFLOW BLOCKS @V305106 00211000
  212. FRETWORK LR R1,R5 PRIME LOC REG FOR DMSFRET @V305106 00212000
  213. LA R0,CON37 37 DOUBLEWORDS @V305066 00213000
  214. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR REL DMSVIP WK@V305106 00214000
  215. XC AVIPWORK(4),AVIPWORK ZERO WORK AREA POINTER @V305106 00215000
  216. NI VSAMFLG1,255-VIPINIT ALSO THE VIPINIT FLAGBIT @V305106 00216000
  217. L R3,ADMSVIB ADDR OF INTFC BOOTSTRAP INTO WORK@V305106 00217000
  218. L R4,ACMSCVT ADDRESS SIMULATED CVT @V305106 00218000
  219. USING CMSCVT,R4 @V305106 00219000
  220. ST R3,CVTAVIB RESTORE BOOTSTRAP ADDRESS IN CVT @V305106 00220000
  221. DROP R4 @V305106 00221000
  222. SPACE 1 00222000
  223. DOSOFF NI VSAMFLG1,255-VSAMSOS CLEAR OS AMSERV FLAG @VM03001 00223000
  224. LA R1,DOSLIST POINT TO DMSSET PLIST @V305106 00224000
  225. SVC 202 SET DOS OFF @V305106 00225000
  226. DC AL4(*+4) ... @V305106 00226000
  227. EJECT 00227000
  228. EXIT L R2,SAVE14 FINALLY, RESTORE RETURN-REGISTER @V305106 00228000
  229. LR R1,R8 POINT AT FREE STOR AREA @V305106 00229000
  230. LA R0,FREESIZ AND NO. DWORDS FOR LENGTH @V305106 00230000
  231. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR FREE 'VSRWORK'@V305106 00231000
  232. SR R15,R15 CLEAR RETURN-CODE @V305106 00232000
  233. ST R15,AVSRWORK CLEAR A(WORKAREA) FOR RECUR CK @V305106 00233000
  234. BR R2 AND EXIT. @V305106 00234000
  235. SPACE 00235000
  236. ERROR1 TM VSAMFLG1,VSAMSOS IS IT OS AMSERV USER ? @VM03082 00236000
  237. BZ ERREXIT NO, JUST EXIT @VM03082 00237000
  238. NI VSAMFLG1,255-VSAMSOS CLEAR OS AMSERV FLAG @VM03082 00238000
  239. LA R1,DOSLIST POINT TO DMSSET PLIST @VM03082 00239000
  240. SVC 202 GO SET DOS OFF @VM03082 00240000
  241. DC AL4(*+4) ... @VM03082 00241000
  242. ERREXIT LA R15,ERR1 SET RETURN CODE OF 1 @VM03082 00242000
  243. BR R14 EXIT FORTHWITH (R14 INTACT) @V305106 00243000
  244. SVC11 TM VSAMFLG1,VSAMSOS IS IT OS AMSERV USER ? @VM03001 00244000
  245. BO DOSOFF YES, GO SET DOS OFF THEN... @VM03001 00245000
  246. SVC 11 ELSE RETURN AFTER SVC 2 ABOVE @VM03001 00246000
  247. EJECT 00247000
  248. * PLEASE PLACE ALL FIELDS WHICH ARE MODIFIED HERE... 00248000
  249. * AND LET'S KEEP DMSVSR RE-ENTRANT. INSERT ANYWHERE WITHIN 00249000
  250. * 'VSRWORK' DSECT AFTER 'SAVE14' FIELD. THANK YOU 00250000
  251. SPACE 1 00251000
  252. VSRWORK DSECT @V305106 00252000
  253. DS 0D @V305106 00253000
  254. REGSAV DS 14F DMSVSR REGISTER SAVE AREA @V305106 00254000
  255. SAVE14 DS F @V305106 00255000
  256. DS 0D @V305106 00256000
  257. FREESIZ EQU (*-VSRWORK)/8 @V305106 00257000
  258. SPACE 2 00258000
  259. DMSVSR CSECT @V305106 00259000
  260. DS 0D KEEP ALL STATIC FIELDS HERE. @V305106 00260000
  261. AUTOCLOS DC CL8'$$BACLOS' VSAM AUTOMATIC CLOSE ROUTINE @V305106 00261000
  262. DOSLIST DC CL8'SET' SET DOS OFF FOR OS USERS @V305106 00262000
  263. DC CL8'DOS' @V305106 00263000
  264. DC CL8'OFF' @V305106 00264000
  265. DC 8X'FF' @V305106 00265000
  266. SPACE 00266000
  267. RURLENG EQU 32*4 LENGTH OF VSAM RESOURCE TABLE @V305106 00267000
  268. VIPOVFL EQU 228 @V305106 00268000
  269. OVFLNEXT EQU 64 @V305106 00269000
  270. ACFLDSP EQU 15 DISP OF AUTO CLOSE FLG IN PIB @V305174 00270000
  271. AUTCLFL EQU X'10' AUTO CLOSE IN PROGRESS FLAG @V305174 00271000
  272. SVC2 EQU 2 SVC 2 @V305066 00272000
  273. CON37 EQU 37 @V305066 00273000
  274. PURGESYS EQU 8 PURGESYS CODE @V305066 00274000
  275. NINE EQU 9 NINE @V305066 00275000
  276. ERR1 EQU 1 ERROR CODE 1 @V305066 00276000
  277. ELEVEN EQU 11 SVC 11 @V305066 00277000
  278. LTORG OTHER CONSTANTS @V305106 00278000
  279. EJECT 00279000
  280. NUCON @V305106 00280000
  281. BGCOM @V305106 00281000
  282. EJECT 00282000
  283. CMSCVT @V305106 00283000
  284. SYSNAMES @V305106 00284000
  285. SPACE 00285000
  286. PRINT NOGEN CERTAINLY DON'T NEED EXPANSION OF ... 00286000
  287. REGEQU @V305106 00287000
  288. SPACE 00288000
  289. END 00289000