Table of Contents

DMKTDK Source

References

Source Listing

DMKTDK.ASSEMBLE.txt
  1. TDK TITLE 'DMKTDK (CP) VM/370 - RELEASE 6' 00001000
  2. ISEQ 73,80 00002000
  3. *. 00003000
  4. * MODULE NAME - 00004000
  5. * 00005000
  6. * DMKTDK 00006000
  7. * 00007000
  8. * CONTENTS - 00008000
  9. * 00009000
  10. * DMKTDKGT - OBTAIN TDISK SPACE 00010000
  11. * DMKTDKRL - RELEASE TDISK SPACE 00011000
  12. * 00012000
  13. EJECT 00013000
  14. * SUBROUTINE NAME - 00014000
  15. * 00015000
  16. * DMKTDKGT 00016000
  17. * 00017000
  18. * FUNCTION - 00018000
  19. * 00019000
  20. * TO ALLOCATE CYLINDERS OF TDISK SPACE FROM CP OWNED VOLUMES 00020000
  21. * 00021000
  22. * ATTRIBUTES - 00022000
  23. * 00023000
  24. * REENTRANT, PAGEABLE, CALLED VIA SVC 00024000
  25. * 00025000
  26. * ENTRY POINTS - 00026000
  27. * 00027000
  28. * DMKTDKGT 00028000
  29. * 00029000
  30. * ENTRY CONDITIONS - 00030000
  31. * 00031000
  32. * GPR0 = NUMBER OF CYLINDERS REQUIRED 00032000
  33. * GPR1 = DEVICE TYPE REQUIRED 00033000
  34. * GPR12 = ADDRESS OF DMKTDKGT 00034000
  35. * GPR13 = ADDRESS OF SAVEAREA 00035000
  36. * 00036000
  37. * EXIT CONDITIONS - 00037000
  38. * 00038000
  39. * NORMAL - 00039000
  40. * GPR1 = CYLINDER NUMBER OF 1ST CYLINDER ALLOCATED 00040000
  41. * GPR8 = ADDRESS OF RDEVBLOK CONTAINING VOLUME 00041000
  42. * 00042000
  43. * ERROR - 00043000
  44. * GPR8 = 0 - NO SPACE AVAILABLE 00044000
  45. * 00045000
  46. * CALLS TO OTHER ROUTINES - 00046000
  47. * 00047000
  48. * DMKIOSQR 00048000
  49. * 00049000
  50. * EXTERNAL REFERENCES - 00050000
  51. * 00051000
  52. * CHAIN ANCHORS FOR DEVICES WITH OWNED VOLUMES MOUNTED. 00052000
  53. * DMKPGTP5,DMKPGT5P,DMKPGTP0,DMKPGT4P,DMKPGTP4 00053000
  54. * DMKPGTT5,DMKPGT5T,DMKPGTT0,DMKPGT4T,DMKPGTT4 00054000
  55. * 00055000
  56. * TABLES / WORKAREAS - 00056000
  57. * 00057000
  58. * ALOCBLOK 00058000
  59. * 00059000
  60. EJECT 00060000
  61. * REGISTER USAGE - 00061000
  62. * 00062000
  63. * GPR0-4 - SCRATCH 00063000
  64. * GPR5 = OWNED VOLUME DEVICE LIST ANCHOR 00064000
  65. * GPR6 = ALOCBLOK BASE 00065000
  66. * GPR7 = ALOCMAP CYLINDER POINTER 00066000
  67. * GPR8 = RDEVBLOK BASE 00067000
  68. * GPR9-11 - NOT USED 00068000
  69. * GPR12 = DMKTDK BASE 00069000
  70. * GPR13 = SAVEAREA BASE 00070000
  71. * GPR14 = INCREMENT REGISTER FOR BXLE (=1) 00071000
  72. * GPR15 = COMPARAND REGISTER FOR BXLE 00072000
  73. * 00073000
  74. * NOTES - 00074000
  75. * 00075000
  76. * NONE 00076000
  77. * 00077000
  78. * OPERATION - 00078000
  79. * 00079000
  80. * 1. LOCATE AN RDEVBLOK FOR A DEVICE CONTAINING A VOLUME OF 00080000
  81. * THE DESIRED TYPE; IF NONE CAN BE FOUND RETURN A VALUE OF 00081000
  82. * ZERO IN GPR8 AND EXIT 00082000
  83. * 2. LOCATE AN ALOCBLOK FOR TDISK SPACE ON THE ALLOCATION CHAIN 00083000
  84. * FROM THE RDEVBLOK; IF NONE CAN BE FOUND GO TO STEP 1; 00084000
  85. * OTHERWISE, CONTINUE 00085000
  86. * 3. LOCATE AN UNALLOCATED CYLINDER ON THE ALLOCATION MAP AND 00086000
  87. * VERIFY THAT ENOUGH CONTIGUOUS CYLINDERS EXIST TO SATISFY 00087000
  88. * THE REQUEST; IF ENOUGH CYLINDERS ARE NOT AVAILABLE GO TO 00088000
  89. * STEP 2; OTHERWISE, CONTINUE 00089000
  90. * 4. MARK THE CYLINDERS ALLOCATED IN THE ALLOCATION MAP AND 00090000
  91. * ERASE TRACK ZERO OF THIS EXTENT TO ZEROES. RETURN THE 00091000
  92. * ADDRESS OF THE FIRST CYLINDER ALLOCATED TO THE CALLER 00092000
  93. * IN GPR1 AND THE ADDRESS OF THE RDEVBLOK IN GPR8; THEN, 00093000
  94. * EXIT TO THE CALLER. 00094000
  95. *. 00095000
  96. EJECT 00096000
  97. COPY OPTIONS 00097000
  98. COPY LOCAL OPTIONS 00098000
  99. EJECT 00099000
  100. DMKTDK CSECT 00100000
  101. SPACE 3 00101000
  102. EXTRN DMKPGTT5 2305 OWNED VOLUME ANCHOR 00102000
  103. EXTRN DMKPGT5T 3350 OWNED VOLUME ANCHOR @V304498 00103000
  104. EXTRN DMKPGT7T 3375 owned volume anchor HRC106DK 00103100
  105. EXTRN DMKPGT8T 3380 owned volume anchor HRC106DK 00103200
  106. EXTRN DMKPGTT0 3330 OWNED VOLUME ANCHOR 00104000
  107. EXTRN DMKPGT4T 3340 OWNED VOLUME ANCHOR @V2A2029 00105000
  108. EXTRN DMKPGTT4 2314 OWNED VOLUME ANCHOR 00106000
  109. EXTRN DMKPGTP5 2305 OWNED VOLUME ANCHOR (PREF) 00107000
  110. EXTRN DMKPGT5P 3350 OWNED VOLUME ANCHOR (PREF) @V304498 00108000
  111. EXTRN DMKPGT7P 3375 owned volume anchor (pref) HRC106DK 00108100
  112. EXTRN DMKPGT8P 3380 owned volume anchor (pref) HRC106DK 00108200
  113. EXTRN DMKPGTP0 3330 OWNED VOLUME ANCHOR (PREF) 00109000
  114. EXTRN DMKPGT4P 3340 OWNED VOLUME ANCHOR (PREF) @V2A2029 00110000
  115. EXTRN DMKPGTP4 2314 OWNED VOLUME ANCHOR (PREF) 00111000
  116. EXTRN DMKIOSQR 00112000
  117. SPACE 00113000
  118. USING PSA,R0 00114000
  119. USING ALOCBLOK,R6 00115000
  120. USING RDEVBLOK,R8 00116000
  121. USING SAVEAREA,R13 00117000
  122. SPACE 2 00118000
  123. USING *,R12 00119000
  124. EJECT 00120000
  125. ID DC CL8'DMKTDK' MODULE NAME 00121000
  126. SPACE 2 00122000
  127. DMKTDKGT RELOC 00123000
  128. LA R14,1 ESTABLISH INCREMENT REGISTER FOR BXLE 00124000
  129. C R1,=A(TYP3340) 3340 TYPE OF DASD SPACE NEEDED ? @V2A2029 00125000
  130. BE TYPE3340 YES - BRANCH @V2A2029 00126000
  131. C R1,=A(TYP3350) 3350 TYPE OF DASD SPACE NEEDED ? @V304498 00127000
  132. BE TYPE3350 YES - BRANCH @V304498 00128000
  133. C R1,=A(TYP3375) 3375 type of dasd space needed ? HRC106DK 00128100
  134. BE TYPE3375 Yes - branch HRC106DK 00128200
  135. C R1,=A(TYP3380) 3380 type of dasd space needed ? HRC106DK 00128300
  136. BE TYPE3380 Yes - branch HRC106DK 00128400
  137. C R1,=A(TYP3330) TEST FOR TYPE OF DASD SPACE NEEDED 00129000
  138. BH TYPE2314 MUST BE 2314 00130000
  139. BL TYPE2305 OR IF LOW, MUST BE 2305 00131000
  140. L R5,=A(DMKPGTT0) 3330 - GET LIST ANCHOR 00132000
  141. L R2,=A(DMKPGTP0) GET LIST ANCHOR FOR PREF. VOLUMES 00133000
  142. B GETDEVIC AND GO FIND A DEVICE 00134000
  143. SPACE 00135000
  144. TYPE3350 L R5,=A(DMKPGT5T) GET LIST ANCHOR FOR 3350 @V304498 00136000
  145. L R2,=A(DMKPGT5P) GET LIST ANCHOR FOR PREF. VOL'S @V304498 00137000
  146. B GETDEVIC AND REJOIN BELOW @V304498 00138000
  147. SPACE 00139000
  148. TYPE3375 L R5,=A(DMKPGT7T) Get list anchor for 3375 HRC106DK 00139100
  149. L R2,=A(DMKPGT7P) Get list anchor for pref. vol's HRC106DK 00139200
  150. B GETDEVIC and rejoin below HRC106DK 00139300
  151. SPACE 1 HRC106DK 00139400
  152. TYPE3380 L R5,=A(DMKPGT8T) Get list anchor for 3380 HRC106DK 00139500
  153. L R2,=A(DMKPGT8P) Get list anchor for pref. vol's HRC106DK 00139600
  154. B GETDEVIC and rejoin below HRC106DK 00139700
  155. SPACE 1 HRC106DK 00139800
  156. TYPE2314 L R5,=A(DMKPGTT4) GET LIST ANCHOR FOR 2314 00140000
  157. L R2,=A(DMKPGTP4) GET LIST ANCHOR FOR PREF. VOLUMES 00141000
  158. B GETDEVIC AND REJOIN BELOW 00142000
  159. SPACE 00143000
  160. TYPE3340 L R5,=A(DMKPGT4T) GET LIST ANCHOR FOR 3340 @V2A2029 00144000
  161. L R2,=A(DMKPGT4P) GET LIST ANCHOR FOR PREF. @V2A2029 00145000
  162. * VOLUMES 00146000
  163. B GETDEVIC AND REJOIN BELOW @V2A2029 00147000
  164. SPACE 00148000
  165. TYPE2305 L R5,=A(DMKPGTT5) GET LIST ANCHOR FOR 2305 00149000
  166. L R2,=A(DMKPGTP5) GET LIST ANCHOR FOR PREF. VOLUMES 00150000
  167. SPACE 00151000
  168. GETDEVIC L R8,0(,R5) GET NEXT DEVICE ON LIST 00152000
  169. LTR R8,R8 IS THE LIST EMPTY ?? 00153000
  170. BZ CKPREF NO - GO SEE IF THERE IS ANOTHER LIST 00154000
  171. SPACE 00155000
  172. GETALLN1 LA R6,RDEVALLN POINT TO ALOCBLOK LIST ANCHOR 00156000
  173. SPACE 00157000
  174. GETALLN2 L R6,ALOCPNT POINT TO NEXT ALOCBLOK ON LIST 00158000
  175. LTR R6,R6 LOOK FOR A TDISK BLOK 00159000
  176. BP GETALLN2 STILL CHAINING PAGING BLOKS 00160000
  177. BM GETMAP FOUND ONE -- 00161000
  178. SPACE 00162000
  179. L R8,RDEVPNT POINT TO NEXT DEVICE ON LIST 00163000
  180. C R8,0(,R5) BACK TO START ?? 00164000
  181. BNE GETALLN1 NO -- LOOK FOR SPACE ON THIS DEVICE -- 00165000
  182. SPACE 00166000
  183. CKPREF EQU * TEST FOR ADDITIONAL DEVICE LIST TO PROCESS 00167000
  184. CLR R5,R2 PROCESSING THE PREFERRED LIST ? 00168000
  185. BE NOTSPACE YES -- NO TDISK SPACE AVAILABLE 00169000
  186. LR R5,R2 POINT TO PREFERRED LIST ANCHOR 00170000
  187. B GETDEVIC AND CONTINUE 00171000
  188. SPACE 00172000
  189. NOTSPACE EQU * HERE IF NO SPACE AVAILABLE 00173000
  190. SLR R8,R8 INDICATE NO DEVICE TO CALLER 00174000
  191. B SETDEVIC INDICATE SO TO CALLER 00175000
  192. EJECT 00176000
  193. GETMAP EQU * FIND SOME UNALLOCATED CYLINDERS 00177000
  194. LH R1,ALOCCYL2 GET LAST CYLINDER ON THIS BLOK 00178000
  195. SH R1,ALOCCYL1 GET NUMBER OF CYLINDERS AVAILABLE-1 00179000
  196. L R0,SAVER0 GET NUMBER OF CYLINDERS REQUESTED 00180000
  197. SR R0,R14 DECREMENT NUMBER ASKED BY ONE 00181000
  198. CLR R0,R1 ENOUGH IN THIS BLOK ?? 00182000
  199. BH GETALLN2 NO -- SEE IF MORE ALOCBLOKS 00183000
  200. SPACE 00184000
  201. LA R15,ALOCMAP(R1) POINT TO LAST BYTE IN MAP 00185000
  202. SR R15,R0 POINT TO LAST BYTE TO TEST 00186000
  203. LA R7,ALOCMAP POINT TO 1ST BYTE TO TEST 00187000
  204. LR R4,R7 AND SAVE ITS ADDRESS 00188000
  205. SPACE 2 00189000
  206. GETCYL CLI 0(R7),0 IS THE CYLINDER ALLOCATED ?? 00190000
  207. BE GETNXTCL NO -- 00191000
  208. CYLOOP BXLE R7,R14,GETCYL LOOP UNTIL AN UNALLOCATED CYLINDER IS 00192000
  209. B GETALLN2 FOUND, OR UNTIL NONE ARE LEFT 00193000
  210. SPACE 00194000
  211. GETNXTCL LTR R3,R0 ONLY ONE CYLINDER NEEDED ? 00195000
  212. BZ ALLOCATE YES -- 00196000
  213. SLR R3,R14 DECREMENT COUNT ONE MORE 00197000
  214. ST R7,SAVEWRK2 SAVE ALOCBLOK POINTER @VA03157 00198000
  215. LR R9,R3 SET REG FOR EXECUTE @VA03157 00199000
  216. ALLOCCLC CL R9,F255 CHECKING MORE THAN 256 CHARS @VA03157 00200000
  217. BNH ALCCLCEX NO, GO COMPARE @VA03157 00201000
  218. L R10,F255 LOAD REG FOR MAX COMPARE LENGTH @VA03157 00202000
  219. EX R10,CKCYL GO COMPARE FOR MAX LENGTH @VA03157 00203000
  220. BE CONTLOOP CONTINUE COMPARING @VA03157 00204000
  221. L R7,SAVEWRK2 RESTORE ALOCBLOK FLAG POINTER @VA03157 00205000
  222. B CYLOOP NOT ENOUGH CYLS, LOOK AGAIN @VA03157 00206000
  223. CONTLOOP A R7,F256 INCREMENT POINTER @VA03157 00207000
  224. S R9,F256 DECREMENT COMPARE LENGTH BY 256 @VA03157 00208000
  225. B ALLOCCLC LOOP @VA03157 00209000
  226. ALCCLCEX EX R9,CKCYL TEST FOR ENOUGH CONTIGUOUS CYLS @VA03157 00210000
  227. L R7,SAVEWRK2 RESTORE ALOCBLOK FLAG POINTER @VA03157 00211000
  228. BNE CYLOOP NOT ENOUGH -- KEEP LOOKING 00212000
  229. SPACE 00213000
  230. ALLOCATE MVI 0(R7),X'AA' FLAG 1ST CYLINDER AS ALLOCATED 00214000
  231. LTR R0,R0 ONLY 1 CYLINDER TO ALLOCATE ? 00215000
  232. BZ SETCYL YES -- 00216000
  233. ALLOCMVC CL R3,F255 FLAG MORE THAN 256 @VA03157 00217000
  234. BNH ALCMVCEX NO, GO FLAG @VA03157 00218000
  235. EX R10,MOVEALLN FLAG MAXIMUM @VA03157 00219000
  236. A R7,F256 INCREMENT POINTER @VA03157 00220000
  237. S R3,F256 DECREMENT LENGTH BY 256 @VA03157 00221000
  238. B ALLOCMVC LOOP @VA03157 00222000
  239. ALCMVCEX EX R3,MOVEALLN ALLOCATE REST OF CYS @VA03157 00223000
  240. L R7,SAVEWRK2 RESTORE ALOCBLOK COUNTER @VA03157 00224000
  241. SPACE 00225000
  242. SETCYL EQU * CALCULATE CYLINDER NUMBER ALLOCATED 00226000
  243. SR R7,R4 GET DISPLACEMENT FROM START OF MAP 00227000
  244. AH R7,ALOCCYL1 GET CYLINDER NUMBER 00228000
  245. ST R7,SAVER1 PASS BACK TO CALLER IN GPR1 00229000
  246. LH R7,RDEVLNKS OBTAIN USE COUNT @VA04364 00229300
  247. ALR R7,R14 INCREMENT BY ONE @VA04364 00229600
  248. STH R7,RDEVLNKS STORE UPDATED COUNT @VA04364 00229900
  249. SPACE 00230000
  250. SETDEVIC EQU * PASS BACK RDEVBLOK ADDRESS 00231000
  251. ST R8,SAVER8 IN GPR8 00232000
  252. LTR R8,R8 TDISK SPACE FOUND ?? 00233000
  253. BNZ RLEXIT YES - GO CLEAR FIRST CYLINDER 00234000
  254. EXIT 00235000
  255. EJECT 00236000
  256. *. 00237000
  257. * 00238000
  258. * SUBROUTINE NAME - 00239000
  259. * 00240000
  260. * DMKTDKRL 00241000
  261. * 00242000
  262. * FUNCTION - 00243000
  263. * 00244000
  264. * TO RELEASE TDISK SPACE TO THE POOL OF FREE SPACE 00245000
  265. * 00246000
  266. * ATTRIBUTES - 00247000
  267. * 00248000
  268. * REENTRANT, PAGEABLE, CALLED VIA SVC 00249000
  269. * 00250000
  270. * ENTRY POINTS - 00251000
  271. * 00252000
  272. * DMKTDKRL 00253000
  273. * 00254000
  274. * ENTRY CONDITIONS - 00255000
  275. * 00256000
  276. * GPR0 = NUMBER OF CYLINDERS TO RELEASE 00257000
  277. * GPR1 = CYLINDER NUMBER OF FIRST CYLINDER TO RELEASE 00258000
  278. * GPR8 = ADDRESS OF RDEVBLOK FOR DEVICE ON WHICH SPACE IS 00259000
  279. * ALLOCATED 00260000
  280. * GPR12 = ADDRESS OF DMKTDKRL 00261000
  281. * GPR13 = ADDRESS OF SAVEAREA 00262000
  282. * 00263000
  283. * EXIT CONDITIONS - 00264000
  284. * 00265000
  285. * NONE 00266000
  286. * 00267000
  287. * CALLS TO OTHER ROUTINES - 00268000
  288. * 00269000
  289. * DMKFREE - OBTAIN STORAGE FOR AN IO TASK BLOK 00270000
  290. * DMKFRET - RETURN IOTASK TO FREE STORAGE 00271000
  291. * DMKIOSQR - SCHEDULE IO TO ERASE TRACK 0 CYLINDER 0 00272000
  292. * DMKDSPCH - EXIT VIA GOTO TO AWAIT IO INTERRUPT 00273000
  293. * 00274000
  294. * EXTERNAL REFERENCES - 00275000
  295. * 00276000
  296. * NONE 00277000
  297. * 00278000
  298. * TABLES / WORKAREAS - 00279000
  299. * 00280000
  300. * ALOCBLOK 00281000
  301. * 00282000
  302. * REGISTER USAGE - 00283000
  303. * 00284000
  304. * GPR0-5 - SCRATCH 00285000
  305. * GPR6 = ALOCBLOK BASE 00286000
  306. * GPR7 = SCRATCH 00287000
  307. * GPR8 = RDEVBLOK BASE 00288000
  308. * GPR9-11 NOT USED 00289000
  309. * GPR12 = DMKTDK BASE 00290000
  310. * GPR13 = SAVEAREA BASE 00291000
  311. * GPR14,15 NOT USED 00292000
  312. * 00293000
  313. * 00294000
  314. * NOTES - 00295000
  315. * 00296000
  316. * NONE 00297000
  317. * 00298000
  318. * OPERATION - 00299000
  319. * 00300000
  320. * 1. LOCATE THE ALOCBLOK FOR TDISK SPACE ON THE CHAIN FROM THE 00301000
  321. * RDEVBLOK WHOSE ADDRESS IS PASSED IN GPR8 00302000
  322. * 2. CALCULATE THE STARTING ADDRESS AND LENGTH OF THE BYTE 00303000
  323. * STRING THAT REPRESENTS THE CYLINDER ALLOCATION 00304000
  324. * 3. VERIFY THAT THE CYLINDERS ARE IN FACT ALLOCATED 00305000
  325. * 4. DE-ALLOCATE THE SPACE BY SETTING THE APPROPRIATE BYTES 00306000
  326. * TO ZERO 00307000
  327. * 5. EXIT TO THE CALLER 00308000
  328. * 5. ERASE TRACK 0 OF THE FIRST CYLINDER RETURNED 00309000
  329. * 6. EXIT TO CALLER 00310000
  330. *. 00311000
  331. EJECT 00312000
  332. DMKTDKRL RELOC 00313000
  333. LA R6,RDEVALLN POINT TO ALOCATION CHAIN ANCHOR 00314000
  334. SPACE 00315000
  335. FINDALLN L R6,ALOCPNT POINT TO NEXT ALOCBLOK ON CHAIN 00316000
  336. LTR R6,R6 LOOK FOR TDISK ALLOCATION 00317000
  337. BP FINDALLN STILL CHAINING PAGE ALLOCATION 00318000
  338. BM TDK1A FOUND IT 00319000
  339. ABEND 1 GPR8 MUST BE FOULED UP 00320000
  340. TDK1A EQU * 00321000
  341. SPACE 00322000
  342. CH R1,ALOCCYL1 CHECK RANGE OF THIS BLOK 00323000
  343. BL FINDALLN TOO LOW FOR THIS BLOCK 00324000
  344. CH R1,ALOCCYL2 ... 00325000
  345. BH FINDALLN TOO HIGH FOR THIS BLOK 00326000
  346. SPACE 00327000
  347. LR R2,R1 SAVE STARTING CYLINDER NUMBER 00328000
  348. SH R2,ALOCCYL1 GET RELATIVE CYLINDER NUMBER 00329000
  349. LA R7,ALOCMAP(R2) POINT TO BYTE FOR 1ST CYLINDER 00330000
  350. CLI 0(R7),X'AA' IS IT ALLOCATED ?? 00331000
  351. BNE NOTALLN NO -- DISASTER 00332000
  352. BCTR R0,R0 GET NUMBER OF CYLINDERS TO DEALLOCATE-1 00333000
  353. AR R1,R0 GET LAST CYLINDER TO DEALLOCATE 00334000
  354. CH R1,ALOCCYL2 IN THIS RANGE ?? 00335000
  355. BH NOTALLN NO -- DISASTER 00336000
  356. LTR R3,R0 ONLY ONE TO DE-ALLOCATE 00337000
  357. BZ DEALOCAT YES -- GO DO IT 00338000
  358. BCTR R3,0 GET NUMBER TO DEALLOCATE-2 00339000
  359. ST R7,SAVEWRK2 SAVE ALOCBLOK POINTER @VA03157 00340000
  360. LR R9,R3 SET REG FOR EXECUTE @VA03157 00341000
  361. DEALCCLC CL R9,F255 COMPARE GREATER THAN 256 CHARS @VA03157 00342000
  362. BNH DEACLCEX NO, GO COMPARE @VA03157 00343000
  363. L R10,F255 LOAD REG FOR MAX COMPARE LENGTH @VA03157 00344000
  364. EX R10,CKCYL GO COMPARE FOR MAX LENGTH @VA03157 00345000
  365. BNE NOTALLN NOT ALLOCATED @VA03157 00346000
  366. A R7,F256 INCREMENT POINTER BY MAX @VA03157 00347000
  367. S R9,F256 DECREMENT COMPARE LENGTH BY 256 @VA03157 00348000
  368. B DEALCCLC LOOP @VA03157 00349000
  369. DEACLCEX EX R9,CKCYL TEST FOR ALLOCATED CYLINDERS @VA03157 00350000
  370. BNE NOTALLN NOT ALLOCATED @VA03157 00351000
  371. L R7,SAVEWRK2 RESTORE ALOCBLOK POINTER @VA03157 00352000
  372. SPACE 00353000
  373. DEALOCAT MVI 0(R7),0 DEALLOCATE 1ST CYLINDER 00354000
  374. LTR R0,R0 ONLY ONE TO DO ?? 00355000
  375. BZ USECOUNT YES, UPDATE USE COUNT @VA04364 00356500
  376. DEALCMVC CL R3,F255 FLAG MORE THAN 256 @VA03157 00357000
  377. BNH DEAMVCEX NO, GO FLAG @VA03157 00358000
  378. EX R10,MOVEALLN FLAG MAXIMUM @VA03157 00359000
  379. A R7,F256 INCREMENT POINTER FOR FLAGGING @VA03157 00360000
  380. S R3,F256 DECREMENT FLAG LENGTH BY 256 @VA03157 00361000
  381. B DEALCMVC LOOP @VA03157 00362000
  382. DEAMVCEX EX R3,MOVEALLN DEALLOCATE REST OF CYS @VA03157 00363000
  383. USECOUNT LH R7,RDEVLNKS OBTAIN USE COUNT @VA04364 00363300
  384. BCTR R7,0 DECREMENT BY ONE @VA04364 00363600
  385. STH R7,RDEVLNKS STORE UPDATED COUNT @VA04364 00363900
  386. EJECT 00364000
  387. RLEXIT EQU * ERASE VIRTUAL CYLINDER 0, TRACK 0, FOR SECURITY 00365000
  388. LA R0,IOTASKSZ GET STORAGE FOR 00366000
  389. CALL DMKFREE AN IOBLOK AND CHANNEL PROGRAM 00367000
  390. LR R10,R1 USE STANDARD 00368000
  391. USING IOBLOK,R10 ADDRESSABILITY 00369000
  392. XC IOBLOK(IOTASKSZ*8),IOBLOK CLEAR THE BLOK TO 0 00370000
  393. MVI IOBFLAG,IOBCP AND FLAG IT AS A CP TASK 00371000
  394. L R0,SAVER1 GET STARTING CYLINDER 00372000
  395. STH R0,IOBCYL AND SAVE IN IOBLOK 00373000
  396. STH R0,IOCC AND AS SEEK ADDRESS 00374000
  397. CLI RDEVTYPE,TYP3340 3340 TYPE DEVICE ? @V2A2029 00375000
  398. BNE SETIOB NO -- CONTINUE @V2A2029 00376000
  399. TM RDEVFTR,FTR70MB 70MB DATA MODULE MOUNTED ? @V2A2029 00377000
  400. BZ *+8 NO -- GO @V2A2029 00378000
  401. NI IOBCYL+1,X'FE' QUEUE ON LOWEST LOGICAL CYL @V2A2029 00379000
  402. SETIOB LR R0,R13 SAVE GPR13 (SAVE AREA BASE) @V2A2029 00380000
  403. LR R1,R11 ADDRESS OF USER VMBLOK 00381000
  404. LA R2,TDKIRA GET ADDRESS FOR INTERRUPT RETURN 00382000
  405. LA R3,IOSEEK GET ADDRESS OF 1ST CCW 00383000
  406. STM R0,R3,IOBMISC ,IOBUSER, IOBIRA, AND IOBCAW 00384000
  407. LM R0,R9,SEEK PICK UP MODEL CCW'S 00385000
  408. ALR R0,R10 AND RELOCATE THEIR DATA ADDRESSES 00386000
  409. ALR R2,R10 .... 00387000
  410. ALR R4,R10 ... 00388000
  411. ALR R6,R10 .. 00389000
  412. ALR R8,R10 . 00390000
  413. STM R0,R9,IOSEEK SAVE CCW'S IN IOTASK 00391000
  414. LM R0,R3,TIC SET UP REMAINDER OF CHANNEL PROGRAM 00392000
  415. ALR R0,R10 ... 00393000
  416. ALR R2,R10 .. 00394000
  417. STM R0,R3,IOTIC . 00395000
  418. SPACE 00396000
  419. L R8,SAVER8 RESTORE ADDRESS OF RDEVBLOK 00397000
  420. CLI RDEVTYPE,TYP2314 IS THIS A 2314/2319 ? 00398000
  421. BNE *+8 NO -- SET SECTOR IS A LEGAL COMMAND 00399000
  422. MVI IOSS,X'03' NOP THE SET SECTOR 00400000
  423. MVI IOR1R,1 SET TO WRITE RECORD 1 00401000
  424. CALL DMKIOSQR AND START THE ERASE 00402000
  425. GOTO DMKDSPCH ... GO TO DISPATCH TO AWAIT THE INTERRUPT 00403000
  426. EJECT 00404000
  427. TDKIRA EQU * HERE WHEN THE I/O HAS FINISHED 00405000
  428. USING *,R12 TEMPORARY ADDRESSABILITY AT ENTRY 00406000
  429. SL R12,=A(TDKIRA-DMKTDK) RE-ESTABLISH 00407000
  430. USING DMKTDK,R12 STANDARD ADDRESSABILITY 00408000
  431. L R13,IOBMISC RESTORE ADDRESS OF SAVEAREA 00409000
  432. LA R0,IOTASKSZ GET SIZE OF TASK 00410000
  433. LR R1,R10 AND ITS ADDRESS 00411000
  434. CALL DMKFRET RETURN THE IOTASK TO FREE STORAGE 00412000
  435. EXIT AND RETURN TO CALLER .. 00413000
  436. SPACE 3 00414000
  437. NOTALLN ABEND 2 00415000
  438. EJECT 00416000
  439. * INSTRUCTIONS EXECUTED TO TEST AND SET ALLOCATION 00417000
  440. SPACE 00418000
  441. CKCYL CLC 0(*-*,R7),1(R7) TEST FOR UNALLOCATED CYLINDERS 00419000
  442. SPACE 00420000
  443. MOVEALLN MVC 1(*-*,R7),0(R7) ALLOCATE/DEALLOCATE CYLINDERS 00421000
  444. SPACE 2 00422000
  445. * MODEL CHANNEL PROGRAM TO ERASE CYLINDER 0, TRACK 0 OF TDISK AREA 00423000
  446. SPACE 00424000
  447. SEEK CCW X'07',IOBB-IOBLOK,CC+SILI,6 SEEK 00425000
  448. SFM CCW X'1F',IOBB-IOBLOK,CC+SILI,1 SET FILE MASK 00426000
  449. RR0 CCW X'16',IOCC-IOBLOK,CC+SILI,4 READ RECORD 0 00427000
  450. SS CCW X'23',IOSS-IOBLOK+7,CC+SILI,1 SET SECTOR 1 00428000
  451. SRCHID CCW X'31',IOCC-IOBLOK,CC+SILI,5 SEARCH ID =, RECORD 0 00429000
  452. TIC CCW X'08',IOSRCHID-IOBLOK,0,0 TIC 00430000
  453. WR1 CCW X'1D',IOREC1-IOBLOK,SILI,8 WRITE CKD, RECORD 1 00431000
  454. LTORG 00432000
  455. EJECT 00433000
  456. COPY ALLOC 00434000
  457. COPY SAVE 00435000
  458. COPY RBLOKS 00436000
  459. COPY IOBLOKS 00437000
  460. IOBLOK DSECT CONTINE THE IOBLOK DSECT 00438000
  461. ORG , MAKE SURE WE'RE AT THE END @V200820 00439000
  462. IOCCWS DS 7D DEFINE SPACE FOR ERASE CHANNEL PROGRAM 00440000
  463. ORG IOCCWS DEFINE THE CCWS 00441000
  464. IOSEEK DS D SEEK 00442000
  465. IOSFM DS D SET FILE MASK - ALLOW FORMAT WRITES 00443000
  466. IORR0 DS D READ RECORD 0 TO OBTAIN REAL CYLINDER 00444000
  467. IOSS DS D SET SECTOR 3330/40/50/75/80/2305 HRC106DK 00445100
  468. IOSRCHID DS D SEARCH ID EQUAL ON RECORD 0 00446000
  469. IOTIC DS D TRANSFER IN CHANNEL UNTIL SEARCH = 00447000
  470. IOWR1 DS D WRITE RECORD 1, ERASE REST OF TRACK 00448000
  471. IODATA DS 2D DEFINE SPACE FOR SEARCH DATA AND REC. 1 00449000
  472. ORG IODATA DEFINE THE DATA FIELDS 00450000
  473. IOBB DS H BIN NUMBER 00451000
  474. IOCC DS H CYLINDER NUMBER 00452000
  475. IOHHR DS 3X HEAD AND RECORD FOR SEARCH 00453000
  476. DS X UNUSED 00454000
  477. IOREC1 DS D COUNT FIELD FOR RECORD 1 00455000
  478. ORG IOREC1 00456000
  479. IOR1CC DS H CYLINDER 00457000
  480. IOR1HH DS H HEAD 00458000
  481. IOR1R DS X RECORD 00459000
  482. IOR1KL DS X KEY LENGTH 00460000
  483. IOR1DL DS H DATA LENGTH (= 0) 00461000
  484. IOTASKSZ EQU (*-IOBLOK)/8 TASK SIZE IN DOUBLE WORDS 00462000
  485. EJECT 00463000
  486. PSA 00464000
  487. COPY EQU 00465000
  488. COPY DEVTYPES 00466000
  489. END 00467000