PTR TITLE 'DMKPTR (CP) VM/370 - RELEASE 6' 00001000 ISEQ 73,80 VALIDATE SEQUENCING OF INPUT 00002000 *. 00003000 * MODULE NAME - 00004000 * 00005000 * DMKPTR 00006000 * 00007000 * FUNCTION - 00008000 * 00009000 * TO MANAGE THE INVENTORY OF REAL SYSTEM PAGES, PROVIDING REAL 00010000 * MEMORY SPACE FOR CONTROL PROGRAM FUNCTIONS AND FOR PAGES OF 00011000 * USER AND CONTROL PROGRAM VIRTUAL MEMORY 00012000 * 00013000 * ATTRIBUTES - 00014000 * 00015000 * SERIALLY REUSABLE, RESIDENT, CALLED VIA SVC 8 00016000 * 00017000 * ENTRY POINTS - 00018000 * 00019000 * DMKPTRAN - TRANSLATE THE VIRTUAL ADDRESS PROVIDED BY THE CALL- 00020000 * ER INTO A REAL MEMORY ADDRESS 00021000 * DMKPTRUL - UNLOCK A PAGE OF REAL MEMORY 00022000 * DMKPTRFR - OBTAIN A PAGE OF REAL MEMORY 00023000 * DMKPTRFT - RETURN A PAGE OF REAL MEMORY TO THE SYSTEM 00024000 * DMKPTRLK - LOCK A PAGE OF REAL MEMORY 00025000 * DMKPTRRS RESET PAGES BELONGING TO USER 00026000 * DMKPTRPW - WAIT FOR USER PAGING TO COMPLETE 00026100 * 00027000 * THE FOLLOWING VALUES MAY BE REFERENCED OR MODIFIED BY EXTERNAL 00028000 * ROUTINES 00029000 * 00030000 * DMKPTRFN - NUMBER OF FREE PAGES CURRENTLY AVAILABLE - INITIAL- 00031000 * IZED BY DMKCPINT 00032000 * DMKPTRF1 - POINTER TO THE CORETABL ENTRY FOR THE FIRST FREE 00033000 * PAGE - INITIALIZED BY DMKCPINT 00034000 * DMKPTRU1 - ADDRESS OF 1ST CORTABLE ENTRY ON FLUSH LIST 00035000 * DMKPTRRT - CPEXBLOK RETURN ADDRESS FOR (DMKPTRPW) 00036000 * DMKPTRFD - CPEXBLOK RETURN ADDRESS TO 'FRET' SWAPPPED PAGE 00037000 * DMKPTRFP - CPEXBLOK RETURN ADDRESS TO EXTEND FREE STORAGE 00038000 * DMKPTRFE - CPEXBLOK RETURN ADDRESS TO FORCE PAGE SWAP 00039000 * DMKPTRRU - ADDRESS OF VMBLOK FOR CURRENT RESERVED PAGE USER 00040000 * DMKPTRCT - NUMBER OF CALLS TO DMKPTRAN 00041000 * DMKPTRF0 - NUMBER OF TIMES DMKPTRFR WAS CALLED AND NO PAGES 00042000 * WERE AVAILABLE 00043000 * DMKPTRFC - NUMBER OF CALLS TO DMKPTRFR 00044000 * DMKPTRFA - ADDRESS OF RESERVED CPEXBLOK USED BY DMKPTRFR 00045000 * DMKPTRRL - HIGH WATER LIMIT FOR RESERVED PAGE USER 00046000 * DMKPTRRC - CURRENT NUMBER OF RESIDENT RESERVED PAGES 00047000 * DMKPTRSC - NUMBER OF RESIDENT, SHARED PAGES 00048000 * DMKPTRSS - NUMBER OF PAGES STOLEN FROM ACTIVE USERS 00049000 * DMKPTRFF - NUMBER OF PAGES TAKEN FROM FLUSHED PAGE LIST 00050000 * DMKPTRRQ - PAGE READ REQUEST QUEUE 00051000 * DMKPTRWQ - PAGE WRITE REQUEST QUEUE 00052000 * DMKPTRCP TABLE OF INDICES FOR CORTABLE SEARCHING 00053000 * DMKPTRPR PAGES RECLAINED 00054000 * 00055000 * ENTRY CONDITIONS - 00056000 * 00057000 * FOR DMKPTRAN - 00058000 * GPR1 = VIRTUAL ADDRESS TO BE TRANSLATED 00059000 * GPR2 = ONE OR MORE OF THE FOLLOWING OPTIONS - 00060000 * BRING - IF THE PAGE IS NOT RESIDENT, BRING IT IN 00061000 * DEFER - DO NOT RETURN TO THE CALLER UNTIL THE PAGE IS 00062000 * RESIDENT 00063000 * LOCK - LOCK THE PAGE INTO REAL MEMORY 00064000 * IOERET - RETURN ANY PAGING IO ERRORS TO THE CALLER 00065000 * IF DEFER IS NOT REQUESTED, THEN: 00066000 * GPR3 = RETURN ADDRESS FOR EXIT WHEN PAGE IS RESIDENT 00067000 * SYSTEM - CALLER IS REFERENCING SYSTEM VM SPACE 00068000 * VFAULT - CALL IS FOR VIRTUAL PAGE FAULT (FROM DMKPRG) @V400141 00069000 * CALLER WILL NOT REFERENCE REAL ADDRESS @V400141 00070000 * RETURNED IN REGISTER 2 @V400141 00071000 * GPR11 = ADDRESS OF USER'S VMBLOK 00072000 * GPR12 = DMKPTRAN BASE 00073000 * GPR13 = SAVEAREA BASE 00074000 * FOR DMKPTRUL - 00075000 * GPR2 = AN ADDRESS WITHIN THE REAL PAGE TO BE UNLOCKED 00076000 * GPR14 = RETURN REGISTER 00077000 * GPR15 = DMKPTRUL BASE 00078000 * 00079000 * FOR DMKPTRLK - 00080000 * GPR 2 = AN ADDRESS WITHIN THE REAL PAGE TO BE LOCKED 00081000 * GPR 14 = RETURN REGISTER 00082000 * GPR 15 = DMKPTRLK BASE 00083000 * 00084000 * 00085000 * FOR DMKPTRFR - 00086000 * GPR2 = PARM REGISTER 00087000 * (=1 IF CALLED BY DMKFREE; =0 FOR ALL OTHER CALLERS) 00088000 * (=2 IF CALLED BY DMKFREE AND THE DMKFRE CALLER 00089000 * IS TO GET A RET CODE INSTEAD OF SYSTEM ABEND 00090000 * STORAGE IS NOT AVAILABLE). 00091000 * GPR12 = DMKPTRFR BASE 00092000 * GPR13 = SAVEAREA BASE 00093000 * 00094000 * FOR DMKPTRFT - 00095000 * GPR7 = ADDRESS OF CORTABLE ENTRY FOR PAGE TO BE FRETTED 00096000 * GPR12 = DMKPTRFT BASE 00097000 * GPR13 = SAVEAREA BASE 00098000 * 00099000 * FOR DMKPTRPW 00099100 * GPR11 = ADDRESS OF VMBLOK OF VIRTUAL MEMORY'S OWNER 00099200 * GPR12 = ADDRESS OF ENTRY POINT 00099300 * GPR13 = ADDRESS OF SAVEAREA 00099400 * 00099500 * EXIT CONDITIONS - 00100000 * 00101000 * FROM DMKPTRAN - NORMAL - 00102000 * CC = 0 - VIRTUAL PAGE IS RESIDENT 00103000 * GPR2 = TRANSLATED REAL ADDRESS 00104000 * CC = 1 - PAGE IS NOT RESIDENT, DEFER NOT SPECIFIED 00105000 * GPR2 = ADDRESS OF PAGTABLE ENTRY 00106000 * 00107000 * FROM DMKPTRAN - ERROR 00108000 * CC = 2 - VIRTUAL ADDRESS PROVIDED LIES OUTSIDE OF USER'S 00109000 * VIRTUAL MEMORY SPACE 00110000 * CC = 3 - IOERROR OCCURRED WHLE ATTEMPTING TO READ PAGE 00111000 * 00112000 * FROM DMKPTRUL - NONE 00113000 * 00114000 * FROM DMKPTRLK - NORMAL - CC = 0 00115000 * 00116000 * FROM DMKPTRFR - NORMAL 00117000 * GPR7 = ADDRESS OF CORTABLE ENTRY FOR PAGE PROVIDED 00118000 * IF THE CALL WAS FROM DMKFREE, THE PAGE IS MERGED INTO THE FREE 00119000 * STORAGE CHAIN VIA A CALL TO DMKFRETR 00120000 * 00121000 * IF DMKPTRFR WAS CALLED WITH PARM=2 AND A PAGE IS NOT 00122000 * IMMEDIATELY AVAILABLE, AND THE NUMBER OF PAGES ON THE 00123000 * WAY OUT IS NOT SUFFICIENT, THEN A SEPARATE TASK IS STARTED 00124000 * FOR THE PURPOSE OF REPLENISHING THE FREE LIST. 00125000 * THIS IS DONE BY STACKING A CPEXBLOK FOR RETURN TO 00126000 * DMKPTRFE TO PERFORM THE REPLENISHMENT FUNCTION. 00127000 * IF THE REPLENISHMENT ROUTINE FINDS THAT THERE ARE NO 00128000 * MORE PAGES TO BE HAD, AND THE REQUEST WHICH RESULTED 00129000 * IN THE STARTING OF THE REPLENISHMENT FUNCTION WAS FOR 00130000 * A CONDITIONAL CALL TO OBTAIN FREE STORAGE, THEN THE 00131000 * THE CPEXBLOK FOR THE CONDITIONAL CALL IS SEARCHED FOR 00132000 * ON THE 'FREEQ'. IF IT IS FOUND, IT IS FRETED AND 00133000 * A RETURN CODE EXIT IS MADE BACK TO DMKFRE. IF IT IS 00134000 * NOT FOUND, THEN IT IS ASSUMED THAT THERE WAS SUFFICIENT 00135000 * DELAYED PAGING ACTIVITY TO SATISFY THE REQUEST; 00136000 * DMKFRE SHOULD HAVE RECEIVED ITS PAGE, SO WE 'GOTO' 00137000 * THE DISPATCHER. 00138000 * 00139000 * FROM DMKPTRFR - ERROR - NONE 00140000 * 00141000 * FROM DMKPTRFT - NONE 00142000 * 00143000 * CALLS TO OTHER ROUTINES - 00144000 * 00145000 * DMKPAGIO - EXIT VIA GOTO TO INITIATE PAGE I/O 00146000 * DMKFREE - OBTAIN FREE STORAGE 00147000 * DMKFRET - RETURN FREE STORAGE 00148000 * DMKSTKCP - STACK DEFERED REQUESTS FOR EXECUTION 00149000 * DMKQCNWT - WRITE ERROR MESSAGE TO USERS 00150000 * DMKPGTPG - OBTAIN DASD SPACE FOR PAGE WRITES 00151000 * DMKDSPCH - EXIT VIA GOTO TO AWAIT INTERRUPTS 00152000 * DMKFRETR - MERGE EXTENDED FREE STORAGE PAGE INTO FREE LIST 00153000 * DMKCFMBK - TO PUT USER IN CONSOLE FUNCTION MODE 00154000 * DMKPTRFT - TO PUT A PAGE ON THE FREELIST 00155000 * DMKPGTPR - TO RELEASE AN OLD PAGE 00156000 * EXTERNAL REFERENCES - 00158000 * 00159000 * DMKPAGQ - QUEUE OF PENDING PAGING TASKS 00160000 * DMKSYSRM - SIZE OF THE REAL MACHINE 00161000 * DMKSCHN1 - NUMBER OF USERS CURRENTLY IN QUEUE1 00162000 * DMKSCHN2 - NUMBER OF USERS CURRENTLY IN QUEUE2 00163000 * DMKSYSOW - ADDRESS OF SYSTEM OWNED VOLUME LIST 00164000 * 00165000 * TABLES / WORKAREAS - 00166000 * 00167000 * CORTABLE - ONE ENTRY PER PAGE OF REAL MEMORY 00168000 * SWPTABLE - ONE ENTRY PER PAGE OF VIRTUAL MEMORY 00169000 * SEGTABLE - USED BY DAT FEATURE TO TRANSLATE VIRTUAL -> REAL 00170000 * PAGTABLE - USED BY DAT FEATURE TO TRANSLATE VIRTUAL -> REAL 00171000 * 00172000 * REGISTER USAGE - 00173000 * 00174000 * GPR0 = SCRATCH 00175000 * GPR1-3 USED TO MANIPULATE CORTABLE CHAIN POINTERS 00176000 * GPR4 = INCREMENT REGISTER - CONTAINS VALUE OF 1 00177000 * GPR5 = SWPTABLE ENTRY BASE 00178000 * GPR6 = SCRATCH 00179000 * GPR7 = CORTABLE ENTRY BASE 00180000 * GPR8 = SCRATCH 00181000 * GPR9 = PAGTABLE ENTRY BASE 00182000 * GPR10 = SECOND BASE REGISTER @V407594 00183000 * GPR11 = VMBLOK BASE 00184000 * GPR12 = DMKPTR BASE 00185000 * GPR13 = SAVEAREA BASE 00186000 * GPR14 = EXTERNAL LINKAGE 00187000 * GPR15 = EXTERNAL LINKAGE 00188000 * 00189000 * NOTES - 00190000 * 00191000 * DMKPTRAN IS GENERALLY CALLED VIA THE 'TRANS' MACRO, WHICH 00192000 * SETS UP THE NECESSARY PARMS IN GPR2, AND TESTS THE CONDITION 00193000 * CODES RETURNED TO THE CALLER 00194000 * 00195000 * OPERATION - 00196000 * 00197000 * THE OPERATION OF DMKPTRAN IS DESCRIBED IN SECTIONS A-D BELOW 00198000 * THE OPERATION OF DMKPTRFR IS DESCIRBED IN SECTION E 00199000 * THE OPERATION OF THE PAGE SELECTION ROUTINE 'SELECT' IS 00200000 * DESCRIBED IN SECTION F 00201000 * THE OPERATION OF DMKPTRFT IS DESCRIBED IN SECTION G 00202000 * THE OPERATION OF DMKPTRUL IS DESCRIBED IN SECTION H 00203000 * THE OPERATION OF DMKPTRLK IS DESCRIBED IN SECTION I 00204000 * THE OPERATION OF DMKPTRRS IS DESCRIBED IN SECTION J 00205000 * 00206000 *. 00207000 EJECT 00208000 COPY OPTIONS 00209000 COPY LOCAL OPTIONS @V306638 00210000 EJECT 00211000 DMKPTR CSECT 00212000 SPACE 3 00213000 EXTRN DMKSYSRM 00214000 EXTRN DMKDSPNP 00215000 EXTRN DMKDSPRQ @VA08037 00215100 EXTRN DMKSCHN1,DMKSCHN2 00216000 EXTRN DMKPAGIO @V200820 00217000 EXTRN DMKSTKCP 00218000 EXTRN DMKVMASH @V407594 00220000 EXTRN DMKSTKMP @V407594 00221000 EXTRN DMKSTKOP @V407594 00222000 EXTRN DMKFREAP @V407594 00223000 EXTRN DMKPAGQ 00224000 EXTRN DMKCFMBK 00225000 EXTRN DMKCVTAB,DMKBLDRT @V408246 00226000 EXTRN DMKFRETR 00227000 EXTRN DMKPGTPR 00228000 EXTRN DMKSYSOW 00229000 EXTRN DMKPGTPG 00230000 EXTRN DMKSCHDL 00231000 ENTRY DMKPTRAN 00232000 ENTRY DMKPTRU1 00233000 ENTRY DMKPTRCP @V408246 00234000 ENTRY DMKPTRFA 00235000 ENTRY DMKPTRF0,DMKPTRFC 00236000 ENTRY DMKPTRFN,DMKPTRF1 00237000 ENTRY DMKPTRXX @V408246 00238000 ENTRY DMKPTRCT,DMKPTRSS,DMKPTRPR @V408246 00239000 ENTRY DMKPTRSC SHARED PAGE COUNT @V408246 00240000 ENTRY DMKPTRFF @V408246 00241000 ENTRY DMKPTRRS @V408246 00242000 ENTRY DMKPTRRL 00243000 ENTRY DMKPTRFD,DMKPTRFP 00244000 ENTRY DMKPTRRU 00245000 ENTRY DMKPGSHR SHARE TABLE CHAIN ANCHOR @V408246 00246000 ENTRY DMKPTRRC 00247000 ENTRY DMKPTRFE 00248000 ENTRY DMKPTRRQ,DMKPTRWQ 00249000 ENTRY DMKPTRSW NO. OF PAGES BEING SWAPPED @V2B2638 00250000 ENTRY DMKPTRRF NO. PAGES EXAMINED DURING STEALS @V2B2638 00251000 ENTRY DMKPTRCS NO. COMP SCANS OF ULIST FOR STEAL@V2B2638 00252000 ENTRY DMKPTRPL,DMKPTRRM - FOR CP ASSIST @V386198 00253000 ENTRY DMKPTRSN @VA08341 00253100 ENTRY DMKPTRFQ @V408246 00254000 ENTRY DMKPTRP2 PAGES RECLAIMED FROM FLUSH LIST @VA07717 00254100 ENTRY DMKPTRUC FLUSHED PAGE COUNT @VA07810 00254200 SPACE 2 00255000 USING PSA,R0 00256000 USING CPEXBLOK,R1 00257000 USING SWPFLAG,R5 00258000 USING CORTABLE,R7 00259000 USING PAGCORE,R9 00260000 USING VMBLOK,R11 00261000 USING SAVEAREA,R13 00262000 SPACE 2 00263000 USING *,R12,R10 @V407594 00264000 EJECT 00265000 *. 00266000 * A. INITIAL ENTRY TO DMKPTRAN - 00267000 * 1. IF THE VIRTUAL ADDRESS IN GPR1 IS WITHIN THE USER'S VIRTUAL 00268000 * MEMORY, CONTINUE; OTHERWISE, RETURN CC 2 00269000 * 2. IF THE REQUESTED PAGE IS RESIDENT, GO SEE IF THE LOCK 00270000 * OPTION HAS BEEN REQUESTED (D, BELOW); OTHERWISE, CONTINUE 00271000 * 3. LOCATE THE PAGTABLE AND SWPTABLE ENTRIES FOR THE PAGE, 00272000 * AND TEST TO SEE IF IT IS IN TRANSIT 00273000 * 4. IF THE PAGE IS IN TRANSIT, SET UP TO WAIT FOR IT (B, BELOW) 00274000 * OTHERWISE, CONTINUE 00275000 * 5. TEST THE PAGTABLE ENTRY TO SEE IF THE PAGE HAS BEEN 00276000 * STOLEN FRON THE USER BUT IS STILL RESIDENT IN THE FLUSH 00277000 * OR FREE LISTS 00278000 * 6. IF THE PAGE IS NOT RESIDENT, GO ALLOCATE A NEW PAGE (C, 00279000 * BELOW); OTHERWISE, CONTINUE 00280000 * 7. RECLAIM THE PAGE FROM THE LIST AND RETURN IT TO THE USER AT 00281000 * STEP C.6 00282000 *. 00283000 SPACE 00284000 DMKPTRAN LA R1,0(,R1) STRIP HIGH BYTE - 24 BIT ADDRESSING ONLY 00285000 ST R1,SAVEWRK9 CLEAR PAGEIO ERROR SWITCH 00286000 ENTER 00287000 LR R10,R12 ESTABLISH SECOND BASE REGISTER @V407594 00288000 A R10,F4096 @V407594 00289000 LA R4,1 ESTABLISH GENRAL INCREMENT REGISTER 00290000 L R0,DMKPTRCT GET COUNT OF CALLS 00291000 ALR R0,R4 BUMP 00292000 ST R0,DMKPTRCT AND SAVE 00293000 RESTART EQU * HERE TO RESTART AFTER INTRANSIT PAGE IS IN 00294000 LR R2,R11 ADDRESS OF CALLER'S VMBLOK 00295000 TM SAVER2+3,SYSTEM CALL FOR SYSTEM V.M. SPACE ?? 00296000 BZ CKADDR NO -- R2 IS CORRECT 00297000 L R2,ASYSVM POINT TO SYSTEM VMBLOK 00298000 SPACE 00299000 CKADDR DS 0H VERIFY VIRTUAL ADDRESS 00300000 CL R1,VMSIZE-VMBLOK(,R2) IS ADDRESS WITHIN MEMORY SPACE 00301000 BL ADDROK YES -- 00302000 CLI FFS,X'00' SET CONDITION CODE 2 00303000 B EXIT AND LEAVE 00304000 ADDROK EQU * VIRTUAL ADDRESS IS VALID 00305000 LCTL C1,C1,VMSEG-VMBLOK(R2) GET SEGMENT TABLE ORIGIN 00306000 LRA R7,0(,R1) DO HARDWARE TRANSLATE 00307000 BNZ TESTSEG PAGE IS NOT RESIDENT - TEST FOR PAGE OR 00308000 * SEGMENT EXCEPTION 00309000 N R7,XPAGNUM CLEAR BYTE DISPLACEMENT 00310000 SRL R7,8 AND GET PAGE # TIMES 8 00311000 A R7,ACORETBL POINT TO CORTABLE ENTRY 00312000 L R9,CORPGPNT POINT TO PAGETABLE ENTRY 00313000 B TESTLOCK AND SEE IF LOCK IS REQUESTED 00314000 SPACE 2 00315000 TESTSEG DS 0H @V4M0167 00316000 BC 4+1,SEGEX CC=1,3 LET SEGEX HANDLE @V4M0167 00317000 EJECT 00318000 GETENTRY EQU * 00319000 LR R9,R7 SAVE ADDRESS OF PAGE TABLE ENTRY 00320000 N R1,=XL4'0000F000' CLEAR SEGMENT NUMBER AND DISPL. 00321000 SRL R1,11 GET PAGE NUMBER*2 00322000 SR R7,R1 POINT TO START OF PAGE TABLE 00323000 AIF (NOT &AP).NOAP1 **AIF*** 00323900 TM APSTAT1,APUOPER RUNNING AS AP @V407594 00324000 BZ GETENTR2 NO, BYPASS AFFINITY LOGIC @V407594 00325000 * FOR SHARED PAGE CALL PTR MUST RETURN TO CALLER @V407594 00326000 * ON THE ORIGINAL PROCESSOR @V407594 00327000 S R7,=F'16' BACK TO HEADER @V407594 00328000 ICM R3,B'0111',PAGSHR-PAGTABLE+1(R7) NAMED SYSTEM @V407594 00329000 BZ GETENTR1 NO @V407594 00330000 TM SHRFLAG-SHRTABLE(R3),SHRNOPRT UNPROTECTED @VA09281 00330100 * SHARED SYSTEM? 00330200 BO GETENTR1 YES, NO NEED TO SET UP PROCESSOR @VA09281 00330300 * AFFINITY SINCE THERE IS ONLY ONE 00330400 * SET OF PAGE/SWAP TABLES 00330500 ICM R3,B'1111',SHRSEGCT-SHRTABLE(R3) SHARED SYSTEM @V407594 00331000 BZ GETENTR1 NO @V407594 00332000 IC R3,LPUADDR+1 LOGICAL PROCESSOR ID @V407594 00333000 STC R3,SAVEPROC TO SAVE AREA @V407594 00334000 GETENTR1 LA R7,16(R7) R7 POINTS TO FIRST PTE @V407594 00335000 GETENTR2 DS 0H @V407594 00336000 .NOAP1 ANOP **ANOP** 00336100 SLL R1,2 GET PAGE NUMBER*8 00337000 LA R5,16*2+8(R1,R7) POINT TO SWAPTABLE ENTRY @V408246 00338000 TM SWPFLAG,SWPTRANS+SWPALLOC WAS THERE A PREVIOUS @V408246 00339000 * REQ? 00340000 BNZ INTRAN YES, ENQUEUE UNTIL COMPLETED @V408246 00341000 * PAGE IS NOT RESIDENT AND NOT IN TRANSIT 00342000 LH R7,PAGCORE GET PAGE TABLE ENTRY 00343000 N R7,=A(X'FFF0') IS THE PAGE STILL IN CORE ? 00344000 BZ READPAGE NO -- MUST GO FIND ANOTHER PAGE 00345000 AIF (NOT &VIRREAL).NOVR1 00346000 CL R11,AVMREAL IS REQUEST FOR VIRT=REAL USER 00347000 BNE PASSVR NO, PROCEED AS NORMAL 00348000 TM SAVER2+3,SYSTEM IS REQUEST FOR SYSTEM SPACE 00349000 BO PASSVR YES, WE ARE USING THE SYSTEM VMBLOK 00350000 A R7,ACORETBL POINT TO THE CORE-TABLE ENTRY 00351000 BAL R3,CKDEFER @V408246 00352000 B DOIO READ THE PAGE INTO STORAGE 00353000 PASSVR DS 0H CONNECTOR 00354000 .NOVR1 ANOP 00355000 A R7,ACORETBL POINT TO CORTABLE ENTRY 00356000 LM R2,R3,CORFPNT GET FORWARD AND BACKWARD CHAIN POINTERS 00357000 ST R2,CORFPNT-CORTABLE(,R3) UNCHAIN THE ENTRY 00358000 ST R3,CORBPNT-CORTABLE(,R2) -- 00359000 SR R2,R2 CLEAR . . @V408246 00360000 ST R2,CORBPNT . . BACK-POINTER @V408246 00361000 TM CORFLAG,CORFREE PAGE ON FREE OR USER LIST? @V408246 00362000 BZ CNTFLR FLUSH LIST PAGE @VA07717 00363100 L R0,DMKPTRPR INCREMENT @V408246 00364000 AR R0,R4 COUNT OF PAGE RECLAIMS @V408246 00365000 ST R0,DMKPTRPR @V408246 00366000 L R0,DMKPTRFN GET NUMBER OF FREE PAGES 00367000 SR R0,R4 DECREMENT FREE COUNT 00368000 ST R0,DMKPTRFN AND SAVE 00369000 BAL R8,SELECT REPLENISH F/L IF NEEDED @VA03893 00370000 L R5,CORSWPNT RESTORE SWAP TABLE ADDRESS @VA03893 00371000 B SETKEYS GO SET VIRTUAL STORAGE KEYS 00372000 CNTFLR L R0,DMKPTRP2 COUNT FLUSH LIST RECLAIMS @VA07717 00372100 AR R0,R4 @VA07717 00372120 ST R0,DMKPTRP2 @VA07717 00372140 L R0,DMKPTRUC FLUSHED PAGE COUNT @VA07810 00372145 SR R0,R4 LESS ONE @VA07810 00372148 BM AB20 CANNOT BE NEGATIVE @VA07810 00372151 ST R0,DMKPTRUC STORE NEW COUNT @VA07810 00372154 TM CORFLAG,CORSHARE SHARED PAGE @VA07717 00372160 BO CLEARID YES @VA07717 00372180 * GET SEGMENT'S OWNER TO DECREASE FLUSHED PAGE COUNT 00372200 SR R0,R0 @VA07717 00372220 IC R0,SWPVPAGE VIRTUAL PAGE NUMBER @VA07717 00372240 AR R0,R4 PLUS ONE FOR HEADER @VA07717 00372260 SLL R0,3 TIMES 8 FOR ENTRY LENGTH @VA07717 00372280 LR R6,R5 SWAP TABLE ENTRY @VA07717 00372300 SR R6,R0 BACK TO HEADER @VA07717 00372320 L R15,0(R6) GET SEGMENT'S OWNER (SWPVM) @VA07717 00372340 LH R0,VMFLPAG-VMBLOK(R15) FLUSHED PAGE COUNT @VA07717 00372360 SR R0,R4 MINUS ONE @VA07717 00372380 BM AB19 CANNOT BE NEGATIVE @VA07717 00372400 STH R0,VMFLPAG-VMBLOK(R15) @VA07717 00372420 B CLEARID RECLAIM PAGE @VA07717 00372440 AB19 ABEND 19 VMFLPAG IS NEGATIVE @VA07717 00372460 SPACE 1 00372480 AB20 ABEND 20 DMKPTRUC IS NEGATIVE @VA07810 00372500 EJECT 00373000 *. 00374000 * B. PROCESSING FOR IN-TRANSIT PAGES - 00375000 * 1. PLACE THE USER IN PAGE-WAIT, INCREMENTING THE WAIT COUNT 00376000 * 2. IF THE THE CALLER SPECIFIED 'DEFER', CONTINUE; OTHERWISE, 00377000 * STACK A CPEXBLOK FOR RETURN TO DMKPTRAN AND EXIT NOW 00378000 * 3. LOCATE THE CPEXBLOK FOR THE REAL PAGE INTO OR FROM 00379000 * WHICH THE VIRTUAL PAGE IS BEING MOVED 00380000 * 4. CONSTRUCT A CPEXBLOK AND QUEUE IT TO THE END OF THE CHAIN 00381000 * ANCHORED AT CPEXMISC 00382000 * 5. EXIT TO DMKDSPCH. WHEN THE PAGE I/O COMPLETES, THE 00383000 * CPEXBLOKS CHAINED TO THE CORTABLE ENTRY WILL BE UNSTACKED 00384000 * AND PROCESSING WILL RESUME 00385000 *. 00386000 SPACE 00387000 INTRAN EQU * HERE IF PAGE IS IN TRANSIT 00388000 NI VMDSTAT,255-VMDSP NO FAST REDSP @V408246 00389000 BAL R3,CKDEFER GO TEST FOR DEFERED RETURN 00390000 LA R0,CPEXSIZE GET CORE FOR 00391000 CALL DMKFREE A CPREQUEST BLOK 00392000 STM R9,R13,CPEXR9 SAVE THESE REGS ONLY ... 00393000 LA R14,TRANRETN SET UP RETURN TO EXECUTION ADDRESS 00394000 ST R14,CPEXADD AND SAVE 00395000 L R3,=A(DMKPAGQ) POINT TO QUEUE OF CPEXBLOKS FOR 00396000 LR R2,R3 IN-TRANSIT PAGES AND SAVE ITS ADDRESS 00397000 TM SWPFLAG,SWPALLOC ENQUEUED FOR ALLOCATION ?? 00398000 BZ FINDTASK NO -- WE HAVE CORRECT LIST 00399000 LA R3,FREEQ POINT TO ALLOCATION LIST 00400000 SR R2,R2 LIST CHAINED ONE-WAY 00401000 SPACE 00402000 FINDTASK L R3,CPEXFPNT-CPEXBLOK(,R3) POINT TO NEXT BLOK 00403000 CR R2,R3 END OF CHAIN 00404000 BE STAKIT YES -- TRANSIT BLOK ALREADY STICKED 00405000 C R9,CPEXR9-CPEXBLOK(,R3) TASK FOR OUR PAGE ?? 00406000 BNE FINDTASK NO -- KEEP LOOKING 00407000 SPACE 00408000 FINDEND L R2,CPEXMISC-CPEXBLOK(,R3) GET POINTER TO DEFERED TASKS 00409000 LTR R2,R2 ANY MORE ?? 00410000 BZ CHAINIT NO -- CHAIN NEW ONE 00411000 LR R3,R2 SAVE BACK POINTER 00412000 B FINDEND AND LOOK FOR END 00413000 SPACE 00414000 STAKIT EQU * HERE IF BLOK ALREADY STACKED 00415000 AIF (NOT &AP).NOAP2 **AIF*** 00415900 CLI SAVEPROC,0 PROCESSOR AFFINITY FOR THIS CALL @V407594 00416000 BE CALLSTK NO, STACK NORMALLY @V407594 00417000 CLC SAVEPROC,LPUADDR+1 YES- FOR THIS PROCESSOR @V407594 00418000 BNE STKOPP NO, STACK FOR OTHER PROCESSOR @V407594 00419000 CALL DMKSTKMP STACK FOR THIS PROCESSOR ONLY @V407594 00420000 B TRANXIT & EXIT @V407594 00421000 STKOPP CALL DMKSTKOP STACK FOR OTHER PROCESSOR ONLY @V407594 00422000 B TRANXIT AND EXIT @V407594 00423000 CALLSTK DS 0H STACK FOR EITHER PROCESSOR @V407594 00424000 .NOAP2 ANOP **ANOP** 00424100 CALL DMKSTKCP STACK NEW BLOK 00425000 B TRANXIT AND LEAVE 00426000 SPACE 00427000 CHAINIT ST R1,CPEXMISC-CPEXBLOK(,R3) CHAIN IN NEW TASK 00428000 ST R2,CPEXMISC AND CLEAR POINTER 00429000 AIF (NOT &AP).NOAP3 **AIF*** 00429900 IC R15,SAVEPROC LOAD AFFINITY (IF ANY) @V407594 00430000 STC R15,CPEXADD & STORE IN CPEXBLOK FOR DMKPAG @V407594 00431000 .NOAP3 ANOP **ANOP** 00431100 SPACE 00432000 TRANXIT GOTO DMKPAGIO START ANY WAITING FOR I/O @VA01491 00433000 SPACE 2 00434000 TRANRETN EQU * HERE WHEN PAGE IS NO LONGER IN TRANSIT 00435000 LA R4,1 RE-ESTABLISH INCREMENTER 00436000 BAL R3,CKWT CHECK WAIT COUNT @V408246 00437000 L R1,SAVER1 RESTORE VIRTUAL ADDRESS 00438000 B RESTART RESTART TRANSLATION PROCESS 00439000 EJECT 00440000 *. 00441000 * C. PROCESSING FOR NON-RESIDENT, NON-TRANSIT PAGES - 00442000 * 1. IF USER HAS SPECIFIED 'BRING', CONTINUE; OTHERWISE, SET 00443000 * CONDITION CODE 1 (PAGE NOT RESIDENT) AND EXIT 00444000 * 2. PLACE THE USER IN PAGE-WAIT, INCREMENTING THE WAIT COUNT 00445000 * 3. TEST FOR THE DEFERED RETURN OPTION AND HANDLE AS IN B.2 00446000 * 4. CALL DMKPTRFR (E, BELOW) TO OBTAIN A FREE PAGE TO ASSIGN 00447000 * TO THE USER 00448000 * 5. IF THE VIRTUAL PAGE HAS NEVER BEEN REFERENCED, CLEAR IT TO 00449000 * BINARY ZEROES AND GO TO STEP C.7 00450100 * 6. CALL DMKPAGIO TO READ THE PAGE FROM THE BACKING STORE, AND 00451000 * GO TO DMKDSPCH TO WAIT FOR IT 00452000 *. 00453000 SPACE 00454000 READPAGE EQU * HERE IF USER PAGE IS NOT RESIDENT 00455000 NI VMDSTAT,255-VMDSP NO FAST REDSP @V408246 00456000 TM SAVER2+3,BRING BRING ASKED ?? 00457000 BO SETWAIT YES -- USER MUST WAIT 00458000 ST R9,SAVER2 SAVE ADDRESS PAGETABLE ENTRY 00459000 CLI F0,X'FF' SET CC = 1 00460000 B EXIT AND LEAVE 00461000 SPACE 00462000 SETWAIT EQU * 00463000 CLI SWPDPAGE,0 HAS PAGE BEEN REFERENCED? @VA08184 00463100 BNE SETWAIT1 YES, CONTINUE NORMALLY @VA08184 00463150 TM SWPFLAG,SWPSHR IS THIS A SHARED PAGE? @VA08184 00463200 BZ SETWAIT1 NO, CONTINUE NORMALLY @VA08184 00463250 CLI FFS,X'00' SET CONDITION CODE 2 - SINCE THE @VA08184 00463300 * PAGE WAS NOT SAVED, IT CANNOT BE 00463350 * REFERENCED 00463400 B EXIT AND EXIT @VA08184 00463450 SPACE 00463500 SETWAIT1 DS 0H @VA08184 00463550 BAL R3,CKDEFER TEST FOR DEFERRED RETURN @V408246 00464000 OI SWPFLAG,SWPALLOC FREEZE PAGE FOR ALLOCATION @V408246 00465000 SR R2,R2 CLEAR PARM REGISTER 00466000 BAL R3,PAGFREE GO GET A FREE PAGE 00467000 NI SWPFLAG,X'FF'-SWPALLOC REMOVE ALLOCATION ENQUEUE FLAG 00468000 STCM R5,B'0111',CORSWPNT+1 SAVE SWPTABLE PNTR (AND @V408246 00469000 * CORFLAG 00470000 OI SWPFLAG,SWPTRANS @V408246 00471000 ST R9,CORPGPNT AND PAGTABLE ENTRY POINTER 00472000 CLI SWPDPAGE,0 RECORD NUMBER ZERO ?? 00473000 BNE DOIO NO -- PAGE MUST BE BROUGHT IN -- 00474000 SPACE 2 00475000 AIF (NOT &AP).NOAP4 **AIF*** 00475900 CLI SAVEPROC,0 PROCESSOR AFFINITY SPECIFIED @V407594 00476000 BE CLRPG NO @V407594 00477000 CLC SAVEPROC,LPUADDR+1 CORRECT PROCESSOR NOW @V407594 00478000 BE CLRPG YES, PROCEED @V407594 00479000 TM APSTAT1,PROCIO CURRENTLY ON MAIN PROCESSOR @V407594 00480000 BZ DOSWTCH NO- SWITCH FROM AP TO MAIN @V407594 00481000 SPACE 1 @V407594 00482000 ABEND 17 ERROR IN PROC'R AFFINITY LOGIC @V407594 00483000 SPACE 1 @V407594 00484000 DOSWTCH SWITCH SWITCH FROM AP TO MAIN @V407594 00485000 SPACE 1 @V407594 00486000 CLRPG DS 0H PROCESS ZEROES PAGE @V407594 00487000 .NOAP4 ANOP **ANOP** 00487100 STM R0,R3,BALRSAVE SAVE THESE REGISTER'S. @V408246 00488000 LR R0,R7 GET ADDRESS OF CORETABLE ENTRY @V408246 00489000 SL R0,ACORETBL GET PAGE ADDRESS /256. @V408246 00490000 SLL R0,8 GET REAL PAGE ADDRESS. @V408246 00491000 L R1,F4096 NUMBER OF BYTES TO CLEAR @V408246 00492000 SLR R2,R2 USE PAD CHARACTER OF ZERO @V408246 00493000 SLR R3,R3 ZERO BYTE COUNT FOR 2'ND OPERAND.@V408246 00494000 MVCL R0,R2 CLEAR ENTIRE PAGE TO BINARY @V408246 00495000 * ZEROES. 00496000 LM R0,R3,BALRSAVE RESTORE REG'S WE USED @V408246 00497000 B PAGEINA AND CONTINUE 00498000 SPACE 00499000 DOIO EQU * HERE TO SET UP FOR REAL PAGE READ 00500000 L R2,PGREAD BUMP TOTAL PAGE READS 00501000 AR R2,R4 -- 00502000 ST R2,PGREAD 00503000 L R2,VMPGREAD GET PAGE READ COUNT 00504000 AR R2,R4 BUMP BY ONE 00505000 ST R2,VMPGREAD AND SAVE 00506000 L R2,VMPGRINQ GET SUM OF RESIDENT PAGES AT EACH READ 00507000 AH R2,VMPAGES ADD CURRENT COUNT 00508000 LH R14,VMFLPAG LOAD FLUSHED PAGES @VA07717 00508100 AR R2,R14 FACTOR INTO NEXT VMWSPROJ @VA07717 00508150 ST R2,VMPGRINQ AND SAVE 00509000 AIF (NOT &AP).NOAP5 **AIF*** 00509900 TM APSTAT1,APUOPER RUNNING AS AP @V407594 00510000 BZ GETCPEX NO, DO PAGE READ @V407594 00511000 TM SWPFLAG,SWPSHR SHARED PAGE @V407594 00512000 BZ GETCPEX NO, DO PAGE READ @V407594 00513000 * IF OTHER PROCESSOR'S COPY OF SHARED PAGE IS RESIDENT @V407594 00514000 * WE CAN SUBSTITUTE AN MVCL FOR THE REAL PAGE I/O @V407594 00515000 SR R14,R14 @V407594 00516000 IC R14,SWPVPAGE LOAD VIRTUAL PAGE NUMBER @V407594 00517000 AR R14,R4 PLUS ONE FOR HEADER @V407594 00518000 SLL R14,3 TIMES 8 FOR ENTRY LENGTH @V407594 00519000 LR R15,R5 POINT TO SWAP TBL ENTRY @V407594 00520000 SR R15,R14 BACK TO HEADER @V407594 00521000 LR R14,R15 ADDRESS OF SWAP TABLE HEADER @VMI0019 00521100 S R14,=A(PAGTSWP) BACK UP TO PAGE TABLE HEADER @VMI0019 00521200 L R14,PAGSHR-PAGTABLE(R14) SHRTABLE ADDRESS @VMI0019 00521300 TM SHRFLAG-SHRTABLE(R14),SHRNOPRT UNPROTECTED @VMI0019 00521400 * SHARED SEGMENT? IF SO, ONLY ONE 00521500 * SET OF PG/SWP TABLES EXIST. 00521600 BO GETCPEX GO DO PAGE READ @VMI0019 00521700 TM SWPFLAG2-SWPTABLE(R15),SWPAPP 2ND SET OF TABLES?@V60B7AA 00522100 LA R15,PAGBMP(,R9) ASSUME IPL PROC'S PAGE--POINT TO@V60B7AA 00522600 * AP PTE 00523100 BZ COPYSHR PAGE OWNED BY IPL PROCESSOR @V60B7AA 00523600 S R15,=A(2*PAGBMP) AP PAGE;POINT TO IPL PROC'S PTE@V60B7AA 00524100 COPYSHR LH R14,0(R15) LOAD PTE OF DUPLICATE PAGE @V407594 00526000 N R14,=A(X'FFF0') PAGE FRAME ONLY @V407594 00527000 BZ GETCPEX PAGE NOT RESIDENT OR RECLAIMABLE @V407594 00528000 SLL R14,8 EXPAND TO REAL ADDRESS @V407594 00529000 LR R2,R7 CORETABLE ENTRY @V407594 00530000 SL R2,ACORETBL REAL ADDRESS/256 @V407594 00531000 SLL R2,8 REAL ADDRESS OF TARGET FRAME @V407594 00532000 L R15,F4096 LENGTH FOR MVCL @V407584 00533000 L R3,F4096 DITTO @V407594 00534000 MVCL R2,R14 COPY PAGE @V407594 00535000 * NOW INSURE SOURCE PAGE WAS NOT CHANGED BEFORE OR @V407594 00536000 * DURING MVCL @V407594 00537000 S R14,F4096 BACK TO BEGINNING OF PAGE @V407594 00538000 ISK R1,R14 STORAGE KEY FOR 1ST HALF OF PAGE @V407594 00539000 LA R14,2048(R14) INCREMENT TO 2ND HALF PAGE @V407594 00540000 SLL R1,8 SAVE KEY @V407594 00541000 ISK R1,R14 INSERT 2ND KEY @V407594 00542000 N R1,=A(X'0202') CLEAR ALL BUT CHANGE BITS @V407594 00543000 BNZ GETCPEX PAGE WAS CHANGED- DO PAGE READ @V407594 00544000 * CALL PAGE REPLENISHMENT IF NECESSARY @V407594 00545000 LM R14,R15,=A(DMKSCHN1,DMKSCHN2) IN-Q COUNTERS @V407594 00546000 L R14,0(R14) Q1 COUNT @V407594 00547000 L R15,0(R15) Q2 COUNT @V407594 00548000 LA R0,1(R14,R15) TOTAL COUNT+1 @V407594 00549000 SRA R0,1 DIVIDE BY 2 @V407594 00550000 C R0,DMKPTRFN MINIMUM PAGES AVAILABLE @V407594 00551000 BNH PAGEINA YES, PROCESS COPIED PAGE @V407594 00552000 BAL R8,SELECTA NO, REPLENISH FREE LIST @V407594 00553000 B PAGEINA 'PAGE READ' COMPLETE @V407594 00554000 .NOAP5 ANOP **ANOP** 00554100 GETCPEX DS 0H @V407594 00555000 LA R0,CPEXSIZE GET CORE FOR 00556000 CALL DMKFREE A CPREQUEST BLOK 00557000 LA R0,6 GET DASD READ DATA OP-CODE 00558000 STM R0,R15,CPEXR0 SAVE ALL REGS 00559000 LA R15,PAGEIN ADDRESS FOR RETURN TO EXECUTION 00560000 ST R15,CPEXADD SET RETURN TO EXECUTION ADDRESS 00561000 AIF (NOT &AP).NOAP6 **AIF*** 00561900 TM SAVER2+3,VFAULT CALLED FOR VIRTUAL PAGE FAULT @V400141 00562000 BO NOAFF YES- BYPASS PROCESSOR AFFINITY @V400141 00563000 IC R15,SAVEPROC LOAD AFFINITY (IF ANY) @V407594 00564000 STC R15,CPEXADD & PLACE IN CPEXBLOK FOR DMKPAG @V407594 00565000 NOAFF DS 0H @V400141 00566000 .NOAP6 ANOP **ANOP** 00566100 L R0,DMKPTRRQ PUSH DOWN PAGE 00567000 ST R1,DMKPTRRQ READ REQUEST 00568000 ST R0,CPEXFPNT STACK 00569000 BAL R8,SELECT REPLENISH FREE LIST IF NECESSARY @VA07693 00570100 B PTRFDISP GO GET I/O STARTED @V408246 00578000 EJECT 00579000 CKDEFER EQU * HERE TO TEST FOR IMMEDIATE RETURN TO CALLER 00580000 SPACE 00581000 TM SAVER2+3,DEFER DEFERED RETURN REQUESTED ? @V213135 00582000 BZ NOTDFERD NO -- PREPARE TO EXIT FORTHWITH @V213135 00583000 LH R2,VMWCNT GET PAGE WAIT COUNT 00584000 ALR R2,R4 UPDATE 00585000 STH R2,VMWCNT AND SAVE 00586000 OI VMRSTAT,VMPGWAIT FLAG USER IN PAGE WAIT 00587000 TM VMRSTAT,VMCPWAIT-VMPGWAIT ALREADY NOT RUNNABLE? @V408246 00588000 BCR 7,R3 YES, BYPASS SCHEDULE CALL @V408246 00589000 CALL DMKSCHDL INSURE THAT USER IS DROPPED FROM Q 00590000 BR R3 EXIT TO CALLER @V213135 00591000 SPACE 00592000 NOTDFERD EQU * HERE TO SET UP FOR NON-DEFERED @V213135 00593000 * RETURN 00594000 LH R2,VMNDCNT GET NON-DEFERRED PAGE READ COUNT @VA04283 00595000 ALR R2,R4 INCREMENT @VA04283 00596000 STH R2,VMNDCNT ...AND SAVE @VA04283 00597000 CLC SAVERETN,SAVER3 HAS RET ADDR BEEN PROCESSED? @VA04283 00598000 BER R3 IF SO, DON'T STACK ANOTHER BLOK @VA04283 00599000 LA R0,CPEXSIZE ... @V213135 00600000 CALL DMKFREE GET CORE FOR A CPREQUEST BLOK 00601000 STM R0,R15,CPEXR0 SAVE ALL REGISTERS 00602000 LA R3,TRANRETN RESTART FROM TOP @V408246 00603000 ST R3,CPEXADD AND RETURN TO EXECUTION ADDRESS 00604000 CALL DMKSTKCP STACK FOR DEFERED RETURN TO PAGTRANS 00605000 L R15,SAVERETN GET CALLER'S RETURN ADDRESS 00606000 L R12,SAVER12 AND BASE REGISTER 00607000 L R0,SAVER3 GET RETURN ADDRESS PASSED ON GPR3@V213135 00608000 ST R0,SAVERETN AND SAVE FOR EXIT WHEN PAGE @V213135 00609000 * COMES IN 00610000 LM R0,R11,SAVER0 GET CALLER'S REGS 00611000 L R13,SAVER13 -- 00612000 CLI ZEROES,X'FF' SET CC = 1 @V213135 00613000 BR R15 AND RETURN NOW 00614000 EJECT 00615000 *. 00616000 * 7. WHEN THE PAGE IS RESIDENT, DECREMENT THE WAIT COUNT, IF IT 00617100 * IS ZERO, REMOVE THE USER FROM PAGE-WAIT 00618000 * 8. SET THE STORAGE KEYS MAINTAINED IN THE SWPTABLE ENTRY INTO 00619100 * THE KEYS OF THE REAL PAGE, AND CONTINUE WITH LOCK OPTION 00620000 * PROCESSING AT D BELOW 00621000 *. 00622000 PAGEIN EQU * HERE AFTER PAGE IS IN CORE 00623000 ST R15,SAVEWRK9 SAVE PAGEIO ERROR SWITCH 00624000 PAGEINA DS 0H @V408246 00625000 BAL R3,CKWT CHECK WAIT COUNT @V408246 00626000 NI SWPFLAG,X'FF'-SWPTRANS RESET IN-TRANSIT FLAG @V408246 00627000 SETKEYS EQU * JOINED HERE FOR RE-CLAIMED PAGES 00628000 TM SWPFLAG,SWPRECMP READ-ONLY PAGE ? 00629000 BZ CLEARID NO @V408246 00630000 CLI SWPDPAGE,0 ZEROS PAGE? @V408246 00631000 BE CLEARID YES, DOESN'T NEED HELP IN SETTING@V408246 00632000 OI SWPFLAG,SWPCHG1 NO -FORCE SWAP TO HI-SPEED @V408246 00633000 CLEARID EQU * 00634000 OI SWPFLAG,SWPREF1 MARK REF'ED INITIALLY @V408246 00635000 NI CORFLAG,CORIOLCK+CORCFLCK RESET ALL BUT THESE @V408246 00636000 LR R6,R7 SAVE POINTER TO CORTABLE ENTRY 00637000 S R6,ACORETBL GET PAGE ADDRESS/256 00638000 SLL R6,8 GET PAGE ADDRESS 00639000 LA R8,2048(,R6) GET ADDRESS OF 2ND HALF PAGE 00640000 L R3,SWPFLAG GET USER'S KEYS IN LOW ORDER @V304735 00641000 N R3,=A(X'F8F8') CLEAR REF/CHANGE BITS @V304735 00642000 SSK R3,R8 SET KEY FOR 2'ND HALF PAGE @V304735 00643000 SRL R3,8 JUSTIFY KEY FOR 1'ST HALF PAGE @V304735 00644000 SSK R3,R6 SET KEY FOR 1'ST HALF PAGE @V304735 00645000 TM SWPFLAG,SWPSHR IS THIS A SHARED PAGE ? @V304735 00646000 BZ PAGEINB NO - NORMAL PATH @V304735 00647000 OI CORFLAG,CORSHARE FLAG CORTABLE ENTRY (SHARED) @V304735 00648000 L R15,DMKPTRSC GET SHARED PAGE COUNTER @V304735 00649000 LA R15,1(,R15) ADD ONE MORE TO IT @V304735 00650000 ST R15,DMKPTRSC SAVE NEW TOTAL @V304735 00651000 PAGEINB DS 0H @V408246 00652000 TM CORFLAG,CORCFLCK CONSOLE FUNCTION LOCK? @V408246 00653000 BO PAGEINC YES, BYPASS COUNT INCREMENT @V408246 00654000 LR R2,R11 SAVE ADDRESS OF VMBLOK @V408246 00655000 TM SAVER2+3,SYSTEM CALL FOR SYSTEM V.M. SPACE? @V408246 00656000 BZ *+8 NO @V408246 00657000 L R2,ASYSVM YES - USE SYSTEM'S VMBLOK @V408246 00658000 ST R2,CORFPNT CORE TABLE ENTRY POINTS TO VMBLOK@V408246 00659000 LH R0,VMPAGES-VMBLOK(,R2) INCREMENT @V408246 00660000 AR R0,R4 USER'S IN CORE PAGE COUNT @V408246 00661000 STH R0,VMPAGES-VMBLOK(,R2) @V408246 00662000 CH R0,VMXPG-VMBLOK(,R2) MAX. PAGES SO FAR? @V408246 00663000 BNH *+8 NO @V408246 00664000 STH R0,VMXPG-VMBLOK(,R2) YES, SET NEW MAX. @V408246 00665000 TM VMPSTAT-VMBLOK(R2),VMRPAGE RESERVE USER? (FOR @V408246 00666000 * R11=R2) 00667000 BZ PAGEINC NO -- NO SPECIAL TREATMENT 00668000 L R2,DMKPTRRC GET COUNT OF RESIDENT, RESERVED PAGES 00669000 ALR R2,R4 AND INCREMENT 00670000 CL R2,DMKPTRRL ABOVE HIGH WATER MARK ?? 00671000 BH PAGEINC YES -- THIS PAGE NOT RESERVED 00672000 ST R2,DMKPTRRC SAVE NEW COUNT 00673000 OI CORFLAG,CORRSV AND FLAG RESERVED PAGE 00674000 L R15,=A(DMKDSPNP) GET ADDRESS OF DYNAMIC PAGE COUNTER 00675000 L R2,0(,R15) GET NUMBER OF ASSIGNABLE PAGE FRAMES 00676000 SLR R2,R4 AND DECREMENT 00677000 ST R2,0(,R15) AND SAVE 00678000 PAGEINC EQU * 00679000 L R1,XPAGNUM CHECK THE VIRTUAL PAGE NUMBER @V408246 00680000 N R1,SAVER1 IS IT ZERO? @V408246 00681000 BNZ TESTLOCK NO, NO FURTHER PROCESSING @V408246 00682000 L R1,VMTIMER VALUE OF SAVED TIMER @V408246 00683000 ST R1,TIMER-PSA(R6) BRING VIRT. 80 UP TO DATE @V408246 00684000 TM VMTLEVEL,VMTON+VMRON VIRTUAL TIMERS RUNNING? @V408246 00685000 BZ TESTLOCK NO @V408246 00686000 TM VMMCR6,VMMVTMR VIRT TIMER ASSIST EN??? @V408246 00687000 BNO TESTLOCK NOPE... @V408246 00688000 ICM R15,B'0111',VMMADDR IS VMASSIST BEING USED???? @V408246 00689000 BZ TESTLOCK NOPE... @V408246 00690000 USING MICBLOK,R15 @V408246 00691000 LA R2,80(,R6) GET VIRT TIMER ADDR. @V408246 00692000 ST R2,MICVTMR SAVE IN VIRT MACH PTR LIST @V408246 00693000 DROP R15 @V408246 00694000 EJECT 00695000 *. 00696000 * D. PROCESSING LOCK OPTION AND EXIT FROM DMKPTRAN - 00697000 * 1. IF THE LOCK OPTION IS NOT SPECIFIED, GO TO STEP D.4; 00698000 * OTHERWISE, CONTINUE 00699000 * 2. IF THE PAGE IS ALREADY LOCKED, SKIP TO STEP D.3; OTHER- 00700000 * WISE, SET THE CORLOCK FLAG IN THE CORFLAG FIELD OF THE 00701000 * CORTABLE ENTRY. 00702000 * 3. ADD ONE TO THE LOCK COUNT IN THE CORTABLE ENTRY 00703000 * 4. SET THE REAL TRANSLATED ADDRESS IN THE CALLER'S GPR2, MAKE 00704000 * THE APPROPRIATE PAGTABLE ENTRY VALID, SET CC = 0, 00705000 * AND EXIT TO THE CALLER 00706000 *. 00707000 SPACE 00708000 TESTLOCK TM SAVER2+3,LOCK SHOULD PAGE BE LOCKED ?? 00709000 BZ GETRADD NO -- GO DEVELOP REAL ADDRESS 00710000 TM CORFLAG,CORIOLCK IS PAGE ALREADY LOCKED? @V408246 00711000 BZ SETLOCKA NO - LOCK IT AND UPDATE COUNT. @V408246 00712000 SETLOCK EQU * NOTE THAT GPR4 = 1 00713000 AL R4,CORLCNT UPDATE LOCK COUNT 00714000 SETLOCKA EQU * GPR4 NOW = TO LOCK COUNT 00715000 ST R4,CORLCNT .... 00716000 OI CORFLAG,CORIOLCK FLAG LOCKED PAGE 00717000 GETRADD DS 0H @V408246 00718000 LA R1,X'FFF' DISPLACEMENT MASK @V408246 00719000 N R1,SAVER1 GET VIRTUAL ADDRESS DISPLACEMENT @V408246 00720000 S R7,ACORETBL GET PAGE ADDRESS/256 00721000 STH R7,PAGCORE UPDATE PAGE TABLE 00722000 SLL R7,8 GET PAGE ADDRESS 00723000 AR R1,R7 FORM REAL ADDRESS IN R1 @V386198 00724000 SPACE 00725000 CLI SAVEWRK9,0 PAGE IN OK ?? 00726000 BNE PAGERROR NO -- 00727000 SPACE 00728000 ST R1,SAVER2 RETURN REAL ADDRESS IN GPR2 @V408246 00729000 EXITCC0 CLI F0,X'00' SET CC = 0 @V407466 00730000 EXIT LM R0,R11,SAVEREGS RESTORE REGS R0 THRU R11 @VM03012 00731000 LCTL C1,C1,VMSEG RESTORE CALLERS SEGMENT TABLE @VM03012 00732000 * ORIGIN 00733000 SVC 12 RETURN TO CALLER @VM03012 00734000 EXITRC LCR R9,R9 PLUS TO MINUS SETS CC = 1 @V407466 00735000 B EXIT EXIT TO RETURN CC=1 @V407466 00736000 EJECT 00737000 *. 00738000 * SEGMENT TABLE EXCEPTION HANDLER 00739000 * 00740000 * 1. BUILD PAGE TABLES AS REQUIRED, RETRY LRA 00741000 * 00742000 *. 00743000 SEGEX DS 0H SEGMENT EXCEPTIONS HERE @V408246 00744000 BC 1,ADDEX LENGTH VIOLATION, DOUBLE CHECK @V408246 00745000 ICM R5,B'0110',1(R7) TEST FOR VALID PTR @V408246 00746000 BZ SEGEXA NONE @V408246 00747000 NI 3(R7),255-SEGINV CLEAR INVALID FLAG @V408246 00748000 L R5,0(,R7) LOAD VALID POINTER @V408246 00749000 LA R5,0(,R5) CLEAR COUNT FIELD @V408246 00750000 S R5,F16 BACK-UP TO HEADER @V408246 00751000 USING PAGSTMP,R5 @V408246 00752000 STCK TEMPR2 STORE TOD CLOCK IN WORK AREA @V407594 00753000 MVC PAGSTMP,TEMPR2 & MOVE HIGH WORD TO PG TBL HDR @V407594 00754000 BC 3,DOWNWEGO CLOCK NOT FUNCTIONING @V408246 00755000 ICM R6,B'0111',PAGSHR+1 NAMED SYSTEM PNTR. @V408246 00756000 BZ SGXNS NOT NAMED @V408246 00757000 ICM R6,B'1111',SHRSEGCT-SHRTABLE(R6) SHARED? @V408246 00758000 BZ SGXNS NO @V408246 00759000 L R0,PAGACT LOAD COUNTS @V407594 00760000 AIF (NOT &AP).NOAP7 **AIF*** 00760900 TM APSTAT1,APUOPER RUNNING IN AP MODE @V407594 00761000 BO CSPGACT YES, USE COMPARE AND SWAP LOGIC @V407594 00762000 .NOAP7 ANOP **ANOP** 00762100 AL R0,=A(X'10000') INCREMENT ACTIVE COUNT @V407594 00763000 ST R0,PAGACT & REPLACE IN PG TBL HDR @V407594 00764000 AIF (NOT &AP).NOAP8 **AIF*** 00764900 B SGXNS @V407594 00765000 CSPGACT LR R14,R0 @V407594 00766000 AL R14,=A(X'10000') INCREMENT ACTIVE COUNT @V407594 00767000 CS R0,R14,PAGACT UPDATE ACTIVE COUNT @V407594 00768000 BC 4,CSPGACT UPDATE FAILED @V407594 00769000 .NOAP8 ANOP **ANOP** 00769100 SGXNS DS 0H @V407594 00770000 CLM R7,B'0111',VMSEG+1 FOR SEGMENT 0? @V408246 00771000 BNE ADDROK NO @V408246 00772000 LRA R15,0 PAGE 0 NOW AVAILABLE? @V408246 00773000 BNZ ADDROK NO @V408246 00774000 MVC TIMER-PSA(4,R15),VMTIMER YES, UPDATE VRT. 80 @V408246 00775000 TM VMMCR6,VMMVTMR IS TIMER ASSIST BEING USED? @V408246 00776000 BZ ADDROK NO @V408246 00777000 ICM R14,B'0111',VMMADDR VM ASSIST ON FOR USER? @V408246 00778000 BZ ADDROK NO @V408246 00779000 LA R0,TIMER-PSA(,R15) POINT TIMER ASSIST HERE... @V408246 00780000 ST R0,MICVTMR-MICBLOK(R14) @V408246 00781000 B ADDROK @V408246 00782000 * 00783000 SEGEXA DS 0H LET SEGTRANS HANDLE EXCEPTION @V408246 00784000 CL R1,VMSTOR-VMBLOK(R2) WITHIN PERMANENT MEMORY @V407594 00785000 BNL ADDEX NO- ADDRESSING EXCEPTION @V407594 00786000 STM R0,R2,SAVEWRK2 SAVE REGS ACROSS BAL @V408246 00787000 BAL R3,CKDEFER CHECK DEFER AND SET PAGEWAIT @V408246 00788000 LM R0,R2,SAVEWRK2 RESTORE AFTER RETURN @V408246 00789000 LR R2,R1 SAVE VIRTUAL ADDRESS @V408246 00790000 * THIS IS THE STANDARD CASE FOR AN INVALID SEGMENT 00791000 * PAGE AND SWAP TABLE HAVE NOT YET BEEN BUILT. 00792000 SRL R2,16 STE NO. @V408246 00793000 LR R1,R2 SEGMENT NUMBER IN GPR1 @V408246 00794000 AR R1,R4 STE NO. + 1 @V408246 00795000 SLL R1,16 ENDING SEGMENT ADDRESS + 1 @V408246 00796000 C R1,VMSTOR OVERSHOT VIRTUAL MACHINE MEMORY? @V408246 00797000 BNH *+8 NO, OK @V408246 00798000 L R1,VMSTOR YES, RESET TO MAX. @V408246 00799000 SRL R1,12 POSITION ENDING ADDRESS @V408246 00800000 BCTR R1,0 ORIGIN 0 COUNT @V408246 00801000 SLL R2,20 POSITION STARTING ADDRESS @V408246 00802000 ALR R1,R2 COMBINE STARTING AND ENDING @V408246 00803000 * ADDRESS 00804000 CALL DMKBLDRT,PARM=PAGTONLY+NEWPAGES @V408246 00805000 ST R2,0(R7) UPDATE STE W/CNT+PG TBL PTR @V408246 00806000 BAL R3,CKWT RESET PAGEWAIT @V408246 00807000 LM R0,R2,SAVEWRK2 RESTORE THEM AGAIN @V408246 00808000 B ADDROK @V408246 00809000 * 00810000 * ADDRESSSNG EXCEPTION, RETURN C.C. = 2 00811000 * 00812000 ADDEX DS 0H ADDRESSING EXCEPTION @V408246 00813000 CLI FFS,0 SET CONDITION CODE 2 @V408246 00814000 B EXIT AND LEAVE @V408246 00815000 * 00816000 DROP R5 @V408246 00817000 USING SWPFLAG,R5 @V408246 00818000 EJECT 00819000 PAGERROR EQU * HERE IF AN IOERROR OCCURED DURING PAGEING 00820000 LR R2,R7 GET REAL PAGE ADDRESS @V386198 00821000 L R3,F4096 LENGTH OF ONE PAGE FRAME .. 00822000 SLR R4,R4 DUMMY ADDRESS FOR MVCL 00823000 SLR R5,R5 LENGTH AND PADDING .. 00824000 MVCL R2,R4 CLEAR THE PAGE FRAME IN ERROR 00825000 SRL R7,8 PAGE NUMBER X 16 @VA07310 00825100 AL R7,ACORETBL BASE CORE TABLE ENTRY @VA07310 00825200 L R5,CORSWPNT PICK-UP SWAPTABLE ENTRY @V408246 00826000 TM SWPFLAG,SWPSHR SHARED PAGE @VA12685 00827050 BZ BADBKST NO, SKIP UNSHARE OF USER @VA12685 00827100 MVC PAGCORE,INVLPTE INVALIDATE PTE @VA12685 00827150 XC CORPGPNT(4),CORPGPNT CLEAR CORETBL PTE PTR @VA12685 00827200 SLR R0,R0 ... @VA12685 00827250 STCM R0,B'0111',CORSWPNT+1 CLR SWPTBL PTR IN CORETBL @VA12685 00827300 NI CORFLAG,255-CORSHARE CLEAR FLAGS @VA12685 00827350 CALL DMKPTRFT PLACE FRAME ON FREE LIST @VA12685 00827400 B HNDLERR ISSUE CP MSG OR RETURN TO USER @VA12685 00827450 SPACE 1 00827500 INVLPTE DC X'0008' INVALID PTE CONSTANT @VA12685 00827550 SPACE 1 00827600 BADBKST OI SWPFLAG,SWPRECMP BACKING STORE UNUSABLE @VA12685 00827650 XC SWPCYL(4),SWPCYL ZEROS PAGE @V408246 00828000 HNDLERR TM SAVER2+3,IOERETN USER WANT TO HANDLE ERROR ? @VA12685 00829500 ST R1,SAVER2 RETURN REAL ADDRESS IN GPR2 @V408246 00830000 BO SETCC3 YES -- JUST RETURN CC 00831000 SPACE 2 00832000 MSG 'DMKPTR410W CP ENTERED; PAGING ERROR' 00833000 CALL DMKQCNWT,PARM=NORET 00834000 CALL DMKCFMBK PUT USER IN CONSOLE FUNTION MODE @VA09005 00834500 SETCC3 TM FFS,X'FF' SET CC = 3 00835000 B EXIT AND EXIT TO CALLER 00836000 SPACE 2 00837000 CKWT EQU * TEST FOR NORMAL OR NON-DEFERED @V213135 00838000 * PAGE 00839000 TM SAVER2+3,DEFER WAS DEFER REQUESTED FOR THIS @V213135 00840000 * PAGE ? 00841000 BZ NOWAIT NO -- USER WAS NOT IN PAGEWAIT, @V213135 00842000 * THEN 00843000 SPACE 00844000 LH R2,VMWCNT GET WAIT COUNT @V213135 00845000 BCT R2,WTCOUNT DECREMENT AND TEST @VA01061 00846000 NI VMRSTAT,X'FF'-VMPGWAIT CLEAR WAIT FLAG. @VA01061 00847000 WTCOUNT STH R2,VMWCNT AND UPDATE NEW COUNT. @VA01061 00848000 TM VMRSTAT,VMCPWAIT STILL NOT RUNNABLE? @V408246 00849000 BCR 7,R3 YES, BYPASS SCHEDULE CALL @V408246 00850000 CALL DMKSCHDL NOTIFY SCHEDULE OF CHANGE OF @V408246 00851000 * STATUS 00852000 BR R3 AND RETURN @V213135 00853000 SPACE 00854000 NOWAIT EQU * HERE IF NEW PAGE WAS NON-DEFERED @V213135 00855000 LH R2,VMNDCNT GET NON-DEFERED COUNT @V213135 00856000 BCTR R2,R0 DECREMENT @V213135 00857000 STH R2,VMNDCNT AND SAVE @V213135 00858000 BR R3 AND RETURN 00859000 * 00860000 DOWNWEGO DS 0H CLOCK DAMAGED - ABEND CVT001 @V408246 00861000 GOTO DMKCVTAB @V408246 00862000 SPACE 1 @V407594 00863000 DROP R12,R10 @V407594 00864000 EJECT 00865000 *. 00866000 * E. DMKPTRFR - ALLOCATE REAL CORE PAGE FRAME 00867000 * 1. IF THE CALLER IS DMKFREE TRYING TO EXTEND SYSTEM FREE 00868000 * STORAGE, CONTINUE; OTHERWISE, SKIP TO STEP 6. 00869000 * 3. RETURN SPARE STORAGE SAVED FOR 'EXTEND' TO FREE STORAGE 00870000 * 4. IF NO PAGES ARE CURRENTLY ON THE FREE LIST OR IN TRANSIT 00871000 * OUT OF THE SYSTEM, CONTINUE; OTHERWISE, SKIP TO STEP 6. 00872000 * 5. OBTAIN A CPEXBLOK, AND SET ITS RETURN ADDRESS TO STEP 10. 00873000 * 6. BRANCH AND LINK TO TO THE PAGFREE SUBROUTINE TO GET A PAGE 00874000 * 7. IF THE PAGE OBTAINED IS NOT FOR FREE STORAGE, PASS THE 00875000 * ADDRESS OF THE CORTABLE ENTRY TO THE CALLER, AND SKIP TO 00876000 * STEP 9; OTHERWISE, CONTINUE 00877000 * 8. FLAG THE CORTABLE ENTRY AS A CP OWNED, FREE STORAGE PAGE, 00878000 * PLACE THE STORAGE OBTAINED INTO THE FREE LIST VIA A CALL 00879000 * TO DMKFRETR, AND RESET THE EXTEND LOCK. 00880000 * 9. BRANCH AND LINK TO THE SELECT SUBROUTINE TO REPLENISH THE 00881000 * FREE PAGE LIST, AND EXIT TO THE CALLER. 00882000 * 10. SCAN ALL OF THE AVAILABLE PAGEABLE STORAGE TO LOCATE A 00883000 * NON-CHANGED PAGE FRAME TO SATISFY THE REQUEST. IF A NON- 00884000 * CHANGED PAGE CAN BE FOUND, ENTER THE SELECT ROUTINE LOGIC 00885000 * AT LABEL 'EXTSRCH' WHERE A PAGE FRAME HAS ALREADY BEEN 00886000 * SELECTED. OTHERWISE ENTER THE SELECT ROUTINE AT THE 00887000 * BEGINNING. 00888000 *. 00889000 SPACE 00890000 ENTRY DMKPTRFR @VA08037 00891100 DMKPTRFR DS 0H @VA08037 00891200 USING *,R12 @VA08037 00891300 STM R0,R11,SAVEREGS @VA08037 00891400 SL R12,LABEL1 @VA08037 00891500 USING DMKPTR,R12 @VA08037 00891600 LR R10,R12 @VA08037 00891700 A R10,F4096 @VA08037 00891800 USING DMKPTR+4096,R10 @VA08037 00891900 B LABEL2 @VA08037 00892000 LABEL1 DC A(DMKPTRFR-DMKPTR) @VA08037 00892100 LABEL2 DS 0H @VA08037 00892200 LA R5,SAVEWRK6 LET R5 POINT TO A HARMLESS SCRATCH-AREA 00895000 * WORD (TO KEEP "OI" AT "SETALLOC" FROM 00896000 * CLOBBERING A RANDOM BYTE PER CALLER'S R5) 00897000 CL R2,F1 HIGH PRIORITY CALL FROM DMKFREE ?? 00898000 BE EXTEND YES, CONT (XTNDLOCK SET BY FRE) @V407466 00899000 CL R2,F2 HIGH PRIORITY CALL + RETURN CODE @V407466 00900000 BNE PAGEGET NO, CAN AFFORD TO WAIT FOR PAGE @V407466 00901000 * YES - CONTINUE (XTNDLOCK SET BY DMKFRE): 00902000 EXTEND SLR R0,R0 CLEAR LENGTH DW'S TO FRET @VM08952 00903000 IC R0,DMKPTRFA GET INTO R0 - LENGTH @VM08952 00904000 L R1,DMKPTRFA ADDRESS OF EXTEND BUFFER @VM08952 00905000 LA R1,0(,R1) CLEAR HI BYTE @VM08952 00906000 CALL DMKFRET RETURN IT TO FREE @VM08952 00907000 SLR R0,R0 INDICATE THAT THE EXTEND BUFFER @V407466 00908000 ST R0,DMKPTRFA HAS BEEN GIVEN OUT @V407466 00909000 LM R0,R1,DMKPTRFN GET NUMBER OF NOW AND FUTURE FREE PAGES 00910000 LTR R0,R0 ANY PAGES IMMEDIATELY AVAILABLE ? 00911000 BP PAGEGET YES -- GO GET ONE 00912000 LA R0,CPEXSIZE NO PAGE IN SIGHT -- DO IT THE HARD WAY 00913000 CALL DMKFREE GET A CPEXBLOK SO WE CAN RETURN 00914000 LA R15,DMKPTRFE GET RETURN ADDRESS TO EXTEND 00915000 STM R15,R13,CPEXADD AND SAVE IN CPEXBLOK 00916000 CALL DMKSTKCP STACK THE BLOK SO WE CAN RESTART 00917000 SIGNAL EXTEND,CONTROL=SERIAL ANNOUNCE EXTEND IN PROG @V407594 00918000 PAGEGET LA R4,1 ESTABLISH DMKPTR'S STANDARD INCREMENTER 00919000 BAL R3,PAGFREE AND GO TRY FOR A PAGE 00920000 SPACE 00921000 DMKPTRFP EQU * HERE AFTER WE HAVE OUR PAGE 00922000 CLC SAVER2,F1 WAS CALL FROM DMKFREE TO EXTEND ?@V304735 00923000 BE EXTPAGE YES - MERGE INTO 'FREE CHAIN' @V304735 00924000 CLC SAVER2,F2 WAS CALL FROM DMKFREE WITH RC @V407466 00925000 BE EXTPAGE YES, MERGE INTO FREE CHAIN @V407466 00926000 ST R7,SAVER7 PASS BACK THE CORTABLE ENTRY ADDRESS 00927000 ST R11,CORFPNT ASSIGN PAGE TO OWNER @V408246 00928000 B EXIT AND EXIT @V3M4026 00929000 SPACE 00930000 EXTPAGE EQU * HERE TO MERGE PAGE INTO FREE STORAGE CHAIN 00931000 MVC CORFPNT,=C'FREE' FIRST, FLAG THE CORTABLE ENTRY 00932000 MVI CORFLAG,CORCP AS A CP OWNED, FREE STORAGE PAGE 00933000 SL R7,ACORETBL GET DISPLACEMENT OF ENTRY INTO TABLE 00934000 SLL R7,8 GET REAL PAGE ADDRESS 00935000 LR R1,R7 INTO GPR1 FOR DMKFRET 00936000 SR R6,R6 SET KEY TO ZERO @VA02537 00937000 LA R5,2048(,R7) ADDRESS OF SECOND 2K @VA02537 00938000 SSK R6,R7 SET FIRST 2K @VA02537 00939000 SSK R6,R5 SET SECOND 2K @VA02537 00940000 LA R0,512 GET THE SIZE OF A PAGE IN DOUBLE WORDS 00941000 CALL DMKFRETR AND MERGE IT INTO THE CHAIN 00942000 LA R0,CPEXSIZE*8 GET ANOTHER LARGE BLOCK @V408246 00943000 CALL DMKFREE ... @VM08952 00944000 ST R1,DMKPTRFA SAVE THE NEW AREA GOTTEN @VM08952 00945000 STC R0,DMKPTRFA AND SAVE ITS LENGTH IN DBL WDS @V407594 00946000 TM APSTAT1,APUOPER RUNNING AS AP @V407594 00947000 BZ SKIPAP NO @V407594 00948000 L R4,=A(DMKFREAP) AP BACK POCKET @V407594 00949000 ICM R1,B'0111',1(R4) ACCESS AP BACK POCKET @V407594 00950000 BNZ SKIPAP REPLENISHMENT NOT REQUIRED @V407594 00951000 SR R0,R0 CLEAR REG @V407594 00952000 IC R0,0(R4) LOAD SIZE OF DMKFREAP (DBL WDS) @V407594 00953000 CALL DMKFREE GET STORAGE @V407594 00954000 STCM R1,B'0111',1(R4) SAVE ITS ADDRESS @V407594 00955000 LA R0,CPEXSIZE MUST GET CPEXBLOK TOO @VA12596 00955100 CALL DMKFREE @VA12596 00955300 ST R1,4(,R4) PUT CPEX POINTER IN DMKFREAP @VA12596 00955500 SKIPAP DS 0H @V407594 00956000 LA R0,CPEXSIZE GET CPEXBLOK @V408246 00957000 CALL DMKFREE @V408246 00958000 LA R15,PTRFDISP AMKE SURE WE WAKE-UP AFTER EXTEND@V408246 00959000 STM R15,R13,CPEXADD @V408246 00960000 CALL DMKSTKCP @V408246 00961000 CLC SAVER2,F2 DMKPTR CALLED WITH PARM = 2 @V407466 00962000 BE EXITCC0 YES, PAGE OBTAINED SUCCESSFULLY @V407466 00963000 B EXIT EXIT WITHOUT PAGE REPLENISHING @V3M4026 00964000 * (XTNDLOCK STILL SET - CLEARED BY DMKFRE) 00965000 EJECT 00966000 * 00967000 * SCAN IN-CORE PAGES FOR NON-CHANGED TO SATISFY EXTEND REQ. 00968000 * 00969000 DMKPTRFE DS 0H HEVE VIA CPEXBLOK TO SELECT PAGE @V408246 00970000 SR R0,R0 @V407594 00971000 ST R0,TEMPR0 CLEAR FLAGS @V407594 00972000 LA R8,SELDSPX GO DIRECTLY TO . . @V408246 00973000 ST R8,SAVEWRK8 . . DSP AFTER SELECT @V408246 00974000 LA R4,1 INCREMENTER (=1) @V408246 00975000 XC SAVEWRK1,SAVEWRK1 DON'T NEED ANYMORE PAGES @V408246 00976000 LA R3,TSTUSR LOOP BRANCH ADDRESS @V408246 00977000 LA R7,DMKPTRU1 CHAIN OF USER Q-DROP PAGES @V408246 00978000 LR R0,R7 SAVE ANCHOR @V408246 00979000 TSTUSR DS 0H @V408246 00980000 L R7,CORFPNT NEXT PAGE ON LIST @V408246 00981000 CR R7,R0 BACK AT THE START? @V408246 00982000 BE FLLSCN YES, SCAN ALL PAGES @V408246 00983000 LR R6,R7 GET PAGE'S REAL ADDRESS @V408246 00984000 SL R6,ACORETBL PAGE NO. * 16 @V408246 00985000 SLL R6,8 PAGE ADDRESS @V408246 00986000 B TESTCHG CHECK FOR CHANGED PAGE @V408246 00987000 * 00988000 * PART TWO OF SCAN IF NO UNCHANGED PAGES 00989000 * 00990000 FLLSCN DS 0H @V408246 00991000 LA R2,FULLSCAN ADDRESS OF FIRST SCAN BLOCK @VA08341 00991100 FLLSCN1 LA R3,CONTST BRANCH ADDRESS @VA08341 00992100 LM R6,R9,0(R2) LOAD TABLE VALUES FOR BXH SEARCH @VA08341 00993100 LTR R6,R6 TEST IF TABLES HAVE BEEN EXCEEDED@VA11926 00993400 BM SCNEND YES--BRANCH OUT @VA11926 00993700 L R1,F4096 CONSTANT TO DECREMENT PAGE ADDR @V407594 00994000 TSTFLAG TM CORFLAG,255-CORSHARE-CORRSV PICK ANY UNLOCKED @V408246 00995000 * PAGE 00996000 BZ TESTCHG YES, TEST CHANGED @V408246 00997000 CONTST SLR R6,R1 GET NEXT REAL PAGE ADDRESS @V407594 00998000 BXH R7,R8,TSTFLAG LET BXH GET NEXT CORETABLE ENTRY @V408246 00999000 LA R2,20(R2) INCREMENT TO NEXT BLOCK TO SCAN @VA08341 00999100 TM SCANFLAG,VEQRUNLK HAVE V=R PAGES BEEN UNLOCKED? @VA08341 00999200 BO FLLSCN1 YES, BRANCH TO TRY THOSE PAGES @VA08341 00999300 SCNEND DS 0H @VA11926 00999350 L R2,SAVER2 RESTORE CALLER'S REGISTER 2 @VA08341 00999400 SR R13,R13 GO DIRECTLY TO PAGIO AFTER SELECT@V408246 01000000 CL R2,F2 CONDITIONAL CALL FROM FREE @V407594 01001000 BNE USERPAGE NO, NORMAL EXTEND CALL @V407594 01002000 LR R13,R2 REMEMBER CONDITIONAL CALL @V407594 01003000 B USERPAGE NO NON-CHANGED PAGES, TAKE ANY @V408246 01004000 TESTCHG DS 0H @V408246 01005000 ICM R5,B'0111',CORSWPNT+1 GET SWAP TABLE ENTRY @V408246 01006000 * POINTER 01007000 BZ FRETIT NO POINTER, PAGE UNOWNED @V408246 01008000 TM SWPFLAG,SWPTRANS+SWPALLOC+SWPCHG1+SWPCHG2 @V408246 01009000 * AVAILABLE? 01010000 BCR 7,R3 NO, TRY NEXT PAGE @V408246 01011000 ISK R15,R6 GET STORAGE KEY @V408246 01012000 SLL R15,8 MAKE ROOM FOR 2ND HALF OF PAGE @V408246 01013000 LA R14,2048(,R6) ADDR FOR 2ND 2K @V408246 01014000 ISK R15,R14 GET OTHER STORAGE KEY @V408246 01015000 LA R14,SWPREF2*256+SWPREF2 GET CHANGE BIT MASK @V408246 01016000 NR R14,R15 WAS PAGE CHANGED? @V408246 01017000 BCR 7,R3 YES, LOOK FOR ANOTHER PAGE @V408246 01018000 TM CORFLAG,CORFLUSH USER FLUSH PAGE? @V408246 01019000 BNZ USERPGA YES @V408246 01020000 RRB 0(R6) MAKE SURE BITS RESET FOR SELECT. @V408246 01021000 BZ *+8 NO RE.F BIT TO BACK-UP @V408246 01022000 OI SWPKEY1,4 VIRT. BACK-UP KEY @V408246 01023000 RRB 2048(R6) . . @V408246 01024000 BZ *+8 NO REF. BIT TO BACK-UP @V408246 01025000 OI SWPKEY2,4 VIRT. BACK-UP KEY @V408246 01026000 * R14 SET UP TO REFLECT NON-CHANGED PAGE 01027000 OI TESTFLG+1,CORRSV SET FOR AP LOOKASIDE MAINT @V407594 01028000 B EXTSRCH PUT PAGE ON FREELIST @V408246 01029000 SPACE 1 @V407594 01030000 PTR7A LA R0,2 CHECK VALUE FOR PTRFR CALL PARM=2@V407594 01031000 CL R13,F2 CONDITIONAL FREE CALL @V4M0192 01032000 BNE PTR7 NO, ABEND @V4M0192 01033000 LA R1,FREEQ ADDR OF THE HEAD OF THE QUEUE @V407594 01034000 LA R5,DMKPTRFP RETURN ADDR FOR OUR REQUEST @V407594 01035000 NEXTREQ LR R4,R1 SAVE PREV REQUEST BLOK ADDRESS @V407594 01036000 L R1,CPEXFPNT-CPEXBLOK(R4) GET THE NEXT REQUEST @V407594 01037000 LTR R1,R1 IS THERE ONE? @V407594 01038000 BNZ REQLOOP YES, GO CHECK IT OUT @V407594 01039000 PTR6A GOTO DMKDSPCH NO DEF REQ, PGE MUST'VE BEEN FND @V407594 01040000 SPACE 3 @V407594 01041000 REQLOOP CL R0,CPEXR2 THIS A DMKFRERC CALL TO EXTEND? @V407594 01042000 BNE PTR6A NOPE, MUST HAVE BEEN STACKED @V407594 01043000 L R13,CPEXR13 RECLAIM SAVE AREA @V407594 01044000 L R2,CPEXFPNT GET PTR TO NEXT DEFERED REQUEST @V407594 01045000 ST R2,CPEXFPNT-CPEXBLOK(R4) STORE IN PREVIOUS @V407594 01046000 LA R0,CPEXSIZE SIZE OF BLOCK @V407594 01047000 CALL DMKFRET DEF. REQ. WILL NEVER BE SATISFIED@V407594 01048000 LA R0,CPEXSIZE*16 SIZE OF EXTEND BUFFER @V407594 01049000 CALL DMKFREE RE-OBTAIN EXTEND BUFFER @V407594 01050000 ST R1,DMKPTRFA SAVE THE BUFFER ADDRESS @V407594 01051000 STC R0,DMKPTRFA AND THE SIZE OF THE BUFFER TOO @V407594 01052000 B EXITRC GO TELL USER: NO MORE STORAGE @V407594 01053000 SPACE 01054000 EJECT 01055000 *. 01056000 * 11. COUNT THE CALLS TO PAGFREE; THEN, DECREMENT AND TEST THE 01057000 * NUMBER OF FREE PAGES AVAILABLE. IF A PAGE IS AVAILABLE, 01058000 * SKIP TO STEP 12; OTHERWISE, CHAIN A CPEXBLOK TO THE QUEUE 01059000 * OF TASKS WAITING FOR PAGES AND EXIT TO DISPATCH. 01060000 *. 01061000 SPACE 01062000 PAGFREE EQU * ENTRY FROM WITHIN DMKPTRAN 01063000 L R0,DMKPTRFC COUNT NUMBER OF CALLS 01064000 ALR R0,R4 -- 01065000 ST R0,DMKPTRFC -- 01066000 SPACE 01067000 L R0,DMKPTRFN GET FREE PAGE COUNTER 01068000 SR R0,R4 DECREMENT @V408246 01069000 BNM GETFREE SOMETHING TO GIVE OUT @V408246 01070000 SPACE 01071000 L R0,DMKPTRF0 COUNT NUMBER OF TIMES WE WERE OUT 01072000 AR R0,R4 OF FREE PAGES TO ASSIGN 01073000 ST R0,DMKPTRF0 -- 01074000 SPACE 01075000 LA R0,CPEXSIZE GET CORE FOR A CPREQUEST BLOK 01076000 CALL DMKFREE 01077000 STM R2,R13,CPEXR2 SAVE REGISTERS 01078000 LR R6,R3 AND RETURN ADDRESS 01079000 LA R2,FREEQ POINT TO QUEUE OF DEFERED REQUESTS 01080000 CL R4,CPEXR2 CALL BY FREE TO EXTEND ?? 01081000 BE SETFIRST YUP, MAKE REQ FIRST ON CHAIN @V407466 01082000 CLC CPEXR2,F2 RETURN CODE CALL FOR EXTEND @V407594 01083000 BNE NEXTQ NO, ADD TO END OF CHAIN @V407594 01084000 SETFIRST L R3,FREEQ CHAIN REQ AHEAD OF ALL OTHERS @V407466 01085000 B QREQUEST -- 01086000 SPACE 01087000 NEXTQ L R3,CPEXFPNT-CPEXBLOK(,R2) GET POINTER TO NEXT BLOK 01088000 LTR R3,R3 ARE THERE ANY ?? 01089000 BZ QREQUEST 01090000 LR R2,R3 SAVE PREVIOUS POINTER 01091000 B NEXTQ AND KEEP LOOKING 01092000 SPACE 2 01093000 QREQUEST ST R1,CPEXFPNT-CPEXBLOK(,R2) CHAIN NEW REQUEST TO END 01094000 SR R5,R5 ZERO TASK CHAIN 01095000 STM R3,R6,CPEXFPNT SET FORWARD POINTER, TASK CHAIN TO 0, 01096000 * AND SAVE EXECUTION ADDRESS 01097000 SPACE 01098000 L R15,PREFIXA ACCESS ABSOLUTE PSA @V407594 01099000 CLI XTNDLOCK-PSA(R15),0 SYSTEM EXTENDING @V407594 01100000 BNE SELDSPX YES -- UNSTACK DMKPTRFE BLOCK @V408246 01101000 LM R14,R15,=A(DMKSCHN1,DMKSCHN2) GET POINTERS TO @V408246 01102000 * Q COUNTS 01103000 L R14,0(,R14) NO. IN Q1 @V408246 01104000 L R15,0(,R15) NO. IN Q2 @V408246 01105000 LA R0,1(R14,R15) 1 + (Q1 + Q2) COUNT @V408246 01106000 ST R0,SAVEWRK1 AND SAVE @V408246 01107000 LA R8,PTRFDISP RETURN @V408246 01108000 ST R8,SAVEWRK8 @V408246 01109000 B USERPAGE FORCE SELECT TO OBTAIN 1 MORE @V408246 01110000 EJECT 01111000 *. 01112000 * 12. IF A FREE PAGE IS AVAIALBLE, UNCHAIN THE CORTABLE ENTRY 01113000 * FROM THE FREELIST, AND, IF THE PAGTABLE POINTER IN THE 01114000 * ENTRY IS VALID, ZERO OUT THE OLD OWNER'S PAGTABLE ENTRY 01115000 * 13. EXIT TO THE CALLER, PASSING BACK THE CORTABLE ENTRY 01116000 * ADDRESS IN GPR7 01117000 *. 01118000 SPACE 01119000 GETFREE EQU * 01120000 ST R0,DMKPTRFN SAVE NEW VALUE. @VA01767 01121000 LR R15,R2 SAVE PARM REGISTER 01122000 L R7,DMKPTRF1 POINT TO FIRST ENTRY ON LIST 01123000 LM R1,R2,CORFPNT GET FORWARD AND BACK CHAIN POINTERS 01124000 ST R1,CORFPNT-CORTABLE(,R2) UNCHAIN THE 01125000 ST R2,CORBPNT-CORTABLE(,R1) CORTABLE ENTRY 01126000 L R1,CORPGPNT GET POINTER TO OWNER'S PAGTABLE ENTRY 01127000 LTR R1,R1 IS IT VALID ?? 01128000 BZ FREEXIT NO -- OK TO LEAVE NOW 01129000 TM 1(R1),PAGINVAL TRY TO CATCH CULPRIT 01130000 BO PTR8A OK 01131000 ABEND 8 GOTCHA 01132000 PTR8A EQU * 01133000 MVI 0(R1),0 SET PAGE TABLE ENTRY -> 0, 01134000 NI 1(R1),PAGINVAL+PAGREF RETAINING THESE FLAGS 01135000 SLR R1,R1 CLEAR OUT 01136000 ST R1,CORPGPNT PTE POINTER 01137000 FREEXIT MVI CORFLAG,CORCP PAGE NOW BELONGS TO CP @VA05378 01138000 LR R2,R15 RESTORE PARM REG @VA05378 01139000 ST R1,CORBPNT ... @V408246 01140000 STCM R1,B'0111',CORSWPNT+1 AND SWAP POINTER @V408246 01141000 BR R3 AND RETURN TO CALLER 01142000 EJECT 01143000 *. 01144000 * F. OPERATION OF THE PAGE SELECTION ROUTINE - 01145000 * 1. IF THERE IS AN ENTRY ON THE FLUSHED PAGE LIST, UNCHAIN IT 01146000 * AND GO TO STEP F.8; OTHERWISE, CONTINUE 01147000 * 2. SEARCH ALL OF AVAILABLE PAGEABLE STORAGE ( IF V=R 01148100 * AREA IS UNLOCKED THEN IT WILL BECOME PAGEABLE 01148600 * STORAGE ) FOR A PAGE WITH THE HARDWARE 'REFERENCED' 01149100 * BITS = 0 01149600 * 3. IF ONE OR BOTH OF THE 'REFERENCED' BITS ARE SET TO ONE, 01150000 * RESET THEM AND CONTINUE SEARCHING PAGEABLE STORAGE 01151000 * 4. IF STORAGE IS EXHAUSTED BEFORE AN UNREFERENCED PAGE IS 01152000 * FOUND, RESTART AT THE TOP OF STORAGE. 01153000 * 5. AFTER AN UNREFERENCED PAGE IS FOUND, SAVE A POINTER TO 01154000 * THE CORTABLE ENTRY FOR THE NEXT REAL PAGE FOR THE SELECT 01155000 * PROCESS TO RESUME AT NEXT TIME. 01156000 * 6. TEST TO SEE IF THE SELECTED PAGE BELONGS TO AN IN-QUEUE 01157000 * VIRTUAL MACHINE; IF SO INCREMENT BOTH THE SYSTEM'S AND THE 01158000 * VIRTUAL MACHINE'S PAGE STEAL COUNT. 01159000 * 7. TEST TO SEE IF THE SELECTED PAGE HAS BEEN CHANGED; IF IT 01160000 * HAS NOT BEEN CHANGED, CALL DMKPTRFT (G, BELOW) TO PLACE IT 01161000 * ON THE FREE LIST AND EXIT; OTHERWISE, CONTINUE 01162000 * 8. IF THE RECOMPUTE FLAG IS SET IN THE SWPTABLE ENTRY, CALL 01163000 * DMKPGTPG TO OBTAIN THE ADDRESS OF A DASD PAGE SLOT IN 01164000 * WHICH TO WRITE THE PAGE; OTHERWISE, CONTINUE 01165000 * 9. BUMP THE PENDING SWAP COUNT, AND CALL DMKPAGIO TO SCHEDULE 01166000 * THE PAGE WRITE; THEN EXIT TO THE CALLER 01167000 * 10. WHEN THE PAGE HAS BEEN WRITTEN, DECREMENT THE PENDING SWAP 01168000 * COUNT AND CALL DMKPTRFT (G, BELOW) TO PLACE IT ON THE FREE 01169000 * LIST 01170000 SPACE 01171000 SELECT DS 0H @V408246 01172000 LM R14,R15,=A(DMKSCHN1,DMKSCHN2) GET POINTERS TO Q 01173000 L R14,0(,R14) COUNTS 01174000 L R15,0(,R15) ... 01175000 SELECTA DS 0H @V408246 01176000 STM R2,R9,SAVEWRK2 SAVE REGS @V408246 01177000 LA R0,1(R14,R15) GET NUMBER IN Q1 + Q2 + 1 01178000 ST R0,SAVEWRK1 AND SAVE FOR LATER. @V408246 01179000 SELECT1 EQU * MAIN PAGE REPLENISHMENT LOGIC 01180000 L R15,PREFIXA ACCESS ABSOLUTE PSA @V407594 01181000 CLI XTNDLOCK-PSA(R15),0 SYSTEM EXTENDING @V407594 01182000 BNE SELEXIT YES -- DO NOT SWAP OUT 01183000 LM R0,R1,DMKPTRFN GET NUMBER OF NOW AND FUTURE FREE PAGES 01184000 AR R0,R1 GET SUM 01185000 C R0,SAVEWRK1 COMPARE TO MINUMUM @V408246 01186000 BNL SELEXIT 'NUF ALREADY 01187000 EJECT 01188000 USERPAGE DS 0H CHECK DEFERED WRITE LIST FIRST @V408246 01189000 L R7,DMKPTRU1 PICK UP FORWARD PTR @V408246 01190000 LA R6,DMKPTRU1 ADDRESS OF ANCHOR LIST @V408246 01191000 CLR R6,R7 ANY ENTRIES? @V408246 01192000 BE SELPAG NO, SCAN CORETBL @V408246 01193000 USERPGA DS 0H @V408246 01194000 ICM R9,B'0111',CORPGPNT+1 GET PTE POINTER @V408246 01195000 BNZ PTR14A @V408246 01196000 ABEND 15 @V408246 01197000 PTR14A DS 0H @V408246 01198000 LM R1,R2,CORFPNT PICK UP F AND B PTRS @V408246 01199000 ST R1,CORFPNT-CORTABLE(,R2) UNCHAIN THE @V408246 01200000 ST R2,CORBPNT-CORTABLE(,R1) CORETABLE ENTRY @V408246 01201000 L R0,DMKPTRFF INCREMENT @V408246 01202000 ALR R0,R4 COUNT OF PAGES MOVED FROM FLUSH @V408246 01203000 ST R0,DMKPTRFF @V408246 01204000 * CORFLUSH BIT IS ON FOR USER LIST PAGES 01205000 L R5,CORSWPNT SWAP TABLE POINTER @V408246 01206000 LA R15,0(,R5) GET SWP TBL PTR FOR VMBLOK @V408246 01207000 SR R2,R2 CLEAR @V408246 01208000 IC R2,SWPVPAGE GET VIRTUAL PAGE NUMBER @V408246 01209000 AR R2,R4 GET VMBLOK PTR @V408246 01210000 SLL R2,3 DISPL. BACK TO VMBLOK PTR @V408246 01211000 SR R15,R2 ADDR. OF VMBLOK PTR @V408246 01212000 L R15,0(,R15) GET VMBLOK PTR @V408246 01213000 ST R15,CORFPNT SAVE FOR LOADING VMBLOK @V408246 01214000 SR R14,R14 CLEAR . . @V408246 01215000 ST R14,CORBPNT . . BACK CHAIN POINTER @V408246 01216000 LR R6,R7 CORE TABLE ENTRY @V408246 01217000 S R6,ACORETBL REAL PAGE NO. * 16 @V408246 01218000 SLL R6,8 REAL PAGE ADDRESS @V408246 01219000 SR R0,R0 @V407594 01220000 ST R0,TEMPR0 CLEAR FLAG BYTES @V407594 01221000 L R0,DMKPTRUC FLUSHED PAGE COUNT @VA07810 01221050 SR R0,R4 LESS ONE @VA07810 01221055 BM AB20 CANNOT BE NEGATIVE @VA07810 01221060 ST R0,DMKPTRUC STORE NEW COUNT @VA07810 01221065 TM CORFLAG,CORSHARE SHARED PAGE @VA07717 01221100 BO CKBKUP YES @VA07717 01221150 LH R0,VMFLPAG-VMBLOK(R15) FLUSHED PAGE COUNT @VA07717 01221200 SR R0,R4 MINUS ONE @VA07717 01221250 BM AB19 ABEND IF NEGATIVE @VA07717 01221300 STH R0,VMFLPAG-VMBLOK(R15) @VA07717 01221350 B CKBKUP CHECK CP BACK-UP CHANGE BIT @V408246 01222000 EJECT 01223000 * 01224000 * SELECT NON-REFERNCED PAGE FROM AMOUNT PAGES BELONGING TO 01225000 * IN-QUEUE TASKS 01226000 * 01227000 SELPAG DS 0H SELECT NON-REFERENCED PAGE @V408246 01228000 AIF (NOT &AP).NOAP21 **AIF*** 01228900 SR R2,R2 @V407594 01229000 ST R2,TEMPR0 CLEAR FLAGS @V407594 01230000 .NOAP21 ANOP **ANOP** 01230100 MVI TESTFLG+1,255-CORSHARE SET-UP FOR INITIAL PASS @V408246 01231000 TM VMPSTAT,VMRPAGE RESERVED PAGE VMBLOK? @V408246 01232000 BZ SELPAGA NO @V408246 01233000 CLC DMKPTRRC,DMKPTRRL RESERVED PAGES AT LIMIT? @V408246 01234000 BL SELPAGA NO @V407594 01235000 XI TESTFLG+1,CORRSV YES, SEARCH FOR ANY @V408246 01236000 B TSTQSCE QUIESCE OPP PROC'R IF REQUIRED @V407594 01237000 SELPAGA DS 0H @V408246 01238000 NI SCANFLAG,255-PASSTWO INITIALIZE FLAG TO 1ST PASS@VA08341 01238100 MVC SCANSTRT(2),SCANBLOK STARTING SCAN AT THIS @VA08341 01238150 * BLOCK OF FRAMES 01238200 LA R1,CURPNT LOAD ADDR OF INDEX TO CORETABLE @VA08341 01238250 LM R6,R9,CURPNT LOAD ALL NEEDED REGISTERS @V407594 01239000 L R2,F4096 VALUE TO DECREMENT PAGE ADDRESS @V407594 01240000 CNOP 0,8 ALIGN FOR PERFORMANCE @V408246 01242000 TESTFLG1 L R15,DMKPTRRF LOAD COUNT OF STEAL REFS @VA07751 01243000 LA R15,1(R15) BUMP 1 @VA07751 01243500 ST R15,DMKPTRRF PUT IT BACK @VA07751 01244000 TESTFLG TM CORFLAG,255-CORSHARE PAGE AVAILABLE ? @VA07751 01244500 BZ TESTRRB YES @V408246 01245000 NONZERO SLR R6,R2 GET NEXT REAL PAGE ADDRESS @V407594 01246000 BXH R7,R8,TESTFLG1 LET BXLE CALC. NEXT ENTRY @VA07751 01247100 LA R6,TOPPNT LOAD ADDRESS FOR LAST PART OF @VA08341 01251100 * COMPLETE SCAN 01251150 CR R6,R1 DID WE JUST SCAN THIS TOP PART? @VA08341 01251200 BNE NEXTBLOK NO--WE ARE NOT DONE YET @VA08341 01251250 LA R1,20(R1) ADDRESS OF 'FENCE' @VA08341 01251300 B PASSONE GO LOAD NEXT SET OF POINTERS @VA08341 01251350 NEXTBLOK LH R6,SCANBLOK BLOCK OF FRAMES WE ARE SCANNING @VA08341 01251400 BCTR R6,0 MOVE ON TO NEXT LOWER BLOCK @VA08341 01251450 C R6,F1 ARE WE NOW POINTING TO BLOCK 1? @VA08341 01251500 BH TSTSTART NO--TEST TO SEE IF WE ARE BACK @VA08341 01251550 * WHERE WE BEGAN THE SCAN 01251600 BL SETBLKNO AT BLOCK '0'--SET TO HIGH BLOCK @VA08341 01251650 TM SCANFLAG,VEQRUNLK AT BLOCK 1--HAS V=R AREA BEEN @VA08341 01251700 * UNLOCKED? 01251750 BO TSTSTART YES. OK TO SCAN THIS BLOCK. @VA08341 01251800 SETBLKNO LA R6,1 VALUE TO INCREMENT @VA08341 01251850 AL R6,DMKPTRCS COUNT OF CORE TABLE WRAPS @VA08341 01251900 ST R6,DMKPTRCS UPDATE COUNTER @VA08341 01251950 LH R6,SCANNUM UPDATE BLOCK POINTER TO TOP BLOCK@VA08341 01252000 TSTSTART STH R6,SCANBLOK UPDATE CURRENT BLOCK POINTER @VA08341 01252050 CH R6,SCANNUM ARE WE SCANNING TOP BLOCK? @VA08341 01252100 BNE CALCSTRT IF NOT, CALCULATE FULLSCAN PTR. @VA08341 01252150 LA R1,FULLSCAN START AT FULLSCAN OF TOP BLOCK @VA08341 01252200 B TST2 TEST FOR END OF FIRST PASS @VA08341 01252250 CALCSTRT LH R15,SCANNUM NUMBER OF FRAME BLOCKS TO SCAN @VA08341 01252300 SR R15,R6 SUBTRACT CURRENT BLOCK NUMBER @VA08341 01252350 SR R14,R14 GET READY FOR MULTIPLY @VA08341 01252400 M R14,F20 20 BYTES FOR EACH FULLSCAN ENTRY @VA08341 01252450 LA R1,FULLSCAN(R15) POINT TO CURRENT FULLSCAN ENTRY@VA08341 01252500 TST2 CH R6,SCANSTRT IS THIS THE BLOCK WE STARTED THE @VA08341 01252550 * SCAN ON? 01252600 BNE PASSONE NO--STILL ON THE FIRST PASS @VA08341 01252650 TM SCANFLAG,PASSTWO HAVE WE COMPLETED TWO PASSES? @VA08341 01252700 BO DOTOP YES--DO TOP SCAN @VA08341 01252750 OI SCANFLAG,PASSTWO INDICATE NOW ON 2ND FULL PASS @VA08341 01252800 PASSONE LM R6,R9,0(R1) LOAD NEXT SET OF POINTERS @VA08341 01252850 LTR R6,R6 TEST IF TABLES HAVE BEEN EXCEEDED@V408246 01253000 BP TESTFLG1 LOOK AGAIN THRU THE LIST @VA07751 01254100 XI TESTFLG+1,CORRSV ALLOW SELECTION OF RESERVED @V408246 01255000 TM TESTFLG+1,CORRSV BEEN AROUND ONCE ALREADY? @V408246 01256000 BO PTR7A YES, ABEND @V407594 01257000 TSTQSCE TM APSTAT1,APUOPER RUNNING IN AP MODE @V407594 01258000 AIF (NOT &AP).NOAP9 **AIF*** 01258100 BZ SELPAGA NO @V407594 01259000 L R15,PREFIXA LOAD PREFIX VALUE @V407594 01260000 CLI XTNDLOCK-PSA(R15),0 SYSTEM EXTENDING @V407594 01261000 BNE SELPAGA YES, BYPASS QUIESCE @V407594 01262000 SIGNAL QUIESCE,CONTROL=SERIAL QUIESCE OTHER PROC'R @V407594 01263000 MVI TEMPR0+1,OPPRSTRT MUST RESTART OTHER PROC'R @V407594 01264000 .NOAP9 ANOP **ANOP** 01264100 B SELPAGA MAY NOW SELECT ANY AVAILABLE PG @V407594 01265000 SPACE 01265100 DOTOP LA R1,TOPPNT LOAD ADDRESS FOR LAST PART OF @VA08341 01265150 * COMPLETE SCAN 01265200 B PASSONE GO LOAD NEXT SET OF POINTERS @VA08341 01265250 SPACE 01265300 ABEND 7 SO- VERY-SORRY (NO PAGES) @V408246 01266000 CNOP 0,8 ALIGN FOR PERF. @V408246 01267000 TESTRRB DS 0H @V408246 01268000 ICM R5,B'0111',CORSWPNT+1 SWAP TABLE ENTRY POINTER @V408246 01269000 BZ FRETIT NONE, PAGE IMMEDIATELY AVAILABLE @V408246 01270000 TM SWPFLAG,SWPTRANS+SWPALLOC IS A REQUEST AVAIL. @V408246 01271000 BNZ NONZERO IF SO WE CAN'T USE IT. @V408246 01272000 AIF (NOT &AP).NOAP10 **AIF*** 01272900 MVI TEMPR0,0 CLEAR FLAG BYTE @V407594 01273000 TM APSTAT1,APUOPER RUNNING AS AP @V407594 01274000 BZ DORRB NO @V407594 01275000 TM TESTFLG+1,CORRSV PHASE ONE @V407594 01276000 BZ DORRB NO, ISSUE RRB @V4M0172 01277000 TM CORFLAG,CORSHARE SHARED PAGE @V407594 01278000 BO DOSHRRRB YES, DO RRB @V407594 01279000 L R15,CORVM LOAD VMBLOK ADDR @V407594 01280000 CL R15,ASYSVM SYSTEM PAGE @V407594 01281000 BE DORRB YES, DO RRB @V407594 01282000 LH R14,LPUADDR LOAD LOGICAL PROC'R ADDR @V407594 01283000 CLM R14,B'0011',VMLOCK+2-VMBLOK(R15) VM ALREADY @V407594 01284000 * LOCKED BY THIS PROCESSOR @V407594 01285000 BE DORRB YES,DO RRB @V407594 01286000 LR R14,R1 SAVE R1 ACROSS LOCK MACRO @V407594 01287000 LR R1,R15 VMBLOK ADDR @V407594 01288000 LOCK OBTAIN,TYPE=VMBLOK,OPTION=NOUPDT,SPIN=NO,SAVE @V407594 01289000 LR R1,R14 RESTORE R1 @V407594 01290000 BC 4,NOLOCK LOCK FAILED @V407594 01291000 MVI TEMPR0,UNLKVM MUST UNLOCK VMBLOK @V407594 01292000 MVI TEMPR0+1,0 CLEAR FLAGS @V407594 01293000 B DORRB RESET REFERENCE BITS @V407594 01294000 DOSHRRRB MVI TEMPR0,RRBSHR PROCESSING SHARED PAGE @V407594 01295000 B DORRB RESET REFERENCE BITS @V407594 01296000 NOLOCK L R15,CORVM GET VMBLOK ADDR @V407594 01297000 TM VMOSTAT-VMBLOK(R15),VMSHR RUNNING SHARED SYSTEM @V407594 01298000 BZ NONZERO NO, BYPASS PAGE FRAME @V407594 01299000 MVI TEMPR0,NOSTEAL REMEMBER CANNOT STEAL PAGE @V407594 01300000 .NOAP10 ANOP **ANOP** 01300100 DORRB DS 0H @V407594 01301000 RRB 0(R6) TEST 1'ST HALF OF PAGE. @V408246 01302000 BC 8+4,TSTRRB2 RESET 2ND KEY @V408246 01303000 OI SWPKEY1,4 REF. BIT TO VIRT. BACK-UP KEY @V408246 01304000 RRB 2048(R6) CLEAR 2ND KEY @V408246 01305000 BC 8+4,STKEY2+4 NO SET, PAGE NOT SELECTED @V408246 01306000 STKEY2 DS 0H @V408246 01307000 OI SWPKEY2,4 REF. BIT TO VIRT. BACK-UP KEY @V408246 01308000 NI SWPFLAG,255-SWPREF1-SWPREF2 RESET CP REF. BITS @V408246 01309000 AIF (NOT &AP).NOAP11 **AIF*** 01309900 TM TEMPR0,UNLKVM DID WE LOCK VMBLOK @V407594 01310000 BZ NONZERO NO, ACCESS NEXT PAGE @V407594 01311000 LR R14,R1 SAVE R1 ACROSS LOCK MACRO @V407594 01312000 L R1,CORVM GET VMBLOK ADDRESS @V407594 01313000 LOCK RELEASE,TYPE=VMBLOK,SAVE UNLOCK VMBLOK @V407594 01314000 LR R1,R14 RESTORE R1 @V407594 01315000 .NOAP11 ANOP **ANOP** 01315100 B NONZERO PAGE NOT SELECTED @V408246 01316000 TSTRRB2 DS 0D 1ST KEY 0, CHECK 2ND KEY @V408246 01317000 BALR R14,0 SAVE C.C. FOR CHANGE TEST @V408246 01318000 RRB 2048(R6) CLEAR 2ND KEY @V408246 01319000 BC 2+1,STKEY2 REF. BIT ON, PAGE NOT AVAILABLE @V408246 01320000 BALR R15,R0 CHANGE C.C. @V408246 01321000 TM SWPFLAG,SWPREF1+SWPREF2 CHECK BACK-UP BITS @V408246 01322000 BNZ STKEY2+4 PAGE REF'ED DON'T SELECT @V408246 01323000 OR R14,R15 SAVE FOR CHANGED PAGE TEST @VA09279 01323100 AIF (NOT &AP).NOAP12 **AIF*** 01323900 TM TEMPR0,NOSTEAL CAN WE SELECT PAGE @V407594 01324000 BO NONZERO NO, ACCESS NEXT PAGE FRAME @V407594 01325000 TM TEMPR0,RRBSHR SHARED PG, AP MODE, PHASE 1 @V407594 01326000 BZ STEALSHR NO, STEAL PAGE @V407594 01327000 SLR R0,R0 DETERMINE PROC'R OWNERSHIP OF PG @V407594 01328000 IC R0,SWPVPAGE LOAD VIRTUAL PAGE NUMBER @V407594 01329000 ALR R0,R4 PLUS 1 FOR HEADER @V407594 01330000 SLL R0,3 TIMES 8 FOR ENTRY LENGTH @V407594 01331000 LR R3,R5 PT TO SWAP TBL ENTRY @V407594 01332000 SLR R3,R0 PT TO SWAP TBL HDR @V407594 01333000 LR R15,R3 SWAP TABLE HEADER @VA09279 01333100 S R15,=A(PAGTSWP) BACK UP TO PAGE TABLE HEADER @VA09279 01333150 L R15,PAGSHR-PAGTABLE(R15) ADDRESS OF SHARETABLE @VA09279 01333200 TM SHRFLAG-SHRTABLE(R15),SHRNOPRT IS SHARED PAGE @VA09279 01333250 * UNPROTECTED? 01333300 BO STEALSHR YES--OK TO STEAL IT @VA09279 01333350 * IF PROTECTED SHARED PAGE, DETERMINE IF FRAME IS 01333400 * OWNED BY THIS PROCESSOR 01333450 TM SWPFLAG2-SWPTABLE(R3),SWPAPP 2ND SET OF TABLES? @V60B7AA 01334100 BO SHPGAP YES @V407594 01335000 TM APSTAT1,PROCIPL IS THIS THE MAIN (IPL) PROC? @V60B7AA 01336100 BO STEALSHR YES, STEAL PAGE @V407594 01337000 B NONZERO ON AP, PG OWNED BY MAIN PROC'R @V407594 01338000 SHPGAP TM APSTAT1,PROCIPL IS THIS NON-IPL PROCESSOR? @V60B7AA 01339100 BO NONZERO NO- ON MAIN PROC'R, AP PAGE @V407594 01340000 STEALSHR DS 0H @V407594 01341000 .NOAP12 ANOP **ANOP** 01341100 TM CORFLAG,CORSHARE SHARED PAGE? @VA09279 01342150 BZ STEALSH1 NO, STEAL IT @VA09279 01342175 SPM R14 CHECK FOR CHANGED SHARED PAGE @VA09279 01342200 BC 8+2,STEALSH1 IF UNCHANGED, STEAL IT @VA09279 01342225 * CHECK TO SEE IF CHANGED SHARED PAGE IS UNPROTECTED 01342250 SLR R0,R0 ZERO REG FOR INSERT @VA09279 01342275 IC R0,SWPVPAGE VIRTUAL PAGE NUMBER @VA09279 01342300 ALR R0,R4 ADD ONE FOR SWAP TABLE HEADER @VA09279 01342325 SLL R0,3 MULTIPLY BY 8 FOR ENTRY LENGTH @VA09279 01342350 LR R15,R5 SWAP TABLE ENTRY ADDRESS @VA09279 01342375 SLR R15,R0 POINT TO SWAP TABLE HEADER @VA09279 01342400 S R15,=A(PAGTSWP) ADDRESS OF PAGE TABLE HEADER @VA09279 01342425 L R15,PAGSHR-PAGTABLE(R15) SHARETABLE ADDRESS @VA09279 01342450 TM SHRFLAG-SHRTABLE(R15),SHRNOPRT IS SHARED PAGE @VA09279 01342475 * UNPROTECTED? 01342500 BZ NONZERO DON'T STEAL PROTECTED SHARED PAGE@VA09279 01342525 * IF UNPROTECTED, STEAL EVEN IF @VA09279 01342550 * CHANGED 01342575 STEALSH1 DS 0H @VA09279 01342600 LR R0,R6 SAVE REAL STORAGE ADDRESS @V408246 01343000 LR R1,R7 SAVE CURRENT CORETABLE ENTRY @V408246 01344000 SLR R0,R2 DECREMENT REAL ADDR BY ONE PAGE @V407594 01345000 AR R1,R8 DECREMENT CURRENT CORETABLE @V408246 01346000 STM R0,R1,CURPNT SAVE THE 'NEW' CURRENT POINTER @V408246 01347000 ST R1,TOPPNT+12 ALSO SAVE IT HERE. @V408246 01348000 CLC SCANBLOK(2),SCANSTRT IS FRAME IN THE CURRENT @VA08341 01348100 * BLOCK? 01348150 BE EXTSRCH YES--OTHER POINTERS ARE OK @VA08341 01348200 LH R0,SCANBLOK POINTER TO CURRENT BLOK OF FRAMES@VA08341 01348250 LH R1,SCANNUM NO. OF BLOCKS AVAILABLE TO SCAN @VA08341 01348300 SR R1,R0 START TO CALCULATE CURRENT @VA08341 01348350 * BLOCK'S FULLSCAN ENTRY 01348400 SR R0,R0 GET READY FOR MULTIPLY @VA08341 01348450 M R0,F20 20 BYTES PER FULLSCAN ENTRY @VA08341 01348500 LA R1,FULLSCAN(R1) CURRENT BLOCK'S FULLSCAN ENTRY @VA08341 01348550 MVC CURPNT+12(4),12(R1) UPDATE CURPNT ADDRESSES @VA08341 01348600 MVC TOPPNT(8),0(R1) UPDATE TOPPNT ADDRESSES @VA08341 01348650 EXTSRCH DS 0H @V408246 01349000 DROP R11 @V408246 01350000 AIF (NOT &AP).NOAP12A **AIF*** 01350025 TM APSTAT1,APUOPER IN AP MODE? @VA09279 01350040 BZ STEALSH2 NO, BYPASS UNPROTECTED CHECK @VA09279 01350055 TM CORFLAG,CORSHARE SHARED PAGE? @VA09279 01350070 BZ STEALSH2 NO -- NO NEED FOR QUIESCE @VA09279 01350085 SLR R0,R0 @VA09279 01350100 IC R0,SWPVPAGE GET PAGE NUMBER @VA09279 01350115 SLL R0,1 MULTIPLY BY 2 FOR PTE SIZE @VA09279 01350130 L R1,CORPGPNT PAGE TABLE ENTRY ADDRESS @VA09279 01350145 SLR R1,R0 BACK UP TO START OF PAGE TABLE @VA09279 01350160 SL R1,F16 BACK UP TO PAGE TABLE HEADER @VA09279 01350175 L R1,PAGSHR-PAGTABLE(,R1) GET SHRTABLE ADDRESS @VA09279 01350190 TM SHRFLAG-SHRTABLE(R1),SHRNOPRT UNPROTECTED? @VA09279 01350205 BZ STEALSH2 NO -- NO QUIESCE NECESSARY @VA09279 01350220 L R1,PREFIXA ACCESS ABSOLUTE PSA @VA09279 01350235 CLI XTNDLOCK-PSA(R1),0 SYSTEM EXTENDING? @VA09279 01350250 BNE STEALSH2 YES--BYPASS QUIESCE @VA09279 01350265 TM TEMPR0+1,OPPRSTRT HAS OTHER PROCESSOR ALREADY @VA09279 01350280 * BEEN QUIESCED? 01350295 BO SETPTLB YES -- CONTINUE @VA09279 01350310 LR R9,R14 SAVE R14 CONTENTS @VA09279 01350325 SIGNAL QUIESCE,CONTROL=SERIAL @VA09279 01350340 LR R14,R9 SAVE FOR CHANGED PAGE TEST @VA09279 01350355 MVI TEMPR0+1,OPPRSTRT REMEMBER TO RESUME OTHER PROC.@VA09279 01350370 SETPTLB TM TESTFLG+1,CORRSV PHASE ONE? @VA09279 01350385 BO OTHRPTLB IF PHASE ONE, TELL OTHER PROC @VA09279 01350400 * TO DO PTLB. THIS PROC. WILL BE 01350415 * MARKED FOR PTLB AT OWNSHR. 01350430 * HERE IF NOT PHASE 1 01350445 TM APSTAT1,PROCIPL IS THIS THE MAIN (IPL) PROC? @V60B7AA 01350465 BO OTHRPTLB YES -- TELL OTHER PROC TO PTLB @VA09279 01350475 OI APSTAT2,CPPTLBR THIS PROC MUST PURGE TLB @VA09279 01350490 B STEALSH2 CONTINUE WITH STEAL @VA09279 01350505 OTHRPTLB L R1,PREFIXB ADDRESS OF OTHER PSA @VA09279 01350520 OI APSTAT2-PSA(R1),CPPTLBR TELL OTHER PROC TO PTLB @V60B7AA 01350540 STEALSH2 DS 0H @VA09279 01350550 .NOAP12A ANOP **ANOP** 01350565 L R15,CORFPNT PAGES OWNER @V408246 01351000 USING VMBLOK,R15 @V408246 01352000 L R9,CORPGPNT PICK-UP PTE POINTER @V408246 01353000 TM VMDSTAT,VMINQ VMBLOK IN-QUEUE? @V408246 01354000 BZ PNTSTL NO @V408246 01355000 L R0,DMKPTRSS YES, INCREMENT @V408246 01356000 ALR R0,R4 TOTAL SYSTEM STEAL COUNT @V408246 01357000 ST R0,DMKPTRSS @V408246 01358000 LH R0,VMSTEALS INCREMENT ALSO @V408246 01359000 ALR R0,R4 INDIVIDUAL STEAL COUNT @V408246 01360000 STH R0,VMSTEALS @V408246 01361000 OI PAGCORE+1,PAGREF NON-RESIDENT PAGE WAS TOUCHED @V408246 01362000 PNTSTL DS 0H @V408246 01363000 TM CORFLAG,CORSHARE SHARED PAGE FRAME? @V408246 01364000 BZ CKPG0 NO, SAVE TIMER IN CASE PAGE 0 @V408246 01365000 L R2,DMKPTRSC DECREMENT @V408246 01366000 SR R2,R4 RESIDENT SHARED PAGE COUNT @V408246 01367000 ST R2,DMKPTRSC @V408246 01368000 AIF (NOT &AP).NOAP13 **AIF*** 01368900 TM APSTAT1,APUOPER RUNNING AS AP @V407594 01369000 BZ OWNSHR NO, INVALIDATE LOOKASIDE BUFFER @V407594 01370000 TM TESTFLG+1,CORRSV PHASE ONE @V407594 01371000 BO OWNSHR YES, WE MUST OWN PAGE @V4M0172 01372000 * EITHER PHASE 2 OR DMKPTRFE SELECTED FLUSH LIST PAGE @V407594 01373000 * DETERMINE WHICH PROCESSOR OWNS SHARED PAGE AND @V407594 01374000 * INVALIDATE PROPER LOOKASIDE BUFFER @V407594 01375000 SR R0,R0 @V407594 01376000 IC R0,SWPVPAGE VIRTUAL PAGE NUMBER @V407594 01377000 AR R0,R4 PLUS ONE @V407594 01378000 SLL R0,3 TIMES 8 @V407594 01379000 LR R2,R5 SWAP TBL ENTRY @V407594 01380000 SR R2,R0 PT TO SWPTBL HEADER @V407594 01381000 TM SWPFLAG2-SWPTABLE(R2),SWPAPP 2ND SET OF TABLES? @V60B7AA 01382100 BO PURAP YES @V407594 01383000 TM APSTAT1,PROCIPL IS THIS THE MAIN (IPL) PROC? @V60B7AA 01384100 BO OWNSHR ON CPU- CPU PAGE @V407594 01385000 OTHSHR L R2,PREFIXB PURGE OTHER LOOKASIDE BUFFER @V407594 01386000 OI APSTAT2-PSA(R2),CPPTLBR SET PTLB REQUIRED @V407594 01387000 L R2,RUNUSER-PSA(R2) ACCESS RUNUSER FOR OTHER @VA08621 01387100 * PROCESSOR 01387200 NI VMDSTAT-VMBLOK(R2),X'FF'-VMDSP NO FAST DISPATCH @VA08621 01387300 * NOW THE OTHER PROCESSOR SHOULD BE QUIESCED AT THIS TIME 01387400 B CKRSV CHECK FOR RESERVED PG @V407594 01388000 PURAP DS 0H PAGE OWNED BY AP @V407594 01389000 TM APSTAT1,PROCIPL MAIN (IPL) PROCESSOR? @V60B7AA 01390100 BO OTHSHR ON CPU- AP PAGE @V407594 01391000 .NOAP13 ANOP **ANOP** 01391100 OWNSHR OI APSTAT2,CPPTLBR SET PTLB REQUIRED @V407594 01392000 CLC RUNUSER,ASYSVM IS RUNUSER SYSTEM @VA08621 01392100 BE CKRSV YES, BRANCH @VA08621 01392150 TM APSTAT1,APUOPER RUNNING AS AP @VA08621 01392200 BZ RESETDSP NO @VA08621 01392250 CLC RUNUSER,LASTUSER RUNUSER STILL LOCKED @VA08621 01392300 BE RESETDSP YES, OK TO RESET VMDSP @VA08621 01392350 NI APSTAT2,X'FF'-CPPTLBR RESET PTLB REQUIRED @VA08621 01392400 PTLB DO IT NOW @VA08621 01392450 B CKRSV @VA08621 01392500 RESETDSP DS 0H @VA08621 01392550 L R2,RUNUSER NO FAST REDISPATCH FOR HIM @VA08621 01392600 NI VMDSTAT-VMBLOK(R2),X'FF'-VMDSP @VA08621 01392650 B CKRSV CHECK FOR RESERVED PAGE @V408246 01393000 CKPG0 DS 0H @V408246 01394000 CL R15,ASYSVM IS THIS SYSTEM PAGE (NON-SHARED) @V407594 01395000 BE CKRSV YES, BYPASS PTLB & PG ZERO LOGIC @V407594 01396000 OI VMESTAT,VMINVPAG INVALIDATE SHADOW TABLES @V408246 01397000 OI APSTAT2,CPPTLBR SET PTLB REQUIRED FOR THIS PROC@RV407594 01398000 AIF (NOT &AP).NOAP14 **AIF*** 01398900 L R2,PREFIXB AND OTHER PROCESSOR @V407594 01399000 OI APSTAT2-PSA(R2),CPPTLBR REDUNDANT IF UP MODE @V407594 01400000 .NOAP14 ANOP **ANOP** 01400100 NI VMDSTAT,255-VMDSP NO FAST REDSP @V408246 01401000 L R3,VMSEG OWNER'S STO @V4M0167 01402000 CLM R9,B'0111',1(R3) PTE FOR PAGE 0? @V4M0167 01403000 BNE CKRSV NO, OR SEGMENT INVALID @V4M0167 01404000 LCTL C1,C1,VMSEG SET OWNER'S STO IN CONTROL REG. @V408246 01405000 LRA R2,0 REAL ADDRESS OF PAGE ZERO @V408246 01406000 BNZ CKRSV PAGE NOT RESIDENT @V408246 01407000 L R2,TIMER-PSA(R2) SAVE THE VIRTUAL TIMER VALUE @V408246 01408000 ST R2,VMTIMER @V408246 01409000 TM VMMCR6,VMMVTMR IS TIMER ASSIST ACTIVE? @V408246 01410000 BZ CKRSV NO @V408246 01411000 ICM R2,B'0111',VMMADDR VM ASSIST ON FOR USER? @V408246 01412000 BZ CKRSV NO @V408246 01413000 LA R0,VMTIMER YES, POINT TIMER ASSIST HERE... @V408246 01414000 ST R0,MICVTMR-MICBLOK(R2) . . @V408246 01415000 CKRSV DS 0H @V408246 01416000 LH R2,VMPAGES DECREMENT @V408246 01417000 SR R2,R4 RESIDENT PAGE COUNT @V408246 01418000 BM PTR18 VMPAGES TO GO NEGATIVE - TERM CP @VA07224 01418100 STH R2,VMPAGES @V408246 01419000 TM CORFLAG,CORRSV STEALING A RESERVED PAGE? @V408246 01420000 BZ CKCHGE NO @V408246 01421000 L R2,=A(DMKDSPNP) GET DYNAMIC PAGE COUNT @V408246 01422000 L R0,0(,R2) INCREMENT @V408246 01423000 ALR R0,R4 PAGEABLE PAGES COUNT @V408246 01424000 ST R0,0(,R2) @V408246 01425000 L R0,DMKPTRRC DECREMENT @V408246 01426000 SR R0,R4 RESIDENT RESERVED PAGE COUNT @V408246 01427000 BNM PTR10A ALRIGHT @V408246 01428000 ABEND 10 @V408246 01429000 ABEND 18 VMPAGES TO GO NEGATIVE - TERM CP @VA07224 01429100 PTR10A DS 0H @V408246 01430000 ST R0,DMKPTRRC @V408246 01431000 EJECT 01432000 CKCHGE DS 0H @V408246 01433000 OI PAGCORE+1,PAGINVAL FLAG PAGE INVALID @V408246 01434000 AIF (NOT &AP).NOAP15 **AIF*** 01434900 TM TEMPR0,UNLKVM DID WE LOCK VMBLOK @V407594 01435000 BZ CKCHGE2 NO @V407594 01436000 LR R1,R15 POINT TO VMBLOK OF OWNER OF PAGE @V407594 01437000 LOCK RELEASE,TYPE=VMBLOK,SAVE UNLOCK VMBLOK @V407594 01438000 MVI TEMPR0,0 CLEAR FLAG BYTE @V407594 01439000 CKCHGE2 DS 0H @V407594 01440000 .NOAP15 ANOP **ANOP** 01440100 OI CORFLAG,CORFLUSH FLAG PAGE SELECTED @V408246 01441000 AIF (NOT &AP).NOAP15A **AIF*** 01441050 TM TEMPR0+1,OPPRSTRT WAS OTHER PROCESSOR QUIESCED? @VA09279 01441100 BZ CKCHGE3 NO--WE DON'T HAVE TO WORRY ABOUT @VA09279 01441150 * CHANGE BITS HAVING BEEN CHANGED 01441200 RRB 0(R6) TEST FIRST HALF OF PAGE--PAGE @VA09279 01441250 * MAY HAVE BEEN CHANGED BY OTHER 01441300 * PROCESSOR IF STEALING UNPROTECTED 01441350 * SHARED PAGE 01441400 BC 4+1,BCHNGE REAL KEY WAS CHANGED @VA09279 01441450 RRB 2048(R6) TEST SECOND HALF OF PAGE @VA09279 01441500 BC 4+1,BCHNGE REAL KEY WAS CHANGED @VA09279 01441550 B CKBKUP TEST BACK-UP BITS @VA09279 01441600 CKCHGE3 DS 0H @VA09279 01441650 .NOAP15A ANOP **ANOP** 01441700 SPM R14 CHECK FOR CHANGED PAGE C.C. @V408246 01442000 BC 4+1,BCHNGE REAL KEYS WERE CHANGED @V408246 01443000 CKBKUP DS 0H @V408246 01444000 TM SWPFLAG,SWPCHG1+SWPCHG2 TEST BACK-UP CHANGE BIT @V408246 01445000 BNZ TESTRCMP PAGE HAS BEEN CHANGED -- @V408246 01446000 SPACE 3 01447000 FRETIT DS 0H PLACE PAGE ON FREE LIST @V408246 01448000 AIF (NOT &AP).NOAP16 **AIF*** 01448900 TM TEMPR0+1,OPPRSTRT RESTART OTHER PROC'R @V407594 01449000 BZ FRETIT2 NO @V407594 01450000 SIGNAL RESUME,CONTROL=PARALLEL ISSUE RESUME ORDER @V407594 01451000 MVI TEMPR0+1,0 CLEAR FLAG @V407594 01452000 FRETIT2 DS 0H @V407594 01453000 .NOAP16 ANOP **ANOP** 01453100 CALL DMKPTRFT FREE LIST ROUTINE @V408246 01454000 B SELECT1 CHECK FOR WORK COMPLETED @V408246 01455000 EJECT 01456000 * 01457000 * UPDATE COPY OF NEW AND/OR CHANGED PAGE ON BACKING STORE 01458000 * 01459000 BCHNGE DS 0H BACK-UP CHANGED BITS @V408246 01460000 RRB 0(R6) CHECK WHICH KEY WAS CHANGED @V408246 01461000 BC 8+2,*+8 NOT 1ST 2K @V408246 01462000 OI SWPKEY1,2 BACK-UP CHANGE BITS @V408246 01463000 RRB 2048(R6) 2ND 2K @V408246 01464000 BC 8+2,*+8 NOT CHANGED @V408246 01465000 OI SWPKEY2,2 BACK-UP CHANGE BIT @V408246 01466000 DROP R15 @V60BC11 01467000 USING VMBLOK,R11 NORMAL VMBLOK BASE @V60BC11 01468000 SPACE 1 01507000 TESTRCMP DS 0H @V408246 01508000 LR R2,R15 SAVE VMBLOK OF PAGES OWNER @V407594 01509000 AIF (NOT &AP).NOAP17 **AIF*** 01509900 TM TEMPR0+1,OPPRSTRT RESTART OTHER PROC'R @V407594 01510000 BZ TSTRCMP2 NO @V407594 01511000 SIGNAL RESUME,CONTROL=PARALLEL ISSUE RESUME ORDER @V407594 01512000 MVI TEMPR0+1,0 CLEAR FLAG @V407594 01513000 TSTRCMP2 DS 0H @V407594 01514000 TM APSTAT1,APUOPER RUNNING AS AP @V407594 01515000 BZ RCMPCHG NO @V407594 01516000 CL R13,F2 DMKPTRFE ENTRY @V407594 01517000 BH RCMPCHG NO, BYPASS UNLOCK OF R11 @V407594 01518000 CL R11,LASTUSER LAST USER @V407594 01519000 BE RCMPCHG YES, DO NOT UNLOCK VMBLOK @V407594 01520000 CL R11,ASYSVM SYSTEM VMBLOK @V407594 01521000 BE RCMPCHG YES, IT IS NEVER LOCKED @V407594 01522000 LR R1,R11 VMBLOK ADDR TO R1 @V407594 01523000 LOCK RELEASE,TYPE=VMBLOK UNLOCK VMBLOK @V407594 01524000 .NOAP17 ANOP **ANOP** 01524100 RCMPCHG CHARGE SWITCH,2 CHARGE PAGE WRITE TO OWNER @V407594 01525000 * 01526000 * IS NEW BACKING STORE LOCATION REQUIRED? 01527000 * 01528000 TM SWPFLAG,SWPRECMP RECOMPUTE BACKING STORE? @V408246 01529000 BNZ TSTOWNR YES @V408246 01530000 SR R1,R1 CLEAR VOLUME INDEX @V408246 01533000 IC R1,SWPCODE AND GET VOLUME INDEX CODE @V408246 01534000 SLL R1,3 GET VOLUME DISPLACEMENT IN TABLE @V408246 01535000 AL R1,=A(DMKSYSOW) POINT TO VOLUME ENTRY IN TABLE @V408246 01536000 LH R1,OWNDRDEV-OWNDLIST(,R1) GET RDEVBLOK INDEX @V408246 01537000 SLL R1,3 CONVERT TO DISPLACEMENT @V408246 01538000 AL R1,ARIODV POINT TO RDEVBLOK @V408246 01539000 CLI RDEVTYPE-RDEVBLOK(R1),TYP2305 FIXED HEAD DEVICE?@V408246 01540000 BE QWRITE YES, FOREGO ARM OPTIMIZATION @V408246 01541000 * 01542000 * MATCH SEGMENT'S OWNER AND R11 FOR DASD COUNTERS 01543000 * 01544000 TSTOWNR DS 0H UPDATE COUNTS FOR SEGMENT'S OWNER@V408246 01545000 LA R1,0(,R5) SWAPT TABLE ENTRY POINTER @V408246 01546000 SR R2,R2 CLEAR @V408246 01547000 IC R2,SWPVPAGE GET VIRTUAL PAGE NO. @V408246 01548000 AR R2,R4 NO. + 1 @V408246 01549000 SLL R2,3 DISPLACEMENT TO TABLE HEADER @V408246 01550000 SR R1,R2 BACK-UP TO TABLE HEADER @V408246 01551000 LR R3,R11 SAVE ORIGINAL VMBLOK POINTER @V408246 01552000 C R11,0(,R1) IS THIS USER THE SEGMENT'S OWNER?@V408246 01553000 BE CHKRCMP YES, NO NEED TO SWITCH FOR COUNT @V408246 01554000 CHARGE SWITCH,0(R1) NO, SWITCH VMBLOK AND TIMER @V407594 01555000 CHKRCMP DS 0H @V408246 01556000 TM SWPFLAG,SWPRECMP CHECK ON RECOMPUTE AGAIN @V408246 01557000 BO GETPAG NO NEED TO RELEASE BACKING STORE @V408246 01558000 CALL DMKPGTPR RELEASE OLD DASD ADDRESS @V408246 01559000 SPACE 3 01560000 GETPAG DS 0H @V408246 01561000 CALL DMKPGTPG GET NEW DASD PAGE ADDRESS @V408246 01562000 CR R3,R11 MATCHING VMBLOKS? @V408246 01563000 BE CHKDSD YES, CHECK RETURN CONDITION @V408246 01564000 LR R2,R11 SAVE SEGMENT'S OWNER @VA07717 01564100 CHARGE SWITCH,3 NO, SWITCH VMBLOK AND TIMER @V407594 01565000 CHKDSD DS 0H @V408246 01566000 LTR R1,R1 ANY PAGES AVAILABLE? @V408246 01567000 BNZ SETADDR YES, SAVE ADDRESS @V408246 01568000 LA R14,DMKPTRU1 USER FLUSH CHAIN @V408246 01569000 L R15,CORBPNT-CORTABLE(,R14) LAST ENTRY @V408246 01570000 ST R7,CORFPNT-CORTABLE(,R15) NEW LAST @V408246 01571000 ST R7,CORBPNT-CORTABLE(,R14) . . @V408246 01572000 STM R14,R15,CORFPNT @V408246 01573000 OI SWPFLAG,SWPRECMP+SWPCHG1 FLAG NO BACKING STORE @V408246 01574000 L R3,DMKPTRUC FLUSHED PAGE COUNT @VA07810 01574050 AR R3,R4 PLUS ONE @VA07810 01574055 ST R3,DMKPTRUC STORE NEW COUNT @VA07810 01574060 TM CORFLAG,CORSHARE SHARED PAGE @VA07717 01574100 BO SELEXIT1 YES @VA09179 01574151 LH R3,VMFLPAG-VMBLOK(R11) FLUSHED PAGE COUNT @VA07922 01574210 AR R3,R4 PLUS ONE @VA07717 01574250 STH R3,VMFLPAG-VMBLOK(R11) @VA07922 01574310 SELEXIT1 CL R13,F2 ENTERED BY CPEXBLOK @VA09179 01574361 BNH SELDISP YES, EXIT TO DMKPAG @VA07922 01574410 CHARGE SWITCH,SAVER11 BACK TO CALLER @VA07922 01574460 B SELEXIT AND LEAVE @V408246 01575000 * 01576000 SETADDR DS 0H @V408246 01577000 ST R1,SWPCYL SAVE BACKING STORE ADDRESS @V408246 01578000 NI SWPFLAG,X'FF'-SWPRECMP TURN OFF SWAPRECMP @VA09460 01578500 EJECT 01579000 QWRITE EQU * HERE TO SWAP THE PAGE 01580000 * GET CPEXBLOK BEFORE UPPING COUNTS SO THAT AN EXTEND ON THIS FREE CALL 01581000 * WILL NOT RESULT IN THE SYSTEM WAITING FOR A NONEXISTANT PAGING INT. 01582000 OI SWPFLAG,SWPTRANS IND. PAGE IS NOW IN TRANSIT @VA01180 01583000 LA R0,CPEXSIZE GET CORE FOR A CPEXBLOK @VA00972 01584000 CALL DMKFREE BEFORE WE BUMP THE COUNTS @VA00972 01585000 L R2,DMKPTRSW GET NUMBER OF PAGES BEING SWAPPED@V2B2638 01586000 AR R2,R4 BUMP BY ONE 01587000 ST R2,DMKPTRSW AND RE-STORE @V2B2638 01588000 L R2,VMPGWRIT COUNT PAGE WRITES 01589000 AR R2,R4 ... 01590000 ST R2,VMPGWRIT ... 01591000 L R2,PGWRITE COUNT FOR SYSTEM .. 01592000 ALR R2,R4 ... 01593000 ST R2,PGWRITE ... 01594000 SPACE 01595000 LA R0,5 GET DASD WRITE DATA OP-CODE 01596000 STM R0,R15,CPEXR0 SAVE ALL REGS 01597000 LA R3,DMKPTRFD SET RETURN TO EXECUTION ADDRESS 01598000 ST R3,CPEXADD -- 01599000 SLR R15,R15 CLEAR... 01600000 ST R15,CPEXR13 SAVE AREA POINTER IN CPEXBLOK 01601000 L R0,DMKPTRWQ PUSH DOWN PAGE 01602000 ST R1,DMKPTRWQ WRITE REQUEST 01603000 ST R0,CPEXFPNT STACK 01604000 SPACE 2 01605000 CL R13,F2 UNSTACKED VIA CPEXBLOCK @V407594 01606000 BNH SELDISP YES, THERE IS NO CALLER @V407594 01607000 CHARGE SWITCH,SAVER11 RESUME CHARGING CALLER @V407594 01608000 B SELECT1 GO SEE IF MORE SWAPS NEEDED 01609000 SPACE 3 01610000 SELEXIT LTR R13,R13 SHOULD WE RETURN TO A CALLER 01611000 BZ SELDISP NO, GOTO THE DISPATCHER 01612000 LM R2,R9,SAVEWRK2 RESTORE PTR SAVE REGISTERS. @V408246 01613000 BR R8 AND EXIT TO CALLER 01614000 EJECT 01615000 DMKPTRFD EQU * HERE TO FRET THE PAGE AFTER IT HAS BEEN WRITTEN 01616000 NI SWPFLAG,255-SWPTRANS-SWPRECMP-SWPCHG1-SWPCHG2 @V408246 01617000 * RESET 01618000 L R1,DMKPTRSW GET NUMBER OF PAGES BEING SWAPPED@V2B2638 01619000 BCTR R1,0 DECREMENT 01620000 ST R1,DMKPTRSW AND RE-STORE @V2B2638 01621000 LTR R15,R15 TEST ERROR FROM PAGIO 01622000 BP DOFRET IO COMPLETED SUCCESSFULLY 01623000 OI SWPFLAG,SWPRECMP+SWPCHG1 BACKING STORE UNUSABLE @V408246 01624000 LR R3,R11 SET-UP FOR TSTOWNR @V408246 01625000 B TSTOWNR GET NEW DASD LOCATION @V408246 01626000 SPACE 3 01627000 DOFRET DS 0H @V408246 01628000 CALL DMKPTRFT FRET THE PAGE @V408246 01629000 AIF (NOT &AP).NOAP18 **AIF*** 01629900 TM APSTAT1,APUOPER RUNNING AS AP @V407594 01630000 BZ SELCHG NO @V407594 01631000 CL R11,LASTUSER LAST USER @V407594 01632000 BE SELCHG YES, DO NOT UNLOCK @V407594 01633000 CL R11,ASYSVM SYSTEM VMBLOK @V407594 01634000 BE SELCHG YES, UNLOCK NOT REQUIRED @V407594 01635000 LR R1,R11 VMBLOK TO R1 @V407594 01636000 LOCK RELEASE,TYPE=VMBLOK UNLOCK VMBLOK @V407594 01637000 .NOAP18 ANOP **ANOP** 01637100 SELCHG CHARGE SWITCH,ASYSVM START CHARGING SYSTEM @V407594 01638000 SELDSPX DS 0H @V408246 01639000 GOTO DMKDSPCH @V408246 01640000 SPACE 3 01641000 PTRFDISP DS 0H @V408246 01642000 SELDISP DS 0H @V408246 01643000 GOTO DMKPAGIO GO TEST FOR I/O TO START @V408246 01644000 EJECT 01645000 *. 01646000 * G. OPERATION OF DMKPTRFT - PLACE A CORTABLE ENTRY ON THE FREELIST 01647000 * 1. BUMP THE NUMBER OF ENTRIES IN THE FREELIST, AND TEST TO 01648000 * SEE IF THERE ARE ANY DEFERED REQUESTS QUEUE FROM FREEQ 01649000 * 2. IF THERE ARE NO DEFERED REQUESTS, SKIP TO STEP 3; OTHER- 01650000 * WISE, UNCHAIN THE FIRST REQUEST, PLACE THE ADDRESS OF THE 01651000 * CORTABLE ENTRY BEING RETURNED IN THE DEFERED CALLER'S GPR7, 01652000 * CALL DMKSTKCP TO STACK THE DEFERED REQUEST, AND EXIT 01653000 * 3. PLACE THE NEW ENTRY AT THE END OF THE FREELIST, AND FLAG 01654000 * IT AS A FREE PAGE; THEN EXIT TO THE CALLER 01655000 *. 01656000 SPACE 01657000 ENTRY DMKPTRFT 01658000 DROP R12,R10 @V407594 01659000 USING *,R15 01660000 DROP R9 01661000 DMKPTRFT STM R0,R2,BALR0 SAVE THESE REGS ONLY 01662000 TM CORFLAG,CORFREE IS PAGE ALREADY IN FREELIST @VA05378 01663000 BZ OKFREE NO, OK TO ADD TO FREE LIST @VA05378 01664000 SPACE 01665000 ABEND 14 @VA05378 01666000 SPACE 01667000 OKFREE EQU * @VA05378 01668000 MVI CORFLAG,CORFREE RESET CORFLAG @V408246 01669000 L R1,FREEQ GET QUEUE OF DEFERED REQUESTS 01670000 LTR R1,R1 ARE THERE ANY ?? 01671000 BZ CHAINPAG NO -- 01672000 SPACE 01673000 ST R7,CPEXR7 SAVE ADDRESS OF CORTABLE ENTRY 01674000 L R2,CORPGPNT POINT TO OLD PTE 01675000 LTR R2,R2 IS THERE ONE ? 01676000 USING PAGCORE,R2 ADDRESSABILITY, JUST IN CASE 01677000 BZ CKQ NO PAGTABLE ENTRY ACTIVE .. 01678000 TM PAGCORE+1,PAGINVAL CATCH CULPRIT 01679000 BO PTR11A OK THIS TIME .. 01680000 ABEND 11 GOTCHA 01681000 PTR11A EQU * 01682000 MVI PAGCORE,0 CLEAR PTE 01683000 NI PAGCORE+1,PAGINVAL+PAGREF RETAINING THESE FLAGS 01684000 SLR R2,R2 CLEAR OUT 01685000 ST R2,CORPGPNT OLD PAGE TABLE ENTRY POINTER 01686000 ST R2,CORBPNT CLEAR BACK-POINTER @V408246 01687000 STCM R2,B'0111',CORSWPNT+1 AND SWAP POINTER @V408246 01688000 CKQ EQU * 01689000 L R2,CPEXFPNT GET POINTER TO NEXT ON Q 01690000 ST R2,FREEQ AND MAKE HIM FIRST 01691000 LR R0,R14 PRESERVE RETURN ADDRESS 01692000 FTSTAK L R2,CPEXMISC GET RELATED TASK POINTER 01693000 CALL DMKSTKCP STACK FOR EXECUTION 01694000 SPACE 01695000 * THIS UNUSUAL CODE IS EXECUTED < 10 % OF THE TIME .. 01696000 USING *,R14 TEMPORARY ADDRESSABILITY 01697000 L R15,=A(DMKPTRFT) GET STANDARD 01698000 DROP R14 ADDRESSABILITY 01699000 USING DMKPTRFT,R15 ... 01700000 LTR R1,R2 ANY MORE IN THE STACK ?? 01701000 BNZ FTSTAK YES -- STACK THEM TOO 01702000 LR R14,R0 RESTORE OUR RETURN ADDRESS 01703000 B FRETEXIT NO -- LEAVE NOW 01704000 SPACE 3 01705000 CHAINPAG DS 0H @V408246 01706000 LA R2,DMKPTRF1 CHAIN ANCHOR FOR FREE LIST PAGES @V408246 01707000 L R1,CORFPNT-CORTABLE(,R2) 1ST PAGE ON LIST @V408246 01708000 ST R7,CORBPNT-CORTABLE(,R1) BACKCHAIN TO NEW 1ST @V408246 01709000 ST R7,CORFPNT-CORTABLE(,R2) FORWARD CHAIN TO NEW @V408246 01710000 * 1ST 01711000 STM R1,R2,CORFPNT 01712000 L R2,DMKPTRFN BUMP NUMBER ... @VA01767 01713000 A R2,F1 ...IN... @VA01767 01714000 ST R2,DMKPTRFN ...FREELIST. @VA01767 01715000 L R2,CORPGPNT POINT TO PTE 01716000 LTR R2,R2 IS THERE ONE ?? 01717000 BZ FRETEXIT NO ... 01718000 TM PAGCORE+1,PAGINVAL IT MUST BE INVALID 01719000 BO FRETEXIT WHEW . 01720000 ABEND 12 01721000 FRETEXIT LM R0,R2,BALR0 RESTORE REGS 01722000 BR R14 AND EXIT 01723000 SPACE 01724000 DROP R2,R5,R7 01725000 EJECT 01726000 *. 01727000 * H. OPERATION OF DMKPTRUL - UNLOCK A PAGE 01728000 * 1. VERIFY THE THE PAGE IS WITHIN THE REAL MACHINE AND IS IN 01729000 * FACT LOCKED 01730000 * 2. DECREMENT AND TEST THE LOCK COUNT IN THE CORTABLE ENTRY; 01731000 * IF IT IS STILL POSITIVE, EXIT; OTHERWISE CONTINUE 01732000 * 3. IF THE LOCK COUNT IS ZERO, RESET THE LOCK FLAG AND EXIT 01733000 * 01734000 *********************************************************************** 01735000 * 01736000 * 01737000 * CP ASSIST INSTRUCTION "PTRUL" - UNLOCK A PAGE FRAME 01738000 * 01739000 * 01740000 * OPERANDS: 01741000 * 1 = ADDRESS OF 'DMKPTRPL' ("PTRUL" DATA LIST) 01742000 * 2 = REAL ADDRESS WITHIN THE PAGE FRAME TO BE UNLOCKED 01743000 * 01744000 * REGISTER INPUT: 01745000 * GPR 14 = EXIT ADDRESS 01746000 * 01747000 * SYSTEM DATA AREAS REFERENCED (BY MODULE): 01748000 * DMKPTR - 'DMKPTRU1' 01749000 * DMKSYS - 'CORTABLE' 01750000 * 01751000 * 01752000 * EXITS: 01753000 * 01754000 * 1. ADDRESS IN GPR 14 (NORMAL COMPLETION) 01755000 * 01756000 * REGISTER OUTPUT: NONE CHANGED BY THIS INSTRUCTION 01757000 * 01758000 * 2. NEXT SEQUENTIAL INSTRUCTION (ABNORMAL COMPLETION) 01759000 * 01760000 * NOTE: THIS EXIT IS FUNCTIONALLY EQUIVALENT TO A NO-OP. 01761000 * 01762000 *********************************************************************** 01763000 *. 01764000 SPACE 01765000 DMKPTRUL DS 0F PAGE UNLOCK ROUTINE CALLED VIA BALR 01766000 ENTRY DMKPTRUL 01767000 USING *,R15 ADDRESSABILITY VIA GPR15 01768000 USING CORTABLE,R2 ADDRESSABILITY FOR CORTABLE ENTRY 01769000 SPACE 01770000 DS 0H EXECUTE CP ASSIST "PTRUL" %V3M4038 01771000 DC X'E603',S(DMKPTRPL,0(R2)) ***%V3M4038 01772000 SPACE 01773000 STM R0,R4,BALRSAVE SAVE REGS THAT ARE CHANGED %V3M4038 01774000 L R1,=A(DMKSYSRM) POINT TO REAL MACHINE SIZE %V3M4038 01775000 CL R2,0(,R1) PAGE TO BE UNLOCKED WITHIN CORE? %V3M4038 01776000 BL PTR2A YES -- %V3M4038 01777000 SPACE 01778000 ABEND 2 DIE 01779000 SPACE 01780000 PTR2A EQU * %V3M4038 01781000 N R2,XPAGNUM GET PAGE NUMBER %V3M4038 01782000 SRL R2,8 DIVIDED BY 256 %V3M4038 01783000 A R2,ACORETBL POINT TO CORETABLE ENTRY %V3M4038 01784000 TM CORFLAG,CORIOLCK IS THE PAGE LOCKED ?? %V3M4038 01785000 BO PTR3A YES -- %V3M4038 01786000 SPACE 01787000 ABEND 3 DIE 01788000 SPACE 01789000 PTR3A EQU * %V3M4038 01790000 L R0,CORLCNT GET LOCK COUNT %V3M4038 01791000 S R0,F1 DECREMENT %V3M4038 01792000 BNM PTR4A CANNOT BE MINUS %V3M4038 01793000 SPACE 01794000 ABEND 4 OR WE DIE 01795000 SPACE 01796000 PTR4A EQU * %V3M4038 01797000 ST R0,CORLCNT SAVE LOCK COUNT %V3M4038 01798000 BP UNLOKXIT LOCK COUNT STILL NON-ZERO %V3M4038 01799000 NI CORFLAG,X'FF'-(CORIOLCK+CORCP) RESET LOCK FLAG. %V408246 01800000 UNLOKXIT LM R0,R4,BALRSAVE RESTORE USER REGS %V3M4038 01801000 BR R14 AND EXIT TO CALLER %V3M4038 01802000 DROP R2 01803000 EJECT 01804000 *. 01805000 * I. OPERATION OF DMKPTRLK - LOCK A PAGE 01806000 * 1. ISOLATES THE REAL PAGE NUMBER FROM THE REAL ADDRESS IN 01807000 * GPR 2, AND REFERENCES THE CORE TABLE. 01808000 * 2. IF THE PAGE IS ALREADY LOCKED (FLAG-BIT SET), SIMPLY 01809000 * INCREMENTS THE LOCK COUNT BY 1, AND EXITS. 01810000 * 3. IF THE PAGE WAS NOT LOCKED, SETS THE 01811000 * FLAG-BIT INDICATING THE PAGE IS NOW LOCKED, SETS THE 01812000 * LOCK COUNT TO 1, AND EXITS. 01813000 * 01814000 *********************************************************************** 01815000 * 01816000 * 01817000 * CP ASSIST INSTRUCTION "PTRLK" - LOCK A PAGE FRAME 01818000 * 01819000 * 01820000 * OPERANDS: 01821000 * 1 = ADDRESS OF 'LOCKLIST' (ADDR OF THE ADDR OF 'CORTABLE') 01822000 * 2 = REAL ADDRESS WITHIN THE PAGE FRAME TO BE LOCKED 01823000 * 01824000 * REGISTER INPUT: 01825000 * GPR 14 = EXIT ADDRESS 01826000 * 01827000 * SYSTEM DATA AREAS REFERENCED (BY MODULE): 01828000 * DMKSYS - 'CORTABLE' 01829000 * 01830000 * 01831000 * EXITS: 01832000 * 01833000 * 1. ADDRESS IN GPR 14 (NORMAL COMPLETION) 01834000 * 01835000 * REGISTER OUTPUT: NONE CHANGED BY THIS INSTRUCTION 01836000 * NOTE: THE CONDITION CODE IS SET TO ZERO 01837000 * 01838000 * 2. NEXT SEQUENTIAL INSTRUCTION (ABNORMAL COMPLETION) 01839000 * 01840000 * NOTE: THIS EXIT IS FUNCTIONALLY EQUIVALENT TO A NO-OP. 01841000 * 01842000 *********************************************************************** 01843000 *. 01844000 SPACE 01845000 DMKPTRLK DS 0F PAGE LOCK ROUTINE CALLED VIA BALR 01846000 ENTRY DMKPTRLK 01847000 USING *,R15 ADDRESSABILITY VIA GPR15 01848000 SPACE 01849000 DS 0H EXECUTE CP ASSIST "PTRLK" %V3M4038 01850000 DC X'E602',S(LOCKLIST,0(R2)) ***%V3M4038 01851000 SPACE 01852000 STM R2,R5,BALR2 SAVE ONLY THE REGS. WE WILL USE %V3M4038 01853000 N R2,XPAGNUM ISOLATE REAL PAGE NUMBER %V3M4038 01854000 SRL R2,8 DIVIDED BY 256 %V3M4038 01855000 AL R2,ACORETBL POINT TO CORTABLE ENTRY %V3M4038 01856000 USING CORTABLE,R2 AND REFERENCE THE CORE TABLE %V3M4038 01857000 LA R5,1 SET R5 = 1 (FOR GENERAL USE) %V3M4038 01858000 TM CORFLAG,CORIOLCK IS PAGE ALREADY LOCKED? %V408246 01859000 BZ PTRLKSTR NO -SET LOCK COUNT TO 1. %V408246 01860000 AL R5,CORLCNT ADD TOTAL NUMBER OF LOCKS. %V408246 01861000 PTRLKSTR ST R5,CORLCNT STORE UPDATED LOCK COUNT %V3M4038 01862000 OI CORFLAG,CORIOLCK ENSURE LOCK FLAG-BIT SET %V3M4038 01863000 LM R2,R5,BALR2 RESTORE THE REGISTERS WE USED, %V3M4038 01864000 SR R15,R15 SET CONDITION-CODE = 0, %V3M4038 01865000 BR R14 AND EXIT TO CALLER. %V3M4038 01866000 SPACE 3 01867000 DROP R15 @V408246 01868000 EJECT 01869000 *. 01870000 * 01871000 * J. OPERATION OF DMKPTRRS - RESET VIRTUAL MEMORY TABLES 01872000 * 1. INVALIDATES EACH VALID STE IN THE VIRTUAL MACHINE'S 01873000 * SEGMENT TABLE AND TIMESTAMPS THE ASSOCIATED 01874000 * PAGE TABLE HEADER. IF THE SEGMENT IS SHARED 01875000 * THEN THE ACTIVE SHARE COUNT IN THE PAGE 01876000 * TABLE HEADER IS ALSO DECREMENTED. 01877000 * 2. IF THE PERFORMANCE FEEDBACK FLAG IS SET INDICATING 01878000 * A HEAVY PAGING LOAD THEN EACH VALID PTE IN THE 01879000 * VIRTUAL MACHINE'S PAGE TABLES IS INVALIDATED AND 01880000 * THE ASSOCIATED CORTABLE ENTRY IS CHAINED ONTO THE 01881000 * FLUSH LIST. FOR A SHARED SEGMENT THIS PROCESS IS 01882000 * ONLY PERFORMED WHEN THE ACTIVE SHARE COUNT HAS 01883000 * DECREMENTED TO 0. 01884000 * 01885000 *. 01886000 * 01887000 USING SEGPAGE,R3 @V408246 01888000 USING SWPFLAG,R5 @V408246 01889000 USING CORTABLE,R7 @V408246 01890000 USING PAGCORE,R9 @V408246 01891000 DMKPTRRS DS 0H @V408246 01892000 TM VMDSTAT,VMINQ IS VM NOW IN A QUEUE @V4M0207 01893000 BOR R14 BYPASS RESET IF SO @V4M0207 01894000 STM R0,R15,FREESAVE (SCH MAY BE CALLER) @V408246 01895000 L R12,APTRAN ESTABLISH ADDRESSABILITY @V408246 01896000 LR R10,R12 SET SECOND BASE REGISTER @V407594 01897000 A R10,F4096 @V407594 01898000 USING DMKPTR,R12,R10 @V407594 01899000 LA R4,1 INCREMENT @V408246 01900000 ICM R6,B'1111',VMSEG GET CNT AND PTR @V408246 01901000 BZ RSEXIT NONE, THEN EXIT @V408246 01902000 NI VMDSTAT,X'FF'-VMDSP ASSURE NO FAST RE-DISPATCH @V4M0167 01903000 MVI TEMPR0,0 ZERO PTLB FLAG @V408246 01904000 LCTL C1,C1,VMSEG GET CORRECT STO IN CONTROL REG @V408246 01905000 LRA R2,0 PAGE ZERO @V408246 01906000 BNZ RSNOTMR NOT AVAILABLE @V408246 01907000 OI VMESTAT,VMINVPAG INVALIDATE ANY SHADOW TABLES @V4M0167 01908000 L R2,TIMER-PSA(R2) SAVE THE VIRTUAL TIMER VALUE @V408246 01909000 ST R2,VMTIMER @V408246 01910000 TM VMMCR6,VMMVTMR IS TIMER ASSIST ACTIVE? @V408246 01911000 BZ RSNOTMR NO @V408246 01912000 ICM R2,B'0111',VMMADDR VM ASSIST OF FOR USER? @V408246 01913000 BZ RSNOTMR NO @V408246 01914000 LA R0,VMTIMER YES, POINT TIMER ASSIT HERE... @V408246 01915000 ST R0,MICVTMR-MICBLOK(R2) @V408246 01916000 RSNOTMR DS 0H @V408246 01917000 SRL R6,24 GET SEG LGTH / 16 @V408246 01918000 AR R6,R4 ORIGIN 1 @V408246 01919000 SLL R6,4 SEG LGTH @V408246 01920000 ICM R3,B'0111',VMSEG+1 GET SEG ADDR @V408246 01921000 SR R9,R9 CLEAR INITIALLY @V408246 01922000 LH R0,VMPAGES CURRENT NO. IN CORE PAGES @V408246 01923000 ST R0,TEMPR1 INITIALIZE COUNT @V408246 01924000 EJECT 01925000 * 01926000 * SCAN THRU THE VIRTUAL MEMORY TABLES, LOOKING FOR VALID ENTIRES 01927000 * 01928000 RSSGLOOP DS 0H LOOP THRU SEGMENT TABLE ENTRIES @V408246 01929000 TM SEGPAGE+3,SEGINV SEGMENT TABLE ENTRY VALID? @V408246 01930000 BO RSNEWSEG NO, MOVE TO NEXT STE @V408246 01931000 SR R8,R8 CLEAR @V408246 01932000 IC R8,SEGPAGE PAGE TABLE LENGTH @V408246 01933000 SRL R8,4 RIGHT JUSTIFY @V408246 01934000 AR R8,R4 ORIGIN 1 @V408246 01935000 ICM R9,B'0111',SEGPAGE+1 PAGE TABLE POINTER @V408246 01936000 L R5,=F'-16' BACK-UP TO START OF TABLE HEADER @V408246 01937000 AR R5,R9 @V408246 01938000 USING PAGSTMP,R5 @V408246 01939000 STCK TEMPR2 STORE TOD CLOCK IN WORK AREA @V407594 01940000 MVC PAGSTMP,TEMPR2 MOVE HIGH WORD TO PG TBL HDR @V407594 01941000 BC 3,DOWNWEGO ABEND CVT001 @V408246 01942000 ICM R2,B'0111',PAGSHR+1 NAMED SYSTEM POINTER? @V408246 01943000 BZ RSPGLOOP NO @V408246 01944000 ICM R2,B'1111',SHRSEGCT-SHRTABLE(R2) SHARED SEG. @V408246 01945000 * COUNT? 01946000 BZ RSPGLOOP NO @V408246 01947000 AIF (NOT &AP).NOAP19 **AIF*** 01947900 TM APSTAT1,APUOPER RUNNING AS AP @V407594 01948000 BO DOCS YES, USE COMPARE AND SWAP LOGIC @V407594 01949000 .NOAP19 ANOP **ANOP** 01949100 LH R2,PAGACT DECREMENT @V408246 01950000 SR R2,R4 ACTIVE SHARED SEGMENT USER COUNT @V408246 01951000 STH R2,PAGACT @V408246 01952000 BP RSISTE SEGMENT STILL BEING USED, @V408246 01953000 * BYPASS RESET @V407594 01954000 AIF (NOT &AP).NOAP20 **AIF*** 01954900 B RSPGLOOP RESET PAGES WITHIN SEGMENT @V4M0172 01955000 DOCS L R14,PAGACT LOAD COUNTS @V407594 01956000 DECRACT LR R2,R14 @V407594 01957000 SL R2,=A(X'10000') DECREMENT ACTIVE COUNT @V407594 01958000 CS R14,R2,PAGACT UPDATE COUNTS @V407594 01959000 BC 4,DECRACT UPDATE FAILED @V407594 01960000 SRL R2,16 ACTIVE COUNT TO LOW HALF WORD @V407594 01961000 LTR R2,R2 SEGMENT STILL IN USE @V407594 01962000 BP RSISTE YES, BYPASS RESET @V407594 01963000 .NOAP20 ANOP **ANOP** 01963100 RSPGLOOP DS 0H LOOP THRU PAGE TABLE ENTIRES @V408246 01964000 TM PAGCORE+1,PAGINVAL PAGE INVALID? @V408246 01965000 BZ RSPGVL NO, VALID @V408246 01966000 TM PAGCORE+1,PAGREF USED WHILE IN-Q? @V408246 01967000 BZ RSPGUPD NO, DONE @V408246 01968000 NI PAGCORE+1,255-PAGREF YES, RESET FLAG @V408246 01969000 LA R0,1 INCREMENT @V408246 01970000 AL R0,TEMPR1 COUNT OF PAGES TOUCHED @V408246 01971000 ST R0,TEMPR1 @V408246 01972000 B RSPGUPD AND OUT @V408246 01973000 RSPGVL DS 0H @V408246 01974000 LH R7,PAGCORE REAL PAGE NO. * 16 @V408246 01975000 N R7,=A(X'FFF0') CLEAR ALL BUT ADDRESS BITS @V408246 01976000 LR R1,R7 SAVE @V408246 01977000 A R7,ACORETBL INDEX TO CORRESPONDING CORE @V408246 01978000 * TABLE ENTRY 01979000 TM CORFLAG,255-CORSHARE PAGE AVAILABLE? @V408246 01980000 BNZ RSPGUPD NO, BYPASS RESET @V408246 01981000 ICM R5,B'0111',CORSWPNT+1 SWAP TABLE POINTER @V408246 01982000 USING SWPFLAG,R5 @V408246 01983000 TM SWPFLAG,SWPTRANS+SWPALLOC PAGE ENQUEUED? @V408246 01984000 BNZ RSPGUPD YES, BYPASS RESET @V408246 01985000 SLL R1,8 GET REAL PAGE ADDRESS @V408246 01986000 RRB 0(R1) RESET REF. BITS FOR THIS PAGE @V408246 01987000 BALR R14,0 SAVE CONDITION CODE @V408246 01988000 BC 8+4,*+8 @V408246 01989000 OI SWPKEY1,4 REF. BIT RESET, BACK-UP TO VIRT @V408246 01990000 RRB 2048(R1) RESET KEY IN 2ND 2K @V408246 01991000 BALR R15,0 SAVE CONDITION CODE @V408246 01992000 BC 8+4,*+8 @V408246 01993000 OI SWPKEY2,4 REF. BIT RESET, BACK-UP TO VIRT. @V408246 01994000 NI SWPFLAG,255-SWPREF1-SWPREF2 RESET CP BACK-UP @V408246 01995000 * BITS 01996000 EJECT 01997000 OR R14,R15 COMBINE C.C. @V408246 01998000 TM CORFLAG,CORSHARE SHARED PAGE FRAME? @V4M0167 01999000 BZ RSSCHG NO, CHECK CHANGED @V4M0167 02000000 SPM R14 CHECK FOR SHARED AND CHANGED @V4M0167 02001000 BC 8+2,RSNOCHG PAGE NOT CHANGED @VA09279 02002100 SLR R15,R15 CLEAR REG FOR INSERT @VA09279 02002200 IC R15,SWPVPAGE VIRTUAL PAGE NUMBER @VA09279 02002300 SLL R15,1 MULTIPLY BY 2 FOR PTE SIZE @VA09279 02002400 L R2,CORPGPNT PAGE TABLE ENTRY ADDRESS @VA09279 02002500 SLR R2,R15 BACK UP TO START OF PAGE TABLE @VA09279 02002600 SL R2,F16 BACK UP TO PAGE TABLE HEADER @VA09279 02002700 L R2,PAGSHR-PAGTABLE(,R2) SHARETABLE POINTER @VA09279 02002800 TM SHRFLAG-SHRTABLE(R2),SHRNOPRT IS SHARED PAGE @VA09279 02002900 * UNPROTECTED? 02003000 BZ RSCHGSHR PAGE IS SHARED, CHANGED, @VA09279 02003100 * PROTECTED--LEAVE FOR DMKVMA 02003200 RSNOCHG L R2,DMKPTRSC FRAME IS UNCHANGED, OR FRAME IS @VA09279 02003300 * CHANGED AND UNPROTECTED 02003400 SR R2,R4 RESIDENT SHARED PAGE COUNT @V4M0167 02004000 ST R2,DMKPTRSC STORE UPDATED COUNT @V4M0167 02005000 RSSCHG DS 0H @V4M0167 02006000 OI PAGCORE+1,PAGINVAL INVALIDATE PAGE TABLE ENTRY @V408246 02007000 OI VMESTAT,VMINVPAG INVALIDATE ANY SHADOW TABLES @V408246 02008000 * ALSO 02009000 OI CORFLAG,CORFLUSH FLAG PAGE ON FLUSH LIST @V408246 02010000 L R15,CORFPNT PAGE'S OWNER @V408246 02011000 LH R2,VMPAGES-VMBLOK(,R15) DECREMENT @V408246 02012000 SR R2,R4 IN-CORE PAGE COUNT @V408246 02013000 BM PTR18 VMPAGES TO GO NEGATIVE - TERM CP @VA07224 02013100 STH R2,VMPAGES-VMBLOK(,R15) @V408246 02014000 L R2,DMKPTRUC FLUSHED PAGE COUNT @VA07810 02014050 AR R2,R4 PLUS ONE @VA07810 02014055 ST R2,DMKPTRUC STORE NEW COUNT @VA07810 02014060 TM CORFLAG,CORSHARE SHARED PAGE @VA07717 02014100 BO RSNFLCNT YES @VA07717 02014150 LH R2,VMFLPAG-VMBLOK(R15) FLUSHED PAGE COUNT @VA07717 02014200 AR R2,R4 PLUS ONE @VA07717 02014250 STH R2,VMFLPAG-VMBLOK(R15) @VA07717 02014300 RSNFLCNT DS 0H @VA07717 02014350 SPM R14 CHECK IF REAL KEYS MUST BE @V408246 02015000 * BACKED UP 02016000 BC 8+2,RSCKCHN REAL KEYS NOT SET @V408246 02017000 OI SWPFLAG,SWPCHG2 MAKE SURE WRITTEN OUT @V408246 02018000 RRB 0(R1) TEST 1ST 2K @V408246 02019000 BC 8+2,*+8 1ST 2K NOT CHANGED @V408246 02020000 OI SWPKEY1,2 REAL CHANGE BIT TO VIRT. BACKUP @V408246 02021000 RRB 2048(R1) TEST 2ND 2K @V408246 02022000 BC 8+2,*+8 NOT CHANGED @V408246 02023000 OI SWPKEY2,2 REAL CHANGE BIT TO VIRT. BACKUP @V408246 02024000 RSCKCHN DS 0H @V408246 02025000 TM VMDSTAT,VMELIG IN ELIGIBLE LIST @VA07714 02025100 BO RSCHNF YES, ADD PAGES TO END OF LIST @VA07714 02025200 LA R15,DMKPTRU1 ANCHOR FOR USER PAGE LIST @V408246 02026000 L R14,CORFPNT-CORTABLE(,R15) 1ST PAGE ON LIST @V408246 02027000 ST R7,CORBPNT-CORTABLE(,R14) BACKCHAIN TO NEW 1ST @V408246 02028000 ST R7,CORFPNT-CORTABLE(,R15) MAKE NEW FIRST @V408246 02029000 STM R14,R15,CORFPNT FILE IN NEW FORW. AND BACKW. @V408246 02030000 * PTRS. 02031000 B RSPGUPD @VA07714 02031100 RSCHNF DS 0H ADD PAGES TO END OF FLUSH LIST @VA07714 02031150 LA R15,DMKPTRU1 POINTER TO LAST ENTRY @VA07714 02031200 L R14,4(R15) POINT TO LAST ENTRY @VA07714 02031250 ST R7,CORFPNT-CORTABLE(R14) FWD CHAIN TO NEW LAST @VA07714 02031300 ST R7,4(R15) POINT TO NEW LAST ENTRY @VA07714 02031350 ST R14,CORBPNT BACKCHAIN NEW ENTRY @VA07714 02031400 ST R15,CORFPNT & FORWARD CHAIN IT @VA07714 02031450 SPACE 3 02032000 RSPGUPD DS 0H @V408246 02033000 LA R9,PAGCORE+2 MOVE POINTER TO NEXT PTE @V408246 02034000 BCT R8,RSPGLOOP LOOP THRU ALL PTE IN THIS SEGMENT@V408246 02035000 RSISTEI DS 0H INVALIDATE STE @VA07230 02036000 OI SEGPAGE+3,SEGINV INVALIDATE STE @V408246 02037000 RSSETPUR DS 0H @V4M0172 02038000 MVI TEMPR0,1 RAISE PTLB FLAG @V408246 02039000 RSNEWSEG DS 0H HANDLE NEXT STE @V408246 02040000 LA R3,SEGPAGE+4 POINT TO NEXT STE @V408246 02041000 BCT R6,RSSGLOOP LOOP THRU ALL STE IN SEGMENT @V408246 02042000 * TABLE 02043000 CLI TEMPR0,0 IMMEDIATE PTLB REQUIRED? @V408246 02044000 BE RSEXIT NO @V408246 02045000 OI APSTAT2,CPPTLBR SET PTLB REQ FOR THIS PROCR @V407594 02046000 L R2,PREFIXB AND OTHER PROCESSOR @V407594 02047000 OI APSTAT2-PSA(R2),CPPTLBR REDUNDANT IF UP MODE @V407594 02048000 RSEXIT DS 0H @V408246 02049000 LM R0,R15,FREESAVE RESTORE REGS. @V408246 02050000 BR R14 AND RETURN TO SCH CALLER @V408246 02051000 SPACE 1 @V4M0172 02052000 RSCHGSHR DS 0H RESET PAGACT TO WHAT IT WAS @V4M0172 02053000 ICM R9,B'0111',SEGPAGE+1 LOAD PAGE TBL POINTER @V4M0172 02054000 L R5,=F'-16' BACK UP TO HEADER @V4M0172 02055000 AR R5,R9 POINT TO HEADER @V4M0172 02056000 USING PAGSTMP,R5 BASE HEADER @V4M0172 02057000 TM APSTAT1,APUOPER RUNNING AS AP @V4M0172 02058000 BO RSINCRCS YES, MUST USE COMPARE & SWAP @V4M0172 02059000 LH R0,PAGACT LOAD ACTIVE COUNT @V4M0172 02060000 AR R0,R4 ADD ONE (SEGMENT STILL VALID) @V4M0172 02061000 STH R0,PAGACT STORE COUNT @V4M0172 02062000 B RSSETPUR FINISHED WITH SEGMENT @V4M0172 02063000 RSINCRCS L R0,PAGACT LOAD ACTIVE & TOTAL COUNTS @V4M0172 02064000 RSCSADD LR R14,R0 COUNTS TO R14 @V4M0172 02065000 AL R14,=A(X'10000') ADD ONE TO ACTIVE COUNT @V4M0172 02066000 CS R0,R14,PAGACT REPLACE COUNTS @V4M0172 02067000 BC 4,RSCSADD UPDATE FAILED @V4M0172 02068000 B RSSETPUR FINISHED WITH SEGMENT @V4M0172 02069000 SPACE 1 02069100 RSISTE DS 0H @VA07230 02069110 CL R11,LASTUSER IS VMA SCAN PENDING @VA07230 02069120 BNE RSISTEI NO- INVALIDATE STE @VA07230 02069130 * PERFORM DMKVMA SCAN HERE AND INVALIDATE STE IF NO CHANGED PAGE 02069140 * IF PAGE HAS BEEN CHANGED LEAVE STE VALID 02069150 CNOP 0,8 @VA07230 02069160 PAGEISK TM PAGCORE+1,PAGINVAL PAGE INVALID @VA07230 02069170 BO INVAL YES, CANNOT BE CHANGED @VA07230 02069180 LH R2,PAGCORE LOAD PTE @VA07230 02069190 SLL R2,8 DEVELOP REAL ADDRESS @VA07230 02069200 N R2,XPAGNUM CLEAR DISPLACEMENT @VA07230 02069210 ISK R0,R2 LOAD FIRST KEY @VA07230 02069220 SLL R0,8 SAVE KEY @VA07230 02069230 LA R2,2048(R2) ADD FOR SECOND HALF OF PAGE @VA07230 02069240 ISK R0,R2 LOAD SECOND KEY @VA07230 02069250 N R0,=A(X'00000202') ISOLATE CHANGE BITS @VA07230 02069260 BNZ RSCHGSHR PAGE WAS CHANGED @VA07230 02069270 INVAL LA R9,PAGCORE+2 POINT TO NEXT PTE @VA07230 02069280 BCT R8,PAGEISK PROCESS NEXT PTE @VA07230 02069290 B RSISTEI INVALIDATE STE- SEG NOT CHANGED @VA07230 02069300 SPACE 1 @V4M0172 02070000 DROP R3,R5,R7,R9 @V408246 02071000 EJECT 02071100 * NOTE.... THIS SUBROUTINE REMOVED FROM DMKPGS BY VM8037 02071120 * B. OPERATION OF DMKPTRPW - 02071140 * 02071160 * 1. CHECK THAT THIS VIRTUAL MACHINE HAS SOME OUTSTANDING 02071180 * PAGING ACTIVITY. IF NONE FOUND RETURN TO CALLER 02071200 * 2. CREATE A CP REQUEST BLOCK TO RESTART AT STEP 1. 02071220 * 3. SEARCH CP PAGE I/O REQUEST CHAINS FOR A REQUEST BLOCK 02071240 * BELONGING TO THIS VIRTUAL MACHINE. IF NONE FOUND 02071260 * SKIP TO STEP 5. 02071280 * 4. QUEUE CP REQUEST BLOCK OFF OF THE PAGE I/O REQUEST BLOCK. 02071300 * SKIP TO STEP 6. 02071320 * 5. CALL DMKSTKCP TO IMMEDIATELY QUEUE THE CP REQUEST BLOCK 02071340 * 6. GOTO DMKDSP 02071360 * 02071380 *. 02071400 DMKPTRPW RELOC @V408246 02071420 LR R10,R12 SET SECOND BASE @VA08037 02071440 A R10,F4096 ......... @VA08037 02071460 USING DMKPTR,R12,R10 @VA08037 02071480 CL R11,ASYSVM ENTERED FOR SYSTEM VMBLOK? @VA08341 02071485 BE EXITA YES, ALL DONE @VA08341 02071490 PTRPWEP DS 0H @V408246 02071500 TM VMRSTAT,VMPGWAIT ALL QUIET? @V408246 02071520 BNZ CHKSTK NO @V408246 02071540 CLC VMNDCNT,F0 QUIET HERE ALSO? @V408246 02071560 BE EXITA YES, ALL DONE @V408246 02071580 * 02071600 * USER HAS OUTSTANDING PAGING ACTIVITY. 02071620 * DEFER RETURN UNTILL ALL IS QUIET. 02071640 * 02071660 CHKSTK DS 0H @V408246 02071680 LA R0,CPEXSIZE GET CPRQ BLOCK @V408246 02071700 CALL DMKFREE @V408246 02071720 USING CPEXBLOK,R1 @V408246 02071740 STM R0,R13,CPEXR0 SAVE MY REGS. @V408246 02071760 LA R0,PTRPWEP RE-ENTER AT THE TOP @V408246 02071780 ST R0,CPEXADD @V408246 02071800 L R4,=A(DMKPTRFQ) FREE LIST QUEUE @V408246 02071820 L R3,=A(DMKPAGQ) PAGE I/O QUEUE @V408246 02071840 LR R2,R3 SAVE ANCHOR @V408246 02071860 * 02071880 * SEARCH PAGING QUEUES FOR A REQUEST BLOCK FOR THIS VMBLOK 02071900 * 02071920 GETTASK DS 0H @V408246 02071940 ICM R3,B'1111',CPEXFPNT-CPEXBLOK(R3) GET ADDR CPEXB @VMI0038 02071960 BZ CKDSPQ NO CPEXBLOK @VMI0038 02071980 CR R2,R3 BACK AT START OF CHAIN? @V408246 02072000 BE STAK YES @V408246 02072020 LR R5,R3 NO, SAVE POINTER @V408246 02072040 LR R15,R5 SET SWITCH NON-ZERO @V408246 02072060 GETEND DS 0H SCAN ALL DEFERRED TASKS @V408246 02072080 C R11,CPEXR11-CPEXBLOK(,R5) THIS USER'S TASK? @V408246 02072100 BNE *+6 NO @V408246 02072120 SR R15,R15 YES, ZERO SWITCH @V408246 02072140 ICM R0,15,CPEXMISC-CPEXBLOK(R5) GET POINTER TO @V408246 02072160 * DEFERED 02072180 BZ CHNIT FOUND @V408246 02072200 LR R5,R0 SAVE BACKPOINTER AND CONTINUE @V408246 02072220 B GETEND @V408246 02072240 CHNIT DS 0H @V408246 02072260 LTR R15,R15 WAS SOMETHING FOUND? @V408246 02072280 BNZ GETTASK NO, KEEP SEARCHING @V408246 02072300 ST R1,CPEXMISC-CPEXBLOK(,R5) NEW LAST BLOCK @V408246 02072320 ST R15,CPEXMISC ZERO FORWARD POINTER @V408246 02072340 B GTDSP ALL DONE @V408246 02072360 SPACE 02072380 * 02072400 * NOT REQUESTS WERE FOUND 02072420 * 02072440 STAK DS 0H TASK NOT FOUND @V408246 02072460 LR R3,R4 @V408246 02072480 SR R4,R4 CLEAR @V408246 02072500 LTR R2,R3 SAVE CHAIN ANCHOR AND TEST @V408246 02072520 BNZ GETTASK CHECK THIS CHAIN ALSO @V408246 02072540 CKDSPQ DS 0H @VMI0038 02072560 CALL DMKSTKCP @VMI0038 02072580 GTDSP DS 0H @V408246 02072780 GOTO DMKDSPCH @V408246 02072800 EXITA DS 0H NOW RETURN TO CALLER WITH CC=0 @V400141 02072860 CLI SAVEWRK1+1,CC0 SET CC FOR CALLER @V408246 02072880 LM R0,R11,SAVEREGS @V408246 02072900 SVC 12 @V408246 02072920 EJECT @V408246 02072940 DS 0D ALIGNMENT 02073000 DMKPTRFN DC F'0' NUMBER OF PAGES IMMEDIATELY AVAILABLE 02074000 DMKPTRSW DC F'0' NUMBER OF PAGES BEING SWAPPED @V2B2638 02075000 DMKPTRF1 DC A(DMKPTRF1) ADDRESS OF 1ST PAGE 02076000 FREELAST DC A(DMKPTRF1) ADDRESS OF LAST PAGE 02077000 SPACE 2 02078000 SPACE 02079000 DMKPTRXX DC A(X'80000000') LOC TO DETERMINE IF USER @V408246 02080000 * CHANGED PAGE 02081000 * SHOULD BE PAGED OUT AFTER BEING DROPPED FROM Q 02082000 SPACE 2 02083000 * THE FOLLOWING 8 BYTE DATA LIST MUST BE KEPT CONTIGUOUS AND IN ORDER 02084000 * BECAUSE IT IS USED BY THE CP ASSIST INSTRUCTIONS "PTRLK" AND "PTRUL". 02085000 SPACE 02086000 DMKPTRPL DS 0F @V386198 02087000 DMKPTRRM DC A(0) +0 STORAGE SIZE (SET BY DMKCPI) @V386198 02088000 LOCKLIST DC V(DMKSYSCS) +4 ADDR OF THE SYSTEM CORE TABLE @V386198 02089000 * 02090000 * DMKPTRU1 IS THE DEFERRED WRITE (FLUSH) LIST ANCHOR 02090100 DMKPTRU1 DC A(DMKPTRU1) A(1ST ENTRY FOR USER PAGES) @V408246 02091000 DC A(DMKPTRU1) A(LAST ENTRY FOR USER PGS) @V408246 02092000 SPACE 1 02092100 DMKPTRUC DC F'0' COUNT OF FLUSHED PAGES @VA07810 02092200 SPACE 2 02093000 DMKPTRRU DC A(0) VMBLOK ADDRESS FOR RESERVED PAGE USER 02094000 SPACE 02095000 FREEQ DC A(0) Q OF DEFERED REQUESTS FOR FREE CORE 02096000 DMKPTRFQ EQU FREEQ @V408246 02097000 DMKPTRFA DC A(0) BLOCK OF STORAGE FOR EXTENDING @VM08952 02098000 SPACE 02099000 DMKPTRRQ DC A(0) PAGE READ REQUEST QUEUE 02100000 DMKPTRWQ DC A(0) PAGE WRITE REQUEST QUEUE 02101000 DC F'-1' FENCE 02102000 SPACE 3 02103000 DMKPTRPR DC F'0' NUMBER OF PAGES RECLAIMED @V2B2638 02104000 * FROM FREE LIST 02104050 DMKPTRP2 DC F'0' NUMBER OF PAGES RECLAIMED @VA07717 02104100 * FROM FLUSH LIST 02104150 SPACE 02105000 DMKPTRF0 DC F'0' NUMBER OF TIMES FREELIST WAS EMPTY 02106000 SPACE 02107000 DMKPTRFC DC F'0' NUMBER OF TIMES DMKPTRFR WAS CALLED 02108000 SPACE 02109000 DMKPTRFF DC F'0' NO. PAGES SWAPPED FROM FLUSH LIST@V2B2638 02110000 DMKPTRSS DC F'0' NO. OF PAGE STEALS FROM ACTIVE @V2B2638 02111000 * USERS 02112000 SPACE 02113000 DMKPTRRF DC F'0' NO. PAGES LOOKED AT DURING STEALS@V2B2638 02114000 DMKPTRCS DC F'0' NO. OF TIMES ENTIRE ULIST EXAMIND@V2B2638 02115000 SPACE 02116000 SPACE 02117000 SPACE 02118000 DMKPTRRL DC F'0' RESERVED PAGE LIMIT 02119000 SPACE 02120000 DMKPTRRC DC F'0' NUMBER OF RESIDENT, RESERVED PAGES 02121000 SPACE 02122000 EJECT 02123000 DMKPTRCP EQU * TABLE IS SET UP BY DMKCPI @V408246 02124000 * THE FOLLOWING DC CONTAINS POINTERS TO INDEX INTO THE CORETBL 02125000 *CURPNT DC A(REAL STORAGE ADDR),A(CUR CORETBL ENTRY),A(INDEX CONT) 02126000 * DC A(LOWEST PAGEABLE CORETBL ENTRY THIS BLOK),A(INCREMENT) 02127100 CURPNT DC A(0),A(0),A(-16),A(0),A(4096) @V408246 02128000 SPACE 1 02129000 FULLSCAN EQU * START OF FULLSCAN TABLE @VA08341 02130100 *FULSCAN2 DC A(ADDR. OF HIGHEST PAGEABLE PAGE),A(HIGH CORETBL ENTRY) 02130150 * DC A(INDEX CONST.),A(FIRST PAGEABLE CORETBL ENTRY),A(INCRE) 02131000 FULSCAN2 DC A(0),A(0),A(-16),A(0),A(4096) @VA08341 02131100 *FULSCAN1 DC A(ADDR. OF HIGHEST V=R PAGE),A(HIGH V=R CORETBL ENTRY) 02131200 * DC A(INDEX CONST.),A(1ST V=R CORETBL ENTRY),A(INCRE) 02131300 FULSCAN1 DC A(0),A(0),A(-16),A(0),A(4096) @VA08341 02131400 *TOPPNT DC A(ADDRESS HIGHEST PAGEABLE PAGE THIS BLOK), 02133100 * DC A(HIGHEST CORETBL ENTRY THIS BLOK), 02133200 * DC A(INDEX CONST),A(CURRENT CORETBL ENTRY),A(INCREMENT) 02134000 SPACE 1 02135000 TOPPNT DC A(0),A(0),A(-16),A(0),A(4096) @V408246 02136000 DC F'-1' FENCE.... @V408246 02137000 SPACE 3 02138000 DMKPTRCT DC F'0' TOTAL CALLS TO DMKPTR 02139000 DMKPTRSC DC F'0' TOTAL RESIDENT SHARED PAGES 02140000 * 02141000 DMKPGSHR DC 2A(DMKPGSHR) ANCHOR FOR SCHRTABLES @V408246 02142000 DMKPTRSN EQU * @VA08341 02142100 SCANNUM DC H'0' NUMBER OF FRAME BLOCKS AVAILABLE @VA08341 02142150 * FOR SCAN 02142200 SCANBLOK DC H'0' NUMBER OF BLOCK CURRENTLY BEING @VA08341 02142250 * SCANNED 02142300 SCANSTRT DC H'0' NUMBER OF BLOCK WHERE CURRENT @VA08341 02142350 * SCAN STARTED 02142400 SCANFLAG DC X'0' FLAGS FOR SCAN PROCESS @VA08341 02142450 PASSTWO EQU X'80' SCAN IS NOW ON 2ND FULL PASS @VA08341 02142500 * THROUGH THE BLOCKS OF FRAMES 02142550 VEQRUNLK EQU X'40' V=R AREA HAS BEEN UNLOCKED BY THE@VA08341 02142600 * OPERATOR AND IS AVAILABLE TO THE 02142650 * SCAN PROCESS 02142700 EJECT 02143000 LTORG 02144000 SPACE 2 02145000 PAGESIZE EQU 15 *** SIZE OF PAGING IOBLOK (USED BY DMKPAGIO) *** 02146000 SPACE 1 02147000 * EQUATES FOR TEMPR0 - USED FOR PAGE SELECTION CONTROL @V407594 02148000 UNLKVM EQU X'80' MUST UNLOCK VMBLOK (CORVM) @V407594 02149000 NOSTEAL EQU X'40' CANNOT STEAL PAGE, BUT DO RRB @V407594 02150000 RRBSHR EQU X'20' PROC'G SHARED PAGE (AP PHASE 1) @V407594 02151000 SPACE 1 02152000 * EQUATES FOR TEMPR0+1 - USED DURING PAGE SELECTION @V407594 02153000 OPPRSTRT EQU X'80' MUST RESTART OTHER PROCESSOR @V407594 02154000 * CONDITION CODE SETTING FOR SAVEWRK1+1 @V407511 02154100 CC0 EQU X'00' CONDITION CODE ZERO - NORMAL @V407511 02154200 EJECT 02155000 COPY VMBLOK 02156000 COPY MICBLOK @V386198 02157000 COPY CORE 02158000 PSA 02159000 COPY SAVE 02160000 COPY RBLOKS 02161000 COPY ALLOC 02162000 COPY EQU 02163000 COPY DEVTYPES 02164000 COPY SHRTABLE @V408246 02165000 END 02166000