User Tools

Site Tools


ibm:vm370-lib:cp:dmkptr.assemble_src

DMKPTR Source

References

Source Listing

DMKPTR.ASSEMBLE.txt
  1. PTR TITLE 'DMKPTR (CP) VM/370 - RELEASE 6' 00001000
  2. ISEQ 73,80 VALIDATE SEQUENCING OF INPUT 00002000
  3. *. 00003000
  4. * MODULE NAME - 00004000
  5. * 00005000
  6. * DMKPTR 00006000
  7. * 00007000
  8. * FUNCTION - 00008000
  9. * 00009000
  10. * TO MANAGE THE INVENTORY OF REAL SYSTEM PAGES, PROVIDING REAL 00010000
  11. * MEMORY SPACE FOR CONTROL PROGRAM FUNCTIONS AND FOR PAGES OF 00011000
  12. * USER AND CONTROL PROGRAM VIRTUAL MEMORY 00012000
  13. * 00013000
  14. * ATTRIBUTES - 00014000
  15. * 00015000
  16. * SERIALLY REUSABLE, RESIDENT, CALLED VIA SVC 8 00016000
  17. * 00017000
  18. * ENTRY POINTS - 00018000
  19. * 00019000
  20. * DMKPTRAN - TRANSLATE THE VIRTUAL ADDRESS PROVIDED BY THE CALL- 00020000
  21. * ER INTO A REAL MEMORY ADDRESS 00021000
  22. * DMKPTRUL - UNLOCK A PAGE OF REAL MEMORY 00022000
  23. * DMKPTRFR - OBTAIN A PAGE OF REAL MEMORY 00023000
  24. * DMKPTRFT - RETURN A PAGE OF REAL MEMORY TO THE SYSTEM 00024000
  25. * DMKPTRLK - LOCK A PAGE OF REAL MEMORY 00025000
  26. * DMKPTRRS RESET PAGES BELONGING TO USER 00026000
  27. * DMKPTRPW - WAIT FOR USER PAGING TO COMPLETE 00026100
  28. * 00027000
  29. * THE FOLLOWING VALUES MAY BE REFERENCED OR MODIFIED BY EXTERNAL 00028000
  30. * ROUTINES 00029000
  31. * 00030000
  32. * DMKPTRFN - NUMBER OF FREE PAGES CURRENTLY AVAILABLE - INITIAL- 00031000
  33. * IZED BY DMKCPINT 00032000
  34. * DMKPTRF1 - POINTER TO THE CORETABL ENTRY FOR THE FIRST FREE 00033000
  35. * PAGE - INITIALIZED BY DMKCPINT 00034000
  36. * DMKPTRU1 - ADDRESS OF 1ST CORTABLE ENTRY ON FLUSH LIST 00035000
  37. * DMKPTRRT - CPEXBLOK RETURN ADDRESS FOR (DMKPTRPW) 00036000
  38. * DMKPTRFD - CPEXBLOK RETURN ADDRESS TO 'FRET' SWAPPPED PAGE 00037000
  39. * DMKPTRFP - CPEXBLOK RETURN ADDRESS TO EXTEND FREE STORAGE 00038000
  40. * DMKPTRFE - CPEXBLOK RETURN ADDRESS TO FORCE PAGE SWAP 00039000
  41. * DMKPTRRU - ADDRESS OF VMBLOK FOR CURRENT RESERVED PAGE USER 00040000
  42. * DMKPTRCT - NUMBER OF CALLS TO DMKPTRAN 00041000
  43. * DMKPTRF0 - NUMBER OF TIMES DMKPTRFR WAS CALLED AND NO PAGES 00042000
  44. * WERE AVAILABLE 00043000
  45. * DMKPTRFC - NUMBER OF CALLS TO DMKPTRFR 00044000
  46. * DMKPTRFA - ADDRESS OF RESERVED CPEXBLOK USED BY DMKPTRFR 00045000
  47. * DMKPTRRL - HIGH WATER LIMIT FOR RESERVED PAGE USER 00046000
  48. * DMKPTRRC - CURRENT NUMBER OF RESIDENT RESERVED PAGES 00047000
  49. * DMKPTRSC - NUMBER OF RESIDENT, SHARED PAGES 00048000
  50. * DMKPTRSS - NUMBER OF PAGES STOLEN FROM ACTIVE USERS 00049000
  51. * DMKPTRFF - NUMBER OF PAGES TAKEN FROM FLUSHED PAGE LIST 00050000
  52. * DMKPTRRQ - PAGE READ REQUEST QUEUE 00051000
  53. * DMKPTRWQ - PAGE WRITE REQUEST QUEUE 00052000
  54. * DMKPTRCP TABLE OF INDICES FOR CORTABLE SEARCHING 00053000
  55. * DMKPTRPR PAGES RECLAINED 00054000
  56. * 00055000
  57. * ENTRY CONDITIONS - 00056000
  58. * 00057000
  59. * FOR DMKPTRAN - 00058000
  60. * GPR1 = VIRTUAL ADDRESS TO BE TRANSLATED 00059000
  61. * GPR2 = ONE OR MORE OF THE FOLLOWING OPTIONS - 00060000
  62. * BRING - IF THE PAGE IS NOT RESIDENT, BRING IT IN 00061000
  63. * DEFER - DO NOT RETURN TO THE CALLER UNTIL THE PAGE IS 00062000
  64. * RESIDENT 00063000
  65. * LOCK - LOCK THE PAGE INTO REAL MEMORY 00064000
  66. * IOERET - RETURN ANY PAGING IO ERRORS TO THE CALLER 00065000
  67. * IF DEFER IS NOT REQUESTED, THEN: 00066000
  68. * GPR3 = RETURN ADDRESS FOR EXIT WHEN PAGE IS RESIDENT 00067000
  69. * SYSTEM - CALLER IS REFERENCING SYSTEM VM SPACE 00068000
  70. * VFAULT - CALL IS FOR VIRTUAL PAGE FAULT (FROM DMKPRG) @V400141 00069000
  71. * CALLER WILL NOT REFERENCE REAL ADDRESS @V400141 00070000
  72. * RETURNED IN REGISTER 2 @V400141 00071000
  73. * GPR11 = ADDRESS OF USER'S VMBLOK 00072000
  74. * GPR12 = DMKPTRAN BASE 00073000
  75. * GPR13 = SAVEAREA BASE 00074000
  76. * FOR DMKPTRUL - 00075000
  77. * GPR2 = AN ADDRESS WITHIN THE REAL PAGE TO BE UNLOCKED 00076000
  78. * GPR14 = RETURN REGISTER 00077000
  79. * GPR15 = DMKPTRUL BASE 00078000
  80. * 00079000
  81. * FOR DMKPTRLK - 00080000
  82. * GPR 2 = AN ADDRESS WITHIN THE REAL PAGE TO BE LOCKED 00081000
  83. * GPR 14 = RETURN REGISTER 00082000
  84. * GPR 15 = DMKPTRLK BASE 00083000
  85. * 00084000
  86. * 00085000
  87. * FOR DMKPTRFR - 00086000
  88. * GPR2 = PARM REGISTER 00087000
  89. * (=1 IF CALLED BY DMKFREE; =0 FOR ALL OTHER CALLERS) 00088000
  90. * (=2 IF CALLED BY DMKFREE AND THE DMKFRE CALLER 00089000
  91. * IS TO GET A RET CODE INSTEAD OF SYSTEM ABEND 00090000
  92. * STORAGE IS NOT AVAILABLE). 00091000
  93. * GPR12 = DMKPTRFR BASE 00092000
  94. * GPR13 = SAVEAREA BASE 00093000
  95. * 00094000
  96. * FOR DMKPTRFT - 00095000
  97. * GPR7 = ADDRESS OF CORTABLE ENTRY FOR PAGE TO BE FRETTED 00096000
  98. * GPR12 = DMKPTRFT BASE 00097000
  99. * GPR13 = SAVEAREA BASE 00098000
  100. * 00099000
  101. * FOR DMKPTRPW 00099100
  102. * GPR11 = ADDRESS OF VMBLOK OF VIRTUAL MEMORY'S OWNER 00099200
  103. * GPR12 = ADDRESS OF ENTRY POINT 00099300
  104. * GPR13 = ADDRESS OF SAVEAREA 00099400
  105. * 00099500
  106. * EXIT CONDITIONS - 00100000
  107. * 00101000
  108. * FROM DMKPTRAN - NORMAL - 00102000
  109. * CC = 0 - VIRTUAL PAGE IS RESIDENT 00103000
  110. * GPR2 = TRANSLATED REAL ADDRESS 00104000
  111. * CC = 1 - PAGE IS NOT RESIDENT, DEFER NOT SPECIFIED 00105000
  112. * GPR2 = ADDRESS OF PAGTABLE ENTRY 00106000
  113. * 00107000
  114. * FROM DMKPTRAN - ERROR 00108000
  115. * CC = 2 - VIRTUAL ADDRESS PROVIDED LIES OUTSIDE OF USER'S 00109000
  116. * VIRTUAL MEMORY SPACE 00110000
  117. * CC = 3 - IOERROR OCCURRED WHLE ATTEMPTING TO READ PAGE 00111000
  118. * 00112000
  119. * FROM DMKPTRUL - NONE 00113000
  120. * 00114000
  121. * FROM DMKPTRLK - NORMAL - CC = 0 00115000
  122. * 00116000
  123. * FROM DMKPTRFR - NORMAL 00117000
  124. * GPR7 = ADDRESS OF CORTABLE ENTRY FOR PAGE PROVIDED 00118000
  125. * IF THE CALL WAS FROM DMKFREE, THE PAGE IS MERGED INTO THE FREE 00119000
  126. * STORAGE CHAIN VIA A CALL TO DMKFRETR 00120000
  127. * 00121000
  128. * IF DMKPTRFR WAS CALLED WITH PARM=2 AND A PAGE IS NOT 00122000
  129. * IMMEDIATELY AVAILABLE, AND THE NUMBER OF PAGES ON THE 00123000
  130. * WAY OUT IS NOT SUFFICIENT, THEN A SEPARATE TASK IS STARTED 00124000
  131. * FOR THE PURPOSE OF REPLENISHING THE FREE LIST. 00125000
  132. * THIS IS DONE BY STACKING A CPEXBLOK FOR RETURN TO 00126000
  133. * DMKPTRFE TO PERFORM THE REPLENISHMENT FUNCTION. 00127000
  134. * IF THE REPLENISHMENT ROUTINE FINDS THAT THERE ARE NO 00128000
  135. * MORE PAGES TO BE HAD, AND THE REQUEST WHICH RESULTED 00129000
  136. * IN THE STARTING OF THE REPLENISHMENT FUNCTION WAS FOR 00130000
  137. * A CONDITIONAL CALL TO OBTAIN FREE STORAGE, THEN THE 00131000
  138. * THE CPEXBLOK FOR THE CONDITIONAL CALL IS SEARCHED FOR 00132000
  139. * ON THE 'FREEQ'. IF IT IS FOUND, IT IS FRETED AND 00133000
  140. * A RETURN CODE EXIT IS MADE BACK TO DMKFRE. IF IT IS 00134000
  141. * NOT FOUND, THEN IT IS ASSUMED THAT THERE WAS SUFFICIENT 00135000
  142. * DELAYED PAGING ACTIVITY TO SATISFY THE REQUEST; 00136000
  143. * DMKFRE SHOULD HAVE RECEIVED ITS PAGE, SO WE 'GOTO' 00137000
  144. * THE DISPATCHER. 00138000
  145. * 00139000
  146. * FROM DMKPTRFR - ERROR - NONE 00140000
  147. * 00141000
  148. * FROM DMKPTRFT - NONE 00142000
  149. * 00143000
  150. * CALLS TO OTHER ROUTINES - 00144000
  151. * 00145000
  152. * DMKPAGIO - EXIT VIA GOTO TO INITIATE PAGE I/O 00146000
  153. * DMKFREE - OBTAIN FREE STORAGE 00147000
  154. * DMKFRET - RETURN FREE STORAGE 00148000
  155. * DMKSTKCP - STACK DEFERED REQUESTS FOR EXECUTION 00149000
  156. * DMKQCNWT - WRITE ERROR MESSAGE TO USERS 00150000
  157. * DMKPGTPG - OBTAIN DASD SPACE FOR PAGE WRITES 00151000
  158. * DMKDSPCH - EXIT VIA GOTO TO AWAIT INTERRUPTS 00152000
  159. * DMKFRETR - MERGE EXTENDED FREE STORAGE PAGE INTO FREE LIST 00153000
  160. * DMKCFMBK - TO PUT USER IN CONSOLE FUNCTION MODE 00154000
  161. * DMKPTRFT - TO PUT A PAGE ON THE FREELIST 00155000
  162. * DMKPGTPR - TO RELEASE AN OLD PAGE 00156000
  163. * EXTERNAL REFERENCES - 00158000
  164. * 00159000
  165. * DMKPAGQ - QUEUE OF PENDING PAGING TASKS 00160000
  166. * DMKSYSRM - SIZE OF THE REAL MACHINE 00161000
  167. * DMKSCHN1 - NUMBER OF USERS CURRENTLY IN QUEUE1 00162000
  168. * DMKSCHN2 - NUMBER OF USERS CURRENTLY IN QUEUE2 00163000
  169. * DMKSYSOW - ADDRESS OF SYSTEM OWNED VOLUME LIST 00164000
  170. * 00165000
  171. * TABLES / WORKAREAS - 00166000
  172. * 00167000
  173. * CORTABLE - ONE ENTRY PER PAGE OF REAL MEMORY 00168000
  174. * SWPTABLE - ONE ENTRY PER PAGE OF VIRTUAL MEMORY 00169000
  175. * SEGTABLE - USED BY DAT FEATURE TO TRANSLATE VIRTUAL -> REAL 00170000
  176. * PAGTABLE - USED BY DAT FEATURE TO TRANSLATE VIRTUAL -> REAL 00171000
  177. * 00172000
  178. * REGISTER USAGE - 00173000
  179. * 00174000
  180. * GPR0 = SCRATCH 00175000
  181. * GPR1-3 USED TO MANIPULATE CORTABLE CHAIN POINTERS 00176000
  182. * GPR4 = INCREMENT REGISTER - CONTAINS VALUE OF 1 00177000
  183. * GPR5 = SWPTABLE ENTRY BASE 00178000
  184. * GPR6 = SCRATCH 00179000
  185. * GPR7 = CORTABLE ENTRY BASE 00180000
  186. * GPR8 = SCRATCH 00181000
  187. * GPR9 = PAGTABLE ENTRY BASE 00182000
  188. * GPR10 = SECOND BASE REGISTER @V407594 00183000
  189. * GPR11 = VMBLOK BASE 00184000
  190. * GPR12 = DMKPTR BASE 00185000
  191. * GPR13 = SAVEAREA BASE 00186000
  192. * GPR14 = EXTERNAL LINKAGE 00187000
  193. * GPR15 = EXTERNAL LINKAGE 00188000
  194. * 00189000
  195. * NOTES - 00190000
  196. * 00191000
  197. * DMKPTRAN IS GENERALLY CALLED VIA THE 'TRANS' MACRO, WHICH 00192000
  198. * SETS UP THE NECESSARY PARMS IN GPR2, AND TESTS THE CONDITION 00193000
  199. * CODES RETURNED TO THE CALLER 00194000
  200. * 00195000
  201. * OPERATION - 00196000
  202. * 00197000
  203. * THE OPERATION OF DMKPTRAN IS DESCRIBED IN SECTIONS A-D BELOW 00198000
  204. * THE OPERATION OF DMKPTRFR IS DESCIRBED IN SECTION E 00199000
  205. * THE OPERATION OF THE PAGE SELECTION ROUTINE 'SELECT' IS 00200000
  206. * DESCRIBED IN SECTION F 00201000
  207. * THE OPERATION OF DMKPTRFT IS DESCRIBED IN SECTION G 00202000
  208. * THE OPERATION OF DMKPTRUL IS DESCRIBED IN SECTION H 00203000
  209. * THE OPERATION OF DMKPTRLK IS DESCRIBED IN SECTION I 00204000
  210. * THE OPERATION OF DMKPTRRS IS DESCRIBED IN SECTION J 00205000
  211. * 00206000
  212. *. 00207000
  213. EJECT 00208000
  214. COPY OPTIONS 00209000
  215. COPY LOCAL OPTIONS @V306638 00210000
  216. EJECT 00211000
  217. DMKPTR CSECT 00212000
  218. SPACE 3 00213000
  219. EXTRN DMKSYSRM 00214000
  220. EXTRN DMKDSPNP 00215000
  221. EXTRN DMKDSPRQ @VA08037 00215100
  222. EXTRN DMKSCHN1,DMKSCHN2 00216000
  223. EXTRN DMKPAGIO @V200820 00217000
  224. EXTRN DMKSTKCP 00218000
  225. EXTRN DMKVMASH @V407594 00220000
  226. EXTRN DMKSTKMP @V407594 00221000
  227. EXTRN DMKSTKOP @V407594 00222000
  228. EXTRN DMKFREAP @V407594 00223000
  229. EXTRN DMKPAGQ 00224000
  230. EXTRN DMKCFMBK 00225000
  231. EXTRN DMKCVTAB,DMKBLDRT @V408246 00226000
  232. EXTRN DMKFRETR 00227000
  233. EXTRN DMKPGTPR 00228000
  234. EXTRN DMKSYSOW 00229000
  235. EXTRN DMKPGTPG 00230000
  236. EXTRN DMKSCHDL 00231000
  237. ENTRY DMKPTRAN 00232000
  238. ENTRY DMKPTRU1 00233000
  239. ENTRY DMKPTRCP @V408246 00234000
  240. ENTRY DMKPTRFA 00235000
  241. ENTRY DMKPTRF0,DMKPTRFC 00236000
  242. ENTRY DMKPTRFN,DMKPTRF1 00237000
  243. ENTRY DMKPTRXX @V408246 00238000
  244. ENTRY DMKPTRCT,DMKPTRSS,DMKPTRPR @V408246 00239000
  245. ENTRY DMKPTRSC SHARED PAGE COUNT @V408246 00240000
  246. ENTRY DMKPTRFF @V408246 00241000
  247. ENTRY DMKPTRRS @V408246 00242000
  248. ENTRY DMKPTRRL 00243000
  249. ENTRY DMKPTRFD,DMKPTRFP 00244000
  250. ENTRY DMKPTRRU 00245000
  251. ENTRY DMKPGSHR SHARE TABLE CHAIN ANCHOR @V408246 00246000
  252. ENTRY DMKPTRRC 00247000
  253. ENTRY DMKPTRFE 00248000
  254. ENTRY DMKPTRRQ,DMKPTRWQ 00249000
  255. ENTRY DMKPTRSW NO. OF PAGES BEING SWAPPED @V2B2638 00250000
  256. ENTRY DMKPTRRF NO. PAGES EXAMINED DURING STEALS @V2B2638 00251000
  257. ENTRY DMKPTRCS NO. COMP SCANS OF ULIST FOR STEAL@V2B2638 00252000
  258. ENTRY DMKPTRPL,DMKPTRRM - FOR CP ASSIST @V386198 00253000
  259. ENTRY DMKPTRSN @VA08341 00253100
  260. ENTRY DMKPTRFQ @V408246 00254000
  261. ENTRY DMKPTRP2 PAGES RECLAIMED FROM FLUSH LIST @VA07717 00254100
  262. ENTRY DMKPTRUC FLUSHED PAGE COUNT @VA07810 00254200
  263. SPACE 2 00255000
  264. USING PSA,R0 00256000
  265. USING CPEXBLOK,R1 00257000
  266. USING SWPFLAG,R5 00258000
  267. USING CORTABLE,R7 00259000
  268. USING PAGCORE,R9 00260000
  269. USING VMBLOK,R11 00261000
  270. USING SAVEAREA,R13 00262000
  271. SPACE 2 00263000
  272. USING *,R12,R10 @V407594 00264000
  273. EJECT 00265000
  274. *. 00266000
  275. * A. INITIAL ENTRY TO DMKPTRAN - 00267000
  276. * 1. IF THE VIRTUAL ADDRESS IN GPR1 IS WITHIN THE USER'S VIRTUAL 00268000
  277. * MEMORY, CONTINUE; OTHERWISE, RETURN CC 2 00269000
  278. * 2. IF THE REQUESTED PAGE IS RESIDENT, GO SEE IF THE LOCK 00270000
  279. * OPTION HAS BEEN REQUESTED (D, BELOW); OTHERWISE, CONTINUE 00271000
  280. * 3. LOCATE THE PAGTABLE AND SWPTABLE ENTRIES FOR THE PAGE, 00272000
  281. * AND TEST TO SEE IF IT IS IN TRANSIT 00273000
  282. * 4. IF THE PAGE IS IN TRANSIT, SET UP TO WAIT FOR IT (B, BELOW) 00274000
  283. * OTHERWISE, CONTINUE 00275000
  284. * 5. TEST THE PAGTABLE ENTRY TO SEE IF THE PAGE HAS BEEN 00276000
  285. * STOLEN FRON THE USER BUT IS STILL RESIDENT IN THE FLUSH 00277000
  286. * OR FREE LISTS 00278000
  287. * 6. IF THE PAGE IS NOT RESIDENT, GO ALLOCATE A NEW PAGE (C, 00279000
  288. * BELOW); OTHERWISE, CONTINUE 00280000
  289. * 7. RECLAIM THE PAGE FROM THE LIST AND RETURN IT TO THE USER AT 00281000
  290. * STEP C.6 00282000
  291. *. 00283000
  292. SPACE 00284000
  293. DMKPTRAN LA R1,0(,R1) STRIP HIGH BYTE - 24 BIT ADDRESSING ONLY 00285000
  294. ST R1,SAVEWRK9 CLEAR PAGEIO ERROR SWITCH 00286000
  295. ENTER 00287000
  296. LR R10,R12 ESTABLISH SECOND BASE REGISTER @V407594 00288000
  297. A R10,F4096 @V407594 00289000
  298. LA R4,1 ESTABLISH GENRAL INCREMENT REGISTER 00290000
  299. L R0,DMKPTRCT GET COUNT OF CALLS 00291000
  300. ALR R0,R4 BUMP 00292000
  301. ST R0,DMKPTRCT AND SAVE 00293000
  302. RESTART EQU * HERE TO RESTART AFTER INTRANSIT PAGE IS IN 00294000
  303. LR R2,R11 ADDRESS OF CALLER'S VMBLOK 00295000
  304. TM SAVER2+3,SYSTEM CALL FOR SYSTEM V.M. SPACE ?? 00296000
  305. BZ CKADDR NO -- R2 IS CORRECT 00297000
  306. L R2,ASYSVM POINT TO SYSTEM VMBLOK 00298000
  307. SPACE 00299000
  308. CKADDR DS 0H VERIFY VIRTUAL ADDRESS 00300000
  309. CL R1,VMSIZE-VMBLOK(,R2) IS ADDRESS WITHIN MEMORY SPACE 00301000
  310. BL ADDROK YES -- 00302000
  311. CLI FFS,X'00' SET CONDITION CODE 2 00303000
  312. B EXIT AND LEAVE 00304000
  313. ADDROK EQU * VIRTUAL ADDRESS IS VALID 00305000
  314. LCTL C1,C1,VMSEG-VMBLOK(R2) GET SEGMENT TABLE ORIGIN 00306000
  315. LRA R7,0(,R1) DO HARDWARE TRANSLATE 00307000
  316. BNZ TESTSEG PAGE IS NOT RESIDENT - TEST FOR PAGE OR 00308000
  317. * SEGMENT EXCEPTION 00309000
  318. N R7,XPAGNUM CLEAR BYTE DISPLACEMENT 00310000
  319. SRL R7,8 AND GET PAGE # TIMES 8 00311000
  320. A R7,ACORETBL POINT TO CORTABLE ENTRY 00312000
  321. L R9,CORPGPNT POINT TO PAGETABLE ENTRY 00313000
  322. B TESTLOCK AND SEE IF LOCK IS REQUESTED 00314000
  323. SPACE 2 00315000
  324. TESTSEG DS 0H @V4M0167 00316000
  325. BC 4+1,SEGEX CC=1,3 LET SEGEX HANDLE @V4M0167 00317000
  326. EJECT 00318000
  327. GETENTRY EQU * 00319000
  328. LR R9,R7 SAVE ADDRESS OF PAGE TABLE ENTRY 00320000
  329. N R1,=XL4'0000F000' CLEAR SEGMENT NUMBER AND DISPL. 00321000
  330. SRL R1,11 GET PAGE NUMBER*2 00322000
  331. SR R7,R1 POINT TO START OF PAGE TABLE 00323000
  332. AIF (NOT &AP).NOAP1 **AIF*** 00323900
  333. TM APSTAT1,APUOPER RUNNING AS AP @V407594 00324000
  334. BZ GETENTR2 NO, BYPASS AFFINITY LOGIC @V407594 00325000
  335. * FOR SHARED PAGE CALL PTR MUST RETURN TO CALLER @V407594 00326000
  336. * ON THE ORIGINAL PROCESSOR @V407594 00327000
  337. S R7,=F'16' BACK TO HEADER @V407594 00328000
  338. ICM R3,B'0111',PAGSHR-PAGTABLE+1(R7) NAMED SYSTEM @V407594 00329000
  339. BZ GETENTR1 NO @V407594 00330000
  340. TM SHRFLAG-SHRTABLE(R3),SHRNOPRT UNPROTECTED @VA09281 00330100
  341. * SHARED SYSTEM? 00330200
  342. BO GETENTR1 YES, NO NEED TO SET UP PROCESSOR @VA09281 00330300
  343. * AFFINITY SINCE THERE IS ONLY ONE 00330400
  344. * SET OF PAGE/SWAP TABLES 00330500
  345. ICM R3,B'1111',SHRSEGCT-SHRTABLE(R3) SHARED SYSTEM @V407594 00331000
  346. BZ GETENTR1 NO @V407594 00332000
  347. IC R3,LPUADDR+1 LOGICAL PROCESSOR ID @V407594 00333000
  348. STC R3,SAVEPROC TO SAVE AREA @V407594 00334000
  349. GETENTR1 LA R7,16(R7) R7 POINTS TO FIRST PTE @V407594 00335000
  350. GETENTR2 DS 0H @V407594 00336000
  351. .NOAP1 ANOP **ANOP** 00336100
  352. SLL R1,2 GET PAGE NUMBER*8 00337000
  353. LA R5,16*2+8(R1,R7) POINT TO SWAPTABLE ENTRY @V408246 00338000
  354. TM SWPFLAG,SWPTRANS+SWPALLOC WAS THERE A PREVIOUS @V408246 00339000
  355. * REQ? 00340000
  356. BNZ INTRAN YES, ENQUEUE UNTIL COMPLETED @V408246 00341000
  357. * PAGE IS NOT RESIDENT AND NOT IN TRANSIT 00342000
  358. LH R7,PAGCORE GET PAGE TABLE ENTRY 00343000
  359. N R7,=A(X'FFF0') IS THE PAGE STILL IN CORE ? 00344000
  360. BZ READPAGE NO -- MUST GO FIND ANOTHER PAGE 00345000
  361. AIF (NOT &VIRREAL).NOVR1 00346000
  362. CL R11,AVMREAL IS REQUEST FOR VIRT=REAL USER 00347000
  363. BNE PASSVR NO, PROCEED AS NORMAL 00348000
  364. TM SAVER2+3,SYSTEM IS REQUEST FOR SYSTEM SPACE 00349000
  365. BO PASSVR YES, WE ARE USING THE SYSTEM VMBLOK 00350000
  366. A R7,ACORETBL POINT TO THE CORE-TABLE ENTRY 00351000
  367. BAL R3,CKDEFER @V408246 00352000
  368. B DOIO READ THE PAGE INTO STORAGE 00353000
  369. PASSVR DS 0H CONNECTOR 00354000
  370. .NOVR1 ANOP 00355000
  371. A R7,ACORETBL POINT TO CORTABLE ENTRY 00356000
  372. LM R2,R3,CORFPNT GET FORWARD AND BACKWARD CHAIN POINTERS 00357000
  373. ST R2,CORFPNT-CORTABLE(,R3) UNCHAIN THE ENTRY 00358000
  374. ST R3,CORBPNT-CORTABLE(,R2) -- 00359000
  375. SR R2,R2 CLEAR . . @V408246 00360000
  376. ST R2,CORBPNT . . BACK-POINTER @V408246 00361000
  377. TM CORFLAG,CORFREE PAGE ON FREE OR USER LIST? @V408246 00362000
  378. BZ CNTFLR FLUSH LIST PAGE @VA07717 00363100
  379. L R0,DMKPTRPR INCREMENT @V408246 00364000
  380. AR R0,R4 COUNT OF PAGE RECLAIMS @V408246 00365000
  381. ST R0,DMKPTRPR @V408246 00366000
  382. L R0,DMKPTRFN GET NUMBER OF FREE PAGES 00367000
  383. SR R0,R4 DECREMENT FREE COUNT 00368000
  384. ST R0,DMKPTRFN AND SAVE 00369000
  385. BAL R8,SELECT REPLENISH F/L IF NEEDED @VA03893 00370000
  386. L R5,CORSWPNT RESTORE SWAP TABLE ADDRESS @VA03893 00371000
  387. B SETKEYS GO SET VIRTUAL STORAGE KEYS 00372000
  388. CNTFLR L R0,DMKPTRP2 COUNT FLUSH LIST RECLAIMS @VA07717 00372100
  389. AR R0,R4 @VA07717 00372120
  390. ST R0,DMKPTRP2 @VA07717 00372140
  391. L R0,DMKPTRUC FLUSHED PAGE COUNT @VA07810 00372145
  392. SR R0,R4 LESS ONE @VA07810 00372148
  393. BM AB20 CANNOT BE NEGATIVE @VA07810 00372151
  394. ST R0,DMKPTRUC STORE NEW COUNT @VA07810 00372154
  395. TM CORFLAG,CORSHARE SHARED PAGE @VA07717 00372160
  396. BO CLEARID YES @VA07717 00372180
  397. * GET SEGMENT'S OWNER TO DECREASE FLUSHED PAGE COUNT 00372200
  398. SR R0,R0 @VA07717 00372220
  399. IC R0,SWPVPAGE VIRTUAL PAGE NUMBER @VA07717 00372240
  400. AR R0,R4 PLUS ONE FOR HEADER @VA07717 00372260
  401. SLL R0,3 TIMES 8 FOR ENTRY LENGTH @VA07717 00372280
  402. LR R6,R5 SWAP TABLE ENTRY @VA07717 00372300
  403. SR R6,R0 BACK TO HEADER @VA07717 00372320
  404. L R15,0(R6) GET SEGMENT'S OWNER (SWPVM) @VA07717 00372340
  405. LH R0,VMFLPAG-VMBLOK(R15) FLUSHED PAGE COUNT @VA07717 00372360
  406. SR R0,R4 MINUS ONE @VA07717 00372380
  407. BM AB19 CANNOT BE NEGATIVE @VA07717 00372400
  408. STH R0,VMFLPAG-VMBLOK(R15) @VA07717 00372420
  409. B CLEARID RECLAIM PAGE @VA07717 00372440
  410. AB19 ABEND 19 VMFLPAG IS NEGATIVE @VA07717 00372460
  411. SPACE 1 00372480
  412. AB20 ABEND 20 DMKPTRUC IS NEGATIVE @VA07810 00372500
  413. EJECT 00373000
  414. *. 00374000
  415. * B. PROCESSING FOR IN-TRANSIT PAGES - 00375000
  416. * 1. PLACE THE USER IN PAGE-WAIT, INCREMENTING THE WAIT COUNT 00376000
  417. * 2. IF THE THE CALLER SPECIFIED 'DEFER', CONTINUE; OTHERWISE, 00377000
  418. * STACK A CPEXBLOK FOR RETURN TO DMKPTRAN AND EXIT NOW 00378000
  419. * 3. LOCATE THE CPEXBLOK FOR THE REAL PAGE INTO OR FROM 00379000
  420. * WHICH THE VIRTUAL PAGE IS BEING MOVED 00380000
  421. * 4. CONSTRUCT A CPEXBLOK AND QUEUE IT TO THE END OF THE CHAIN 00381000
  422. * ANCHORED AT CPEXMISC 00382000
  423. * 5. EXIT TO DMKDSPCH. WHEN THE PAGE I/O COMPLETES, THE 00383000
  424. * CPEXBLOKS CHAINED TO THE CORTABLE ENTRY WILL BE UNSTACKED 00384000
  425. * AND PROCESSING WILL RESUME 00385000
  426. *. 00386000
  427. SPACE 00387000
  428. INTRAN EQU * HERE IF PAGE IS IN TRANSIT 00388000
  429. NI VMDSTAT,255-VMDSP NO FAST REDSP @V408246 00389000
  430. BAL R3,CKDEFER GO TEST FOR DEFERED RETURN 00390000
  431. LA R0,CPEXSIZE GET CORE FOR 00391000
  432. CALL DMKFREE A CPREQUEST BLOK 00392000
  433. STM R9,R13,CPEXR9 SAVE THESE REGS ONLY ... 00393000
  434. LA R14,TRANRETN SET UP RETURN TO EXECUTION ADDRESS 00394000
  435. ST R14,CPEXADD AND SAVE 00395000
  436. L R3,=A(DMKPAGQ) POINT TO QUEUE OF CPEXBLOKS FOR 00396000
  437. LR R2,R3 IN-TRANSIT PAGES AND SAVE ITS ADDRESS 00397000
  438. TM SWPFLAG,SWPALLOC ENQUEUED FOR ALLOCATION ?? 00398000
  439. BZ FINDTASK NO -- WE HAVE CORRECT LIST 00399000
  440. LA R3,FREEQ POINT TO ALLOCATION LIST 00400000
  441. SR R2,R2 LIST CHAINED ONE-WAY 00401000
  442. SPACE 00402000
  443. FINDTASK L R3,CPEXFPNT-CPEXBLOK(,R3) POINT TO NEXT BLOK 00403000
  444. CR R2,R3 END OF CHAIN 00404000
  445. BE STAKIT YES -- TRANSIT BLOK ALREADY STICKED 00405000
  446. C R9,CPEXR9-CPEXBLOK(,R3) TASK FOR OUR PAGE ?? 00406000
  447. BNE FINDTASK NO -- KEEP LOOKING 00407000
  448. SPACE 00408000
  449. FINDEND L R2,CPEXMISC-CPEXBLOK(,R3) GET POINTER TO DEFERED TASKS 00409000
  450. LTR R2,R2 ANY MORE ?? 00410000
  451. BZ CHAINIT NO -- CHAIN NEW ONE 00411000
  452. LR R3,R2 SAVE BACK POINTER 00412000
  453. B FINDEND AND LOOK FOR END 00413000
  454. SPACE 00414000
  455. STAKIT EQU * HERE IF BLOK ALREADY STACKED 00415000
  456. AIF (NOT &AP).NOAP2 **AIF*** 00415900
  457. CLI SAVEPROC,0 PROCESSOR AFFINITY FOR THIS CALL @V407594 00416000
  458. BE CALLSTK NO, STACK NORMALLY @V407594 00417000
  459. CLC SAVEPROC,LPUADDR+1 YES- FOR THIS PROCESSOR @V407594 00418000
  460. BNE STKOPP NO, STACK FOR OTHER PROCESSOR @V407594 00419000
  461. CALL DMKSTKMP STACK FOR THIS PROCESSOR ONLY @V407594 00420000
  462. B TRANXIT & EXIT @V407594 00421000
  463. STKOPP CALL DMKSTKOP STACK FOR OTHER PROCESSOR ONLY @V407594 00422000
  464. B TRANXIT AND EXIT @V407594 00423000
  465. CALLSTK DS 0H STACK FOR EITHER PROCESSOR @V407594 00424000
  466. .NOAP2 ANOP **ANOP** 00424100
  467. CALL DMKSTKCP STACK NEW BLOK 00425000
  468. B TRANXIT AND LEAVE 00426000
  469. SPACE 00427000
  470. CHAINIT ST R1,CPEXMISC-CPEXBLOK(,R3) CHAIN IN NEW TASK 00428000
  471. ST R2,CPEXMISC AND CLEAR POINTER 00429000
  472. AIF (NOT &AP).NOAP3 **AIF*** 00429900
  473. IC R15,SAVEPROC LOAD AFFINITY (IF ANY) @V407594 00430000
  474. STC R15,CPEXADD & STORE IN CPEXBLOK FOR DMKPAG @V407594 00431000
  475. .NOAP3 ANOP **ANOP** 00431100
  476. SPACE 00432000
  477. TRANXIT GOTO DMKPAGIO START ANY WAITING FOR I/O @VA01491 00433000
  478. SPACE 2 00434000
  479. TRANRETN EQU * HERE WHEN PAGE IS NO LONGER IN TRANSIT 00435000
  480. LA R4,1 RE-ESTABLISH INCREMENTER 00436000
  481. BAL R3,CKWT CHECK WAIT COUNT @V408246 00437000
  482. L R1,SAVER1 RESTORE VIRTUAL ADDRESS 00438000
  483. B RESTART RESTART TRANSLATION PROCESS 00439000
  484. EJECT 00440000
  485. *. 00441000
  486. * C. PROCESSING FOR NON-RESIDENT, NON-TRANSIT PAGES - 00442000
  487. * 1. IF USER HAS SPECIFIED 'BRING', CONTINUE; OTHERWISE, SET 00443000
  488. * CONDITION CODE 1 (PAGE NOT RESIDENT) AND EXIT 00444000
  489. * 2. PLACE THE USER IN PAGE-WAIT, INCREMENTING THE WAIT COUNT 00445000
  490. * 3. TEST FOR THE DEFERED RETURN OPTION AND HANDLE AS IN B.2 00446000
  491. * 4. CALL DMKPTRFR (E, BELOW) TO OBTAIN A FREE PAGE TO ASSIGN 00447000
  492. * TO THE USER 00448000
  493. * 5. IF THE VIRTUAL PAGE HAS NEVER BEEN REFERENCED, CLEAR IT TO 00449000
  494. * BINARY ZEROES AND GO TO STEP C.7 00450100
  495. * 6. CALL DMKPAGIO TO READ THE PAGE FROM THE BACKING STORE, AND 00451000
  496. * GO TO DMKDSPCH TO WAIT FOR IT 00452000
  497. *. 00453000
  498. SPACE 00454000
  499. READPAGE EQU * HERE IF USER PAGE IS NOT RESIDENT 00455000
  500. NI VMDSTAT,255-VMDSP NO FAST REDSP @V408246 00456000
  501. TM SAVER2+3,BRING BRING ASKED ?? 00457000
  502. BO SETWAIT YES -- USER MUST WAIT 00458000
  503. ST R9,SAVER2 SAVE ADDRESS PAGETABLE ENTRY 00459000
  504. CLI F0,X'FF' SET CC = 1 00460000
  505. B EXIT AND LEAVE 00461000
  506. SPACE 00462000
  507. SETWAIT EQU * 00463000
  508. CLI SWPDPAGE,0 HAS PAGE BEEN REFERENCED? @VA08184 00463100
  509. BNE SETWAIT1 YES, CONTINUE NORMALLY @VA08184 00463150
  510. TM SWPFLAG,SWPSHR IS THIS A SHARED PAGE? @VA08184 00463200
  511. BZ SETWAIT1 NO, CONTINUE NORMALLY @VA08184 00463250
  512. CLI FFS,X'00' SET CONDITION CODE 2 - SINCE THE @VA08184 00463300
  513. * PAGE WAS NOT SAVED, IT CANNOT BE 00463350
  514. * REFERENCED 00463400
  515. B EXIT AND EXIT @VA08184 00463450
  516. SPACE 00463500
  517. SETWAIT1 DS 0H @VA08184 00463550
  518. BAL R3,CKDEFER TEST FOR DEFERRED RETURN @V408246 00464000
  519. OI SWPFLAG,SWPALLOC FREEZE PAGE FOR ALLOCATION @V408246 00465000
  520. SR R2,R2 CLEAR PARM REGISTER 00466000
  521. BAL R3,PAGFREE GO GET A FREE PAGE 00467000
  522. NI SWPFLAG,X'FF'-SWPALLOC REMOVE ALLOCATION ENQUEUE FLAG 00468000
  523. STCM R5,B'0111',CORSWPNT+1 SAVE SWPTABLE PNTR (AND @V408246 00469000
  524. * CORFLAG 00470000
  525. OI SWPFLAG,SWPTRANS @V408246 00471000
  526. ST R9,CORPGPNT AND PAGTABLE ENTRY POINTER 00472000
  527. CLI SWPDPAGE,0 RECORD NUMBER ZERO ?? 00473000
  528. BNE DOIO NO -- PAGE MUST BE BROUGHT IN -- 00474000
  529. SPACE 2 00475000
  530. AIF (NOT &AP).NOAP4 **AIF*** 00475900
  531. CLI SAVEPROC,0 PROCESSOR AFFINITY SPECIFIED @V407594 00476000
  532. BE CLRPG NO @V407594 00477000
  533. CLC SAVEPROC,LPUADDR+1 CORRECT PROCESSOR NOW @V407594 00478000
  534. BE CLRPG YES, PROCEED @V407594 00479000
  535. TM APSTAT1,PROCIO CURRENTLY ON MAIN PROCESSOR @V407594 00480000
  536. BZ DOSWTCH NO- SWITCH FROM AP TO MAIN @V407594 00481000
  537. SPACE 1 @V407594 00482000
  538. ABEND 17 ERROR IN PROC'R AFFINITY LOGIC @V407594 00483000
  539. SPACE 1 @V407594 00484000
  540. DOSWTCH SWITCH SWITCH FROM AP TO MAIN @V407594 00485000
  541. SPACE 1 @V407594 00486000
  542. CLRPG DS 0H PROCESS ZEROES PAGE @V407594 00487000
  543. .NOAP4 ANOP **ANOP** 00487100
  544. STM R0,R3,BALRSAVE SAVE THESE REGISTER'S. @V408246 00488000
  545. LR R0,R7 GET ADDRESS OF CORETABLE ENTRY @V408246 00489000
  546. SL R0,ACORETBL GET PAGE ADDRESS /256. @V408246 00490000
  547. SLL R0,8 GET REAL PAGE ADDRESS. @V408246 00491000
  548. L R1,F4096 NUMBER OF BYTES TO CLEAR @V408246 00492000
  549. SLR R2,R2 USE PAD CHARACTER OF ZERO @V408246 00493000
  550. SLR R3,R3 ZERO BYTE COUNT FOR 2'ND OPERAND.@V408246 00494000
  551. MVCL R0,R2 CLEAR ENTIRE PAGE TO BINARY @V408246 00495000
  552. * ZEROES. 00496000
  553. LM R0,R3,BALRSAVE RESTORE REG'S WE USED @V408246 00497000
  554. B PAGEINA AND CONTINUE 00498000
  555. SPACE 00499000
  556. DOIO EQU * HERE TO SET UP FOR REAL PAGE READ 00500000
  557. L R2,PGREAD BUMP TOTAL PAGE READS 00501000
  558. AR R2,R4 -- 00502000
  559. ST R2,PGREAD 00503000
  560. L R2,VMPGREAD GET PAGE READ COUNT 00504000
  561. AR R2,R4 BUMP BY ONE 00505000
  562. ST R2,VMPGREAD AND SAVE 00506000
  563. L R2,VMPGRINQ GET SUM OF RESIDENT PAGES AT EACH READ 00507000
  564. AH R2,VMPAGES ADD CURRENT COUNT 00508000
  565. LH R14,VMFLPAG LOAD FLUSHED PAGES @VA07717 00508100
  566. AR R2,R14 FACTOR INTO NEXT VMWSPROJ @VA07717 00508150
  567. ST R2,VMPGRINQ AND SAVE 00509000
  568. AIF (NOT &AP).NOAP5 **AIF*** 00509900
  569. TM APSTAT1,APUOPER RUNNING AS AP @V407594 00510000
  570. BZ GETCPEX NO, DO PAGE READ @V407594 00511000
  571. TM SWPFLAG,SWPSHR SHARED PAGE @V407594 00512000
  572. BZ GETCPEX NO, DO PAGE READ @V407594 00513000
  573. * IF OTHER PROCESSOR'S COPY OF SHARED PAGE IS RESIDENT @V407594 00514000
  574. * WE CAN SUBSTITUTE AN MVCL FOR THE REAL PAGE I/O @V407594 00515000
  575. SR R14,R14 @V407594 00516000
  576. IC R14,SWPVPAGE LOAD VIRTUAL PAGE NUMBER @V407594 00517000
  577. AR R14,R4 PLUS ONE FOR HEADER @V407594 00518000
  578. SLL R14,3 TIMES 8 FOR ENTRY LENGTH @V407594 00519000
  579. LR R15,R5 POINT TO SWAP TBL ENTRY @V407594 00520000
  580. SR R15,R14 BACK TO HEADER @V407594 00521000
  581. LR R14,R15 ADDRESS OF SWAP TABLE HEADER @VMI0019 00521100
  582. S R14,=A(PAGTSWP) BACK UP TO PAGE TABLE HEADER @VMI0019 00521200
  583. L R14,PAGSHR-PAGTABLE(R14) SHRTABLE ADDRESS @VMI0019 00521300
  584. TM SHRFLAG-SHRTABLE(R14),SHRNOPRT UNPROTECTED @VMI0019 00521400
  585. * SHARED SEGMENT? IF SO, ONLY ONE 00521500
  586. * SET OF PG/SWP TABLES EXIST. 00521600
  587. BO GETCPEX GO DO PAGE READ @VMI0019 00521700
  588. TM SWPFLAG2-SWPTABLE(R15),SWPAPP 2ND SET OF TABLES?@V60B7AA 00522100
  589. LA R15,PAGBMP(,R9) ASSUME IPL PROC'S PAGE--POINT TO@V60B7AA 00522600
  590. * AP PTE 00523100
  591. BZ COPYSHR PAGE OWNED BY IPL PROCESSOR @V60B7AA 00523600
  592. S R15,=A(2*PAGBMP) AP PAGE;POINT TO IPL PROC'S PTE@V60B7AA 00524100
  593. COPYSHR LH R14,0(R15) LOAD PTE OF DUPLICATE PAGE @V407594 00526000
  594. N R14,=A(X'FFF0') PAGE FRAME ONLY @V407594 00527000
  595. BZ GETCPEX PAGE NOT RESIDENT OR RECLAIMABLE @V407594 00528000
  596. SLL R14,8 EXPAND TO REAL ADDRESS @V407594 00529000
  597. LR R2,R7 CORETABLE ENTRY @V407594 00530000
  598. SL R2,ACORETBL REAL ADDRESS/256 @V407594 00531000
  599. SLL R2,8 REAL ADDRESS OF TARGET FRAME @V407594 00532000
  600. L R15,F4096 LENGTH FOR MVCL @V407584 00533000
  601. L R3,F4096 DITTO @V407594 00534000
  602. MVCL R2,R14 COPY PAGE @V407594 00535000
  603. * NOW INSURE SOURCE PAGE WAS NOT CHANGED BEFORE OR @V407594 00536000
  604. * DURING MVCL @V407594 00537000
  605. S R14,F4096 BACK TO BEGINNING OF PAGE @V407594 00538000
  606. ISK R1,R14 STORAGE KEY FOR 1ST HALF OF PAGE @V407594 00539000
  607. LA R14,2048(R14) INCREMENT TO 2ND HALF PAGE @V407594 00540000
  608. SLL R1,8 SAVE KEY @V407594 00541000
  609. ISK R1,R14 INSERT 2ND KEY @V407594 00542000
  610. N R1,=A(X'0202') CLEAR ALL BUT CHANGE BITS @V407594 00543000
  611. BNZ GETCPEX PAGE WAS CHANGED- DO PAGE READ @V407594 00544000
  612. * CALL PAGE REPLENISHMENT IF NECESSARY @V407594 00545000
  613. LM R14,R15,=A(DMKSCHN1,DMKSCHN2) IN-Q COUNTERS @V407594 00546000
  614. L R14,0(R14) Q1 COUNT @V407594 00547000
  615. L R15,0(R15) Q2 COUNT @V407594 00548000
  616. LA R0,1(R14,R15) TOTAL COUNT+1 @V407594 00549000
  617. SRA R0,1 DIVIDE BY 2 @V407594 00550000
  618. C R0,DMKPTRFN MINIMUM PAGES AVAILABLE @V407594 00551000
  619. BNH PAGEINA YES, PROCESS COPIED PAGE @V407594 00552000
  620. BAL R8,SELECTA NO, REPLENISH FREE LIST @V407594 00553000
  621. B PAGEINA 'PAGE READ' COMPLETE @V407594 00554000
  622. .NOAP5 ANOP **ANOP** 00554100
  623. GETCPEX DS 0H @V407594 00555000
  624. LA R0,CPEXSIZE GET CORE FOR 00556000
  625. CALL DMKFREE A CPREQUEST BLOK 00557000
  626. LA R0,6 GET DASD READ DATA OP-CODE 00558000
  627. STM R0,R15,CPEXR0 SAVE ALL REGS 00559000
  628. LA R15,PAGEIN ADDRESS FOR RETURN TO EXECUTION 00560000
  629. ST R15,CPEXADD SET RETURN TO EXECUTION ADDRESS 00561000
  630. AIF (NOT &AP).NOAP6 **AIF*** 00561900
  631. TM SAVER2+3,VFAULT CALLED FOR VIRTUAL PAGE FAULT @V400141 00562000
  632. BO NOAFF YES- BYPASS PROCESSOR AFFINITY @V400141 00563000
  633. IC R15,SAVEPROC LOAD AFFINITY (IF ANY) @V407594 00564000
  634. STC R15,CPEXADD & PLACE IN CPEXBLOK FOR DMKPAG @V407594 00565000
  635. NOAFF DS 0H @V400141 00566000
  636. .NOAP6 ANOP **ANOP** 00566100
  637. L R0,DMKPTRRQ PUSH DOWN PAGE 00567000
  638. ST R1,DMKPTRRQ READ REQUEST 00568000
  639. ST R0,CPEXFPNT STACK 00569000
  640. BAL R8,SELECT REPLENISH FREE LIST IF NECESSARY @VA07693 00570100
  641. B PTRFDISP GO GET I/O STARTED @V408246 00578000
  642. EJECT 00579000
  643. CKDEFER EQU * HERE TO TEST FOR IMMEDIATE RETURN TO CALLER 00580000
  644. SPACE 00581000
  645. TM SAVER2+3,DEFER DEFERED RETURN REQUESTED ? @V213135 00582000
  646. BZ NOTDFERD NO -- PREPARE TO EXIT FORTHWITH @V213135 00583000
  647. LH R2,VMWCNT GET PAGE WAIT COUNT 00584000
  648. ALR R2,R4 UPDATE 00585000
  649. STH R2,VMWCNT AND SAVE 00586000
  650. OI VMRSTAT,VMPGWAIT FLAG USER IN PAGE WAIT 00587000
  651. TM VMRSTAT,VMCPWAIT-VMPGWAIT ALREADY NOT RUNNABLE? @V408246 00588000
  652. BCR 7,R3 YES, BYPASS SCHEDULE CALL @V408246 00589000
  653. CALL DMKSCHDL INSURE THAT USER IS DROPPED FROM Q 00590000
  654. BR R3 EXIT TO CALLER @V213135 00591000
  655. SPACE 00592000
  656. NOTDFERD EQU * HERE TO SET UP FOR NON-DEFERED @V213135 00593000
  657. * RETURN 00594000
  658. LH R2,VMNDCNT GET NON-DEFERRED PAGE READ COUNT @VA04283 00595000
  659. ALR R2,R4 INCREMENT @VA04283 00596000
  660. STH R2,VMNDCNT ...AND SAVE @VA04283 00597000
  661. CLC SAVERETN,SAVER3 HAS RET ADDR BEEN PROCESSED? @VA04283 00598000
  662. BER R3 IF SO, DON'T STACK ANOTHER BLOK @VA04283 00599000
  663. LA R0,CPEXSIZE ... @V213135 00600000
  664. CALL DMKFREE GET CORE FOR A CPREQUEST BLOK 00601000
  665. STM R0,R15,CPEXR0 SAVE ALL REGISTERS 00602000
  666. LA R3,TRANRETN RESTART FROM TOP @V408246 00603000
  667. ST R3,CPEXADD AND RETURN TO EXECUTION ADDRESS 00604000
  668. CALL DMKSTKCP STACK FOR DEFERED RETURN TO PAGTRANS 00605000
  669. L R15,SAVERETN GET CALLER'S RETURN ADDRESS 00606000
  670. L R12,SAVER12 AND BASE REGISTER 00607000
  671. L R0,SAVER3 GET RETURN ADDRESS PASSED ON GPR3@V213135 00608000
  672. ST R0,SAVERETN AND SAVE FOR EXIT WHEN PAGE @V213135 00609000
  673. * COMES IN 00610000
  674. LM R0,R11,SAVER0 GET CALLER'S REGS 00611000
  675. L R13,SAVER13 -- 00612000
  676. CLI ZEROES,X'FF' SET CC = 1 @V213135 00613000
  677. BR R15 AND RETURN NOW 00614000
  678. EJECT 00615000
  679. *. 00616000
  680. * 7. WHEN THE PAGE IS RESIDENT, DECREMENT THE WAIT COUNT, IF IT 00617100
  681. * IS ZERO, REMOVE THE USER FROM PAGE-WAIT 00618000
  682. * 8. SET THE STORAGE KEYS MAINTAINED IN THE SWPTABLE ENTRY INTO 00619100
  683. * THE KEYS OF THE REAL PAGE, AND CONTINUE WITH LOCK OPTION 00620000
  684. * PROCESSING AT D BELOW 00621000
  685. *. 00622000
  686. PAGEIN EQU * HERE AFTER PAGE IS IN CORE 00623000
  687. ST R15,SAVEWRK9 SAVE PAGEIO ERROR SWITCH 00624000
  688. PAGEINA DS 0H @V408246 00625000
  689. BAL R3,CKWT CHECK WAIT COUNT @V408246 00626000
  690. NI SWPFLAG,X'FF'-SWPTRANS RESET IN-TRANSIT FLAG @V408246 00627000
  691. SETKEYS EQU * JOINED HERE FOR RE-CLAIMED PAGES 00628000
  692. TM SWPFLAG,SWPRECMP READ-ONLY PAGE ? 00629000
  693. BZ CLEARID NO @V408246 00630000
  694. CLI SWPDPAGE,0 ZEROS PAGE? @V408246 00631000
  695. BE CLEARID YES, DOESN'T NEED HELP IN SETTING@V408246 00632000
  696. OI SWPFLAG,SWPCHG1 NO -FORCE SWAP TO HI-SPEED @V408246 00633000
  697. CLEARID EQU * 00634000
  698. OI SWPFLAG,SWPREF1 MARK REF'ED INITIALLY @V408246 00635000
  699. NI CORFLAG,CORIOLCK+CORCFLCK RESET ALL BUT THESE @V408246 00636000
  700. LR R6,R7 SAVE POINTER TO CORTABLE ENTRY 00637000
  701. S R6,ACORETBL GET PAGE ADDRESS/256 00638000
  702. SLL R6,8 GET PAGE ADDRESS 00639000
  703. LA R8,2048(,R6) GET ADDRESS OF 2ND HALF PAGE 00640000
  704. L R3,SWPFLAG GET USER'S KEYS IN LOW ORDER @V304735 00641000
  705. N R3,=A(X'F8F8') CLEAR REF/CHANGE BITS @V304735 00642000
  706. SSK R3,R8 SET KEY FOR 2'ND HALF PAGE @V304735 00643000
  707. SRL R3,8 JUSTIFY KEY FOR 1'ST HALF PAGE @V304735 00644000
  708. SSK R3,R6 SET KEY FOR 1'ST HALF PAGE @V304735 00645000
  709. TM SWPFLAG,SWPSHR IS THIS A SHARED PAGE ? @V304735 00646000
  710. BZ PAGEINB NO - NORMAL PATH @V304735 00647000
  711. OI CORFLAG,CORSHARE FLAG CORTABLE ENTRY (SHARED) @V304735 00648000
  712. L R15,DMKPTRSC GET SHARED PAGE COUNTER @V304735 00649000
  713. LA R15,1(,R15) ADD ONE MORE TO IT @V304735 00650000
  714. ST R15,DMKPTRSC SAVE NEW TOTAL @V304735 00651000
  715. PAGEINB DS 0H @V408246 00652000
  716. TM CORFLAG,CORCFLCK CONSOLE FUNCTION LOCK? @V408246 00653000
  717. BO PAGEINC YES, BYPASS COUNT INCREMENT @V408246 00654000
  718. LR R2,R11 SAVE ADDRESS OF VMBLOK @V408246 00655000
  719. TM SAVER2+3,SYSTEM CALL FOR SYSTEM V.M. SPACE? @V408246 00656000
  720. BZ *+8 NO @V408246 00657000
  721. L R2,ASYSVM YES - USE SYSTEM'S VMBLOK @V408246 00658000
  722. ST R2,CORFPNT CORE TABLE ENTRY POINTS TO VMBLOK@V408246 00659000
  723. LH R0,VMPAGES-VMBLOK(,R2) INCREMENT @V408246 00660000
  724. AR R0,R4 USER'S IN CORE PAGE COUNT @V408246 00661000
  725. STH R0,VMPAGES-VMBLOK(,R2) @V408246 00662000
  726. CH R0,VMXPG-VMBLOK(,R2) MAX. PAGES SO FAR? @V408246 00663000
  727. BNH *+8 NO @V408246 00664000
  728. STH R0,VMXPG-VMBLOK(,R2) YES, SET NEW MAX. @V408246 00665000
  729. TM VMPSTAT-VMBLOK(R2),VMRPAGE RESERVE USER? (FOR @V408246 00666000
  730. * R11=R2) 00667000
  731. BZ PAGEINC NO -- NO SPECIAL TREATMENT 00668000
  732. L R2,DMKPTRRC GET COUNT OF RESIDENT, RESERVED PAGES 00669000
  733. ALR R2,R4 AND INCREMENT 00670000
  734. CL R2,DMKPTRRL ABOVE HIGH WATER MARK ?? 00671000
  735. BH PAGEINC YES -- THIS PAGE NOT RESERVED 00672000
  736. ST R2,DMKPTRRC SAVE NEW COUNT 00673000
  737. OI CORFLAG,CORRSV AND FLAG RESERVED PAGE 00674000
  738. L R15,=A(DMKDSPNP) GET ADDRESS OF DYNAMIC PAGE COUNTER 00675000
  739. L R2,0(,R15) GET NUMBER OF ASSIGNABLE PAGE FRAMES 00676000
  740. SLR R2,R4 AND DECREMENT 00677000
  741. ST R2,0(,R15) AND SAVE 00678000
  742. PAGEINC EQU * 00679000
  743. L R1,XPAGNUM CHECK THE VIRTUAL PAGE NUMBER @V408246 00680000
  744. N R1,SAVER1 IS IT ZERO? @V408246 00681000
  745. BNZ TESTLOCK NO, NO FURTHER PROCESSING @V408246 00682000
  746. L R1,VMTIMER VALUE OF SAVED TIMER @V408246 00683000
  747. ST R1,TIMER-PSA(R6) BRING VIRT. 80 UP TO DATE @V408246 00684000
  748. TM VMTLEVEL,VMTON+VMRON VIRTUAL TIMERS RUNNING? @V408246 00685000
  749. BZ TESTLOCK NO @V408246 00686000
  750. TM VMMCR6,VMMVTMR VIRT TIMER ASSIST EN??? @V408246 00687000
  751. BNO TESTLOCK NOPE... @V408246 00688000
  752. ICM R15,B'0111',VMMADDR IS VMASSIST BEING USED???? @V408246 00689000
  753. BZ TESTLOCK NOPE... @V408246 00690000
  754. USING MICBLOK,R15 @V408246 00691000
  755. LA R2,80(,R6) GET VIRT TIMER ADDR. @V408246 00692000
  756. ST R2,MICVTMR SAVE IN VIRT MACH PTR LIST @V408246 00693000
  757. DROP R15 @V408246 00694000
  758. EJECT 00695000
  759. *. 00696000
  760. * D. PROCESSING LOCK OPTION AND EXIT FROM DMKPTRAN - 00697000
  761. * 1. IF THE LOCK OPTION IS NOT SPECIFIED, GO TO STEP D.4; 00698000
  762. * OTHERWISE, CONTINUE 00699000
  763. * 2. IF THE PAGE IS ALREADY LOCKED, SKIP TO STEP D.3; OTHER- 00700000
  764. * WISE, SET THE CORLOCK FLAG IN THE CORFLAG FIELD OF THE 00701000
  765. * CORTABLE ENTRY. 00702000
  766. * 3. ADD ONE TO THE LOCK COUNT IN THE CORTABLE ENTRY 00703000
  767. * 4. SET THE REAL TRANSLATED ADDRESS IN THE CALLER'S GPR2, MAKE 00704000
  768. * THE APPROPRIATE PAGTABLE ENTRY VALID, SET CC = 0, 00705000
  769. * AND EXIT TO THE CALLER 00706000
  770. *. 00707000
  771. SPACE 00708000
  772. TESTLOCK TM SAVER2+3,LOCK SHOULD PAGE BE LOCKED ?? 00709000
  773. BZ GETRADD NO -- GO DEVELOP REAL ADDRESS 00710000
  774. TM CORFLAG,CORIOLCK IS PAGE ALREADY LOCKED? @V408246 00711000
  775. BZ SETLOCKA NO - LOCK IT AND UPDATE COUNT. @V408246 00712000
  776. SETLOCK EQU * NOTE THAT GPR4 = 1 00713000
  777. AL R4,CORLCNT UPDATE LOCK COUNT 00714000
  778. SETLOCKA EQU * GPR4 NOW = TO LOCK COUNT 00715000
  779. ST R4,CORLCNT .... 00716000
  780. OI CORFLAG,CORIOLCK FLAG LOCKED PAGE 00717000
  781. GETRADD DS 0H @V408246 00718000
  782. LA R1,X'FFF' DISPLACEMENT MASK @V408246 00719000
  783. N R1,SAVER1 GET VIRTUAL ADDRESS DISPLACEMENT @V408246 00720000
  784. S R7,ACORETBL GET PAGE ADDRESS/256 00721000
  785. STH R7,PAGCORE UPDATE PAGE TABLE 00722000
  786. SLL R7,8 GET PAGE ADDRESS 00723000
  787. AR R1,R7 FORM REAL ADDRESS IN R1 @V386198 00724000
  788. SPACE 00725000
  789. CLI SAVEWRK9,0 PAGE IN OK ?? 00726000
  790. BNE PAGERROR NO -- 00727000
  791. SPACE 00728000
  792. ST R1,SAVER2 RETURN REAL ADDRESS IN GPR2 @V408246 00729000
  793. EXITCC0 CLI F0,X'00' SET CC = 0 @V407466 00730000
  794. EXIT LM R0,R11,SAVEREGS RESTORE REGS R0 THRU R11 @VM03012 00731000
  795. LCTL C1,C1,VMSEG RESTORE CALLERS SEGMENT TABLE @VM03012 00732000
  796. * ORIGIN 00733000
  797. SVC 12 RETURN TO CALLER @VM03012 00734000
  798. EXITRC LCR R9,R9 PLUS TO MINUS SETS CC = 1 @V407466 00735000
  799. B EXIT EXIT TO RETURN CC=1 @V407466 00736000
  800. EJECT 00737000
  801. *. 00738000
  802. * SEGMENT TABLE EXCEPTION HANDLER 00739000
  803. * 00740000
  804. * 1. BUILD PAGE TABLES AS REQUIRED, RETRY LRA 00741000
  805. * 00742000
  806. *. 00743000
  807. SEGEX DS 0H SEGMENT EXCEPTIONS HERE @V408246 00744000
  808. BC 1,ADDEX LENGTH VIOLATION, DOUBLE CHECK @V408246 00745000
  809. ICM R5,B'0110',1(R7) TEST FOR VALID PTR @V408246 00746000
  810. BZ SEGEXA NONE @V408246 00747000
  811. NI 3(R7),255-SEGINV CLEAR INVALID FLAG @V408246 00748000
  812. L R5,0(,R7) LOAD VALID POINTER @V408246 00749000
  813. LA R5,0(,R5) CLEAR COUNT FIELD @V408246 00750000
  814. S R5,F16 BACK-UP TO HEADER @V408246 00751000
  815. USING PAGSTMP,R5 @V408246 00752000
  816. STCK TEMPR2 STORE TOD CLOCK IN WORK AREA @V407594 00753000
  817. MVC PAGSTMP,TEMPR2 & MOVE HIGH WORD TO PG TBL HDR @V407594 00754000
  818. BC 3,DOWNWEGO CLOCK NOT FUNCTIONING @V408246 00755000
  819. ICM R6,B'0111',PAGSHR+1 NAMED SYSTEM PNTR. @V408246 00756000
  820. BZ SGXNS NOT NAMED @V408246 00757000
  821. ICM R6,B'1111',SHRSEGCT-SHRTABLE(R6) SHARED? @V408246 00758000
  822. BZ SGXNS NO @V408246 00759000
  823. L R0,PAGACT LOAD COUNTS @V407594 00760000
  824. AIF (NOT &AP).NOAP7 **AIF*** 00760900
  825. TM APSTAT1,APUOPER RUNNING IN AP MODE @V407594 00761000
  826. BO CSPGACT YES, USE COMPARE AND SWAP LOGIC @V407594 00762000
  827. .NOAP7 ANOP **ANOP** 00762100
  828. AL R0,=A(X'10000') INCREMENT ACTIVE COUNT @V407594 00763000
  829. ST R0,PAGACT & REPLACE IN PG TBL HDR @V407594 00764000
  830. AIF (NOT &AP).NOAP8 **AIF*** 00764900
  831. B SGXNS @V407594 00765000
  832. CSPGACT LR R14,R0 @V407594 00766000
  833. AL R14,=A(X'10000') INCREMENT ACTIVE COUNT @V407594 00767000
  834. CS R0,R14,PAGACT UPDATE ACTIVE COUNT @V407594 00768000
  835. BC 4,CSPGACT UPDATE FAILED @V407594 00769000
  836. .NOAP8 ANOP **ANOP** 00769100
  837. SGXNS DS 0H @V407594 00770000
  838. CLM R7,B'0111',VMSEG+1 FOR SEGMENT 0? @V408246 00771000
  839. BNE ADDROK NO @V408246 00772000
  840. LRA R15,0 PAGE 0 NOW AVAILABLE? @V408246 00773000
  841. BNZ ADDROK NO @V408246 00774000
  842. MVC TIMER-PSA(4,R15),VMTIMER YES, UPDATE VRT. 80 @V408246 00775000
  843. TM VMMCR6,VMMVTMR IS TIMER ASSIST BEING USED? @V408246 00776000
  844. BZ ADDROK NO @V408246 00777000
  845. ICM R14,B'0111',VMMADDR VM ASSIST ON FOR USER? @V408246 00778000
  846. BZ ADDROK NO @V408246 00779000
  847. LA R0,TIMER-PSA(,R15) POINT TIMER ASSIST HERE... @V408246 00780000
  848. ST R0,MICVTMR-MICBLOK(R14) @V408246 00781000
  849. B ADDROK @V408246 00782000
  850. * 00783000
  851. SEGEXA DS 0H LET SEGTRANS HANDLE EXCEPTION @V408246 00784000
  852. CL R1,VMSTOR-VMBLOK(R2) WITHIN PERMANENT MEMORY @V407594 00785000
  853. BNL ADDEX NO- ADDRESSING EXCEPTION @V407594 00786000
  854. STM R0,R2,SAVEWRK2 SAVE REGS ACROSS BAL @V408246 00787000
  855. BAL R3,CKDEFER CHECK DEFER AND SET PAGEWAIT @V408246 00788000
  856. LM R0,R2,SAVEWRK2 RESTORE AFTER RETURN @V408246 00789000
  857. LR R2,R1 SAVE VIRTUAL ADDRESS @V408246 00790000
  858. * THIS IS THE STANDARD CASE FOR AN INVALID SEGMENT 00791000
  859. * PAGE AND SWAP TABLE HAVE NOT YET BEEN BUILT. 00792000
  860. SRL R2,16 STE NO. @V408246 00793000
  861. LR R1,R2 SEGMENT NUMBER IN GPR1 @V408246 00794000
  862. AR R1,R4 STE NO. + 1 @V408246 00795000
  863. SLL R1,16 ENDING SEGMENT ADDRESS + 1 @V408246 00796000
  864. C R1,VMSTOR OVERSHOT VIRTUAL MACHINE MEMORY? @V408246 00797000
  865. BNH *+8 NO, OK @V408246 00798000
  866. L R1,VMSTOR YES, RESET TO MAX. @V408246 00799000
  867. SRL R1,12 POSITION ENDING ADDRESS @V408246 00800000
  868. BCTR R1,0 ORIGIN 0 COUNT @V408246 00801000
  869. SLL R2,20 POSITION STARTING ADDRESS @V408246 00802000
  870. ALR R1,R2 COMBINE STARTING AND ENDING @V408246 00803000
  871. * ADDRESS 00804000
  872. CALL DMKBLDRT,PARM=PAGTONLY+NEWPAGES @V408246 00805000
  873. ST R2,0(R7) UPDATE STE W/CNT+PG TBL PTR @V408246 00806000
  874. BAL R3,CKWT RESET PAGEWAIT @V408246 00807000
  875. LM R0,R2,SAVEWRK2 RESTORE THEM AGAIN @V408246 00808000
  876. B ADDROK @V408246 00809000
  877. * 00810000
  878. * ADDRESSSNG EXCEPTION, RETURN C.C. = 2 00811000
  879. * 00812000
  880. ADDEX DS 0H ADDRESSING EXCEPTION @V408246 00813000
  881. CLI FFS,0 SET CONDITION CODE 2 @V408246 00814000
  882. B EXIT AND LEAVE @V408246 00815000
  883. * 00816000
  884. DROP R5 @V408246 00817000
  885. USING SWPFLAG,R5 @V408246 00818000
  886. EJECT 00819000
  887. PAGERROR EQU * HERE IF AN IOERROR OCCURED DURING PAGEING 00820000
  888. LR R2,R7 GET REAL PAGE ADDRESS @V386198 00821000
  889. L R3,F4096 LENGTH OF ONE PAGE FRAME .. 00822000
  890. SLR R4,R4 DUMMY ADDRESS FOR MVCL 00823000
  891. SLR R5,R5 LENGTH AND PADDING .. 00824000
  892. MVCL R2,R4 CLEAR THE PAGE FRAME IN ERROR 00825000
  893. SRL R7,8 PAGE NUMBER X 16 @VA07310 00825100
  894. AL R7,ACORETBL BASE CORE TABLE ENTRY @VA07310 00825200
  895. L R5,CORSWPNT PICK-UP SWAPTABLE ENTRY @V408246 00826000
  896. TM SWPFLAG,SWPSHR SHARED PAGE @VA12685 00827050
  897. BZ BADBKST NO, SKIP UNSHARE OF USER @VA12685 00827100
  898. MVC PAGCORE,INVLPTE INVALIDATE PTE @VA12685 00827150
  899. XC CORPGPNT(4),CORPGPNT CLEAR CORETBL PTE PTR @VA12685 00827200
  900. SLR R0,R0 ... @VA12685 00827250
  901. STCM R0,B'0111',CORSWPNT+1 CLR SWPTBL PTR IN CORETBL @VA12685 00827300
  902. NI CORFLAG,255-CORSHARE CLEAR FLAGS @VA12685 00827350
  903. CALL DMKPTRFT PLACE FRAME ON FREE LIST @VA12685 00827400
  904. B HNDLERR ISSUE CP MSG OR RETURN TO USER @VA12685 00827450
  905. SPACE 1 00827500
  906. INVLPTE DC X'0008' INVALID PTE CONSTANT @VA12685 00827550
  907. SPACE 1 00827600
  908. BADBKST OI SWPFLAG,SWPRECMP BACKING STORE UNUSABLE @VA12685 00827650
  909. XC SWPCYL(4),SWPCYL ZEROS PAGE @V408246 00828000
  910. HNDLERR TM SAVER2+3,IOERETN USER WANT TO HANDLE ERROR ? @VA12685 00829500
  911. ST R1,SAVER2 RETURN REAL ADDRESS IN GPR2 @V408246 00830000
  912. BO SETCC3 YES -- JUST RETURN CC 00831000
  913. SPACE 2 00832000
  914. MSG 'DMKPTR410W CP ENTERED; PAGING ERROR' 00833000
  915. CALL DMKQCNWT,PARM=NORET 00834000
  916. CALL DMKCFMBK PUT USER IN CONSOLE FUNTION MODE @VA09005 00834500
  917. SETCC3 TM FFS,X'FF' SET CC = 3 00835000
  918. B EXIT AND EXIT TO CALLER 00836000
  919. SPACE 2 00837000
  920. CKWT EQU * TEST FOR NORMAL OR NON-DEFERED @V213135 00838000
  921. * PAGE 00839000
  922. TM SAVER2+3,DEFER WAS DEFER REQUESTED FOR THIS @V213135 00840000
  923. * PAGE ? 00841000
  924. BZ NOWAIT NO -- USER WAS NOT IN PAGEWAIT, @V213135 00842000
  925. * THEN 00843000
  926. SPACE 00844000
  927. LH R2,VMWCNT GET WAIT COUNT @V213135 00845000
  928. BCT R2,WTCOUNT DECREMENT AND TEST @VA01061 00846000
  929. NI VMRSTAT,X'FF'-VMPGWAIT CLEAR WAIT FLAG. @VA01061 00847000
  930. WTCOUNT STH R2,VMWCNT AND UPDATE NEW COUNT. @VA01061 00848000
  931. TM VMRSTAT,VMCPWAIT STILL NOT RUNNABLE? @V408246 00849000
  932. BCR 7,R3 YES, BYPASS SCHEDULE CALL @V408246 00850000
  933. CALL DMKSCHDL NOTIFY SCHEDULE OF CHANGE OF @V408246 00851000
  934. * STATUS 00852000
  935. BR R3 AND RETURN @V213135 00853000
  936. SPACE 00854000
  937. NOWAIT EQU * HERE IF NEW PAGE WAS NON-DEFERED @V213135 00855000
  938. LH R2,VMNDCNT GET NON-DEFERED COUNT @V213135 00856000
  939. BCTR R2,R0 DECREMENT @V213135 00857000
  940. STH R2,VMNDCNT AND SAVE @V213135 00858000
  941. BR R3 AND RETURN 00859000
  942. * 00860000
  943. DOWNWEGO DS 0H CLOCK DAMAGED - ABEND CVT001 @V408246 00861000
  944. GOTO DMKCVTAB @V408246 00862000
  945. SPACE 1 @V407594 00863000
  946. DROP R12,R10 @V407594 00864000
  947. EJECT 00865000
  948. *. 00866000
  949. * E. DMKPTRFR - ALLOCATE REAL CORE PAGE FRAME 00867000
  950. * 1. IF THE CALLER IS DMKFREE TRYING TO EXTEND SYSTEM FREE 00868000
  951. * STORAGE, CONTINUE; OTHERWISE, SKIP TO STEP 6. 00869000
  952. * 3. RETURN SPARE STORAGE SAVED FOR 'EXTEND' TO FREE STORAGE 00870000
  953. * 4. IF NO PAGES ARE CURRENTLY ON THE FREE LIST OR IN TRANSIT 00871000
  954. * OUT OF THE SYSTEM, CONTINUE; OTHERWISE, SKIP TO STEP 6. 00872000
  955. * 5. OBTAIN A CPEXBLOK, AND SET ITS RETURN ADDRESS TO STEP 10. 00873000
  956. * 6. BRANCH AND LINK TO TO THE PAGFREE SUBROUTINE TO GET A PAGE 00874000
  957. * 7. IF THE PAGE OBTAINED IS NOT FOR FREE STORAGE, PASS THE 00875000
  958. * ADDRESS OF THE CORTABLE ENTRY TO THE CALLER, AND SKIP TO 00876000
  959. * STEP 9; OTHERWISE, CONTINUE 00877000
  960. * 8. FLAG THE CORTABLE ENTRY AS A CP OWNED, FREE STORAGE PAGE, 00878000
  961. * PLACE THE STORAGE OBTAINED INTO THE FREE LIST VIA A CALL 00879000
  962. * TO DMKFRETR, AND RESET THE EXTEND LOCK. 00880000
  963. * 9. BRANCH AND LINK TO THE SELECT SUBROUTINE TO REPLENISH THE 00881000
  964. * FREE PAGE LIST, AND EXIT TO THE CALLER. 00882000
  965. * 10. SCAN ALL OF THE AVAILABLE PAGEABLE STORAGE TO LOCATE A 00883000
  966. * NON-CHANGED PAGE FRAME TO SATISFY THE REQUEST. IF A NON- 00884000
  967. * CHANGED PAGE CAN BE FOUND, ENTER THE SELECT ROUTINE LOGIC 00885000
  968. * AT LABEL 'EXTSRCH' WHERE A PAGE FRAME HAS ALREADY BEEN 00886000
  969. * SELECTED. OTHERWISE ENTER THE SELECT ROUTINE AT THE 00887000
  970. * BEGINNING. 00888000
  971. *. 00889000
  972. SPACE 00890000
  973. ENTRY DMKPTRFR @VA08037 00891100
  974. DMKPTRFR DS 0H @VA08037 00891200
  975. USING *,R12 @VA08037 00891300
  976. STM R0,R11,SAVEREGS @VA08037 00891400
  977. SL R12,LABEL1 @VA08037 00891500
  978. USING DMKPTR,R12 @VA08037 00891600
  979. LR R10,R12 @VA08037 00891700
  980. A R10,F4096 @VA08037 00891800
  981. USING DMKPTR+4096,R10 @VA08037 00891900
  982. B LABEL2 @VA08037 00892000
  983. LABEL1 DC A(DMKPTRFR-DMKPTR) @VA08037 00892100
  984. LABEL2 DS 0H @VA08037 00892200
  985. LA R5,SAVEWRK6 LET R5 POINT TO A HARMLESS SCRATCH-AREA 00895000
  986. * WORD (TO KEEP "OI" AT "SETALLOC" FROM 00896000
  987. * CLOBBERING A RANDOM BYTE PER CALLER'S R5) 00897000
  988. CL R2,F1 HIGH PRIORITY CALL FROM DMKFREE ?? 00898000
  989. BE EXTEND YES, CONT (XTNDLOCK SET BY FRE) @V407466 00899000
  990. CL R2,F2 HIGH PRIORITY CALL + RETURN CODE @V407466 00900000
  991. BNE PAGEGET NO, CAN AFFORD TO WAIT FOR PAGE @V407466 00901000
  992. * YES - CONTINUE (XTNDLOCK SET BY DMKFRE): 00902000
  993. EXTEND SLR R0,R0 CLEAR LENGTH DW'S TO FRET @VM08952 00903000
  994. IC R0,DMKPTRFA GET INTO R0 - LENGTH @VM08952 00904000
  995. L R1,DMKPTRFA ADDRESS OF EXTEND BUFFER @VM08952 00905000
  996. LA R1,0(,R1) CLEAR HI BYTE @VM08952 00906000
  997. CALL DMKFRET RETURN IT TO FREE @VM08952 00907000
  998. SLR R0,R0 INDICATE THAT THE EXTEND BUFFER @V407466 00908000
  999. ST R0,DMKPTRFA HAS BEEN GIVEN OUT @V407466 00909000
  1000. LM R0,R1,DMKPTRFN GET NUMBER OF NOW AND FUTURE FREE PAGES 00910000
  1001. LTR R0,R0 ANY PAGES IMMEDIATELY AVAILABLE ? 00911000
  1002. BP PAGEGET YES -- GO GET ONE 00912000
  1003. LA R0,CPEXSIZE NO PAGE IN SIGHT -- DO IT THE HARD WAY 00913000
  1004. CALL DMKFREE GET A CPEXBLOK SO WE CAN RETURN 00914000
  1005. LA R15,DMKPTRFE GET RETURN ADDRESS TO EXTEND 00915000
  1006. STM R15,R13,CPEXADD AND SAVE IN CPEXBLOK 00916000
  1007. CALL DMKSTKCP STACK THE BLOK SO WE CAN RESTART 00917000
  1008. SIGNAL EXTEND,CONTROL=SERIAL ANNOUNCE EXTEND IN PROG @V407594 00918000
  1009. PAGEGET LA R4,1 ESTABLISH DMKPTR'S STANDARD INCREMENTER 00919000
  1010. BAL R3,PAGFREE AND GO TRY FOR A PAGE 00920000
  1011. SPACE 00921000
  1012. DMKPTRFP EQU * HERE AFTER WE HAVE OUR PAGE 00922000
  1013. CLC SAVER2,F1 WAS CALL FROM DMKFREE TO EXTEND ?@V304735 00923000
  1014. BE EXTPAGE YES - MERGE INTO 'FREE CHAIN' @V304735 00924000
  1015. CLC SAVER2,F2 WAS CALL FROM DMKFREE WITH RC @V407466 00925000
  1016. BE EXTPAGE YES, MERGE INTO FREE CHAIN @V407466 00926000
  1017. ST R7,SAVER7 PASS BACK THE CORTABLE ENTRY ADDRESS 00927000
  1018. ST R11,CORFPNT ASSIGN PAGE TO OWNER @V408246 00928000
  1019. B EXIT AND EXIT @V3M4026 00929000
  1020. SPACE 00930000
  1021. EXTPAGE EQU * HERE TO MERGE PAGE INTO FREE STORAGE CHAIN 00931000
  1022. MVC CORFPNT,=C'FREE' FIRST, FLAG THE CORTABLE ENTRY 00932000
  1023. MVI CORFLAG,CORCP AS A CP OWNED, FREE STORAGE PAGE 00933000
  1024. SL R7,ACORETBL GET DISPLACEMENT OF ENTRY INTO TABLE 00934000
  1025. SLL R7,8 GET REAL PAGE ADDRESS 00935000
  1026. LR R1,R7 INTO GPR1 FOR DMKFRET 00936000
  1027. SR R6,R6 SET KEY TO ZERO @VA02537 00937000
  1028. LA R5,2048(,R7) ADDRESS OF SECOND 2K @VA02537 00938000
  1029. SSK R6,R7 SET FIRST 2K @VA02537 00939000
  1030. SSK R6,R5 SET SECOND 2K @VA02537 00940000
  1031. LA R0,512 GET THE SIZE OF A PAGE IN DOUBLE WORDS 00941000
  1032. CALL DMKFRETR AND MERGE IT INTO THE CHAIN 00942000
  1033. LA R0,CPEXSIZE*8 GET ANOTHER LARGE BLOCK @V408246 00943000
  1034. CALL DMKFREE ... @VM08952 00944000
  1035. ST R1,DMKPTRFA SAVE THE NEW AREA GOTTEN @VM08952 00945000
  1036. STC R0,DMKPTRFA AND SAVE ITS LENGTH IN DBL WDS @V407594 00946000
  1037. TM APSTAT1,APUOPER RUNNING AS AP @V407594 00947000
  1038. BZ SKIPAP NO @V407594 00948000
  1039. L R4,=A(DMKFREAP) AP BACK POCKET @V407594 00949000
  1040. ICM R1,B'0111',1(R4) ACCESS AP BACK POCKET @V407594 00950000
  1041. BNZ SKIPAP REPLENISHMENT NOT REQUIRED @V407594 00951000
  1042. SR R0,R0 CLEAR REG @V407594 00952000
  1043. IC R0,0(R4) LOAD SIZE OF DMKFREAP (DBL WDS) @V407594 00953000
  1044. CALL DMKFREE GET STORAGE @V407594 00954000
  1045. STCM R1,B'0111',1(R4) SAVE ITS ADDRESS @V407594 00955000
  1046. LA R0,CPEXSIZE MUST GET CPEXBLOK TOO @VA12596 00955100
  1047. CALL DMKFREE @VA12596 00955300
  1048. ST R1,4(,R4) PUT CPEX POINTER IN DMKFREAP @VA12596 00955500
  1049. SKIPAP DS 0H @V407594 00956000
  1050. LA R0,CPEXSIZE GET CPEXBLOK @V408246 00957000
  1051. CALL DMKFREE @V408246 00958000
  1052. LA R15,PTRFDISP AMKE SURE WE WAKE-UP AFTER EXTEND@V408246 00959000
  1053. STM R15,R13,CPEXADD @V408246 00960000
  1054. CALL DMKSTKCP @V408246 00961000
  1055. CLC SAVER2,F2 DMKPTR CALLED WITH PARM = 2 @V407466 00962000
  1056. BE EXITCC0 YES, PAGE OBTAINED SUCCESSFULLY @V407466 00963000
  1057. B EXIT EXIT WITHOUT PAGE REPLENISHING @V3M4026 00964000
  1058. * (XTNDLOCK STILL SET - CLEARED BY DMKFRE) 00965000
  1059. EJECT 00966000
  1060. * 00967000
  1061. * SCAN IN-CORE PAGES FOR NON-CHANGED TO SATISFY EXTEND REQ. 00968000
  1062. * 00969000
  1063. DMKPTRFE DS 0H HEVE VIA CPEXBLOK TO SELECT PAGE @V408246 00970000
  1064. SR R0,R0 @V407594 00971000
  1065. ST R0,TEMPR0 CLEAR FLAGS @V407594 00972000
  1066. LA R8,SELDSPX GO DIRECTLY TO . . @V408246 00973000
  1067. ST R8,SAVEWRK8 . . DSP AFTER SELECT @V408246 00974000
  1068. LA R4,1 INCREMENTER (=1) @V408246 00975000
  1069. XC SAVEWRK1,SAVEWRK1 DON'T NEED ANYMORE PAGES @V408246 00976000
  1070. LA R3,TSTUSR LOOP BRANCH ADDRESS @V408246 00977000
  1071. LA R7,DMKPTRU1 CHAIN OF USER Q-DROP PAGES @V408246 00978000
  1072. LR R0,R7 SAVE ANCHOR @V408246 00979000
  1073. TSTUSR DS 0H @V408246 00980000
  1074. L R7,CORFPNT NEXT PAGE ON LIST @V408246 00981000
  1075. CR R7,R0 BACK AT THE START? @V408246 00982000
  1076. BE FLLSCN YES, SCAN ALL PAGES @V408246 00983000
  1077. LR R6,R7 GET PAGE'S REAL ADDRESS @V408246 00984000
  1078. SL R6,ACORETBL PAGE NO. * 16 @V408246 00985000
  1079. SLL R6,8 PAGE ADDRESS @V408246 00986000
  1080. B TESTCHG CHECK FOR CHANGED PAGE @V408246 00987000
  1081. * 00988000
  1082. * PART TWO OF SCAN IF NO UNCHANGED PAGES 00989000
  1083. * 00990000
  1084. FLLSCN DS 0H @V408246 00991000
  1085. LA R2,FULLSCAN ADDRESS OF FIRST SCAN BLOCK @VA08341 00991100
  1086. FLLSCN1 LA R3,CONTST BRANCH ADDRESS @VA08341 00992100
  1087. LM R6,R9,0(R2) LOAD TABLE VALUES FOR BXH SEARCH @VA08341 00993100
  1088. LTR R6,R6 TEST IF TABLES HAVE BEEN EXCEEDED@VA11926 00993400
  1089. BM SCNEND YES--BRANCH OUT @VA11926 00993700
  1090. L R1,F4096 CONSTANT TO DECREMENT PAGE ADDR @V407594 00994000
  1091. TSTFLAG TM CORFLAG,255-CORSHARE-CORRSV PICK ANY UNLOCKED @V408246 00995000
  1092. * PAGE 00996000
  1093. BZ TESTCHG YES, TEST CHANGED @V408246 00997000
  1094. CONTST SLR R6,R1 GET NEXT REAL PAGE ADDRESS @V407594 00998000
  1095. BXH R7,R8,TSTFLAG LET BXH GET NEXT CORETABLE ENTRY @V408246 00999000
  1096. LA R2,20(R2) INCREMENT TO NEXT BLOCK TO SCAN @VA08341 00999100
  1097. TM SCANFLAG,VEQRUNLK HAVE V=R PAGES BEEN UNLOCKED? @VA08341 00999200
  1098. BO FLLSCN1 YES, BRANCH TO TRY THOSE PAGES @VA08341 00999300
  1099. SCNEND DS 0H @VA11926 00999350
  1100. L R2,SAVER2 RESTORE CALLER'S REGISTER 2 @VA08341 00999400
  1101. SR R13,R13 GO DIRECTLY TO PAGIO AFTER SELECT@V408246 01000000
  1102. CL R2,F2 CONDITIONAL CALL FROM FREE @V407594 01001000
  1103. BNE USERPAGE NO, NORMAL EXTEND CALL @V407594 01002000
  1104. LR R13,R2 REMEMBER CONDITIONAL CALL @V407594 01003000
  1105. B USERPAGE NO NON-CHANGED PAGES, TAKE ANY @V408246 01004000
  1106. TESTCHG DS 0H @V408246 01005000
  1107. ICM R5,B'0111',CORSWPNT+1 GET SWAP TABLE ENTRY @V408246 01006000
  1108. * POINTER 01007000
  1109. BZ FRETIT NO POINTER, PAGE UNOWNED @V408246 01008000
  1110. TM SWPFLAG,SWPTRANS+SWPALLOC+SWPCHG1+SWPCHG2 @V408246 01009000
  1111. * AVAILABLE? 01010000
  1112. BCR 7,R3 NO, TRY NEXT PAGE @V408246 01011000
  1113. ISK R15,R6 GET STORAGE KEY @V408246 01012000
  1114. SLL R15,8 MAKE ROOM FOR 2ND HALF OF PAGE @V408246 01013000
  1115. LA R14,2048(,R6) ADDR FOR 2ND 2K @V408246 01014000
  1116. ISK R15,R14 GET OTHER STORAGE KEY @V408246 01015000
  1117. LA R14,SWPREF2*256+SWPREF2 GET CHANGE BIT MASK @V408246 01016000
  1118. NR R14,R15 WAS PAGE CHANGED? @V408246 01017000
  1119. BCR 7,R3 YES, LOOK FOR ANOTHER PAGE @V408246 01018000
  1120. TM CORFLAG,CORFLUSH USER FLUSH PAGE? @V408246 01019000
  1121. BNZ USERPGA YES @V408246 01020000
  1122. RRB 0(R6) MAKE SURE BITS RESET FOR SELECT. @V408246 01021000
  1123. BZ *+8 NO RE.F BIT TO BACK-UP @V408246 01022000
  1124. OI SWPKEY1,4 VIRT. BACK-UP KEY @V408246 01023000
  1125. RRB 2048(R6) . . @V408246 01024000
  1126. BZ *+8 NO REF. BIT TO BACK-UP @V408246 01025000
  1127. OI SWPKEY2,4 VIRT. BACK-UP KEY @V408246 01026000
  1128. * R14 SET UP TO REFLECT NON-CHANGED PAGE 01027000
  1129. OI TESTFLG+1,CORRSV SET FOR AP LOOKASIDE MAINT @V407594 01028000
  1130. B EXTSRCH PUT PAGE ON FREELIST @V408246 01029000
  1131. SPACE 1 @V407594 01030000
  1132. PTR7A LA R0,2 CHECK VALUE FOR PTRFR CALL PARM=2@V407594 01031000
  1133. CL R13,F2 CONDITIONAL FREE CALL @V4M0192 01032000
  1134. BNE PTR7 NO, ABEND @V4M0192 01033000
  1135. LA R1,FREEQ ADDR OF THE HEAD OF THE QUEUE @V407594 01034000
  1136. LA R5,DMKPTRFP RETURN ADDR FOR OUR REQUEST @V407594 01035000
  1137. NEXTREQ LR R4,R1 SAVE PREV REQUEST BLOK ADDRESS @V407594 01036000
  1138. L R1,CPEXFPNT-CPEXBLOK(R4) GET THE NEXT REQUEST @V407594 01037000
  1139. LTR R1,R1 IS THERE ONE? @V407594 01038000
  1140. BNZ REQLOOP YES, GO CHECK IT OUT @V407594 01039000
  1141. PTR6A GOTO DMKDSPCH NO DEF REQ, PGE MUST'VE BEEN FND @V407594 01040000
  1142. SPACE 3 @V407594 01041000
  1143. REQLOOP CL R0,CPEXR2 THIS A DMKFRERC CALL TO EXTEND? @V407594 01042000
  1144. BNE PTR6A NOPE, MUST HAVE BEEN STACKED @V407594 01043000
  1145. L R13,CPEXR13 RECLAIM SAVE AREA @V407594 01044000
  1146. L R2,CPEXFPNT GET PTR TO NEXT DEFERED REQUEST @V407594 01045000
  1147. ST R2,CPEXFPNT-CPEXBLOK(R4) STORE IN PREVIOUS @V407594 01046000
  1148. LA R0,CPEXSIZE SIZE OF BLOCK @V407594 01047000
  1149. CALL DMKFRET DEF. REQ. WILL NEVER BE SATISFIED@V407594 01048000
  1150. LA R0,CPEXSIZE*16 SIZE OF EXTEND BUFFER @V407594 01049000
  1151. CALL DMKFREE RE-OBTAIN EXTEND BUFFER @V407594 01050000
  1152. ST R1,DMKPTRFA SAVE THE BUFFER ADDRESS @V407594 01051000
  1153. STC R0,DMKPTRFA AND THE SIZE OF THE BUFFER TOO @V407594 01052000
  1154. B EXITRC GO TELL USER: NO MORE STORAGE @V407594 01053000
  1155. SPACE 01054000
  1156. EJECT 01055000
  1157. *. 01056000
  1158. * 11. COUNT THE CALLS TO PAGFREE; THEN, DECREMENT AND TEST THE 01057000
  1159. * NUMBER OF FREE PAGES AVAILABLE. IF A PAGE IS AVAILABLE, 01058000
  1160. * SKIP TO STEP 12; OTHERWISE, CHAIN A CPEXBLOK TO THE QUEUE 01059000
  1161. * OF TASKS WAITING FOR PAGES AND EXIT TO DISPATCH. 01060000
  1162. *. 01061000
  1163. SPACE 01062000
  1164. PAGFREE EQU * ENTRY FROM WITHIN DMKPTRAN 01063000
  1165. L R0,DMKPTRFC COUNT NUMBER OF CALLS 01064000
  1166. ALR R0,R4 -- 01065000
  1167. ST R0,DMKPTRFC -- 01066000
  1168. SPACE 01067000
  1169. L R0,DMKPTRFN GET FREE PAGE COUNTER 01068000
  1170. SR R0,R4 DECREMENT @V408246 01069000
  1171. BNM GETFREE SOMETHING TO GIVE OUT @V408246 01070000
  1172. SPACE 01071000
  1173. L R0,DMKPTRF0 COUNT NUMBER OF TIMES WE WERE OUT 01072000
  1174. AR R0,R4 OF FREE PAGES TO ASSIGN 01073000
  1175. ST R0,DMKPTRF0 -- 01074000
  1176. SPACE 01075000
  1177. LA R0,CPEXSIZE GET CORE FOR A CPREQUEST BLOK 01076000
  1178. CALL DMKFREE 01077000
  1179. STM R2,R13,CPEXR2 SAVE REGISTERS 01078000
  1180. LR R6,R3 AND RETURN ADDRESS 01079000
  1181. LA R2,FREEQ POINT TO QUEUE OF DEFERED REQUESTS 01080000
  1182. CL R4,CPEXR2 CALL BY FREE TO EXTEND ?? 01081000
  1183. BE SETFIRST YUP, MAKE REQ FIRST ON CHAIN @V407466 01082000
  1184. CLC CPEXR2,F2 RETURN CODE CALL FOR EXTEND @V407594 01083000
  1185. BNE NEXTQ NO, ADD TO END OF CHAIN @V407594 01084000
  1186. SETFIRST L R3,FREEQ CHAIN REQ AHEAD OF ALL OTHERS @V407466 01085000
  1187. B QREQUEST -- 01086000
  1188. SPACE 01087000
  1189. NEXTQ L R3,CPEXFPNT-CPEXBLOK(,R2) GET POINTER TO NEXT BLOK 01088000
  1190. LTR R3,R3 ARE THERE ANY ?? 01089000
  1191. BZ QREQUEST 01090000
  1192. LR R2,R3 SAVE PREVIOUS POINTER 01091000
  1193. B NEXTQ AND KEEP LOOKING 01092000
  1194. SPACE 2 01093000
  1195. QREQUEST ST R1,CPEXFPNT-CPEXBLOK(,R2) CHAIN NEW REQUEST TO END 01094000
  1196. SR R5,R5 ZERO TASK CHAIN 01095000
  1197. STM R3,R6,CPEXFPNT SET FORWARD POINTER, TASK CHAIN TO 0, 01096000
  1198. * AND SAVE EXECUTION ADDRESS 01097000
  1199. SPACE 01098000
  1200. L R15,PREFIXA ACCESS ABSOLUTE PSA @V407594 01099000
  1201. CLI XTNDLOCK-PSA(R15),0 SYSTEM EXTENDING @V407594 01100000
  1202. BNE SELDSPX YES -- UNSTACK DMKPTRFE BLOCK @V408246 01101000
  1203. LM R14,R15,=A(DMKSCHN1,DMKSCHN2) GET POINTERS TO @V408246 01102000
  1204. * Q COUNTS 01103000
  1205. L R14,0(,R14) NO. IN Q1 @V408246 01104000
  1206. L R15,0(,R15) NO. IN Q2 @V408246 01105000
  1207. LA R0,1(R14,R15) 1 + (Q1 + Q2) COUNT @V408246 01106000
  1208. ST R0,SAVEWRK1 AND SAVE @V408246 01107000
  1209. LA R8,PTRFDISP RETURN @V408246 01108000
  1210. ST R8,SAVEWRK8 @V408246 01109000
  1211. B USERPAGE FORCE SELECT TO OBTAIN 1 MORE @V408246 01110000
  1212. EJECT 01111000
  1213. *. 01112000
  1214. * 12. IF A FREE PAGE IS AVAIALBLE, UNCHAIN THE CORTABLE ENTRY 01113000
  1215. * FROM THE FREELIST, AND, IF THE PAGTABLE POINTER IN THE 01114000
  1216. * ENTRY IS VALID, ZERO OUT THE OLD OWNER'S PAGTABLE ENTRY 01115000
  1217. * 13. EXIT TO THE CALLER, PASSING BACK THE CORTABLE ENTRY 01116000
  1218. * ADDRESS IN GPR7 01117000
  1219. *. 01118000
  1220. SPACE 01119000
  1221. GETFREE EQU * 01120000
  1222. ST R0,DMKPTRFN SAVE NEW VALUE. @VA01767 01121000
  1223. LR R15,R2 SAVE PARM REGISTER 01122000
  1224. L R7,DMKPTRF1 POINT TO FIRST ENTRY ON LIST 01123000
  1225. LM R1,R2,CORFPNT GET FORWARD AND BACK CHAIN POINTERS 01124000
  1226. ST R1,CORFPNT-CORTABLE(,R2) UNCHAIN THE 01125000
  1227. ST R2,CORBPNT-CORTABLE(,R1) CORTABLE ENTRY 01126000
  1228. L R1,CORPGPNT GET POINTER TO OWNER'S PAGTABLE ENTRY 01127000
  1229. LTR R1,R1 IS IT VALID ?? 01128000
  1230. BZ FREEXIT NO -- OK TO LEAVE NOW 01129000
  1231. TM 1(R1),PAGINVAL TRY TO CATCH CULPRIT 01130000
  1232. BO PTR8A OK 01131000
  1233. ABEND 8 GOTCHA 01132000
  1234. PTR8A EQU * 01133000
  1235. MVI 0(R1),0 SET PAGE TABLE ENTRY -> 0, 01134000
  1236. NI 1(R1),PAGINVAL+PAGREF RETAINING THESE FLAGS 01135000
  1237. SLR R1,R1 CLEAR OUT 01136000
  1238. ST R1,CORPGPNT PTE POINTER 01137000
  1239. FREEXIT MVI CORFLAG,CORCP PAGE NOW BELONGS TO CP @VA05378 01138000
  1240. LR R2,R15 RESTORE PARM REG @VA05378 01139000
  1241. ST R1,CORBPNT ... @V408246 01140000
  1242. STCM R1,B'0111',CORSWPNT+1 AND SWAP POINTER @V408246 01141000
  1243. BR R3 AND RETURN TO CALLER 01142000
  1244. EJECT 01143000
  1245. *. 01144000
  1246. * F. OPERATION OF THE PAGE SELECTION ROUTINE - 01145000
  1247. * 1. IF THERE IS AN ENTRY ON THE FLUSHED PAGE LIST, UNCHAIN IT 01146000
  1248. * AND GO TO STEP F.8; OTHERWISE, CONTINUE 01147000
  1249. * 2. SEARCH ALL OF AVAILABLE PAGEABLE STORAGE ( IF V=R 01148100
  1250. * AREA IS UNLOCKED THEN IT WILL BECOME PAGEABLE 01148600
  1251. * STORAGE ) FOR A PAGE WITH THE HARDWARE 'REFERENCED' 01149100
  1252. * BITS = 0 01149600
  1253. * 3. IF ONE OR BOTH OF THE 'REFERENCED' BITS ARE SET TO ONE, 01150000
  1254. * RESET THEM AND CONTINUE SEARCHING PAGEABLE STORAGE 01151000
  1255. * 4. IF STORAGE IS EXHAUSTED BEFORE AN UNREFERENCED PAGE IS 01152000
  1256. * FOUND, RESTART AT THE TOP OF STORAGE. 01153000
  1257. * 5. AFTER AN UNREFERENCED PAGE IS FOUND, SAVE A POINTER TO 01154000
  1258. * THE CORTABLE ENTRY FOR THE NEXT REAL PAGE FOR THE SELECT 01155000
  1259. * PROCESS TO RESUME AT NEXT TIME. 01156000
  1260. * 6. TEST TO SEE IF THE SELECTED PAGE BELONGS TO AN IN-QUEUE 01157000
  1261. * VIRTUAL MACHINE; IF SO INCREMENT BOTH THE SYSTEM'S AND THE 01158000
  1262. * VIRTUAL MACHINE'S PAGE STEAL COUNT. 01159000
  1263. * 7. TEST TO SEE IF THE SELECTED PAGE HAS BEEN CHANGED; IF IT 01160000
  1264. * HAS NOT BEEN CHANGED, CALL DMKPTRFT (G, BELOW) TO PLACE IT 01161000
  1265. * ON THE FREE LIST AND EXIT; OTHERWISE, CONTINUE 01162000
  1266. * 8. IF THE RECOMPUTE FLAG IS SET IN THE SWPTABLE ENTRY, CALL 01163000
  1267. * DMKPGTPG TO OBTAIN THE ADDRESS OF A DASD PAGE SLOT IN 01164000
  1268. * WHICH TO WRITE THE PAGE; OTHERWISE, CONTINUE 01165000
  1269. * 9. BUMP THE PENDING SWAP COUNT, AND CALL DMKPAGIO TO SCHEDULE 01166000
  1270. * THE PAGE WRITE; THEN EXIT TO THE CALLER 01167000
  1271. * 10. WHEN THE PAGE HAS BEEN WRITTEN, DECREMENT THE PENDING SWAP 01168000
  1272. * COUNT AND CALL DMKPTRFT (G, BELOW) TO PLACE IT ON THE FREE 01169000
  1273. * LIST 01170000
  1274. SPACE 01171000
  1275. SELECT DS 0H @V408246 01172000
  1276. LM R14,R15,=A(DMKSCHN1,DMKSCHN2) GET POINTERS TO Q 01173000
  1277. L R14,0(,R14) COUNTS 01174000
  1278. L R15,0(,R15) ... 01175000
  1279. SELECTA DS 0H @V408246 01176000
  1280. STM R2,R9,SAVEWRK2 SAVE REGS @V408246 01177000
  1281. LA R0,1(R14,R15) GET NUMBER IN Q1 + Q2 + 1 01178000
  1282. ST R0,SAVEWRK1 AND SAVE FOR LATER. @V408246 01179000
  1283. SELECT1 EQU * MAIN PAGE REPLENISHMENT LOGIC 01180000
  1284. L R15,PREFIXA ACCESS ABSOLUTE PSA @V407594 01181000
  1285. CLI XTNDLOCK-PSA(R15),0 SYSTEM EXTENDING @V407594 01182000
  1286. BNE SELEXIT YES -- DO NOT SWAP OUT 01183000
  1287. LM R0,R1,DMKPTRFN GET NUMBER OF NOW AND FUTURE FREE PAGES 01184000
  1288. AR R0,R1 GET SUM 01185000
  1289. C R0,SAVEWRK1 COMPARE TO MINUMUM @V408246 01186000
  1290. BNL SELEXIT 'NUF ALREADY 01187000
  1291. EJECT 01188000
  1292. USERPAGE DS 0H CHECK DEFERED WRITE LIST FIRST @V408246 01189000
  1293. L R7,DMKPTRU1 PICK UP FORWARD PTR @V408246 01190000
  1294. LA R6,DMKPTRU1 ADDRESS OF ANCHOR LIST @V408246 01191000
  1295. CLR R6,R7 ANY ENTRIES? @V408246 01192000
  1296. BE SELPAG NO, SCAN CORETBL @V408246 01193000
  1297. USERPGA DS 0H @V408246 01194000
  1298. ICM R9,B'0111',CORPGPNT+1 GET PTE POINTER @V408246 01195000
  1299. BNZ PTR14A @V408246 01196000
  1300. ABEND 15 @V408246 01197000
  1301. PTR14A DS 0H @V408246 01198000
  1302. LM R1,R2,CORFPNT PICK UP F AND B PTRS @V408246 01199000
  1303. ST R1,CORFPNT-CORTABLE(,R2) UNCHAIN THE @V408246 01200000
  1304. ST R2,CORBPNT-CORTABLE(,R1) CORETABLE ENTRY @V408246 01201000
  1305. L R0,DMKPTRFF INCREMENT @V408246 01202000
  1306. ALR R0,R4 COUNT OF PAGES MOVED FROM FLUSH @V408246 01203000
  1307. ST R0,DMKPTRFF @V408246 01204000
  1308. * CORFLUSH BIT IS ON FOR USER LIST PAGES 01205000
  1309. L R5,CORSWPNT SWAP TABLE POINTER @V408246 01206000
  1310. LA R15,0(,R5) GET SWP TBL PTR FOR VMBLOK @V408246 01207000
  1311. SR R2,R2 CLEAR @V408246 01208000
  1312. IC R2,SWPVPAGE GET VIRTUAL PAGE NUMBER @V408246 01209000
  1313. AR R2,R4 GET VMBLOK PTR @V408246 01210000
  1314. SLL R2,3 DISPL. BACK TO VMBLOK PTR @V408246 01211000
  1315. SR R15,R2 ADDR. OF VMBLOK PTR @V408246 01212000
  1316. L R15,0(,R15) GET VMBLOK PTR @V408246 01213000
  1317. ST R15,CORFPNT SAVE FOR LOADING VMBLOK @V408246 01214000
  1318. SR R14,R14 CLEAR . . @V408246 01215000
  1319. ST R14,CORBPNT . . BACK CHAIN POINTER @V408246 01216000
  1320. LR R6,R7 CORE TABLE ENTRY @V408246 01217000
  1321. S R6,ACORETBL REAL PAGE NO. * 16 @V408246 01218000
  1322. SLL R6,8 REAL PAGE ADDRESS @V408246 01219000
  1323. SR R0,R0 @V407594 01220000
  1324. ST R0,TEMPR0 CLEAR FLAG BYTES @V407594 01221000
  1325. L R0,DMKPTRUC FLUSHED PAGE COUNT @VA07810 01221050
  1326. SR R0,R4 LESS ONE @VA07810 01221055
  1327. BM AB20 CANNOT BE NEGATIVE @VA07810 01221060
  1328. ST R0,DMKPTRUC STORE NEW COUNT @VA07810 01221065
  1329. TM CORFLAG,CORSHARE SHARED PAGE @VA07717 01221100
  1330. BO CKBKUP YES @VA07717 01221150
  1331. LH R0,VMFLPAG-VMBLOK(R15) FLUSHED PAGE COUNT @VA07717 01221200
  1332. SR R0,R4 MINUS ONE @VA07717 01221250
  1333. BM AB19 ABEND IF NEGATIVE @VA07717 01221300
  1334. STH R0,VMFLPAG-VMBLOK(R15) @VA07717 01221350
  1335. B CKBKUP CHECK CP BACK-UP CHANGE BIT @V408246 01222000
  1336. EJECT 01223000
  1337. * 01224000
  1338. * SELECT NON-REFERNCED PAGE FROM AMOUNT PAGES BELONGING TO 01225000
  1339. * IN-QUEUE TASKS 01226000
  1340. * 01227000
  1341. SELPAG DS 0H SELECT NON-REFERENCED PAGE @V408246 01228000
  1342. AIF (NOT &AP).NOAP21 **AIF*** 01228900
  1343. SR R2,R2 @V407594 01229000
  1344. ST R2,TEMPR0 CLEAR FLAGS @V407594 01230000
  1345. .NOAP21 ANOP **ANOP** 01230100
  1346. MVI TESTFLG+1,255-CORSHARE SET-UP FOR INITIAL PASS @V408246 01231000
  1347. TM VMPSTAT,VMRPAGE RESERVED PAGE VMBLOK? @V408246 01232000
  1348. BZ SELPAGA NO @V408246 01233000
  1349. CLC DMKPTRRC,DMKPTRRL RESERVED PAGES AT LIMIT? @V408246 01234000
  1350. BL SELPAGA NO @V407594 01235000
  1351. XI TESTFLG+1,CORRSV YES, SEARCH FOR ANY @V408246 01236000
  1352. B TSTQSCE QUIESCE OPP PROC'R IF REQUIRED @V407594 01237000
  1353. SELPAGA DS 0H @V408246 01238000
  1354. NI SCANFLAG,255-PASSTWO INITIALIZE FLAG TO 1ST PASS@VA08341 01238100
  1355. MVC SCANSTRT(2),SCANBLOK STARTING SCAN AT THIS @VA08341 01238150
  1356. * BLOCK OF FRAMES 01238200
  1357. LA R1,CURPNT LOAD ADDR OF INDEX TO CORETABLE @VA08341 01238250
  1358. LM R6,R9,CURPNT LOAD ALL NEEDED REGISTERS @V407594 01239000
  1359. L R2,F4096 VALUE TO DECREMENT PAGE ADDRESS @V407594 01240000
  1360. CNOP 0,8 ALIGN FOR PERFORMANCE @V408246 01242000
  1361. TESTFLG1 L R15,DMKPTRRF LOAD COUNT OF STEAL REFS @VA07751 01243000
  1362. LA R15,1(R15) BUMP 1 @VA07751 01243500
  1363. ST R15,DMKPTRRF PUT IT BACK @VA07751 01244000
  1364. TESTFLG TM CORFLAG,255-CORSHARE PAGE AVAILABLE ? @VA07751 01244500
  1365. BZ TESTRRB YES @V408246 01245000
  1366. NONZERO SLR R6,R2 GET NEXT REAL PAGE ADDRESS @V407594 01246000
  1367. BXH R7,R8,TESTFLG1 LET BXLE CALC. NEXT ENTRY @VA07751 01247100
  1368. LA R6,TOPPNT LOAD ADDRESS FOR LAST PART OF @VA08341 01251100
  1369. * COMPLETE SCAN 01251150
  1370. CR R6,R1 DID WE JUST SCAN THIS TOP PART? @VA08341 01251200
  1371. BNE NEXTBLOK NO--WE ARE NOT DONE YET @VA08341 01251250
  1372. LA R1,20(R1) ADDRESS OF 'FENCE' @VA08341 01251300
  1373. B PASSONE GO LOAD NEXT SET OF POINTERS @VA08341 01251350
  1374. NEXTBLOK LH R6,SCANBLOK BLOCK OF FRAMES WE ARE SCANNING @VA08341 01251400
  1375. BCTR R6,0 MOVE ON TO NEXT LOWER BLOCK @VA08341 01251450
  1376. C R6,F1 ARE WE NOW POINTING TO BLOCK 1? @VA08341 01251500
  1377. BH TSTSTART NO--TEST TO SEE IF WE ARE BACK @VA08341 01251550
  1378. * WHERE WE BEGAN THE SCAN 01251600
  1379. BL SETBLKNO AT BLOCK '0'--SET TO HIGH BLOCK @VA08341 01251650
  1380. TM SCANFLAG,VEQRUNLK AT BLOCK 1--HAS V=R AREA BEEN @VA08341 01251700
  1381. * UNLOCKED? 01251750
  1382. BO TSTSTART YES. OK TO SCAN THIS BLOCK. @VA08341 01251800
  1383. SETBLKNO LA R6,1 VALUE TO INCREMENT @VA08341 01251850
  1384. AL R6,DMKPTRCS COUNT OF CORE TABLE WRAPS @VA08341 01251900
  1385. ST R6,DMKPTRCS UPDATE COUNTER @VA08341 01251950
  1386. LH R6,SCANNUM UPDATE BLOCK POINTER TO TOP BLOCK@VA08341 01252000
  1387. TSTSTART STH R6,SCANBLOK UPDATE CURRENT BLOCK POINTER @VA08341 01252050
  1388. CH R6,SCANNUM ARE WE SCANNING TOP BLOCK? @VA08341 01252100
  1389. BNE CALCSTRT IF NOT, CALCULATE FULLSCAN PTR. @VA08341 01252150
  1390. LA R1,FULLSCAN START AT FULLSCAN OF TOP BLOCK @VA08341 01252200
  1391. B TST2 TEST FOR END OF FIRST PASS @VA08341 01252250
  1392. CALCSTRT LH R15,SCANNUM NUMBER OF FRAME BLOCKS TO SCAN @VA08341 01252300
  1393. SR R15,R6 SUBTRACT CURRENT BLOCK NUMBER @VA08341 01252350
  1394. SR R14,R14 GET READY FOR MULTIPLY @VA08341 01252400
  1395. M R14,F20 20 BYTES FOR EACH FULLSCAN ENTRY @VA08341 01252450
  1396. LA R1,FULLSCAN(R15) POINT TO CURRENT FULLSCAN ENTRY@VA08341 01252500
  1397. TST2 CH R6,SCANSTRT IS THIS THE BLOCK WE STARTED THE @VA08341 01252550
  1398. * SCAN ON? 01252600
  1399. BNE PASSONE NO--STILL ON THE FIRST PASS @VA08341 01252650
  1400. TM SCANFLAG,PASSTWO HAVE WE COMPLETED TWO PASSES? @VA08341 01252700
  1401. BO DOTOP YES--DO TOP SCAN @VA08341 01252750
  1402. OI SCANFLAG,PASSTWO INDICATE NOW ON 2ND FULL PASS @VA08341 01252800
  1403. PASSONE LM R6,R9,0(R1) LOAD NEXT SET OF POINTERS @VA08341 01252850
  1404. LTR R6,R6 TEST IF TABLES HAVE BEEN EXCEEDED@V408246 01253000
  1405. BP TESTFLG1 LOOK AGAIN THRU THE LIST @VA07751 01254100
  1406. XI TESTFLG+1,CORRSV ALLOW SELECTION OF RESERVED @V408246 01255000
  1407. TM TESTFLG+1,CORRSV BEEN AROUND ONCE ALREADY? @V408246 01256000
  1408. BO PTR7A YES, ABEND @V407594 01257000
  1409. TSTQSCE TM APSTAT1,APUOPER RUNNING IN AP MODE @V407594 01258000
  1410. AIF (NOT &AP).NOAP9 **AIF*** 01258100
  1411. BZ SELPAGA NO @V407594 01259000
  1412. L R15,PREFIXA LOAD PREFIX VALUE @V407594 01260000
  1413. CLI XTNDLOCK-PSA(R15),0 SYSTEM EXTENDING @V407594 01261000
  1414. BNE SELPAGA YES, BYPASS QUIESCE @V407594 01262000
  1415. SIGNAL QUIESCE,CONTROL=SERIAL QUIESCE OTHER PROC'R @V407594 01263000
  1416. MVI TEMPR0+1,OPPRSTRT MUST RESTART OTHER PROC'R @V407594 01264000
  1417. .NOAP9 ANOP **ANOP** 01264100
  1418. B SELPAGA MAY NOW SELECT ANY AVAILABLE PG @V407594 01265000
  1419. SPACE 01265100
  1420. DOTOP LA R1,TOPPNT LOAD ADDRESS FOR LAST PART OF @VA08341 01265150
  1421. * COMPLETE SCAN 01265200
  1422. B PASSONE GO LOAD NEXT SET OF POINTERS @VA08341 01265250
  1423. SPACE 01265300
  1424. ABEND 7 SO- VERY-SORRY (NO PAGES) @V408246 01266000
  1425. CNOP 0,8 ALIGN FOR PERF. @V408246 01267000
  1426. TESTRRB DS 0H @V408246 01268000
  1427. ICM R5,B'0111',CORSWPNT+1 SWAP TABLE ENTRY POINTER @V408246 01269000
  1428. BZ FRETIT NONE, PAGE IMMEDIATELY AVAILABLE @V408246 01270000
  1429. TM SWPFLAG,SWPTRANS+SWPALLOC IS A REQUEST AVAIL. @V408246 01271000
  1430. BNZ NONZERO IF SO WE CAN'T USE IT. @V408246 01272000
  1431. AIF (NOT &AP).NOAP10 **AIF*** 01272900
  1432. MVI TEMPR0,0 CLEAR FLAG BYTE @V407594 01273000
  1433. TM APSTAT1,APUOPER RUNNING AS AP @V407594 01274000
  1434. BZ DORRB NO @V407594 01275000
  1435. TM TESTFLG+1,CORRSV PHASE ONE @V407594 01276000
  1436. BZ DORRB NO, ISSUE RRB @V4M0172 01277000
  1437. TM CORFLAG,CORSHARE SHARED PAGE @V407594 01278000
  1438. BO DOSHRRRB YES, DO RRB @V407594 01279000
  1439. L R15,CORVM LOAD VMBLOK ADDR @V407594 01280000
  1440. CL R15,ASYSVM SYSTEM PAGE @V407594 01281000
  1441. BE DORRB YES, DO RRB @V407594 01282000
  1442. LH R14,LPUADDR LOAD LOGICAL PROC'R ADDR @V407594 01283000
  1443. CLM R14,B'0011',VMLOCK+2-VMBLOK(R15) VM ALREADY @V407594 01284000
  1444. * LOCKED BY THIS PROCESSOR @V407594 01285000
  1445. BE DORRB YES,DO RRB @V407594 01286000
  1446. LR R14,R1 SAVE R1 ACROSS LOCK MACRO @V407594 01287000
  1447. LR R1,R15 VMBLOK ADDR @V407594 01288000
  1448. LOCK OBTAIN,TYPE=VMBLOK,OPTION=NOUPDT,SPIN=NO,SAVE @V407594 01289000
  1449. LR R1,R14 RESTORE R1 @V407594 01290000
  1450. BC 4,NOLOCK LOCK FAILED @V407594 01291000
  1451. MVI TEMPR0,UNLKVM MUST UNLOCK VMBLOK @V407594 01292000
  1452. MVI TEMPR0+1,0 CLEAR FLAGS @V407594 01293000
  1453. B DORRB RESET REFERENCE BITS @V407594 01294000
  1454. DOSHRRRB MVI TEMPR0,RRBSHR PROCESSING SHARED PAGE @V407594 01295000
  1455. B DORRB RESET REFERENCE BITS @V407594 01296000
  1456. NOLOCK L R15,CORVM GET VMBLOK ADDR @V407594 01297000
  1457. TM VMOSTAT-VMBLOK(R15),VMSHR RUNNING SHARED SYSTEM @V407594 01298000
  1458. BZ NONZERO NO, BYPASS PAGE FRAME @V407594 01299000
  1459. MVI TEMPR0,NOSTEAL REMEMBER CANNOT STEAL PAGE @V407594 01300000
  1460. .NOAP10 ANOP **ANOP** 01300100
  1461. DORRB DS 0H @V407594 01301000
  1462. RRB 0(R6) TEST 1'ST HALF OF PAGE. @V408246 01302000
  1463. BC 8+4,TSTRRB2 RESET 2ND KEY @V408246 01303000
  1464. OI SWPKEY1,4 REF. BIT TO VIRT. BACK-UP KEY @V408246 01304000
  1465. RRB 2048(R6) CLEAR 2ND KEY @V408246 01305000
  1466. BC 8+4,STKEY2+4 NO SET, PAGE NOT SELECTED @V408246 01306000
  1467. STKEY2 DS 0H @V408246 01307000
  1468. OI SWPKEY2,4 REF. BIT TO VIRT. BACK-UP KEY @V408246 01308000
  1469. NI SWPFLAG,255-SWPREF1-SWPREF2 RESET CP REF. BITS @V408246 01309000
  1470. AIF (NOT &AP).NOAP11 **AIF*** 01309900
  1471. TM TEMPR0,UNLKVM DID WE LOCK VMBLOK @V407594 01310000
  1472. BZ NONZERO NO, ACCESS NEXT PAGE @V407594 01311000
  1473. LR R14,R1 SAVE R1 ACROSS LOCK MACRO @V407594 01312000
  1474. L R1,CORVM GET VMBLOK ADDRESS @V407594 01313000
  1475. LOCK RELEASE,TYPE=VMBLOK,SAVE UNLOCK VMBLOK @V407594 01314000
  1476. LR R1,R14 RESTORE R1 @V407594 01315000
  1477. .NOAP11 ANOP **ANOP** 01315100
  1478. B NONZERO PAGE NOT SELECTED @V408246 01316000
  1479. TSTRRB2 DS 0D 1ST KEY 0, CHECK 2ND KEY @V408246 01317000
  1480. BALR R14,0 SAVE C.C. FOR CHANGE TEST @V408246 01318000
  1481. RRB 2048(R6) CLEAR 2ND KEY @V408246 01319000
  1482. BC 2+1,STKEY2 REF. BIT ON, PAGE NOT AVAILABLE @V408246 01320000
  1483. BALR R15,R0 CHANGE C.C. @V408246 01321000
  1484. TM SWPFLAG,SWPREF1+SWPREF2 CHECK BACK-UP BITS @V408246 01322000
  1485. BNZ STKEY2+4 PAGE REF'ED DON'T SELECT @V408246 01323000
  1486. OR R14,R15 SAVE FOR CHANGED PAGE TEST @VA09279 01323100
  1487. AIF (NOT &AP).NOAP12 **AIF*** 01323900
  1488. TM TEMPR0,NOSTEAL CAN WE SELECT PAGE @V407594 01324000
  1489. BO NONZERO NO, ACCESS NEXT PAGE FRAME @V407594 01325000
  1490. TM TEMPR0,RRBSHR SHARED PG, AP MODE, PHASE 1 @V407594 01326000
  1491. BZ STEALSHR NO, STEAL PAGE @V407594 01327000
  1492. SLR R0,R0 DETERMINE PROC'R OWNERSHIP OF PG @V407594 01328000
  1493. IC R0,SWPVPAGE LOAD VIRTUAL PAGE NUMBER @V407594 01329000
  1494. ALR R0,R4 PLUS 1 FOR HEADER @V407594 01330000
  1495. SLL R0,3 TIMES 8 FOR ENTRY LENGTH @V407594 01331000
  1496. LR R3,R5 PT TO SWAP TBL ENTRY @V407594 01332000
  1497. SLR R3,R0 PT TO SWAP TBL HDR @V407594 01333000
  1498. LR R15,R3 SWAP TABLE HEADER @VA09279 01333100
  1499. S R15,=A(PAGTSWP) BACK UP TO PAGE TABLE HEADER @VA09279 01333150
  1500. L R15,PAGSHR-PAGTABLE(R15) ADDRESS OF SHARETABLE @VA09279 01333200
  1501. TM SHRFLAG-SHRTABLE(R15),SHRNOPRT IS SHARED PAGE @VA09279 01333250
  1502. * UNPROTECTED? 01333300
  1503. BO STEALSHR YES--OK TO STEAL IT @VA09279 01333350
  1504. * IF PROTECTED SHARED PAGE, DETERMINE IF FRAME IS 01333400
  1505. * OWNED BY THIS PROCESSOR 01333450
  1506. TM SWPFLAG2-SWPTABLE(R3),SWPAPP 2ND SET OF TABLES? @V60B7AA 01334100
  1507. BO SHPGAP YES @V407594 01335000
  1508. TM APSTAT1,PROCIPL IS THIS THE MAIN (IPL) PROC? @V60B7AA 01336100
  1509. BO STEALSHR YES, STEAL PAGE @V407594 01337000
  1510. B NONZERO ON AP, PG OWNED BY MAIN PROC'R @V407594 01338000
  1511. SHPGAP TM APSTAT1,PROCIPL IS THIS NON-IPL PROCESSOR? @V60B7AA 01339100
  1512. BO NONZERO NO- ON MAIN PROC'R, AP PAGE @V407594 01340000
  1513. STEALSHR DS 0H @V407594 01341000
  1514. .NOAP12 ANOP **ANOP** 01341100
  1515. TM CORFLAG,CORSHARE SHARED PAGE? @VA09279 01342150
  1516. BZ STEALSH1 NO, STEAL IT @VA09279 01342175
  1517. SPM R14 CHECK FOR CHANGED SHARED PAGE @VA09279 01342200
  1518. BC 8+2,STEALSH1 IF UNCHANGED, STEAL IT @VA09279 01342225
  1519. * CHECK TO SEE IF CHANGED SHARED PAGE IS UNPROTECTED 01342250
  1520. SLR R0,R0 ZERO REG FOR INSERT @VA09279 01342275
  1521. IC R0,SWPVPAGE VIRTUAL PAGE NUMBER @VA09279 01342300
  1522. ALR R0,R4 ADD ONE FOR SWAP TABLE HEADER @VA09279 01342325
  1523. SLL R0,3 MULTIPLY BY 8 FOR ENTRY LENGTH @VA09279 01342350
  1524. LR R15,R5 SWAP TABLE ENTRY ADDRESS @VA09279 01342375
  1525. SLR R15,R0 POINT TO SWAP TABLE HEADER @VA09279 01342400
  1526. S R15,=A(PAGTSWP) ADDRESS OF PAGE TABLE HEADER @VA09279 01342425
  1527. L R15,PAGSHR-PAGTABLE(R15) SHARETABLE ADDRESS @VA09279 01342450
  1528. TM SHRFLAG-SHRTABLE(R15),SHRNOPRT IS SHARED PAGE @VA09279 01342475
  1529. * UNPROTECTED? 01342500
  1530. BZ NONZERO DON'T STEAL PROTECTED SHARED PAGE@VA09279 01342525
  1531. * IF UNPROTECTED, STEAL EVEN IF @VA09279 01342550
  1532. * CHANGED 01342575
  1533. STEALSH1 DS 0H @VA09279 01342600
  1534. LR R0,R6 SAVE REAL STORAGE ADDRESS @V408246 01343000
  1535. LR R1,R7 SAVE CURRENT CORETABLE ENTRY @V408246 01344000
  1536. SLR R0,R2 DECREMENT REAL ADDR BY ONE PAGE @V407594 01345000
  1537. AR R1,R8 DECREMENT CURRENT CORETABLE @V408246 01346000
  1538. STM R0,R1,CURPNT SAVE THE 'NEW' CURRENT POINTER @V408246 01347000
  1539. ST R1,TOPPNT+12 ALSO SAVE IT HERE. @V408246 01348000
  1540. CLC SCANBLOK(2),SCANSTRT IS FRAME IN THE CURRENT @VA08341 01348100
  1541. * BLOCK? 01348150
  1542. BE EXTSRCH YES--OTHER POINTERS ARE OK @VA08341 01348200
  1543. LH R0,SCANBLOK POINTER TO CURRENT BLOK OF FRAMES@VA08341 01348250
  1544. LH R1,SCANNUM NO. OF BLOCKS AVAILABLE TO SCAN @VA08341 01348300
  1545. SR R1,R0 START TO CALCULATE CURRENT @VA08341 01348350
  1546. * BLOCK'S FULLSCAN ENTRY 01348400
  1547. SR R0,R0 GET READY FOR MULTIPLY @VA08341 01348450
  1548. M R0,F20 20 BYTES PER FULLSCAN ENTRY @VA08341 01348500
  1549. LA R1,FULLSCAN(R1) CURRENT BLOCK'S FULLSCAN ENTRY @VA08341 01348550
  1550. MVC CURPNT+12(4),12(R1) UPDATE CURPNT ADDRESSES @VA08341 01348600
  1551. MVC TOPPNT(8),0(R1) UPDATE TOPPNT ADDRESSES @VA08341 01348650
  1552. EXTSRCH DS 0H @V408246 01349000
  1553. DROP R11 @V408246 01350000
  1554. AIF (NOT &AP).NOAP12A **AIF*** 01350025
  1555. TM APSTAT1,APUOPER IN AP MODE? @VA09279 01350040
  1556. BZ STEALSH2 NO, BYPASS UNPROTECTED CHECK @VA09279 01350055
  1557. TM CORFLAG,CORSHARE SHARED PAGE? @VA09279 01350070
  1558. BZ STEALSH2 NO -- NO NEED FOR QUIESCE @VA09279 01350085
  1559. SLR R0,R0 @VA09279 01350100
  1560. IC R0,SWPVPAGE GET PAGE NUMBER @VA09279 01350115
  1561. SLL R0,1 MULTIPLY BY 2 FOR PTE SIZE @VA09279 01350130
  1562. L R1,CORPGPNT PAGE TABLE ENTRY ADDRESS @VA09279 01350145
  1563. SLR R1,R0 BACK UP TO START OF PAGE TABLE @VA09279 01350160
  1564. SL R1,F16 BACK UP TO PAGE TABLE HEADER @VA09279 01350175
  1565. L R1,PAGSHR-PAGTABLE(,R1) GET SHRTABLE ADDRESS @VA09279 01350190
  1566. TM SHRFLAG-SHRTABLE(R1),SHRNOPRT UNPROTECTED? @VA09279 01350205
  1567. BZ STEALSH2 NO -- NO QUIESCE NECESSARY @VA09279 01350220
  1568. L R1,PREFIXA ACCESS ABSOLUTE PSA @VA09279 01350235
  1569. CLI XTNDLOCK-PSA(R1),0 SYSTEM EXTENDING? @VA09279 01350250
  1570. BNE STEALSH2 YES--BYPASS QUIESCE @VA09279 01350265
  1571. TM TEMPR0+1,OPPRSTRT HAS OTHER PROCESSOR ALREADY @VA09279 01350280
  1572. * BEEN QUIESCED? 01350295
  1573. BO SETPTLB YES -- CONTINUE @VA09279 01350310
  1574. LR R9,R14 SAVE R14 CONTENTS @VA09279 01350325
  1575. SIGNAL QUIESCE,CONTROL=SERIAL @VA09279 01350340
  1576. LR R14,R9 SAVE FOR CHANGED PAGE TEST @VA09279 01350355
  1577. MVI TEMPR0+1,OPPRSTRT REMEMBER TO RESUME OTHER PROC.@VA09279 01350370
  1578. SETPTLB TM TESTFLG+1,CORRSV PHASE ONE? @VA09279 01350385
  1579. BO OTHRPTLB IF PHASE ONE, TELL OTHER PROC @VA09279 01350400
  1580. * TO DO PTLB. THIS PROC. WILL BE 01350415
  1581. * MARKED FOR PTLB AT OWNSHR. 01350430
  1582. * HERE IF NOT PHASE 1 01350445
  1583. TM APSTAT1,PROCIPL IS THIS THE MAIN (IPL) PROC? @V60B7AA 01350465
  1584. BO OTHRPTLB YES -- TELL OTHER PROC TO PTLB @VA09279 01350475
  1585. OI APSTAT2,CPPTLBR THIS PROC MUST PURGE TLB @VA09279 01350490
  1586. B STEALSH2 CONTINUE WITH STEAL @VA09279 01350505
  1587. OTHRPTLB L R1,PREFIXB ADDRESS OF OTHER PSA @VA09279 01350520
  1588. OI APSTAT2-PSA(R1),CPPTLBR TELL OTHER PROC TO PTLB @V60B7AA 01350540
  1589. STEALSH2 DS 0H @VA09279 01350550
  1590. .NOAP12A ANOP **ANOP** 01350565
  1591. L R15,CORFPNT PAGES OWNER @V408246 01351000
  1592. USING VMBLOK,R15 @V408246 01352000
  1593. L R9,CORPGPNT PICK-UP PTE POINTER @V408246 01353000
  1594. TM VMDSTAT,VMINQ VMBLOK IN-QUEUE? @V408246 01354000
  1595. BZ PNTSTL NO @V408246 01355000
  1596. L R0,DMKPTRSS YES, INCREMENT @V408246 01356000
  1597. ALR R0,R4 TOTAL SYSTEM STEAL COUNT @V408246 01357000
  1598. ST R0,DMKPTRSS @V408246 01358000
  1599. LH R0,VMSTEALS INCREMENT ALSO @V408246 01359000
  1600. ALR R0,R4 INDIVIDUAL STEAL COUNT @V408246 01360000
  1601. STH R0,VMSTEALS @V408246 01361000
  1602. OI PAGCORE+1,PAGREF NON-RESIDENT PAGE WAS TOUCHED @V408246 01362000
  1603. PNTSTL DS 0H @V408246 01363000
  1604. TM CORFLAG,CORSHARE SHARED PAGE FRAME? @V408246 01364000
  1605. BZ CKPG0 NO, SAVE TIMER IN CASE PAGE 0 @V408246 01365000
  1606. L R2,DMKPTRSC DECREMENT @V408246 01366000
  1607. SR R2,R4 RESIDENT SHARED PAGE COUNT @V408246 01367000
  1608. ST R2,DMKPTRSC @V408246 01368000
  1609. AIF (NOT &AP).NOAP13 **AIF*** 01368900
  1610. TM APSTAT1,APUOPER RUNNING AS AP @V407594 01369000
  1611. BZ OWNSHR NO, INVALIDATE LOOKASIDE BUFFER @V407594 01370000
  1612. TM TESTFLG+1,CORRSV PHASE ONE @V407594 01371000
  1613. BO OWNSHR YES, WE MUST OWN PAGE @V4M0172 01372000
  1614. * EITHER PHASE 2 OR DMKPTRFE SELECTED FLUSH LIST PAGE @V407594 01373000
  1615. * DETERMINE WHICH PROCESSOR OWNS SHARED PAGE AND @V407594 01374000
  1616. * INVALIDATE PROPER LOOKASIDE BUFFER @V407594 01375000
  1617. SR R0,R0 @V407594 01376000
  1618. IC R0,SWPVPAGE VIRTUAL PAGE NUMBER @V407594 01377000
  1619. AR R0,R4 PLUS ONE @V407594 01378000
  1620. SLL R0,3 TIMES 8 @V407594 01379000
  1621. LR R2,R5 SWAP TBL ENTRY @V407594 01380000
  1622. SR R2,R0 PT TO SWPTBL HEADER @V407594 01381000
  1623. TM SWPFLAG2-SWPTABLE(R2),SWPAPP 2ND SET OF TABLES? @V60B7AA 01382100
  1624. BO PURAP YES @V407594 01383000
  1625. TM APSTAT1,PROCIPL IS THIS THE MAIN (IPL) PROC? @V60B7AA 01384100
  1626. BO OWNSHR ON CPU- CPU PAGE @V407594 01385000
  1627. OTHSHR L R2,PREFIXB PURGE OTHER LOOKASIDE BUFFER @V407594 01386000
  1628. OI APSTAT2-PSA(R2),CPPTLBR SET PTLB REQUIRED @V407594 01387000
  1629. L R2,RUNUSER-PSA(R2) ACCESS RUNUSER FOR OTHER @VA08621 01387100
  1630. * PROCESSOR 01387200
  1631. NI VMDSTAT-VMBLOK(R2),X'FF'-VMDSP NO FAST DISPATCH @VA08621 01387300
  1632. * NOW THE OTHER PROCESSOR SHOULD BE QUIESCED AT THIS TIME 01387400
  1633. B CKRSV CHECK FOR RESERVED PG @V407594 01388000
  1634. PURAP DS 0H PAGE OWNED BY AP @V407594 01389000
  1635. TM APSTAT1,PROCIPL MAIN (IPL) PROCESSOR? @V60B7AA 01390100
  1636. BO OTHSHR ON CPU- AP PAGE @V407594 01391000
  1637. .NOAP13 ANOP **ANOP** 01391100
  1638. OWNSHR OI APSTAT2,CPPTLBR SET PTLB REQUIRED @V407594 01392000
  1639. CLC RUNUSER,ASYSVM IS RUNUSER SYSTEM @VA08621 01392100
  1640. BE CKRSV YES, BRANCH @VA08621 01392150
  1641. TM APSTAT1,APUOPER RUNNING AS AP @VA08621 01392200
  1642. BZ RESETDSP NO @VA08621 01392250
  1643. CLC RUNUSER,LASTUSER RUNUSER STILL LOCKED @VA08621 01392300
  1644. BE RESETDSP YES, OK TO RESET VMDSP @VA08621 01392350
  1645. NI APSTAT2,X'FF'-CPPTLBR RESET PTLB REQUIRED @VA08621 01392400
  1646. PTLB DO IT NOW @VA08621 01392450
  1647. B CKRSV @VA08621 01392500
  1648. RESETDSP DS 0H @VA08621 01392550
  1649. L R2,RUNUSER NO FAST REDISPATCH FOR HIM @VA08621 01392600
  1650. NI VMDSTAT-VMBLOK(R2),X'FF'-VMDSP @VA08621 01392650
  1651. B CKRSV CHECK FOR RESERVED PAGE @V408246 01393000
  1652. CKPG0 DS 0H @V408246 01394000
  1653. CL R15,ASYSVM IS THIS SYSTEM PAGE (NON-SHARED) @V407594 01395000
  1654. BE CKRSV YES, BYPASS PTLB & PG ZERO LOGIC @V407594 01396000
  1655. OI VMESTAT,VMINVPAG INVALIDATE SHADOW TABLES @V408246 01397000
  1656. OI APSTAT2,CPPTLBR SET PTLB REQUIRED FOR THIS PROC@RV407594 01398000
  1657. AIF (NOT &AP).NOAP14 **AIF*** 01398900
  1658. L R2,PREFIXB AND OTHER PROCESSOR @V407594 01399000
  1659. OI APSTAT2-PSA(R2),CPPTLBR REDUNDANT IF UP MODE @V407594 01400000
  1660. .NOAP14 ANOP **ANOP** 01400100
  1661. NI VMDSTAT,255-VMDSP NO FAST REDSP @V408246 01401000
  1662. L R3,VMSEG OWNER'S STO @V4M0167 01402000
  1663. CLM R9,B'0111',1(R3) PTE FOR PAGE 0? @V4M0167 01403000
  1664. BNE CKRSV NO, OR SEGMENT INVALID @V4M0167 01404000
  1665. LCTL C1,C1,VMSEG SET OWNER'S STO IN CONTROL REG. @V408246 01405000
  1666. LRA R2,0 REAL ADDRESS OF PAGE ZERO @V408246 01406000
  1667. BNZ CKRSV PAGE NOT RESIDENT @V408246 01407000
  1668. L R2,TIMER-PSA(R2) SAVE THE VIRTUAL TIMER VALUE @V408246 01408000
  1669. ST R2,VMTIMER @V408246 01409000
  1670. TM VMMCR6,VMMVTMR IS TIMER ASSIST ACTIVE? @V408246 01410000
  1671. BZ CKRSV NO @V408246 01411000
  1672. ICM R2,B'0111',VMMADDR VM ASSIST ON FOR USER? @V408246 01412000
  1673. BZ CKRSV NO @V408246 01413000
  1674. LA R0,VMTIMER YES, POINT TIMER ASSIST HERE... @V408246 01414000
  1675. ST R0,MICVTMR-MICBLOK(R2) . . @V408246 01415000
  1676. CKRSV DS 0H @V408246 01416000
  1677. LH R2,VMPAGES DECREMENT @V408246 01417000
  1678. SR R2,R4 RESIDENT PAGE COUNT @V408246 01418000
  1679. BM PTR18 VMPAGES TO GO NEGATIVE - TERM CP @VA07224 01418100
  1680. STH R2,VMPAGES @V408246 01419000
  1681. TM CORFLAG,CORRSV STEALING A RESERVED PAGE? @V408246 01420000
  1682. BZ CKCHGE NO @V408246 01421000
  1683. L R2,=A(DMKDSPNP) GET DYNAMIC PAGE COUNT @V408246 01422000
  1684. L R0,0(,R2) INCREMENT @V408246 01423000
  1685. ALR R0,R4 PAGEABLE PAGES COUNT @V408246 01424000
  1686. ST R0,0(,R2) @V408246 01425000
  1687. L R0,DMKPTRRC DECREMENT @V408246 01426000
  1688. SR R0,R4 RESIDENT RESERVED PAGE COUNT @V408246 01427000
  1689. BNM PTR10A ALRIGHT @V408246 01428000
  1690. ABEND 10 @V408246 01429000
  1691. ABEND 18 VMPAGES TO GO NEGATIVE - TERM CP @VA07224 01429100
  1692. PTR10A DS 0H @V408246 01430000
  1693. ST R0,DMKPTRRC @V408246 01431000
  1694. EJECT 01432000
  1695. CKCHGE DS 0H @V408246 01433000
  1696. OI PAGCORE+1,PAGINVAL FLAG PAGE INVALID @V408246 01434000
  1697. AIF (NOT &AP).NOAP15 **AIF*** 01434900
  1698. TM TEMPR0,UNLKVM DID WE LOCK VMBLOK @V407594 01435000
  1699. BZ CKCHGE2 NO @V407594 01436000
  1700. LR R1,R15 POINT TO VMBLOK OF OWNER OF PAGE @V407594 01437000
  1701. LOCK RELEASE,TYPE=VMBLOK,SAVE UNLOCK VMBLOK @V407594 01438000
  1702. MVI TEMPR0,0 CLEAR FLAG BYTE @V407594 01439000
  1703. CKCHGE2 DS 0H @V407594 01440000
  1704. .NOAP15 ANOP **ANOP** 01440100
  1705. OI CORFLAG,CORFLUSH FLAG PAGE SELECTED @V408246 01441000
  1706. AIF (NOT &AP).NOAP15A **AIF*** 01441050
  1707. TM TEMPR0+1,OPPRSTRT WAS OTHER PROCESSOR QUIESCED? @VA09279 01441100
  1708. BZ CKCHGE3 NO--WE DON'T HAVE TO WORRY ABOUT @VA09279 01441150
  1709. * CHANGE BITS HAVING BEEN CHANGED 01441200
  1710. RRB 0(R6) TEST FIRST HALF OF PAGE--PAGE @VA09279 01441250
  1711. * MAY HAVE BEEN CHANGED BY OTHER 01441300
  1712. * PROCESSOR IF STEALING UNPROTECTED 01441350
  1713. * SHARED PAGE 01441400
  1714. BC 4+1,BCHNGE REAL KEY WAS CHANGED @VA09279 01441450
  1715. RRB 2048(R6) TEST SECOND HALF OF PAGE @VA09279 01441500
  1716. BC 4+1,BCHNGE REAL KEY WAS CHANGED @VA09279 01441550
  1717. B CKBKUP TEST BACK-UP BITS @VA09279 01441600
  1718. CKCHGE3 DS 0H @VA09279 01441650
  1719. .NOAP15A ANOP **ANOP** 01441700
  1720. SPM R14 CHECK FOR CHANGED PAGE C.C. @V408246 01442000
  1721. BC 4+1,BCHNGE REAL KEYS WERE CHANGED @V408246 01443000
  1722. CKBKUP DS 0H @V408246 01444000
  1723. TM SWPFLAG,SWPCHG1+SWPCHG2 TEST BACK-UP CHANGE BIT @V408246 01445000
  1724. BNZ TESTRCMP PAGE HAS BEEN CHANGED -- @V408246 01446000
  1725. SPACE 3 01447000
  1726. FRETIT DS 0H PLACE PAGE ON FREE LIST @V408246 01448000
  1727. AIF (NOT &AP).NOAP16 **AIF*** 01448900
  1728. TM TEMPR0+1,OPPRSTRT RESTART OTHER PROC'R @V407594 01449000
  1729. BZ FRETIT2 NO @V407594 01450000
  1730. SIGNAL RESUME,CONTROL=PARALLEL ISSUE RESUME ORDER @V407594 01451000
  1731. MVI TEMPR0+1,0 CLEAR FLAG @V407594 01452000
  1732. FRETIT2 DS 0H @V407594 01453000
  1733. .NOAP16 ANOP **ANOP** 01453100
  1734. CALL DMKPTRFT FREE LIST ROUTINE @V408246 01454000
  1735. B SELECT1 CHECK FOR WORK COMPLETED @V408246 01455000
  1736. EJECT 01456000
  1737. * 01457000
  1738. * UPDATE COPY OF NEW AND/OR CHANGED PAGE ON BACKING STORE 01458000
  1739. * 01459000
  1740. BCHNGE DS 0H BACK-UP CHANGED BITS @V408246 01460000
  1741. RRB 0(R6) CHECK WHICH KEY WAS CHANGED @V408246 01461000
  1742. BC 8+2,*+8 NOT 1ST 2K @V408246 01462000
  1743. OI SWPKEY1,2 BACK-UP CHANGE BITS @V408246 01463000
  1744. RRB 2048(R6) 2ND 2K @V408246 01464000
  1745. BC 8+2,*+8 NOT CHANGED @V408246 01465000
  1746. OI SWPKEY2,2 BACK-UP CHANGE BIT @V408246 01466000
  1747. DROP R15 @V60BC11 01467000
  1748. USING VMBLOK,R11 NORMAL VMBLOK BASE @V60BC11 01468000
  1749. SPACE 1 01507000
  1750. TESTRCMP DS 0H @V408246 01508000
  1751. LR R2,R15 SAVE VMBLOK OF PAGES OWNER @V407594 01509000
  1752. AIF (NOT &AP).NOAP17 **AIF*** 01509900
  1753. TM TEMPR0+1,OPPRSTRT RESTART OTHER PROC'R @V407594 01510000
  1754. BZ TSTRCMP2 NO @V407594 01511000
  1755. SIGNAL RESUME,CONTROL=PARALLEL ISSUE RESUME ORDER @V407594 01512000
  1756. MVI TEMPR0+1,0 CLEAR FLAG @V407594 01513000
  1757. TSTRCMP2 DS 0H @V407594 01514000
  1758. TM APSTAT1,APUOPER RUNNING AS AP @V407594 01515000
  1759. BZ RCMPCHG NO @V407594 01516000
  1760. CL R13,F2 DMKPTRFE ENTRY @V407594 01517000
  1761. BH RCMPCHG NO, BYPASS UNLOCK OF R11 @V407594 01518000
  1762. CL R11,LASTUSER LAST USER @V407594 01519000
  1763. BE RCMPCHG YES, DO NOT UNLOCK VMBLOK @V407594 01520000
  1764. CL R11,ASYSVM SYSTEM VMBLOK @V407594 01521000
  1765. BE RCMPCHG YES, IT IS NEVER LOCKED @V407594 01522000
  1766. LR R1,R11 VMBLOK ADDR TO R1 @V407594 01523000
  1767. LOCK RELEASE,TYPE=VMBLOK UNLOCK VMBLOK @V407594 01524000
  1768. .NOAP17 ANOP **ANOP** 01524100
  1769. RCMPCHG CHARGE SWITCH,2 CHARGE PAGE WRITE TO OWNER @V407594 01525000
  1770. * 01526000
  1771. * IS NEW BACKING STORE LOCATION REQUIRED? 01527000
  1772. * 01528000
  1773. TM SWPFLAG,SWPRECMP RECOMPUTE BACKING STORE? @V408246 01529000
  1774. BNZ TSTOWNR YES @V408246 01530000
  1775. SR R1,R1 CLEAR VOLUME INDEX @V408246 01533000
  1776. IC R1,SWPCODE AND GET VOLUME INDEX CODE @V408246 01534000
  1777. SLL R1,3 GET VOLUME DISPLACEMENT IN TABLE @V408246 01535000
  1778. AL R1,=A(DMKSYSOW) POINT TO VOLUME ENTRY IN TABLE @V408246 01536000
  1779. LH R1,OWNDRDEV-OWNDLIST(,R1) GET RDEVBLOK INDEX @V408246 01537000
  1780. SLL R1,3 CONVERT TO DISPLACEMENT @V408246 01538000
  1781. AL R1,ARIODV POINT TO RDEVBLOK @V408246 01539000
  1782. CLI RDEVTYPE-RDEVBLOK(R1),TYP2305 FIXED HEAD DEVICE?@V408246 01540000
  1783. BE QWRITE YES, FOREGO ARM OPTIMIZATION @V408246 01541000
  1784. * 01542000
  1785. * MATCH SEGMENT'S OWNER AND R11 FOR DASD COUNTERS 01543000
  1786. * 01544000
  1787. TSTOWNR DS 0H UPDATE COUNTS FOR SEGMENT'S OWNER@V408246 01545000
  1788. LA R1,0(,R5) SWAPT TABLE ENTRY POINTER @V408246 01546000
  1789. SR R2,R2 CLEAR @V408246 01547000
  1790. IC R2,SWPVPAGE GET VIRTUAL PAGE NO. @V408246 01548000
  1791. AR R2,R4 NO. + 1 @V408246 01549000
  1792. SLL R2,3 DISPLACEMENT TO TABLE HEADER @V408246 01550000
  1793. SR R1,R2 BACK-UP TO TABLE HEADER @V408246 01551000
  1794. LR R3,R11 SAVE ORIGINAL VMBLOK POINTER @V408246 01552000
  1795. C R11,0(,R1) IS THIS USER THE SEGMENT'S OWNER?@V408246 01553000
  1796. BE CHKRCMP YES, NO NEED TO SWITCH FOR COUNT @V408246 01554000
  1797. CHARGE SWITCH,0(R1) NO, SWITCH VMBLOK AND TIMER @V407594 01555000
  1798. CHKRCMP DS 0H @V408246 01556000
  1799. TM SWPFLAG,SWPRECMP CHECK ON RECOMPUTE AGAIN @V408246 01557000
  1800. BO GETPAG NO NEED TO RELEASE BACKING STORE @V408246 01558000
  1801. CALL DMKPGTPR RELEASE OLD DASD ADDRESS @V408246 01559000
  1802. SPACE 3 01560000
  1803. GETPAG DS 0H @V408246 01561000
  1804. CALL DMKPGTPG GET NEW DASD PAGE ADDRESS @V408246 01562000
  1805. CR R3,R11 MATCHING VMBLOKS? @V408246 01563000
  1806. BE CHKDSD YES, CHECK RETURN CONDITION @V408246 01564000
  1807. LR R2,R11 SAVE SEGMENT'S OWNER @VA07717 01564100
  1808. CHARGE SWITCH,3 NO, SWITCH VMBLOK AND TIMER @V407594 01565000
  1809. CHKDSD DS 0H @V408246 01566000
  1810. LTR R1,R1 ANY PAGES AVAILABLE? @V408246 01567000
  1811. BNZ SETADDR YES, SAVE ADDRESS @V408246 01568000
  1812. LA R14,DMKPTRU1 USER FLUSH CHAIN @V408246 01569000
  1813. L R15,CORBPNT-CORTABLE(,R14) LAST ENTRY @V408246 01570000
  1814. ST R7,CORFPNT-CORTABLE(,R15) NEW LAST @V408246 01571000
  1815. ST R7,CORBPNT-CORTABLE(,R14) . . @V408246 01572000
  1816. STM R14,R15,CORFPNT @V408246 01573000
  1817. OI SWPFLAG,SWPRECMP+SWPCHG1 FLAG NO BACKING STORE @V408246 01574000
  1818. L R3,DMKPTRUC FLUSHED PAGE COUNT @VA07810 01574050
  1819. AR R3,R4 PLUS ONE @VA07810 01574055
  1820. ST R3,DMKPTRUC STORE NEW COUNT @VA07810 01574060
  1821. TM CORFLAG,CORSHARE SHARED PAGE @VA07717 01574100
  1822. BO SELEXIT1 YES @VA09179 01574151
  1823. LH R3,VMFLPAG-VMBLOK(R11) FLUSHED PAGE COUNT @VA07922 01574210
  1824. AR R3,R4 PLUS ONE @VA07717 01574250
  1825. STH R3,VMFLPAG-VMBLOK(R11) @VA07922 01574310
  1826. SELEXIT1 CL R13,F2 ENTERED BY CPEXBLOK @VA09179 01574361
  1827. BNH SELDISP YES, EXIT TO DMKPAG @VA07922 01574410
  1828. CHARGE SWITCH,SAVER11 BACK TO CALLER @VA07922 01574460
  1829. B SELEXIT AND LEAVE @V408246 01575000
  1830. * 01576000
  1831. SETADDR DS 0H @V408246 01577000
  1832. ST R1,SWPCYL SAVE BACKING STORE ADDRESS @V408246 01578000
  1833. NI SWPFLAG,X'FF'-SWPRECMP TURN OFF SWAPRECMP @VA09460 01578500
  1834. EJECT 01579000
  1835. QWRITE EQU * HERE TO SWAP THE PAGE 01580000
  1836. * GET CPEXBLOK BEFORE UPPING COUNTS SO THAT AN EXTEND ON THIS FREE CALL 01581000
  1837. * WILL NOT RESULT IN THE SYSTEM WAITING FOR A NONEXISTANT PAGING INT. 01582000
  1838. OI SWPFLAG,SWPTRANS IND. PAGE IS NOW IN TRANSIT @VA01180 01583000
  1839. LA R0,CPEXSIZE GET CORE FOR A CPEXBLOK @VA00972 01584000
  1840. CALL DMKFREE BEFORE WE BUMP THE COUNTS @VA00972 01585000
  1841. L R2,DMKPTRSW GET NUMBER OF PAGES BEING SWAPPED@V2B2638 01586000
  1842. AR R2,R4 BUMP BY ONE 01587000
  1843. ST R2,DMKPTRSW AND RE-STORE @V2B2638 01588000
  1844. L R2,VMPGWRIT COUNT PAGE WRITES 01589000
  1845. AR R2,R4 ... 01590000
  1846. ST R2,VMPGWRIT ... 01591000
  1847. L R2,PGWRITE COUNT FOR SYSTEM .. 01592000
  1848. ALR R2,R4 ... 01593000
  1849. ST R2,PGWRITE ... 01594000
  1850. SPACE 01595000
  1851. LA R0,5 GET DASD WRITE DATA OP-CODE 01596000
  1852. STM R0,R15,CPEXR0 SAVE ALL REGS 01597000
  1853. LA R3,DMKPTRFD SET RETURN TO EXECUTION ADDRESS 01598000
  1854. ST R3,CPEXADD -- 01599000
  1855. SLR R15,R15 CLEAR... 01600000
  1856. ST R15,CPEXR13 SAVE AREA POINTER IN CPEXBLOK 01601000
  1857. L R0,DMKPTRWQ PUSH DOWN PAGE 01602000
  1858. ST R1,DMKPTRWQ WRITE REQUEST 01603000
  1859. ST R0,CPEXFPNT STACK 01604000
  1860. SPACE 2 01605000
  1861. CL R13,F2 UNSTACKED VIA CPEXBLOCK @V407594 01606000
  1862. BNH SELDISP YES, THERE IS NO CALLER @V407594 01607000
  1863. CHARGE SWITCH,SAVER11 RESUME CHARGING CALLER @V407594 01608000
  1864. B SELECT1 GO SEE IF MORE SWAPS NEEDED 01609000
  1865. SPACE 3 01610000
  1866. SELEXIT LTR R13,R13 SHOULD WE RETURN TO A CALLER 01611000
  1867. BZ SELDISP NO, GOTO THE DISPATCHER 01612000
  1868. LM R2,R9,SAVEWRK2 RESTORE PTR SAVE REGISTERS. @V408246 01613000
  1869. BR R8 AND EXIT TO CALLER 01614000
  1870. EJECT 01615000
  1871. DMKPTRFD EQU * HERE TO FRET THE PAGE AFTER IT HAS BEEN WRITTEN 01616000
  1872. NI SWPFLAG,255-SWPTRANS-SWPRECMP-SWPCHG1-SWPCHG2 @V408246 01617000
  1873. * RESET 01618000
  1874. L R1,DMKPTRSW GET NUMBER OF PAGES BEING SWAPPED@V2B2638 01619000
  1875. BCTR R1,0 DECREMENT 01620000
  1876. ST R1,DMKPTRSW AND RE-STORE @V2B2638 01621000
  1877. LTR R15,R15 TEST ERROR FROM PAGIO 01622000
  1878. BP DOFRET IO COMPLETED SUCCESSFULLY 01623000
  1879. OI SWPFLAG,SWPRECMP+SWPCHG1 BACKING STORE UNUSABLE @V408246 01624000
  1880. LR R3,R11 SET-UP FOR TSTOWNR @V408246 01625000
  1881. B TSTOWNR GET NEW DASD LOCATION @V408246 01626000
  1882. SPACE 3 01627000
  1883. DOFRET DS 0H @V408246 01628000
  1884. CALL DMKPTRFT FRET THE PAGE @V408246 01629000
  1885. AIF (NOT &AP).NOAP18 **AIF*** 01629900
  1886. TM APSTAT1,APUOPER RUNNING AS AP @V407594 01630000
  1887. BZ SELCHG NO @V407594 01631000
  1888. CL R11,LASTUSER LAST USER @V407594 01632000
  1889. BE SELCHG YES, DO NOT UNLOCK @V407594 01633000
  1890. CL R11,ASYSVM SYSTEM VMBLOK @V407594 01634000
  1891. BE SELCHG YES, UNLOCK NOT REQUIRED @V407594 01635000
  1892. LR R1,R11 VMBLOK TO R1 @V407594 01636000
  1893. LOCK RELEASE,TYPE=VMBLOK UNLOCK VMBLOK @V407594 01637000
  1894. .NOAP18 ANOP **ANOP** 01637100
  1895. SELCHG CHARGE SWITCH,ASYSVM START CHARGING SYSTEM @V407594 01638000
  1896. SELDSPX DS 0H @V408246 01639000
  1897. GOTO DMKDSPCH @V408246 01640000
  1898. SPACE 3 01641000
  1899. PTRFDISP DS 0H @V408246 01642000
  1900. SELDISP DS 0H @V408246 01643000
  1901. GOTO DMKPAGIO GO TEST FOR I/O TO START @V408246 01644000
  1902. EJECT 01645000
  1903. *. 01646000
  1904. * G. OPERATION OF DMKPTRFT - PLACE A CORTABLE ENTRY ON THE FREELIST 01647000
  1905. * 1. BUMP THE NUMBER OF ENTRIES IN THE FREELIST, AND TEST TO 01648000
  1906. * SEE IF THERE ARE ANY DEFERED REQUESTS QUEUE FROM FREEQ 01649000
  1907. * 2. IF THERE ARE NO DEFERED REQUESTS, SKIP TO STEP 3; OTHER- 01650000
  1908. * WISE, UNCHAIN THE FIRST REQUEST, PLACE THE ADDRESS OF THE 01651000
  1909. * CORTABLE ENTRY BEING RETURNED IN THE DEFERED CALLER'S GPR7, 01652000
  1910. * CALL DMKSTKCP TO STACK THE DEFERED REQUEST, AND EXIT 01653000
  1911. * 3. PLACE THE NEW ENTRY AT THE END OF THE FREELIST, AND FLAG 01654000
  1912. * IT AS A FREE PAGE; THEN EXIT TO THE CALLER 01655000
  1913. *. 01656000
  1914. SPACE 01657000
  1915. ENTRY DMKPTRFT 01658000
  1916. DROP R12,R10 @V407594 01659000
  1917. USING *,R15 01660000
  1918. DROP R9 01661000
  1919. DMKPTRFT STM R0,R2,BALR0 SAVE THESE REGS ONLY 01662000
  1920. TM CORFLAG,CORFREE IS PAGE ALREADY IN FREELIST @VA05378 01663000
  1921. BZ OKFREE NO, OK TO ADD TO FREE LIST @VA05378 01664000
  1922. SPACE 01665000
  1923. ABEND 14 @VA05378 01666000
  1924. SPACE 01667000
  1925. OKFREE EQU * @VA05378 01668000
  1926. MVI CORFLAG,CORFREE RESET CORFLAG @V408246 01669000
  1927. L R1,FREEQ GET QUEUE OF DEFERED REQUESTS 01670000
  1928. LTR R1,R1 ARE THERE ANY ?? 01671000
  1929. BZ CHAINPAG NO -- 01672000
  1930. SPACE 01673000
  1931. ST R7,CPEXR7 SAVE ADDRESS OF CORTABLE ENTRY 01674000
  1932. L R2,CORPGPNT POINT TO OLD PTE 01675000
  1933. LTR R2,R2 IS THERE ONE ? 01676000
  1934. USING PAGCORE,R2 ADDRESSABILITY, JUST IN CASE 01677000
  1935. BZ CKQ NO PAGTABLE ENTRY ACTIVE .. 01678000
  1936. TM PAGCORE+1,PAGINVAL CATCH CULPRIT 01679000
  1937. BO PTR11A OK THIS TIME .. 01680000
  1938. ABEND 11 GOTCHA 01681000
  1939. PTR11A EQU * 01682000
  1940. MVI PAGCORE,0 CLEAR PTE 01683000
  1941. NI PAGCORE+1,PAGINVAL+PAGREF RETAINING THESE FLAGS 01684000
  1942. SLR R2,R2 CLEAR OUT 01685000
  1943. ST R2,CORPGPNT OLD PAGE TABLE ENTRY POINTER 01686000
  1944. ST R2,CORBPNT CLEAR BACK-POINTER @V408246 01687000
  1945. STCM R2,B'0111',CORSWPNT+1 AND SWAP POINTER @V408246 01688000
  1946. CKQ EQU * 01689000
  1947. L R2,CPEXFPNT GET POINTER TO NEXT ON Q 01690000
  1948. ST R2,FREEQ AND MAKE HIM FIRST 01691000
  1949. LR R0,R14 PRESERVE RETURN ADDRESS 01692000
  1950. FTSTAK L R2,CPEXMISC GET RELATED TASK POINTER 01693000
  1951. CALL DMKSTKCP STACK FOR EXECUTION 01694000
  1952. SPACE 01695000
  1953. * THIS UNUSUAL CODE IS EXECUTED < 10 % OF THE TIME .. 01696000
  1954. USING *,R14 TEMPORARY ADDRESSABILITY 01697000
  1955. L R15,=A(DMKPTRFT) GET STANDARD 01698000
  1956. DROP R14 ADDRESSABILITY 01699000
  1957. USING DMKPTRFT,R15 ... 01700000
  1958. LTR R1,R2 ANY MORE IN THE STACK ?? 01701000
  1959. BNZ FTSTAK YES -- STACK THEM TOO 01702000
  1960. LR R14,R0 RESTORE OUR RETURN ADDRESS 01703000
  1961. B FRETEXIT NO -- LEAVE NOW 01704000
  1962. SPACE 3 01705000
  1963. CHAINPAG DS 0H @V408246 01706000
  1964. LA R2,DMKPTRF1 CHAIN ANCHOR FOR FREE LIST PAGES @V408246 01707000
  1965. L R1,CORFPNT-CORTABLE(,R2) 1ST PAGE ON LIST @V408246 01708000
  1966. ST R7,CORBPNT-CORTABLE(,R1) BACKCHAIN TO NEW 1ST @V408246 01709000
  1967. ST R7,CORFPNT-CORTABLE(,R2) FORWARD CHAIN TO NEW @V408246 01710000
  1968. * 1ST 01711000
  1969. STM R1,R2,CORFPNT 01712000
  1970. L R2,DMKPTRFN BUMP NUMBER ... @VA01767 01713000
  1971. A R2,F1 ...IN... @VA01767 01714000
  1972. ST R2,DMKPTRFN ...FREELIST. @VA01767 01715000
  1973. L R2,CORPGPNT POINT TO PTE 01716000
  1974. LTR R2,R2 IS THERE ONE ?? 01717000
  1975. BZ FRETEXIT NO ... 01718000
  1976. TM PAGCORE+1,PAGINVAL IT MUST BE INVALID 01719000
  1977. BO FRETEXIT WHEW . 01720000
  1978. ABEND 12 01721000
  1979. FRETEXIT LM R0,R2,BALR0 RESTORE REGS 01722000
  1980. BR R14 AND EXIT 01723000
  1981. SPACE 01724000
  1982. DROP R2,R5,R7 01725000
  1983. EJECT 01726000
  1984. *. 01727000
  1985. * H. OPERATION OF DMKPTRUL - UNLOCK A PAGE 01728000
  1986. * 1. VERIFY THE THE PAGE IS WITHIN THE REAL MACHINE AND IS IN 01729000
  1987. * FACT LOCKED 01730000
  1988. * 2. DECREMENT AND TEST THE LOCK COUNT IN THE CORTABLE ENTRY; 01731000
  1989. * IF IT IS STILL POSITIVE, EXIT; OTHERWISE CONTINUE 01732000
  1990. * 3. IF THE LOCK COUNT IS ZERO, RESET THE LOCK FLAG AND EXIT 01733000
  1991. * 01734000
  1992. *********************************************************************** 01735000
  1993. * 01736000
  1994. * 01737000
  1995. * CP ASSIST INSTRUCTION "PTRUL" - UNLOCK A PAGE FRAME 01738000
  1996. * 01739000
  1997. * 01740000
  1998. * OPERANDS: 01741000
  1999. * 1 = ADDRESS OF 'DMKPTRPL' ("PTRUL" DATA LIST) 01742000
  2000. * 2 = REAL ADDRESS WITHIN THE PAGE FRAME TO BE UNLOCKED 01743000
  2001. * 01744000
  2002. * REGISTER INPUT: 01745000
  2003. * GPR 14 = EXIT ADDRESS 01746000
  2004. * 01747000
  2005. * SYSTEM DATA AREAS REFERENCED (BY MODULE): 01748000
  2006. * DMKPTR - 'DMKPTRU1' 01749000
  2007. * DMKSYS - 'CORTABLE' 01750000
  2008. * 01751000
  2009. * 01752000
  2010. * EXITS: 01753000
  2011. * 01754000
  2012. * 1. ADDRESS IN GPR 14 (NORMAL COMPLETION) 01755000
  2013. * 01756000
  2014. * REGISTER OUTPUT: NONE CHANGED BY THIS INSTRUCTION 01757000
  2015. * 01758000
  2016. * 2. NEXT SEQUENTIAL INSTRUCTION (ABNORMAL COMPLETION) 01759000
  2017. * 01760000
  2018. * NOTE: THIS EXIT IS FUNCTIONALLY EQUIVALENT TO A NO-OP. 01761000
  2019. * 01762000
  2020. *********************************************************************** 01763000
  2021. *. 01764000
  2022. SPACE 01765000
  2023. DMKPTRUL DS 0F PAGE UNLOCK ROUTINE CALLED VIA BALR 01766000
  2024. ENTRY DMKPTRUL 01767000
  2025. USING *,R15 ADDRESSABILITY VIA GPR15 01768000
  2026. USING CORTABLE,R2 ADDRESSABILITY FOR CORTABLE ENTRY 01769000
  2027. SPACE 01770000
  2028. DS 0H EXECUTE CP ASSIST "PTRUL" %V3M4038 01771000
  2029. DC X'E603',S(DMKPTRPL,0(R2)) ***%V3M4038 01772000
  2030. SPACE 01773000
  2031. STM R0,R4,BALRSAVE SAVE REGS THAT ARE CHANGED %V3M4038 01774000
  2032. L R1,=A(DMKSYSRM) POINT TO REAL MACHINE SIZE %V3M4038 01775000
  2033. CL R2,0(,R1) PAGE TO BE UNLOCKED WITHIN CORE? %V3M4038 01776000
  2034. BL PTR2A YES -- %V3M4038 01777000
  2035. SPACE 01778000
  2036. ABEND 2 DIE 01779000
  2037. SPACE 01780000
  2038. PTR2A EQU * %V3M4038 01781000
  2039. N R2,XPAGNUM GET PAGE NUMBER %V3M4038 01782000
  2040. SRL R2,8 DIVIDED BY 256 %V3M4038 01783000
  2041. A R2,ACORETBL POINT TO CORETABLE ENTRY %V3M4038 01784000
  2042. TM CORFLAG,CORIOLCK IS THE PAGE LOCKED ?? %V3M4038 01785000
  2043. BO PTR3A YES -- %V3M4038 01786000
  2044. SPACE 01787000
  2045. ABEND 3 DIE 01788000
  2046. SPACE 01789000
  2047. PTR3A EQU * %V3M4038 01790000
  2048. L R0,CORLCNT GET LOCK COUNT %V3M4038 01791000
  2049. S R0,F1 DECREMENT %V3M4038 01792000
  2050. BNM PTR4A CANNOT BE MINUS %V3M4038 01793000
  2051. SPACE 01794000
  2052. ABEND 4 OR WE DIE 01795000
  2053. SPACE 01796000
  2054. PTR4A EQU * %V3M4038 01797000
  2055. ST R0,CORLCNT SAVE LOCK COUNT %V3M4038 01798000
  2056. BP UNLOKXIT LOCK COUNT STILL NON-ZERO %V3M4038 01799000
  2057. NI CORFLAG,X'FF'-(CORIOLCK+CORCP) RESET LOCK FLAG. %V408246 01800000
  2058. UNLOKXIT LM R0,R4,BALRSAVE RESTORE USER REGS %V3M4038 01801000
  2059. BR R14 AND EXIT TO CALLER %V3M4038 01802000
  2060. DROP R2 01803000
  2061. EJECT 01804000
  2062. *. 01805000
  2063. * I. OPERATION OF DMKPTRLK - LOCK A PAGE 01806000
  2064. * 1. ISOLATES THE REAL PAGE NUMBER FROM THE REAL ADDRESS IN 01807000
  2065. * GPR 2, AND REFERENCES THE CORE TABLE. 01808000
  2066. * 2. IF THE PAGE IS ALREADY LOCKED (FLAG-BIT SET), SIMPLY 01809000
  2067. * INCREMENTS THE LOCK COUNT BY 1, AND EXITS. 01810000
  2068. * 3. IF THE PAGE WAS NOT LOCKED, SETS THE 01811000
  2069. * FLAG-BIT INDICATING THE PAGE IS NOW LOCKED, SETS THE 01812000
  2070. * LOCK COUNT TO 1, AND EXITS. 01813000
  2071. * 01814000
  2072. *********************************************************************** 01815000
  2073. * 01816000
  2074. * 01817000
  2075. * CP ASSIST INSTRUCTION "PTRLK" - LOCK A PAGE FRAME 01818000
  2076. * 01819000
  2077. * 01820000
  2078. * OPERANDS: 01821000
  2079. * 1 = ADDRESS OF 'LOCKLIST' (ADDR OF THE ADDR OF 'CORTABLE') 01822000
  2080. * 2 = REAL ADDRESS WITHIN THE PAGE FRAME TO BE LOCKED 01823000
  2081. * 01824000
  2082. * REGISTER INPUT: 01825000
  2083. * GPR 14 = EXIT ADDRESS 01826000
  2084. * 01827000
  2085. * SYSTEM DATA AREAS REFERENCED (BY MODULE): 01828000
  2086. * DMKSYS - 'CORTABLE' 01829000
  2087. * 01830000
  2088. * 01831000
  2089. * EXITS: 01832000
  2090. * 01833000
  2091. * 1. ADDRESS IN GPR 14 (NORMAL COMPLETION) 01834000
  2092. * 01835000
  2093. * REGISTER OUTPUT: NONE CHANGED BY THIS INSTRUCTION 01836000
  2094. * NOTE: THE CONDITION CODE IS SET TO ZERO 01837000
  2095. * 01838000
  2096. * 2. NEXT SEQUENTIAL INSTRUCTION (ABNORMAL COMPLETION) 01839000
  2097. * 01840000
  2098. * NOTE: THIS EXIT IS FUNCTIONALLY EQUIVALENT TO A NO-OP. 01841000
  2099. * 01842000
  2100. *********************************************************************** 01843000
  2101. *. 01844000
  2102. SPACE 01845000
  2103. DMKPTRLK DS 0F PAGE LOCK ROUTINE CALLED VIA BALR 01846000
  2104. ENTRY DMKPTRLK 01847000
  2105. USING *,R15 ADDRESSABILITY VIA GPR15 01848000
  2106. SPACE 01849000
  2107. DS 0H EXECUTE CP ASSIST "PTRLK" %V3M4038 01850000
  2108. DC X'E602',S(LOCKLIST,0(R2)) ***%V3M4038 01851000
  2109. SPACE 01852000
  2110. STM R2,R5,BALR2 SAVE ONLY THE REGS. WE WILL USE %V3M4038 01853000
  2111. N R2,XPAGNUM ISOLATE REAL PAGE NUMBER %V3M4038 01854000
  2112. SRL R2,8 DIVIDED BY 256 %V3M4038 01855000
  2113. AL R2,ACORETBL POINT TO CORTABLE ENTRY %V3M4038 01856000
  2114. USING CORTABLE,R2 AND REFERENCE THE CORE TABLE %V3M4038 01857000
  2115. LA R5,1 SET R5 = 1 (FOR GENERAL USE) %V3M4038 01858000
  2116. TM CORFLAG,CORIOLCK IS PAGE ALREADY LOCKED? %V408246 01859000
  2117. BZ PTRLKSTR NO -SET LOCK COUNT TO 1. %V408246 01860000
  2118. AL R5,CORLCNT ADD TOTAL NUMBER OF LOCKS. %V408246 01861000
  2119. PTRLKSTR ST R5,CORLCNT STORE UPDATED LOCK COUNT %V3M4038 01862000
  2120. OI CORFLAG,CORIOLCK ENSURE LOCK FLAG-BIT SET %V3M4038 01863000
  2121. LM R2,R5,BALR2 RESTORE THE REGISTERS WE USED, %V3M4038 01864000
  2122. SR R15,R15 SET CONDITION-CODE = 0, %V3M4038 01865000
  2123. BR R14 AND EXIT TO CALLER. %V3M4038 01866000
  2124. SPACE 3 01867000
  2125. DROP R15 @V408246 01868000
  2126. EJECT 01869000
  2127. *. 01870000
  2128. * 01871000
  2129. * J. OPERATION OF DMKPTRRS - RESET VIRTUAL MEMORY TABLES 01872000
  2130. * 1. INVALIDATES EACH VALID STE IN THE VIRTUAL MACHINE'S 01873000
  2131. * SEGMENT TABLE AND TIMESTAMPS THE ASSOCIATED 01874000
  2132. * PAGE TABLE HEADER. IF THE SEGMENT IS SHARED 01875000
  2133. * THEN THE ACTIVE SHARE COUNT IN THE PAGE 01876000
  2134. * TABLE HEADER IS ALSO DECREMENTED. 01877000
  2135. * 2. IF THE PERFORMANCE FEEDBACK FLAG IS SET INDICATING 01878000
  2136. * A HEAVY PAGING LOAD THEN EACH VALID PTE IN THE 01879000
  2137. * VIRTUAL MACHINE'S PAGE TABLES IS INVALIDATED AND 01880000
  2138. * THE ASSOCIATED CORTABLE ENTRY IS CHAINED ONTO THE 01881000
  2139. * FLUSH LIST. FOR A SHARED SEGMENT THIS PROCESS IS 01882000
  2140. * ONLY PERFORMED WHEN THE ACTIVE SHARE COUNT HAS 01883000
  2141. * DECREMENTED TO 0. 01884000
  2142. * 01885000
  2143. *. 01886000
  2144. * 01887000
  2145. USING SEGPAGE,R3 @V408246 01888000
  2146. USING SWPFLAG,R5 @V408246 01889000
  2147. USING CORTABLE,R7 @V408246 01890000
  2148. USING PAGCORE,R9 @V408246 01891000
  2149. DMKPTRRS DS 0H @V408246 01892000
  2150. TM VMDSTAT,VMINQ IS VM NOW IN A QUEUE @V4M0207 01893000
  2151. BOR R14 BYPASS RESET IF SO @V4M0207 01894000
  2152. STM R0,R15,FREESAVE (SCH MAY BE CALLER) @V408246 01895000
  2153. L R12,APTRAN ESTABLISH ADDRESSABILITY @V408246 01896000
  2154. LR R10,R12 SET SECOND BASE REGISTER @V407594 01897000
  2155. A R10,F4096 @V407594 01898000
  2156. USING DMKPTR,R12,R10 @V407594 01899000
  2157. LA R4,1 INCREMENT @V408246 01900000
  2158. ICM R6,B'1111',VMSEG GET CNT AND PTR @V408246 01901000
  2159. BZ RSEXIT NONE, THEN EXIT @V408246 01902000
  2160. NI VMDSTAT,X'FF'-VMDSP ASSURE NO FAST RE-DISPATCH @V4M0167 01903000
  2161. MVI TEMPR0,0 ZERO PTLB FLAG @V408246 01904000
  2162. LCTL C1,C1,VMSEG GET CORRECT STO IN CONTROL REG @V408246 01905000
  2163. LRA R2,0 PAGE ZERO @V408246 01906000
  2164. BNZ RSNOTMR NOT AVAILABLE @V408246 01907000
  2165. OI VMESTAT,VMINVPAG INVALIDATE ANY SHADOW TABLES @V4M0167 01908000
  2166. L R2,TIMER-PSA(R2) SAVE THE VIRTUAL TIMER VALUE @V408246 01909000
  2167. ST R2,VMTIMER @V408246 01910000
  2168. TM VMMCR6,VMMVTMR IS TIMER ASSIST ACTIVE? @V408246 01911000
  2169. BZ RSNOTMR NO @V408246 01912000
  2170. ICM R2,B'0111',VMMADDR VM ASSIST OF FOR USER? @V408246 01913000
  2171. BZ RSNOTMR NO @V408246 01914000
  2172. LA R0,VMTIMER YES, POINT TIMER ASSIT HERE... @V408246 01915000
  2173. ST R0,MICVTMR-MICBLOK(R2) @V408246 01916000
  2174. RSNOTMR DS 0H @V408246 01917000
  2175. SRL R6,24 GET SEG LGTH / 16 @V408246 01918000
  2176. AR R6,R4 ORIGIN 1 @V408246 01919000
  2177. SLL R6,4 SEG LGTH @V408246 01920000
  2178. ICM R3,B'0111',VMSEG+1 GET SEG ADDR @V408246 01921000
  2179. SR R9,R9 CLEAR INITIALLY @V408246 01922000
  2180. LH R0,VMPAGES CURRENT NO. IN CORE PAGES @V408246 01923000
  2181. ST R0,TEMPR1 INITIALIZE COUNT @V408246 01924000
  2182. EJECT 01925000
  2183. * 01926000
  2184. * SCAN THRU THE VIRTUAL MEMORY TABLES, LOOKING FOR VALID ENTIRES 01927000
  2185. * 01928000
  2186. RSSGLOOP DS 0H LOOP THRU SEGMENT TABLE ENTRIES @V408246 01929000
  2187. TM SEGPAGE+3,SEGINV SEGMENT TABLE ENTRY VALID? @V408246 01930000
  2188. BO RSNEWSEG NO, MOVE TO NEXT STE @V408246 01931000
  2189. SR R8,R8 CLEAR @V408246 01932000
  2190. IC R8,SEGPAGE PAGE TABLE LENGTH @V408246 01933000
  2191. SRL R8,4 RIGHT JUSTIFY @V408246 01934000
  2192. AR R8,R4 ORIGIN 1 @V408246 01935000
  2193. ICM R9,B'0111',SEGPAGE+1 PAGE TABLE POINTER @V408246 01936000
  2194. L R5,=F'-16' BACK-UP TO START OF TABLE HEADER @V408246 01937000
  2195. AR R5,R9 @V408246 01938000
  2196. USING PAGSTMP,R5 @V408246 01939000
  2197. STCK TEMPR2 STORE TOD CLOCK IN WORK AREA @V407594 01940000
  2198. MVC PAGSTMP,TEMPR2 MOVE HIGH WORD TO PG TBL HDR @V407594 01941000
  2199. BC 3,DOWNWEGO ABEND CVT001 @V408246 01942000
  2200. ICM R2,B'0111',PAGSHR+1 NAMED SYSTEM POINTER? @V408246 01943000
  2201. BZ RSPGLOOP NO @V408246 01944000
  2202. ICM R2,B'1111',SHRSEGCT-SHRTABLE(R2) SHARED SEG. @V408246 01945000
  2203. * COUNT? 01946000
  2204. BZ RSPGLOOP NO @V408246 01947000
  2205. AIF (NOT &AP).NOAP19 **AIF*** 01947900
  2206. TM APSTAT1,APUOPER RUNNING AS AP @V407594 01948000
  2207. BO DOCS YES, USE COMPARE AND SWAP LOGIC @V407594 01949000
  2208. .NOAP19 ANOP **ANOP** 01949100
  2209. LH R2,PAGACT DECREMENT @V408246 01950000
  2210. SR R2,R4 ACTIVE SHARED SEGMENT USER COUNT @V408246 01951000
  2211. STH R2,PAGACT @V408246 01952000
  2212. BP RSISTE SEGMENT STILL BEING USED, @V408246 01953000
  2213. * BYPASS RESET @V407594 01954000
  2214. AIF (NOT &AP).NOAP20 **AIF*** 01954900
  2215. B RSPGLOOP RESET PAGES WITHIN SEGMENT @V4M0172 01955000
  2216. DOCS L R14,PAGACT LOAD COUNTS @V407594 01956000
  2217. DECRACT LR R2,R14 @V407594 01957000
  2218. SL R2,=A(X'10000') DECREMENT ACTIVE COUNT @V407594 01958000
  2219. CS R14,R2,PAGACT UPDATE COUNTS @V407594 01959000
  2220. BC 4,DECRACT UPDATE FAILED @V407594 01960000
  2221. SRL R2,16 ACTIVE COUNT TO LOW HALF WORD @V407594 01961000
  2222. LTR R2,R2 SEGMENT STILL IN USE @V407594 01962000
  2223. BP RSISTE YES, BYPASS RESET @V407594 01963000
  2224. .NOAP20 ANOP **ANOP** 01963100
  2225. RSPGLOOP DS 0H LOOP THRU PAGE TABLE ENTIRES @V408246 01964000
  2226. TM PAGCORE+1,PAGINVAL PAGE INVALID? @V408246 01965000
  2227. BZ RSPGVL NO, VALID @V408246 01966000
  2228. TM PAGCORE+1,PAGREF USED WHILE IN-Q? @V408246 01967000
  2229. BZ RSPGUPD NO, DONE @V408246 01968000
  2230. NI PAGCORE+1,255-PAGREF YES, RESET FLAG @V408246 01969000
  2231. LA R0,1 INCREMENT @V408246 01970000
  2232. AL R0,TEMPR1 COUNT OF PAGES TOUCHED @V408246 01971000
  2233. ST R0,TEMPR1 @V408246 01972000
  2234. B RSPGUPD AND OUT @V408246 01973000
  2235. RSPGVL DS 0H @V408246 01974000
  2236. LH R7,PAGCORE REAL PAGE NO. * 16 @V408246 01975000
  2237. N R7,=A(X'FFF0') CLEAR ALL BUT ADDRESS BITS @V408246 01976000
  2238. LR R1,R7 SAVE @V408246 01977000
  2239. A R7,ACORETBL INDEX TO CORRESPONDING CORE @V408246 01978000
  2240. * TABLE ENTRY 01979000
  2241. TM CORFLAG,255-CORSHARE PAGE AVAILABLE? @V408246 01980000
  2242. BNZ RSPGUPD NO, BYPASS RESET @V408246 01981000
  2243. ICM R5,B'0111',CORSWPNT+1 SWAP TABLE POINTER @V408246 01982000
  2244. USING SWPFLAG,R5 @V408246 01983000
  2245. TM SWPFLAG,SWPTRANS+SWPALLOC PAGE ENQUEUED? @V408246 01984000
  2246. BNZ RSPGUPD YES, BYPASS RESET @V408246 01985000
  2247. SLL R1,8 GET REAL PAGE ADDRESS @V408246 01986000
  2248. RRB 0(R1) RESET REF. BITS FOR THIS PAGE @V408246 01987000
  2249. BALR R14,0 SAVE CONDITION CODE @V408246 01988000
  2250. BC 8+4,*+8 @V408246 01989000
  2251. OI SWPKEY1,4 REF. BIT RESET, BACK-UP TO VIRT @V408246 01990000
  2252. RRB 2048(R1) RESET KEY IN 2ND 2K @V408246 01991000
  2253. BALR R15,0 SAVE CONDITION CODE @V408246 01992000
  2254. BC 8+4,*+8 @V408246 01993000
  2255. OI SWPKEY2,4 REF. BIT RESET, BACK-UP TO VIRT. @V408246 01994000
  2256. NI SWPFLAG,255-SWPREF1-SWPREF2 RESET CP BACK-UP @V408246 01995000
  2257. * BITS 01996000
  2258. EJECT 01997000
  2259. OR R14,R15 COMBINE C.C. @V408246 01998000
  2260. TM CORFLAG,CORSHARE SHARED PAGE FRAME? @V4M0167 01999000
  2261. BZ RSSCHG NO, CHECK CHANGED @V4M0167 02000000
  2262. SPM R14 CHECK FOR SHARED AND CHANGED @V4M0167 02001000
  2263. BC 8+2,RSNOCHG PAGE NOT CHANGED @VA09279 02002100
  2264. SLR R15,R15 CLEAR REG FOR INSERT @VA09279 02002200
  2265. IC R15,SWPVPAGE VIRTUAL PAGE NUMBER @VA09279 02002300
  2266. SLL R15,1 MULTIPLY BY 2 FOR PTE SIZE @VA09279 02002400
  2267. L R2,CORPGPNT PAGE TABLE ENTRY ADDRESS @VA09279 02002500
  2268. SLR R2,R15 BACK UP TO START OF PAGE TABLE @VA09279 02002600
  2269. SL R2,F16 BACK UP TO PAGE TABLE HEADER @VA09279 02002700
  2270. L R2,PAGSHR-PAGTABLE(,R2) SHARETABLE POINTER @VA09279 02002800
  2271. TM SHRFLAG-SHRTABLE(R2),SHRNOPRT IS SHARED PAGE @VA09279 02002900
  2272. * UNPROTECTED? 02003000
  2273. BZ RSCHGSHR PAGE IS SHARED, CHANGED, @VA09279 02003100
  2274. * PROTECTED--LEAVE FOR DMKVMA 02003200
  2275. RSNOCHG L R2,DMKPTRSC FRAME IS UNCHANGED, OR FRAME IS @VA09279 02003300
  2276. * CHANGED AND UNPROTECTED 02003400
  2277. SR R2,R4 RESIDENT SHARED PAGE COUNT @V4M0167 02004000
  2278. ST R2,DMKPTRSC STORE UPDATED COUNT @V4M0167 02005000
  2279. RSSCHG DS 0H @V4M0167 02006000
  2280. OI PAGCORE+1,PAGINVAL INVALIDATE PAGE TABLE ENTRY @V408246 02007000
  2281. OI VMESTAT,VMINVPAG INVALIDATE ANY SHADOW TABLES @V408246 02008000
  2282. * ALSO 02009000
  2283. OI CORFLAG,CORFLUSH FLAG PAGE ON FLUSH LIST @V408246 02010000
  2284. L R15,CORFPNT PAGE'S OWNER @V408246 02011000
  2285. LH R2,VMPAGES-VMBLOK(,R15) DECREMENT @V408246 02012000
  2286. SR R2,R4 IN-CORE PAGE COUNT @V408246 02013000
  2287. BM PTR18 VMPAGES TO GO NEGATIVE - TERM CP @VA07224 02013100
  2288. STH R2,VMPAGES-VMBLOK(,R15) @V408246 02014000
  2289. L R2,DMKPTRUC FLUSHED PAGE COUNT @VA07810 02014050
  2290. AR R2,R4 PLUS ONE @VA07810 02014055
  2291. ST R2,DMKPTRUC STORE NEW COUNT @VA07810 02014060
  2292. TM CORFLAG,CORSHARE SHARED PAGE @VA07717 02014100
  2293. BO RSNFLCNT YES @VA07717 02014150
  2294. LH R2,VMFLPAG-VMBLOK(R15) FLUSHED PAGE COUNT @VA07717 02014200
  2295. AR R2,R4 PLUS ONE @VA07717 02014250
  2296. STH R2,VMFLPAG-VMBLOK(R15) @VA07717 02014300
  2297. RSNFLCNT DS 0H @VA07717 02014350
  2298. SPM R14 CHECK IF REAL KEYS MUST BE @V408246 02015000
  2299. * BACKED UP 02016000
  2300. BC 8+2,RSCKCHN REAL KEYS NOT SET @V408246 02017000
  2301. OI SWPFLAG,SWPCHG2 MAKE SURE WRITTEN OUT @V408246 02018000
  2302. RRB 0(R1) TEST 1ST 2K @V408246 02019000
  2303. BC 8+2,*+8 1ST 2K NOT CHANGED @V408246 02020000
  2304. OI SWPKEY1,2 REAL CHANGE BIT TO VIRT. BACKUP @V408246 02021000
  2305. RRB 2048(R1) TEST 2ND 2K @V408246 02022000
  2306. BC 8+2,*+8 NOT CHANGED @V408246 02023000
  2307. OI SWPKEY2,2 REAL CHANGE BIT TO VIRT. BACKUP @V408246 02024000
  2308. RSCKCHN DS 0H @V408246 02025000
  2309. TM VMDSTAT,VMELIG IN ELIGIBLE LIST @VA07714 02025100
  2310. BO RSCHNF YES, ADD PAGES TO END OF LIST @VA07714 02025200
  2311. LA R15,DMKPTRU1 ANCHOR FOR USER PAGE LIST @V408246 02026000
  2312. L R14,CORFPNT-CORTABLE(,R15) 1ST PAGE ON LIST @V408246 02027000
  2313. ST R7,CORBPNT-CORTABLE(,R14) BACKCHAIN TO NEW 1ST @V408246 02028000
  2314. ST R7,CORFPNT-CORTABLE(,R15) MAKE NEW FIRST @V408246 02029000
  2315. STM R14,R15,CORFPNT FILE IN NEW FORW. AND BACKW. @V408246 02030000
  2316. * PTRS. 02031000
  2317. B RSPGUPD @VA07714 02031100
  2318. RSCHNF DS 0H ADD PAGES TO END OF FLUSH LIST @VA07714 02031150
  2319. LA R15,DMKPTRU1 POINTER TO LAST ENTRY @VA07714 02031200
  2320. L R14,4(R15) POINT TO LAST ENTRY @VA07714 02031250
  2321. ST R7,CORFPNT-CORTABLE(R14) FWD CHAIN TO NEW LAST @VA07714 02031300
  2322. ST R7,4(R15) POINT TO NEW LAST ENTRY @VA07714 02031350
  2323. ST R14,CORBPNT BACKCHAIN NEW ENTRY @VA07714 02031400
  2324. ST R15,CORFPNT & FORWARD CHAIN IT @VA07714 02031450
  2325. SPACE 3 02032000
  2326. RSPGUPD DS 0H @V408246 02033000
  2327. LA R9,PAGCORE+2 MOVE POINTER TO NEXT PTE @V408246 02034000
  2328. BCT R8,RSPGLOOP LOOP THRU ALL PTE IN THIS SEGMENT@V408246 02035000
  2329. RSISTEI DS 0H INVALIDATE STE @VA07230 02036000
  2330. OI SEGPAGE+3,SEGINV INVALIDATE STE @V408246 02037000
  2331. RSSETPUR DS 0H @V4M0172 02038000
  2332. MVI TEMPR0,1 RAISE PTLB FLAG @V408246 02039000
  2333. RSNEWSEG DS 0H HANDLE NEXT STE @V408246 02040000
  2334. LA R3,SEGPAGE+4 POINT TO NEXT STE @V408246 02041000
  2335. BCT R6,RSSGLOOP LOOP THRU ALL STE IN SEGMENT @V408246 02042000
  2336. * TABLE 02043000
  2337. CLI TEMPR0,0 IMMEDIATE PTLB REQUIRED? @V408246 02044000
  2338. BE RSEXIT NO @V408246 02045000
  2339. OI APSTAT2,CPPTLBR SET PTLB REQ FOR THIS PROCR @V407594 02046000
  2340. L R2,PREFIXB AND OTHER PROCESSOR @V407594 02047000
  2341. OI APSTAT2-PSA(R2),CPPTLBR REDUNDANT IF UP MODE @V407594 02048000
  2342. RSEXIT DS 0H @V408246 02049000
  2343. LM R0,R15,FREESAVE RESTORE REGS. @V408246 02050000
  2344. BR R14 AND RETURN TO SCH CALLER @V408246 02051000
  2345. SPACE 1 @V4M0172 02052000
  2346. RSCHGSHR DS 0H RESET PAGACT TO WHAT IT WAS @V4M0172 02053000
  2347. ICM R9,B'0111',SEGPAGE+1 LOAD PAGE TBL POINTER @V4M0172 02054000
  2348. L R5,=F'-16' BACK UP TO HEADER @V4M0172 02055000
  2349. AR R5,R9 POINT TO HEADER @V4M0172 02056000
  2350. USING PAGSTMP,R5 BASE HEADER @V4M0172 02057000
  2351. TM APSTAT1,APUOPER RUNNING AS AP @V4M0172 02058000
  2352. BO RSINCRCS YES, MUST USE COMPARE & SWAP @V4M0172 02059000
  2353. LH R0,PAGACT LOAD ACTIVE COUNT @V4M0172 02060000
  2354. AR R0,R4 ADD ONE (SEGMENT STILL VALID) @V4M0172 02061000
  2355. STH R0,PAGACT STORE COUNT @V4M0172 02062000
  2356. B RSSETPUR FINISHED WITH SEGMENT @V4M0172 02063000
  2357. RSINCRCS L R0,PAGACT LOAD ACTIVE & TOTAL COUNTS @V4M0172 02064000
  2358. RSCSADD LR R14,R0 COUNTS TO R14 @V4M0172 02065000
  2359. AL R14,=A(X'10000') ADD ONE TO ACTIVE COUNT @V4M0172 02066000
  2360. CS R0,R14,PAGACT REPLACE COUNTS @V4M0172 02067000
  2361. BC 4,RSCSADD UPDATE FAILED @V4M0172 02068000
  2362. B RSSETPUR FINISHED WITH SEGMENT @V4M0172 02069000
  2363. SPACE 1 02069100
  2364. RSISTE DS 0H @VA07230 02069110
  2365. CL R11,LASTUSER IS VMA SCAN PENDING @VA07230 02069120
  2366. BNE RSISTEI NO- INVALIDATE STE @VA07230 02069130
  2367. * PERFORM DMKVMA SCAN HERE AND INVALIDATE STE IF NO CHANGED PAGE 02069140
  2368. * IF PAGE HAS BEEN CHANGED LEAVE STE VALID 02069150
  2369. CNOP 0,8 @VA07230 02069160
  2370. PAGEISK TM PAGCORE+1,PAGINVAL PAGE INVALID @VA07230 02069170
  2371. BO INVAL YES, CANNOT BE CHANGED @VA07230 02069180
  2372. LH R2,PAGCORE LOAD PTE @VA07230 02069190
  2373. SLL R2,8 DEVELOP REAL ADDRESS @VA07230 02069200
  2374. N R2,XPAGNUM CLEAR DISPLACEMENT @VA07230 02069210
  2375. ISK R0,R2 LOAD FIRST KEY @VA07230 02069220
  2376. SLL R0,8 SAVE KEY @VA07230 02069230
  2377. LA R2,2048(R2) ADD FOR SECOND HALF OF PAGE @VA07230 02069240
  2378. ISK R0,R2 LOAD SECOND KEY @VA07230 02069250
  2379. N R0,=A(X'00000202') ISOLATE CHANGE BITS @VA07230 02069260
  2380. BNZ RSCHGSHR PAGE WAS CHANGED @VA07230 02069270
  2381. INVAL LA R9,PAGCORE+2 POINT TO NEXT PTE @VA07230 02069280
  2382. BCT R8,PAGEISK PROCESS NEXT PTE @VA07230 02069290
  2383. B RSISTEI INVALIDATE STE- SEG NOT CHANGED @VA07230 02069300
  2384. SPACE 1 @V4M0172 02070000
  2385. DROP R3,R5,R7,R9 @V408246 02071000
  2386. EJECT 02071100
  2387. * NOTE.... THIS SUBROUTINE REMOVED FROM DMKPGS BY VM8037 02071120
  2388. * B. OPERATION OF DMKPTRPW - 02071140
  2389. * 02071160
  2390. * 1. CHECK THAT THIS VIRTUAL MACHINE HAS SOME OUTSTANDING 02071180
  2391. * PAGING ACTIVITY. IF NONE FOUND RETURN TO CALLER 02071200
  2392. * 2. CREATE A CP REQUEST BLOCK TO RESTART AT STEP 1. 02071220
  2393. * 3. SEARCH CP PAGE I/O REQUEST CHAINS FOR A REQUEST BLOCK 02071240
  2394. * BELONGING TO THIS VIRTUAL MACHINE. IF NONE FOUND 02071260
  2395. * SKIP TO STEP 5. 02071280
  2396. * 4. QUEUE CP REQUEST BLOCK OFF OF THE PAGE I/O REQUEST BLOCK. 02071300
  2397. * SKIP TO STEP 6. 02071320
  2398. * 5. CALL DMKSTKCP TO IMMEDIATELY QUEUE THE CP REQUEST BLOCK 02071340
  2399. * 6. GOTO DMKDSP 02071360
  2400. * 02071380
  2401. *. 02071400
  2402. DMKPTRPW RELOC @V408246 02071420
  2403. LR R10,R12 SET SECOND BASE @VA08037 02071440
  2404. A R10,F4096 ......... @VA08037 02071460
  2405. USING DMKPTR,R12,R10 @VA08037 02071480
  2406. CL R11,ASYSVM ENTERED FOR SYSTEM VMBLOK? @VA08341 02071485
  2407. BE EXITA YES, ALL DONE @VA08341 02071490
  2408. PTRPWEP DS 0H @V408246 02071500
  2409. TM VMRSTAT,VMPGWAIT ALL QUIET? @V408246 02071520
  2410. BNZ CHKSTK NO @V408246 02071540
  2411. CLC VMNDCNT,F0 QUIET HERE ALSO? @V408246 02071560
  2412. BE EXITA YES, ALL DONE @V408246 02071580
  2413. * 02071600
  2414. * USER HAS OUTSTANDING PAGING ACTIVITY. 02071620
  2415. * DEFER RETURN UNTILL ALL IS QUIET. 02071640
  2416. * 02071660
  2417. CHKSTK DS 0H @V408246 02071680
  2418. LA R0,CPEXSIZE GET CPRQ BLOCK @V408246 02071700
  2419. CALL DMKFREE @V408246 02071720
  2420. USING CPEXBLOK,R1 @V408246 02071740
  2421. STM R0,R13,CPEXR0 SAVE MY REGS. @V408246 02071760
  2422. LA R0,PTRPWEP RE-ENTER AT THE TOP @V408246 02071780
  2423. ST R0,CPEXADD @V408246 02071800
  2424. L R4,=A(DMKPTRFQ) FREE LIST QUEUE @V408246 02071820
  2425. L R3,=A(DMKPAGQ) PAGE I/O QUEUE @V408246 02071840
  2426. LR R2,R3 SAVE ANCHOR @V408246 02071860
  2427. * 02071880
  2428. * SEARCH PAGING QUEUES FOR A REQUEST BLOCK FOR THIS VMBLOK 02071900
  2429. * 02071920
  2430. GETTASK DS 0H @V408246 02071940
  2431. ICM R3,B'1111',CPEXFPNT-CPEXBLOK(R3) GET ADDR CPEXB @VMI0038 02071960
  2432. BZ CKDSPQ NO CPEXBLOK @VMI0038 02071980
  2433. CR R2,R3 BACK AT START OF CHAIN? @V408246 02072000
  2434. BE STAK YES @V408246 02072020
  2435. LR R5,R3 NO, SAVE POINTER @V408246 02072040
  2436. LR R15,R5 SET SWITCH NON-ZERO @V408246 02072060
  2437. GETEND DS 0H SCAN ALL DEFERRED TASKS @V408246 02072080
  2438. C R11,CPEXR11-CPEXBLOK(,R5) THIS USER'S TASK? @V408246 02072100
  2439. BNE *+6 NO @V408246 02072120
  2440. SR R15,R15 YES, ZERO SWITCH @V408246 02072140
  2441. ICM R0,15,CPEXMISC-CPEXBLOK(R5) GET POINTER TO @V408246 02072160
  2442. * DEFERED 02072180
  2443. BZ CHNIT FOUND @V408246 02072200
  2444. LR R5,R0 SAVE BACKPOINTER AND CONTINUE @V408246 02072220
  2445. B GETEND @V408246 02072240
  2446. CHNIT DS 0H @V408246 02072260
  2447. LTR R15,R15 WAS SOMETHING FOUND? @V408246 02072280
  2448. BNZ GETTASK NO, KEEP SEARCHING @V408246 02072300
  2449. ST R1,CPEXMISC-CPEXBLOK(,R5) NEW LAST BLOCK @V408246 02072320
  2450. ST R15,CPEXMISC ZERO FORWARD POINTER @V408246 02072340
  2451. B GTDSP ALL DONE @V408246 02072360
  2452. SPACE 02072380
  2453. * 02072400
  2454. * NOT REQUESTS WERE FOUND 02072420
  2455. * 02072440
  2456. STAK DS 0H TASK NOT FOUND @V408246 02072460
  2457. LR R3,R4 @V408246 02072480
  2458. SR R4,R4 CLEAR @V408246 02072500
  2459. LTR R2,R3 SAVE CHAIN ANCHOR AND TEST @V408246 02072520
  2460. BNZ GETTASK CHECK THIS CHAIN ALSO @V408246 02072540
  2461. CKDSPQ DS 0H @VMI0038 02072560
  2462. CALL DMKSTKCP @VMI0038 02072580
  2463. GTDSP DS 0H @V408246 02072780
  2464. GOTO DMKDSPCH @V408246 02072800
  2465. EXITA DS 0H NOW RETURN TO CALLER WITH CC=0 @V400141 02072860
  2466. CLI SAVEWRK1+1,CC0 SET CC FOR CALLER @V408246 02072880
  2467. LM R0,R11,SAVEREGS @V408246 02072900
  2468. SVC 12 @V408246 02072920
  2469. EJECT @V408246 02072940
  2470. DS 0D ALIGNMENT 02073000
  2471. DMKPTRFN DC F'0' NUMBER OF PAGES IMMEDIATELY AVAILABLE 02074000
  2472. DMKPTRSW DC F'0' NUMBER OF PAGES BEING SWAPPED @V2B2638 02075000
  2473. DMKPTRF1 DC A(DMKPTRF1) ADDRESS OF 1ST PAGE 02076000
  2474. FREELAST DC A(DMKPTRF1) ADDRESS OF LAST PAGE 02077000
  2475. SPACE 2 02078000
  2476. SPACE 02079000
  2477. DMKPTRXX DC A(X'80000000') LOC TO DETERMINE IF USER @V408246 02080000
  2478. * CHANGED PAGE 02081000
  2479. * SHOULD BE PAGED OUT AFTER BEING DROPPED FROM Q 02082000
  2480. SPACE 2 02083000
  2481. * THE FOLLOWING 8 BYTE DATA LIST MUST BE KEPT CONTIGUOUS AND IN ORDER 02084000
  2482. * BECAUSE IT IS USED BY THE CP ASSIST INSTRUCTIONS "PTRLK" AND "PTRUL". 02085000
  2483. SPACE 02086000
  2484. DMKPTRPL DS 0F @V386198 02087000
  2485. DMKPTRRM DC A(0) +0 STORAGE SIZE (SET BY DMKCPI) @V386198 02088000
  2486. LOCKLIST DC V(DMKSYSCS) +4 ADDR OF THE SYSTEM CORE TABLE @V386198 02089000
  2487. * 02090000
  2488. * DMKPTRU1 IS THE DEFERRED WRITE (FLUSH) LIST ANCHOR 02090100
  2489. DMKPTRU1 DC A(DMKPTRU1) A(1ST ENTRY FOR USER PAGES) @V408246 02091000
  2490. DC A(DMKPTRU1) A(LAST ENTRY FOR USER PGS) @V408246 02092000
  2491. SPACE 1 02092100
  2492. DMKPTRUC DC F'0' COUNT OF FLUSHED PAGES @VA07810 02092200
  2493. SPACE 2 02093000
  2494. DMKPTRRU DC A(0) VMBLOK ADDRESS FOR RESERVED PAGE USER 02094000
  2495. SPACE 02095000
  2496. FREEQ DC A(0) Q OF DEFERED REQUESTS FOR FREE CORE 02096000
  2497. DMKPTRFQ EQU FREEQ @V408246 02097000
  2498. DMKPTRFA DC A(0) BLOCK OF STORAGE FOR EXTENDING @VM08952 02098000
  2499. SPACE 02099000
  2500. DMKPTRRQ DC A(0) PAGE READ REQUEST QUEUE 02100000
  2501. DMKPTRWQ DC A(0) PAGE WRITE REQUEST QUEUE 02101000
  2502. DC F'-1' FENCE 02102000
  2503. SPACE 3 02103000
  2504. DMKPTRPR DC F'0' NUMBER OF PAGES RECLAIMED @V2B2638 02104000
  2505. * FROM FREE LIST 02104050
  2506. DMKPTRP2 DC F'0' NUMBER OF PAGES RECLAIMED @VA07717 02104100
  2507. * FROM FLUSH LIST 02104150
  2508. SPACE 02105000
  2509. DMKPTRF0 DC F'0' NUMBER OF TIMES FREELIST WAS EMPTY 02106000
  2510. SPACE 02107000
  2511. DMKPTRFC DC F'0' NUMBER OF TIMES DMKPTRFR WAS CALLED 02108000
  2512. SPACE 02109000
  2513. DMKPTRFF DC F'0' NO. PAGES SWAPPED FROM FLUSH LIST@V2B2638 02110000
  2514. DMKPTRSS DC F'0' NO. OF PAGE STEALS FROM ACTIVE @V2B2638 02111000
  2515. * USERS 02112000
  2516. SPACE 02113000
  2517. DMKPTRRF DC F'0' NO. PAGES LOOKED AT DURING STEALS@V2B2638 02114000
  2518. DMKPTRCS DC F'0' NO. OF TIMES ENTIRE ULIST EXAMIND@V2B2638 02115000
  2519. SPACE 02116000
  2520. SPACE 02117000
  2521. SPACE 02118000
  2522. DMKPTRRL DC F'0' RESERVED PAGE LIMIT 02119000
  2523. SPACE 02120000
  2524. DMKPTRRC DC F'0' NUMBER OF RESIDENT, RESERVED PAGES 02121000
  2525. SPACE 02122000
  2526. EJECT 02123000
  2527. DMKPTRCP EQU * TABLE IS SET UP BY DMKCPI @V408246 02124000
  2528. * THE FOLLOWING DC CONTAINS POINTERS TO INDEX INTO THE CORETBL 02125000
  2529. *CURPNT DC A(REAL STORAGE ADDR),A(CUR CORETBL ENTRY),A(INDEX CONT) 02126000
  2530. * DC A(LOWEST PAGEABLE CORETBL ENTRY THIS BLOK),A(INCREMENT) 02127100
  2531. CURPNT DC A(0),A(0),A(-16),A(0),A(4096) @V408246 02128000
  2532. SPACE 1 02129000
  2533. FULLSCAN EQU * START OF FULLSCAN TABLE @VA08341 02130100
  2534. *FULSCAN2 DC A(ADDR. OF HIGHEST PAGEABLE PAGE),A(HIGH CORETBL ENTRY) 02130150
  2535. * DC A(INDEX CONST.),A(FIRST PAGEABLE CORETBL ENTRY),A(INCRE) 02131000
  2536. FULSCAN2 DC A(0),A(0),A(-16),A(0),A(4096) @VA08341 02131100
  2537. *FULSCAN1 DC A(ADDR. OF HIGHEST V=R PAGE),A(HIGH V=R CORETBL ENTRY) 02131200
  2538. * DC A(INDEX CONST.),A(1ST V=R CORETBL ENTRY),A(INCRE) 02131300
  2539. FULSCAN1 DC A(0),A(0),A(-16),A(0),A(4096) @VA08341 02131400
  2540. *TOPPNT DC A(ADDRESS HIGHEST PAGEABLE PAGE THIS BLOK), 02133100
  2541. * DC A(HIGHEST CORETBL ENTRY THIS BLOK), 02133200
  2542. * DC A(INDEX CONST),A(CURRENT CORETBL ENTRY),A(INCREMENT) 02134000
  2543. SPACE 1 02135000
  2544. TOPPNT DC A(0),A(0),A(-16),A(0),A(4096) @V408246 02136000
  2545. DC F'-1' FENCE.... @V408246 02137000
  2546. SPACE 3 02138000
  2547. DMKPTRCT DC F'0' TOTAL CALLS TO DMKPTR 02139000
  2548. DMKPTRSC DC F'0' TOTAL RESIDENT SHARED PAGES 02140000
  2549. * 02141000
  2550. DMKPGSHR DC 2A(DMKPGSHR) ANCHOR FOR SCHRTABLES @V408246 02142000
  2551. DMKPTRSN EQU * @VA08341 02142100
  2552. SCANNUM DC H'0' NUMBER OF FRAME BLOCKS AVAILABLE @VA08341 02142150
  2553. * FOR SCAN 02142200
  2554. SCANBLOK DC H'0' NUMBER OF BLOCK CURRENTLY BEING @VA08341 02142250
  2555. * SCANNED 02142300
  2556. SCANSTRT DC H'0' NUMBER OF BLOCK WHERE CURRENT @VA08341 02142350
  2557. * SCAN STARTED 02142400
  2558. SCANFLAG DC X'0' FLAGS FOR SCAN PROCESS @VA08341 02142450
  2559. PASSTWO EQU X'80' SCAN IS NOW ON 2ND FULL PASS @VA08341 02142500
  2560. * THROUGH THE BLOCKS OF FRAMES 02142550
  2561. VEQRUNLK EQU X'40' V=R AREA HAS BEEN UNLOCKED BY THE@VA08341 02142600
  2562. * OPERATOR AND IS AVAILABLE TO THE 02142650
  2563. * SCAN PROCESS 02142700
  2564. EJECT 02143000
  2565. LTORG 02144000
  2566. SPACE 2 02145000
  2567. PAGESIZE EQU 15 *** SIZE OF PAGING IOBLOK (USED BY DMKPAGIO) *** 02146000
  2568. SPACE 1 02147000
  2569. * EQUATES FOR TEMPR0 - USED FOR PAGE SELECTION CONTROL @V407594 02148000
  2570. UNLKVM EQU X'80' MUST UNLOCK VMBLOK (CORVM) @V407594 02149000
  2571. NOSTEAL EQU X'40' CANNOT STEAL PAGE, BUT DO RRB @V407594 02150000
  2572. RRBSHR EQU X'20' PROC'G SHARED PAGE (AP PHASE 1) @V407594 02151000
  2573. SPACE 1 02152000
  2574. * EQUATES FOR TEMPR0+1 - USED DURING PAGE SELECTION @V407594 02153000
  2575. OPPRSTRT EQU X'80' MUST RESTART OTHER PROCESSOR @V407594 02154000
  2576. * CONDITION CODE SETTING FOR SAVEWRK1+1 @V407511 02154100
  2577. CC0 EQU X'00' CONDITION CODE ZERO - NORMAL @V407511 02154200
  2578. EJECT 02155000
  2579. COPY VMBLOK 02156000
  2580. COPY MICBLOK @V386198 02157000
  2581. COPY CORE 02158000
  2582. PSA 02159000
  2583. COPY SAVE 02160000
  2584. COPY RBLOKS 02161000
  2585. COPY ALLOC 02162000
  2586. COPY EQU 02163000
  2587. COPY DEVTYPES 02164000
  2588. COPY SHRTABLE @V408246 02165000
  2589. END 02166000
ibm/vm370-lib/cp/dmkptr.assemble_src.txt ยท Last modified: 2023/08/06 13:37 by Site Administrator