User Tools

Site Tools


ibm:vm370-lib:cp:dmkfre.assemble_src

DMKFRE Source

References

Source Listing

DMKFRE.ASSEMBLE.txt
  1. FRE TITLE 'DMKFRE (CP) VM/370 - RELEASE 6' 00001000
  2. ISEQ 73,80 VALIDATE SEQUENCING OF SOURCE @VA00881 00002000
  3. * 00003000
  4. *. 00004000
  5. * MODULE NAME - 00005000
  6. * 00006000
  7. * DMKFRE 00007000
  8. * 00008000
  9. * CONTENTS - 00009000
  10. * 00010000
  11. * DMKFREE - GET A SUBPOOL OR OTHER BLOCK FROM FREE STORAGE 00011000
  12. * DMKFRERC - GET A SUBPOOL OR OTHER BLOCK FROM FREE STORAGE 00012000
  13. * AND RETURN A CC=1 TO THE CALLER IF THE REQUEST 00013000
  14. * CANNOT BE SATISFIED. 00014000
  15. * DMKFRET - RETURN A SUBPOOL OR OTHER BLOCK TO FREE STORAGE 00015000
  16. * DMKFRETR - RETURN A BLOCK TO FREE STORAGE (IGNORING SUBPOOLS) 00016000
  17. * DMKFRERS - RETURN ALL SUBPOOLS TO FREE STORAGE CHAIN 00017000
  18. EJECT 00018000
  19. * SUBROUTINE NAME - 00019000
  20. * 00020000
  21. * DMKFREE 00021000
  22. * 00022000
  23. * FUNCTION - 00023000
  24. * 00024000
  25. * TO PROVIDE THE CALLER WITH A FREE STORAGE BLOCK, EITHER 00025000
  26. * FROM A SUBPOOL, FOR SMALL-SIZE BLOCKS, OR 00026000
  27. * FROM A CHAINED LIST, FOR LARGER BLOCKS. 00027000
  28. * 00028000
  29. * ATTRIBUTES - 00029000
  30. * 00030000
  31. * SERIALLY REUSABLE, RESIDENT, CALLED VIA BALR 00031000
  32. * 00032000
  33. * ENTRY POINT - 00033000
  34. * 00034000
  35. * DMKFREE/DMKFRERC 00035000
  36. * 00036000
  37. * ENTRY CONDITIONS - 00037000
  38. * 00038000
  39. * GPR 0 = NUMBER OF DOUBLE WORDS REQUESTED 00039000
  40. * GPR 14 = RETURN ADDRESS 00040000
  41. * GPR 15 = ADDRESS OF DMKFREE 00041000
  42. * 00042000
  43. * EXIT CONDITIONS - 00043000
  44. * 00044000
  45. * DMKFREE 00045000
  46. * 00046000
  47. * GPR 0 = UNCHANGED (= NUMBER OF DOUBLE WORDS REQUESTED) 00047000
  48. * GPR 1 = ADDRESS OF FIRST DOUBLE-WORD OF BLOCK SUPPLIED 00048000
  49. * ALL OTHER GPR'S UNCHANGED 00049000
  50. * 00050000
  51. * DMKFRERC IF FREE STORAGE REQUEST COULD NOT BE SATISFIED. 00051000
  52. * 00052000
  53. * GPR 0 = UNCHANGED (= NUMBER OF DOUBLE WORDS REQUESTED) 00053000
  54. * GPR 1 = X'00FFFFFF' 00054000
  55. * ALL OTHER GPR'S UNCHANGED 00055000
  56. * 00056000
  57. * CALLS TO OTHER ROUTINES - 00057000
  58. * 00058000
  59. * DMKPTRFR - CALLED TO OBTAIN A PAGE FROM DYNAMIC PAGING AREA 00059000
  60. * IF IT IS NECESSARY TO CALL DMKPTRFR TO OBTAIN A 00060000
  61. * PAGE FROM THE DYNAMIC PAGING AREA AND DMKFRE WAS 00061000
  62. * ENTERED AT ENTRY POINT DMKFRERC, DMKPTRFR WILL 00062000
  63. * BE CALLED WITH 'PARM = 2' TO INDICATE THAT IF 00063000
  64. * A PAGE CANNOT BE OBTAINED, A CC=1 SHOULD BE 00064000
  65. * RETURNED TO DMKFRE INSTEAD OF ABENDING VM/370 00065000
  66. * WITH A PTR07. DMKFRE WILL THEN RETURN THE SAME 00066000
  67. * CONDITION CODE TO THE CALLER SO THAT AN APPROPRIATE 00067000
  68. * ERROR MESSAGE CAN BE ISSUED. 00068000
  69. * 00069000
  70. * EXTERNAL REFERENCES - 00070000
  71. * 00071000
  72. * DMKDSPNP - NUMBER OF PAGES AVAILABLE FOR PAGING USE 00072000
  73. * 00073000
  74. * TABLES / WORK AREAS - 00074000
  75. * 00075000
  76. * FREESAVE (16 WORDS) USED TO SAVE REGISTERS 00076000
  77. * FREEWORK (UP TO 12 WORDS) USED FOR SCRATCH STORAGE 00077000
  78. EJECT 00078000
  79. * REGISTER USAGE - 00079000
  80. * 00080000
  81. * GPR 0 - 10 = WORK REGISTERS 00081000
  82. * GPR 11 IS NOT USED 00082000
  83. * GPR 12 = MODULE BASE REGISTER 00083000
  84. * GPR 13 - 15 = WORK REGISTERS 00084000
  85. * 00085000
  86. * NOTES - 00086000
  87. * 00087000
  88. * BLOCK SIZES OF 30 DOUBLE WORDS OR LESS ARE GROUPED INTO TEN 00088000
  89. * SUBPOOL SIZES, OF 3, 6, ..., 30 DOUBLE WORDS (MULTIPLES OF 3) 00089000
  90. * AND ARE HANDLED BY LIFO (PUSH DOWN STACK) LOGIC. POINTERS 00090000
  91. * AT "SUBTABLE" POINT TO THE VARIOUS AVAILABLE SUBPOOLS. 00091000
  92. * 00092000
  93. * BLOCK SIZES OF GREATER THAN 30 DOUBLE WORDS ARE STRUNG OFF 00093000
  94. * A CHAINED LIST. "DMKFRELS" POINTS TO THE FIRST BLOCK IN THE 00094000
  95. * LIST, AND "FREENUM" CONTAINS THE NUMBER OF BLOCKS IN THE LIST. 00095000
  96. * 00096000
  97. * OPERATION - 00097000
  98. * 00098000
  99. * 1. THE NUMBER OF DOUBLE WORDS REQUESTED IS CHECKED. IF A 00099000
  100. * ZERO OR NEGATIVE VALUE IS FOUND (INDICATING A SERIOUS CODING 00100000
  101. * ERROR), AN ABEND OCCURS VIA SVC 0. OTHERWISE, PROCEEDS TO 00101000
  102. * STEP 2 FOR SUBPOOL SIZES (30 DOUBLE WORDS OR LESS), 00102000
  103. * OR TO STEP 3 FOR LARGER SIZES (> 30 DOUBLE WORDS). 00103000
  104. * 00104000
  105. * 2. THE APPROPRIATE SUBPOOL FOR THE REQUESTED SIZE IS 00105000
  106. * CHECKED TO SEE IF THERE IS AT LEAST ONE BLOCK AVAILABLE. 00106000
  107. * 00107000
  108. * IF ONE IS AVAILABLE, THE FIRST ONE (POINTED TO BY "SUBTABLE") 00108000
  109. * IS REMOVED FROM THE SUBPOOL TO BE RETURNED TO THE CALLER, 00109000
  110. * AND THE POINTER AT "SUBTABLE" IS CHANGED TO POINT TO THE 00110000
  111. * NEXT AVAILABLE SUBPOOL BLOCK OF THE SAME SIZE (IF ANY). 00111000
  112. EJECT 00112000
  113. * OPERATION (CONTINUED) - 00113000
  114. * 00114000
  115. * 2. (CONTINUED) - NO SUBPOOL AVAILABLE: 00115000
  116. * 00116000
  117. * IF THERE IS NO SUITABLE BLOCK FOR THE SUBPOOL SIZE REQUESTED, 00117000
  118. * THEN THE CHAINED LIST OF FREE STORAGE IS SEARCHED FOR A BLOCK 00118000
  119. * OF EQUAL OR LARGER SIZE. THE FIRST BLOCK OF LARGER OR EQUAL 00119000
  120. * SIZE IS USED TO SATISFY THE CALL (AN EQUAL-SIZE BLOCK TAKING 00120000
  121. * PRIORITY), EXCEPT THAT EQUAL OR LARGER BLOCKS PREVIOUSLY 00121000
  122. * OBTAINED FROM THE DYNAMIC PAGING AREA ARE AVOIDED IF AT ALL 00122000
  123. * POSSIBLE. IF AN EQUAL BLOCK IS FOUND, IT IS DETACHED FROM 00123000
  124. * THE CHAIN AND RETURNED TO THE CALLER. IF A LARGER ONE MUST 00124000
  125. * BE USED, THE LOW-NUMBERED END IS SPLIT OFF AND RETURNED TO 00125000
  126. * THE CALLER. IF NO EQUAL OR LARGER BLOCK IS FOUND, THEN 00126000
  127. * A CHECK IS MADE TO SEE IF ANY LARGER SUBPOOL BLOCK (STARTING 00127000
  128. * WITH THE LARGEST SIZE OF 30 DOUBLE WORDS AND WORKING DOWNWARD) 00128000
  129. * CAN BE SPLIT UP INTO THE SIZE REQUESTED AND ANOTHER SUBPOOL 00129000
  130. * SIZE. IF ONE IS FOUND, THE LARGER BLOCK IS DETACHED FROM ITS 00130000
  131. * SUBPOOL AND SPLIT. THE REQUESTED BLOCK IS RETURNED TO THE 00131000
  132. * CALLER, AND THE REMAINING BLOCK IS ATTACHED TO THE APPROPRIATE 00132000
  133. * SUBPOOL AT "SUBTABLE". IF THIS EFFORT FAILS, THEN 00133000
  134. * DMKPTRFR IS CALLED TO OBTAIN ANOTHER PAGE FROM THE 00134000
  135. * DYNAMIC PAGING AREA (WHICH IS MERGED INTO THE CHAIN 00135000
  136. * OF FREE STORAGE), AND STEP 2 IS THEN REPEATED 00136000
  137. * (FROM THE BEGINNING) TO OBTAIN THE NEEDED BLOCK. 00137000
  138. * 00138000
  139. * 3. CALL TO DMKFREE FOR A LARGE BLOCK (> 30 DOUBLE WORDS): 00139000
  140. * 00140000
  141. * WHEN DMKFREE IS CALLED FOR A LARGE BLOCK, THE CHAINED LIST OF 00141000
  142. * FREE STORAGE IS SEARCHED FOR A BLOCK OF EQUAL OR LARGER SIZE. 00142000
  143. * IF AN EQUAL SIZE BLOCK IS FOUND, IT IS DETACHED FROM THE CHAIN 00143000
  144. * AND GIVEN TO THE CALLER, UNLESS IF FALLS WITHIN THE DYNAMIC 00144000
  145. * PAGING AREA; IN THIS CASE, ITS ADDRESS IS REMEMBERED FOR 00145000
  146. * LATER USE IF NECESSARY, AND THE SCAN IS RESUMED FOR AN 00146000
  147. * EQUAL OR LARGER BLOCK NOT WITHIN THE DYNAMIC PAGING AREA. 00147000
  148. * UPON COMPLETION OF THE SCAN, IF AT LEAST ONE LARGER BLOCK WAS 00148000
  149. * FOUND, IF IT FELL WITHIN THE DYNAMIC PAGING AREA AND AN EQUAL 00149000
  150. * BLOCK WAS ALSO FOUND THEREIN, THE EQUAL BLOCK IS USED. OTHER- 00150000
  151. * WISE, THE DESIRED BLOCK SIZE IS SPLIT OFF THE HIGH NUMBERED 00151000
  152. * END OF THE LAST LARGER BLOCK FOUND, AND GIVEN TO THE CALLER. 00152000
  153. * IF NO EQUAL OR LARGER BLOCK IS FOUND, THEN DMKPTRFR IS CALLED 00153000
  154. * TO OBTAIN ANOTHER PAGE FROM THE DYNAMIC PAGING AREA (WHICH 00154000
  155. * IS MERGED INTO THE CHAIN OF FREE STORAGE), AND STEP 3 IS 00155000
  156. * THEN REPEATED TO OBTAIN THE NEEDED BLOCK. 00156000
  157. *. 00157000
  158. EJECT 00158000
  159. MACRO 00159000
  160. &LABEL INCR &COUNT 00160000
  161. &LABEL LA R14,1 00161000
  162. AL R14,&COUNT 00162000
  163. ST R14,&COUNT 00163000
  164. MEND 00164000
  165. * 00165000
  166. MACRO 00166000
  167. DECR &COUNT 00167000
  168. L R14,&COUNT 00168000
  169. BCTR R14,0 00169000
  170. ST R14,&COUNT 00170000
  171. MEND 00171000
  172. EJECT 00172000
  173. COPY OPTIONS 00173000
  174. COPY LOCAL 00174000
  175. DMKFRE CSECT 00175000
  176. ENTRY DMKFREE OBTAIN A SUBPOOL OR REGULAR BLOCK 00176000
  177. ENTRY DMKFRET RETURN A SUBPOOL OR REGULAR BLOCK 00177000
  178. ENTRY DMKFRETO TOTAL FREE STORAGE IN DBL WORDS @V408246 00178000
  179. ENTRY DMKFRETR RETURN A REGULAR BLOCK (IGNORE SUBPOOLS) 00179000
  180. * 00180000
  181. ENTRY DMKFRELG EXTERNAL-NAME FOR "LRGSTSIZ" 00181000
  182. ENTRY DMKFRELS START OF REGULAR FREE-STORAGE CHAIN 00182000
  183. ENTRY DMKFRELO SET TO END OF LOW-CORE AREA 00183000
  184. ENTRY DMKFREHI SET TO BEGINNING OF HIGH-CORE AREA 00184000
  185. ENTRY DMKFRENP NAME FOR "NPAGFREE" & "NPAGFRET" @VA00881 00185000
  186. ENTRY DMKFRESV SAVE-AREA FOR USE WHEN CALLING DMKPTRFR 00186000
  187. ENTRY DMKFREST SUBTABLE... POINTERS TO SUBPOOLS @VA14280 00187000
  188. ENTRY DMKFREMX MAXSIZE... FOR CP ASSIST USE @VA14280 00187500
  189. ENTRY DMKFRETL ALSO FOR USE BY THE CP ASSIST @V386198 00188000
  190. ENTRY DMKFREAP BACK POCKET FOR AP MODE EXTEND @V407594 00189000
  191. * 00190000
  192. EXTRN DMKPTRFR CALLED WHEN ANOTHER PAGE IS NEEDED 00191000
  193. EXTRN DMKPTRFT CALLED TO RETURN PAGE(S) TO CP 00192000
  194. EXTRN DMKCPE END OF CP NUCLEUS 00193000
  195. EXTRN DMKSYSRM SIZE OF REAL MACHINE 00194000
  196. EXTRN DMKDSPNP NUMBER OF PAGES AVAILABLE FOR PAGING USE 00195000
  197. EXTRN DMKQCNFT,DMKVCNFT @VA05235 00196000
  198. EXTRN DMKSTKLF STACK CPEXBLOK LIFO ENTRY @V407594 00197000
  199. AIF (NOT &AP).DSPRU3 00198000
  200. EXTRN DMKDSPRU UNLOCKED ENTRY TO DISPATCHER @V407594 00199000
  201. .DSPRU3 ANOP 00200000
  202. AIF (NOT &VIRREAL).NOVR1 00201000
  203. EXTRN DMKSLC 00202000
  204. .NOVR1 ANOP 00203000
  205. * 00204000
  206. USING PSA,R0 FOR ALL ENTRANCES 00205000
  207. * 00206000
  208. *********************************************************************** 00207000
  209. * 00208000
  210. * SUBPOOL BLOCKS APPEAR AS FOLLOWS --- 00209000
  211. * 00210000
  212. * DS 1F POINTER TO NEXT SUBPOOL BLOCK OF SAME SIZE 00211000
  213. * 00212000
  214. * EACH GROUP OF SUBPOOL BLOCKS OF THE SAME SIZE IS 00213000
  215. * STRUNG OFF AN INITIAL POINTER (SEE 'SUBTABLE') 00214000
  216. * 00215000
  217. *********************************************************************** 00216000
  218. * 00217000
  219. *********************************************************************** 00218000
  220. * * 00219000
  221. * ALL OTHER FREE STORAGE BLOCKS APPEAR AS FOLLOWS --- 00220000
  222. * * 00221000
  223. * DS 1F POINTER TO NEXT FREE STORAGE BLOCK * 00222000
  224. * DS 1F SIZE (IN BYTES) OF THIS BLOCK. * 00223000
  225. * * 00224000
  226. * ALL BLOCKS ARE STRUNG OFF DMKFRELS IN ORDER OF ASCENDING * 00225000
  227. * CORE ADDRESSES. * 00226000
  228. * * 00227000
  229. *********************************************************************** 00228000
  230. * 00229000
  231. PNTR EQU 0 POINTER TO NEXT BLOCK. 00230000
  232. SIZE EQU 4 SIZE OF THIS BLOCK. 00231000
  233. EJECT 00232000
  234. *********************************************************************** 00233000
  235. * * 00234000
  236. * "FREE" IS CALLED AS FOLLOWS --- * 00235000
  237. * * 00236000
  238. * LA 0,NDBLWRDS NUMBER OF DOUBLE WORDS DESIRED. * 00237000
  239. * CALL DMKFREE .. * 00238000
  240. * * 00239000
  241. *********************************************************************** 00240000
  242. *. 00241000
  243. *********************************************************************** 00242000
  244. * 00243000
  245. * 00244000
  246. * CP ASSIST INSTRUCTION "FREEX" 00245000
  247. * - OBTAIN SUBPOOL SIZE FREE SPACE (EXTENDED) 00245500
  248. * 00246000
  249. * 00247000
  250. * OPERANDS: 00248000
  251. * 1 = ADDRESS OF 'MAXSIZE' FOLLOWED BY 'SUBTABLE' 00249100
  252. * 2 = ADDRESS OF ONE LESS THAN 'BYTBL' 00250000
  253. * 00251000
  254. * REGISTER INPUT: 00252000
  255. * GPR 0 = A SIGNED 32 BIT INTEGER SPECIFYING THE NUMBER OF 00253000
  256. * DOUBLEWORDS OF FREE SPACE REQUESTED 00254000
  257. * GPR 11 = ADDRESS OF THE REQUESTOR'S VMBLOK 00255000
  258. * GPR 14 = EXIT ADDRESS 00256000
  259. * 00257000
  260. * SYSTEM DATA AREAS REFERENCED (BY MODULE): 00258000
  261. * DMKFRE - 'BYTBL', 'MAXSIZE', AND 'SUBTABLE' 00259100
  262. * DMKPSA - TRACING INFORMATION, ALOKFR, LPUADDR 00260000
  263. * 00261000
  264. * 00262000
  265. * EXITS: 00263000
  266. * 00264000
  267. * 1. ADDRESS IN GPR 14 (NORMAL COMPLETION) 00265000
  268. * 00266000
  269. * REGISTER OUTPUT: 00267000
  270. * GPR 1 = ADDRESS OF THE FREE SPACE OBTAINED 00268000
  271. * 00269000
  272. * 2. NEXT SEQUENTIAL INSTRUCTION (ABNORMAL COMPLETION) 00270000
  273. * 00271000
  274. * NOTE: THIS EXIT IS FUNCTIONALLY EQUIVALENT TO A NO-OP. 00272000
  275. * 00272090
  276. * NOTE: 00272180
  277. * 00272270
  278. * THE GET FREE SPACE EXTENDED (X'E614') INSTRUCTION IS 00272360
  279. * SUPPORTED ONLY UNDER ECPS:VM LEVEL 20. IT ALLOWS FOR 00272450
  280. * A VARIABLE NUMBER OF VARIABLE SIZE SUBPOOLS. 00272540
  281. * IF VM/370 IS IPLED ON A MACHINE THAT HAS ECPS:VM LEVEL 18 00272630
  282. * OR 19, DMKCPI WILL ALTER THE X'E614' INSTRUCTION IN 00272720
  283. * DMKFRE BACK TO THE OLD-STYLE X'E600' INSTRUCTION DURING 00272810
  284. * THE IPL OF VM/370. 00272900
  285. * 00273000
  286. *********************************************************************** 00274000
  287. *. 00275000
  288. SPACE 00276000
  289. USING DMKFREE,R15 - UPON ENTRY ONLY... @V3M4038 00277000
  290. DMKFREE DS 0D ENTER "FREE" @V3M4038 00278000
  291. SPACE 00279000
  292. DS 0H EXECUTE CP ASSIST "FREEX" @VA14280 00280000
  293. * NOTE THE FOLLOWING CHANGED TO X'E600',S(SUBTABLE,BYTBL-1) 00280500
  294. * IF RUNNING BELOW ECPS LEVEL 20. 00281000
  295. DC X'E614',S(MAXSIZE,BYTBL-1) %VA14280 00281500
  296. SPACE 00282000
  297. STM R0,R15,FREESAVE - SAVE REGISTERS %V3M4038 00283000
  298. LR R12,R15 ADDRESSABILITY IN R12, PLEASE %V3M4038 00284000
  299. DROP R15 ESTABLISH NORMAL ADDRESSABILITY %V3M4038 00285000
  300. USING DMKFREE,R12 - FOR ALL ENTRIES %V3M4038 00286000
  301. SPACE 00287000
  302. DMKFREEB DS 0H %VA07369 00288000
  303. AIF (NOT &AP).NOAP1 **AIF*** 00289000
  304. BAL R14,LOCKFRE LOCK DMKFRE %VA07369 00290000
  305. * NOP IN UP MODE.. %VA07369 00290100
  306. .NOAP1 ANOP **ANOP** 00291000
  307. LTR R2,R0 NO. DBL WORDS REQUESTED %V407594 00292000
  308. BNP ERROR6 ERROR IF NOT PLUS AND NONZERO. %V3M4038 00293000
  309. AIF (NOT &FRETRAP).NOFTR1 HRC035DK 00293200
  310. LA R2,1(,R2) ADD ONE MORE DOUBLE WORD HRC035DK 00293400
  311. .NOFTR1 ANOP , HRC035DK 00293600
  312. LM R7,R9,ADCONFRE INITIALIZE R7-R9 FOR 'FREE' USE %V3M4038 00294000
  313. SPACE 00295000
  314. CHEKSIZE CL R2,MAXSIZE IS SIZE WITHIN SUBPOOL RANGE ? %V3M4038 00296000
  315. BHR R8 NO, USE REGULAR FREE/FRET LOGIC %V3M4038 00297000
  316. IC R7,BYTBL-1(R2) ELSE, GET SUBPOOL SIZE VALUE %V3M4038 00298000
  317. BR R9 AND GO TO 'FREESUB' OR 'FRETSUB' %V3M4038 00299000
  318. SPACE 2 00300000
  319. ENTRY DMKFRERC @V407466 00301000
  320. DMKFRERC STM R0,R15,FREESAVE ENTER - SAVE REGISTERS @V407466 00302000
  321. L R12,AFREE COMMON ADDRESSABILITY NEEDED @V407466 00303000
  322. USING DMKFRE,R12 ... @V407466 00304000
  323. B DMKFREEB GO TO COMMON FREE STORAGE LOGIC @V407466 00305000
  324. FREESUB DS 0H SIZE IS IN SUBPOOL TABLE RANGE %V3M4038 00306000
  325. L R1,SUBTABLE(R7) LOAD POINTER INTO R1, %V3M4038 00307000
  326. LTR R1,R1 ANYTHING AVAILABLE ? %V3M4038 00308000
  327. BZ FREE02 NO, MUST GET SUBPOOL-SIZE BLOCK. %V3M4038 00309000
  328. L R14,PNTR(,R1) PATCH POINTER TO NEW SUBTABLE %V3M4038 00310000
  329. ST R14,SUBTABLE(R7) ... %V3M4038 00311000
  330. ST R1,GPR1 STORE FOR RETURNING R1 TO CALLER %V3M4038 00312000
  331. AIF (NOT &FRETRAP).NOFTR2 HRC035DK 00313090
  332. L R15,SUBSIZES(R7) SET TO FULL SUBPOOL SIZE HRC035DK 00313180
  333. SLL R15,3 ... HRC035DK 00313270
  334. B FREE20CN ,,, HRC035DK 00313360
  335. .NOFTR2 ANOP , HRC035DK 00313450
  336. SPACE , HRC035DK 00313540
  337. FREE20 DS 0H EXIT HERE FROM FREE. %V3M4038 00314000
  338. L R15,FREEWORK GET THE FULL SUBPOOL/BLOCK SIZE HRC035DK 00314050
  339. AIF (NOT &FRETRAP).NOFTR3 HRC035DK 00314100
  340. SPACE , HRC035DK 00314150
  341. *** FILL BLOCK WITH X'EEEEEEEE'S HRC035DK 00314200
  342. *** MOVE TRAP DATA INTO FIRST WORD AFTER REQUESTED STORAGE HRC035DK 00314250
  343. *** AND CALLER'S R14 + LENGTH, FROM R0 INTO THE LAST WORD HRC035DK 00314300
  344. SPACE , HRC035DK 00314350
  345. FREE20CN DS 0H HRC035DK 00314400
  346. L R14,GPR1 POINT TO FREE STORAGE HRC035DK 00314450
  347. L R2,FREER0 GET ORIGINAL STORAGE REQUEST HRC035DK 00314500
  348. SLL R2,3 CONVERT TO BYTES FROM DWORDS HRC035DK 00314550
  349. AR R2,R14 POINT TO THE END OF THE BLOCK HRC035DK 00314600
  350. L R1,=X'EE000000' PAD BLOCK WITH EEEEEEEEEES HRC035DK 00314650
  351. MVCL R14,R0 DO IT NOW HRC035DK 00314700
  352. L R3,=X'9AC7E5D5' SETUP TRAP DATA HRC035DK 00314750
  353. L R4,FREER14 CALLERS RETURN REGISTER HRC035DK 00314800
  354. ICM R4,B'1000',FREER0+3 INCLUDE COUNT IN DWORDS HRC035DK 00314850
  355. STM R3,R4,0(R2) SAVE SPECIAL CONSTANT AND RETURN HRC035DK 00314900
  356. .NOFTR3 ANOP , HRC035DK 00314950
  357. AIF (NOT &TRACE(9)).TR1 %V3M4038 00315000
  358. TM TRACFLG1,TRAC67 TRACING ACTIVE? %V3M4038 00316000
  359. BZ NOFREETR BRANCH IF NOT %V3M4038 00317000
  360. TRACE CODE=TRCFREE,R15,R14,R1 OBTAIN TRACE TBL SLOT %V407594 00318000
  361. STCM R11,B'0111',1(R15) VMBLOK OF CALLER @V407594 00319000
  362. L R14,FREER0 SAVE GPR0 %V3M4038 00320000
  363. ST R14,4(,R15) ... %V3M4038 00321000
  364. L R14,FREER1 SAVE GPR1 %V3M4038 00322000
  365. ST R14,8(,R15) ... %V3M4038 00323000
  366. L R14,FREER14 SAVE GPR14 %V3M4038 00324000
  367. ST R14,12(,R15) ... %V3M4038 00325000
  368. NOFREETR EQU * %V3M4038 00326000
  369. .TR1 ANOP %V3M4038 00327000
  370. AIF (NOT &AP).NOAP2 **AIF*** 00328000
  371. BAL R14,RELFRE RELEASE DMKFRE LOCK %V407594 00329000
  372. .NOAP2 ANOP **ANOP** 00330000
  373. CLC FREER15+1(3),AFRERC+1 ENTERED AT DMKFRERC %V407594 00331000
  374. BNE EXIT NO, NORMAL EXIT %V4M0157 00332000
  375. CLI FREER1,X'FF' CALL TO PAGE FREE FAILED? @V407466 00333000
  376. BNE EXIT2 NO, EXIT NORMALLY - CC=0 @V407466 00334000
  377. LNR R7,R12 SET CC=1 -- MUST BE COND.CC EQ 1 @VA09450 00335000
  378. EXIT LM R0,R15,FREESAVE RESTORE REGISTERS %V407466 00336000
  379. BR R14 RETURN %V407466 00337000
  380. EXIT2 CLI F0,X'00' SET CC=0 FOR NORMAL EXIT @V407466 00338000
  381. B EXIT EXIT WITH CC=0 TO CALLER @V407466 00339000
  382. EJECT 00340000
  383. FRETSUB DS 0H SIZE IS IN SUBPOOL TABLE RANGE %V3M4038 00341000
  384. CL R1,DMKFREHI ARE WE IN HIGH-CORE FREE AREA ? %V3M4038 00342000
  385. BNL FRET19 YES - GO RETURN BLOCK TO CHAIN. %V3M4038 00343000
  386. CL R1,DMKFRELO OR IN THE LOWER-CORE FREE AREA ? 00344000
  387. BNL FRET21 NOT < DMKFRELO, RETURN TO THE CHAIN. 00345000
  388. L R15,SUBSIZES(R7) BEGINNING OF BLOCK < DMKFRELO, 00346000
  389. SLL R15,3 COMPUTE THE END OF THE BLOCK 00347000
  390. ALR R15,R1 ... 00348000
  391. CL R15,DMKFRELO DOES THAT OVERLAP DMKFRELO ? 00349000
  392. AIF (&VIRREAL).TRC6B @VA00881 00350000
  393. BNH FRET19 NOPE - WE'RE OK. 00351000
  394. AGO .TRC6C @VA00881 00352000
  395. .TRC6B BH FRET21 YES - TOO BAD (IN DYNAMIC PAGING AREA) 00353000
  396. CL R1,=A(DMKSLC) BEWARE OF BLOCK IN UNLOCKED V=R @VA00881 00354000
  397. * AREA 00355000
  398. BNL FRET19 IF NOT BELOW "DMKSLC", IT'S OK. @VA00881 00356000
  399. .TRC6C ANOP SUBPOOL-SIZE BLOCK IS IN DYNAMIC PAGING AREA: 00357000
  400. FRET21 L R2,SUBSIZES(R7) SIZE (IN DOUBLE WORDS) MUST BE @VA00881 00358000
  401. * IN R2 00359000
  402. INCR SBFRTREG BUMP COUNT OF HOW MANY TIMES OCCURRED 00360000
  403. B FRET01 GO USE REGULAR FRET LOGIC. @V3M4038 00361000
  404. * 00362000
  405. FRET19 DS 0H OK TO RETURN CHUNK TO SUBPOOL: %V3M4038 00363000
  406. L R14,SUBTABLE(R7) GET PNTR (MAY = 0) FROM TABLE %V3M4038 00364000
  407. CLR R1,R14 FRET'D BLOCK MATCH 1ST ON CHAIN? %V3M4038 00365000
  408. BE ERROR8 IF YES, A CODING ERROR BY CALLER %V3M4038 00366000
  409. CL R1,0(,R14) FRET'D BLOCK MATCH 2ND ON CHAIN? %V3M4038 00367000
  410. * (HARMLESS COMPARE IF R14 = 0) 00368000
  411. BE ERROR9 IF YES, ALSO A CODING ERROR %V3M4038 00369000
  412. SPACE 00370000
  413. FRET19OK ST R14,PNTR(,R1) PUT OLD POINTER IN FRET'D BLOCK, %V3M4038 00371000
  414. ST R1,SUBTABLE(R7) POINTER TO US REPLACES OLD PNTR %V3M4038 00372000
  415. SPACE 00373000
  416. FRET20 DS 0H EXIT HERE FROM FRET. %V3M4038 00374000
  417. AIF (NOT &AP).NOAP3 **AIF*** 00375000
  418. * NOP IN UP MODE %V4M0198 00375100
  419. BAL R14,RELFRE RELEASE DMKFRE LOCK %V4M0198 00376000
  420. .NOAP3 ANOP **ANOP** 00377000
  421. LM R0,R15,FREESAVE RESTORE REGISTERS %V3M4038 00378000
  422. BR R14 %V3M4038 00379000
  423. SPACE 2 00380000
  424. ERROR8 ABEND 8 FRET'D BLOCK MATCHED 1ST SUBPOOL BLOCK 00381000
  425. SPACE 2 00382000
  426. ERROR9 LTR R14,R14 CHECK "SECOND SUBPOOL BLOCK" ... 00383000
  427. BZ FRET19OK IF NONEXISTENT, IT'S ALL OK. 00384000
  428. ABEND 9 FRET'D BLOCK MATCHED 2ND SUBPOOL BLOCK 00385000
  429. EJECT 00386000
  430. * "REGULAR" FREE LOGIC ENTERED AT "FREE01" 00387000
  431. * GET A BLOCK FROM HIGH-NUMBERED END OF LAST LARGER BLOCK 00388000
  432. * (UNLESS LUCKY ENOUGH TO FIND EXACT MATCH) 00389000
  433. * 00390000
  434. FREE01 DS 0H HERE IF BLOCK > LARGEST SUBPOOL SIZE: 00391000
  435. CL R2,LRGSTSIZ NEW VALUE OF "LARGEST SIZE" ? @VA01089 00392000
  436. BNH *+8 NO @VA01089 00393000
  437. ST R2,LRGSTSIZ STORE LARGEST SIZE REQUESTED @VA01089 00394000
  438. LA R7,FREE16 SET R7 TO CALL PAGE-FREE IF RUN OUT OF ROOM 00395000
  439. LA R3,FREE07 SET R3 SWITCH TO GET NON-SUBPOOL SIZES 00396000
  440. LA R4,FREE09 AND R4-SWITCH TO GO TO 'FREE09' 00397000
  441. B FREE03 GO CONVERT DBL-WORDS TO BYTES. 00398000
  442. * 00399000
  443. * 00400000
  444. * "SUBPOOL" FREE LOGIC ENTERED AT "FREE02" 00401000
  445. * (IF A "SUBPOOL SIZE", BUT NO BLOCK IS AVAILABLE IN SUBPOOL) 00402000
  446. * 00403000
  447. * GET A BLOCK FROM LOW-NUMBERED END OF FIRST LARGER BLOCK 00404000
  448. * (UNLESS LUCKY ENOUGH TO FIND AN EXACT MATCH SOMEPLACE) 00405000
  449. * 00406000
  450. CNOP 4,8 DBL-WORD-ALIGN 'FREE05' @V3M4038 00407000
  451. * 00408000
  452. FREE02 L R2,SUBSIZES(R7) SIZE (IN DOUBLE WORDS) MUST BE IN R2 00409000
  453. LM R3,R4,ADCON3 NEEDED ADCONS INTO R3-R4 NOW: @VA00881 00410000
  454. * R3 = A(FREE10) 00411000
  455. * R4 = A(FREE06A) 00412000
  456. ST R7,JSAVE7 REMEMBER R7 INDEXER, @VA00881 00413000
  457. LA R7,TRYSPLIT SET R7 SWITCH TO TRY CHKSPLIT @VA00881 00414000
  458. * LATER IF CAN'T GET A BLOCK FROM THE CHAIN 00415000
  459. * 00416000
  460. FREE03 SLL R2,3 DOUBLE-WORDS TO BYTES, PLEASE 00417000
  461. L R15,DMKFRELO COMPUTE DMKFRELO MINUS LENGTH OF BLOCK 00418000
  462. SR R15,R2 AND 00419000
  463. ST R15,FREELOWM STORE FOR USE IN MAIN LOOP CALCULATIONS 00420000
  464. FREE04 L R0,FREENUM FREENUM INTO R0, 00421000
  465. LTR R10,R0 (ALSO IN R10), ANYTHING AVAILABLE ? 00422000
  466. BCR 8,R7 <BZ> IF NOT, TRY SPLITTING A LARGER @VA00881 00423000
  467. * SUBPOOL, OR CALL PAGE-FREE 00424000
  468. LA R5,DMKFRELS START AT BEGINNING OF CHAIN, 00425000
  469. SR R8,R8 R8 = 0 MEANS NO BLOCK FOUND YET 00426000
  470. SR R9,R9 R9 ALSO = 0 (FOR SUBPOOL LOGIC) 00427000
  471. SLR R13,R13 R13=0: EQUAL-SIZE-BLOCK NOT @VA00881 00428000
  472. * FOUND (YET) 00429000
  473. LA R6,FREE05 FOR BCTR FOR LOOP, 00430000
  474. * 00431000
  475. FREE05 LR R1,R5 SAVE OLD POINTER, 00432000
  476. L R5,PNTR(,R5) GET NEW POINTER, 00433000
  477. CL R2,SIZE(,R5) CHECK DESIRED SIZE AGAINST THAT AVAILABLE 00434000
  478. BCR 13,R3 BNH FREE07 OR FREE10 IF BIG ENOUGH 00435000
  479. FREE05A BCTR R10,R6 NOT DONE YET, ITERATE LOOP TO @VA00881 00436000
  480. * FREE05. 00437000
  481. * 00438000
  482. LTR R8,R8 HOPEFULLY WE FOUND A BIGGER ONE ? 00439000
  483. BNZ FREE05C YES - GOOD SHOW. @VA00881 00440000
  484. LTR R1,R13 NO - MAYBE AN EQUAL-SIZE BLOCK, @VA00881 00441000
  485. * THEN ? 00442000
  486. BCR 8,R7 <BZ> IF NOT, TRY SPLITTING A LARGER @VA00881 00443000
  487. * SUBPOOL, OR CALL PAGE-FREE 00444000
  488. FREE05B L R5,PNTR(,R1) EQUAL-BLOCK FOUND, GET POINTER @VA00881 00445000
  489. * THERETO 00446000
  490. B FREE06C AND GO CHECK WHICH SIZE WE ARE @VA00881 00447000
  491. * HANDLING. 00448000
  492. * 00449000
  493. FREE05C CL R3,ADCON3 LARGER BLOCK FOUND, CHECK @VA00881 00450000
  494. * R3-SWITCH, 00451000
  495. BE FREE10C TRF IF IT'S A SUBPOOL, 00452000
  496. B FREE08 OR IF A REGULAR SIZE OTHERWISE. 00453000
  497. SPACE 00454000
  498. FREQUAL CL R5,DMKFREHI IS BLOCK AT DMKFREHI OR ABOVE ? @VA00881 00455000
  499. BNL FREE06C YES - GREAT. @VA00881 00456000
  500. LR R13,R1 NO, WE MUST REMEMBER PREVIOUS @VA00881 00457000
  501. * BLOCK ADDR 00458000
  502. CL R5,FREELOWM IS IT IN DYNAMIC PAGING AREA ? @VA00881 00459000
  503. BH FREE05A YES - KEEP CHECKING FOR A @VA00881 00460000
  504. * BETTER ONE. 00461000
  505. AIF (NOT &VIRREAL).J0 @VA00881 00462000
  506. CL R5,=A(DMKSLC) BEWARE OF BLOCK IN UNLOCKED V=R @VA00881 00463000
  507. * AREA 00464000
  508. BL FREE05A IF BELOW "DMKSLC" TRY FOR A @VA00881 00465000
  509. * BETTER ONE 00466000
  510. .J0 ANOP EQUAL-SIZE BLOCK NOT IN DYNAMIC PAGING AREA: 00467000
  511. FREE06C CL R3,ADCON3 I FORGET NOW - WHICH SIZE ARE @VA00881 00468000
  512. * WE HANDLING 00469000
  513. BNE FREE06 NOT A SUBPOOL - GO TO FREE06. @VA00881 00470000
  514. * SUBPOOL - CONTINUE TO FREE06B ... 00471000
  515. FREE06B ST R5,GPR1 STORE FOR RETURNING R1 TO CALLER 00472000
  516. * 00473000
  517. FREE06 DS 0H EXACT-SIZE BLOCK FOUND FOR "OTHER" SIZE 00474000
  518. FREE062 L R14,PNTR(,R5) PATCH POINTERS IN THE CHAIN 00475000
  519. ST R14,PNTR(,R1) ... 00476000
  520. BCTR R0,0 DECREMENT FREENUM (STILL IN R0) BY 1 00477000
  521. ST R0,FREENUM AND STORE. 00478000
  522. LA R6,FREE09A SET R6 "SWITCH" TO CONTINUE @VA01089 00479000
  523. * AFTER CODE AT "FREE09" 00480000
  524. BR R4 CONTINUE TO FREE06A OR BRANCH TO FREE09. 00481000
  525. * 00482000
  526. FREE06A AR R5,R2 IF IT IS A SUBPOOL SIZE, COMPUTE END OF 00483000
  527. B FREE10A BLOCK, AND JOIN CODE BELOW. 00484000
  528. * 00485000
  529. * IF R2 = "ANOTHER SIZE", AND A LARGER (OR EQUAL) FOUND .. 00486000
  530. FREE07 BE FREQUAL TRY TO USE IF AN EXACT MATCH. @V3M4038 00487000
  531. LR R8,R5 IF NOT, REMEMBER WHERE IT WAS, 00488000
  532. BCTR R10,R6 ITERATE LOOP AT FREE05. 00489000
  533. * 00490000
  534. * CONTINUE TO 'FREE08' IF DROPS THRU LOOP ... 00491000
  535. * 00492000
  536. * GET A CHUNK FROM HIGH-END OF LAST LARGER BLOCK FOUND... 00493000
  537. FREE08 L R9,SIZE(,R8) SIZE OF LAST LARGER BLOCK, 00494000
  538. LA R5,0(R8,R9) END OF LAST LARGER BLOCK INTO R5, 00495000
  539. LA R6,FREE20 SET R6 "SWITCH" TO GO TO EXIT @VA01089 00496000
  540. CL R8,DMKFREHI IS BLOCK AT OR ABOVE DMKFREHI ? @V3M4038 00497000
  541. BNL FREE08B YES - GOOD SHOW - USE IT. @VA00881 00498000
  542. CL R5,DMKFRELO COMPARE END OF BLOCK VS. DMKFRELO@VA00881 00499000
  543. AIF (&VIRREAL).J2B @VA00881 00500000
  544. BNH FREE08B OK - GOOD SHOW (IF UNLIKELY) - @VA00881 00501000
  545. * USE IT. 00502000
  546. AGO .J2C @VA00881 00503000
  547. .J2B BH FREE08A IF > DMKFRELO IT'S IN DYNAMIC PAGING AREA 00504000
  548. CL R8,=A(DMKSLC) BEWARE OF BLOCK IN UNLOCKED V=R @VA00881 00505000
  549. * AREA 00506000
  550. BNL FREE08B IF NOT BELOW "DMKSLC", IT'S OK. @VA00881 00507000
  551. .J2C ANOP LARGER BLOCK WAS IN DYNAMIC PAGING AREA: 00508000
  552. FREE08A LTR R1,R13 DID WE HAVE AN EQUAL-SIZE BLOCK ?@VA00881 00509000
  553. BNZ FREE05B YES - WE MIGHT AS WELL USE IT. @VA00881 00510000
  554. LA R6,FREE09A SET R6 "SWITCH" TO CONTINUE @VA01089 00511000
  555. FREE08B SR R9,R2 COMPUTE NEW SIZE OF BLOCK, @VA00881 00512000
  556. ST R9,SIZE(,R8) STORE BACK WHERE IT WAS, 00513000
  557. SR R5,R2 ADDRESS OF BLOCK WE'RE SPLITTING OFF ->R5 00514000
  558. FREE09 ST R5,GPR1 STORE R5 FOR RETURNING R1 TO CALLER, 00515000
  559. AIF (NOT &FRETRAP).NOFTR4 HRC035DK 00515200
  560. ST R2,FREEWORK SAVE BYTE COUNT OF STORAGE BLOCK HRC035DK 00515400
  561. .NOFTR4 ANOP , HRC035DK 00515600
  562. LR R7,R2 REMEMBER BYTE COUNT OF BLOCK @VA01089 00516000
  563. BR R6 EITHER "B FREE20" OR CONTINUE: @VA01089 00517000
  564. SPACE 00518000
  565. * CONTINUE IF A "LARGE" BLOCK GIVEN OUT FROM THE DYNAMIC PAGING AREA: 00519000
  566. FREE09A CL R7,F4096 WAS BYTE COUNT > 4096 ? @VA01089 00520000
  567. BNH FREE20 NO - GO DIRECTLY TO FREE20. @VA01089 00521000
  568. SPACE 00522000
  569. * IF LARGE BLOCK (> 4096 BYTES) WAS GIVEN OUT FROM DYNAMIC PAGING AREA, 00523000
  570. * SCAN THE CHAIN TO SEE IF THERE ARE ANY EXTRA BLOCKS IN THERE WHICH 00524000
  571. * SHOULD BE RETURNED FOR PAGING VIA DMKPTRFT: 00525000
  572. LA R10,FREE20 SET EXIT VECTOR FOR DMKFREE ... @VA05235 00526000
  573. FREE09B L R0,FREENUM FREENUM INTO R0 @VA01089 00527000
  574. LTR R4,R0 (ALSO IN R4); IS FREENUM = 0 ? @VA01089 00528000
  575. BZR R10 YES - FORGET IT - GO EXIT. @VA05235 00529000
  576. L R9,F4096 LET R9 = SIZE OF ONE PAGE @VA01089 00530000
  577. LA R1,DMKFRELS START AT BEGINNING OF CHAIN @VA01089 00531000
  578. SPACE 00532000
  579. * LOOP TO "SCAN" FREE STORAGE CHAIN FOR LIKELY CULPRITS 00533000
  580. FREE09C LR R3,R1 REMEMBER PREVIOUS BLOCK @VA01089 00534000
  581. L R1,PNTR(,R1) GET NEW POINTER @VA01089 00535000
  582. CL R9,SIZE(,R1) CHECK SIZE OF BLOCK @VA01089 00536000
  583. BNH FREE09E BRANCH IF WE FOUND A BIG ONE @VA01089 00537000
  584. FREE09D BCT R4,FREE09C ITERATE LOOP @VA01089 00538000
  585. BR R10 AND EXIT WHEN ALL THRU @VA05235 00539000
  586. SPACE 00540000
  587. * WE FOUND A LARGE BLOCK - CHECK IT OUT FURTHER: 00541000
  588. FREE09E CL R1,DMKFREHI ARE WE IN DYNAMIC PAGING AREA ? @VA01089 00542000
  589. BNLR R10 IF > DMKFREHI (OR =) WE'RE ALL @VA05235 00543000
  590. * DONE 00544000
  591. CL R1,DMKFRELO (CHECK FOR LOWER FREE AREA ALSO) @VA01089 00545000
  592. BNL FREE09F BRANCH IF DEFINITELY IN THERE @VA01089 00546000
  593. AIF (&VIRREAL).J3B @VA01705 00547000
  594. B FREE09D OK IF BELOW DPA @VA01705 00548000
  595. AGO .J3C @VA01705 00549000
  596. .J3B ANOP 00550000
  597. CL R1,=A(DMKSLC) IF < DMKFRELO, LOOK FOR BLOCK @VA01089 00551000
  598. * IN V=R AREA 00552000
  599. BNL FREE09D OK IF NOT LOW @VA01089 00553000
  600. .J3C ANOP 00554000
  601. FREE09F LA R5,4095(,R1) ROUND UP TO BEG. NEXT PAGE @VA01089 00555000
  602. N R5,XPAGNUM ... @VA01089 00556000
  603. LR R8,R5 LET'S HAVE THAT IN R8, @VA01089 00557000
  604. SR R8,R1 MINUS BEGINNING OF OUR BLOCK @VA01089 00558000
  605. L R7,SIZE(,R1) SIZE OUR BLOCK INTO R7, @VA01089 00559000
  606. SR R7,R8 MINUS FRONT OF US @VA01089 00560000
  607. SR R6,R6 NOW HOW MUCH CAN WE GIVE BACK ? @VA01089 00561000
  608. DR R6,R9 ONE OR MORE PAGES WE HOPE ? @VA01089 00562000
  609. LTR R2,R7 CHECK QUOTIENT (& PLACE IN R2) @VA01089 00563000
  610. BNP FREE09D IF NOT > 0, FORGET THE WHOLE @VA01089 00564000
  611. * THING. 00565000
  612. ST R10,SAVE910 SAVE R10 ACROSS THIS BAL ... @VA05235 00566000
  613. BAL R10,FRET22J IF OK, RETURN THE BLOCK VIA @VA01089 00567000
  614. * DMKPTRFT 00568000
  615. L R10,SAVE910 RECOVER R10 (EXIT VECTOR) @VA05235 00569000
  616. INCR NUMEXBLK BUMP COUNT OF OCCURRENCES @VA01089 00570000
  617. B FREE09B THEN CHECK THE CHAIN AGAIN. @VA01089 00571000
  618. * 00572000
  619. * IF R2 = A SUBPOOL SIZE AND LARGER (OR EQUAL) FOUND ... 00573000
  620. FREE10 BE FREQUAL TRY TO USE IF AN EXACT MATCH. @V3M4038 00574000
  621. LTR R9,R9 IF NOT, DO WE ALREADY HAVE A "GOOD" ONE ? 00575000
  622. BP FREE10D TRF IF YES (KEEP IT). 00576000
  623. LR R8,R5 IF NOT, REMEMBER "THIS ONE" IN R8, 00577000
  624. LR R14,R1 AND REMEMBER PREVIOUS BLOCK IN R14, 00578000
  625. CL R8,DMKFREHI ARE WE IN HIGH-CORE FREE AREA ? 00579000
  626. BNL FREE10E TRF IF YES (GOOD SHOW). 00580000
  627. CL R8,FREELOWM OR IS IT ABOVE DMKFRELO ? 00581000
  628. BH FREE10D YES - DON'T USE IT JUST YET. 00582000
  629. AIF (NOT &VIRREAL).J3A @VA00881 00583000
  630. CL R8,=A(DMKSLC) BEWARE OF BLOCK IN UNLOCKED V=R @VA00881 00584000
  631. * AREA 00585000
  632. BL FREE10D IF < DMKSLC, DON'T USE IT JUST @VA00881 00586000
  633. * YET. 00587000
  634. .J3A ANOP 00588000
  635. FREE10E LR R9,R5 IF OK, REMEMBER ADDRESS OF GOOD BLOCK 00589000
  636. FREE10D BCTR R10,R6 ITERATE LOOP AT 'FREE05' HOPING FOR = BLK 00590000
  637. * 00591000
  638. FREE10C DS 0H SUBPOOL SIZE; WE HAVE AT LEAST ONE BLOCK: 00592000
  639. LTR R5,R9 DID WE HAVE A "GOOD" BLOCK ? @V3M4038 00593000
  640. BP FREE10B TRF IF YES (GOOD SHOW). 00594000
  641. LTR R1,R13 IF NOT, DID WE HAVE AN @VA00881 00595000
  642. * EQUAL-SIZE BLOCK ? 00596000
  643. BNZ FREE05B YES - WE MIGHT AS WELL USE IT. @VA00881 00597000
  644. LR R5,R8 IF NOT, WE'LL JUST HAVE TO USE "R8" BLOCK 00598000
  645. FREE10B ST R5,GPR1 STORE FOR RETURNING R1 TO CALLER 00599000
  646. LM R6,R7,PNTR(R5) OBTAIN POINTER & SIZE OF BLOCK, 00600000
  647. AR R5,R2 OBTAIN NEW BEGINNING OF BLOCK, 00601000
  648. ST R5,PNTR(,R14) STORE AS POINTER IN PREVIOUS BLOCK, 00602000
  649. SR R7,R2 DECREMENT SIZE BY BLOCK TAKEN OFF, 00603000
  650. STM R6,R7,PNTR(R5) STORE POINTER & NEW SIZE IN NEW BLOCK 00604000
  651. FREE10A DS 0H SUBPOOL SIZE BLOCK WAS FOUND SOMEWHERE: 00605000
  652. AIF (NOT &FRETRAP).NOFTR5 HRC035DK 00605200
  653. ST R2,FREEWORK SAVE BYTE COUNT OF STORAGE BLOCK HRC035DK 00605400
  654. .NOFTR5 ANOP , HRC035DK 00605600
  655. B FREE20 GO EXIT FROM FREE. 00606000
  656. SPACE 2 00607000
  657. * SUBPOOL SIZE BLOCK - COULN'T FIND A BLOCK IN THE CHAIN: 00608000
  658. TRYSPLIT L R7,JSAVE7 RECOVER R7 INDEXER @VA00881 00609000
  659. L R2,SUBSIZES(R7) NEED COUNT (IN DBL WORDS) IN R2 @VA00881 00610000
  660. LM R5,R6,ADCON5 SET R5 AND R6 AS NEEDED @VA00881 00611000
  661. SLR R1,R1 AND R1 MUST = 0 @VA00881 00612000
  662. INCR SPLITATT COUNT HOW MANY ATTEMPTS WE MAKE @VA00881 00613000
  663. FREE02A CL R1,SUBTABLE(R5) LOOK AT <NEXT-TO> LAST SUBPOOL @VA00881 00614000
  664. BNE CHKSPLIT IF NON-EMPTY WE'RE IN BUSINESS. @VA00881 00615000
  665. BXH R5,R6,FREE02A ITERATE R5 DOWN TO OURS (IN R7) @VA00881 00616000
  666. * NO LUCK - CONTINUE: 00617000
  667. FREE16 DS 0H NOT ENOUGH ROOM LEFT, WE MUST CALL PAGE-FREE 00618000
  668. AIF (NOT &AP).NOAP7 **AIF*** 00619000
  669. * 00620000
  670. * IF AP MODE WE CAN ONLY CALL DMKPTRFR WITH GLOBAL @V407594 00621000
  671. * SUPERVISOR LOCK @V407594 00622000
  672. TM APSTAT1,APUOPER RUNNING AS AP @V407594 00623000
  673. BZ CALLPTR NO, PROCEED @V407594 00624000
  674. L R14,=V(DMKLOKSY) ADDRESS SUPERVISOR LOCK @V407594 00625000
  675. CLC 2(2,R14),LPUADDR DO WE HOLD LOCK @V407594 00626000
  676. BE CALLPTR YES, CALL DMKPTRFR @V407594 00627000
  677. BAL R14,LOCKSYS TRY FOR SUPERVISOR LOCK @V407594 00628000
  678. BNZ DEFERPTR COULD NOT GET LOCK @V407594 00629000
  679. * @V407594 00630000
  680. CALLPTR DS 0H @V407594 00631000
  681. SR R3,R3 INDICATES CPFRELK NOT SET @V407594 00632000
  682. CALLPTR2 DS 0H @V407594 00633000
  683. .NOAP7 ANOP **ANOP** 00634000
  684. INCR NPAGFREE COUNT HOW MANY TIMES PAGE-FREE IS CALLED 00635000
  685. L R15,=A(DMKDSPNP) REF. NO. OF PAGEABLE PAGES @V3M4038 00636000
  686. L R14,PREFIXA LOAD PREFIX VALUE @V407594 00637000
  687. TS XTNDLOCK-PSA(R14) TEST & SET 'EXTEND LOCK' @V407594 00638000
  688. BNZ ERROR10 IF SET ("EXTEND WHILE EXTENDING") DIE NOW 00639000
  689. * (BEFORE OLD BALRSAVE/FREESAVE COVERED UP) 00640000
  690. DECR 0(,R15) OK - DECREMENT "DMKDSPNP" BY 1 00641000
  691. MVC EXTNDSAV(32*4),BALRSAVE SAVE BALRSAVE & FREESAVE 00642000
  692. STCTL C2,C2,TEMPSAVE GET CURRENT EXTENDED IO MASKS 00643000
  693. NI TEMPSAVE,X'7F' DISABLE CHANNEL ZERO 00644000
  694. LCTL C2,C2,TEMPSAVE WHILE WE ARE EXTENDING 00645000
  695. L R13,DMKFRESV LET R13 POINT TO OUR SPECIAL SAVE-AREA 00646000
  696. CLEARSAV XC 0(SAVESIZE*8,R13),0(R13) CLEAR THE ENTIRE SAVE-AREA 00647000
  697. AIF (NOT &AP).NOAP8 **AIF*** 00648000
  698. BAL R14,RELFRE RELEASE DMKFRE LOCK @V407594 00649000
  699. .NOAP8 ANOP **ANOP** 00650000
  700. SVC 16 GIVE IT TO DMKPSA FOR THE DMKPTRFR CALL 00651000
  701. ICM R4,B'0011',LPUADDR SAVE CURRENT PROCESSOR ADDR @V407594 00652000
  702. CLC FREER15+1(3),AFRERC+1 ENTERED AT DMKFRERC @V407594 00653000
  703. BE PARM2 CALL TO DMKPTR WITH RETURN CODE @V4M0157 00654000
  704. * 00655000
  705. CALL DMKPTRFR,PARM=1 CALL "PAGE FREE" TO GET ANOTHER PAGE 00656000
  706. * NOTE: DMKPTRFR HAS CALLED DMKFRETR TO MERGE 00657000
  707. AIF (NOT &AP).NOAP9 **AIF*** 00658000
  708. * @V407594 00659000
  709. * IF WE FORCED EXTEND TO REFILL DMKFREAP, NOW WE MUST @V407594 00660000
  710. * CLEAR CPFRELK - (COULD NOT HAPPEN FOR DMKFRERC ENTRY) @V407594 00661000
  711. * 00662000
  712. LTR R3,R3 SHOULD WE CLEAR CPFRELK @V407594 00663000
  713. BZ COMMON NO @V407594 00664000
  714. L R14,PREFIXA ACCESS ABSOLUTE PSA @V407594 00665000
  715. MVI CPFRELK-PSA(R14),0 CLEAR CPFRELK @V407594 00666000
  716. MVI FRLKPROC-PSA(R14),0 & PROCESSOR ADDRESS @V407594 00667000
  717. SIGNAL WAKEUP,CONTROL=PARALLEL TELL OTHER PROCESSOR @V407594 00668000
  718. * @V407594 00669000
  719. .NOAP9 ANOP **ANOP** 00670000
  720. COMMON DS 0H @V407594 00671000
  721. BAL R5,RESTORE RESTORE SAVE AREAS & EXTEND LOCK @V407466 00672000
  722. LM R0,R15,FREESAVE RESTORE REGISTERS @V407466 00673000
  723. BR R15 GO SEARCH AGAIN @V407466 00674000
  724. * THE BLOCK INTO THE FREE-STORAGE CHAIN. 00675000
  725. * 00676000
  726. RESTORE SVC 20 GET SAVE AREA BACK AGAIN @V407466 00677000
  727. ST R13,DMKFRESV AND PUT IT AWAY FOR FUTURE USE 00678000
  728. AIF (NOT &AP).NOAP10 **AIF*** 00679000
  729. CLM R4,B'0011',LPUADDR STILL ON SAME PROCESSOR @V407594 00680000
  730. BE RESTORE2 YES @V407594 00681000
  731. * WE HAVE MOVED FROM MAIN PROCESSOR TO ATTACHED PROC'R @V407594 00682000
  732. * WE MUST TRANSFER EXECUTION BACK TO AP NOW @V407594 00683000
  733. LA R0,CPEXSIZE GET A CPEXBLOK @V407594 00684000
  734. CALL DMKFREE WE DO NOT HOLD FREE STORAGE LOCK @V407594 00685000
  735. USING CPEXBLOK,R1 @V407594 00686000
  736. STM R0,R15,CPEXR0 SAVE ALL REGS @V407594 00687000
  737. MVC CPEXPROC,LPUADDRX STACK FOR OTHER PROCESSOR @V407594 00688000
  738. LA R14,RESTORE3 EXECUTION ADDRESS @V407594 00689000
  739. ST R14,CPEXADD TO CPEXBLOK @V407594 00690000
  740. CALL DMKSTKLF STACK BLOCK LIFO @V407594 00691000
  741. L R14,PREFIXA ACCESS ABSOLUTE PSA @V407594 00692000
  742. TS CPFRESW-PSA(R14) SET CPFRESW @V407594 00693000
  743. BNZ ERROR15 BAD NEWS IF ALREADY SET @V4M0241 00694000
  744. INCR EXTSWTCH COUNT USE OF CPFRESW @V407594 00695000
  745. STCTL C2,C2,TEMPSAVE @V407594 00696000
  746. OI TEMPSAVE,X'80' REENABLE CHANNEL ZERO @V407594 00697000
  747. LCTL C2,C2,TEMPSAVE @V407594 00698000
  748. L R14,PREFIXA ACCESS ABSOLUTE PSA @V4M0123 00699000
  749. MVI XTNDLOCK-PSA(R14),0 CLEAR EXTEND LOCK @V407594 00700000
  750. * DISPATCHER ON AP WILL NOW SEE THAT CPFRESW IS SET @V407594 00701000
  751. C R11,ASYSVM IS THIS THE SYSTEM ?? @VA07866 00702000
  752. BE NORELVM YES, NO NEED TO RELEASE HIM @VA07866 00703000
  753. C R11,LASTUSER THIS USER ALSO LAST USER ?? @VA07866 00704000
  754. BE NORELVM YES, HE'S O.K. TOO @VA07866 00705000
  755. LR R1,R11 POINT TO THIS USER IN R1 @VA07866 00706000
  756. L R11,ASYSVM INSURE DMKDSP DOESN'T RELEASE TOO@VA07866 00707000
  757. LOCK RELEASE,TYPE=VMBLOK UNLOCK VMBLOK, NO SAVREG @VA07866 00708000
  758. NORELVM EQU * @VA07866 00709000
  759. LOCK RELEASE,TYPE=SYS CLEAR SUPERVISOR LOCK @V407594 00710000
  760. GOTO DMKDSPRU UNLOCKED ENTRY TO DMKDSP @V407594 00711000
  761. SPACE 1 @V407594 00712000
  762. RESTORE2 DS 0H @V407594 00713000
  763. .NOAP10 ANOP **ANOP** 00714000
  764. L R14,PREFIXA LOAD PREFIX VALUE @V407594 00715000
  765. MVI XTNDLOCK-PSA(R14),00 CLEAR EXTEND LOCK @V407594 00716000
  766. RESTORE3 DS 0H HERE ON AP VIA CPEXBLOK @V407594 00717000
  767. MVC BALRSAVE(32*4),EXTNDSAV RESTORE BALRSAVE & FREESAVE 00718000
  768. TM APSTAT1,PROCIO IS THIS MAIN PROCESSOR @V407594 00719000
  769. BZR R5 NO, LEAVE ALL CHANNELS DISABLED @V407594 00720000
  770. STCTL C2,C2,TEMPSAVE GET EXTENDED IO MASKS 00721000
  771. OI TEMPSAVE,X'80' RE-ENABLE FOR CHANNEL ZERO 00722000
  772. LCTL C2,C2,TEMPSAVE AFTER EXTEND IS COMPLETE 00723000
  773. BR R5 RETURN TO MAINLINE @V407466 00724000
  774. * 00725000
  775. PARM2 CALL DMKPTRFR,PARM=2 CALL PAGE FREE WITH RETURN CODE @V407466 00726000
  776. BZ COMMON @V407466 00727000
  777. BAL R5,RESTORE CC=1, RESTORE SAVE AREAS @V407466 00728000
  778. AIF (NOT &AP).NOAP16 **AIF*** 00729000
  779. BAL R14,LOCKFRE LOCK DMKFRE @V407594 00730000
  780. .NOAP16 ANOP **ANOP** 00731000
  781. L R1,FFS X'FFFFFFFF' TO R1 @V407466 00732000
  782. ST R1,FREER1 RETURN FF'S IN R1 IF NO STORAGE @V407466 00733000
  783. L R7,FREER0 RESTORE REGISTERS @V407466 00734000
  784. SLL R7,3 SIZE OF BLOCK IN BYTES @V407466 00735000
  785. B FREE09A RETURN PAGES OBTAINED FROM DMKPTR@V407466 00736000
  786. SPACE 3 @V407594 00737000
  787. AIF (NOT &AP).NOAP11 **AIF*** 00738000
  788. DEFERPTR DS 0H MUST EXTEND FREE STORAGE BUT @V407594 00739000
  789. * CANNOT OBTAIN SUPERVISOR LOCK @V407594 00740000
  790. L R14,PREFIXA ACCESS ABSOLUTE PSA @V407594 00741000
  791. TS CPFRELK-PSA(R14) SET CPFRELK @V407594 00742000
  792. BNZ ERROR12 ABEND IF ALREADY SET @V407594 00743000
  793. MVC FRLKPROC-PSA(1,R14),LPUADDR+1 PROCESSOR ID @V407594 00744000
  794. * NOW TRY AGAIN TO OBTAIN SUPERVISOR LOCK @V407594 00745000
  795. * IF SUCCESSFUL, RESET CPFRELK & CALL DMKPTRFR @V407594 00746000
  796. BAL R14,LOCKSYS TRY AGAIN FOR LOCK @V407594 00747000
  797. BNZ DEFER2 COULD NOT OBTAIN LOCK @V407594 00748000
  798. L R14,PREFIXA ACCESS ABSOLUTE PSA @V407594 00749000
  799. MVI CPFRELK-PSA(R14),0 CLEAR CPFRELK @V407594 00750000
  800. MVI FRLKPROC-PSA(R14),0 & PROCESSOR ID @V407594 00751000
  801. SIGNAL WAKEUP,CONTROL=PARALLEL JUST IN CASE OTHER @V407594 00752000
  802. * PROCESSOR SAW CPFRELK WAS ON @V407594 00753000
  803. B CALLPTR GO EXTEND FREE STORAGE @V407594 00754000
  804. SPACE 1 @V407594 00755000
  805. DEFER2 DS 0H HERE TO SUSPEND DMKFREE CALL @V407594 00756000
  806. SR R2,R2 @V407594 00757000
  807. ICM R2,B'0111',DMKFREAP+1 ADDRESS OF BACKPOCKET @VA13499 00758100
  808. BZ ERROR14 ERROR IF NOT THERE @V407594 00759000
  809. XC DMKFREAP+1(R3),DMKFREAP+1 ZERO POINTER @VA07936 00760000
  810. MVC 0(32*4,R2),BALRSAVE SAVE BALRSAVE + FREESAVE @V407594 00761000
  811. L R1,DMKFREAP+4 GET ADDRESS OF CPEX FROM FREAP @VA13499 00762100
  812. STM R0,R15,CPEXR0 SAVE ALL REGS (R2=SAVE AREA PTR) @V407594 00763000
  813. LA R15,FREEDEFD LOAD EXECUTION ADDRESS @V407594 00764000
  814. ST R15,CPEXADD & STORE IN CPEXBLOK @V407594 00765000
  815. MVC CPEXPROC,LPUADDR FOR THIS PROCESSOR ONLY @V407594 00766000
  816. CALL DMKSTKLF AND STACK LIFO @V407594 00767000
  817. INCR EXTDEFER COUNT USE OF CPFRELK @V407594 00768000
  818. BAL R14,RELFRE CLEAR FREE STORAGE LOCK @V407594 00769000
  819. GOTO DMKDSPRU EXIT TO UNLOCKED DISPATCHER ENTRY@V407594 00770000
  820. SPACE 2 @V407594 00771000
  821. FREEDEFD DS 0H HERE TO RESUME DEFERRED FREE CALL@V407594 00772000
  822. * WE ARE ON ORIGINAL PROCESSOR, WITH GLOBAL SUPERVISOR @V407594 00773000
  823. * LOCK, BUT NOT FREE STORAGE LOCK @V407594 00774000
  824. MVC BALRSAVE(16*4),0(R2) RESTORE BALRSAVE @V407594 00775000
  825. MVC APSAVE(16*4),16*4(R2) SAVE ORIGINAL FREESAVE @V407594 00776000
  826. LA R0,32*4/8 FRET 32 WORD SAVE AREA @V407594 00777000
  827. LR R1,R2 SAVE AREA ADDRESS TO R1 @V407594 00778000
  828. CALL DMKFRET @V407594 00779000
  829. MVC FREESAVE(16*4),APSAVE RESTORE ORIGINAL FREESAVE @V407594 00780000
  830. ICM R15,B'0111',DMKFREAP+1 WAS BACK POCKET REFILLED @V407594 00781000
  831. BZ DEFD01 NO- CALL DMKPTRFR TO REFILL IT @V407594 00782000
  832. L R15,PREFIXA BACK POCKET WAS REFILLED @V407594 00783000
  833. MVI CPFRELK-PSA(R15),0 CLEAR CPFRELK @V407594 00784000
  834. MVI FRLKPROC-PSA(R15),0 AND PROCESSOR ADDRESS @V407594 00785000
  835. SIGNAL WAKEUP,CONTROL=PARALLEL WAKE UP OTHER PROC'R @V407594 00786000
  836. LM R0,R15,FREESAVE RESTORE CALLER'S REGISTERS @V407594 00787000
  837. BR R15 REENTER DMKFREE AT TOP @V407594 00788000
  838. SPACE 1 @V407594 00789000
  839. DEFD01 DS 0H MUST FORCE EXTEND TO REFILL @V407594 00790000
  840. * DMKFREAP- ONLY PTR CAN DO THIS @V407594 00791000
  841. BAL R14,LOCKFRE GET FREE STORAGE LOCK @V407594 00792000
  842. LA R3,1 FLAG TO CLEAR CPFRELK @V407594 00793000
  843. B CALLPTR2 EXTEND FREE STORAGE @V407594 00794000
  844. .NOAP11 ANOP **ANOP** 00795000
  845. SPACE 1 @V407594 00796000
  846. EJECT 00797000
  847. * UNSATISFIED SUBPOOL CALL WITH THE FOLLOWING CONDITIONS: 00798000
  848. * R2 = SIZE IN DOUBLE WORDS OF SUBPOOL WE WANT TO FILL 00799000
  849. * R5 INDEXES A LARGER NON-EMPTY SUBPOOL 00800000
  850. * R7 INDEXES THE EMPTY SUBPOOL WE WANT TO FILL 00801000
  851. * 00802000
  852. CHKSPLIT L R8,SUBTABLE(R5) POINT TO THE LARGER SUPBOOL BLOCK 00803000
  853. L R9,SUBSIZES(R5) GET SIZE OF LARGER SUBPOOL 00804000
  854. SR R9,R2 MINUS OUR SIZE = SIZE OF ANOTHER 00805000
  855. IC R9,BYTBL-1(R9) OBTAIN INDEX TO THAT SUBPOOL 00806000
  856. L R14,PNTR(,R8) SET POINTER TO NEW SUBTABLE @V3M4038 00807000
  857. ST R14,SUBTABLE(R5) ... 00808000
  858. ST R8,GPR1 STORE FOR RETURNING R1 TO CALLER, 00809000
  859. SLL R2,3 GET NO. OF BYTES IN OUR BLOCK 00810000
  860. AIF (NOT &FRETRAP).NOFTR6 HRC035DK 00810200
  861. ST R2,FREEWORK SAVE BYTE COUNT OF STORAGE BLOCK HRC035DK 00810400
  862. .NOFTR6 ANOP , HRC035DK 00810600
  863. AR R2,R8 PLUS OUR BEGINNING = OUR END 00811000
  864. L R14,SUBTABLE(R9) GET OLD POINTER FROM "OTHER" BLOCK, 00812000
  865. ST R2,SUBTABLE(R9) STORE POINTER TO THE OTHER SUBTABLE 00813000
  866. ST R14,PNTR(,R2) STORE 0 OR POINTER IN THE FIRST WORD 00814000
  867. INCR SPLITCNT BUMP COUNT OF HOW MANY TIMES WE DID IT 00815000
  868. B FREE20 GO EXIT FROM FREE. 00816000
  869. AIF (NOT &AP).NOAP12 **AIF*** 00817000
  870. SPACE 3 @V407594 00818000
  871. LOCKFRE LOCK OBTAIN,TYPE=FREE,SPIN=YES,SAVE LOCK FREE STORAGE@V407594 00819000
  872. BR R14 RETURN TO CALLER @V407594 00820000
  873. SPACE 1 @V407594 00821000
  874. RELFRE LOCK RELEASE,TYPE=FREE,SAVE UNLOCK FREE STORAGE @V407594 00822000
  875. BR R14 RETURN TO CALLER @V407594 00823000
  876. SPACE 1 @V407594 00824000
  877. LOCKSYS LOCK OBTAIN,TYPE=SYS,SPIN=NO,SAVE @V407594 00825000
  878. BR R14 RETURN WITH CC INTACT @V407594 00826000
  879. .NOAP12 ANOP **ANOP** 00827000
  880. SPACE 00828000
  881. DROP R12 00829000
  882. EJECT 00830000
  883. *. 00831000
  884. * SUBROUTINE NAME - 00832000
  885. * 00833000
  886. * DMKFRERS - RETURN ALL SUBPOOLS TO FREE STORAGE CHAIN 00834000
  887. * 00835000
  888. * FUNCTION - 00836000
  889. * 00837000
  890. * TO RETURN ALL AVAILABLE SUBPOOL BLOCKS 00838000
  891. * TO THE FREE STORAGE CHAIN. 00839000
  892. * 00840000
  893. * ATTRIBUTES - 00841000
  894. * 00842000
  895. * SERIALLY REUSABLE, RESIDENT, CALLED VIA BALR 00843000
  896. * 00844000
  897. * ENTRY POINT - 00845000
  898. * 00846000
  899. * DMKFRERS 00847000
  900. * 00848000
  901. * ENTRY CONDITIONS - 00849000
  902. * 00850000
  903. * NONE 00851000
  904. * 00852000
  905. * EXIT CONDITIONS - 00853000
  906. * 00854000
  907. * ALL GPR'S UNCHANGED 00855000
  908. * 00856000
  909. * CALLS TO OTHER ROUTINES - 00857000
  910. * 00858000
  911. * INVOKES INTERNAL CODE IN DMKFREE TO RETURN 00859000
  912. * SUBPOOLS TO FREE STORAGE CHAIN. 00860000
  913. * 00861000
  914. * EXTERNAL REFERENCES - 00862000
  915. * 00863000
  916. * NONE 00864000
  917. * 00865000
  918. * TABLES / WORK AREAS 00866000
  919. * 00867000
  920. * FREESAVE (16 WORDS USED TO SAVE REGISTERS) 00868000
  921. * 00869000
  922. * REGISTER USAGE - 00870000
  923. * 00871000
  924. * GPR 12 = ADDRESSABILITY 00872000
  925. * GPR 13 = LINKING REGISTER TO CODE IN DMKFREE WHICH 00873000
  926. * RETURNS SUBPOOLS TO FREE STORAGE CHAIN 00874000
  927. * 00875000
  928. * GPR 11 IS NOT USED 00876000
  929. * 00877000
  930. * OTHER REGISTERS = WORK REGISTERS 00878000
  931. * 00879000
  932. * NOTES - 00880000
  933. * 00881000
  934. * CALLED (FOR EXAMPLE) FROM DMKUSOFF AFTER ALL 00882000
  935. * BLOCKS FOR A VIRTUAL MACHINE HAVE BEEN DMKFRET'D. 00883000
  936. EJECT 00884000
  937. * OPERATION - 00885000
  938. * 00886000
  939. * 1. SAVES REGISTERS (IN FREESAVE), SETS COMMON ADDRESSABILITY. 00887000
  940. * 00888000
  941. * 2. INVOKES COMMON CODE IN DMKFREE TO RETURN ALL SUBPOOL 00889000
  942. * BLOCKS TO THE FREE STORAGE CHAIN. 00890000
  943. * 00891000
  944. * 3. RESTORES REGISTERS AND RETURNS TO CALLER. 00892000
  945. *. 00893000
  946. SPACE 2 00894000
  947. ENTRY DMKFRERS @VA00881 00895000
  948. DMKFRERS STM R0,R15,FREESAVE ENTER - SAVE REGISTERS @VA00881 00896000
  949. L R12,AFREE COMMON ADDRSSABILITY NEEDED @VA00881 00897000
  950. USING DMKFRE,R12 ... @VA00881 00898000
  951. AIF (NOT &AP).NOAP4 **AIF*** 00899000
  952. BAL R14,LOCKFRE LOCK DMKFRE @V407594 00900000
  953. .NOAP4 ANOP **ANOP** 00901000
  954. INCR SUBRETN COUNT HOW MANY TIMES WE DO THIS @VA00881 00902000
  955. * NOW RETURN THE VARIOUS SUBPOOL(S) TO THE FREE STORAGE CHAIN: 00903000
  956. LA R9,SUBSIZES LET R9 POINT TO FIRST SIZE @VA00881 00904000
  957. FREE12 L R1,DISPSUBT(,R9) GET A SUBPOOL POINTER @VA00881 00905000
  958. LTR R1,R1 ANYTHING THERE ? @VA00881 00906000
  959. BZ FREE15 BZ IF NOT. @VA00881 00907000
  960. FREE13 L R10,PNTR(,R1) SAVE NEXT POINTER (IF ANY) IN @VA00881 00908000
  961. * R10, 00909000
  962. L R2,0(,R9) SIZE INTO R2 AS NEEDED, @VA00881 00910000
  963. STM R9,R10,SAVE910 SAVE R9 AND R10 @VA00881 00911000
  964. BAL R10,FRET05 CALL MAIN FRET LOGIC TO GIVE IT @VA00881 00912000
  965. * BACK 00913000
  966. LM R9,R10,SAVE910 RESTORE R9 AND R10 @VA00881 00914000
  967. INCR SUBRETAC COUNT HOW MANY SUBPOOLS @VA00881 00915000
  968. * ACTUALLY RETURNED 00916000
  969. LTR R1,R10 ANYTHING LEFT IN THIS SUBPOOL ? @VA00881 00917000
  970. BNZ FREE13 BNZ IF YES, KEEP GIVING 'EM BACK.@VA00881 00918000
  971. ST R1,DISPSUBT(,R9) CLEAR ORIGINAL POINTER WHEN @VA00881 00919000
  972. * THRU 00920000
  973. FREE15 LA R6,4 SET UP R6 & R7 FOR BXLE, @VA00881 00921000
  974. LA R7,ENDSIZES-4 ... @VA00881 00922000
  975. BXLE R9,R6,FREE12 ITERATE THE MAIN LOOP. @VA00881 00923000
  976. BAL R10,FREE09B ALSO, GIVE BACK ANY LARGE BLOCKS @VA05235 00924000
  977. * ALL THRU ... 00925000
  978. AIF (NOT &AP).NOAP5 **AIF*** 00926000
  979. BAL R14,RELFRE RELEASE DMKFRE LOCK @V407594 00927000
  980. .NOAP5 ANOP **ANOP** 00928000
  981. LM R0,R15,FREESAVE RESTORE REGISTERS, @VA00881 00929000
  982. BR R14 AND EXIT TO CALLER. @VA00881 00930000
  983. EJECT 00931000
  984. *. 00932000
  985. * SUBROUTINE NAME - 00933000
  986. * 00934000
  987. * DMKFRET 00935000
  988. * 00936000
  989. * FUNCTION - 00937000
  990. * 00938000
  991. * TO RETURN A BLOCK SPECIFIED BY THE CALLER EITHER TO 00939000
  992. * THE APPROPRIATE SUBPOOL BLOCK OF FREE STORAGE, 00940000
  993. * OR TO THE CHAINED LIST OF FREE STORAGE. 00941000
  994. * 00942000
  995. * ATTRIBUTES - 00943000
  996. * 00944000
  997. * SERIALLY REUSABLE, RESIDENT, CALLED VIA BALR 00945000
  998. * 00946000
  999. * ENTRY POINTS - 00947000
  1000. * 00948000
  1001. * DMKFRET - RETURN A SUBPOOL OR OTHER BLOCK TO FREE STORAGE 00949000
  1002. * DMKFRETR - RETURN A BLOCK TO THE CHAINED LIST OF FREE STORAGE 00950000
  1003. * (IGNORING SUBPOOLS) 00951000
  1004. * 00952000
  1005. * ENTRY CONDITIONS - 00953000
  1006. * 00954000
  1007. * GPR 0 = NUMBER OF DOUBLE WORDS TO BE RETURNED 00955000
  1008. * GPR 1 = ADDRESS OF FIRST DOUBLE-WORD OF BLOCK TO BE RETURNED 00956000
  1009. * GPR 14 = RETURN ADDRESS 00957000
  1010. * GPR 15 = ADDRESS OF DMKFRET OR DMKFRETR 00958000
  1011. * 00959000
  1012. * EXIT CONDITIONS - 00960000
  1013. * 00961000
  1014. * ALL GPR'S UNCHANGED 00962000
  1015. * 00963000
  1016. * CALLS TO OTHER ROUTINES - 00964000
  1017. * 00965000
  1018. * DMKPTRFT - CALLED TO RETURN PAGE(S) TO DYNAMIC PAGING AREA 00966000
  1019. * 00967000
  1020. * EXTERNAL REFERENCES - 00968000
  1021. * 00969000
  1022. * DMKCPE - END OF CP NUCLEUS 00970000
  1023. * DMKSYSRM - SIZE OF REAL MACHINE 00971000
  1024. * DMKDSPNP - NUMBER OF PAGES AVAILABLE FOR PAGING USE 00972000
  1025. * | DMKQCNFT - ADDRESS OF PARTICULAR DMKFRET CALL IN DMKQCN 00973000
  1026. * | DMKVCNFT - ADDRESS OF PARTICULAR DMKFRET CALL IN DMKVCN 00974000
  1027. * 00975000
  1028. * TABLES / WORK AREAS - 00976000
  1029. * 00977000
  1030. * FREESAVE (16 WORDS) USED TO SAVE REGISTERS 00978000
  1031. * FREEWORK (UP TO 12 WORDS) USED FOR SCRATCH STORAGE 00979000
  1032. EJECT 00980000
  1033. * REGISTER USAGE - 00981000
  1034. * 00982000
  1035. * GPR 0 - 10 = WORK REGISTERS 00983000
  1036. * GPR 11 IS NOT USED 00984000
  1037. * GPR 12 = MODULE BASE REGISTER 00985000
  1038. * GPR 13 - 15 = WORK REGISTERS 00986000
  1039. * 00987000
  1040. * NOTES - 00988000
  1041. * 00989000
  1042. * DMKFRETR IS CALLED BY DMKCPINT OR DMKPTRFR TO MERGE AVAILABLE 00990000
  1043. * BLOCKS OF CORE INTO THE FREE STORAGE CHAIN, REGARDLESS OF 00991000
  1044. * THEIR SIZE. OTHER PROGRAMS CALL DMKFRET TO RETURN BLOCKS 00992000
  1045. * PREVIOUSLY OBTAINED FROM DMKFREE, OF EITHER SMALL (SUBPOOL) 00993000
  1046. * OR LARGE SIZE, WHEN THEY ARE NO LONGER NEEDED. 00994000
  1047. * 00995000
  1048. * OPERATION - 00996000
  1049. * 00997000
  1050. * 1. THE NUMBER OF DOUBLE WORDS TO BE RETURNED IS CHECKED. IF 00998000
  1051. * A ZERO OR NEGATIVE VALUE IS FOUND (INDICATING A SERIOUS CODING 00999000
  1052. * ERROR), AN ABEND OCCURS VIA SVC 0. OTHERWISE, DMKFRET 01000000
  1053. * PROCEEDS TO STEP 2 FOR SUBPOOL SIZES, OR TO STEP 3 FOR 01001000
  1054. * LARGER SIZES. DMKFRETR PROCEEDS DIRECTLY TO STEP 3. 01002000
  1055. * 01003000
  1056. * 2. DMKFRET OF SUBPOOL SIZES: 01004000
  1057. * 01005000
  1058. * THE SUBPOOL SIZE BLOCK IS ATTACHED TO THE APPROPRIATE 01006000
  1059. * SUBPOOL ON A LIFO (PUSH DOWN STACK) BASIS, WITH THE 01007000
  1060. * POINTER AT "SUBTABLE" BEING CORRECTED TO POINT TO 01008000
  1061. * THE BLOCK JUST RETURNED. IF, HOWEVER, THE BLOCK BEING 01009000
  1062. * RETURNED IS WITHIN THE DYNAMIC PAGING AREA, IT IS RETURNED 01010000
  1063. * TO THE FREE STORAGE CHAIN INSTEAD, VIA STEP 3. 01011000
  1064. * 01012000
  1065. * 3. DMKFRET OR DMKFRETR OF BLOCK TO FREE STORAGE CHAIN: 01013000
  1066. * 01014000
  1067. * A BLOCK OF LARGER THAN 30 DOUBLE WORDS, OR ONE RETURNED 01015000
  1068. * BY DMKFRETR, OR A SUBPOOL-SIZE BLOCK WITHIN THE DYNAMIC 01016000
  1069. * PAGING AREA, IS MERGED APPROPRIATELY INTO THE CHAIN OF 01017000
  1070. * FREE STORAGE POINTED TO BY "DMKFRELS". THEN, UNLESS 01018000
  1071. * DMKFRETR WAS INVOKED (OR DMKPTRFR WAS THE CALLER), 01019000
  1072. * A CHECK IS MADE TO SEE IF THE AREA RETURNED (AFTER ALL 01020000
  1073. * MERGING HAS BEEN DONE) IS AT LEAST A WHOLE PAGE WITHIN 01021000
  1074. * THE DYNAMIC PAGING AREA. IF SO, IT IS RETURNED VIA 01022000
  1075. * | DMKPTRFT TO THE DYNAMIC PAGING AREA, UNLESS IT WAS RETURNED 01023000
  1076. * | BY A SPECIFIC PROGRAM (E.G. DMKQCNFT OR DMKVCNFT) KNOWN TO USE 01024000
  1077. * | "LARGE" BLOCKS FREQUENTLY FOR VERY SHORT PERIODS OF TIME. 01025000
  1078. * | IN THIS CASE, DMKPTRFR IS PURPOSELY NOT CALLED, TO AVOID 01026000
  1079. * | CONTINUAL "EXTENDING AND DIS-EXTENDING" OVER VERY SHORT 01027000
  1080. * | TIME INTERVALS. 01028000
  1081. * 01029000
  1082. * (THE LOGIC AS DESCRIBED ABOVE ALLOWS THE NUMBER OF PAGES 01030000
  1083. * ALLOTTED FOR FREE STORAGE TO "BREATHE" AS NECESSARY, 01031000
  1084. * EXPANDING VIA CALLS TO DMKPTRFR WHEN EXTRA PAGES ARE 01032000
  1085. * REQUIRED, AND CONTRACTING VIA DMKPTRFT WHEN SUCH PAGES 01033000
  1086. * HAVE ALL BEEN RETURNED VIA DMKFRET AND ARE NO LONGER 01034000
  1087. * NEEDED.) 01035000
  1088. *. 01036000
  1089. EJECT 01037000
  1090. *********************************************************************** 01038000
  1091. * * 01039000
  1092. * "FRET" IS CALLED AS FOLLOWS --- * 01040000
  1093. * * 01041000
  1094. * LA 0,NDBLWRDS SIZE OF BLOCK RETURNED IN DOUBLE WORDS. * 01042000
  1095. * LA 1,BLOCK ADDRESS OF BEGINNING OF BLOCK. * 01043000
  1096. * CALL DMKFRET .. * 01044000
  1097. * * 01045000
  1098. * "FRETR" HAS SAME R0 AND R1 ENTRY REQUIREMENTS. * 01046000
  1099. * * 01047000
  1100. *********************************************************************** 01048000
  1101. *. 01049000
  1102. *********************************************************************** 01050000
  1103. * 01051000
  1104. * 01052000
  1105. * CP ASSIST INSTRUCTION "FRETX" 01053000
  1106. * - RETURN SUBPOOL SIZE FREE SPACE 01053500
  1107. * 01054000
  1108. * 01055000
  1109. * OPERANDS: 01056000
  1110. * 1 = ADDRESS OF 'MAXSIZE' FOLLOWED BY 'SUBTABLE' 01057100
  1111. * 2 = ADDRESS OF 'DMKFRETL' 01058000
  1112. * 01059000
  1113. * REGISTER INPUT: 01060000
  1114. * GPR 0 = A SIGNED 32 BIT INTEGER SPECIFYING THE NUMBER OF 01061000
  1115. * DOUBLEWORDS OF FREE SPACE BEING RETURNED 01062000
  1116. * GPR 1 = THE ADDRESS OF THE FREE SPACE BEING RELEASED 01063000
  1117. * GPR 11 = ADDRESS OF THE REQUESTOR'S VMBLOK 01064000
  1118. * GPR 14 = EXIT ADDRESS (USED UPON NORMAL COMPLETION) 01065000
  1119. * 01066000
  1120. * SYSTEM DATA AREAS REFERENCED (BY MODULE): 01067000
  1121. * DMKFRE - 'BYTBL', 'MAXSIZE' AND 'SUBTABLE' 01068100
  1122. * DMKPSA - TRACING INFORMATION, ALOKFR, LPUADDR 01069000
  1123. * DMKSYS - 'CORTABLE' 01070000
  1124. * 01071000
  1125. * 01072000
  1126. * EXITS: 01073000
  1127. * 01074000
  1128. * 1. ADDRESS IN GPR 14 (NORMAL COMPLETION) 01075000
  1129. * 01076000
  1130. * REGISTER OUTPUT: NONE CHANGED BY THIS INSTRUCTION 01077000
  1131. * 01078000
  1132. * 2. NEXT SEQUENTIAL INSTRUCTION (ABNORMAL COMPLETION) 01079000
  1133. * 01080000
  1134. * NOTE: THIS EXIT IS FUNCTIONALLY EQUIVALENT TO A NO-OP. 01081000
  1135. * 01081090
  1136. * NOTE: 01081180
  1137. * 01081270
  1138. * THE RETURN FREE SPACE EXTENDED (X'E615') INSTRUCTION IS 01081360
  1139. * SUPPORTED ONLY UNDER ECPS:VM LEVEL 20. IT ALLOWS FOR 01081450
  1140. * A VARIABLE NUMBER OF VARIABLE SIZE SUBPOOLS. 01081540
  1141. * IF VM/370 IS IPLED ON A MACHINE THAT HAS ECPS:VM LEVEL 18 01081630
  1142. * OR 19, DMKCPI WILL ALTER THE X'E615' INSTRUCTION IN 01081720
  1143. * DMKFRE BACK TO THE OLD-STYLE X'E601' INSTRUCTION DURING 01081810
  1144. * THE IPL OF VM/370. 01081900
  1145. * 01082000
  1146. *********************************************************************** 01083000
  1147. *. 01084000
  1148. SPACE 01085000
  1149. USING DMKFRETR,R15 (BRIEFLY) 01086000
  1150. DMKFRETR STM R0,R15,FREESAVE ENTER "FRETR" - SAVE REGISTERS 01087000
  1151. L R10,TOTWORDS @V408246 01088000
  1152. AR R10,R0 INCREMENT TOTAL DBL WRDS @V408246 01089000
  1153. * ALLOCATED 01090000
  1154. ST R10,TOTWORDS @V408246 01091000
  1155. LA R10,FRET01 SET R10 TO GO TO 'FRET01' 01092000
  1156. B FRET00 JOIN FORCES BELOW. 01093000
  1157. EJECT 01094000
  1158. USING DMKFRET,R15 (BRIEFLY) 01095000
  1159. DMKFRET DS 0D ENTER "FRET" @V386198 01096000
  1160. SPACE 01097000
  1161. DS 0H EXECUTE CP ASSIST "FRETX" @VA14280 01098000
  1162. * NOTE THE FOLLOWING CHANGED TO X'E601',S(SUBTABLE,DMKFRETL) 01098500
  1163. * IF RUNNING BELOW ECPS LEVEL 20. 01099000
  1164. DC X'E615',S(MAXSIZE,DMKFRETL) %VA14280 01099500
  1165. SPACE 01100000
  1166. STM R0,R15,FREESAVE - SAVE REGISTERS %V3M4038 01101000
  1167. AIF (NOT &FRETRAP).NOFTR7 HRC035DK 01101060
  1168. LTR R7,R0 INDEXABLE REG FOR TEST POSITIVE HRC035DK 01101120
  1169. BNP ERROR1 ABEND 1 IF INVALID HRC035DK 01101180
  1170. LA R0,1(,R7) BUMP RELEASE COUNT BY ONE HRC035DK 01101240
  1171. SLL R7,3 MULTIPLY BY 8 HRC035DK 01101300
  1172. L R8,=X'9AC7E5D5' GET SPECIAL CONSTANT HRC035DK 01101360
  1173. C R8,0(R1,R7) CHECK IT HRC035DK 01101420
  1174. BE SKIPBY BLOCK OK FOR NOW HRC035DK 01101480
  1175. ABEND 13 FRE013 ABEND HRC035DK 01101540
  1176. SPACE , HRC035DK 01101600
  1177. SKIPBY DS 0H HRC035DK 01101660
  1178. L R8,=X'C6D9C5C5' REPLACE CONSTANT WITH "FREE" HRC035DK 01101720
  1179. ST R8,0(R1,R7) TO TRAP 2ND FRET OF SAME BLOCK HRC035DK 01101780
  1180. .NOFTR7 ANOP , HRC035DK 01101840
  1181. LM R7,R10,ADCONFRT INITIALIZE R7-R10 FOR FRET USE %V3M4038 01102000
  1182. FRET00 L R12,AFREE CHANGE ADDRESSABILITY BACK %V3M4038 01103000
  1183. DROP R15 TO STANDARD BASE REGISTER, R12 %V3M4038 01104000
  1184. USING DMKFRE,R12 ... %V3M4038 01105000
  1185. AIF (NOT &AP).NOAP6 **AIF*** 01106000
  1186. LOCK OBTAIN,TYPE=FREE,SPIN=YES,SAVE LOCK DMKFRE %V407594 01107000
  1187. .NOAP6 ANOP **ANOP** 01108000
  1188. AIF (NOT &TRACE(9)).TR2 %V3M4038 01109000
  1189. TM TRACFLG1,TRAC67 TRACING ACTIVE? %V3M4038 01110000
  1190. BZ NOFRETTR BRANCH IF NOT %V3M4038 01111000
  1191. TRACE CODE=TRCFRET,R15,R2,R3 OBTAIN TRACE TBL SLOT %V407594 01112000
  1192. STCM R11,B'0111',1(R15) VMBLOK OF CALLER %V407594 01113000
  1193. AIF (NOT &FRETRAP).NOFTR8 HRC035DK 01113100
  1194. L R2,FREER0 GET ORIGINAL FRET REQUEST HRC035DK 01113200
  1195. ST R2,4(,R15) SAVE IT IN TRACE TABLE HRC035DK 01113300
  1196. AGO .NOFTR8A HRC035DK 01113400
  1197. .NOFTR8 ANOP , HRC035DK 01113500
  1198. ST R0,4(,R15) SAVE GPR0 %V3M4038 01114000
  1199. .NOFTR8A ANOP , HRC035DK 01114500
  1200. ST R1,8(,R15) SAVE GPR1 %V3M4038 01115000
  1201. ST R14,12(,R15) SAVE GPR14 %V3M4038 01116000
  1202. NOFRETTR EQU * %V3M4038 01117000
  1203. .TR2 ANOP %V3M4038 01118000
  1204. LA R1,0(,R1) STRIP HIGH-ORDER BYTE FROM R1 %V3M4038 01119000
  1205. LR R2,R1 ADDRESS OF BLOCK INTO R2 %V3M4038 01120000
  1206. N R2,XPAGNUM GET PAGE NUMBER %V3M4038 01121000
  1207. SRL R2,8 DIVIDED BY 256 %V3M4038 01122000
  1208. A R2,ACORETBL POINT TO CORETABLE ENTRY %V3M4038 01123000
  1209. USING CORTABLE,R2 ... %V3M4038 01124000
  1210. CLC CORFPNT,FREE PAGE FLAGGED CORRECTLY ? %V3M4038 01125000
  1211. BE R1OK YES - OK. %V3M4038 01126000
  1212. DROP R2 ... @V3M4038 01127000
  1213. CL R1,=A(DMKCPE) LOCATION WITHIN CP NUCLEUS ? @V3M4038 01128000
  1214. BL ERROR5 YES - ISSUE ABEND 5 @V3M4038 01129000
  1215. CL R1,DMKFRELO CHECK R1 - IN LOW-CORE AREA ? 01130000
  1216. BL R1OK OK. 01131000
  1217. SPACE 01132000
  1218. L R15,=A(DMKSYSRM) GET REAL MACHINE SIZE @V386198 01133000
  1219. CL R1,0(,R15) ADDRESS WITHIN REAL STORAGE ? @V386198 01134000
  1220. BNL ERROR7 NO - ISSUE ABEND 7 @V386198 01135000
  1221. ABEND 11 ELSE ADDRESSING USER PAGING AREA @V386198 01136000
  1222. SPACE 01137000
  1223. R1OK EQU * R1 SEEMS REASONABLE, CONTINUE: %V3M4038 01138000
  1224. LTR R2,R0 SIZE BEING RETURNED INTO R2, %V3M4038 01139000
  1225. BPR R10 OK, GO TO 'CHEKSIZE' OR 'FRET01' %V3M4038 01140000
  1226. B ERROR1 ERROR 1 IF R0 = 0 (OR < 0). 01141000
  1227. EJECT 01142000
  1228. * CONTINUE HERE IF NOT SUBPOOL SIZE, FOR FRET: 01143000
  1229. SPACE 01144000
  1230. CNOP 6,8 DBL-WORD-ALIGN 'FRET04' @V3M4038 01145000
  1231. FRET01 SR R10,R10 R10=0 MEANS INVOKED BY 'FRET' OR 'FRETR' 01146000
  1232. * 01147000
  1233. FRET05 SLL R2,3 CHANGE DOUBLE-WORDS TO BYTES 01148000
  1234. * 01149000
  1235. * REGISTERS AT ENTRY... 01150000
  1236. * R1 HOLDS ADDRESS OF BLOCK BEING RETURNED ('THIS BLOCK') 01151000
  1237. * R2 HOLDS SIZE (IN BYTES) OF BLOCK BEING RETURNED 01152000
  1238. * R10 = 0 IF INVOKED BY 'FRET' OR 'FRETR' 01153000
  1239. * OR 01154000
  1240. * R10 = RETURN REGISTER IF INVOKED BY 'FREE'. 01155000
  1241. * 01156000
  1242. L R0,FREENUM FREENUM --> R0, 01157000
  1243. LTR R4,R0 (ALSO IN R4), IS FREENUM = 0 ? 01158000
  1244. BZ FRET18 IF YES, THIS BLOCK WILL BE THE ONLY ONE. 01159000
  1245. LA R6,DMKFRELS START AT BEGINNING OF CHAIN, 01160000
  1246. LA R5,FRET04 SET R5 FOR LOOP AT FRET04, 01161000
  1247. SR R3,R3 CLEAR "OLD POINTER" 01162000
  1248. * 01163000
  1249. FRET04 LR R9,R3 REMEMBER OLD VALUE OF OLD POINTER, 01164000
  1250. LR R3,R6 SAVE OLD POINTER, 01165000
  1251. L R6,PNTR(,R6) GET NEW POINTER, 01166000
  1252. CLR R1,R6 CHECK THIS BLOCK AGAINST NEW POINTER 01167000
  1253. BNH FRET06 BNH IF R1 < R6 (OR =) 01168000
  1254. BCTR R4,R5 IF NOT, ITERATE SCAN-LOOP 'FREENUM' TIMES 01169000
  1255. LR R9,R3 REMEMBER "OLD R3" IN R9 FOR LATER, 01170000
  1256. LR R3,R6 IF DROPS THRU LOOP, ADVANCE R3 TO POINT 01171000
  1257. SR R6,R6 TO LAST BLOCK IN CHAIN, AND CLEAR R6, 01172000
  1258. * NOTE: PNTR FOR OUR BLOCK IS SET AT FRET10 01173000
  1259. L R5,=A(DMKSYSRM) GET SIZE OF REAL MACHINE 01174000
  1260. LA R4,0(R1,R2) COMPUTE END OF THIS BLOCK 01175000
  1261. CL R4,0(,R5) WITHIN OUR MACHINE ? 01176000
  1262. BNH FRET08 IF YES, PROCEED AS USUAL. 01177000
  1263. B ERROR7 "DIE" IF EXCEEDS REAL MACHINE SIZE. 01178000
  1264. * 01179000
  1265. * R3 = ADDRESS OF PRECEDING BLOCK, R6 = ADDRESS OF SUCCEEDING BLOCK 01180000
  1266. FRET06 BE ERROR2 ERROR IF EQUAL, OTHERWISE THIS BLOCK OK 01181000
  1267. LM R7,R8,PNTR(R6) GET POINTER & SIZE FROM SUCCEEDING BLOCK 01182000
  1268. * 01183000
  1269. FRET08 DS 0H NOTE - FREENUM IS STILL IN R0, 01184000
  1270. LM R4,R5,PNTR(R3) GET POINTER & SIZE FROM PRECEDING BLOCK 01185000
  1271. STM R3,R8,SAVE38 SAVE ALL OLD INFO IN CASE OVERLAP ERROR 01186000
  1272. ST R2,SIZE(,R1) STORE SIZE IN OUR OWN (THIS) BLOCK 01187000
  1273. LTR R14,R5 CHECK IF SIZE OF PRECEDING BLOCK = 0 01188000
  1274. BZ FRET10 (POSSIBLE IF R1 IS AT DMKFRELS) 01189000
  1275. AR R14,R3 COMPUTE END OF PREVIOUS BLOCK 01190000
  1276. CLR R14,R1 DOES PREVIOUS BLOCK ABUT OUR BLOCK ? 01191000
  1277. BL FRET10 BL IF NOT, 01192000
  1278. BH ERROR3 ERROR 3 IF IT OVERLAPS 01193000
  1279. AR R2,R5 MERGE SIZES OF PREVIOUS AND THIS BLOCK, 01194000
  1280. ST R2,SIZE(,R3) STORE AS NEW SIZE OF PREVIOUS BLOCK, 01195000
  1281. LR R1,R3 R1 NOW = POINTER TO MERGED BLOCK. 01196000
  1282. LTR R6,R6 IS THERE A SUCCEEDING BLOCK ? 01197000
  1283. BNZ FRET12 BNZ IF YES, CHECK FOR MERGE THERE TOO. 01198000
  1284. B FRET15 IF NONE, WE'RE ALL DONE (FREENUM OK AS IS) 01199000
  1285. * 01200000
  1286. FRET10 ST R4,PNTR(,R1) PUT OLD POINTER INTO OUR BLOCK, 01201000
  1287. ST R1,PNTR(,R3) POINTER TO OUR BLOCK REPLACES OLD POINTER 01202000
  1288. AL R0,F1 ADD 1 TO FREENUM, 01203000
  1289. LTR R6,R6 IS THERE A SUCCEEDING BLOCK ? 01204000
  1290. BZ FRET14 BZ IF NOT, GO STORE UPDATED FREENUM. 01205000
  1291. * 01206000
  1292. FRET12 LA R14,0(R1,R2) COMPUTE END OF OUR BLOCK, 01207000
  1293. CLR R14,R6 DO WE ABUT SUCCEEDING BLOCK ? 01208000
  1294. BL FRET14 BL IF NOT, GO STORE UPDATED FREENUM. 01209000
  1295. BH ERROR4 ERROR IF OVERLAP 01210000
  1296. AR R8,R2 IF YES, MERGE SIZES, 01211000
  1297. STM R7,R8,PNTR(R1) STORE CORRECT POINTER & SIZE IN OUR BLOCK 01212000
  1298. LR R2,R8 (KEEP SIZE IN R2 CURRENT) 01213000
  1299. BCTR R0,0 DECREMENT FREENUM BY 1 01214000
  1300. * 01215000
  1301. FRET14 ST R0,FREENUM STORE UPDATED FREENUM. 01216000
  1302. * 01217000
  1303. FRET15 LTR R10,R10 INVOKED BY 'FREE' OR 'FRET' ? 01218000
  1304. BCR 7,R10 'BNZ' IF INVOKED BY 'FREE' - GO RETURN. 01219000
  1305. CL R2,F4096 IS SIZE OF CHUNK A PAGE OR MORE ? 01220000
  1306. BL FRET20 TRF IF NOT, GO EXIT FROM FRET 01221000
  1307. LA R10,FRET20 R10 = A(FRET20) FOR MANY REFERENCES BELOW 01222000
  1308. LA R14,DMKFRETR WAS THIS A DMKFRETR CALL ? 01223000
  1309. CL R14,FREER15 ... 01224000
  1310. BCR 8,R10 TRF IF YES (VIA DMKFRETR) - DON'T GIVE BACK 01225000
  1311. CL R1,DMKFREHI ARE WE IN DYNAMIC PAGING AREA ? 01226000
  1312. BCR 11,R10 'BNL FRET20' IF NOT. 01227000
  1313. CL R1,DMKFRELO (CHECK FOR LOWER FREE AREA ALSO) 01228000
  1314. AIF (&VIRREAL).J9 @VA00881 01229000
  1315. BCR 4,R10 'BL FRET20' IF IN THERE 01230000
  1316. AGO .J9A @VA00881 01231000
  1317. .J9 BNL FRET15A TO FRET15A IF IN DYNAMIC PAGING AREA. 01232000
  1318. CL R1,=A(DMKSLC) IF < DMKFRELO, LOOK FOR BLOCK @VA00881 01233000
  1319. * IN V=R AREA 01234000
  1320. BCR 11,R10 'BNL FRET20' IF NOT IN DYNAMIC @VA00881 01235000
  1321. * PAGING AREA 01236000
  1322. .J9A ANOP BEGINNING OF BLOCK IS IN DYNAMIC PAGING AREA: 01237000
  1323. FRET15A L R14,PREFIXA LOAD PREFIX VALUE @V407594 01238000
  1324. CLI XTNDLOCK-PSA(R14),00 IS SYSTEM EXTENDING @V047594 01239000
  1325. * RIGHT NOW ? 01240000
  1326. BCR 7,R10 'BNE FRET20' IF YES - DON'T CALL "PAGE-FRET" 01241000
  1327. CLR R3,R1 IS A "PREVIOUS BLOCK" AVAILABLE ? 01242000
  1328. BL FRET22 TRF IF YES (NO PROBLEM) 01243000
  1329. LTR R3,R9 IF NOT (WE DID A MERGE), DO WE HAVE AN 01244000
  1330. BCR 8,R10 "OLD R3" ? (OUT OF LUCK IF NOT). 01245000
  1331. FRET22 LA R5,4095(,R1) ROUND UP TO BEG. NEXT PAGE 01246000
  1332. N R5,XPAGNUM ... 01247000
  1333. LR R8,R5 LET'S HAVE THAT IN R8, 01248000
  1334. SR R8,R1 MINUS BEGINNING OF OUR BLOCK 01249000
  1335. LR R7,R2 SIZE OUR BLOCK INTO R7, 01250000
  1336. SR R7,R8 MINUS FRONT OF US 01251000
  1337. SR R6,R6 NOW HOW MUCH CAN WE GIVE BACK ? 01252000
  1338. D R6,F4096 ONE OR MORE PAGES WE HOPE ? 01253000
  1339. LTR R2,R7 CHECK QUOTIENT (& PLACE IN R2) 01254000
  1340. BCR 13,R10 BNP IF NOT > 0, FORGET THE WHOLE THING. 01255000
  1341. * CHECK FOR KNOWN CASES OF OFTEN-USED BLOCKS OF VERY SHORT DURATION: 01256000
  1342. L R14,FREER14 GET ADDRESS OF CALLER, @VA05235 01257000
  1343. LA R14,0(,R14) (WITHOUT HIGH-ORDER BYTE) @VA05235 01258000
  1344. L R15,PREFIXA LOAD PREFIX VALUE @V407594 01259000
  1345. CL R14,SAMEFRET-PSA(,R15) SAME GUY AS LAST TIME? @V407594 01260000
  1346. ST R14,SAMEFRET-PSA(,R15) SAVE FREER14 (CC INTACT) @V407594 01261000
  1347. BNE FRET22A IF A NEW GUY - GIVE IT BACK @VA05235 01262000
  1348. CL R2,F1 JUST ONE PAGE (PER R2 COUNT) ? @VA05235 01263000
  1349. BH FRET22A IF MORE THAN ONE, GIVE THEM BACK @VA05235 01264000
  1350. * CHECK FOR THE SAME CALLER CONTINUALLY OBTAINING & RETURNING STORAGE: 01265000
  1351. CL R14,=A(DMKQCNFT) IS HE A "KNOWN CULPRIT" ? @VA05235 01266000
  1352. BER R10 "BE FRET20" IF YES (GO EXIT). @VA05235 01267000
  1353. CL R14,=A(DMKVCNFT) OR ANOTHER "KNOWN CULPRIT" ? @VA05235 01268000
  1354. BER R10 "BE FRET20" IF YES (GO EXIT). @VA05235 01269000
  1355. FRET22A BAL R10,FRET22J GIVE BACK THE KNOWN LARGE BLOCK @VA05235 01270000
  1356. BAL R10,FREE09B GIVE BACK ANY OTHER LARGE BLOCKS @VA05235 01271000
  1357. B FRET20 THEN GO EXIT. @VA05235 01272000
  1358. SPACE 01273000
  1359. FRET22J EQU * BAL HERE (R10) TO CLEAN UP FREE @VA05235 01274000
  1360. * STORAGE CHAIN: 01275000
  1361. LR R9,R5 REMEMBER IN R9 ADD. OF AREA TO PAGE-FRET 01276000
  1362. L R4,PNTR(,R1) GET POINTER IN OUR BLOCK, 01277000
  1363. SLL R2,12 MAKE R2 INTO BYTES PLEASE, 01278000
  1364. AR R2,R5 END-OF-AREA INTO R2 (NEEDED) 01279000
  1365. LTR R8,R8 IS THERE STUFF BELOW WHERE WE RETURNED ? 01280000
  1366. BP FRET26 TRF IF YES. 01281000
  1367. LTR R6,R6 IF NOT, IS THERE STUFF AFTER THEM ? 01282000
  1368. BP FRET24 TRF IF YES. 01283000
  1369. ST R4,PNTR(,R3) REPLACE POINTER TO US WITH NEW ONE, 01284000
  1370. BCTR R0,0 DECREMENT FREENUM (A WHOLE BLOCK GONE) 01285000
  1371. ST R0,FREENUM ... 01286000
  1372. * 01287000
  1373. FRET23 DS 0H R9 POINTS TO 1ST PAGE TO BE RETURNED, 01288000
  1374. LR R0,R7 NO. OF CONSEC. PAGE(S) INTO R0, 01289000
  1375. SR R2,R2 CLEAR R2 (FOR USE SHORTLY) 01290000
  1376. * 01291000
  1377. A R7,NPAGFRET BUMP COUNT OF CALLS TO "PAGE-FRET" 01292000
  1378. ST R7,NPAGFRET (BY PAGE-COUNT IN R7/R0), AND STORE 01293000
  1379. L R15,=A(DMKDSPNP) REFERENCE NUMBER OF PAGEABLE PAGES 01294000
  1380. L R14,0(,R15) GET SAME 01295000
  1381. ALR R14,R0 ADD THE NUMBER WE'LL BE GIVING BACK, 01296000
  1382. ST R14,0(,R15) AND REPLACE 01297000
  1383. LR R14,R0 @V408246 01298000
  1384. SLL R14,9 PAGESX512 = DOUBLE WORDS @V408246 01299000
  1385. L R15,TOTWORDS @V408246 01300000
  1386. SR R15,R14 DEC. TOTWORDS @V408246 01301000
  1387. ST R15,TOTWORDS AND SAVE... @V408246 01302000
  1388. MVC EXTNDSV2(16*4),BALRSAVE SAVE BALRSAVE @VA09919 01303100
  1389. * 01304000
  1390. LR R7,R9 FORM CORE-TABLE ADDRESS 01305000
  1391. SRL R7,8 ... 01306000
  1392. A R7,ACORETBL ... 01307000
  1393. USING CORTABLE,R7 01308000
  1394. FRET23A ST R2,CORPGPNT CLEAR PAGE POINTER 01309000
  1395. CALL DMKPTRFT "PAGE FRET" RETURNS IT TO THE SYSTEM 01310000
  1396. LA R7,16(,R7) BUMP R7 TO NEXT PAGE (IF ANY) 01311000
  1397. BCT R0,FRET23A AND ITERATE IF MORE THAN ONE PAGE. 01312000
  1398. DROP R7 01313000
  1399. * 01314000
  1400. MVC BALRSAVE(16*4),EXTNDSV2 RESTORE BALRSAVE @VA09919 01315100
  1401. * 01316000
  1402. BR R10 NOW GO EXIT FROM FRET (WE'RE DONE). 01317000
  1403. * 01318000
  1404. FRET24 ST R2,PNTR(,R3) NEW POINTER TO REMAINING AREA, 01319000
  1405. FRET25 LR R5,R4 PUT OUR POINTER WITH OUR NEW SIZE, 01320000
  1406. STM R5,R6,PNTR(R2) STORE POINTER & SIZE IN REMAINING AREA, 01321000
  1407. B FRET23 GO CALL "PAGE FRET" AND THEN EXIT. 01322000
  1408. * 01323000
  1409. FRET26 ST R8,SIZE(,R1) STORE REDUCED SIZE OF OUR BLOCK, 01324000
  1410. LTR R6,R6 IS THERE STUFF AFTER RETURNED PAGES ? 01325000
  1411. BZ FRET23 TRF IT NOT - GO FINISH UP. 01326000
  1412. AL R0,F1 IF YES, BUMP FREENUM UP BY 1 01327000
  1413. ST R0,FREENUM FOR REMAINING BLOCK, 01328000
  1414. ST R2,PNTR(,R1) STORE POINTER TO NEW BLOCK, 01329000
  1415. B FRET25 GO STORE POINTER & SIZE IN NEW BLOCK. 01330000
  1416. * 01331000
  1417. * IF FREENUM = 0, THIS BLOCK WILL BE THE ONE AND ONLY BLOCK... 01332000
  1418. FRET18 ST R1,DMKFRELS DMKFRELS MUST POINT TO OUR BLOCK, 01333000
  1419. ST R0,PNTR(,R1) STORE POINTER OF ZERO 01334000
  1420. ST R2,SIZE(,R1) AND STORE SIZE IN BYTES 01335000
  1421. LA R0,1 1 INTO R0, 01336000
  1422. ST R0,FREENUM STORE FREENUM OF 1 01337000
  1423. L R14,=A(DMKSYSRM) GET SIZE OF REAL MACHINE 01338000
  1424. ALR R2,R1 COMPUTE END OF BLOCK 01339000
  1425. CL R2,0(,R14) WITHIN OUR MACHINE ? 01340000
  1426. BH ERROR7 "DIE" IF EXCEEDS REAL MACHINE SIZE 01341000
  1427. FRET16 LTR R10,R10 INVOKED BY 'FREE' OR 'FRET' ? 01342000
  1428. BZ FRET20 TRF IF FRET (MOST LIKELY). 01343000
  1429. BR R10 OTHERWISE RETURN TO FREE. 01344000
  1430. SPACE 3 01345000
  1431. TOTWORDS DC F'0' TOT NO. OF DBWRDS ALLOC. FOR @V408246 01346000
  1432. * FREE STORAGE 01347000
  1433. DMKFRETO EQU TOTWORDS ENTRY FOR TOTAL DBL WORDS @V408246 01348000
  1434. EJECT 01349000
  1435. * CONSTANTS, TABLES, AND ADDRESS CONSTANTS ... 01350000
  1436. SPACE 2 01351000
  1437. MAXSPSIZ EQU 30 MAXIMUM SIZE OF A SUBPOOL BLOCK @VA14280 01352100
  1438. * BECAUSE IT IS USED BY THE CP ASSIST INSTRUCTIONS "FREE" AND "FRET". 01353000
  1439. * NOTE: THE LIST INCLUDES THE TABLE 'BYTBL'. 01354000
  1440. SPACE 01355000
  1441. DMKFRETL DS 0F @V386198 01356000
  1442. DC V(DMKSYSCS) +0 ADDR OF THE SYSTEM CORE TABLE @V386198 01357000
  1443. FREE DC C'FREE' +4 CORE TABLE FLAG(ON FREE PGS.) @V386198 01358000
  1444. DMKFREHI DC A(0) +8 LOWEST VAL. OF FIXED FREE PGS @V3M4026 01359000
  1445. * (FILLED IN BY DMKCPI) @V386198 01360000
  1446. SPACE 01361000
  1447. * TABLE TO CONVERT SMALL-SIZE REQUESTS TO SUBPOOL SIZES 01362000
  1448. * INDEXER SIZE IN DOUBLE WORDS 01363000
  1449. BYTBL DC 3AL1(S3-Z) 1-3 -------> 3 01364000
  1450. DC 3AL1(S6-Z) 4-6 -------> 6 01365000
  1451. DC 3AL1(S9-Z) 7-9 -------> 9 01366000
  1452. DC 3AL1(S12-Z) 10-12 -----> 12 01367000
  1453. DC 3AL1(S15-Z) 13-15 -----> 15 01368000
  1454. DC 3AL1(S18-Z) 16-18 -----> 18 01369000
  1455. DC 3AL1(S21-Z) 19-21 -----> 21 01370000
  1456. DC 3AL1(S24-Z) 22-24 -----> 24 01371000
  1457. DC 3AL1(S27-Z) 25-27 -----> 27 01372000
  1458. DC 3AL1(S30-Z) 28-30 -----> 30 01373000
  1459. * 01374000
  1460. SPACE 01375000
  1461. AFRERC DC V(DMKFRERC) ENTRY FOR CONDITIONAL FREE CALLS @V407594 01376000
  1462. SPACE 1 @V407594 01377000
  1463. DMKFREAP DC A(0) BACK POCKET FOR AP MODE EXTEND @V407594 01378000
  1464. ORG DMKFREAP @V407594 01379000
  1465. DC AL1(FREAPLNG) LENGTH OF BACK POCKET @V407594 01380000
  1466. DC XL3'0' ADDRESS OF SAVE AREA @VA12596 01381100
  1467. DC F'0' ADDRESS OF CPEXBLOK @VA12596 01381400
  1468. FREAPLNG EQU 16 EXTEND BACK POCKET STORAGE SIZE @VA12596 01381700
  1469. * (FOR THE SAVE AREA ONLY) @VA12596 01382000
  1470. * BACK POCKET SAVE AREA IS USED FOR BALRSAVE AND @VA12596 01382300
  1471. * FREESAVE. THE CPEXBLOK IS USED TO DEFER THE EXTEND WHEN @VA12596 01382600
  1472. * THE SYSTEM LOCK IS UNAVAILABLE. THE TWO AREAS ARE @VA12596 01382900
  1473. * OBTAINED AND GIVEN BACK AS SEPARATE PIECES OF STORAGE. @VA12596 01383200
  1474. AIF (NOT &AP).NOAP13 **AIF*** 01384000
  1475. SPACE 1 @V407594 01385000
  1476. APSAVE DS 16F SAVE AREA FOR AP EXTEND LOGIC @V407594 01386000
  1477. * CPFRELK CONTROLS ACCESS TO APSAVE @V407594 01387000
  1478. .NOAP13 ANOP **ANOP** 01388000
  1479. SPACE 01389000
  1480. SUBSIZES DS 0F SUBPOOL SIZES ... 01390000
  1481. Z EQU SUBSIZES (FOR USE BY "BYTBL" TABLE) 01391000
  1482. * SIZE 01392000
  1483. S3 DC F'3' 01393000
  1484. S6 DC F'6' 01394000
  1485. S9 DC F'9' 01395000
  1486. S12 DC F'12' 01396000
  1487. S15 DC F'15' 01397000
  1488. S18 DC F'18' 01398000
  1489. S21 DC F'21' 01399000
  1490. S24 DC F'24' 01400000
  1491. S27 DC F'27' 01401000
  1492. S30 DC F'30' 01402000
  1493. ENDSIZES EQU * (MUST FOLLOW LAST SUBPOOL SIZE) 01403000
  1494. * 01404000
  1495. ADCONFRE DS 0F ADCONS USED BY "FREE" ENTRY: 01407000
  1496. DC F'0' --> R7 01408000
  1497. DC A(FREE01) --> R8 01409000
  1498. DC A(FREESUB) --> R9 01410000
  1499. * 01411000
  1500. DS 0D ADCONS USED FOR AN UNSATISFIED "FREE" SUBPOOL CALL: 01412000
  1501. ADCON3 DC A(FREE10) --> R3 01413000
  1502. DC A(FREE06A) --> R4 01414000
  1503. ADCON5 DC A(ENDSIZES-SUBSIZES-4) --> R5 @VA14280 01415100
  1504. DC F'-4' --> R6 01416000
  1505. EJECT 01417000
  1506. DS 0D ADCONS USED BY "FRET" ENTRY: 01418000
  1507. ADCONFRT DC F'0' --> R7 01419000
  1508. DC A(FRET01) --> R8 @V3M4038 01420000
  1509. DC A(FRETSUB) --> R9 01421000
  1510. DC A(CHEKSIZE) --> R10 01422000
  1511. LTORG 01423000
  1512. EJECT 01424000
  1513. *********************************************************************** 01425000
  1514. * 01426000
  1515. * ERROR HANDLERS * 01427000
  1516. * 01428000
  1517. *********************************************************************** 01429000
  1518. SPACE 2 01430000
  1519. ERROR1 ABEND 1 ERROR IF R0 = 0 (OR < 0) AT INPUT TO FRET... 01431000
  1520. SPACE 2 01432000
  1521. ERROR2 ABEND 2 ERROR IF BLOCK BEING RETURNED MATCHES PRESENT ONE 01433000
  1522. SPACE 2 01434000
  1523. ERROR3 ABEND 3 ERROR IF LOWER-NUMBERED BLOCK OVERLAPS THIS ONE 01435000
  1524. SPACE 2 01436000
  1525. ERROR4 ABEND 4 ERROR IF THIS ONE OVERLAPS HIGHER-NUMBERED BLOCK 01437000
  1526. SPACE 2 01438000
  1527. ERROR5 ABEND 5 ERROR IF R1 = 0 AT INPUT TO FRET... 01439000
  1528. SPACE 2 01440000
  1529. ERROR6 ABEND 6 ERROR IF R0 = 0 (OR < 0) AT INPUT TO FREE... 01441000
  1530. SPACE 2 01442000
  1531. ERROR7 ABEND 7 ERROR OF END OF AREA BEING FRET'D > REAL MACH. SIZE: 01443000
  1532. SPACE 2 01444000
  1533. ERROR10 ABEND 10 EXTEND WHILE EXTENDING - FREELOCK SET (BY DMKPTRFR) 01445000
  1534. AIF (NOT &AP).NOAP14 **AIF*** 01446000
  1535. SPACE 1 @V407594 01447000
  1536. ERROR12 ABEND 12 RECURSIVE USE OF CPFREELK @V407594 01448000
  1537. SPACE 1 @V407594 01449000
  1538. ERROR15 ABEND 15 RECURSIVE USE OF CPFRESW @V4M0241 01450000
  1539. SPACE 1 @V407594 01451000
  1540. ERROR14 ABEND 14 DMKFREAP NOT AVAILABLE TO DEFER @V407594 01452000
  1541. .NOAP14 ANOP **ANOP** 01453000
  1542. EJECT 01454000
  1543. * POINTERS, COUNTERS, & FILLED-IN ADDRESSES ... 01455000
  1544. * 01456000
  1545. * NOTE: --> MEANS "BECOMES" 01457000
  1546. * 01458000
  1547. DMKFRELS DC D'0' "FREELIST" = START OF REGULAR FREE STORAGE CHAIN 01459000
  1548. * 01460000
  1549. FREENUM DC F'0' --> COUNT OF BLOCKS IN FREE STORAGE CHAIN 01461000
  1550. * 01462000
  1551. DMKFRELO DC A(X'FFFFFF') --> END OF FREE AREA IN LOWER CORE 01463000
  1552. * 01464000
  1553. * KEEP THE NEXT TWO IN ORDER... USED BY ECPS 01465000
  1554. MAXSIZE DC A(MAXSPSIZ) MAXIMUM SUBPOOL SIZE IN DWRDS @VA14280 01465200
  1555. DMKFREMX EQU MAXSIZE FOR EXTERNAL REF'S BY CP ASSIST @VA14280 01465400
  1556. SUBTABLE DC (MAXSPSIZ/3)A(0) TABLE OF SUBPOOL POINTERS @VA14280 01465600
  1557. DISPSUBT EQU SUBTABLE-SUBSIZES (DISP. OF 'SUBTABLE' FROM 'SUBSIZES) 01466000
  1558. DMKFREST EQU SUBTABLE (FOR EXTERNAL REFERENCES) @V386198 01467000
  1559. SPLITATT DC F'0' --> NO. TIMES "TRYSPLIT" ATTEMPTED @VA00881 01468000
  1560. SPLITCNT DC F'0' --> NO. TIMES A SUBPOOL SPLIT INTO SMALLER ONES 01469000
  1561. SBFRTREG DC F'0' --> NO. OF SUBFRET CALLS REQUIRING REGULAR FRET 01470000
  1562. * KEEP THE FOLLOWING TWO IN ORDER: 01471000
  1563. NPAGFREE DC F'0' --> NO. OF TIMES "PAGE FREE" CALLED @VA00881 01472000
  1564. NPAGFRET DC F'0' --> NO. OF TIMES "PAGE FRET" CALLED 01473000
  1565. DMKFRENP EQU NPAGFREE NAME FOR "NPAGFREE" & "NPAGFRET" @VA00881 01474000
  1566. * 01475000
  1567. AIF (NOT &AP).NOAP15 **AIF*** 01476000
  1568. * @V407594 01477000
  1569. EXTDEFER DC F'0' NO. OF TIMES CPFRELK SET @V407594 01478000
  1570. EXTSWTCH DC F'0' NO. OF TIMES CPFRESW SET @V407594 01479000
  1571. * @V407594 01480000
  1572. .NOAP15 ANOP **ANOP** 01481000
  1573. SUBRETN DC F'0' --> HOW MANY TIMES SUBPOOLS WERE RETURNED. 01482000
  1574. SUBRETAC DC F'0' --> NO. OF SUBPOOLS ACTUALLY RETURNED 01483000
  1575. * BACK-POCKET SAVE AREA TO ENSURE DMKFRE CAN CALL DMKPTRFR 01484000
  1576. DMKFRESV DC F'0' TO ALLOW FREE STORAGE TO BE @VM08952 01485000
  1577. * EXTENDED 01486000
  1578. EXTNDSAV DC 32F'0' BALRSAVE-FREESAVE SAVED FOR DMKPTRFR, 01487000
  1579. * AND BALRSAVE SAVED FOR DMKPTRFT. 01488000
  1580. EXTNDSV2 DC 16F'0' BALRSAVE AREA FOR PG FRET @VA09919 01488500
  1581. * 01489000
  1582. * OTHER STATISTICAL QUANTITIES OF INTEREST ... 01490000
  1583. * 01491000
  1584. LRGSTSIZ DC F'0' --> LARGEST SIZE (IN DBL WORDS) REQUESTED 01492000
  1585. DMKFRELG EQU LRGSTSIZ EXTERNAL-NAME FOR "LRGSTSIZ" 01493000
  1586. NUMEXBLK DC F'0' --> NO. OF TIMES AN EXTRA BLOCK @V3M4038 01494000
  1587. * IN CHAIN GIVEN BACK VIA DMKPTRFT. 01495000
  1588. EJECT 01496000
  1589. COPY EQU 01497000
  1590. PSA 01498000
  1591. SPACE 2 01499000
  1592. * 01500000
  1593. * OTHER SCRATCH-STORAGE (JUST USED TEMPORARILY): 01501000
  1594. SPACE 01502000
  1595. ORG FREEWORK 01503000
  1596. SAVE38 DS 6F R3-R8 SAVED BY FRET, TO RECOVER IF OVERLAP ERROR 01504000
  1597. * 01505000
  1598. SAVE910 DS 2F R9-R10 SAVED BY FREE WHEN RETURNING SUBPOOLS 01506000
  1599. * 01507000
  1600. JSAVE7 DS 1F R7 INDEXER SAVED HERE AS NEEDED @VA00881 01508000
  1601. * 01509000
  1602. FREELOWM DS 1F SET TO DMKFRELO MINUS LENGTH NEEDED BLOCK 01510000
  1603. * 01511000
  1604. SAMEFRET DS 1A CALLER OF BLOCK INVOKING DMKPTRFT@VA14280 01512100
  1605. * SAMEFRET IS IN ABSOLUTE PSA @V407594 01513000
  1606. SPACE 01514000
  1607. GPR1 EQU FREER1 R1 RETURNED BY DMKFREE 01515000
  1608. EJECT 01516000
  1609. COPY CORE 01517000
  1610. COPY VMBLOK @VA07866 01518000
  1611. COPY SAVE 01519000
  1612. END 01520000
ibm/vm370-lib/cp/dmkfre.assemble_src.txt ยท Last modified: 2023/08/06 13:37 by Site Administrator