User Tools

Site Tools


ibm:vm370-lib:cp:dmkvds.assemble_src

DMKVDS Source

References

Source Listing

DMKVDS.ASSEMBLE.txt
  1. VDS TITLE 'DMKVDS (CP) VM/370 - RELEASE 6' 00001000
  2. ISEQ 73,80 VALIDATE SEQUENCING OF SYSIN 00002000
  3. SPACE 00003000
  4. DMKVDS CSECT 00004000
  5. SPACE 00005000
  6. EXTRN DMKTDKGT 00006000
  7. EXTRN DMKSYSCK @VM08883 00007000
  8. EXTRN DMKSCNVU 00008000
  9. EXTRN DMKSCNLI @VA04747 00008010
  10. EXTRN DMKSCNRD,DMKSCNRU @V200820 00009000
  11. EXTRN DMKCVTBH,DMKERMSG @V200820 00010000
  12. EXTRN DMKCVTAB @VA04301 00010100
  13. EXTRN DMKFRERC CALL TO DMFREE WITH RETURN CODE @V3E7466 00010110
  14. EXTRN DMKSPLDL @V60B9BA 00010200
  15. SPACE 00011000
  16. USING PSA,R0 00012000
  17. USING RDEVBLOK,R1 00013000
  18. USING UDEVBLOK,R2 00014000
  19. USING VDEVBLOK,R8 00015000
  20. USING VMBLOK,R11 00016000
  21. USING DMKVDS,R12 00017000
  22. USING SAVEAREA,R13 00018000
  23. SPACE 00019000
  24. *. 00020000
  25. * MODULE NAME - 00021000
  26. * 00022000
  27. * DMKVDS 00023000
  28. * 00024000
  29. * CONTENTS - 00025000
  30. * 00026000
  31. * DMKVDSAT - SUBROUTINE TO ATTACH A VIRTUAL DEVICE 00027000
  32. * DMKVDSDF - SUBROUTINE TO DEFINE A VIRTUAL DEVICE 00028000
  33. * DMKVDSLK - SUBROUTINE TO LINK TO A VIRTUAL DASD DEVICE 00029000
  34. EJECT 00030000
  35. * SUBROUTINE NAME - 00031000
  36. * 00032000
  37. * DMKVDSAT - SUBROUTINE TO ATTACH A VIRTUAL DEVICE 00033000
  38. * 00034000
  39. * FUNCTION - 00035000
  40. * 00036000
  41. * TO PERFORM THE INTERNAL FUNCTIONS NECESSARY TO 00037000
  42. * ATTACH A VIRTUAL DEVICE TO A USER. 00038000
  43. * 00039000
  44. * ATTRIBUTES - 00040000
  45. * 00041000
  46. * REENTRANT, PAGEABLE, CALLED VIA SVC 00042000
  47. * 00043000
  48. * ENTRY POINTS - 00044000
  49. * 00045000
  50. * DMKVDSAT 00046000
  51. * 00047000
  52. * ENTRY CONDITIONS - 00048000
  53. * 00049000
  54. * GPR 1 = ADDRESS OF RDEVBLOK TO BE ATTACHED 00050000
  55. * GPR 2 = ADDRESS OF UDEVBLOK FOR THE VIRT ADDR 00051000
  56. * GPR 11 = ADDRESS OF USER'S VMBLOK 00052000
  57. * GPR 12 = ADDRESS OF DMKVDSAT 00053000
  58. * GPR 13 = ADDRESS OF STANDARD SAVE AREA 00054000
  59. * 00055000
  60. * EXIT CONDITIONS - 00056000
  61. * 00057000
  62. * VIRTUAL DEVICE BLOCK HAS BEEN CREATED (IF NECESSARY) 00058000
  63. * AND INITIALIZED AS NEEDED. 00059000
  64. * 00060000
  65. * CC = 0 IF SUCCESSFUL (AND GPR2 = 0) 00061000
  66. * CC = 1 IF UNSUCCESSFUL - ERROR-CODE RETURNED IN GPR 2 00062000
  67. * 00063000
  68. * GPR 1 = ADDRESS OF REAL DEVICE BLOCK (UNCHANGED) 00064000
  69. * GPR 2 = ERROR-CODE AS FOLLOWS (IF UNSUCCESSFUL): 00065000
  70. * 8 = SPOOL DEVICE NOT DRAINED 00066000
  71. * 12 = REAL DEVICE IS OFFLINE 00067000
  72. * 16 = DEVICE IS IN USE BY SYSTEM 00068000
  73. * 20 = DASD DEVICE IS CP OWNED 00069000
  74. * 24 = REAL DEVICE IS DEDICATED 00070000
  75. * 32 = STORAGE REQUEST NOT SATISFIED. 00070100
  76. * 124 = MAX NO. OF VIRT DEV DEFINED 00070200
  77. * GPR 8 = ADDRESS OF VIRTUAL DEVICE BLOCK 00071000
  78. * 00072000
  79. * CALLS TO OTHER ROUTINES - 00073000
  80. * 00074000
  81. * DMKFRERC - TO OBTAIN VCHBLOK, VCUBLOK AND VDEVBLOK 00075000
  82. * DMKFRET - TO RETURN A VCHBLOK, VCUBLOK, OR VDEVBLOK TO FREE 00076000
  83. * STORAGE (IF A LARGER ONE IS NEEDED) 00077000
  84. * DMKSCNVU - TO FIND THE VCHBLOK, VCUBLOK, AND/OR VDEVBLOK FOR 00078000
  85. * A VIRTUAL DEVICE. 00079000
  86. * DMKSPLDL - TO DELETE THE SPOOL FILES ON THE DELAY PURGE 00079100
  87. * QUEUE OF A 3800 PRINTER TO BE ATTACHED 00079200
  88. * 00080000
  89. * EXTERNAL REFERENCES - 00081000
  90. * 00082000
  91. * NONE 00083000
  92. EJECT 00084000
  93. * TABLES / WORK AREAS - 00085000
  94. * 00086000
  95. * RDEVBLOK 00087000
  96. * UDEVBLOK 00088000
  97. * VCHBLOK 00089000
  98. * VCUBLOK 00090000
  99. * VDEVBLOK 00091000
  100. * 00092000
  101. * REGISTER USAGE - 00093000
  102. * 00094000
  103. * GPR 6 = ADDRESS OF VCHBLOK 00095000
  104. * GPR 7 = ADDRESS OF VCUBLOK 00096000
  105. * GPR 8 = ADDRESS OF VDEVBLOK 00097000
  106. * GPR 9 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDBLOK 00098000
  107. * GPR 10 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDVDEV 00099000
  108. * GPR 11 = ADDRESS OF USER'S VMBLOK 00100000
  109. * GPR 12 = BASE REGISTER 00101000
  110. * GPR 13 = ADDRESS OF STANDARD SAVE AREA 00102000
  111. * 00103000
  112. * GPRS 0-5 AND 14-15 ARE WORK REGISTERS. 00104000
  113. * 00105000
  114. * NOTES - 00106000
  115. * 00107000
  116. * NONE 00108000
  117. * 00109000
  118. * OPERATION - 00110000
  119. * 00111000
  120. * 1. THE REAL DEVICE BLOCK IS CHECKED TO SEE IF THE REAL DEVICE 00112000
  121. * IS OFFLINE, ATTACHED TO THE SYSTEM, OWNED BY CP, OR ALREADY 00113000
  122. * ATTACHED. IF SO, A CONDITION-CODE 1 AND A SPECIFIC ERROR CODE 00114000
  123. * IN GPR 2 ARE RETURNED TO THE CALLER (SEE EXIT CONDITIONS). 00115000
  124. * 00116000
  125. * 2. IF NOT, THEN A VIRTUAL DEVICE BLOCK (AND CONTROL UNIT BLOCK 00117000
  126. * AND/OR CHANNEL BLOCK, IF NECESSARY) IS CREATED AND INITIALIZED 00118000
  127. * (USING INTERNAL SUBROUTINES BLDVDEV & BLDBLOK). 00119000
  128. * 00120000
  129. * 3. FINALLY, DMKVDSAT FLAGS THE REAL DEVICE AS DEDICATED 00121000
  130. * (I.E. ATTACHED), AND FILLS IN OTHER DATA AS NEEDED IN THE 00122000
  131. * VIRTUAL AND REAL DEVICE BLOCKS, AND RETURNS TO THE CALLER. 00123000
  132. * 00124000
  133. * ERROR MESSAGES - 00125000
  134. * 00126000
  135. * DMKVDS465W CTLR XXX EMULATOR LINES IN USE BY SYSTEM 00127000
  136. *. 00128000
  137. EJECT @V4075A0 00128100
  138. COPY OPTIONS @V4075A0 00128200
  139. EJECT @V4075A0 00128300
  140. EJECT 00129000
  141. DC CL8'DMKVDS' MODULE IDENTIFIER. 00130000
  142. SPACE 00131000
  143. DMKVDSAT RELOC , SUBROUTINE TO ATTACH A REAL DEVICE 00132000
  144. SWITCH MAKE SURE WE ARE ON THE IO PROCESSOR @V4075A0 00132100
  145. SPACE 2 00133000
  146. TM RDEVSTAT,RDEVDISA+RDEVDED CHECK REAL DEVICE 00134000
  147. BNZ ATTBUSY BRANCH IF OFFLINE OR ALREADY IN USE 00135000
  148. TM RDEVTYPC,CLASDASD+CLASTAPE DASD OR TAPE ? @V200820 00136000
  149. BNZ ATTDATA YES -- @V200820 00137000
  150. TM RDEVTYPC,CLASURI+CLASURO INPUT OR OUTPUT ? @V200820 00138000
  151. BNZ ATTURIO YES -- SPOOL @V200820 00139000
  152. TM RDEVTYPC,CLASTERM+CLASGRAF TERM OR GRAPHIC ? @V200820 00140000
  153. BNZ ATTRMGR YES -- @V200820 00141000
  154. CLI RDEVTYPC,CLASSPEC CLASS SPECIAL ? @V200820 00142000
  155. BNE ATTBLDV NO -- JUST ATTACH IT @V200820 00143000
  156. SPACE 00144000
  157. ATTSPEC EQU * DEDICATE CLASSPEC @V200820 00145000
  158. CLI RDEVTYPE,TYP3705 IS THIS A 3704 OR 3705 ? @V200820 00146000
  159. BNE ATTBLDV NO -- @V200820 00147000
  160. TM RDEVSTAT,RDEVRSVD LINES IN USE BY THE SYSTEM ?@V200820 00148000
  161. BO ATTSHRD YES -- @V200820 00149000
  162. TM RDEVFLAG,RDEVRCVY IN RECOVERY BY SYSTEM? @VA01656 00150000
  163. BO ATTSHRD YES -- CAN'T ATTACH THEN @VA01656 00151000
  164. TM RDEVFLAG,RDEVLNCP IS THERE AN ACTIVE NICLIST ?@V200820 00152000
  165. BZ ATTSPEP NO -- CHECK EMULATOR LINES @V200820 00153000
  166. LH R3,RDEVMAX MAXIMUM RESOURCE I.D. @V200820 00154000
  167. LA R3,1(0,R3) PLUS ONE FOR NO. OF NICBLOKS @V200820 00155000
  168. MH R3,=AL2(NICSIZE) GR3 = NICLIST SIZE IN DBL-WD@V200820 00156000
  169. LR R0,R3 . . . @VM08559 00157000
  170. L R1,RDEVNICL START OF THE NICLIST @V200820 00158000
  171. CALL DMKFRET RETURN IT TO FREE STORAGE @V200820 00159000
  172. L R1,SAVER1 RECOVER RDEVBLOK ADDRESS @V200820 00160000
  173. SLR R3,R3 @V200820 00161000
  174. ST R3,RDEVNICL NO MORE ACTIVE NICLIST @V200820 00162000
  175. NI RDEVFLAG,255-RDEVLNCP NO MORE NCP @V200820 00163000
  176. STH R3,RDEVMAX CLEAR RESOURCE I.D. COUNT @V200820 00164000
  177. ATTSPEP EQU * @V200820 00165000
  178. TM RDEVFLAG,RDEVEPLN EP-LINES IN USE BY SYSTEM ? @V200820 00166000
  179. BZ ATTBLDV NO -- O.K. TO ATTACH @V200820 00167000
  180. LR R8,R1 RDEVBLOK TO GR8 @V200820 00168000
  181. CALL DMKSCNRD GET DEVICE ADDRESS IN GR1 @V200820 00169000
  182. CALL DMKCVTBH CONVERT @V200820 00170000
  183. ICM R1,8,BLANKS PUT A BLANK HIGH-ORDER @V200820 00171000
  184. L R0,MSGHEAD MODULE ID, LENGTH @V200820 00172000
  185. L R2,MSGPARM FLAGS, MSG NUMBER @V200820 00173000
  186. CALL DMKERMSG,AFFINITY @V4075A0 00174100
  187. LM R1,R2,SAVER1 RESTORE RDEVBLOK, UDEVBLOK PTRS @V200820 00175000
  188. B ATTBLDV GO ATTACH THE 370X @V200820 00176000
  189. SPACE 00177000
  190. ATTRMGR EQU * DEDICATE CLASTERM OR CLASGRAF @V200820 00178000
  191. TM RDEVFLAG,RDEVENAB IN USE BY THE SYSTEM ? @V200820 00179000
  192. BO ATTSHRD YES -- @V200820 00180000
  193. CLI RDEVTYPC,CLASGRAF GRAF DEVICE? @VA09765 00180100
  194. BNE ATTBLDV NO, CONTINUE @VA09765 00180150
  195. CLC RDEVNAME,TST3138 3138? @VA09765 00180200
  196. BE GRAFCONS YES, BRANCH @VA09765 00180250
  197. CLC RDEVNAME,TST3148 3148? @VA09765 00180300
  198. BE GRAFCONS YES, BRANCH @VA09765 00180350
  199. CLC RDEVNAME,TST3158 3158? @VA09765 00180400
  200. BE GRAFCONS YES, BRANCH @VA09765 00180450
  201. CLC RDEVNAME,TST3036 3036? @VA09765 00180500
  202. BE GRAFCONS YES, BRANCH @VA09765 00180550
  203. CLC RDEVNAME,TST3066 3066? @VA09765 00180600
  204. BNE ATTBLDV NO, BRANCH @VA09765 00180650
  205. GRAFCONS DS 0H @VA09765 00180700
  206. OI UDEVSTAT,UDEV3158 SET INDICATOR @VA09765 00180750
  207. B ATTBLDV GO ATTACH THE DEVICE @V200820 00181000
  208. SPACE 00182000
  209. ATTURIO EQU * DEDICATE CLASURI OR CLASURO @V200820 00183000
  210. TM RDEVFLAG,RDEVDRAN IS THE DEVICE DRAINED ? @V200820 00184000
  211. BZ ATTDRAN NO -- @V200820 00185000
  212. ICM R15,15,RDEVSPL CHECK FOR ACTIVE SFBLOK @V200820 00186000
  213. BNZ ATTDRAN YES - CANNOT ATTACH @V200820 00187000
  214. CLI RDEVTYPE,TYP3800 IS IS A 3800 PRINTER ? @V60B9BA 00187010
  215. BNE ATTBLDV GO ATTACH IF NOT 3800 @V60B9BA 00187020
  216. SPACE 1 00187030
  217. * THE DELAY PURGE QUEUE MUST BE PURGED FOR A 3800 PRINTER @V60B9BA 00187040
  218. * BEFORE ATTACHING IT TO THE USER @V60B9BA 00187050
  219. SPACE 1 00187060
  220. LR R10,R7 SAVE R7 FOR NOW @V60B9BA 00187070
  221. NOCALL4 L R7,RDEVDELP GET THE DELAYED PURGE ANCHOR @V60B9BA 00187080
  222. LTR R7,R7 ANYTHING THERE ? @V60B9BA 00187090
  223. BZ NOCALL5 XFER IF NOTHING THERE @V60B9BA 00187100
  224. MVC RDEVDELP,0(R7) NEXT ONE IS NOW FIRST @V60B9BA 00187110
  225. CALL DMKSPLDL GO AND DELETE IT @V60B9BA 00187120
  226. B NOCALL4 DO FOR NEXT ONE ALSO @V60B9BA 00187130
  227. NOCALL5 LR R7,R10 RESTORE R7 @V60B9BA 00187140
  228. B ATTBLDV ATTACH THE DEVICE @V200820 00188000
  229. SPACE 00189000
  230. ATTDATA EQU * DEDICATE CLASDASD OR CLASTAPE @V200820 00190000
  231. TM RDEVFLAG,RDEVSYS+RDEVOWN IN USE BY SYSTEM ? @V200820 00191000
  232. BNZ ATTBUSY YES -- @V200820 00192000
  233. LA R4,8(0,0) LOOP COUNTER IF 2305 DEVICE @V200820 00193000
  234. SPACE 00194000
  235. ATTBLDV EQU * BUILD VDEVBLOK, DEDICATE DEVICE @V200820 00195000
  236. BAL R10,BLDVDEV @V200820 00196000
  237. USING VCHBLOK,R6 @VA01041 00197000
  238. USING VCUBLOK,R7 @VA01041 00198000
  239. OI RDEVSTAT,RDEVDED FLAG REAL DEVICE AS DEDICATED 00199000
  240. NI RDEVFLAG,X'FF'-RDEVMOUT INDICATE MOUNTED AND ATTACHED 00200000
  241. ST R11,RDEVUSER STORE ATTACHED USER'S VMBLOK ADDRESS 00201000
  242. LH R0,UDEVADD STORE ATTACHED VIRTUAL ADDRESS 00202000
  243. STH R0,RDEVATT .. 00203000
  244. L R15,=A(DMKSYSCK) @VM08883 00204000
  245. STCK 0(R15) OBTAIN ATTACH TIME @VM08883 00205000
  246. BC 3,DOWNWEGO CLOCK NOT FUNCTIONING @VA04301 00205100
  247. MVC RDEVTMAT,0(R15) AND SAVE IT. @VM08883 00206000
  248. OI VDEVSTAT,VDEVDED FLAG VIRTUAL DEVICE AS DEDICATED 00207000
  249. LH R0,RDEVTYPC MAKE VIRTUAL DEVICE TYPE SAME AS REAL 00208000
  250. STH R0,VDEVTYPC .. 00209000
  251. CH R0,=AL1(CLASSPEC,TYPCTCA) IS THIS A CTCA ? 00210000
  252. BNE ATTNCTC NO -- O.K. AS IS 00211000
  253. MVI VCUTYPE,VCUCTCA CONTROL UNIT IS CHAN-TO-CHAN@VA01041 00212000
  254. MVI VCHTYPE,VCHSEL FORCE CHANNEL TYPE TO SELECTOR @VA05197 00212500
  255. ATTNCTC EQU * 00213000
  256. ST R1,VDEVREAL STORE ATTACHED RDEVBLOK ADDRESS 00214000
  257. BAL R9,CHEKRSRL CHECK WHETHER RESERVE/RELEASE VALID CCW 00215000
  258. CLI RDEVTYPC,CLASDASD DASD DEVICE ? @V200820 00216000
  259. BNE ATTEXIT NO -- ALL DONE @V200820 00217000
  260. CLI RDEVTYPE,TYP2305 MULTIPLE-EXPOSURE DRUM ? @V200820 00218000
  261. BNE ATTCHKRD NO -- TEST FOR READ/ONLY @V200820 00219000
  262. TM UDEVMODE,X'18' SEPARATE R/O CHECK @VA02888 00220000
  263. BNZ *+8 NOT READ/ONLY ATTACH @V200820 00221000
  264. OI VDEVFLAG,VDEVRDO MAKE VIRTUAL DEVICE R/O @V200820 00222000
  265. MVI VCUTYPE,X'00' CONTROL UNIT IS NOT SHARED @VA01041 00223000
  266. LR R8,R1 RDEVBLOK TO GR8 @V200820 00224000
  267. CALL DMKSCNRD GET REAL DEVICE ADDR IN CCU FORM @VA04098 00225000
  268. LA R1,1(0,R1) NEXT EXPOSURE @V200820 00226000
  269. CALL DMKSCNRU LOCATE THE NEXT RDEVBLOK @V200820 00227000
  270. LR R1,R8 . . .IN GR1 @V200820 00228000
  271. L R2,SAVER2 RECOVER THE UDEVBLOK @V200820 00229000
  272. LH R3,UDEVADD VIRTUAL DEVICE ADDRESS @V200820 00230000
  273. LA R3,1(0,R3) INCREMENT @V200820 00231000
  274. STH R3,UDEVADD . . . @V200820 00232000
  275. BCT R4,ATTBLDV BUILD EIGHT VDEVBLOK'S @V200820 00233000
  276. LH R3,UDEVADD @V200820 00234000
  277. S R3,F8 RESTORE ORIGINAL ADDRESS @V200820 00235000
  278. STH R3,UDEVADD . . . @V200820 00236000
  279. LH R1,UDEVADD GET ITS ADDRESS PLEASE @VA04098 00237000
  280. CALL DMKSCNVU REOBTAIN VDEVBLOK (MAY HAVE MOVED@VA04098 00238000
  281. B ATTEXIT ALL DONE @V200820 00239000
  282. SPACE 00240000
  283. ATTCHKRD TM UDEVMODE,X'18' IS THIS TO BE A R/O LINK/ATTACH? @VA02888 00241000
  284. BNZ ATTEXIT IF NOT, GO EXIT. 00242000
  285. OI VDEVFLAG,VDEVRDO YES, FLAG VIRTUAL DEVICE AS READ-ONLY 00243000
  286. ATTEXIT ST R8,SAVER8 RETURN VDEVBLOK ADDRESS 00244000
  287. TM VCHTYPE,VCHSEL SELECTOR CHANNEL? @VA03072 00245000
  288. BNZ ATTCOMP NO -- ALL SET AS IS @VA01041 00246000
  289. CLI VDEVTYPC,CLASTAPE SHARED TYPE? @VA02808 00247000
  290. BE SETSHRD SET SHARED SUB-CHAN CTL UNIT @VA02808 00248000
  291. CLI VDEVTYPC,CLASGRAF GRAF CLASS? @VA02808 00249000
  292. BNE ATTCOMP NON-SHARED CTL UNIT @VA02808 00250000
  293. TM VDEVTYPE,TYP3277+TYP3278 3270? @V60A6B6 00251000
  294. BZ ATTCOMP NO--NON SHARED @V60A6B6 00252000
  295. TM UDEVSTAT,UDEV3158 IS IT A 3158? @VA02100 00253000
  296. BO ATTCOMP YES, NOT SHARED @VA02100 00254000
  297. SETSHRD OI VCUTYPE,VCUSHRD SHARED SUB-CHANNEL CTL UNIT @VA02808 00255000
  298. ATTCOMP EQU * SET RETURN CODE AND EXIT @VA01041 00256000
  299. SR R0,R0 SET CC = 0 00257000
  300. ST R0,SAVER2 PASS BACK ZERO RETURN CODE 00258000
  301. VDSEXIT EXIT RETURN TO CALLER 00259000
  302. SPACE 2 00260000
  303. DROP R1,R6,R7 @VA01041 00261000
  304. EJECT 00262000
  305. *. 00263000
  306. * SUBROUTINE NAME - 00264000
  307. * 00265000
  308. * DMKVDSDF - SUBROUTINE TO DEFINE A VIRTUAL DEVICE 00266000
  309. * 00267000
  310. * FUNCTION - 00268000
  311. * 00269000
  312. * TO PERFORM THE INTERNAL FUNCTIONS NECESSARY TO 00270000
  313. * DEFINE A NEW VIRTUAL DEVICE FOR A USER. 00271000
  314. * 00272000
  315. * ATTRIBUTES - 00273000
  316. * 00274000
  317. * REENTRANT, PAGEABLE, CALLED VIA SVC 00275000
  318. * 00276000
  319. * ENTRY POINTS - 00277000
  320. * 00278000
  321. * DMKVDSDF 00279000
  322. * 00280000
  323. * ENTRY CONDITIONS - 00281000
  324. * 00282000
  325. * GPR 2 = ADDRESS OF USER DEVICE BLOCK 00283000
  326. * GPR 11 = ADDRESS OF USER'S VMBLOK 00284000
  327. * GPR 12 = ADDRESS OF DMKVDSDF 00285000
  328. * GPR 13 = ADDRESS OF STANDARD SAVE AREA 00286000
  329. * 00287000
  330. * EXIT CONDITIONS - 00288000
  331. * 00289000
  332. * VIRTUAL DEVICE BLOCK HAS BEEN CREATED (IF NECESSARY) 00290000
  333. * AND INITIALIZED AS NEEDED. 00291000
  334. * 00292000
  335. * CC = 0 IF SUCCESSFUL (AND GPR2 = 0) 00293000
  336. * CC = 1 IF UNSUCCESSFUL - ERROR-CODE RETURNED IN GPR 2 00294000
  337. * 00295000
  338. * GPR 2 = ERROR-CODE AS FOLLOWS (IF UNSUCCESSFUL): 00296000
  339. * 28 = SPACE NOT AVAILABLE 00297000
  340. * GPR 8 = ADDRESS OF VIRTUAL DEVICE BLOCK 00298000
  341. * 00299000
  342. * CALLS TO OTHER ROUTINES - 00300000
  343. * 00301000
  344. * DMKFREE - TO OBTAIN A VCHBLOK, VCUBLOK, VDEVBLOK OR VSPXBLOK 00302000
  345. * DMKFRET - TO RETURN A VCHBLOK, VCUBLOK, OR VDEVBLOK TO FREE 00303000
  346. * STORAGE (IF A LARGER ONE IS NEEDED) 00304000
  347. * DMKTDKGT - TO OBTAIN T-DISK SPACE 00305000
  348. * DMKSCNVU - TO FIND THE VCHBLOK, VCUBLOK, AND/OR VDEVBLOK FOR 00306000
  349. * A VIRTUAL DEVICE. 00307000
  350. * 00308000
  351. * EXTERNAL REFERENCES - 00309000
  352. * 00310000
  353. * NONE 00311000
  354. EJECT 00312000
  355. * TABLES / WORK AREAS - 00313000
  356. * 00314000
  357. * UDEVBLOK 00315000
  358. * VCHBLOK 00316000
  359. * VCUBLOK 00317000
  360. * VDEVBLOK 00318000
  361. * VSPXBLOK 00318100
  362. * 00319000
  363. * REGISTER USAGE - 00320000
  364. * 00321000
  365. * GPR 6 = ADDRESS OF VCHBLOK 00322000
  366. * GPR 7 = ADDRESS OF VCUBLOK 00323000
  367. * GPR 8 = ADDRESS OF VDEVBLOK 00324000
  368. * GPR 9 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDBLOK 00325000
  369. * GPR 10 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDVDEV 00326000
  370. * GPR 11 = ADDRESS OF USER'S VMBLOK 00327000
  371. * GPR 12 = BASE REGISTER 00328000
  372. * GPR 13 = ADDRESS OF STANDARD SAVE AREA 00329000
  373. * 00330000
  374. * GPRS 0-5 AND 14-15 ARE WORK REGISTERS. 00331000
  375. * 00332000
  376. * NOTES - 00333000
  377. * 00334000
  378. * NONE 00335000
  379. * 00336000
  380. * OPERATION - 00337000
  381. * 00338000
  382. * 1. A VIRTUAL DEVICE BLOCK (AND CONTROL UNIT BLOCK AND/OR 00339000
  383. * CHANNEL BLOCK, IF NECESSARY) IS CREATED AND INITIALIZED 00340000
  384. * (USING INTERNAL SUBROUTINES BLDVDEV & BLDBLOK). 00341000
  385. * 00342000
  386. * 2. THE DEVICE CLASS AND TYPE (PROVIDED BY THE CALLER) ARE 00343000
  387. * STORED IN THE VIRTUAL DEVICE BLOCK, AND APPROPRIATE STEPS 00344000
  388. * ARE TAKEN TO INITIALIZE THE VIRTUAL DEVICE BLOCK, AS NEEDED, 00345000
  389. * FOR A TERMINAL, UNIT RECORD, OR T-DISK TYPE OF DEVICE. 00346000
  390. * IN ADDITION, FOR A UNIT RECORD OUTPUT DEVICE, THE 00346100
  391. * SMALL SIZED VSPXBLOK WITHOUT ROOM FOR THE TAG FIELD 00346200
  392. * IS GOTTEN VIA DMKFREE AND THEN INITIALIZED. 00346300
  393. * 00347000
  394. * 3. WHEN ALL APPROPRIATE DATA HAS BEEN FILLED IN THE VIRTUAL 00348000
  395. * DEVICE BLOCK, RETURN IS MADE TO THE CALLER. 00349000
  396. *. 00350000
  397. EJECT 00351000
  398. DMKVDSDF RELOC SUBROUTINE TO DEFINE A VIRTUAL DEVICE 00352000
  399. TM UDEVSTAT,UDEVTDSK DEFINING A T-DISK ? 00353000
  400. BO DEFTDSK YES - SPECIAL HANDLING 00354000
  401. BAL R10,BLDVDEV BUILD A VIRTUAL DEVICE BLOCK 00355000
  402. LA R10,ATTEXIT SET R10 = A(ATTEXIT) FOR 'BR' & 'BCR' USE 00356000
  403. LH R0,UDEVTYPC SET DEVICE CLASS AND TYPE 00357000
  404. STH R0,VDEVTYPC .. 00358000
  405. CLI VDEVTYPE,TYP1052 IS THIS A PRIMARY CONSOLE DEVICE ? 00359000
  406. BE DEFTERM YES -- NEEDS VCONCTL 00360000
  407. TM VDEVTYPC,CLASURI+CLASURO IS THIS A SPOOLED DEVICE ? 00361000
  408. BNZ DEFSPOOL BRANCH IF YES 00362000
  409. TM VDEVTYPC,CLASSPEC+CLASGRAF GRAF OR CTCA? @VA09186 00362100
  410. BZR R10 NO-LEAVE IT @VA09186 00362200
  411. OI VDEVSTAT,VDEVNRDY TURN ON NOT READY @VA09186 00362300
  412. CLC VDEVTYPC(2),=AL1(CLASSPEC,TYPCTCA) IS IT CTCA? @VA12155 00363500
  413. BCR 7,R10 'BNE ATTEXIT' NO - LEAVE IT ALONE 00364000
  414. MVI VCUTYPE-VCUBLOK(R7),VCUCTCA MARK CTL UNIT ALSO 00366000
  415. CLI VCHADD-VCHBLOK(R6),X'00' IS THIS CHANNEL ZERO ? @VA01771 00367000
  416. BER R10 YES - EXIT. @VA01771 00368000
  417. MVI VCHTYPE-VCHBLOK(R6),VCHSEL MAKE CTCA CHANNEL @VA01771 00369000
  418. * SELECTOR. 00370000
  419. BR R10 ...AND EXIT 00371000
  420. SPACE 00372000
  421. DEFTERM EQU * DEFINE PRIMARY VIRTUAL MACHINE CONSOLE 00373000
  422. LA R0,VCONSIZE YES, LOAD BLOCK SIZE 00374000
  423. CALL DMKFREE GET A VIRTUAL CONSOLE CONTROL BLOCK 00375000
  424. ST R1,VDEVCON STORE ADDRESS IN VDEVBLOK 00376000
  425. XC 0(VCONSIZE*8,R1),0(R1) CLEAR VCONCTL BLOK TO 0 00377000
  426. LR R1,R8 VDEVBLOK ADDRESS TO GR1 @V200820 00378000
  427. SL R1,VMDVSTRT COMPUTE DISPLACEMENT REFERENCE @V200820 00379000
  428. STH R1,VMVTERM ...SET IT IN VMBLOK FOR OTHERS @V200820 00380000
  429. DEFSPOOL IC R0,UDEVCLAS SET SPOOLED CLASS 00383000
  430. STC R0,VDEVCLAS .. 00384000
  431. MVI VDEVCOPY+1,X'01' DEFAULT TO ONE COPY @V200930 00385000
  432. TM VDEVTYPC,CLASURI IS IT UNIT RECORD INPUT ?? @V200930 00386000
  433. BO DEFSPLIN YES, CONT @V200930 00387000
  434. TM UDEVSTAT,UDEVRDEF IS DEVICE RE-DEFINED? @VA12263 00387030
  435. BO NOVSPXBK YES.. DON'T REALLOCATE @VA12263 00387060
  436. LA R0,VSPXSIZ1 GET BASIC VSPXBLOK FOR URO DEVS @VA09273 00387100
  437. CALL DMKFREE GO AND GET IT @V60B9BA 00387200
  438. ST R1,VDEVEXTN POINT TO IT FROM VDEVBLOK @V60B9BA 00387300
  439. USING VSPXBLOK,R1 ADDRESSIBILITY @V60B9BA 00387400
  440. XC VSPXBLOK(VSPXSIZ1*8),VSPXBLOK CLEAR THE BLOCK @VA09273 00387500
  441. MVC VSPXDIST,VMDIST DEFAULT DISTRIBUTION @V60B9BA 00387600
  442. MVI VSPXLEN,VSPXSIZ1 MOVE IN ITS SIZE @VA09273 00387700
  443. DROP R1 NO LONGER NEEDED @V60B9BA 00387800
  444. NOVSPXBK EQU * @VA12263 00387900
  445. CLI VDEVTYPE,TYP3210 CONSOLE DEVICE ? 00388000
  446. BCR 7,R10 BNE ATTEXIT - NO 00389000
  447. L R14,VMTERM ACCESS TERMINAL RDEVBLOK @VA10103 00389100
  448. USING RDEVBLOK,R14 @VA10103 00389200
  449. OI VDEVSFLG,VDEVTERM INDICATE TERM COPY FOR SPOOLED CONS 00390000
  450. CLI VDEVCLAS,0 CLASS PRESENT ? 00391000
  451. BNE *+8 YES - 00392000
  452. MVI VDEVCLAS,C'T' MOVE IN DEFAULT CLASS T 00393000
  453. LTR R14,R14 RDEVBLOK PRESENT ? 00394000
  454. BZR R10 NO, EXIT. (TO ATTEXIT) @VA03322 00395000
  455. CLI RDEVTYPC,CLASGRAF IS THIS A LOCAL 3270? @VA03322 00396000
  456. BE DEFOPR YES. @VA03322 00397000
  457. CLC RDEVTYPC(2),=AL1(CLASTERM,TYPBSC) REMOTE 3270? @VA03322 00398000
  458. BNER R10 NO, EXIT. (TO ATTEXIT) @VA03322 00399000
  459. DEFOPR EQU * @VA03322 00400000
  460. TM VMOSTAT,VMSYSOP IS THIS THE SYSTEM OPERATOR ?? @V200730 00401000
  461. BCR 8,R10 NO, ATTEXIT @V200730 00402000
  462. OI VDEVFLAG,VDEVCSPL INDICATE CONSOLE SPOOL ACTIVE 00403000
  463. DROP R14 00404000
  464. BR R10 "B ATTEXIT". 00405000
  465. SPACE 00406000
  466. DEFSPLIN DS 0H 'DEFINE' SPOOLED INPUT: 00407000
  467. OI VDEVSFLG,VDEVEOF INDICATE EOF VIA UNIT EXCEPTION 00408000
  468. BR R10 AND "B ATTEXIT". 00409000
  469. SPACE 2 00410000
  470. DEFTDSK EQU * DEFINE TEMPORARY DASD DEVICE 00411000
  471. LH R0,UDEVNCYL NUMBER OF CYLINDERS REQUIRED 00412000
  472. SLR R1,R1 ... 00413000
  473. IC R1,UDEVTYPE DEVICE TYPE REQUESTED 00414000
  474. CALL DMKTDKGT GET SOME DASD SPACE 00415000
  475. LTR R8,R8 WAS IT SUCCESSFUL ? 00416000
  476. BZ ATTNSPC NO - EXIT WITH ERROR 00417000
  477. ST R8,SAVEWRK6 SAVE REAL DEVICE BLOCK ADDRESS 00418000
  478. ST R1,SAVEWRK7 ...AND START CYLINDER NUMBER 00419000
  479. BAL R10,BLDVDEV BUILD A VIRTUAL DEVICE BLOCK 00420000
  480. LH R0,UDEVTYPC DEVTYPC, DEVTYPE 00421000
  481. STH R0,VDEVTYPC ... 00422000
  482. LM R0,R1,SAVEWRK6 RDEVBLOK, CYL.NO. 00423000
  483. STH R1,VDEVRELN RELOCATION FACTOR 00424000
  484. ST R0,VDEVREAL RDEVBLOK POINTER 00425000
  485. LR R1,R0 VDEVREAL INTO R1, AND 00426000
  486. BAL R9,CHEKRSRL CHECK WHETHER RESERVE/RELEASE VALID CCW 00427000
  487. LH R0,UDEVNCYL NUMBER OF CYLINDERS 00428000
  488. STH R0,VDEVBND ... 00429000
  489. L R15,=A(DMKSYSCK) @VM08883 00430000
  490. STCK 0(R15) GET CURRENT TOD VALUE @VM08883 00431000
  491. BC 12,CLOCKOK IS CLOCK FUNCTIONING? @VA04301 00431250
  492. DOWNWEGO GOTO DMKCVTAB CLOCK DAMAGED...ABEND CVT001 @VA04301 00431500
  493. CLOCKOK EQU * @VA04301 00431750
  494. MVC VDEVTMAT,0(R15) SAVE WORD ZERO @VM08883 00432000
  495. OI VDEVFLAG,VDEVTDSK THIS IS A T-DISK 00433000
  496. B ATTEXIT ... 00434000
  497. SPACE 2 00435000
  498. USING RDEVBLOK,R1 (RESTORE FOR USE BY NEXT SUBROUTINE) 00436000
  499. EJECT 00437000
  500. *. 00438000
  501. * SUBROUTINE NAME - 00439000
  502. * 00440000
  503. * DMKVDSLK - SUBROUTINE TO LINK TO A VIRTUAL DASD DEVICE 00441000
  504. * 00442000
  505. * FUNCTION - 00443000
  506. * 00444000
  507. * TO PERFORM THE INTERNAL FUNCTIONS NECESSARY TO 00445000
  508. * LINK A VIRTUAL DEVICE TO A USER. 00446000
  509. * 00447000
  510. * ATTRIBUTES - 00448000
  511. * 00449000
  512. * REENTRANT, PAGEABLE, CALLED VIA SVC 00450000
  513. * 00451000
  514. * ENTRY POINTS - 00452000
  515. * 00453000
  516. * DMKVDSLK 00454000
  517. * 00455000
  518. * ENTRY CONDITIONS - 00456000
  519. * 00457000
  520. * GPR 1 = ADDRESS OF REAL DEVICE BLOCK 00458000
  521. * GPR 2 = ADDRESS OF USER DEVICE BLOCK 00459000
  522. * GPR 3 = ADDRESS OF VDEVBLOK FOR ANY EXISTING LINK (OR 0) 00460000
  523. * GPR 11 = ADDRESS OF USER'S VMBLOK 00461000
  524. * GPR 12 = ADDRESS OF DMKVDSLK 00462000
  525. * GPR 13 = ADDRESS OF STANDARD SAVE AREA 00463000
  526. * 00464000
  527. * EXIT CONDITIONS - 00465000
  528. * 00466000
  529. * VIRTUAL DEVICE BLOCK HAS BEEN CREATED (IF NECESSARY) 00467000
  530. * AND INITIALIZED AS NEEDED. 00468000
  531. * 00469000
  532. * CC = 0 IF SUCCESSFUL (AND GPR2 = 0) 00470000
  533. * CC = 1 IF UNSUCCESSFUL - ERROR-CODE RETURNED IN GPR 2 00471000
  534. * 00472000
  535. * GPR 1 = ADDRESS OF REAL DEVICE BLOCK (UNCHANGED) 00473000
  536. * GPR 2 = ERROR-CODE AS FOLLOWS (IF UNSUCCESSFUL): 00474000
  537. * 12 = DEVICE IS OFFLINE 00475000
  538. * 20 = DEVICE OWNED BY CP 00476000
  539. * 24 = ALREADY ATTACHED 00477000
  540. * GPR 8 = ADDRESS OF VIRTUAL DEVICE BLOCK 00478000
  541. * 00479000
  542. * CALLS TO OTHER ROUTINES - 00480000
  543. * 00481000
  544. * DMKFREE - TO OBTAIN A VCHBLOK, VCUBLOK, OR VDEVBLOK 00482000
  545. * DMKFRET - TO RETURN A VCHBLOK, VCUBLOK, OR VDEVBLOK TO FREE 00483000
  546. * STORAGE (IF A LARGER ONE IS NEEDED) 00484000
  547. * DMKSCNVU - TO FIND THE VCHBLOK, VCUBLOK, AND/OR VDEVBLOK FOR 00485000
  548. * A VIRTUAL DEVICE. 00486000
  549. * 00487000
  550. * EXTERNAL REFERENCES - 00488000
  551. * 00489000
  552. * NONE 00490000
  553. EJECT 00491000
  554. * TABLES / WORK AREAS - 00492000
  555. * 00493000
  556. * RDEVBLOK 00494000
  557. * UDEVBLOK 00495000
  558. * VCHBLOK 00496000
  559. * VCUBLOK 00497000
  560. * VDEVBLOK 00498000
  561. * 00499000
  562. * REGISTER USAGE - 00500000
  563. * 00501000
  564. * GPR 6 = ADDRESS OF VCHBLOK 00502000
  565. * GPR 7 = ADDRESS OF VCUBLOK 00503000
  566. * GPR 8 = ADDRESS OF VDEVBLOK 00504000
  567. * GPR 9 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDBLOK 00505000
  568. * GPR 10 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDVDEV 00506000
  569. * GPR 11 = ADDRESS OF USER'S VMBLOK 00507000
  570. * GPR 12 = BASE REGISTER 00508000
  571. * GPR 13 = ADDRESS OF STANDARD SAVE AREA 00509000
  572. * 00510000
  573. * GPRS 0-5 AND 14-15 ARE WORK REGISTERS. 00511000
  574. * 00512000
  575. * NOTES - 00513000
  576. * 00514000
  577. * NONE 00515000
  578. * 00516000
  579. * OPERATION - 00517000
  580. * 00518000
  581. * 1. THE REAL DEVICE BLOCK IS CHECKED TO SEE IF THE REAL DEVICE 00519000
  582. * IS OFFLINE, OWNED BY CP, OR ALREADY ATTACHED TO THE USER. 00520000
  583. * IF SO, A CONDITION-CODE 1 AND A SPECIFIC ERROR CODE IN GPR 2 00521000
  584. * ARE RETURNED TO THE CALLER (SEE EXIT CONDITIONS). 00522000
  585. * 00523000
  586. * 2. IF NOT, THEN A VIRTUAL DEVICE BLOCK (AND CONTROL UNIT BLOCK 00524000
  587. * AND/OR CHANNEL BLOCK, IF NECESSARY) IS CREATED AND INITIALIZED 00525000
  588. * (USING INTERNAL SUBROUTINES BLDVDEV & BLDBLOK). 00526000
  589. * 00527000
  590. * 3. FINALLY, DMKVDSLK INCREMENTS THE COUNT OF LINKS IN THE 00528000
  591. * REAL DEVICE BLOCK, REVISES THE CHAIN OF LINKS FOR THE 00529000
  592. * ADDED LINK, AND FILLS IN OTHER DATA AS NEEDED IN THE VIRTUAL 00530000
  593. * AND REAL DEVICE BLOCKS, AND RETURNS TO THE CALLER. 00531000
  594. *. 00532000
  595. EJECT 00533000
  596. DMKVDSLK RELOC SUBROUTINE TO LINK TO A VIRTUAL DASD DEVICE 00534000
  597. SWITCH MAKE SURE WE ARE ON THE IO PROCESSOR @V4075A0 00534100
  598. TM RDEVSTAT,RDEVDISA+RDEVDED CHECK REAL DEVICE 00535000
  599. BNZ ATTBUSY BRANCH IF OFFLINE OR ALREADY IN USE 00536000
  600. CALL DMKSCNLI @VA04747 00536050
  601. LR R3,R2 @VA04747 00536100
  602. LM R1,R2,SAVER1 @VA04747 00536150
  603. ST R3,SAVEWRK9 REMEMBER R3 AT INPUT TO VDSLK 00537000
  604. BAL R10,BLDVDEV BUILD A VIRTUAL DEVICE BLOCK 00538000
  605. LH R4,RDEVLNKS ADD 1 TO COUNT OF LINKS TO THIS VOLUME 00539000
  606. LA R4,1(,R4) .. 00540000
  607. STH R4,RDEVLNKS .. 00541000
  608. LH R0,UDEVTYPC SET VIRTUAL DEVICE CLASS AND TYPE 00543000
  609. STH R0,VDEVTYPC .. 00544000
  610. LH R0,UDEVRELN SET RELOCATION FACTOR 00545000
  611. STH R0,VDEVRELN .. 00546000
  612. LH R0,UDEVNCYL ALSO NUMBER OF CYLINDERS 00547000
  613. STH R0,VDEVBND ... 00548000
  614. ST R1,VDEVREAL STORE POINTER TO RDEVBLOK 00549000
  615. TM UDEVSTAT,UDEVVRR VIRTUAL RESERVE/RELEASE? @V3E7466 00550000
  616. BZ RRFEAT NO, SEE IF R/R HARDWARE FEATURE @V3E7466 00550100
  617. OI VDEVFLG2,VDEVRRF VIRTUAL RESERVE/RELEASE @V3E7466 00550200
  618. RRFEAT BAL R9,CHEKRSRL SE IF RESERVE/RELEASE VALID CCWS @V3E7466 00550300
  619. CLI UDEVTYPE,TYP2311 IS THIS A REAL OR FAKE 2311 ? 00551000
  620. BNE LNK02 NOPE - SOME OTHER DASD DEVICE. 00552000
  621. OC VDEVFLAG(1),UDEVFTR YES, SET POSSIBLE VDEV231T/B FLAGBIT 00553000
  622. LNK02 LR R4,R8 SAVE VDEVBLOK ADDRESS 00554000
  623. L R3,SAVEWRK9 RECOVER R3 = 00 OR POINTER TO A VDEVBLOK 00555000
  624. LTR R3,R3 ANY EXISTING LINKS (FROM CALLER) ? 00556000
  625. BZ LNK03 BRANCH IF NO 00557000
  626. L R4,VDEVLINK-VDEVBLOK(,R3) LOAD POINTER TO NEXT BLOCK 00558000
  627. ST R8,VDEVLINK-VDEVBLOK(,R3) SET POINTER TO THIS BLOCK 00559000
  628. LNK03 ST R4,VDEVLINK POINT THIS BLOCK TO NEXT ONE 00560000
  629. TM UDEVSTAT,UDEVVRR WANT VIRTUAL RES/REL? @V407438 00560050
  630. BZ ATTCHKRD NOPE, BR. @V407438 00560100
  631. L R1,VDEVRRB-VDEVBLOK(R4) VRRBLOK FRM NXT IN CHAIN@V407438 00560150
  632. * IT COULD BE ME, IF SO, R1=0 00560200
  633. * TO DIRECTORY UPDATE 00560250
  634. LTR R1,R1 IS THERE ALREADY A VRRBLOK? @V407438 00560300
  635. BNZ SETEND YES, USE EXISTING VRRBLOK @V407438 00560350
  636. LA R0,VRRSIZE SIZE OF THE VIRT RES/REL BLOCK @V407438 00560400
  637. CALL DMKFREE GET STORAGE FOR IT @V407438 00560450
  638. USING VRRBLOK,R1 ADDRESS THE BLOCK VIA R1 @V407438 00560500
  639. XC VRRBLOK(VRRSIZE*8),VRRBLOK CLEAR THE BLOCK @V407438 00560550
  640. SETEND LR R0,R8 REM. WHERE VDEVLINK CHAIN ENDS @V407438 00560600
  641. SETVRR ST R1,VDEVRRB VDEVBLOK POINTS TO VRRBLOK @V407438 00560650
  642. OI VDEVFLG2,VDEVRRF RES/REL FTR INST ON THIS MDSK @V407438 00560700
  643. L R8,VDEVLINK ON TO THE NEXT VDEVBLOK NOW... @V407438 00560750
  644. CLR R0,R8 IS THIS THE END OF THE CHAIN? @V407438 00560800
  645. BNE SETVRR NOPE, KEEP GOING @V407438 00560850
  646. B ATTCHKRD GO CHECK IF TO FLAG R/O, AND THEN EXIT. 00561000
  647. DROP R1 NO MORE VRRBLOK @V407438 00561500
  648. EJECT 00562000
  649. * BLDVDEV - BUILD A VIRTUAL DEVICE 00563000
  650. * (AN INTERNAL SUBROUTINE) 00564000
  651. * 00565000
  652. * AT ENTRY: 00566000
  653. * R2 = ADDRESS OF USER DEVICE BLOCK 00567000
  654. * R10 = RETURN REGISTER 00568000
  655. * SAVEWRK9 = R3 AT INPUT TO DMKVDSLK, OR IMMATERIAL 00569000
  656. * 00570000
  657. * AT EXIT: 00571000
  658. * R1-R3 RESTORED 00572000
  659. * R6 = ADDRESS OF VIRTUAL CHANNEL BLOCK 00573000
  660. * R7 = ADDRESS OF VIRTUAL CONTROL UNIT BLOCK 00574000
  661. * R8 = ADDRESS OF VIRTUAL DEVICE BLOCK 00575000
  662. * SAVEWRK9 = UPDATED R3 FOR DMKVDSLK, OR IMMATERIAL 00576000
  663. * 00577000
  664. BLDVDEV EQU * BUILD VDEVBLOK, VCUBLOK, VCHBLOK @VM08537 00578000
  665. STM R1,R3,BALR1 SAVE GR1-3 AT SUBRTN ENTRY @VM08537 00579000
  666. MVI SAVEWRK1,X'00' CLEAR A FLAG BYTE @VM08537 00580000
  667. LH R1,UDEVADD LOAD THE VIRTUAL DEVICE ADDRESS 00581000
  668. CALL DMKSCNVU FIND THE VIRT CHAN AND CU BLOCK ADDRESSES 00582000
  669. LR R5,R1 SAVE THE VIRTUAL DEVICE ADDRESS 00583000
  670. BC 1,BLDDVBK BRANCH IF BOTH CHAN AND CU BLOCKS FOUND 00584000
  671. BC 2,BLDCUBK BRANCH IF ONLY CHANNEL BLOCK FOUND 00585000
  672. BC 8,BLDFIN BRANCH IF ALL EXIST - JUST FINISH UP. 00586000
  673. * OTHERWISE, BUILD ALL THREE: 00587000
  674. DROP R2 00588000
  675. * BUILD A VIRTUAL CHANNEL BLOCK 00589000
  676. LA R0,VCHSIZE LOAD CHANNEL BLOCK SIZE 00590000
  677. L R1,VMCHSTRT GET POINTER TO VCHBLOK TABLE 00591000
  678. LH R2,VMCHCNT GET NUMBER OF BLOCKS IN TABLE 00592000
  679. BAL R9,BLDBLOK BUILD A VIRTUAL CHANNEL BLOCK 00593000
  680. ST R1,VMCHSTRT STORE UPDATED VCHBLOK TABLE POINTER 00594000
  681. STH R2,VMCHCNT STORE NEW VCHBLOK COUNT 00595000
  682. LR R6,R8 LOAD VCHBLOK BASE REGISTER 00596000
  683. USING VCHBLOK,R6 00597000
  684. MVC VCHBLOK(VCHCUTBL-VCHBLOK),ZEROES CLEAR START OF VCHBLOK 00598000
  685. MVC VCHCUTBL(8),FFS SET VCHCUTBL TO FFFFFFFF'S 00599000
  686. MVC VCHCUTBL+8(24),VCHCUTBL ... 00600000
  687. LA R2,X'F00' STORE CHANNEL ADDRESS IN VCHBLOK 00601000
  688. NR R2,R5 .. 00602000
  689. STH R2,VCHADD .. 00603000
  690. BZ BLDCH01 BRANCH IF CHANNEL 0 - MULTIPLEXER CHANNEL 00604000
  691. OI VCHTYPE,VCHSEL FLAG CHANNELS 1-6 AS SELECTOR CHANNELS 00605000
  692. TM VMFSTAT,VMFBMX DOES USER WANT BLOK MULTIPLEXER @VA01771 00606000
  693. * CHANS. 00607000
  694. BZ *+8 NO - LEAVE THEM AS SELECTOR @VA01771 00608000
  695. MVI VCHTYPE,VCHBMX YES - CHANGE THEM TO BLOK MULTI. @VA01771 00609000
  696. BLDCH01 SRL R2,7 MULTIPLE CHANNEL ADDR BY 2 00610000
  697. SR R8,R1 COMPUTE DISP. OF THIS VCHBLOK 00611000
  698. STH R8,VMCHTBL(R2) STORE IN APPROPRIATE CHANNEL TABLE SLOT 00612000
  699. OI SAVEWRK1,NEWVCH IND. NEW VCHBLOK BUILT 00612100
  700. SPACE 00613000
  701. * BUILD A VIRTUAL CONTROL UNIT BLOCK 00614000
  702. BLDCUBK LA R0,VCUSIZE LOAD CONTROL UNIT BLOCK SIZE 00615000
  703. L R1,VMCUSTRT GET POINTER TO VCUBLOK TABLE 00616000
  704. LH R2,VMCUCNT GET NUMBER OF BLOCKS IN TABLE 00617000
  705. BAL R9,BLDBLOK BUILD A VIRTUAL CONTROL UNIT BLOCK 00618000
  706. ST R1,VMCUSTRT STORE UPDATED VCUBLOK TABLE POINTER 00619000
  707. STH R2,VMCUCNT STORE NEW VCUBLOK COUNT 00620000
  708. LR R7,R8 LOAD VCUBLOK BASE REGISTER 00621000
  709. USING VCUBLOK,R7 00622000
  710. MVC VCUBLOK(VCUDVTBL-VCUBLOK),ZEROES CLEAR START OF VCUBLOK 00623000
  711. MVC VCUDVTBL(8),FFS SET VCUDVTBL TO FFFFFFFF'S 00624000
  712. MVC VCUDVTBL+8(24),VCUDVTBL ... 00625000
  713. LA R2,X'0F0' STORE CU ADDRESS IN VCUBLOK 00626000
  714. NR R2,R5 .. 00627000
  715. STH R2,VCUADD 00628000
  716. SRL R2,3 MULTIPLY CTL UNIT ADDRESS BY 2 @VA01041 00629000
  717. SR R8,R1 COMPUTE DISPLACEMENT OF THIS VCUBLOK 00630000
  718. STH R8,VCHCUTBL(R2) STORE IN APPROPRIATE CU TABLE SLOT 00631000
  719. OI SAVEWRK1,NEWVCU IND. NEW VCUBLOK BUILT 00631100
  720. SPACE 00632000
  721. * BUILD A VIRTUAL DEVICE BLOCK 00633000
  722. BLDDVBK LA R0,VDEVSIZE LOAD DEVICE BLOCK SIZE 00634000
  723. L R1,VMDVSTRT GET POINTER TO VDEVBLOK TABLE 00635000
  724. LH R2,VMDVCNT GET NUMBER OF BLOCKS IN TABLE 00636000
  725. OI SAVEWRK1,NEWVDEV BUILDING NEW VDEVBLOK NOW @V3E7466 00637000
  726. BAL R9,BLDBLOK BUILD A VIRTUAL DEVICE BLOCK 00638000
  727. ST R1,VMDVSTRT STORE UPDATED VDEVBLOK TABLE POINTER 00639000
  728. STH R2,VMDVCNT STORE NEW VDEVBLOK COUNT 00640000
  729. LR R3,R8 SAVE VDEVBLOK ADDRESS 00641000
  730. LA R2,X'00F' STORE DEVICE ADDRESS IN VDEVBLOK 00642000
  731. NR R2,R5 .. 00643000
  732. STH R2,VDEVADD .. 00644000
  733. AR R2,R2 MULTIPLY DEVICE ADDRESS BY 2 00645000
  734. SR R3,R1 COMPUTE DISPLACEMENT OF THIS VDEVBLOK 00646000
  735. STH R3,VCUDVTBL(R2) STORE IN APPROPRIATE DEVICE TABLE SLOT 00647000
  736. BLDFIN XC VDEVADD+2(VDEVSIZE*8-2),VDEVADD+2 CLEAR REMAINDER OF BLK 00648000
  737. ST R11,VDEVUSER STORE USER'S VMBLOK ADDRESS IN VDEVBLOK 00649000
  738. LM R1,R3,BALR1 RESTORE GR1-3 AT SUBRTN ENTRY @VM08537 00650000
  739. BR R10 AND EXIT TO MAIN CODE. 00651000
  740. LIMITERR DS 0H @VA09651 00651100
  741. LA R2,124 SET RETURN CODE 124 FOR @VA13217 00651200
  742. * ATTACH,DEFINE, AND LINK 00651300
  743. ST R2,SAVER2 @VA09651 00651400
  744. LCR R2,R2 SET CC=1 @VA09651 00651500
  745. B VDSEXIT RETURN TO CALLER @VA09651 00651600
  746. EJECT 00652000
  747. * BLDBLOK - BUILD ONE NEW CHANNEL-, CONTROL UNIT-, OR DEVICE-BLOCK 00653000
  748. * (AN INTERNAL SUBROUTINE) 00654000
  749. * 00655000
  750. * AT ENTRY: 00656000
  751. * R0 = VCHSIZE, VCUSIZE, OR VDEVSIZE 00657000
  752. * R1 = VMCHSTRT, VMCUSTRT, OR VMDVSTRT (IF ANY) 00658000
  753. * R2 = VMCHCNT, VMCUCNT, OR VMDVCNT (IF ANY) 00659000
  754. * R9 = RETURN-REGISTER 00660000
  755. * SAVEWRK1 = X'00' IF CHANNEL OR CONTROL UNIT BLOCK WANTED, 00661000
  756. * OR X'80' IF DEVICE BLOCK WANTED. 00662000
  757. * SAVEWRK9 = R3 AT INPUT TO DMKVDSLK, OR IMMATERIAL 00663000
  758. * 00664000
  759. * AT EXIT: 00665000
  760. * R1 = UPDATED VMCHSTRT, VMCUSTRT, OR VMDVSTRT 00666000
  761. * R2 = UPDATED VMCHCNT, VMCUCNT, OR VMDVCNT 00667000
  762. * R8 = NEW CHANNEL-, CONTROL UNIT-, OR DEVICE-BLOCK 00668000
  763. * SAVEWRK9 = UPDATED R3 FOR DMKVDSLK, OR IMMATERIAL 00669000
  764. * 00670000
  765. BLDBLOK LTR R8,R1 ANY ENTRIES IN THE TABLE ? 00671000
  766. BNP BLDNEW NO, BUILD ONE NEW BLOCK 00672000
  767. * YES, LOOK FOR AN EMPTY SLOT 00673000
  768. LR R3,R2 SAVE THE BLOCK COUNT 00674000
  769. SLL R0,3 CONVERT SIZE TO NUMBER OF BYTES 00675000
  770. BLDSLOT TM VDEVADD,X'80' IS THIS SLOT AVAILABLE ? 00676000
  771. BCR 1,R9 "BO" IF YES - RETURN. 00677000
  772. AR R8,R0 NO, POINT TO NEXT BLOCK 00678000
  773. BCT R3,BLDSLOT LOOP IF MORE BLOCKS IN TABLE 00679000
  774. SR R8,R1 COMPUTE OLD TABLE LENGTH 00680000
  775. ST R8,SAVEWRK2 SAVE FOR LATER CALL TO FRET 00681000
  776. ST R1,SAVEWRK3 SAVE OLD TABLE ADDRESS 00682000
  777. LR R3,R0 SAVE THE BLOCK SIZE 00683000
  778. AR R0,R8 COMPUTE NEW TABLE LENGTH 00684000
  779. CLM R0,3,DEVLIM EXCEEDING MAX VIRTUAL DEVICES @VA13217 00684500
  780. BH LIMITERR YES, DONT BUILD NEW TAB; LEAVE @VA13217 00684510
  781. SRL R0,3 CONVERT TO NUMBER OF DOUBLE WORDS 00685000
  782. CALL DMKFRERC GET FREE STORAGE FOR NEW TABLE @V3E7466 00686000
  783. BNZ NOSTOR CC=1 - INSUFFICIENT STORAGE @V3E7466 00686100
  784. STM R1,R2,SAVEWRK4 SAVE NEW TABLE ADDRESS & OLD BLOCK COUNT 00687000
  785. LR R0,R3 RESTORE THE BLOCK SIZE 00688000
  786. BCTR R3,0 SUBTRACT 1 FOR EXECUTED MVC 00689000
  787. LR R8,R1 LOAD NEW TABLE ADDRESS 00690000
  788. L R1,SAVEWRK3 LOAD OLD TABLE ADDRESS 00691000
  789. BLDMOVE EX R3,BLDXMVC MOVE OLD BLOCK TO NEW LOCATION 00692000
  790. TM SAVEWRK1,NEWVDEV BUILDING NEW VDEVBLOK NOW?? @V3E7466 00693000
  791. BZ BLDNEXT BRANCH IF NO 00694000
  792. CLI VDEVTYPC,CLASDASD IS THIS A DASD DEVICE ? 00695000
  793. BNE BLDNEXT BRANCH IF NO 00696000
  794. TM VDEVFLAG,VDEVTDSK IS IT A T-DISK 00697000
  795. BO BLDNEXT YES- BRANCH (NO LINKS) 00698000
  796. L R14,VDEVLINK LOAD SHARED DEVICE LINK 00699000
  797. LTR R14,R14 IS THIS A SHARED DEVICE ? 00700000
  798. BZ BLDNEXT BRANCH IF NOT. 00701000
  799. LR R15,R8 LET R15 POINT TO NEW BLOCK, AND 00702000
  800. B BLDCHCK GO SEE IF OLD BLOCK POINTED TO ITSELF. 00703000
  801. BLDLOOP LR R15,R14 SAVE PREVIOUS VDEVBLOK ADDRESS 00704000
  802. L R14,VDEVLINK-VDEVBLOK(,R14) LOAD NEXT VDEVBLOK ADDRESS 00705000
  803. BLDCHCK CR R1,R14 DOES IT POINT TO THE OLD BLOCK ? 00706000
  804. BNE BLDLOOP NO, KEEP LOOKING 00707000
  805. ST R8,VDEVLINK-VDEVBLOK(,R15) YES, POINT IT TO NEW ONE 00708000
  806. CL R1,SAVEWRK9 DOES OLD BLOCK MATCH R3 AT ENTRY TO VDSLK 00709000
  807. BNE BLDNEXT NOPE. 00710000
  808. ST R8,SAVEWRK9 IF YES, NEW "R3" FOR VDSLK CODE. 00711000
  809. BLDNEXT AR R1,R0 POINT TO NEXT OLD BLOCK 00712000
  810. AR R8,R0 POINT TO NEXT NEW BLOCK 00713000
  811. BCT R2,BLDMOVE BRANCH IF MORE BLOCKS IN THE TABLE 00714000
  812. LM R0,R1,SAVEWRK2 RELOAD OLD TABLE SIZE AND ADDRESS 00715000
  813. SRL R0,3 CONVERT SIZE TO NUMBER OF DOUBLE WORDS 00716000
  814. CALL DMKFRET RETURN OLD TABLE TO FREE STORAGE 00717000
  815. LM R1,R2,SAVEWRK4 RELOAD NEW TABLE ADDRESS AND COUNT 00718000
  816. LA R2,1(,R2) ADD 1 TO THE COUNT 00719000
  817. BR R9 RETURN TO BLDVDEV ROUTINE. 00720000
  818. SPACE 00721000
  819. BLDNEW CALL DMKFRERC GET STORAGE FOR ONE NEW BLOCK @V3E7466 00722000
  820. BNZ NOSTOR CC=1 - INSUFFICIENT STORAGE @V3E7466 00722100
  821. LR R8,R1 LOAD NEW BLOCK ADDRESS 00723000
  822. LA R2,1 SET COUNT TO 1 00724000
  823. BR R9 RETURN TO BLDVDEV ROUTINE. 00725000
  824. SPACE 2 00726000
  825. BLDXMVC MVC VDEVBLOK(0),0(R1) MOVE ONE BLOCK FROM OLD TABLE TO NEW 00727000
  826. EJECT 00727100
  827. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00727200
  828. * BITS DEFINED IN FIRST BYTE OF SAVEWRK1 * 00727300
  829. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00727400
  830. SPACE 2 00727500
  831. NEWVDEV EQU X'80' BUILDING NEW VDEVBLOK @V3E7466 00727600
  832. NEWVCH EQU X'40' NEW VCHBLOK ALREADY BUILT @V3E7466 00727700
  833. NEWVCU EQU X'20' NEW VCUBLOK ALREADY BUILT @V3E7466 00727800
  834. SPACE 00727900
  835. SPACE 2 00728000
  836. USING RDEVBLOK,R1 00729000
  837. USING VDEVBLOK,R8 00730000
  838. CHEKRSRL TM RDEVFTR,FTRRSRL IS RESERVE/RELEASE VALID CCW ? 00731000
  839. BCR 8,R9 <BZ> NO - JUST EXIT. 00732000
  840. OI VDEVFLAG,VDEVRSRL YES - SET FLAG-BIT IN VDEVBLOK 00733000
  841. BR R9 AND EXIT. 00734000
  842. EJECT 00735000
  843. * RDEVSTAT MUST BE TESTED IN THIS ORDER 00736000
  844. ATTBUSY TM RDEVSTAT,RDEVDISA IS THE DEVICE OFFLINE ? 00737000
  845. LA R2,12 R2=12 FOR 'DEVICE IS OFFLINE' 00738000
  846. BO ATTRETN BRANCH IF YES. 00739000
  847. TM RDEVSTAT,RDEVDED IS IT ALREADY DEDICATED ? 00740000
  848. LA R2,24 R2=24 FOR 'ALREADY ATTACHED' 00741000
  849. BO ATTRETN BRANCH IF YES. 00742000
  850. TM RDEVFLAG,RDEVOWN IS IT OWNED BY CP ? 00743000
  851. LA R2,20 R2=20 FOR 'DEVICE OWNED BY CP' 00744000
  852. BO ATTRETN BRANCH IF YES. 00745000
  853. * MUST BE A SYSTEM VOLUME, THEN: 00746000
  854. ATTSHRD LA R2,16 R2 = 16: 'ATTACHED TO SYSTEM' 00747000
  855. B ATTRETN 00748000
  856. SPACE 00749000
  857. ATTDRAN LA R2,8 SPOOL DEVICE NOT DRAINED @V200820 00750000
  858. B ATTRETN @V200820 00751000
  859. NOSTOR TM SAVEWRK1,NEWVDEV ARE WE BUILDING VDEVBLOK? @V3E7466 00751025
  860. BO CHKNEWCU YES, SEE IF NEW VCUBLOK BUILT @V3E7466 00751050
  861. TM SAVEWRK1,NEWVCH DID WE BUILD NEW VCHBLOK?? @V3E7466 00751075
  862. BO PATCHVCH YES, MUST MEAN THIS REQ. FOR VCU @V3E7466 00751100
  863. B NOSTOR2 ISSUE INSUFF. STORAGE MSG. @V3E7466 00751125
  864. SPACE 00751150
  865. CHKNEWCU TM SAVEWRK1,NEWVCU DID WE BUILD NEW VCUBLOK? @V3E7466 00751175
  866. BO PATCHVCU YES, MUST UNDO WHAT HAS BEEN DONE@V3E7466 00751200
  867. TM SAVEWRK1,NEWVCH DID WE BUILD NEW VCHBLOK?? @V3E7466 00751225
  868. BO PATCHVCH YES, MUST UNDO WHAT HAS BEEN DONE@V3E7466 00751250
  869. NOSTOR2 LA R2,RC32 INSUFFICIENT STORAGE FOR BLOCKS @V3E7466 00751275
  870. B ATTRETN RETURN TO CALLER @V3E7466 00751300
  871. SPACE 00751325
  872. PATCHVCU LA R2,FFS MAKE BLOCK LOOK LIKE EMPTY SLOT @V3E7466 00751350
  873. STH R2,VCUADD ... @V3E7466 00751375
  874. LA R1,X'0F0' PUT X'FFFF' IN CUTBL INDEX @V3E7466 00751400
  875. NR R1,R5 ... @V3E7466 00751425
  876. SRL R1,3 ... @V3E7466 00751450
  877. STH R2,VCHCUTBL(R1) STORE IN CORRECT CU TABLE SLOT @V3E7466 00751475
  878. TM SAVEWRK1,NEWVCH NEW VCHBLOK BUILT ALSO? @V3E7466 00751500
  879. BZ NOSTOR2 NO, PATCH WORK ALL DONE @V3E7466 00751525
  880. PATCHVCH LA R2,FFS MAKE BLOCK LOOK LIKE EMPTY SLOT @V3E7466 00751550
  881. STH R2,VCHADD ... @V3E7466 00751575
  882. LA R1,X'F00' STORE X'FFFF' IN CORRECT VMCHTBL SLOT@V3E7466 00751600
  883. NR R1,R5 ... @V3E7466 00751625
  884. STH R2,VMCHTBL(R1) ... @V3E7466 00751650
  885. B NOSTOR2 NOW GO ISSUE ERROR MSG @V3E7466 00751675
  886. SPACE 00752000
  887. ATTNSPC LA R2,28 'SPACE NOT AVAILABLE' 00753000
  888. SPACE 00754000
  889. ATTRETN ST R2,SAVER2 RETURN ERROR-CODE TO CALLER IN R2 00755000
  890. LCR R2,R2 PLUS-TO-MINUS SETS CONDITION-CODE = 1 00756000
  891. B VDSEXIT NOW GO RETURN TO CALLER. 00757000
  892. RC32 EQU 32 INSUFFICIENT FREE STORAGE @V3E7466 00757100
  893. SPACE 00758000
  894. DS 0F @V200820 00759000
  895. MSGHEAD DC C'VDS',X'00' DMKERMSG PARMS FOR @V200820 00760000
  896. MSGPARM DC X'80E6',AL2(465) MSG= DMKVDS465W @V200820 00761000
  897. TST3036 DC X'3036' @VA09765 00761050
  898. TST3066 DC X'3066' @VA09765 00761100
  899. TST3138 DC X'3138' @VA09765 00761150
  900. TST3148 DC X'3148' @VA09765 00761200
  901. TST3158 DC X'3158' @VA09765 00761250
  902. DEVLIM DC X'7FFF' @VA09651 00761500
  903. SPACE 3 00762000
  904. LTORG 00763000
  905. SPACE 00764000
  906. ENTRY DMKVDSND 00765000
  907. DMKVDSND EQU * SHOW "THE END" OF DMKVDS ON LOAD MAP. 00766000
  908. EJECT 00767000
  909. COPY EQU 00768000
  910. COPY DEVTYPES 00769000
  911. PSA 00770000
  912. COPY SAVE 00771000
  913. COPY VMBLOK 00772000
  914. COPY RBLOKS 00773000
  915. COPY NETWORK @V200820 00774000
  916. COPY VBLOKS 00775000
  917. COPY IOBLOKS 00776000
  918. COPY IOER 00777000
  919. COPY UDIRECT 00778000
  920. END 00779000
ibm/vm370-lib/cp/dmkvds.assemble_src.txt ยท Last modified: 2023/08/06 13:37 by Site Administrator