DSP TITLE 'DMKDSP (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 00002000
*. 00003000
* MODULE NAME - 00004000
* 00005000
* DMKDSP 00006000
* 00007000
* FUNCTION - 00008000
* 00009000
* DMKDSP IS ENTERED AFTER EACH INTERRUPT HANDLER HAS FINISHED 00010000
* PROCESSING, AND AFTER EACH STACKED CPEXBLOK, I/O REQUEST, 00011000
* DEFERRED INTERRUPT TASK, AND EXTERNAL INTERRUPT 00012000
* HAS BEEN SERVICED. IT UPDATES THE 00013000
* CPU TIMES CHARGED TO THE USER THAT HAS RECEIVED SERVICE, UP- 00014000
* DATES ALL VIRTUAL TIMERS, AND REFLECTS ANY PENDING INTERRUPTS 00015000
* FOR WHICH THE USER IS ENABLED. AFTER THE USER'S STATUS HAS 00016000
* BEEN UPDATED, EITHER THE NEXT AVAILABLE STACKED REQUEST 00017000
* IS STACKED, OR THE HIGHEST PRIORITY RUNNABLE USER IS 00018000
* DISPATCHED. 00019000
* 00020000
* ATTRIBUTES - 00021000
* 00022000
* REENTRANT, RESIDENT, ENTERED VIA GOTO 00023000
* 00024000
* ENTRY POINTS - EXECUTABLE 00025000
* 00026000
* DMKDSPCH - MAIN ENTRY POINT; SYSTEM LOCK HELD ON ENTRY 00027000
* DMKDSPA - ENTERED FOR FAST REFLECT - ONLY STATUS UPDATE IS 00028000
* FOR VIRTUAL TIMERS; SYSTEM LOCK MAY OR MAY NOT 00029000
* BE HELD 00030000
* DMKDSPB - ENTERED IF VIRTUAL PSW HAS BEEN ALTERED OUTSIDE OF 00031000
* DMKDSP; SYSTEM LOCK HELD ON ENTRY 00032000
* DMKDSPE - ENTERED FOR VIRTUAL TIMER INTERRUPT REFLECT; 00033000
* SYSTEM LOCK NOT APPLICABLE 00034000
* DMKDSPRU - ENTRY FOR ATTACHED PROCESSOR SUPPORT TO SELECT 00035000
* ANOTHER USER TO DISPATCH; SYSTEM LOCK NOT HELD 00036000
* 00037000
* ENTRY POINTS - NON-EXECUTABLE 00038000
* 00039000
* DMKDSPQS - DISPATCHED USER'S MAXIMUM TIME SLICE 00040000
* DMKDSPRQ - QUEUE ANCHOR FOR IOBLOKS AND CPEXBLOKS 00041000
* DMKDSPNP - NUMBER OF DYNAMICALLY ASSIGNABLE PAGE FRAMES NOW 00042000
* AVAILABLE IN THE SYSTEM 00043000
* DMKDSPAC - COUNT OF DMKDSPA ENTRIES 00044000
* DMKDSPBC - COUNT OF DMKDSPB ENTRIES 00045000
* DMKDSPCC - COUNT OF DMKDSPCH ENTRIES 00046000
* DMKDSPEC - COUNT OF DMKDSPE ENTRIES 00047000
* DMKDSPRC - COUNT OF DMKDSPRU ENTRIES 00048000
* DMKDSP0 - CP ASSIST INSTRUCTION ADDRESS 00049000
* DMKDSP1 - CP ASSIST INSTRUCTION ADDRESS 00050000
* DMKDSP2 - CP ASSIST INSTRUCTION ADDRESS 00051000
* DMKDSPIT - VIRTUAL INTERVAL TIMER REFLECTION COUNTER 00052000
* DMKDSPCK - VIRTUAL CLOCK COMPARATOR REFLECTION COUNTER 00053000
* DMKDSPPT - VIRTUAL CPU TIMER REFLECTION COUNTER 00054000
* 00055000
* ENTRY CONDITIONS - 00056000
* 00057000
* GPR11 = ADDRESS OF VMBLOK OF USER TO CHARGE 00058000
* GPR12 = ADDRESS OF ENTRY POINT 00059000
* 00060000
* THE SWITCH "CPSTATUS" IN PSA INDICATES THE STATE OF THE CPU 00061000
* PRIOR TO THE LAST INTERRUPT OR UNSTACK OPERATION - IT WILL 00062000
* INDICATE "RUNNING", "WAITING", OR "CP EXECUTION" 00063000
* 00064000
* EXIT CONDITIONS - 00065000
* 00066000
* EITHER THE NEXT AVAILABLE STACKED REQUEST IS UNSTACKED OR 00067000
* THE HIGHEST PRIORITY RUNNABLE USER IS DISPATCHED; IF NO USER 00068000
* IS RUNNABLE, THE CPU IS PLACED IN AN ENABLED WAIT STATE 00069000
* 00070000
EJECT 00071000
* CALLS TO OTHER ROUTINES - 00072000
* 00073000
* DMKERMSG - CALLED TO WRITE ERROR MESSAGES TO USER 00074000
* DMKUSOFF - CALLED TO LOG OFF A USER WHO HAS ENTERED A DISABLED 00075000
* WAIT STATE WHILE DISCONNECTED 00076000
* DMKSCNVU - CALLED TO LOCATE VIRTUAL UNIT BLOKS FOR INTERRUPT- 00077000
* ING DEVICES 00078000
* DMKCFMBK - CALLED TO PLACE USER IN CONSOLE FUNCTION MODE 00079000
* DMKCVTBH - CALLED TO CONVERT BINARY TO HEX 00080000
* DMKSCHDL - CALLED TO MAINTAIN SCHEDULER LISTS OF ACTIVE USERS 00081000
* DMKPERIL - CALLED TO HANDLE PER TRACING PER001 00082100
* DMKVATAB - CALLED TO MAINTAIN VIRTUAL RELOCATE SIMULATION 00083000
* TABLES FOR VIRTUAL MACHINES WITH THE VR FEATURE 00084000
* DMKVATBC - CALLED WHEN A VIRTUAL MACHINE GOES FROM EXTENDED 00085000
* TO BASIC CONTROL MODE 00086000
* DMKVATEX - GOTO TO RELECT PSEUDO PAGE FAULT 00087000
* DMKVATMD - CALLED WHEN A VIRTUAL MACHINE IN EXTENDED CONTROL 00088000
* MODE ENTERS VIRTUAL TRANSLATE MODE 00089000
* DMKVMASH - CALLED TO CHECK IF LASTUSER CHANGED A SHARED PAGE 00090000
* DMKVMCEX - CALLED TO REFLECT VMCF MESSAGE HEADER 00092000
* DMKTRCEX - TO TRACE A VIRTUAL MACHINE EXTERNAL INTERRUPT 00093000
* DMKTRCIO - TO TRACE A VIRTUAL MACHINE I/O INTERRUPT 00094000
* DMKTRCIT - TO SET NEEDED "SVC B2" FOR INSTRUCTION TRACING 00095000
* DMKTRCPG - CALLED TO TRACE A VIRTUAL MACHINE PROGRAM CHECK 00096000
* DMKFREE - CALLED TO OBTAIN FREE STORAGE 00097000
* DMKFRET - CALLED TO RELEASE STORAGE BACK INTO FREE POOL 00098000
* DMKPTRAN - CALLED TO FETCH A PAGE 00099000
* DMKEXTSP - CALLED TO ISSUE SIGP INSTRUCTION 00100000
* DMKLOKDF - CALLED TO OBTAIN A LOCK WITHOUT SPINNING 00101000
* DMKLOKVM - CALLED TO OBTAIN A VMBLOK LOCK 00102000
* DMKLOKSP - CALLED TO SPIN UNTIL A LOCK IS AVAILABLE 00103000
* DMKLOKPS - CALLED TO SPIN UNTIL A CONDITION IS SATISFIED 00104000
* DMKSTKDE - CALLED TO STACK A DEFERRED INTERRUPT TASK 00105000
* DMKSTKMP - CALLED TO STACK A CPEXBLOK FOR THE CURRENT PROC 00106000
* DMKMCHSE - CALLED FOR SOFT MACHINE CHECK RECOVERY 00107000
* DMKMCTPR - CALLED FOR AUTOMATIC PROCESSOR RECOVERY 00108000
* DMKPRGSM - GOTO TO REFLECT INVALID PSW INTERRUPTION 00109000
* DMKCCHRF - CALLED TO REFLECT CHANNEL CHECK TO VIRTUAL MACHINE 00109050
* 00110000
* EXTERNAL REFERENCES - 00111000
* 00112000
* DMKVIOMK - MASK TABLE FOR ACTIVE I/O AND PENDING INTERRUPTS 00113000
* DMKSCHRL - ANCHOR FOR SCHEDULER'S LIST OF DISPATCHABLE USERS 00114000
* DMKIOSER - ALLOWED EXIT DURING EXTEND 00115000
* DMKIOSRC - ALLOWED EXIT DURING EXTEND 00116000
* DMKPTRFD - ALLOWED EXIT DURING EXTEND 00117000
* DMKPTRFE - ALLOWED EXIT DURING EXTEND 00118000
* DMKPTRFP - ALLOWED EXIT DURING EXTEND 00119000
* DMKPTRRC - RESERVE PAGE USAGE COUNT 00120000
* DMKSCHTQ - QUEUE OF CLOCK COMPARATOR REQUESTS 00121000
* DMKLOKSY - GLOBAL SYSTEM LOCK 00122000
* DMKLOKDS - DISPATCHER QUEUE LOCK 00123000
* DMKLOKRL - RUN LIST LOCK 00124000
* DMKLOKTR - TRQ LOCK 00125000
* 00126000
* TABLES / WORKAREAS - 00127000
* 00128000
* VMBLOK - PRIMARY USER CONTROL TABLE 00129000
* VDEV,VCU AND VCHBLOKS - STATUS UPDATED WHEN I/O INTERRUPTS 00130000
* ARE REFLECTED TO A USER 00131000
* ECBLOK - VMBLOK EXTENSION FOR EXTENDED MODE VIRTUAL MACHINES 00132000
* 00133000
* MACROS 00134000
* 00135000
* ABEND - TO TERMINATE THE SYSTEM 00136000
* CALL - TO LINK TO ANOTHER SYSTEM ROUTINE 00137000
* CHARGE - TO MANAGE THE CPU TIMER FACILITY 00138000
* COUNT - TO INCREMENT A COUNT 00139000
* GOTO - TO TRANSFER CONTROL UNCONDITIONALLY 00140000
* LOCK - TO OBTAIN AND RELEASE A SYSTEM LOCK 00141000
* SIGNAL - TO SIGNAL THE OTHER PROCESSOR 00142000
* TRACE - TO LOCATE THE CURREN TRACE TABLE ENTRY 00143000
* TRANS - TO BRING A PAGEABLE PAGE INTO REAL STORAGE 00144000
* 00145000
* REGISTER USAGE - 00146000
* 00147000
* GPR0-5 - SCRATCH 00148000
* GPR6 - VCHBLOK BASE 00149000
* GPR7 - VCUBLOK BASE 00150000
* GPR8 - VDEVBLOK BASE; 2ND LEVEL SUBROUTINE LINKAGE 00151000
* GPR9 - 1ST LEVEL SUBROUTINE LINKAGE 00152000
* GPR10 - IOBLOK BASE 00153000
* GPR11 - VMBLOK BASE 00154000
* GPR12 - DMKDSP BASE 00155000
* GPR13 - SECOND BASE REGISTER 00156000
* GPR14 - EXTERNAL LINKAGE 00157000
* GPR15 - EXTERNAL LINKAGE 00158000
*. 00159000
EJECT 00160000
COPY OPTIONS 00161000
COPY LOCAL OPTIONS 00162000
SPACE 2 00163000
DMKDSP CSECT 00164000
SPACE 3 00165000
ENTRY DMKDSPCH 00166000
AIF (NOT &AP).UPTST0 **AIF*** 00166900
ENTRY DMKDSPRU @V407508 00167000
ENTRY DMKDSPRC COUNTER FOR DMKDSPRU @V407508 00168000
.UPTST0 ANOP **ANOP** 00168100
ENTRY DMKDSPQS 00169000
ENTRY DMKDSPRQ 00170000
ENTRY DMKDSPA 00171000
ENTRY DMKDSPB 00172000
ENTRY DMKDSPNP 00173000
ENTRY DMKDSPIT,DMKDSPCK,DMKDSPPT @V2B2638 00174000
ENTRY DMKDSPAC,DMKDSPBC,DMKDSPCC,DMKDSPEC - COUNTERS @V386198 00175000
ENTRY DMKDSP0,DMKDSP1,DMKDSP2 - CP ASSIST INST. ADDRS @V3M4026 00176000
ENTRY DMKDSPE REFLECT VIRT. TIMER INTS. @V386198 00177000
SPACE 00178000
EXTRN DMKERMSG @V386198 00179000
EXTRN DMKTRCPG 00180000
EXTRN DMKUSOFF 00181000
EXTRN DMKVIOMK 00182000
EXTRN DMKSCNVU 00183000
EXTRN DMKCFMBK 00184000
EXTRN DMKCVTBH @VA03802 00185000
EXTRN DMKSCHDL 00186000
EXTRN DMKSCHRL 00187000
EXTRN DMKPERIL PER001 00188100
EXTRN DMKPRGSM @VA05647 00189000
EXTRN DMKPTRRC @VA01321 00190000
EXTRN DMKPTRFD,DMKPTRFE,DMKPTRFP,DMKIOSER,DMKIOSRC @VA02760 00191000
EXTRN DMKVATAB 00192000
EXTRN DMKVMASH @V60BC11 00193100
EXTRN DMKVATBC 00194000
EXTRN DMKVATEX @V213135 00195000
EXTRN DMKVATMD 00196000
EXTRN DMKVMCEX @V387045 00197000
EXTRN DMKCCHRF @V508690 00197100
AIF (NOT &TRACE(6)).VR10A 00198000
EXTRN DMKTRCEX,DMKTRCIO,DMKTRCIT 00199000
.VR10A ANOP 00200000
EXTRN DMKMCHSE @VA07369 00201100
AIF (NOT &AP).UPTST0A **AIF*** 00201200
EXTRN DMKLOKPS,DMKLOKSY @VA07369 00201300
EXTRN DMKSCHTQ,DMKMCTPR @V407508 00202000
EXTRN DMKSTKMP,DMKSTKDE @V407508 00203000
.UPTST0A ANOP **ANOP** 00203100
SPACE 2 00204000
USING PSA,R0 00205000
USING VMBLOK,R11 00206000
USING DMKDSP,R12,R13 @V387045 00207000
EJECT 00208000
*. 00209000
* OPERATION - 00210000
* 00211000
* A. PROCESSING AT ENTRY 00212000
* 1. MAIN DISPATCH ENTRY POINT - IF CPSTATUS SWITCH INDICATES 00213000
* A STACKED REQUEST WAS BEING PROCESSED, GO TO SECTION D. TO 00214000
* START CHECKING OUT USER'S STATUS. 00215000
* IF CPSTATUS INDICATES RETURN FROM WAIT OR FROM RUNNING A 00216000
* USER, BAL TO THE APPROPRIATE ROUTINE TO ACCOUNT FOR THE 00217000
* TIME, AND PROCEED TO SECTION D TO CHECK OUT THE USER. IF 00218000
* CPSTATUS INDICATES RETURN FROM RUNNING A USER AND THERE 00219000
* HAS BEEN NO CHANGE TO THAT USER'S STATUS, GO DIRECTLY TO 00220000
* SECTION F, BYPASSING SECTIONS D AND E. 00221000
* 2. FAST REFLECT ENTRY POINT - IF CPSTATUS INDICATES THE 00222000
* SYSTEM WAS NOT RUNNING A USER, OR IF THAT USER IS NO 00223000
* LONGER RUNNABLE, OR IF THE SYSTEM IS EXTENDING, THE FAST 00224000
* REFLECT PATH IS NOT CONTINUED. IF THE SYSTEM LOCK IS HELD 00225000
* OR CAN BE OBTAINED, CONTINUE PROCESSING IN STEP 1 ABOVE; 00226000
* OTHERWISE, CONTINUE PROCESSING IN STEP 5 BELOW. IF THE 00227000
* USER IS RUNNING VIRTUAL TIMERS, BAL TO THE ACCOUNTING 00228000
* ROUTINE TO UPDATE AND TEST THE USER'S VIRTUAL TIMERS. IF 00229000
* THE USER IS STILL DISPATCHABLE, INSERT THE PROGRAM MASK 00230000
* AND CONDITION CODE FROM THE VIRTUAL PSW INTO THE 00231000
* APPROPRIATE OLD PSW (EITHER I/O OR PROGRAM), STORE THE 00232000
* UPDATED PSW IN RUNPSW, AND RE-DISPATCH. 00233000
* 3. NEW PSW ENTRY POINT - IF THE PSW HAS BEEN ALTERED OUTSIDE 00234000
* OF DMKDSP, FIRST DO ACCOUNTING AS IN STEP 1 ABOVE; THEN 00235000
* GO DIRECTLY TO THE PSW VALIDATION ROUTINE (SECTION E). 00236000
* 4. VIRTUAL TIMER INTERRUPT ENTRY - FIRST QUEUE AN EXTERNAL 00237000
* INTERRUPT BLOCK FOR THIS INTERRUPT. THEN DO ACCOUNTING FOR 00238000
* THE RUNNING USER, AND GO TO SECTION D TO CHECK OUT THE 00239000
* USER'S STATUS. 00240000
* 5. RUN-USER ENTRY POINT - IF CPSTATUS INDICATES RETURN FROM 00241000
* WAIT OR FROM RUNNING A USER, BAL TO THE APPROPRIATE 00242000
* ROUTINE TO ACCOUNT FOR THE TIME. IF THE SYSTEM WAS 00243000
* RUNNING A USER AND THERE IS A TIMER INTERRUPT PENDING FOR 00244000
* THAT USER, VERIFY THAT THE USER HAS A DEFERRED INTERRUPT 00245000
* TASK STACKED. IF NOT, SET UP AND STACK THE DEFERRED TASK 00246000
* FOR ENTRY TO DMKDSPCH. THEN UNLOCK LASTUSER IF LASTUSER 00247000
* WAS NOT USING SHARED SYSTEMS. IF THERE IS NO SPECIAL 00248000
* SITUATION (SUCH AS EXTEND OR A QUIESCE SIGNAL) PENDING, 00249000
* GO TO SECTION H TO SELECT A USER FOR DISPATCHING. 00250000
* 00251000
* 00252000
* 00253000
* 00254000
*********************************************************************** 00255000
* 00256000
* 00257000
* CP ASSIST INSTRUCTION "DSP0" - MAIN ENTRY TO DISPATCH 00258000
* (ALSO USED BY FAST DISPATCH ENTRY (DMKDSPA) 00259000
* SINCE THE ASSIST IS QUICKER THAN THE "FAST" 00260000
* SOFTWARE.) 00261000
* 00262000
* 00263000
* OPERANDS: 00264000
* 1 = ADDRESS OF 'DSP0LIST' (DATA LIST) 00265000
* 2 = ADDRESS OF 'DSP0EXIT' (EXIT LIST) 00266000
* 00267000
* REGISTER INPUT: 00268000
* GPR 11 = VMBLOK ADDRESS BEING CHARGED FOR CP OVERHEAD TIME 00269000
* 00270000
* SYSTEM DATA AREAS REFERENCED (BY MODULE WHERE APPLICABLE): 00271000
* DMKPSA - 'CPSTATUS', 'IOOPSW', 'PROBSTRT', 'PROBTIME', 00272000
* 'QUANTUM', 'QUANTUMR', 'RUNUSER', 'TIMER' 00272100
* ECBLOK, PAGE TABLE, SEGMENT TABLE, VMBLOK, XINTBLOK 00273000
* USER'S VIRTUAL PAGE ZERO (IF RESIDENT) 00274000
* 00275000
* 00276000
* EXITS TO SPECIFIED OPERAND 2 LIST ADDRESSES: 00277000
* NOTE: THE CONTENT OF ANY GPR NOT SPECIFIED IN THE FOLLOWING 00278000
* LISTS, EXCEPT GPRS 12 AND 13, MAY BE UNPREDICTABLE. 00279000
* 00280000
* +0 'DISPATCH' (NORMAL EXIT - CAN'T UNSTACK ANY INTERRUPTS) 00281000
* REGISTER OUTPUT: 00282000
* GPR 11 = ADDRESS OF VMBLOK OF 'RUNUSER' 00283000
* 00284000
* +4 'DMKDSPC3' (EXIT IF SYSTEM COMING FROM WAIT STATE) 00285000
* REGISTER OUTPUT: 00286000
* GPR 11 = SAME AS ENTRY CONTENTS 00287000
* 00288000
* +8 'XINTQUE' (VIRTUAL LOC. 80 TIMER INTERRUPT TO BE QUEUED) 00289000
* REGISTER OUTPUT: 00290000
* GPR 3 = VALUE OF ZERO 00291000
* GPR 4 = VALUE OF X'00800080' 00292000
* GPR 9 = ADDRESS OF 'DMKDSPC4' 00293000
* GPR 11 = ADDRESS OF VMBLOK OF 'RUNUSER' 00294000
* 00295000
* +12 'DISPATCH' ('RUNUSER' IS NOT RUNNABLE - IN CP WAIT) 00296000
* REGISTER OUTPUT: SAME AS EXIT TO +0 'DISPATCH' 00297000
* 00298000
* +16 'CKPER' (CAN DO UNSTACK OF A PER OR PAGE FAULT INTERRUPT) 00299000
* REGISTER OUTPUT: SAME AS EXIT TO +0 'DISPATCH' 00300000
* 00301000
* +20 'UNSTPRTY' (CAN UNSTACK EXTERNAL INTERRUPT FOR 'RUNUSER') 00302000
* REGISTER OUTPUT: 00303000
* GPR 4 = 'XINTMASK' BITS THAT ARE ON (IN BITS 16-31) 00304000
* GPR 5 = ADDRESS OF PREVIOUS XINTBLOK (OR 'VMPXINT') 00305000
* GPR 6 = ADDRESS OF CURRENT XINTBLOK (INT. TO REFLECT) 00306000
* GPR 11 = ADDRESS OF VMBLOK OF 'RUNUSER' 00307000
* 00308000
* +24 'GETIOINT' ('RUNUSER' ENABLED FOR I/O AND I/O INT PENDING) 00309000
* REGISTER OUTPUT: 00310000
* GPR 7 = 'VMIOINT' ANDED WITH CHAN. MASKS (IN BITS 0-15) 00311000
* GPR 11 = ADDRESS OF VMBLOK OF 'RUNUSER' 00312000
* 00313000
* +28 'CKWAITST' (VIRTUAL PSW OF 'RUNUSER' HAS WAIT BIT SET ON) 00314000
* REGISTER OUTPUT: SAME AS EXIT TO +0 'DISPATCH' 00315000
* 00316000
* +32 'RUNTIME' (TIMER UPDATING WILL CAUSE AN ABEND CONDITION) 00317000
* REGISTER OUTPUT: SAME AS EXIT TO +0 'DISPATCH' 00318000
* 00318100
* +36 'UNLOCK' (NO STATUS CHANGE HAS OCCURRED) 00318200
* REGISTER OUTPUT: SAME AS EXIT TO +0 'DISPATCH' 00318300
* 00319000
*********************************************************************** 00320000
*. 00321000
SPACE 00322000
DMKDSPCH EQU * MAIN ENTRY - "THE END OF THE WORLD" 00323000
LR R13,R12 LOAD SECOND BASE REG. @VA05545 00324000
AL R13,F4096 WITH ADDRESS @VA05545 00325000
SPACE 00326000
DS 0H EXECUTE CP ASSIST "DSP0" @V3M4026 00327000
DMKDSP0 DC X'E60D',S(DSP0LIST,DSP0EXIT) ***@V3M4026 00328000
SPACE 00329000
LA R9,1 INCREMENT %V3M4038 00330000
AL R9,DMKDSPCC THIS PATH COUNT %V3M4038 00331000
ST R9,DMKDSPCC ... %V3M4038 00332000
DSPC0 DS 0H TEST CPSTATUS SWITCH %V407508 00333000
TM CPSTATUS,CPRUN RUNNING USER? %V408246 00334000
BO DMKDSPC2 YES, CHECK OUT %V408246 00335000
DMKDSPC1 DS 0H %V408246 00336000
TM CPSTATUS,CPWAIT WAS SYSTEM IN WAIT STATE? %V408246 00337000
AIF (&AP).APBR1 **AIF*** 00338000
BZ UNSTACK NO, MUST BE CP REQUEST BLOCK %VA07369 00338100
AGO .UPBR1 **AGO*** 00338200
.APBR1 ANOP **ANOP** 00338300
BZ DMKDSPC5 NO, MUST BE CP REQUEST BLOCK %VA07369 00338400
.UPBR1 ANOP **ANOP** 00338500
DMKDSPC3 DS 0H %V408246 00339000
BAL R9,WAITIME YES -- DO WAIT TIME ACCOUNTING @V408246 00340000
B UNLKLAST SEE IF LASTUSER SHOULD BE @V407508 00341000
* UNLOCKED @V407508 00342000
* 00343000
DMKDSPC2 DS 0H VIRT. MACHINE WAS EXECUTING %V408246 00344000
BAL R9,RUNTIME DO RUN TIME CLEAN UP %V408246 00345000
DMKDSPC4 DS 0H %V408246 00346000
TM IOOPSW,4 VIRT. PSW IN I/O OLD? %V408246 00347000
BZ UNSTACK NO, CHECK FOR STATUS CHANGE %V408246 00348000
TM VMDSTAT,VMDSP YES, CLEAN STATUS? %V408246 00349000
BO UNLOCK YES, NO FURTHER CHECKING NEEDED %V407508 00350000
B UNSTACK NO, CHECK FURTHER %V408246 00351000
SPACE 00352000
AIF (NOT &AP).UPTST1 **AIF*** 00352900
DMKDSPC5 DS 0H STACKED BLOK WAS BEING PROCESSED %V407508 00353000
TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? %V407508 00354000
BZ UNSTACK NO, CONTINUE AS IN UP-MODE %V4M0136 00355000
CLC LPUADDR,VMLOCK+2 IS VM LOCKED BY THIS PROC? @V407508 00356000
BE UNSTACK YES, CONTINUE NORMALLY @V4M0136 00357000
CHARGE STOP STOP CHARGING CURRENT VMBLOK @V4M0173 00358000
L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK @V4M0173 00359000
* SYSTEM VMBLOK @V407508 00360000
B UNLKLAST GO TRY TO UNLOCK LASTUSER @V407508 00361000
.UPTST1 ANOP **ANOP** 00361100
EJECT 00362000
* THE FOLLOWING TWO DATA LISTS MUST BE KEPT CONTIGUOUS AND IN ORDER 00363000
* BECAUSE THEY ARE USED BY THE CP ASSIST INSTRUCTION "DSP0". 00364000
SPACE 2 00365000
DSP0LIST DS 0F "DSP0" ASSIST DATA LIST @V3M4026 00366000
SPACE 00367000
DMKDSPCC DC F'0' +0 COUNT OF ENTRIES TO DMKDSPCH @V3M4026 00368000
DC A(DMKDSPC4) +4 FOR EXIT WHEN ACCOUNTING DONE @V408246 00369000
SPACE 2 00370000
DSP0EXIT DS 0F "DSP0" ASSIST EXIT LIST @V3M4026 00371000
SPACE 00372000
DC A(DISPATCH) +0 "ALL HAS GONE WELL" @V386198 00373000
DC A(DMKDSPC3) +4 SYSTEM COMING FROM WAIT STATE @V408246 00374000
DC A(XINTQUE) +8 VIRTUAL TIMER WENT NEGATIVE @V386198 00375000
DC A(DISPATCH) +12 'RUNUSER' IS NOT RUNNABLE @V386198 00376000
DC A(CKPER) +16 PER OR PAGE FAULT PENDING @V386198 00377000
DC A(UNSTPRTY) +20 EXT. INT. CAN BE UNSTACKED @V386198 00378000
DC A(GETIOINT) +24 I/O INT. CAN BE UNSTACKED @V386198 00379000
DC A(CKWAITST) +28 VIRT. PSW HAS 'WAIT' BIT ON @V386198 00380000
DC A(RUNTIME) +32 ABEND CONDITION DETECTED @V408246 00381000
DC A(UNLOCK) +36 EXIT IF CLEAN STATUS @V407508 00382000
EJECT 00383000
DMKDSPA DS 0H FAST REFLECT AFTER INSTR. @V213235 00384000
* SIMULATION 00385000
USING *,R12 @V213235 00386000
LM R12,R13,DSPBASE LOAD UP BASE REGS @V387045 00387000
USING DMKDSP,R12,R13 @V387045 00388000
COUNT DMKDSPAC INCREMENT FAST REFLECT COUNT @V407508 00389000
TM CPSTATUS,CPRUN RUNNING USER? @V408246 00390000
BZ TESTSYS NO, TEST FOR SYSTEM LOCK @V4M0173 00391000
TM VMRSTAT,VMNORUN VMBLOK RUNNABLE? @V408246 00392000
BNZ TESTSYS NO, TEST FOR SYSTEM LOCK @V407508 00393000
TM PROPSW+1,PROBMODE MONITOR CALL BUSY? @V408246 00394000
BZ TESTSYS YES, TEST FOR SYSTEM LOCK @V407508 00395000
L R2,PREFIXA GET PROCESSOR PREFIX ADDRESS @V407508 00396000
CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? @V407508 00397000
BE TESTSYS YES, TEST FOR SYSTEM LOCK @V407508 00398000
L R2,VMSTKCNT GET COUNT OF STACKED BLOCKS @V4M0173 00399000
LTR R2,R2 ARE ANY BLOCKS STACKED FOR VM? @V4M0173 00400000
BNZ TESTSYS YES, GO TEST FOR SYSTEM LOCK @V4M0173 00401000
TM VMPEND,VMPERPND PER PENDING? PER001 00401100
BO TESTSYS YES, TEST FOR SYSTEM LOCK PER001 00401200
LM R0,R2,QUANTUMR RESID., CURRENT, AND ORIG. @V408246 00402000
* TIME-SLICE 00403000
LTR R1,R1 ANY CURRENT LEFT? @V408246 00404000
BNP TESTSYS NO, TEST FOR SYSTEM LOCK @V407508 00405000
ST R1,QUANTUM CHECKPOINT TIMER @V408246 00406000
TM VMMCR6,VMMFE+VMMVTMR VIRTUAL TIMER RUNNING? @V408246 00407000
BO DMKDSPAA YES, NO NEED FOR UPDATE @V408246 00408000
TM VMTLEVEL,VMTON+VMRON VIRTUAL TIMERS RUNNING? @V408246 00409000
BZ DMKDSPAA NO @V408246 00410000
SR R2,R0 VIRTUAL TIME USED @V408246 00411000
LR R0,R2 PROPER REGISTER @V408246 00412000
BAL R9,UPVIRT YES, UPDATE VIRT. LOCATION 80 @V408246 00413000
TM VMDSTAT,VMDSP STILL DISPATCHABLE? @V408246 00414000
BO DMKDSPA1 YES @V408246 00415000
MVI CPSTATUS,CPEX+CPSUPER SHOW TIMER WAS UPDATED @V407508 00416000
BAL R8,INCPROBT GO INCREMENT PROBLEM STATE TIME @V407508 00417000
AIF (&AP).APBR2 **AIF*** 00417100
B DMKDSPC4 CONTINUE AT MAIN ENTRY @VA07369 00417200
AGO .UPBR2 **AGO*** 00417300
.APBR2 ANOP **ANOP** 00417400
* IN UP-MODE, SUBROUTINE TSTSYS IS A NO-OP. 00418000
BAL R9,TSTSYS TEST FOR AND OBTAIN SYSTEM LOCK @V407508 00419000
BZ DMKDSPC4 IF LOCK OBTAINED GOTO MAIN ENTRY @V407508 00420000
B DSPR1 YES, MAKE ADDITIONAL TESTS @V407508 00421000
.UPBR2 ANOP **ANOP** 00421100
SPACE 00422000
DMKDSPAA DS 0H @V408246 00423000
TM VMDSTAT,VMDSP ABLE TO FAST REDSP? @V408246 00424000
BO DMKDSPA1 YES, CONTINUE FAST REDISPATCH @V407508 00425000
TESTSYS DS 0H TEST FOR SYSTEM LOCK @V407508 00426000
AIF (&AP).APBR3 **AIF*** 00426100
B DSPC0 CONTINUE AT MAIN ENTRY @VA07369 00426200
AGO .UPBR3 **AGO*** 00426300
.APBR3 ANOP **ANOP** 00426400
* IN UP-MODE, SUBROUTINE TSTSYS IS A NO-OP. 00427000
BAL R9,TSTSYS TEST FOR AND OBTAIN SYSTEM LOCK @V407508 00428000
BZ DSPC0 GOTO MAIN ENTRY IF LOCK OBTAINED @V407508 00429000
B DSPR0 ELSE, GOTO UNLOCKED ENTRY @V407508 00430000
.UPBR3 ANOP **ANOP** 00430100
SPACE 00431000
DMKDSPA1 DS 0H @V408246 00432000
AIF (NOT &AP).UPTST2 **AIF*** 00432900
TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? @V407508 00433000
BNO GETPSW NO, SKIP TEST FOR SYSTEM LOCK @V407508 00434000
L R2,=A(DMKLOKSY+2) GET ADDRESS OF SYSTEM LOCK @V407508 00435000
CLC LPUADDR,0(R2) IS SYSTEM LOCK HELD BY THIS PROC @V407508 00436000
BNE FINDPSW DETERMINE CORRECT OLD PSW @V4M0173 00437000
BAL R9,FREESYS FREE SYSTEM LOCK @V407508 00438000
FINDPSW DS 0H @V4M0173 00439000
TM IOOPSW,7 VIRTUAL PSW IN IOOLD? @V4M0173 00440000
BNO GETPSW NO, MUST BE PROPSW @V4M0173 00441000
LM R0,R1,IOOPSW GET INTERRUPT PSW @V4M0173 00442000
MVI IOOPSW,0 FLAG I/O OLD PSW NOT VIRTUAL @V4M0173 00443000
B DMKDSPA2 CONTINUE FAST DISPATCH @V4M0173 00444000
GETPSW DS 0H @V407508 00445000
.UPTST2 ANOP **ANOP** 00445100
LM R0,R1,PROPSW RESTART WITH OLD PSW @V408246 00446000
DMKDSPA2 DS 0H @V408246 00447000
TM VMPSTAT,VMV370R EXTENDED MACHINE? @V408246 00448000
BZ DMKDSPA3 NO @V408246 00449000
L R2,VMECEXT PNTR. TO VMBLOK 370R EXTENSION @V408246 00450000
LCTL C4,C5,EXTCR4-ECBLOK(R2) RELOAD POSSIBLE NEW CRS @V408246 00451000
LCTL C7,C13,EXTCR7-ECBLOK(R2) . . @V408246 00452000
TM VMTRCTL,VMTRPER IS "PER" TRACING ACTIVE ? @V408246 00453000
BZ *+12 NO. @V408246 00454000
L R2,VMPERCTL POINT TO PER BLOCK PER001 00455100
LCTL C9,C11,PERCR9-PERBLOK(R2) PER001 00456100
TM VMESTAT,VMEXTCM EXTENDED MODE PSW? @V408246 00457000
BZ DMKDSPA3 NO @V408246 00458000
ICM R0,B'0010',VMPSW+2 GET CURRENT C.C. @V408246 00459000
B RTNADDR SET UP RETURN ADDRESS @V408246 00460000
DMKDSPA3 DS 0H @V408246 00461000
NI VMPSW+4,X'3F' CLEAR ILC @V408246 00462000
ICM R0,B'0010',VMPSW+4 GET CURRENT C.C. @V408246 00463000
RTNADDR DS 0H @V408246 00464000
STM R0,R1,RUNPSW SET-UP NEW PSW @V408246 00465000
TM VMESTAT,VMINVPAG+VMINVSEG+VMNEWCR0 ANY RELOC. @V408246 00466000
* CHANGE? 00467000
BZ LDRPSW NO, . . . GO @V408246 00468000
B PERHAPS YES, HANDLE IN NORMAL WAY @V408246 00469000
EJECT 00470000
DMKDSPB DS 0H ENTERED AFTER VIRT. PSW CHANGE @V408246 00471000
USING *,R12 TEMPORARY ADDRESSABILITY 00472000
LM R12,R13,DSPBASE LOAD UP BASE REGS @V387045 00473000
USING DMKDSP,R12,R13 @V387045 00474000
LA R9,1 INCREMENT @V408246 00475000
AL R9,DMKDSPBC DISPATCH ENTRIES AFTER PSW CHANGE@V408246 00476000
ST R9,DMKDSPBC ... 00477000
LA R9,CKPSW SET EXIT ADDRESS 00478000
TM CPSTATUS,CPEX HERE VIA STACKED REQUEST ?? 00479000
BCR 1,R9 YES -- GO CHECK OUT NEW PSW 00480000
TM CPSTATUS,CPWAIT ENTERED AFTER WAIT 00481000
BO WAITIME YES -- 00482000
B RUNTIME GO HANDLE NORMALLY @V386198 00483000
SPACE 1 00484000
CKPSW BAL R9,PSWCKSUB GO CHECK OUT NEW PSW @VA05647 00485000
BZ CKPEND CONTINUE IF IT LOOKS OK @VA05647 00486000
SPACE 1 00487000
SPECPSW EQU * TAKE PSW SPEC CHECK INTERRUPT @VA05647 00488000
LA R0,X'06' SPECIFICATION EXCEPTION CODE @VA05647 00489000
SLR R1,R1 ZERO ILC FOR THE INTERRUPT @VA05647 00490000
STH R1,VMPRGIL ... @VA05647 00491000
GOTO DMKPRGSM GO SWAP PSW'S, ETC....... @VA05647 00492000
SPACE 2 00493000
DMKDSPE EQU * ENTERED IF VIRTUAL TIMER INTERRUPT OCCURS @V386198 00494000
USING *,R12 TEMPORARY @V386198 00495000
LM R12,R13,DSPBASE LOAD BASE REGISTERS @VA05545 00496000
USING DMKDSP,R12,R13 @VA05545 00497000
LA R9,1 INCREMENT @V408246 00498000
AL R9,DMKDSPEC COUNT ENTRIES TO TIMER REFLECT @V408246 00499000
ST R9,DMKDSPEC ... @V386198 00500000
NI VMDSTAT,X'FF'-VMDSP INELIGIBLE FOR FAST DSPCH @V386198 00501000
SLR R3,R3 CLEAR FOR 'XINTQUE' SUBROUTINE @V386198 00502000
L R4,=X'00800080' LOC. 80 TIMER INTERRUPT CODE @V3M4026 00503000
BAL R9,XINTQUE GO QUEUE THE EXTERNAL INTERRUPT @V3M4026 00504000
AIF (&AP).APBR4 @V5DAACD 00505010
LA R9,UNSTACK @V5DAACD 00505020
B RUNTIME @V5DAACD 00505030
AGO .UPBT4 00505040
.APBR4 ANOP @V5DAACD 00505050
* IN UP-MODE, SUBROUTINE TSTSYS IS A NO-OP @V5DAACD 00505060
BAL R9,RUNTIME @V5DAACD 00505070
BAL R9,TSTSYS TEST FOR AND OBTAIN SYSTEM LOCK @V5DAACD 00505080
BZ UNSTACK UNSTACK IF LOCK OBTAINED. @V5DAACD 00505090
BAL R9,STKDEF ELSE, GO DEFER IT. @V5DAACD 00505100
B SWITCH AND SWITCH TO ASYSVM @V5DAACD 00505110
.UPBT4 ANOP @V5DAACD 00505120
SPACE 00505130
EJECT 00507000
AIF (NOT &AP).UPTST3 **AIF*** 00507900
DMKDSPRU DS 0H ENTRY TO RUN ANOTHER USER @V407508 00508000
USING *,R12 TEMPORARY ADDRESSABILITY @V407508 00509000
LM R12,R13,DSPBASE LOAD BASE REGS @V407508 00510000
USING DMKDSP,R12,R13 SET UP ADDRESSABILITY @V407508 00511000
COUNT DMKDSPRC INCREMENT THIS ENTRY'S COUNT @V407508 00512000
TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? @V407508 00513000
BO DSPR0 YES, O.K. TO CONTINUE @V407508 00514000
ABEND 6 TERMINATE VM/370 @V407508 00515000
DSPR0 DS 0H BEGIN PROCESSING @V407508 00516000
TM CPSTATUS,CPRUN WAS SYSTEM RUNNING A USER? @V407508 00517000
BZ DSPR2 NO,GO TEST FOR WAIT @V407508 00518000
BAL R9,RUNTIME DO RUN TIME ACCOUNTING @V407508 00519000
L R2,=A(DMKLOKSY+2) GET ADDRESS OF SYSTEM LOCK @V407508 00520000
CLC LPUADDR,0(R2) IS SYSTEM LOCK HELD BY THIS PROC @V407508 00521000
BE DMKDSPC4 YES, CONT AT MAIN ENTRY @V407508 00522000
SPACE 00523000
DSPR1 DS 0H TEST IF SYSTEM LOCK IS HELD @V407508 00524000
TM VMDSTAT,VMDSP IS VM STILL DISPATCHABLE @V407508 00525000
BO SWITCH YES, STILL O.K. @V407508 00526000
BAL R9,STKDEF NO, INSURE A DEF TASK IS STACKED @V407508 00527000
B SWITCH CONTINUE PROCESSING @V407508 00528000
SPACE 00529000
DSPR2 DS 0H TEST FOR SYSTEM IN WAIT @V407508 00530000
TM CPSTATUS,CPWAIT WAS SYSTEM IN WAIT STATE? @V407508 00531000
BZ DSPR3 NO, GO TRY TO UNLOCK LASTUSER @V407508 00532000
BAL R9,WAITIME YES, DO WAIT TIME ACCOUNTING @V407508 00533000
B SWITCH2 CONTINUE PROCESSING @V407508 00534000
SPACE 00535000
DSPR3 DS 0H TRY TO UNLOCK LASTUSER @V407508 00536000
LR R1,R11 GET CURRENT R11 VMBLOK ADDR @V407508 00537000
BAL R8,UNLOKVM UNLOCK THIS VMBLOK IF LOCKED @V407508 00538000
ICM R1,B'1111',STACKVM GET ADDR OF UNSTACKED VMBLOK @V407508 00539000
BZ SWITCH NO VMBLOK ADDRESS THERE @V407508 00540000
BAL R8,UNLOKVM UNLOCK THIS VMBLOK IF LOCKED @V407508 00541000
XC STACKVM(4),STACKVM CLEAR ADDR OF UNSTKED VMBLOK @V407508 00542000
SWITCH DS 0H SWITCH TO ASYSVM @V407508 00543000
CHARGE STOP STOP CHARGING CURRENT VMBLOK @V4M0173 00544000
L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK @V4M0173 00545000
SWITCH2 DS 0H @V407508 00546000
L R1,LASTUSER GET VALUE OF LASTUSER @V407508 00547000
CR R1,R11 IS LASTUSER EQUAL TO ASYSVM? @V407508 00548000
BE TSTXTND YES, ALREADY UNLOCKED @V407508 00549000
TM VMOSTAT-VMBLOK(R1),VMSHR WAS LASTUSER USING @V407508 00550000
* SHARED SYSTEMS? @V407508 00551000
BO TSTXTND YES, DO NOT UNLOCK YET @V407508 00552000
BAL R8,UNLOKVM2 UNLOCK LASTUSER @V407508 00553000
ST R11,LASTUSER SET LASTUSER TO ASYSVM @V407508 00554000
TSTXTND DS 0H @V407508 00555000
* 00555050
* IF A DISPATCH SIGNAL HAS BEEN RECEIVED, IT MUST BE 00555100
* PROCESSED UNLESS ONE OF THE SPECIAL CONDITIONS IS PRESENT 00555150
* 00555200
LA R5,CKUSERS SET EXIT ADDRESS @VA08873 00555250
TM XCPEND,XCDISP DISPATCH SIGNAL PENDING? @VA08873 00555300
BZ TSTXTND2 NO, GO TEST FOR EXTEND @VA08873 00555350
LA R5,SPIN YES, SET UP TO SPIN FOR LOCK @VA08873 00555400
L R3,XCPEND PICK UP WORD OF FLAGS @VA08873 00555450
DSPXC DS 0H ACKNOWLEDGE DISPATCH SIGNAL @VA08873 00555500
LR R4,R3 MOVE FLAGS TO WORK REG @VA08873 00555550
N R4,DISPWKUP TURN OFF DISPATCH & WAKEUP @VA08873 00555600
CS R3,R4,XCPEND STORE ALTERED WORD OF FLAGS @VA08873 00555650
BNE DSPXC KEEP TRYING @VA08873 00555700
TSTXTND2 DS 0H TEST FOR EXTEND @VA08873 00555750
L R2,PREFIXA GET PROCESSOR PREFIX ADDRESS @V407508 00556000
CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? @V407508 00557000
BNE TESTQSC NO, TEST FOR QUIESCE @V407508 00558000
TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? @V407508 00559000
BO TSTXTNDP YES, GO TEST FOR EXTEND PENDING @V407508 00560000
BAL R9,XTNDAP DO AP-ONLY EXTEND PROCESSING @V407508 00561000
TSTXTNDP DS 0H TEST FOR EXTEND PENDING @V407508 00562000
TM EMSPEND,EMSPEXT IS EXTEND PENDING FLAG ON? @V407508 00563000
BNO NOXTNDP NO, SKIP TURNING OFF XTND PNDG @V407508 00564000
NI EMSPEND,X'FF'-EMSPEXT TURN OFF EXTEND PENDING @V407508 00565000
OI EMSREC,EMSREXT TURN ON EXTEND RECEIVED FLAG @V407508 00566000
NOXTNDP DS 0H @V407508 00567000
TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? @V407508 00568000
BO SPIN YES, GO TO SPIN ON SYSTEM LOCK @V407508 00569000
SR R0,R0 CLEAR R0 INDICATE END COND @V407508 00570000
LA R1,XTNDLOCK-PSA(,R2) GET ADDR OF EXTEND LOCK @V407508 00571000
O R1,=A(X'80000000') TURN ON HIGH ORDER BIT @V407508 00572000
CALL DMKLOKPS SPIN TILL EXTEND COMPLETES @V407508 00573000
TESTQSC DS 0H @V407508 00574000
TM EMSPEND,EMSPQUI+EMSINQSC TEST FOR QUIESCE @V4M0210 00575000
* PENDING OR IN-QUIESCE STATUS @V4M0210 00576000
BZ TESTFRLK NEITHER ON, GO TEST FRELK FLAG @V4M0210 00577000
TM EMSPEND,EMSPQUI IS QUIESCE PENDING FLAG ON? @V4M0210 00578000
BNO IDLEB NO, MUST BE IN-QUIESCE @V4M0210 00579000
NI EMSPEND,X'FF'-EMSPQUI TURN OFF QUIESCE PENDING @V4M0210 00580000
OI EMSPEND,EMSINQSC TURN ON IN-QUIESCE FLAG @V4M0210 00581000
OI EMSREC,EMSRQUI TURN ON QUIESCE RECEIVED FLAG @V407508 00582000
B IDLEB GO LOAD WAIT STATE @V407508 00583000
TESTFRLK DS 0H @V407508 00584000
CLI CPFRELK-PSA(R2),SET IS CPFRELK FLAG ON? @V407508 00585000
BNE TESTMCLK NO, GO TEST MCH FLAG @V4M0006 00586000
CLC FRLKPROC-PSA(1,R2),LPUADDR+1 IS THIS FRELK PROC @V407508 00587000
BE SPIN YES, GO TO SPIN ON SYSTEM LOCK @V4M0006 00588000
TESTMCLK DS 0H @V407508 00589000
TM APSTAT4,CPMCHSE IS MCH SOFT ERROR FLAG ON? @VA07615 00590100
* 00591200
* AT THIS POINT, NONE OF THE SPECIAL CONDITIONS IS PRESENT 00591300
* IF DISPATCH SIGNAL HAS BEEN RECEIVED, MUST SPIN FOR LOCK 00591400
* 00591500
BNOR R5 EITHER CKUSERS OR SPIN @VA08873 00591600
SPIN DS 0H SPIN UNTIL SYSTEM LOCK IS FREE @V407508 00592000
LOCK OBTAIN,TYPE=SYS,SPIN=YES GO GET SYSTEM LOCK @V407508 00593000
CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? @V407508 00594000
BNE TSTFRLK NO, GO TEST FRELK FLAG @V4M0006 00595000
TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? @V407508 00596000
BO FLAGCPEX YES, DO NORMAL EXTEND PROCESSING @VA07228 00597000
TSTFRLK DS 0H @V407508 00598000
CLI CPFRELK-PSA(R2),SET IS CPFRELK FLAG ON? @V407508 00599000
BNE TSTMCLK NO, GO TEST MCH FLAG @V4M0006 00600000
CLC FRLKPROC-PSA(1,R2),LPUADDR+1 IS THIS FRELK PROC @V407508 00601000
BE FNDPBLOK YES, GO FIND PRIORITY CPEXBLOK @V4M0141 00602000
TSTMCLK DS 0H @V407508 00603000
TM APSTAT4,CPMCHSE IS MCH SOFT ERROR FLAG ON? @VA07615 00604100
BO MCHSXT YES, GOTO DMKMCH FOR SOFT ERROR @V407508 00605000
B UNLKLAST NO, CONTINUE LOCKED PROCESSING @V407508 00606000
SPACE 1 00606030
.UPTST3 ANOP **ANOP** 00606100
EJECT 00607000
*. 00608000
* OPERATION 00609000
* 00610000
* B. RUNNING USER ACCOUNTING - 00611000
* 1. UNFLAG RUNNING STATUS AND TEST IF R11 VMBLOK IS RUNUSER; 00612000
* IF NOT, UNLOCK R11 VMBLOK AND SWITCH CPU TIMER AND R11 00613000
* TO RUNUSER. 00614000
* 2. CHECK IF USER HAS REACHED EITHER TIME-SLICE END OR QUEUE- 00615000
* SLICE END; IN EITHER CASE, MARK THE USER INELIGIBLE FOR 00616000
* FAST REDISPATCH. ALSO STORE THE TIME REMAINING IN THE 00617000
* TIME-SLICE AND INCREMENT THE PROCESSOR PROBLEM STATE 00618000
* TIME. 00619000
* 3. IF THE VIRTUAL TIMER IS RUNNING, UPDATE EITHER THE USER'S 00620000
* VIRTUAL TIMER, IF RESIDENT, OR THE COPY IN THE USER'S 00621000
* VMBLOK. IF IT CHANGES SIGN FROM POSITIVE TO NEGATIVE, 00622000
* POST A PENDING INTERRUPT AND MARK THE USER INELIGIBLE FOR 00623000
* FAST REDISPATCH. 00624000
*. 00625000
SPACE 2 00626000
RUNTIME EQU * CALCULATE TIME THAT WAS USED... %V3M4038 00627000
MVI CPSTATUS,CPEX+CPSUPER SET PROCESSNG STATUS FLAG %V407508 00628000
CHARGE STOP GET END OF IN-Q SLICE VMTTIME @ZA12055 00628500
C R11,RUNUSER STILL POINTING TO RUNUSER ?? %V3M4038 00629000
BE UNRUN IF YES, SKIP RESET OF CPU TIMER %V3M4038 00630000
AIF (NOT &AP).UPTST4 **AIF*** 00630900
LR R1,R11 SAVE CURRENT R11 USER %V407508 00631000
* IN UP-MODE, SUBROUTINE UNLOKVM IS A NO-OP. 00632000
BAL R8,UNLOKVM UNLOCK OLD R11 USER IF LOCKED %V407508 00633000
.UPTST4 ANOP **ANOP** 00633100
CHARGE SWITCH,RUNUSER SWITCH TIMER & R11 TO RUNUSER %V407508 00634000
L R1,QUANTUMR CPU TIME REMAINING %V408246 00635000
B UNRUN+4 ALREADY HAVE REMAINING VALUE %V408246 00636000
SPACE 00637000
UNRUN DS 0H %V408246 00638000
L R1,TIMER CPU TIME REMAINING %V408246 00639000
LTR R1,R1 ANY? %V3M4038 00640000
BP B1 %V408246 00641000
NI VMDSTAT,255-VMDSP NO, REMOVE FAST DISPATCH FLAG %V3M4038 00642000
OI VMDSTAT,VMTSEND FLAG TIME-SLICE END %V3M4038 00643000
B1 EQU * %V408246 00644000
SPACE 00645000
AIF (NOT &AP).UPTST5 **AIF*** 00645900
TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? %V4M0203 00646000
BZ B1A NO, CONTINUE AS IN UP-MODE %V4M0203 00647000
LM R2,R5,VMCPTIME LOAD BOTH SUPERVISOR TIME VALUES @V4M0203 00648000
SLDL R2,8 SHIFT OFF 1ST BYTE OF VMCPTIME @V4M0203 00649000
SLDL R4,8 SHIFT OFF 1ST BYTE OF VMAPTIME @V4M0203 00650000
ALR R2,R4 COMBINE SUPERVISOR TIME VALUES @V4M0203 00651000
LM R4,R5,VMTMINQ LOAD QUEUE CPU LIMIT @V4M0203 00652000
SLDL R4,8 SHIFT OFF 1ST BYTE OF VMTMINQ @V4M0203 00653000
CLR R2,R4 SEE IF EXCEEDED QUEUE CPU LIMIT @V4M0203 00654000
BH B2 NO, CHECK VIRTUAL LOC 80 TIMER @V4M0203 00655000
B B1B YES, GO SET APPROPRIATE FLAGS @V4M0203 00656000
B1A DS 0H %V4M0203 00657000
.UPTST5 ANOP **ANOP** 00657100
CLC VMTTIME(5),VMTMINQ EXCEEDED QUEUE CPU LIMIT? %V3M4038 00658000
BH B2 NO, CHECK VIRTUAL LOC. 80 TIMER %V408246 00659000
B1B DS 0H %V4M0203 00660000
NI VMDSTAT,255-VMDSP REMOVE FAST DISPATCH FLAG %V3M4038 00661000
OI VMDSTAT,VMQSEND FLAG QUEUE TIME UP %V3M4038 00662000
B2 EQU * %V408246 00663000
SPACE 00664000
BAL R8,INCPROBT GO INCREMENT PROBLEM STATE TIME %V407508 00665000
L R0,QUANTUM SAVE FOR VIRT. 80 UPDATE %V408246 00666000
ST R1,QUANTUM SET TIME-SLICE REMAINING VALUE %V408246 00667000
TM VMMCR6,VMMFE+VMMVTMR VIRTUAL TIMER RUNNING? %V408246 00668000
BOR R9 YES, NO NEED FOR UPDATE %V408246 00669000
TM VMTLEVEL,VMTON+VMRON TIMER RUNNING ?? %V408246 00670000
BZR R9 NO, DONE %V408246 00671000
S R0,QUANTUMR CALCULATE TIME SPENT IN PROBLEM %V408246 00672000
UPVIRT DS 0H UPDATE VIRTUAL LOCATION 80 TIMER %V408246 00673000
BNM DSP3A ACCEPTABLE %V408246 00674000
L R0,=F'1' STOP DSP003 ABEND - JUST FIDDLE TIMER HRC006DK 00675010
DSP3A DS 0H %V408246 00676000
LCTL C1,C1,VMSEG INSURE CORRECT MEMORY SPACE %V408246 00677000
LRA R2,TIMER-PSA VIRTUAL TIMER AVAILABLE? %V408246 00678000
BZ *+8 YES %V408246 00679000
LA R2,VMTIMER NO, POINT AT COPY %V408246 00680000
L R5,0(,R2) GET TIMER VALUE %V408246 00681000
SLR R5,R0 UPDATE VIRTUAL TIMER %V408246 00682000
ST R5,0(,R2) SAVE NEW VALUE %V408246 00683000
BCR 8+2+1,R9 CARRY MEANS NO INT. TO REFLECT %V3M4038 00684000
SLR R3,R3 %V3M4038 00685000
L R4,=X'00800080' %V3M4038 00686000
NI VMDSTAT,X'FF'-VMDSP RESET RUNNING USER FLAG %V3M4038 00687000
SPACE 2 00688000
* QUEUE AN EXTERNAL INTERRUPT BLOCK TO USER'S VMBLOK 00689000
SPACE 00690000
XINTQUE LA R2,VMPXINT EXTERNAL INTERRUPT BLOCK CHAIN @V3M4026 00691000
USING XINTBLOK,R2 ADDRESSABILITY TO BLOCKS... @V3M4026 00692000
XINTLOOP LR R6,R2 PRESERVE POINTER TO PREVIOUS @V200198 00693000
L R2,XINTNEXT-XINTBLOK(,R6) NEXT? @V200198 00694000
LTR R2,R2 @V200198 00695000
BZ XINTADD NOPE, ADD TO END OF CHAIN @V200198 00696000
C R3,XINTSORT CHECK FOR COLLATING SEQUENCE @V200198 00697000
BH XINTLOOP KEEP LOOKING... @V200198 00698000
BL XINTADD "THIS IS THE PLACE..." @V200198 00699000
O R4,XINTCODE THESE MAY BE PRESENTED TOGETHER @V200198 00700000
ST R4,XINTCODE OR ONE AT A TIME @V200198 00701000
BR R9 EXIT @V3M4026 00702000
XINTADD LA R0,XINTSIZE NUMBER OF DOUBLEWORDS @V200198 00703000
CALL DMKFREE GET BLOCK FORM FREE STORAGE @V200198 00704000
ST R1,XINTNEXT-XINTBLOK(,R6) @V200198 00705000
SLR R5,R5 PARAMETER IN MEANINGLESS HERE @V200198 00706000
STM R2,R5,XINTNEXT-XINTBLOK(R1) BUILD NEW @V200198 00707000
* INTERRUPT BLOCK 00708000
BR R9 FINIS... @V3M4026 00709000
DSPBASE DC A(DMKDSP,DMKDSP+4096) BASE REGS @V387045 00710000
EJECT 00711000
*. 00712000
* OPERATION - 00713000
* 00714000
* C. WAIT TIME ACCOUNTING - 00715000
* 1. WAIT TIME IS SUBDIVIDED INTO 3 MAIN CATEGORIES: 00716000
* A. 'IDLEWAIT' IS ACCUMULATED WHEN THE SYSTEM IS IN A 00717000
* DORMANT STATE I.E., THERE IS NO OUTSTANDING ACTIVITY 00718000
* ON THE SYSTEM. 00719000
* 00720000
* B. 'IONTWAIT' IS ACCUMULATED WHEN THERE IS ATLEAST 1 00721000
* ACTIVE CHANNEL PROGRAM IN PROGRESS (OTHER THAN PAGING) 00722000
* THAT HAS NOT AS YET COMPLETED. 00723000
* 00724000
* C. 'PAGEWAIT' IS ACCUMULATED WHEN THE SYSTEM IS IN A 00725000
* TOTAL PAGE WAIT CONDITION. A TOTAL PAGE WAIT CONDITION 00726000
* IS DETECTED WHEN ALL RUNNABLE USER'S IN QUEUE 1 AND 00727000
* QUEUE 2 ARE WAITING FOR PAGES. 00728000
* 00729000
* 2. PRIOR TO LOADING A WAIT STATE PSW THE SYSTEM IS ENABLED 00730000
* FOR EXTERNAL AND I/O INTERRUPTS. IF AN INTERRUPT SHOULD 00731000
* OCCUR BEFORE LOADING A WAIT STATE PSW THERE WILL BE NO 00732000
* CHANGE IN SYSTEM WAIT TIME. OTHERWISE, FLAGS IN 00733000
* THE PSA INDICATE WHAT THE SYSTEM STATE IS 00734000
* FOR THIS WAIT STATE CONDITION. 00735000
* 00736000
* 3. WHEN AN EXTERNAL OR I/O INTERRUPT DOES OCCUR THE VALUE IN 00737000
* THE PSA FIELD WAITEND IS MOVED INTO THE CORRESPONDING 00738000
* WAIT FIELD. 00739000
* 00740000
* 4. A RETURN IS MADE TO THE CALLER. 00741000
* 00742000
*. 00743000
SPACE 2 00744000
WAITIME EQU * PERFORM WAIT-TIME ACCOUNTING 00745000
MVI CPSTATUS,CPEX+CPSUPER SET PROCESSNG STATUS FLAG @V407508 00746000
* 00747000
* SUBROUTINE TO ACCOUNT FOR SYSTEM WAIT TIME 00748000
* 00749000
SPACE 00750000
C R11,ASYSVM RUNUSER STILL THE SYSTEM 00751000
BE WAITPROC YES - @V200820 00752000
AIF (NOT &AP).UPTST6 **AIF*** 00752900
LR R1,R11 SAVE CURRENT R11 USER @V407508 00753000
* IN UP-MODE, SUBROUTINE UNLOKVM IS A NO-OP. 00754000
BAL R8,UNLOKVM UNLOCK OLD R11 USER IF LOCKED @V407508 00755000
.UPTST6 ANOP **ANOP** 00755100
WAITPROC EQU * @V200820 00756000
CHARGE STOP STOP CHARGING CURRENT VMBLOK @V4M0173 00757000
L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK @V4M0173 00758000
SPACE 00759000
TM CPSTAT3,CPTIDLE+CPTPAGE+CPTIONT ANY WAIT FLAGS? @V407508 00760000
BCR 8,R9 BR. IF SYSTEM INT. WHILE SCANNING VMBLOKS 00761000
SPACE 00762000
LM R0,R1,WAITEND GET VALUE IN TIMER AT WAIT END @V407508 00763000
TM CPSTAT3,CPTIDLE DID TIMER CONTAIN IDLE TIME? @V407508 00764000
BZ WAITIDLE NO -- @V200820 00765000
STM R0,R1,IDLEWAIT SAVE NEW IDLE WAIT TIME VALUE 00766000
B WAITRETN RESET FLAG INDICATOR 00767000
SPACE 00768000
WAITIDLE EQU * @V200820 00769000
L R4,PWTPAGES NO, OF PAGEWAIT PAGES AT ENTRY @V407508 00770000
* TO WAIT 00771000
LTR R4,R4 ANY? @V408246 00772000
BZ WAITA NO, BYPASS ACCUMULATING PAGE @V408246 00773000
* WAIT TIME 00774000
LM R2,R3,WAITSTRT GET TIMER VALUE AT ENTRY TO WAIT @V407508 00775000
SLR R3,R1 @V408246 00776000
BC 11,*+8 @V408246 00777000
SL R2,F1 @V408246 00778000
SLR R2,R0 ELAPSED TIME IN WAIT (ASSUME < @V408246 00779000
* 30 MINS) 00780000
SRDL R2,12 VALUE IN MICROSECONDS @V408246 00781000
STM R2,R3,WAITSTRT SAVE ELAPSED TIME IN WAIT @V407508 00782000
MR R2,R4 WAIT * PAGEWAIT PAGES @V408246 00783000
AL R3,PGWAITIM+4 @V408246 00784000
BC 12,*+8 @V408246 00785000
AL R2,F1 @V408246 00786000
AL R2,PGWAITIM @V408246 00787000
STM R2,R3,PGWAITIM @V408246 00788000
WAITA DS 0H @V408246 00789000
TM CPSTAT3,CPTPAGE DID TIMER HAVE PAGE WAIT TIME? @V407508 00790000
BZ WAITPAGE NO -- @V200820 00791000
STM R0,R1,PAGEWAIT SAVE NEW PAGE WAIT TIME VALUE 00792000
B WAITRETN RESET FLAG INDICATOR 00793000
SPACE 00794000
WAITPAGE EQU * @V200820 00795000
STM R0,R1,IONTWAIT SAVE NEW SIMPLE I/O WAIT TIME 00796000
SPACE 00797000
WAITRETN MVI CPSTAT3,NONE TURN OFF ANY WAIT STATE FLAG @V407508 00798000
BR R9 EXIT 00799000
EJECT 00800000
*. 00801000
* OPERATION - 00802000
* 00803000
* D. PENDING INTERRUPT UNSTACK - 00804000
* 1. IF THE USER IS NOT RUNNABLE, GO IMMEDIATELY TO SECTION F. 00805000
* TO ALTER DISPATCHING STATUS 00806000
* 2. IF A DELAYED PER INTERRUPT IS PENDING, REFLECT IT TO THE 00807000
* USER, SWAPPING HIS PSW'S AND STORING THE PER INTERRUPT 00808000
* CODE AND ADDRESS IN LOW CORE; THEN GO TO THE NEW PSW 00809000
* VALIDATION ROUTINE (SECTION E.) 00810000
* 3. IF NO PER INTERRUPT IS PENDING, CHECK FOR PENDING PSEUDO 00811000
* PAGE FAULTS FOR WHICH THE USER IS ENABLED. IF A PSEUDO 00812000
* PAGE FAULT IS PENDING, SET THE NEGATIVE EXCEPTION 00813000
* ADDRESS FROM THE PGBLOK, SET UP THE INTERRUPT CODE, AND 00814000
* GO TO DMKVATEX TO SIMULATE THE PAGE AVAILABLE INTERRUPT. 00815000
* IF NO PAGE FAULT IS PENDING, CHECK FOR PENDING EXTERNAL 00816000
* INTERRUPTS FOR WHICH THE USER IS ENABLED. IF AN EXTERNAL 00817000
* INTERRUPT SHOULD BE REFLECTED, USE THE PENDING MASK 00818000
* TO INDEX THE EXTCODES TABLE TO LOCATE THE PROPER CODE TO BE 00819000
* GIVEN TO THE USER. IF THE USER IS RUNNING AN EXTENDED 00820000
* MACHINE, VERIFY THAT HE IS NOT IN AN ENABLED EXTERNAL 00821000
* INTERRUPT LOOP; THEN REFLECT THE INTERRUPT AS IN STEP 2. 00822000
* WHEN THE NEW PSW HAS BEEN ESTABLISHED, GO TO THE NEW PSW 00823000
* CHECK OUT ROUTINE (SECTION E.) TO VALIDATE IT 00824000
* 4. IF NO EXTERNAL INTERRUPT IS REFLECTED, CHECK FOR PENDING 00825000
* I/O INTERRUPTS FOR WHICH THE USER IS ENABLED. IF THE USER 00826000
* IS MASKED ON FOR A CHANNEL ON WHICH AN INTERRUPT IS PENDING 00827000
* LOCATE THE UNIT ON THE CHANNEL WHICH HAS A PENDING CHANNEL 00828000
* CLASS INTERRUPT. IF NO CHANNEL CLASS INTERRUPT IS PENDING 00829000
* LOCATE THE FIRST UNIT WITH A CONTROL UNIT OR DEVICE CLASS 00830000
* INTERRUPT, AND REFLECT IT TO THE USER BY SWAPPING PSW'S, 00831000
* STORING THE ADDRESS OF THE INTERRUPTING UNIT AND STORING 00832000
* THE APPROPRIATE CSW STATUS. WHEN THE NEW PSW HAS BEEN 00833000
* ESTABLISHED, GO TO NEW PSW CHECK OUT ROUTINE (SECTION E.) 00834000
* TO VALIDATE IT. 00835000
* 5. IF NO INTERRUPTS ARE PENDING FOR WHICH THE USER IS ENABLED, 00836000
* GO TO SECTION F. TO UNSTACK THE NEXT PENDING REQUEST 00837000
* 00838000
*. 00839000
EJECT 00840000
UNSTACK EQU * HERE TO UNSTACK ANY PENDING INTERRUPTS %V3M4038 00841000
SPACE 00842000
TM VMRSTAT,VMCPWAIT IS USER RUNNABLE ?? %V3M4038 00843000
* THE FOLLOWING INSTRUCTION IS NOT PERFORMED BY ECPS 00844000
BNZ CHKILL NO -- DON'T BOTHER TO UNSTACK %V408246 00845000
* RATHER, ECPS PERFORMS: 00846000
* BNZ DISPATCH NO -- DON'T BOTHER TO UNSTACK %V3M4038 00847000
CKPEND EQU * HERE TO TEST FOR INTERRUPTS PENDING %V3M4038 00848000
TM VMPEND,VMPERPND+VMPGPND PER/PAGE FAULT PENDING %V3M4038 00849000
BZ CKEXT NO -- GO CHECK OUT EXTERNALS %V3M4038 00850000
SPACE 00851000
CKPER TM VMPEND,VMPERPND IS IT A DELAY PER INT ? @V386198 00852000
BZ CKPPF NO - MUST BE PSEUDO PAGE FAULT @V213135 00853000
TM VMTRCTL,VMTRPER WERE WE USING THE P.E.R? PER001 00853050
BO OURPER YES. CALL DMKPERIL TO FIGURE IT OUTPER001 00853100
SR R1,R1 PAGE 0 -- 00854000
TRANS 2,1,OPT=(BRING,DEFER) FETCH IT -- 00855000
L R1,VMPSW SWAP PSW'S 00856000
ST R1,PROPSW-PSA(,R2) .. 00857000
L R1,VMPSW+4 .. 00858000
ST R1,PROPSW-PSA+4(,R2) .. 00859000
L R1,PRNPSW-PSA(,R2) 00860000
ST R1,VMPSW .. 00861000
L R1,PRNPSW-PSA+4(,R2) .. 00862000
ST R1,VMPSW+4 .. 00863000
LA R1,X'80' SET PER INTERRUPT CODE 00864000
ICM R1,12,VMPRGIL GET ILC 00865000
ST R1,INTPRL-PSA(,R2) STORE FOR USER 00866000
L R1,VMECEXT GET VMBLOK EXTENSION 00867000
LH R0,EXTPERCD-ECBLOK(,R1) GET PER CODE 00868000
STH R0,PERCODE-PSA(,R2) STORE FOR USER 00869000
L R0,EXTPERAD-ECBLOK(,R1) GET PER ADDRESS 00870000
ST R0,PERADD-PSA(,R2) STORE FOR USER 00871000
NI VMPEND,X'FF'-VMPERPND UNFLAG PER PENDING 00872000
AIF (NOT &TRACE(6)).NOPC1 AIF TRACING PROG INTERRUPTS 00875000
TM VMTRCTL,VMTRPRG+VMTRBRIN TRACE ALL OR P.C. 00876000
BZ CKPSW IF NOT TRACING...BRANCH 00877000
LM R0,R1,PROPSW-PSA(R2) LOAD OLD PC PSW 00878000
L R4,INTPRL-PSA(,R2) GET ILC + INTERRUPT CODE 00879000
LM R2,R3,PRNPSW-PSA(R2) LOAD UP NEW P.C. PSW 00880000
CALL DMKTRCPG CALL TRACER (PROG. CHECKS) 00881000
.NOPC1 ANOP 00882000
SPACE 00883000
B CKPSW GO CHECK OUT NEW PSW 00884000
OURPER OI VMRSTAT,VMEXWAIT TAKE MACHINE OUT OF RUNNING. PER001 00884100
CALL DMKPERIL CALL INTERRUPT HANDLER. PER001 00884200
NI VMPEND,255-VMPERPND KILL THE PENDING BIT. PER001 00884300
NI VMRSTAT,255-VMEXWAIT REMOVE THE MACHINE FROM PER001 00884400
GOTO DMKDSPCH GO TO GROUND FLOOR ZERO. PER001 00884500
EJECT 00885000
CKPPF EQU * HERE TO UNSTACK PSEUDO PAGE @V213135 00886000
* AVAILBLE INTERRUPTS 00887000
TM VMESTAT,VMEXTCM ONLY IN EC MODE, THOUGH ... @V213135 00888000
BZ CKEXT NO DICE - @V213135 00889000
TM VMPSW,VMIOPND AND ONLY IF ENABLED -- @V213135 00890000
BZ CKEXT NOT THIS TIME -- @V213135 00891000
NI VMPEND,X'FF'-VMPGPND UNFLAG PAGE FAULT PENDING @V213135 00892000
L R1,VMPGPNT GET NEXT PAGE AVIALABLE BLOCK @V213135 00893000
LTR R1,R1 ANY THERE ? @V213135 00894000
BZ CKEXT NO -- GO TEST EXTERNALS @V213135 00895000
USING PGBLOK,R1 ADDRESSABILITY FOR PGBLOK @V213135 00896000
L R0,PGPNT GET NEXT ON THE STACK @V213135 00897000
ST R0,VMPGPNT AND MAKE HIM FIRST @V213135 00898000
LTR R0,R0 ANY MORE STACKED ?? @V213135 00899000
BZ *+8 NO -- NOTHING MORE PENDING @V213135 00900000
OI VMPEND,VMPGPND RE-SET PENDING FLAG @V213135 00901000
SLR R8,R8 SET UP GPR8 @V213135 00902000
STH R8,VMPRGIL TO CLEAR ILC SAVE AREA @V213135 00903000
L R3,PGADDR AND SET FOR GOTO TO DMKVATEX @V213135 00904000
LA R0,PGBSIZE RELEASE PGBLOK .. @V213135 00905000
CALL DMKFRET .. @V213135 00906000
LA R1,X'14' SET INTERRUPT CODE @V213135 00907000
OI VMRSTAT,VMEXWAIT DO NOT RUN WHILE REFLECTING -- @V213135 00908000
GOTO DMKVATEX GO DO IT @V213135 00909000
EJECT 00910000
CKEXT DS 0H %V408246 00911000
ICM R6,B'1111',VMPXINT ANY EXTERNAL INTERRUPTS? %V408246 00912000
BZ UNSTIO NO %V408246 00913000
TM VMPSW,VMEXTPND ENABLED FOR EXTERNAL? %V408246 00914000
BZ UNSTIO NOPE, TRY I/O %V3M4038 00915000
L R3,VMVCR0 GET SELECTED MASKS %V3M4038 00916000
TM VMPSTAT,VMV370R EXTENDED CONTROL BLOCK PRESENT? %V3M4038 00917000
BZ *+8 NOPE, THIS'LL HAVE TO DO %V3M4038 00918000
L R3,EXTCR0-ECBLOK(,R3) CONTROL REGISTER 0 %V3M4038 00919000
LA R5,VMPXINT ANCHOR CHAIN FOR EXT. INTERRUPTS %V408246 00920000
B UNSTLUPA JOIN CODE ALREADY IN PROGRESS %V408246 00921000
USING XINTBLOK,R6 %V3M4038 00922000
UNSTLOOP LR R5,R6 PRESERVE PREVIOUS BLOCK ADDRESS %V3M4038 00923000
L R6,XINTNEXT-XINTBLOK(,R5) NEXT? %V3M4038 00924000
LTR R6,R6 %V3M4038 00925000
BZ UNSTIO NOT ENABLED FOR ANY OF THESE %V3M4038 00926000
UNSTLUPA DS 0H %V408246 00927000
LH R4,XINTMASK GET MASK VALUE %V3M4038 00928000
NR R4,R3 SEE IF ENABLE FOR THIS INTERRUPT %V3M4038 00929000
BZ UNSTLOOP BETTER LUCK NEXT TIME %V3M4038 00930000
UNSTPRTY EQU * @V387045 00931000
CLC XINTCODE,=AL2(VMCXCODE) VMCF INTERRUPT ? @V387045 00932000
BNE UNSTFTCH NO..CONTINUE... @V387045 00933000
OI VMRSTAT,VMEXWAIT USER CANNOT RUN @V387045 00934000
CALL DMKSCHDL (IN CASE OF A R11 SWITCH) @V408246 00935000
CALL DMKVMCEX REFLECT MESSAGE HEADER @V387045 00936000
UNSTFTCH EQU * @V387045 00937000
SLR R1,R1 FETCH PAGE ZERO.. @V387045 00938000
TRANS 2,1,OPT=BRING+DEFER BRING IN PSA @V200198 00939000
USING PSA,R2 VIRTUAL PAGE ZERO @V200198 00940000
LM R0,R1,VMPSW CURRENT PSW @V200198 00941000
STM R0,R1,EXOPSW BECOMES EXTERNAL OLD PSW @V200198 00942000
LM R0,R1,EXNPSW AND EXTERNAL NEW PSW @V200198 00943000
STM R0,R1,VMPSW BECOMES NEW CURRENT PSW @V200198 00944000
LM R7,R9,XINTSORT SAVE BLOCK @V200198 00945000
TM XINTCODE,X'F0' IS IT CLASS 0 ? @V200198 00946000
BNZ CLASS1 NO, JUST PRESENT IT @V200198 00947000
TM XINTCODE+1,X'80' IS THIS INTERVAL TIMER? @V2B2638 00948000
BZ NOINTV NOPE, SKIP @V2B2638 00949000
LA R0,1 ADD ONE ... @V2B2638 00950000
AL R0,DMKDSPIT ... TO THE VIRTUAL INTERVAL ... @V2B2638 00951000
ST R0,DMKDSPIT ... TIMER REFLECTION COUNTER @V2B2638 00952000
NOINTV EQU * @V2B2638 00953000
XR R8,R4 RESET MASK BITS PRESENTED @V200198 00954000
STC R8,XINTMASK+1 SAVE WHAT'S LEFT OF CLASS ZERO @V200198 00955000
* INTERRUPTS 00956000
NC XINTMASK(2),XINTMASK PARTIALLY PRESENTED? @V200198 00957000
BNZ PARTIAL YES, TREAT SPECIALLY @V200198 00958000
CLASS1 CLC XINTCODE(2),=X'1005' IS IT CPU TIMER? @V200198 00959000
LA R1,DMKDSPPT ADDRESS OF THE COUNTER @V2B2638 00960000
BE UPCNT YES, GO UP THE COUNT @V2B2638 00961000
CLC XINTCODE(2),=X'1004' CLOCK COMPARATOR? @V200198 00962000
LA R1,DMKDSPCK ADDRESS OF THE COUNTER @V2B2638 00963000
BNE UNCHAINX NO, GO UNCHAIN THE XINTBLOK @V2B2638 00964000
UPCNT LA R0,1 ADD ONE TO THE PROPER COUNTER @V2B2638 00965000
AL R0,0(R1) ... @V2B2638 00966000
ST R0,0(R1) AND PUT IT BACK @V2B2638 00967000
B UNSTCONT CONTINUE @V2B2638 00968000
UNCHAINX EQU * @V2B2638 00969000
CLC XINTCODE,=X'2402' LDF interrupt? HRC065DK 00969100
BE LDFINT Yes HRC065DK 00969200
CLC XINTCODE,=AL2(VMCXCODE) VMCF INTERRUPT ? @V387045 00970000
BNE DSPFRT NO..FRET THE BLOCK @V387045 00971000
L R1,VMCPNT MASTER BLOCK... @V387045 00972000
C R6,XINTNEXT-XINTBLOK(,R5) CHECK VALIDITY OF @VA12460 00972050
* CHAIN 00972100
BE VMCDSPN CONTINUE,CHAIN APPEARS VALID @VA12460 00972150
LA R5,VMPXINT LOAD ADDRESS OF CHAIN ANCHOR @VA12460 00972200
VMCCORR DS 0H @VA12460 00972250
C R6,XINTNEXT-XINTBLOK(,R5) CHECK VALIDITY OF @VA12460 00972300
* CHAIN 00972350
BE VMCDSPN CONTINUE, CHAIN IS CORRECTED @VA12460 00972400
ICM R5,B'1111',XINTNEXT-XINTBLOK(R5) INSERT ADDR @VA12460 00972450
* OF NEXT ELEMENT 00972500
BNZ VMCCORR BRANCH IF NOT END OF CHAIN @VA12460 00972550
VMCDSPN EQU * @V387045 00973000
ICM R1,B'1111',VMCFPNT-VMCBLOK(R1) NEXT VMCBLOK @V387045 00974000
BZ DSPFRT NONE..FRET THE BLOCK @V387045 00975000
TM VMCCSTAT-VMCBLOK(R1),VMCCXINT XINT BLOK ? @V387045 00976000
BZ VMCDSPN NO..KEEP LOOKING ? @V387045 00977000
B UNSTCONT SAVE FOR NEXT INTERRUPT... @V387045 00978000
* HRC065DK 00978100
LDFINT EQU * HRC065DK 00978200
MVC PSA+128(4),XINTPARM LDF indication to loc X'80' HRC065DK 00978300
* HRC065DK 00978400
DSPFRT EQU * @V387045 00979000
L R0,XINTNEXT @V200198 00980000
ST R0,XINTNEXT-XINTBLOK(,R5) @V200198 00981000
LA R0,XINTSIZE GET COUNT OF DOUBLEWORDS @V200198 00982000
LR R1,R6 GET ADDRESS OF BLOCK @V200198 00983000
DROP R2 @V200198 00984000
USING PSA,R0 @V200198 00985000
CALL DMKFRET AND RETURN IT TO FREE STORAGE @V200198 00986000
DROP R0 @V200198 00987000
USING PSA,R2 @V200198 00988000
UNSTCONT SRL R8,16 INTERRUPTION CODE @VA01935 00989000
L R7,PRNPSW SAVE PROGRAM NEW PSW FOR CKLOOP2 @VA05647 00990000
TM EXOPSW+1,EXTMODE INTERRUPT WHILE IN EC MODE? @VA01935 00991000
BO ECXINT YES, DO YOUR THING @V200198 00992000
STH R8,EXOPSW+2 INTERRUPTION CODE @VA01935 00993000
B CHKLOOP GO CHECK FOR EXTERNAL LOOP @V200198 00994000
PARTIAL EX R4,TESTSIG SEE IF PRESENTING EXTERNAL @V200198 00995000
* SIGNALS 00996000
BZ *+8 NOPE, CAN'T COUNT THEM @V200198 00997000
O R4,=XL4'1F' NOT OVERLOOKING SIGNALS 3 @V200198 00998000
* THROUGH 7 00999000
SLL R4,16 MATCH UP WITH INTERRUPTION CODE @V200198 01000000
NR R4,R8 ONLY THESE ARE PRESENTABLE @V200198 01001000
LR R8,R4 INTERRUPTION CODE EXPECTED IN R8 @V200198 01002000
X R4,XINTCODE RESET THE ONES PRESENTED HERE @V200198 01003000
STCM R4,B'1100',XINTCODE SAVE THE REST FOR NEXT TIME @V200198 01004000
B UNSTCONT CONTINUE @V200198 01005000
ECXINT ST R8,INTEXF STASH 370 INTERRUPT CODE @VA01935 01006000
* CODE 01007000
CHKLOOP TM VMPSW,VMEXTPND ENABLED FOR EXTERNAL? @V200198 01008000
BNO NOLOOP NO, NO PROBLEM @V200198 01009000
TM VMPSTAT,VMV370R EC MODE MACHINE? @VA04307 01010000
BZ NOLOOP NO - NO CPU TIMER ETC @VA04307 01011000
LA R1,INTEX EC MODE INT LOCATION @VA04307 01012000
TM EXOPSW+1,EXTMODE IN EC MODE? @VA04307 01013000
BNZ *+8 YES - CONTINUE @VA04307 01014000
LA R1,EXOPSW+2 BC MODE INT LOCATION @VA04307 01015000
TM 0(R1),X'FF' IS INTERRUPT NOT CLASS ZERO ? @V3M4026 01016000
BZ NOLOOP IF YES, A LOOP CONDITION EXISTS @V3M4026 01017000
EXTLOOP EQU * EXTERNAL LOOP MESSAGE @VA05647 01018000
SLR R1,R1 NO DATA FOR THIS ERROR MESSAGE @V3M4026 01019000
L R2,EXTPARMS ERROR CODE: "EXTERNAL INT. LOOP" @V3M4026 01020000
B DSPERMSG GO TO CALL DMKERMSG TO SEND MSG @V3M4026 01021000
SPACE 01022000
NOLOOP EQU * @V200198 01023000
DROP R2,R6 @V200198 01024000
USING PSA,0 @V200198 01025000
AIF (NOT &TRACE(6)).VR10B 01026000
TM VMTRCTL,VMTREX+VMTRBRIN TRACING EXTERNAL INTERRUPTS ETC? 01027000
BZ CHKLOOP2 BRANCH IF NOT @VA05987 01028000
LR R4,R8 INTO R4 @V200198 01029000
LM R0,R1,EXOPSW-PSA(R2) OLD PSW INTO R0-R1, 01030000
LM R2,R3,EXNPSW-PSA(R2) NEW PSW INTO R2-R3, 01031000
CALL DMKTRCEX NOW CALL EXTERNAL INTERRUPT TRACER 01032000
.VR10B ANOP 01033000
SPACE 1 01034000
CHKLOOP2 EQU * CHECK FOR EXT/PGM CHECK LOOP @VA05647 01035000
* CHECK FOR THE AN EXTERNAL/PROGRAM CHECK LOOP DUE TO 01036000
* EXTERNAL NEW PSW INVALID, PROGRAM NEW PSW ENABLED FOR 01037000
* EXTERNAL INTERRUPTIONS, AND TAKING CPU TIMER OR 01038000
* CLOCK COMPARATOR INTERRUPTION. 01039000
BAL R9,PSWCKSUB CHECK OUT EXTERNAL NEW PSW @VA05647 01040000
BZ CKPEND EXTERNAL NEW PSW OK. CONTINUE @VA05647 01041000
* EXTERNAL NEW PSW IS INVALID. 01042000
C R8,F255 CLASS ZERO INTERRUPTION? @VA05647 01043000
BNH SPECPSW BRANCH IF CLASS 0. NO PROBLEM. @VA05647 01044000
SLL R7,7 PGM NEW PSW BIT 7 TO BIT 0 @VA05647 01045000
LTR R7,R7 IS PGM NEW PSW BIT 7 ON? @VA05647 01046000
BM EXTLOOP YES. WE ARE IN A LOOP. @VA05647 01047000
B SPECPSW NO. JUST TAKE PGM INTERRUPTION. @VA05647 01048000
EJECT 01049000
UNSTIO EQU * HERE TO UNSTACK I/O INTERRUPTS %V3M4038 01050000
SLR R6,R6 CLEAR MASK REGISTER %V3M4038 01051000
ICM R6,12,VMIOINT GET PENDING INTERRUPT MASK %V3M4038 01052000
BZ CKWAIT NOTHING PENDING -- %V3M4038 01053000
TM VMESTAT,VMEXTCM IN EXTENDED CONTROL NOW ? %V3M4038 01054000
BO UNSTIOXM YES - GO TAKE CARE OF IT. %V3M4038 01055000
L R7,VMPSW NO - GET ENABLED MASK FROM PSW %V3M4038 01056000
N R7,=X'FC000000' GET MASKS FOR CHANNELS 0-5 %V3M4038 01057000
TM VMPSTAT,VMV370R EXTENDED CHANNEL SUPPORT ? %V3M4038 01058000
BZ GETPEND NOPE - GO "AND" MASKS TOGETHER %V3M4038 01059000
TM VMPSW,VMIOPND IF YES, CHECK CHANNELS 6-15 BIT %V3M4038 01060000
BZ GETPEND NOT ON, GO "AND" MASKS TOGETHER %V3M4038 01061000
L R1,VMECEXT IF ON, GET USER'S CONTROL REG 2 %V3M4038 01062000
L R15,EXTCR2-ECBLOK(,R1) ... %V3M4038 01063000
N R15,=X'03FF0000' MASK OUT CHANNELS 6-15 ONLY %V3M4038 01064000
OR R7,R15 CONCATENATE THE TWO PIECES, %V3M4038 01065000
B GETPEND AND GO "AND" MASKS TOGETHER %V3M4038 01066000
UNSTIOXM TM VMPSW,VMIOPND CHECK I/O SUMMARY BIT %V3M4038 01067000
BZ CKWAIT NOT ENABLED, TEST FOR WAIT STATE %V3M4038 01068000
L R1,VMECEXT POINT TO EXTENDED CONTROL BLOK %V3M4038 01069000
L R7,EXTCR2-ECBLOK(,R1) CHAN MASK; 17-31 HARMLESS %V3M4038 01070000
GETPEND NR R7,R6 MASK PENDING AGAINST ENABLED %V3M4038 01071000
BZ CKWAIT NOTHING TO UNSTACK -- CHECK WAIT %V3M4038 01072000
SPACE 01073000
GETIOINT SLR R1,R1 PREFETCH PAGE ZERO @V386198 01074000
TRANS 9,1,OPT=(BRING,DEFER) @VA04484 01075000
SRL R7,1 NONZERO - PUT MASKS INTO BITS 1-16 01076000
LA R0,2 INDEX VALUE FOR UNIT TABLES 01077000
L R2,=A(DMKVIOMK) GET ADDRESS OF PENDING MASKS 01078000
SR R3,R3 CLEAR CHANNEL INDEX 01079000
SPACE 01080000
TESTVCH BXLE R7,R7,GETVCH SHIFT LEFT AND TEST FOR 1 BIT 01081000
ALR R3,R0 NO BIT - INCREMENT INDEX 01082000
B TESTVCH KEEP LOOKING 01083000
SPACE 01084000
GETVCH EQU * 01085000
LH R6,VMCHTBL(R3) GET INDEX TO VCHBLOK 01086000
A R6,VMCHSTRT POINT TO VCHBLOK 01087000
USING VCHBLOK,R6 01088000
SPACE 01089000
TM VCHTYPE,VCHSEL IS IT A SELECTOR CHANNEL ? @VA01771 01090000
BZ GETVCUI NO -- VCHCEDEV NOT VAILD 01091000
TM VCHSTAT,VCHCEPND CHANNEL CLASS INTERRUPT PENDING ?? 01092000
BZ GETVCUI NO -- 01093000
SPACE 01094000
LH R1,VCHCEDEV GET ADDRESS OF UNIT CAUSING INTERRUPT 01095000
CALL DMKSCNVU LOCATE VBLOKS 01096000
LR R4,R6 POINT TO VCHBLOK @VA04484 01097000
BZ TESTCHAN ALL BLOKS FOUND @VA04484 01098000
DSP01 ABEND 1 @VA01770 01099000
EJECT 01100000
GETVCUI SR R7,R7 CLEAR VCUINT SCANNER 01101000
ICM R7,12,VCHCUINT GET PENDING MASK 01102000
BZ CLEARVMX NOTHING PENDING 01103000
SRL R7,1 INTO BITS 1-16 01104000
SR R3,R3 CLEAR INDEX 01105000
SPACE 01106000
TESTVCU BXLE R7,R7,GETVCU SHIFT AND TEST 01107000
ALR R3,R0 NO BIT .. 01108000
B TESTVCU KEEP LOOKING 01109000
SPACE 01110000
GETVCU LH R7,VCHCUTBL(R3) GET CONTROL UNIT INDEX 01111000
A R7,VMCUSTRT POINT TO VCUBLOK 01112000
USING VCUBLOK,R7 01113000
SPACE 01114000
SR R5,R5 SAVE VCUBLOK, CLEAR NEW SHIFTER 01115000
ICM R5,12,VCUDVINT GET MASK OF INTERRUPTING DEVICES 01116000
BZ CLEARCHX NOTHING PENDING 01117000
SRL R5,1 INTO BITS 1-16 01118000
SR R3,R3 CLEAR INDEX 01119000
SPACE 01120000
TESTVDEV BXLE R5,R5,GETVDEV SHIFT AND TEST 01121000
ALR R3,R0 INDEX 01122000
B TESTVDEV KEEP LOOKING 01123000
SPACE 01124000
GETVDEV LH R8,VCUDVTBL(R3) GET DEVICE INDEX 01125000
A R8,VMDVSTRT AND DEVELOP ADDRESS OF VDEVBLOK 01126000
USING VDEVBLOK,R8 01127000
SPACE 01128000
TM VDEVSTAT,VDEVPEND+VDEVCHAN+VDEVCUE ANYTHING PENDING ? 01129000
BZ CLEARCUX NO -- 01130000
TM VCUINTS,CUE IS CUE PENDING ? 01131000
BZ TESTCUE NO - USE THIS AS INTERRUPTING DEVICE 01132000
ALR R3,R0 INCREMENT DEVICE INDEX FOR RE-SCAN 01133000
TM VDEVSTAT,VDEVCUE IS THIS DEVICE CAUSING CUE ?? 01134000
BZ TESTVDEV NO -- GO LOOK FOR ANOTHER 01135000
SPACE 01136000
TESTCUE EQU * CONTROL-UNIT-END PENDING 01137000
LR R4,R6 POINT TO VCHBLOK 01138000
TM VCHTYPE,VCHSEL IS IT A SELECTOR CHANNEL ? @VA01771 01139000
BNZ TESTCHAN YES -- 01140000
LR R4,R7 POINT TO VCUBLOK 01141000
TM VCUTYPE,VCUSHRD+VCUCTCA ON SHARED SUBCHANNEL ?? 01142000
BNZ TESTCHAN YES -- 01143000
LR R4,R8 POINT TO VDEVBLOK 01144000
SPACE 2 01145000
TESTCHAN EQU * HERE TO TEST STATUS OF SUBCHANNEL 01146000
LR R2,R9 ADDRESS PAGE 0 IN R2 @VA09137 01146200
TM VDEVFLG2,VDEVPST THIS INTERRUPT TO BE POSTED? @VA09137 01146500
BO POST YES @VA09137 01146800
TM VCHSTAT-VCHBLOK(R4),VCHBUSY IS THE SUBCHANNEL BUSY ?? 01147000
BZ TESTCE NO -- GO PREPARE TO REFLECT 01148000
CLC VDEVCSW+4(2),=AL1(0,PCI) IS IT PCI ALONE 01149000
BNE CKWAIT NO -- SAVE INTERRUPT FOR LATER 01150000
EJECT 01151000
TESTCE EQU * 01152000
TM VCHSTAT-VCHBLOK(R4),VCHCEPND IS A CHANNEL INT. PENDING? 01154000
BZ TESTCU NO -- GO LOOK FOR CU OR DEVICE INTERRUPTS 01155000
ALR R3,R0 INCREMENT DEVICE INDEX FOR RESCAN 01156000
TM VDEVSTAT,VDEVCHAN CHANNEL INT. PENDING? 01157000
BZ TESTVDEV NO- GO FIND THE NEXT DEVICE 01158000
POST EQU * @VA09137 01159100
NI VDEVFLG2,255-VDEVPST TURN OFF POST @VA09137 01159200
LR R3,R4 SET R3 FOR NEXT TEST 01160000
LM R4,R5,VDEVCSW GET CSW TO BE STORED 01161000
NI VDEVCSW+5,X'FF'-PCI REMOVE PCI 01162000
NI VCHSTAT-VCHBLOK(R3),X'FF'-VCHCEPND REMOVE CE PENDING 01163000
NI VDEVSTAT,X'FF'-VDEVCHAN REMOVE CE STATUS FROM DEVICE 01164000
NI VCUSTAT,X'FF'-VCUCEPND AND FROM CU 01165000
B STORECSW GO FINISH REFLECTING 01166000
SPACE 3 01167000
TESTCU EQU * HERE IF INTERRUPT IS NOT CE 01168000
SR R4,R4 CLEAR OUT 01169000
SR R5,R5 CSW SAVE REGISTERS 01170000
TM VCUINTS,CUE IS A CUE PENDING ? 01171000
BZ TESTDVIC NO -- GO LOOK FOR INTERRUPTS IN DEVICE 01172000
ICM R5,12,VCUINTS GET CSW STATUS 01173000
NI VCUINTS,X'FF'-CUE REMOVE CUE FROM CONTROL UNIT 01174000
NI VDEVSTAT,X'FF'-VDEVCUE AND FORM DEVICE 01175000
B STORECSW AND GO STORE CSW 01176000
SPACE 3 01177000
TESTDVIC EQU * HERE IF INTERRUPT IN IN DEVICE ONLY 01178000
TM VDEVINTS,ATTN ATTENTION PENDING ?? 01179000
BZ NOATTN NO -- 01180000
TM VDEVFLAG,VDEVPOST SINGLE INTERRUPT ? @VA08933 01181000
BO POSTOFF YES - ATTN + ALL OTHERS @VA04343 01182000
TM VDEVINTS,X'FF'-(ATTN+UC) ANYTHING ELSE ?? 01183000
BNZ ATTNPLUS YES -- REFLECT SEPARATE INTERRUPTS 01184000
B NOATTN REFLECT SINGLE INTERRUPT @VA04343 01185000
SPACE 01186000
* HERE TO REFLECT A SINGLE INTERRUPT ALSO WITH ATTENTION 01187000
POSTOFF NI VDEVFLAG,X'FF'-VDEVPOST TURN OFF VDEVPOST @VA04343 01188000
NOATTN ICM R5,12,VDEVINTS GET CSW STATUS @VA08933 01189000
STH R4,VDEVINTS CLEAR PENDING INTERRUPTS @VA09069 01190100
NI VDEVSTAT,X'FF'-VDEVPEND CLEAR PENDING STATUS 01191000
B STORECSW AND GO FINISH REFLECTING 01192000
SPACE 3 01193000
ATTNPLUS EQU * HERE IF ATTN PLUS OTHER STATUS IS PENDING 01194000
ICM R5,12,VDEVINTS GET STATUS 01195000
N R5,=XL4'7DFF0000' CLEAR ATTN AND UC FROM CSW 01196000
NI VDEVINTS,ATTN+UC LEAVE ONLY ATTN AND UC IN DEVICE 01197000
EJECT 01198000
STORECSW EQU * HERE TO FINISH REFLECTIN ALL INTERRUPTS 01199000
L R1,VMPSW SWAP 01200000
ST R1,IOOPSW-PSA(,R2) PSW'S 01201000
L R3,VMPSW+4 ... 01202000
ST R3,IOOPSW-PSA+4(,R2) ... 01203000
LH R0,VDEVADD GET UNIT ADDRESS 01204000
AH R0,VCUADD ... 01205000
AH R0,VCHADD ... 01206000
TM VMESTAT,VMEXTCM EXTENDED MACHINE .. 01207000
BZ *+12 NO -- 01208000
STCM R0,7,INTTIO-PSA-1(R2) SAVE ADDR IN LOW CORE @VA02716 01209000
B *+8 01210000
STH R0,IOOPSW-PSA+2(,R2) SAVE ADDRESS IN LOW CORE 01211000
L R1,IONPSW-PSA(,R2) GET NEW PSW 01212000
ST R1,VMPSW AND STORE AS CURRENT 01213000
L R1,IONPSW-PSA+4(,R2) .. 01214000
ST R1,VMPSW+4 .. 01215000
ST R4,CSW-PSA(,R2) STORE 01216000
ST R5,CSW-PSA+4(,R2) CSW 01217000
TM CSW-PSA+5(R2),CDC+CCC+IFCC ANY CHANNEL ERRORS @V508690 01217200
BZ NOCHAN NO, CONTINUE NORMAL PROCESSING @V508690 01217250
ICM R1,15,VDEVIOER GET IOERBLOK FOR CHANNEL ERROR @V508690 01217300
BZ NOCHAN NO IOERBLOK, FORGET IT @V508690 01217350
CALL DMKCCHRF REFLECT CHAN ERROR TO VIRT MACH @V508690 01217400
NOCHAN EQU * @V508690 01217450
AIF (NOT &TRACE(9)).TR2 01218000
TM TRACFLG2,TRAC0C TRACING ACTIVE? 01219000
BZ NOTRAC2 BRANCH IF NOT 01220000
* 01221000
* TRACE UNSTACK OF VIRTUAL I/O INTERRUPT 01222000
* 01223000
LA R14,TRCUNSTK SET CODE FOR UNSTAK OF INTERRUPT @V407508 01224000
BAL R1,GETRACE GET CURRENT TRACE TABLE ENTRY @V4M0017 01225000
STCM R0,B'0111',ONE(R15) SAVE VIRTUAL DEVICE ADDRESS @V407508 01226000
ST R11,4(,R15) SAVE VMBLOK PTR 01227000
ST R4,8(,R15) SAVE VIRTUAL CSW 01228000
ST R5,12(,R15) ... 01229000
NOTRAC2 EQU * 01230000
.TR2 ANOP 01231000
EJECT 01232000
* REMOVE PENDING BITS FROM MASKS 01233000
CLI VDEVINTS,0 ANY STATUS STILL PENDING IN DEVICE ? 01234000
BNE CHKTRAC CHECK OUT TRACING STATUS @VA04484 01235000
CLEARCU L R2,=A(DMKVIOMK) GET ADDRESS OF INTERRUPT MASK TABLE 01236000
LH R3,VDEVADD GET DEVICE ADDRESS (0-F) 01237000
ALR R3,R3 TIMES 2 01238000
ALR R3,R2 POINT TO PROPER INTERRUPT MASK 01239000
XC VCUDVINT,0(R3) CLEAR DEVICE PENDING FLAG FROM CU 01240000
BNZ CHKTRAC CHECK TRACING STATUS @VA04484 01241000
SPACE 01242000
CLEARCH LH R3,VCUADD GET CONTROL UNIT ADDRESS (00-F0) 01243000
SRL R3,3 TIMES 2 01244000
ALR R3,R2 POINT TO PROPER MASK 01245000
XC VCHCUINT,0(R3) CLEAR CU PENDING FLAG FROM CHANNEL 01246000
BNZ CHKTRAC CHECK TRACING STATUS @VA04484 01247000
SPACE 01248000
CLEARVM LH R3,VCHADD GET CHANNEL ADDRESS (000-F00) 01249000
SRL R3,7 GET ADDRESS TIMES 2 01250000
ALR R3,R2 POINT TO PENDING MASK 01251000
XC VMIOINT,0(R3) CLEAR PENDING INTERRUPT 01252000
BNZ CHKTRAC CHECK TRACING STATUS @VA04484 01253000
SPACE 01254000
NI VMPEND,X'FF'-VMIOPND CLEAR SUMMARY BIT 01255000
CHKTRAC EQU * CHECK TRACING STATUS @VA04484 01256000
AIF (NOT &TRACE(6)).TR2A @VA04484 01257000
TM VMTRCTL,VMTRIO+VMTRBRIN TRACING I/O OR SUCH ? @VA04484 01258000
BZ CKPSW NO..CHECK OUT PSW @VA04484 01259000
LR R4,R0 DEVICE ADDRESS IN R0 @VA04484 01260000
LH R5,CSW-PSA+4(,R9) CSW TO R5 @VA04484 01261000
LM R0,R1,IOOPSW-PSA(R9) OLD PSW IN R0-R1 @VA04484 01262000
LM R2,R3,IONPSW-PSA(R9) NEW PSW IN R2-R3 @VA04484 01263000
* VDEVBLOK ADDRESS STILL IN R8 01264000
CALL DMKTRCIO TRACE THE INTERRUPT @VA04484 01265000
LR R1,R4 DEVICE ADDRESS TO R1 @VA04484 01266000
CALL DMKSCNVU RESCAN FOR DEVICE BLOKS @VA04484 01267000
BZ CKPSW STILL THERE...GOOD @VA04484 01268000
ABEND 4 SHOULD NOT OCCUR @VA04484 01269000
.TR2A ANOP 01270000
B CKPSW BRANCH EVEN IF NO TRACE OPTION @VA05145 01271000
SPACE 01272000
CLEARCUX EQU * @VA05145 01273000
L R2,=A(DMKVIOMK) GET ADDRESS OF INT MASK TABLE @VA12932 01273500
ALR R3,R2 POINT TO PROPER INTERRUPT MASK @VA05145 01274000
XC VCUDVINT,0(R3) CLEAR DEVICE PENDING FLAG FROM CU@VA05145 01275000
BNZ CKPSW GO CHECK PSW @VA05145 01276000
SPACE 01277000
LH R3,VCUADD GET CONTROL UNIT ADDRESS (00-F0) @VA05145 01278000
SRL R3,3 TIMES 2 @VA05145 01279000
CLEARCHX EQU * @VA05145 01280000
ALR R3,R2 POINT TO PROPER MASK @VA05145 01281000
XC VCHCUINT,0(R3) CLEAR CU PENDING FLAG FROM CHAN @VA05145 01282000
BNZ CKPSW GO CHECK PSW @VA05145 01283000
SPACE 01284000
LH R3,VCHADD GET CHANNEL ADDRESS (000-F00) @VA05145 01285000
SRL R3,7 GET ADDRESS TIMES 2 @VA05145 01286000
CLEARVMX EQU * @VA05145 01287000
ALR R3,R2 POINT TO PENDING MASK @VA05145 01288000
XC VMIOINT,0(R3) CLEAR PENDING INTERRUPT @VA05145 01289000
BNZ CKPSW GO CHECK PSW @VA05145 01290000
SPACE 01291000
NI VMPEND,X'FF'-VMIOPND CLEAR SUMMARY BIT @VA05145 01292000
B CKPSW GO CHECK PSW @VA05647 01293000
EJECT 01294000
*. 01295000
* OPERATION - 01296000
* 01297000
* E. NEW PSW VALIDATION - 01298000
* 1. IF THE USER IS NOT RUNNING AN EXTENDED MACHINE,VERIFY THAT 01299000
* HE HAS NOT LOADED AN EXTENDED PSW. 01300000
* 2. IF THE USER IS RUNNING AN EXTENDED MACHINE AND IS GOING 01301000
* FROM EXTENDED TO BASIC CONTROL MODE, CALL DMKVATBC TO CLEAN 01302000
* UP ANY SHADOW TRANSLATION TABLES 01303000
* 3. IF THE USER HAS LOADED AN EXTENDED PSW, FLAG HIS MACHINE 01304000
* IN EXTENDED MODE AND CHECK TO SEE IF HE IS ENTERING 01305000
* VIRTUAL TRANSLATE MODE ALSO. IF HE IS, CALL DMKVATMD TO 01306000
* INITIALIZE SHADOW TABLES 01307000
* 4. CONDITION CODE ZERO IS RETURNED IF THE PSW IS 01308000
* VALID. OTHERWISE CONDITION CODE THREE IS RETURNED. 01309000
* 01310000
*. 01311000
SPACE 2 01312000
PSWCKSUB EQU * SUBROUTINE TO CHECK ANY NEW PSW @VA05647 01313000
NI VMDSTAT,255-VMDSP NOT RUN USER @VA08989 01314100
TM VMPSTAT,VMV370R ALLOWED TO ENTER EXTENDED MODE ?? 01315000
BZ CKBCPSW NO - PSW MUST BE VANILLA 01316000
TM VMPSW+1,EXTMODE EXTENDED PSW ?? 01317000
BO CKEXTPSW YES -- GO CHECK IT OUT 01318000
TM VMESTAT,VMEXTCM LEAVING EXTENDED MODE ?? 01319000
BZ CKTRACE NO, WAS & IS BC, GO CHK TRACE @VA04140 01320000
CALL DMKVATBC YES -- CLEAN UP TABLES 01321000
NI VMESTAT,X'FF'-VMEXTCM-VMPERCM UNFLAG PER & @V408246 01322000
* EXTENDED 01323000
B CKTRACE GO CHECK OUT TRACE @VA04140 01324000
EJECT 01325000
CKEXTPSW EQU * CHECK OUT EXTENDED MODE PSW 01326000
OI VMESTAT,VMEXTCM FLAG EXTENDED 01327000
TM VMPSW,TRANMODE ADDRESS TRANSATE MODE ALSO ?? 01328000
BZ GETMASK NO PER001 01329050
TM VMOSTAT,VMSHR IS USER EC,TRANSLATE AND SHARED? @VA09151 01329100
BNO NOTSHR NO NOT SHARED....... @VA09151 01329300
CALL DMKVATBC YES MUST THROW AWAY SHADOW TABLES@VA09151 01329500
NOTSHR DS 0H @VA09151 01329700
CALL DMKVATMD ENTER ADDRESS TRANSLATE MODE 01330000
GETMASK L R0,EXTZBIT GET MASK OF "MUST BE ZERO" BITS 01339000
N R0,VMPSW TEST 1ST WORD OF PSW 01340000
BNZ BADPSW ILLEGAL PSW FORMAT 01341000
TM VMPSW+4,X'FF' ILLEGAL BITS IN 2ND WORD 01342000
BNZ BADPSW ILLEGAL PSW IF BIT SET - GO GIVE MESSAGE 01343000
CKTRACE EQU * HERE TO CHECK OUT TRACING @VA04140 01344000
AIF (NOT &TRACE(6)).TR4 **AIF** 01345000
NI VMTRCTL,255-VMTRPER ... PER001 01345050
NI VMESTAT,255-VMPERCM ... PER001 01345100
TM VMPSW+1,EXTMODE IN EXT MODE? PER001 01345150
BNO OUROWN THEN USER CAN'T HAVE OWN PER PER001 01345200
TM VMPSW,PERMODE IS USER PER ON? PER001 01345250
BNO OUROWN NO, GO CHECK FOR CP PER PER001 01345300
OI VMESTAT,VMPERCM AND USER PER FLAG PER001 01345350
B CKTRACE2 AND CONTINUE PER001 01345400
OUROWN TM VMPERFLG,VMPERUSE IS PER TRACE ACTIVE? PER001 01345450
BNO CKTRACE2 NO, SKIP THIS NONSENSE PER001 01345500
L R1,VMPERCTL LOAD POINTER TO TRACE CTL BLOCK PER001 01345550
CLI PERCR9-PERBLOK(R1),00 ANY STOPS ACTIVE? PER001 01345600
BE CKTRACE2 NO, SKIP OI PER001 01345650
OI VMESTAT,VMPERCM TURN ON ANY BIT PER001 01345700
OI VMTRCTL,VMTRPER ... PER001 01345750
CKTRACE2 EQU * HERE TO CHECK TRACE PER001 01345800
TM VMTRCTL,VMTRBRIN INSTRUCTION TRACING SET ? 01346000
BZ CKPSWOK NOPE - OK TO GET OUT NOW @VA05647 01347000
L R1,VMTREXT YES - REFERENCE TRACE CNTRL BLOCK@VA04140 01348000
USING TREXT,R1 ... 01349000
CLI TREXIN2,X'FF' ADDRESS "NULL" OR ALREADY FILLED IN ? 01350000
BNE CKPSWOK NOT X'FF' - MUST BE ALREADY @VA05647 01351000
* FILLED IN 01352000
CLI TREXIN1,X'FF' CHECK THE "NEXT INSTRUCTION" ADDRESS 01353000
BNE CKPSWOK NOT X'FF' - MUST BE ALREADY @VA05647 01354000
* FILLED IN 01355000
TM VMPSW+1,WAIT IS USER PERCHANCE IN WAIT STATE ? 01356000
BO CKPSWOK IF YES, DON'T SET ANYTHING YET @VA05647 01357000
TM TREXFLAG,TREXNDSP SKIP THE TRCIT CALL? @VA04044 01358000
BO CKPSWOK YES - TRC WILL TURN OFF LATER @VA05647 01359000
L R1,VMPSW+4 OK - WHERE-TO-GO INTO R1, AND 01360000
CALL DMKTRCIT SET NEW "SVC B2" INSTRUCTION 01361000
DROP R1 @VA04044 01362000
.TR4 ANOP 01363000
CKPSWOK EQU * THE PSW IS VALID @VA05647 01364000
SR R0,R0 SET CONDITION CODE ZERO @VA05647 01365000
BR R9 GO BACK FROM WHENCE WE CAME @VA05647 01366000
BADPSW EQU * PSW IS BAD. TELL CALLER ABOUT IT.@VA05647 01367000
TM FFS,X'FF' SET CONDITION CODE THREE @VA05647 01368000
BR R9 AND GO BACK. HE WILL HANDLE @VA05647 01369000
SPACE 01370000
CKBCPSW EQU * HERE TO CHECK OUT BC MODE PSW 01371000
TM VMPSW+1,EXTMODE ILLEGAL BIT FOR BC MODE MACHINE 01372000
BZ CKTRACE OK, GO CHECK OUT TRACING @VA04140 01373000
B BADPSW OTHERWISE, GO GIVE MESSAGE 01374000
EJECT 01375000
CKWAIT EQU * CHECK HERE FOR DISABLED OR IDLE WAIT STATES: %V3M4038 01376000
SPACE 01377000
NI VMRSTAT,X'FF'-(VMPSWAIT+VMIDLE) UNFLAG WAIT %V3M4038 01378000
TM VMPSW+1,WAIT STILL IN WAIT ?? %V3M4038 01379000
BZ DISPATCH NO -- GO DISPATCH %V3M4038 01380000
OI VMRSTAT,VMPSWAIT FLAG IN WAIT %V3M4038 01381000
SPACE 01382000
CKWAITST SLR R1,R1 CLEAR R1 EC MODE @V386198 01383000
L R3,XRIGHT16 AND GET MASK FOR ALL EXT CHANNELS@VA02145 01384000
L R2,VMVCR0 CR0 OR ECBLOK @VA02145 01385000
TM VMESTAT,VMEXTCM RUNNING IN EC MODE ? @VA02145 01386000
BNZ CKENBL YES..CHECK I/O SUMMARY @VA02145 01387000
N R3,=A(X'3FF') IF NOT..DISABLE 0-5 @VA02145 01388000
LH R1,VMPSW PICK UP CHANNEL MASK BITS + @VA02145 01389000
N R1,=A(X'FC00') ALL BUT CHANNEL 0 - 5 @VA02145 01390000
TM VMPSTAT,VMV370R EC MODE MACHINE ? @VA02145 01391000
BZ TSTMASK NO..CHECK OUT ENABLED @VA02145 01392000
CKENBL EQU * HERE TO TEST FOR ENABLED I/O @VA02145 01393000
TM VMPSW,VMIOPND SUMMARY ENABLED? @VA02145 01394000
BZ TSTMASK NO..SEE IF ANY ENABLED @VA02145 01395000
LH R0,EXTCR2-ECBLOK(,R2) EXTENDED CHANNEL MASK @VA02145 01396000
NR R0,R3 LESS CH 0-5 ..MAYBE @VA02145 01397000
OR R1,R0 COMBINE WITH PSW MASK @VA02145 01398000
TSTMASK EQU * @VA02145 01399000
ICM R0,B'0011',VMIOACTV ACTIVE I/O MASK @V408246 01400000
BNZ DISPATCH SOMETHING GOING ON @V408246 01401000
LTR R1,R1 ENABLED ON ANY CHANNELS? @VA02145 01402000
BZ CKENEXT NO..CHECK OUT TIMERS, ECT.. @VA02145 01403000
CH R0,VMNDCNT ANY NON-DEFERED PAGE ON THE WAY @V213135 01406000
BE SETIDLE NO -- SET IDLE WAIT STATE @V213135 01407000
TM VMESTAT,VMEXTCM WILL USER BE ABLE TO TAKE IT @V213135 01408000
BO DISPATCH YES -- LEAVE HIM IN QUEUE @V213135 01409000
SETIDLE OI VMRSTAT,VMIDLE FLAG IDLE MACHINE FOR QUEUE DROP @V213135 01410000
B DISPATCH AND LEAVE @V213135 01411000
CKENEXT EQU * @VA02145 01412000
OI VMRSTAT,VMIDLE FLAG FOR Q DROP @VA02145 01413000
TM VMPSW,VMEXTPND ENABLED FOR EXT INTERRUPTS? @VA02145 01414000
BZ DISABLED NO..DISABLED WAIT STATE @VA02145 01415000
TM VMPSTAT,VMV370R EC MODE MACHINE? @VA02145 01416000
BZ EXTBCM NO..NO CLOCK COMP..CPU TIMER @VA02145 01417000
L R2,EXTCR0-ECBLOK(,R2) PICK UP CR0 @VA02145 01418000
LR R1,R2 AND SWITCH TO R1 @VA02145 01419000
N R1,=A(X'0C00') ENABLED FOR EXTENDED TIMERS, ECT.@VA02145 01420000
BNZ DISPATCH YES..INTERRUPT WILL COME.. @VA02145 01421000
EXTBCM EQU * @VA02145 01422000
LR R1,R2 CR0 TO R1 @VA02145 01423000
N R1,=A(X'41') EXT KEY + VMCF @V387045 01424000
BNZ DISPATCH YES¬¬LET HIM GO @VA02145 01425000
TM VMTLEVEL,VMRON REAL TIMER RUNNING? @VA02145 01426000
BZ DISABLED NO..DISABLED WAIT STATE @VA02145 01427000
N R2,=A(X'80') ENABLED FOR INTERVAL TIMER? @VA02145 01428000
BNZ DISPATCH YES..IT'LL COME LATER.. @VA02145 01429000
EJECT 01430000
DISABLED TM VMOSTAT,VMSYSOP IS USER ALLOWED TO DISABLE ? @V3M4026 01431000
BO DISPATCH O.K. IF SYSTEM OPERATOR @V3M4026 01432000
LA R2,450 ERROR CODE: "DISABLED WAIT PSW" @V3M4026 01433000
SPACE 01434000
LA R0,3 SIZE OF MESSAGE BUFFER @V3M4026 01435000
CALL DMKFREE GO GET THE SPACE FOR IT... @V3M4026 01436000
LR R3,R1 SAVE ADDR IN R3 (FOR ERMSG FRET) @V3M4026 01437000
MVI 0(R3),C'''' ADD BEG. DELIMITER TO MSG DATA @V3M4026 01438000
L R1,VMPSW GET FIRST HALF OF PSW IN ERROR @V3M4026 01439000
CALL DMKCVTBH CONVERT FOR OUTPUT @V3M4026 01440000
STM R0,R1,1(R3) SAVE IT @V3M4026 01441000
MVI 9(R3),C' ' CLEAN UP MESSAGE OUTPUT... @V3M4026 01442000
L R1,VMPSW+4 GET SECOND HALF @V3M4026 01443000
CALL DMKCVTBH CONVERT IT @V3M4026 01444000
STM R0,R1,10(R3) AND SAVE @V3M4026 01445000
MVI 18(R3),C'''' ADD ENDING DELIMITER TO MSG DATA @V3M4026 01446000
LA R0,19 SIZE OF MESSAGE IN BYTES @V3M4026 01447000
LR R1,R3 ADDRESS OF THE MESSAGE @V3M4026 01448000
ICM R2,B'1100',PSWPARMS LOAD OPTION REGISTER @V3M4026 01449000
ICM R3,B'1000',F3+3 LOAD SIZE OF BUFFER TO FRET @V3M4026 01450000
SPACE 01451000
DSPERMSG EQU * HERE TO SEND MSG @V3M4026 01452000
NI VMOSTAT,X'FF'-VMCFRUN STOP RUNNING IN CF MODE @V3M4026 01453000
OI VMRSTAT,VMCFWAIT AND PUT IN CF WAIT RIGHT NOW @V3M4026 01454000
ICM R0,B'1110',=C'DSP' MODULE ID FOR CALL TO ERM @V3M4026 01455000
CALL DMKERMSG INVOKE ERROR MESSAGE WRITER @V3M4026 01456000
CALL DMKCFMBK PLACE USER IN CONSOLE FUNC. MODE @V3M4026 01457000
* B DISPATCH CONTINUE... @V407508 01458000
EJECT 01459000
*. 01460000
* 01461000
* OPERATION - 01462000
* 01463000
* F. COMPLETE PROCESSING FOR CURRENT USER - 01464000
* 1. CALL DMKSCHDL IF NECESSARY TO ALTER DISPATCHING PRIORITY OF 01465000
* THE USER FOR WHICH DISPATCH WAS ENTERED. 01466000
* 2. UNLOCK THE CURRENT USER IF THAT USER IS NOT LASTUSER OR 01467000
* THE SYSTEM VMBLOK (WHICH IS NOT LOCKED). IF THE CURRENT 01468000
* USER IS RUNNABLE AND THE OTHER PROCESSOR IS IDLE, SIGNAL 01469000
* THE OTHER PROCESSOR. 01470000
* 3. UNLOCK LASTUSER IMMEDIATELY IF THAT USER IS NOT USING 01471000
* SHARED SYSTEMS. OTHERWISE, WAIT UNTIL ANOTHER USER IS 01472000
* SELECTED TO RUN, OR UNTIL A WAIT STATE IS LOADED. 01473000
* 4. IF THE SYSTEM IS IN EXTEND AND THE CURRENT PROCESSOR IS 01474000
* THE ATTACHED PROCESSOR RELEASE THE SYSTEM LOCK AND SPIN 01475000
* UNTIL EXTEND COMPLETES. 01476000
* 5. IF AUTOMATIC PROCESSOR RECOVERY IS PENDING, CALL DMKMCTPR. 01477000
* 6. IF THE OTHER PROCESSOR NEEDS THE SYSTEM LOCK, RELEASE IT 01478000
* AND GO TO SECTION H TO SELECT A USER FOR DISPATCHING. 01479000
* 01480000
* 01481000
*********************************************************************** 01482000
* 01483000
* 01484000
* CP ASSIST INSTRUCTIONS "DSP1" AND "DSP2" - DISPATCH A BLOK 01485000
* 01486000
* 01487000
* OPERANDS: 01488000
* 1 = ADDRESS OF 'DSP1LIST' (DATA LIST) 01489000
* 2 = ADDRESS OF 'DSP1EXIT' (EXIT LIST) 01490000
* 01491000
* REGISTER INPUT: 01492000
* GPR 11 = ADDRESS OF THE VMBLOK OF USER BEING PROCESSED 01493000
* 01494000
* SYSTEM DATA AREAS REFERENCED (BY MODULE WHERE APPLICABLE): 01495000
* DMKPSA - 'APSTAT2', 'ASYSVM', 'PROBSTRT', 'STACKVM', 01496000
* RUN AND STATUS FIELDS, TRACING INFORMATION 01496100
* CPEXBLOK, ECBLOK, IOBLOK, MICBLOK, PAGE AND SEGMENT TABLES, 01497000
* SHRTABLE, TREXT, TRQBLOK, VMABLOK, VMBLOK, XINTBLOK 01498000
* 01499000
* 01500000
* NOTE: ONLY CR, FPR, AND GPR 12-13 CONTENTS WILL NOT BE CHANGED 01501000
* IF NOT MENTIONED IN THE FOLLOWING EXIT LISTS. ALL OTHER GPR 01502000
* VALUES AT EXIT POINTS SHOULD BE CONSIDERED UNPREDICTABLE. 01503000
* 01504000
* "DSP1" EXITS TO SPECIFIED OPERAND 2 LIST ADDRESSES: 01505000
* 01506000
* +0 'OFFCALL' (THIS USER IS TO BE LOGGED OFF THE SYSTEM) 01507000
* REGISTER OUTPUT: 01508000
* GPR 11 = ENTRY CONTENT - VMBLOK ADDRESS BEING PROCESSED 01509000
* 01510000
* +4 'SCHDL' (MUST CALL SCHEDULER TO CHECK DISPATCHING QUEUE) 01511000
* REGISTER OUTPUT: SAME AS EXIT TO +0 'OFFCALL' 01512000
* 01513000
* "DSP1" AND "DSP2" EXITS TO SPECIFIED OPERAND 2 LIST ADDRESSES: 01514000
* 01515000
* +8 'UNLOCK1' (THE SYSTEM EXTEND LOCK IS SET TO X'FF') 01516000
* REGISTER OUTPUT: SAME AS EXIT TO +0 'OFFCALL' 01517000
* 01518000
* +12 'FRETCPEX' (CP ASSIST "FRET" COULDN'T FRET CPEXBLOK) 01519000
* REGISTER OUTPUT: 01520000
* GPR 0 = VALUE OF X'0000000A' 01521000
* GPR 1 = ADDRESS OF CPEXBLOK 01522000
* GPR 2-11 = CPEXBLOK VALUES ('CPEXR2' TO 'CPEXR11') 01523000
* 01524000
* +16 'CKSHRSYS' (CAN'T COMPLETE CHECKS FOR SHARED SYSTEM USER) 01525000
* REGISTER OUTPUT: 01526000
* GPR 10 = ADDRESS OF VMBLOK TO BE DISPATCHED 01526100
* GPR 11 = ADDRESS OF VMBLOK OF 'LASTUSER' 01527000
* 01528000
* +20 'FREELOCK' DSP2 EXIT IF VMNOECPS IS NON-ZERO @VMD0134 01529100
* REGISTER OUTPUT: @VMD0134 01529200
* GPR 1 = ADDRESS OF VMBLOK TO BE DISPATCHED @VMD0134 01529300
* GPR 11 = ASYSVM VALUE @VMD0134 01529400
* 01533000
* +24 'IDLEECPS' (THE RUN LIST, 'DMKSCHRL', IS EMPTY) 01534000
* REGISTER OUTPUT: REGISTERS ARE UNPREDICTABLE 01535000
* 01536000
* +28 'DSP2' (A BAD EC-MODE ENVIRONMENT HAS BEEN DETECTED) 01537000
* REGISTER OUTPUT: 01538000
* GPR 11 = ADDRESS OF VMBLOK TO BE DISPATCHED 01539000
* 01540000
* "DSP1" AND "DSP2" EXITS UPON DISPATCH OF A BLOK: 01541000
* 01542000
* EXIT BY IOBLOK OR TRQBLOK DISPATCH: (EXIT TO NEW GPR 12 VALUE) 01543000
* REGISTER OUTPUT: 01544000
* GPR 10 = ADDRESS OF THE IOBLOK/TRQBLOK 01545000
* GPR 11 = ADDRESS OF THE VMBLOK OF 'IOBUSER'/'TRQBUSER' 01546000
* GPR 12 = EXIT ADDRESS ('IOBIRA'/'TRQBIRA') 01547000
* 01548000
* EXIT BY CPEXBLOK DISPATCH: (EXIT TO NEW ADDRESS IN GPR 15) 01549000
* REGISTER OUTPUT: 01550000
* GPR 0-14 = CPEXBLOK VALUES ('CPEXR0' TO 'CPEXR14') 01551000
* GPR 15 = CPEXBLOK VALUE ('CPEXADD') 01552000
* 01553000
* EXIT BY VMBLOK DISPATCH: (EXIT TO ADDRESS IN 'VMPSW'+4) 01554000
* REGISTER OUTPUT: 01555000
* CR 0 = VALUE FROM EITHER 'CPCREG0' OR 'EXTSHCR0' 01556000
* CR 1 = VALUE FROM EITHER 'VMSEG' OR 'EXTSHCR1' 01557000
* CR 4-8 = VALUES FROM ECBLOK ('EXTCR4' - 'EXTCR8') OR 01558000
* ENTRY CONTENTS 01558100
* CR 9-11 = VALUES FROM ECBLOK ('EXTCR9' - 'EXTCR11') OR 01559000
* VALUES FROM TREXT ('TREXCR9' - 'TREXCR11') OR 01560000
* ENTRY CONTENTS 01561000
* CR 12-13 = VALUES FROM ECBLOK ('EXTCR12' - 'EXTCR13') OR 01562000
* ENTRY CONTENTS 01562100
* FPR 0-6 = VALUES FROM VMBLOK ('VMFPRS') 01563000
* GPR 0-15 = VALUES FROM VMBLOK ('VMGPRS') 01564000
* 01565000
*********************************************************************** 01566000
*. 01567000
EJECT 01568000
DISPATCH EQU * ALTER USER STATUS AND DISPATCH... 01569000
SPACE 01570000
DS 0H EXECUTE CP ASSIST "DSP1" @V3M4026 01571000
DMKDSP1 DC X'E607',S(DSP1LIST,DSP1EXIT) ***@V3M4026 01572000
SPACE 01573000
L R1,VMRSTAT SCH BITS %V408246 01574000
N R1,SCHMASK JUST 'IMPORTANT' BITS %V408246 01575000
SL R1,SCHMON REMOVE 'ON' BITS, SHOULD LEAVE %V408246 01576000
* 'ZERO' 01577000
BC 2,UNLOCK YES, NO FURTHER CHECKING %V407508 01578000
* NECESSARY 01579000
CHKILL DS 0H %V408246 01580000
C R11,ASYSVM IS VMBLOK = SYSTEM? %V408246 01581000
BE UNLOCK YES, NOTHING FURTHER TO CHECK %V4M0173 01582000
TM VMOSTAT,VMKILL SHOULD USER BE LOGGED OFF ? %V3M4038 01583000
BZ SCHDL NO, CHECK FOR RUNNABLE STATUS %V407508 01584000
TM VMQSTAT,VMCFREAD IS READ PENDING? %V3M4038 01585000
BO OFF IF SO, EXIT %V3M4038 01586000
TM VMOSTAT,VMCF EXECUTING A CONSOLE FUNCTION NOW %V3M4038 01587000
BO SCHDL YES, WAIT UNTIL IT'S ALL DONE %V407508 01588000
OFF NI VMQSTAT,255-VMCFREAD TURN OFF FLAG AND EXIT %V3M4038 01589000
NI VMOSTAT,255-VMKILL DO NOT CALL TWICE %V3M4038 01590000
TM VMRSTAT,VMLOGOFF IN LOGOFF? %V3M4038 01591000
BO UNLOCK DON'T CALL USO AGAIN %V407508 01592000
OI VMRSTAT,VMLOGOFF DO NOT RUN THIS VM %V3M4038 01593000
OFFCALL DS 0H LOG USER OFF SYSTEM @VA13025 01594000
TM VMRSTAT,VMEXWAIT IS USER IN EXECUTION WAIT @VA13025 01594200
BO DELAYOFF YES, WAIT UNTIL FINISHED @VA13025 01594400
CALL DMKUSOFF LOG USER OFF SYSTEM @VA08667 01594600
B UNLOCK GO UNLOCK USER @V407508 01595000
SPACE 1 @VA13025 01595100
DELAYOFF OI VMOSTAT,VMKILL RESET THE VMKILL BIT @VA13025 01595200
NI VMRSTAT,255-VMLOGOFF RESET LOGOFF BIT IN VMBLOK @VA13025 01595300
TM VMSPMFLG,VMCFRD1 IS BACK-UP BIT ON ? @VA13025 01595400
BZ SCHDL NO, THEN JUST GO TO SCHEDULER @VA13025 01595500
OI VMQSTAT,VMCFREAD YES, THEN SET CFREAD FLAG @VA13025 01595600
B SCHDL AND GO TO SCHEDULER @VA13025 01595700
SPACE 1 @VA13025 01595800
* 01596000
* THE FOLLOWING TWO DATA LISTS MUST BE KEPT CONTIGUOUS AND IN ORDER 01597000
* BECAUSE THEY ARE USED BY CP ASSIST INSTRUCTIONS "DSP1" AND "DSP2". 01598000
SPACE 01599000
DSP1LIST DS 0F "DSP1" & "DSP2" ASSIST DATA LIST @V3M4026 01600000
SPACE 01601000
* NOTE: THE WORD AT DISPLACEMENT 28 WILL BE INCREMENTED 01601200
* BY 4 DURING IPL IF THIS CPU HAS CP ASSIST LEVEL 18 01601400
* OR 19. THIS ALLOWS USE OF THE "OLD" LEVEL OF FRET ASSIST. 01601600
SPACE , 01601800
DMKDSPRQ DC 4A(DMKDSPRQ) +0 IO, TRQ, CPEX BLOK ANCHORS @V3M4026 01602000
DMKDSPQS DC A(X'F00') +16 50 MILLISEC. DSP. TIME SLICE @V3M4026 01603000
PTRRTLOC DC A(0) +20 RESERVED @V408246 01604000
SCHRLOC DC A(DMKSCHRL) +24 LIST OF RUNNABLE USERS @V386198 01605000
DC V(DMKFREMX) +28 ADDRESS OF 'MAXSIZE' @VA14280 01606100
DC V(DMKFRETL) +32 ADDR OF CP ASSIST DATA LIST @V386198 01607000
DC V(DMKVATAT) +36 ADDR OF TABLE 'ARCHTECT' @V386198 01608000
DSPSAVE DC 6F'0' +40 SAVE AREA FOR CPEX REGS 12-1 @V386198 01609000
SCHMASK DS 0F +60 BITS REQUIRING CHECK 01610000
DC AL1(VMNORUN) VMRSTAT @V408246 01611000
DC AL1(VMRUN+VMINQ+VMTSEND+VMQSEND) VMDSTAT @V408246 01612000
DC AL1(VMKILL) VMOSTAT @V408246 01613000
DC AL1(VMPRIDSP) VMQSTAT @V408246 01614000
SCHMON DS 0F +64 THE ONLY ALLOWABLE VALUE 01615000
DC AL1(0) VMRSTAT @V408246 01616000
DC AL1(VMRUN+VMINQ) VMDSTAT @V408246 01617000
DC AL2(0) VMOSTAT, VMQSTAT @V408246 01618000
SPACE 2 01619000
DSP1EXIT DS 0F "DSP1" & "DSP2" ASSIST EXIT LIST @V3M4026 01620000
SPACE 01621000
DC A(OFFCALL) +0 USER GOING TO BE LOGGED OFF @V386198 01622000
DC A(SCHDL) +4 NEED TO GO THRU SCHEDULER @V386198 01623000
DC A(UNLOCK1) +8 THE SYSTEM IS EXTENDING @V407508 01624000
DC A(FRETCPEX) +12 CAN'T RELEASE A CPEXBLOK @V386198 01625000
DC A(CKSHRSYS) +16 CAN'T DO SHARED SYS. CHECKS @V386198 01626000
DC A(FREELOCK) +20 VMNOECPS BIT IS NON-ZERO @VMD0134 01627100
DC A(IDLEECPS) +24 CAN'T DISPATCH A USER @V407508 01628000
DC A(DSP2) +28 ABEND CONDITION DETECTED @V386198 01629000
EJECT 01630000
SCHDL CALL DMKSCHDL CALL THE SCHEDULER 01631000
UNLOCK DS 0H UNLOCK THE CURRENT USER %V407508 01632000
SPACE 01633000
DS 0H EXECUTE CP ASSIST DSP2 %V407508 01634000
DMKDSP2 DC X'E611',S(DSP1LIST,DSP1EXIT) ***%V407508 01635000
UNLOCK1 DS 0H %V407508 01636000
SPACE 01637000
LR R1,R11 SAVE CURRENT R11 USER %V407508 01638000
CHARGE STOP STOP CHARGING CURRENT VMBLOK %V4M0173 01639000
L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK %V4M0173 01640000
AIF (NOT &AP).UPBR4 **AIF*** 01640900
* IN UP-MODE, SUBROUTINE UNLOKVM1 IS A NO-OP. 01641000
BAL R8,UNLOKVM1 UNLOCK OLD R11 USER %V407508 01642000
L R15,PREFIXB ACCESS PSA OF OTHER PROCESSOR %V4M0173 01643000
CLI CPSTATUS-PSA(R15),CPWAIT IS IT IDLE %V4M0173 01644000
BNE UNLKLAST NO - PROCESS STACKVM %V4M0173 01645000
TM VMDSTAT-VMBLOK(R1),VMRUN IS OLD R11 VM RUNNABLE @V4M0173 01646000
BZ UNLKLAST NO- BYPASS WAKE-UP SIGNAL @V4M0173 01647000
BAL R9,WAKSIG ALERT OTH PROC @VA09257 01648000
.UPBR4 ANOP **ANOP** 01648100
UNLKLAST DS 0H SEE IF LASTUSER IS TO BE UNLOCKD %V407508 01649000
AIF (&AP).APBR5 **AIF*** 01649100
CLI XTNDLOCK,SET IS SYSTEM IN EXTEND? %VA07369 01649200
BE FLAGCPEX YES, DO EXTEND PROCESSING %VA07369 01649300
AGO .UPBR5 **AGO*** 01649400
.APBR5 ANOP **ANOP** 01649500
TM APSTAT1,APUOPER IS THE AP OPERATIONAL? %V407508 01650000
BNO EXTNDTST NO, LEAVE EVERYTHING AS IS %V407508 01651000
L R1,STACKVM GET ADDR OF UNSTACKED VMBLOK @V407508 01652000
LTR R1,R1 IS ANY ADDRESS THERE? @V407508 01653000
BZ NOSTKVM NO, SKIP TRYING TO UNLOCK VM @V407508 01654000
BAL R8,UNLOKVM UNLOCK VMBLOK IF LOCKED @V407508 01655000
SLR R1,R1 CLEAR R1 @V407508 01656000
ST R1,STACKVM CLEAR ADDR OF UNSTACKED VMBLOK @V407508 01657000
NOSTKVM DS 0H @V407508 01658000
L R1,LASTUSER GET VALUE OF LASTUSER @V407508 01659000
CR R1,R11 IS LASTUSER EQUAL TO ASYSVM? @V407508 01660000
BE EXTNDTST YES, ALREADY UNLOCKED @V407508 01661000
TM VMOSTAT-VMBLOK(R1),VMSHR WAS LASTUSER USING @V407508 01662000
* SHARED SYSTEMS @V407508 01663000
BO EXTNDTST YES, LEAVE LOCKED @V4M0173 01664000
BAL R8,UNLOKVM2 UNLOCK LASTUSER @V407508 01665000
ST R11,LASTUSER SET LASTUSER = ASYSVM @V407508 01666000
EJECT 01667000
EXTNDTST DS 0H TEST FOR EXTEND %V407508 01668000
L R2,PREFIXA GET PROCESSOR PREFIX ADDRESS %V407508 01669000
CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? %V407508 01670000
BNE MCHTEST NO, TEST FOR SOFT ERROR PENDING %V407508 01671000
TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? @V407508 01672000
BO FLAGCPEX YES, DO EXTEND PROCESSING @V4M0173 01673000
BAL R9,XTNDAP DO AP-ONLY EXTEND PROCESSING @V407508 01674000
BAL R9,FREESYS NO, AP RELEASES THE SYSTEM LOCK @V407508 01675000
SR R0,R0 CLEAR R0 TO INDICATE END COND @V407508 01676000
LA R1,XTNDLOCK-PSA(,R2) GET ADDR OF EXTEND LOCK @V407508 01677000
O R1,=A(X'80000000') TURN ON HIGH ORDER BIT @V407508 01678000
CALL DMKLOKPS SPIN TILL EXTEND COMPLETES @V407508 01679000
CLI CPFRESW-PSA(R2),SET IS FRESW FLAG ON FOR AP? @V407508 01680000
BNE CKUSERS2 NO, SELECT A USER TO DISPATCH @V407508 01681000
LOCK OBTAIN,TYPE=SYS,SPIN=YES GO SPIN ON SYSTEM LOCK @V407508 01682000
MVI CPFRESW-PSA(R2),NONE TURN OFF FRESW FLAG @V407508 01683000
B FNDPBLOK FIND 1ST PRIORITY BLOK FOR PROC @V4M0141 01684000
.UPBR5 ANOP **ANOP** 01684100
SPACE 01685000
MCHTEST DS 0H TEST FOR NEEDED RECOVERY %V407508 01686000
* IN UP-MODE, FLAG CPAPRPND IS ALWAYS 0. 01687100
* ECPS CHECKS CPMCHLK IN APSTAT2 INSTEAD OF CPMCHSE; 01687600
* ECPS EXITS TO UNLOCK1 IF THIS FLAG IS ON. 01688100
TM APSTAT4,CPMCHSE+CPAPRPND TEST MCH RECOVRY FLAGS %VA07615 01688600
AIF (&AP).APBR6 **AIF*** 01689100
BZ CKCPSTAK NONE SET, CONTINUE NORMALLY %VA07615 01689600
CHARGE START START CHARGING SYSTEM VMBLOK @VA07615 01690100
AGO .UPBR6 **AGO*** 01690600
.APBR6 ANOP **ANOP** 01691100
BZ SYSLKTST NONE SET, CHECK SYS LOCK FLAG %VA07615 01691600
CHARGE START START CHARGING SYSTEM VMBLOK @V4M0173 01693000
TM APSTAT4,CPAPRPND IS AUTO PROC RECOVERY PENDING? @VA07615 01694100
BNO MCHSXT NO, GOTO DMKMCH FOR SOFT ERROR @V407508 01695000
GOTO DMKMCTPR DO AUTOMATIC PROCESSOR RECOVERY @V407508 01696000
SPACE 01697000
MCHSXT DS 0H EXIT TO DMKMCHSE @V407508 01698000
.UPBR6 ANOP **ANOP** 01698100
GOTO DMKMCHSE DO SOFT ERROR RECOVERY @V407508 01699000
AIF (NOT &AP).UPTST7 **AIF*** 01699900
SPACE 01700000
SYSLKTST DS 0H CHECK SYSTEM LOCK FLAG %VA07615 01701100
* IN UP-MODE, FLAG CPSYSLK IS ALWAYS 0. 01701200
TM APSTAT3,CPSYSLK DOES OTHER PROC NEED SYS LOCK? %VA07615 01701300
BZ CKCPSTAK NO, CONTINUE NORMALLY %VA07615 01701400
BAL R9,FREESYS RELEASE SYSTEM LOCK @V407508 01702000
B CKUSERS GO SELECT A USER TO DISPATCH @V407508 01703000
.UPTST7 ANOP **ANOP** 01703100
EJECT 01704000
*. 01705000
* 01706000
* OPERATION - 01707000
* 01708000
* G. UNSTACK DEFERRED BLOCKS 01709000
* 1. TO UNSTACK ANY BLOK, FIRST LOCK THE ASSOCIATED VMBLOK. IF 01710000
* THE LOCK IS NOT AVAILABLE, SKIP THIS BLOK AND SCAN FOR 01711000
* ANOTHER BLOK FOR A DIFFERENT VM. FOR A GIVEN VM, BLOKS ARE 01712000
* UNSTACKED IN THE FOLLOWING ORDER: DEFERRED INTERRUPT TASK; 01713000
* PRIORITY CPEXBLOKS; IO/TRQ BLOKS; NORMAL CPEXBLOKS. 01714000
* 2. EXAMINE FIRST THE STACK OF IO/TRQ BLOKS. IF SYSTEM IS NOT 01715000
* EXTENDING, UNSTACK NORMALLY; OTHERWISE, ONLY UNSTACK PAGING 01716000
* OR PCI IOBLOKS. 01717000
* 3. BEFORE EXAMINING THE STACK OF CPEXBLOKS, OPEN A WINDOW FOR 01718000
* INTERRUPTS IF THE SYSTEM IS NOT EXTENDING. 01719000
* 4. EXAMINE THE STACK OF CPEXBLOKS. IF SYSTEM IS NOT EXTENDING 01720000
* UNSTACK NORMALLY; OTHERWISE ONLY UNSTACK THOSE THAT WILL 01721000
* ALLOW THE SYSTEM TO EXTEND. IF A 01722000
* CPEXBLOK FOR THE OTHER PROCESSOR IS ENCOUNTERED, GIVE UP 01723000
* THE SYSTEM LOCK, SIGNAL THE OTHER PROCESSOR, AND GO TO 01724000
* SECTION H TO SELECT A USER TO DISPATCH. 01725000
* 01726000
*. 01727000
SPACE 2 01728000
EJECT 01729000
CKCPSTAK EQU * FIRST, TEST FOR STACKED REQUESTS %V3M4038 01730000
LA R15,DMKDSPRQ GET ADDRESS OF DSP REQUEST STACK %V4M0173 01731000
C R15,IOBFPNT-IOBLOK(,R15) IS THE LIST EMPTY? %V4M0173 01732000
BE WINDOW YES, GO OPEN INTERRUPT WINDOW %V4M0173 01733000
SPACE 01734000
FLAGCPEX DS 0H %V408246 01735000
BAL R9,LOCKOBDS GET LOCK FOR DSP STACKS @VA09257 01736000
SPACE 01737000
LA R15,DMKDSPRQ POINT TO REQUEST STACK %V3M4038 01738000
LR R10,R15 INTIALIZE R10 %V407508 01739000
AIF (&AP).APBR7 **AIF*** 01739100
CLI XTNDLOCK,SET IS SYSTEM IN EXTEND? %VA07369 01739200
AGO .UPBR7 **AGO*** 01739300
.APBR7 ANOP **ANOP** 01739400
L R3,PREFIXA GET PROCESSOR PREFIX ADDRESS %V407508 01740000
CLI XTNDLOCK-PSA(R3),SET IS SYSTEM IN EXTEND? %V407508 01741000
.UPBR7 ANOP **ANOP** 01741100
BNE NOEXTND NO, CONTINUE NORMALLY %V407508 01742000
USING IOBLOK,R10 SET UP ADDRESSABILITY TO IOBLOK @V407508 01743000
NXTIOB DS 0H @V407508 01744000
L R10,IOBFPNT GET FIRST/NEXT IO OR TRQ BLOK @V407508 01745000
CLR R10,R15 ANY REQUESTS LEFT? @V407508 01746000
BE EXTDISP NO, GO LOOK FOR XTND CPEXBLOKS @V407508 01747000
TM 0(R10),X'80' IS THIS A TRQ @VA07831 01747100
BO NXTIOB YES, DO NOT UNSTACK @VA07831 01747150
* BIT IS ON FOR ALL TRQ'S & 01747200
* OFF FOR ALL PAGING IOB'S 01747250
TM IOBFLAG,IOBPAG IS IOB A PAGING TASK @V407508 01748000
BO GETVM YES, GO TO LOCK ASSOCIATED VM @V407508 01749000
TM IOBCSW+5,PCI IS IOB A PCI INERRUPT? @V407508 01750000
BNO NXTIOB NO, GO GET NEXT IOBLOK @V407508 01751000
GETVM DS 0H @V407508 01752000
AIF (NOT &AP).UPTST8 **AIF*** 01752900
L R1,IOBUSER GET ADDRESS OF ASSOCIATED VM @V407508 01753000
* IN UP-MODE, SUBROUTINE LOCKVM IS A NO-OP. 01754000
BAL R9,LOCKVM GO TO LOCK THIS VM @V407508 01755000
BNZ DOWN LOCK NOT OBTAINED, TERM VM/370 @V407508 01756000
.UPTST8 ANOP **ANOP** 01756100
B PROCIOB LOCK HELD, PROCESS THIS IOB @V407508 01757000
SPACE 01758000
NOEXTND DS 0H NORMAL PROCESSING %V407508 01759000
L R10,IOBFPNT GET FIRST/NEXT IO OR TRQ BLOK %V407508 01760000
AIF (NOT &AP).UPTST9 **AIF*** 01760900
CLR R10,R15 ANY REQUESTS LEFT? %V407508 01761000
BE CKCPREQ NO, GO LOOK FOR CPEXBLOKS %V407508 01762000
TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? %V4M0173 01763000
BZ PROCIOB NO, GO PROCESS THIS IOB %V4M0173 01764000
L R1,IOBUSER GET ADDRESS OF ASSOCIATED VM @V407508 01765000
BAL R9,LOCKVM GO TO LOCK THIS VM @V407508 01766000
BZ TESTDEF LOCK OBTAINED @VA09257 01767100
L R2,PREFIXB ACCESS OTHER PSA @VA09257 01767120
CLI CPSTATUS-PSA(R2),CPRUN IS OTHER PROCR ENABLED @VA09257 01767140
BNE NOEXTND NO, BYPASS IOB @VA09257 01767160
B SIGPDSP YES, SIGNAL DISPATCH @VA09257 01767180
DSPSIG SIGNAL DISPATCH @VA09257 01767200
BR R9 @VA09257 01767220
WAKSIG SIGNAL WAKEUP @VA09257 01767240
BR R9 @VA09257 01767260
TESTDEF DS 0H @VA09257 01767280
DROP R11 STOP USING R11 FOR VMBLOK @V407508 01768000
USING VMBLOK,R1 SET UP ADDRESSABILITY TO VMBLOK @V407508 01769000
TM VMPEND,VMDEFSTK IS A DEFERRED INTERRUPT PENDING @V407508 01770000
BNO TESTP NO, TEST FOR PRIORITY CPEXBLOKS @V4M0141 01771000
L R2,VMDFTPNT GET ADDRESS OF DEFERRED INT TASK @V407508 01772000
CLC LPUADDRX,CPEXPROC-CPEXBLOK(R2) IS THIS DEFERRED @V407508 01773000
* TASK FOR THE OTHER PROCESSOR? @V407508 01774000
BNE PROCCP GO TO UNSTACK THIS TASK @V407508 01775000
B SIGNLDSP GO ISSUE DISPATCH SIGNAL @V407508 01776000
SPACE 01777000
TESTP DS 0H @V407508 01778000
LH R2,VMPRRCT GET CNT OF PRIORITY CPEXBLOKS @V4M0141 01779000
LTR R2,R2 ARE THERE PRIORITY CPEXBLOKS? @VA07581 01779100
BNZ FINDPTSK FIND PRIORITY CPEXBLOK @V4M0136 01780000
TESTIO DS 0H @V407508 01781000
C R10,IOBFPNT-IOBLOK(,R15) IS THIS THE 1ST IOB? @V407508 01782000
BE PROCIOB YES, NO PRIOR IOB EXIST @V407508 01783000
LH R2,VMSTKCNT GET IOB/CPEX COUNT @V407508 01784000
C R2,F1 IS THIS COUNT > 1? @V407508 01785000
BNH PROCIOB NO, GO PROCESS THIS IOB @V407508 01786000
BAL R9,FINDIOB LOOK FOR A PRIOR IOB @V407508 01787000
DROP R1 STOP USING R1 AS VMBLOK BASE @VA07369 01787100
.UPTST9 ANOP **ANOP** 01787200
PROCIOB DS 0H PROCESSING FOR IO OR TRQ BLOKS %V407508 01788000
LM R2,R3,IOBFPNT GET FORWARD & BACKWARD POINTERS %V407508 01789000
ST R2,IOBFPNT-IOBLOK(,R3) REPLACE FORWARD POINTER %V407508 01790000
* OF PREVIOUS ELEMENT %V407508 01791000
ST R3,IOBBPNT-IOBLOK(,R2) REPLACE BACKWARD POINTER %V407508 01792000
* OF NEXT ELEMENT %V407508 01793000
USING VMBLOK,R11 START USING R11 AS VMBLOK BASE %V4M0173 01795000
L R11,IOBUSER SWITCH R11 TO NE VMBLOK %V4M0173 01796000
LH R2,VMSTKCNT GET IOB/CPEX COUNT FOR THIS VM %V407508 01797000
BCTR R2,0 DECREMENT THIS COUNT BY 1 %V407508 01798000
STH R2,VMSTKCNT REPLACE WITH UPDATED COUNT %V407508 01799000
BAL R9,LOCKRLDS RELEASE LOCK ON DSP STACKS @VA09257 01800100
AIF (NOT &TRACE(9)).TR10 ** AIF ** %V3M4038 01801000
TM TRACFLG2,TRAC10 TRACING ACTIVE? %V3M4038 01802000
BZ NOTRAC3 BRANCH IF NOT %V3M4038 01803000
* 01804000
* TRACE UNSTACK OF IOBLOK OR TRQBLOK 01805000
* 01806000
LA R14,TRCUNBLK SET CODE FOR UNSTACK OF BLOK %V407508 01807000
BAL R1,GETRACE GET CURRENT TRACE TABLE ENTRY %V4M0017 01808000
STCM R11,B'0111',ONE(R15) STORE VMBLOK ADDRESS %V4M0173 01809000
MVC 4(4,R15),VMRSTAT SAVE STATUS OF NEW VMBLOK %V4M0173 01810000
ST R10,8(,R15) POINT TO IOBLOK OR TRQBLOK %V3M4038 01811000
L R1,IOBIRA GET INTERRUPT RETURN ADDRESS %VA07237 01812000
ST R1,12(,R15) SAVE THE RETURN ADDRESS %VA07237 01813000
NOTRAC3 EQU * %V3M4038 01814000
.TR10 ANOP 01815000
CHARGE START START CHARGING NEW VMBLOK %V4M0173 01816000
L R12,IOBIRA GET INTERRUPT RETURN ADDRESS %VA07237 01816100
ST R11,STACKVM REMEMBER UNSTACKED VMBLOK %V407508 01817000
BR R12 AND GO .. %V3M4038 01818000
EJECT 01819000
CKCPREQ EQU * CHECK FOR STACKED CPEXBLOKS %V3M4038 01820000
* 01826000
* OPEN WINDOW FOR INTERRUPTS 01827000
* 01828000
BAL R9,LOCKRLDS RELEASE LOCK ON DSP STACKS @VA09257 01829100
WINDOW DS 0H %V4M0173 01830000
AIF (NOT &AP).UPTST10 **AIF*** 01830900
TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? %V4M0173 01831000
BO ENABLE YES, OPEN WINDOW ON MAIN PROC %V4M0173 01832000
LA R15,DMKDSPRQ GET ADDRESS OF DSP REQUEST STACK @V4M0173 01833000
C R15,CPEXFPNT-CPEXBLOK(,R15) IS THE LIST EMPTY? @V4M0173 01834000
BE DONE2 YES, GO FREE THE SYSTEM LOCK AND @V4M0173 01835000
* SELECT A USER TO DISPATCH @V4M0173 01836000
B GETDSLOK NO, GO GET LOCK ON DSP STACKS @V4M0173 01837000
.UPTST10 ANOP **ANOP** 01837100
SPACE 01838000
ENABLE DS 0H %V4M0173 01839000
* THE FOLLOWING 'SSM ENABLE/SSM DISABLE' INSTRUCTIONS ARE 01840000
* ARE NOT PERFORMED BY ECPS. 01841000
SSM IOWINDOW OPEN WINDOW FOR IO INTERRUPTS %V4M0173 01842000
SSM *+1 AND CLOSE AGAIN %V408246 01843000
* 01844000
LA R15,DMKDSPRQ GET ADDRESS OF DSP REQUEST STACK %V4M0173 01845000
C R15,CPEXFPNT-CPEXBLOK(,R15) IS THE LIST EMPTY? %V4M0173 01846000
BE DONE2 YES, GO GET A USER TO DISPATCH %V4M0173 01847000
GETDSLOK DS 0H %V4M0173 01848000
BAL R9,LOCKOBDS GET LOCK ON DSP STACKS @VA09257 01849000
LA R15,DMKDSPRQ RESTORE ADDRESS OF REQUEST STACK %V407508 01850000
LR R2,R15 INITIALIZE R2 %V407508 01851000
USING CPEXBLOK,R2 GET ADDRESSABILITY TO CPEXBLOK %V407508 01852000
NXTCP DS 0H %V407508 01853000
L R2,CPEXFPNT GET NEXT CPEXBLOK POINTER %V407508 01854000
AIF (NOT &AP).UPTST11 **AIF*** 01854900
CR R2,R15 ANY CPEXBLOKS LEFT? %V407508 01855000
BE DONE NO, GO GET A USER TO RUN %V407508 01856000
TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? %V4M0173 01857000
BZ PROCCP NO, UNSTACK THIS CPEXBLOK %V4M0173 01858000
L R1,CPEXR11 GET ADDRESS OF ASSOCIATED VM @V407508 01859000
BAL R9,LOCKVM TRY TO LOCK THIS VM @V407508 01860000
* UNSTK CPEXBLOK HAS PRIORITY OVER RUNNING USER 01861100
BZ UNSTK GOT THE LOCK-GO UNSTK CPEXBLOK @VA09257 01861110
L R15,PREFIXB ACCESS OTH PROC PSA @VA09257 01861120
TM XCPEND-PSA(R15),XCDISP EXTINT PEND? @VA09257 01861130
BO NOSIGNAL YES-SIGP REDUNDANT @VA09257 01861140
CLI CPSTATUS-PSA(R15),CPRUN RUNNING USER? @VA09257 01861150
BZ NOSIGNAL NO - DON'T BOTHER @VA09257 01861160
B SIGPDSP @VA09257 01861170
NOSIGNAL LA R15,DMKDSPRQ RESTORE R15 @VA09257 01861180
B NXTCP SEE IF MORE ON Q @VA09257 01861190
UNSTK DS 0H @VA09257 01861200
DROP R11 STOP USING R11 AS VMBLOK BASE @V407508 01862000
USING VMBLOK,R1 USE R1 AS BASE FOR VMBLOK @V407508 01863000
TM VMPEND,VMDEFSTK IS A DEFERRED INTERRUPT PENDING @V407508 01864000
BNO TSTP NO, TEST FOR PRIORITY CPEXBLOKS @V4M0141 01865000
L R2,VMDFTPNT GET ADDRESS OF DEFERRED INT TASK @V407508 01866000
CLC LPUADDRX,CPEXPROC IS THIS DEFERRED TASK FOR THE @V407508 01867000
* OTHER PROCESSOR @V407508 01868000
BNE PROCCP GO TO UNSTACK THIS TASK @V407508 01869000
B SIGNLDSP GO ISSUE DISPATCH SIGNAL @V407508 01870000
SPACE 01871000
TSTP DS 0H @V407508 01872000
LH R3,VMPRRCT GET CNT OF PRIORITY CPEXBLOKS @V4M0141 01873000
LTR R3,R3 ARE THERE ANY PRIORITY CPEXBLOKS @VA07381 01873100
BNZ FINDPTSK FIND PRIORITY CPEXBLOK @V4M0136 01874000
TSTIO DS 0H @V407508 01875000
LH R3,VMSTKCNT GET IOB/CPEX COUNT @V407508 01876000
C R3,F1 IS THIS COUNT > 1? @V407508 01877000
BNH TSTCP NO, TEST CPEXBLOK FOR AFFINITY @V4M0141 01878000
BAL R9,FINDIOB LOOK FOR A PRIOR IOB @V407508 01879000
BAL R9,FINDCP LOOK FOR A PRIOR CPEXBLOK @V407508 01880000
TSTCP DS 0H TEST CPEXBLOK FOR PROC AFFINITY @V4M0141 01881000
CLC CPEXPROC,LPUADDRX IS THIS CPEXBLOK STACKED FOR @V4M0141 01882000
* THE OTHER PROCESSOR? @V4M0141 01883000
BNE PROCCP NO, GO PROCESS THIS CPEXBLOK @V4M0141 01884000
SIGNLDSP DS 0H SIGNAL OTHER PROCESSOR @V4M0141 01885000
BAL R8,UNLOKVM1 UNLOCK THIS VM @V4M0141 01886000
SIGPDSP DS 0H @VA09257 01886500
BAL R9,LOCKRLDS RELEASE LOCK ON DSP STACKS @VA09257 01887100
BAL R9,FREESYS RELEASE THE SYSTEM LOCK @V4M0141 01888000
L R15,PREFIXB ACCESS OTHER PSA @VA08311 01888400
TM XCPEND-PSA(R15),XCDISP IS DISPATCH XC PENDING ? @VA08311 01888500
BO CKUSERS YES- SKIP REDUNDANT SIGNAL @VA08311 01888600
BAL R9,DSPSIG TELL OTH PROC ABOUT CPEXBLOK @VA09257 01889000
B CKUSERS GO SELECT A USER TO DISPATCH @V4M0141 01890000
DROP R1 STOP USING R1 AS VMBLOK BASE @VA07369 01890100
.UPTST11 ANOP **ANOP** 01890200
SPACE 01891000
PROCCP DS 0H %V407508 01892000
L R3,CPEXFPNT GET ADDRESS OF NEXT ELEMENT %V407508 01893000
L R4,CPEXBPNT GET ADDRESS OF PREVIOUS ELEMENT %V407508 01894000
ST R3,CPEXFPNT-CPEXBLOK(,R4) REPLACE FORWARD PTR %V407508 01895000
* OF PREVIOUS ELEMENT %V407508 01896000
ST R4,CPEXBPNT-CPEXBLOK(,R3) REPLACE BACKWARD PTR %V407508 01897000
* OF NEXT ELEMENT %V407508 01898000
USING VMBLOK,R11 USE R11 AS BASE FOR VMBLOK %V4M0173 01900000
L R11,CPEXR11 SWITCH R11 TO NEW VMBLOK %V4M0173 01901000
AIF (NOT &AP).UPTST12 **AIF*** 01901900
* IN UP-MODE, FLAG CPEXPRIO IS NEVER ON. 01902000
TM CPEXTYPE,CPEXPRIO IS THIS A PRIORITY CPEXBLOK? %V4M0141 01903000
BZ CHKNORM NO, CHECK FOR NORMAL CPEXBLOK %V407508 01904000
LH R3,VMPRRCT GET CNT OF PRIORITY CPEXBLOKS @V4M0141 01905000
BCTR R3,0 DECREMENT THIS COUNT BY 1 @V407508 01906000
STH R3,VMPRRCT REPLACE WITH UPDATED COUNT @V407508 01907000
B NEXT CONTINUE PROCESSING BLOK @V407508 01908000
SPACE 01909000
CHKNORM DS 0H %V407508 01910000
* IN UP-MODE, FLAG CPEXDEFR IS NEVER ON. 01911000
TM CPEXTYPE,CPEXDEFR IS THIS A DEFERRED INT TASK? %V407508 01912000
BZ NORMCP NO, MUST BE A NORMAL CPEXBLOK %V407508 01913000
NI VMPEND,X'FF'-VMDEFSTK TURN OFF DEFERRED FLAG @V407508 01914000
B NEXT CONTINUE PROCESSING BLOK @V407508 01915000
SPACE 01916000
NORMCP DS 0H %V407508 01917000
.UPTST12 ANOP **ANOP** 01917100
LH R3,VMSTKCNT GET IOB/CPEX COUNT FOR THIS VM %V407508 01918000
BCTR R3,0 DECREMENT THIS COUNT BY 1 %V407508 01919000
STH R3,VMSTKCNT REPLACE WITH UPDATED COUNT %V407508 01920000
NEXT DS 0H %V407508 01921000
BAL R9,LOCKRLDS RELEASE LOCK ON DSP STACKS @VA09257 01922100
CHARGE START START CHARGING NEW VMBLOK %V4M0173 01923000
ST R11,STACKVM REMEMBER UNSTACKED VMBLOK %V407508 01924000
DROP R2 STOP USING R2 AS BASE FOR CPEXBK %V407508 01925000
USING CPEXBLOK,R1 USE R1 AS BASE FOR CPEXBLOK %V407508 01926000
LR R1,R2 GET CPEXBLOK ADDRESS IN R1 %V407508 01927000
LM R5,R7,CPEXADD GET EXECUTION ADDRESS, GPR0,1 %V3M4038 01928000
LM R2,R4,CPEXREGS+12*4 GET GPRS 12-14 %V3M4038 01929000
STM R2,R7,DSPSAVE SAVE REGS ACROSS CALL TO FRET %V3M4038 01930000
LM R2,R11,CPEXREGS+2*4 GET NEW USER'S GPR2-11 %V3M4038 01931000
LA R0,CPEXSIZE GET SIZE OF CPEXBLOK %VA07369 01931100
AIF (NOT &AP).UPTST13 **AIF*** 01931200
* IN UP-MODE, FLAG CPEXDEFR IS NEVER ON. 01932000
TM CPEXTYPE,CPEXDEFR IS THIS A DEFERRED INT TASK %V407508 01933000
BO NOFRET YES, DO NOT FRET STORAGE %V407508 01934000
* IN UP-MODE, FLAG CPEXLPSW IS NEVER ON. 01936000
TM CPEXTYPE,CPEXLPSW IS THIS A 'SWITCH' CPEXBLOK? %V407508 01937000
BO CPLPSW YES, SAVE CPEXR15 BEFORE FRET %V407508 01938000
.UPTST13 ANOP **ANOP** 01938100
FRETCPEX CALL DMKFRET TO FREE STORAGE %V3M4038 01939000
NOFRET DS 0H %V407508 01940000
LM R12,R1,DSPSAVE RESTORE KEY REGS AFTER CALL %V3M4038 01941000
LTR R15,R15 SET CONDITION CODE %V3M4038 01942000
BR R15 AND GO ... %V3M4038 01943000
SPACE 01944000
AIF (NOT &AP).UPTST14 **AIF*** 01944900
CPLPSW DS 0H @V407508 01945000
L R14,CPEXR15 GET CPEXR15 VALUE @V407508 01946000
ST R14,DSPSAVE+OFFR15 SAVE ACROSS CALL TO FRET @V407508 01947000
MVC PSWADDR,CPEXADD SAVE CPEXADD ACROSS FRET CALL @V407508 01948000
CALL DMKFRET RETURN CPEXBLOK TO FREE STORAGE @V407508 01949000
MVC TEMPSAVE(LNPSW),CPPSW SET UP PSW IN TEMPSAVE @V407508 01950000
LM R12,R1,DSPSAVE RESTORE REGS AFTER CALL TO FRET @V407508 01951000
LPSW TEMPSAVE LOAD PSW TO GO TO EXECUTION ADDR @V407508 01952000
.UPTST14 ANOP **ANOP** 01952100
SPACE 2 01953000
EXTDISP EQU * HERE IF THE SYSTEM IS EXTENDING -- 01954000
LM R3,R7,EXTADDRS GET VALUES OF ALLOWED EXITS @V407508 01955000
LR R2,R15 INITIALIZE R2 @V407508 01956000
DROP R1 STOP USING R1 AS CPEXBLOK BASE @V407508 01957000
USING CPEXBLOK,R2 USE R2 AS CPEXBLOK BASE @V407508 01958000
EXTCP DS 0H @V407508 01959000
L R2,CPEXFPNT GET ADDRESS OF NEXT CPEXBLOK @V407508 01960000
CR R2,R15 ANY CPEXBOLKS LEFT? @V407508 01961000
BE DONE NO, GO RELEASE LOCKS AND WAIT @V407508 01962000
L R14,CPEXADD GET VALUE OF EXIT ADDRESS @V407508 01963000
LA R14,0(,R14) CLEAR HIGH-ORDER BYTE @V407508 01964000
CR R3,R14 IS THIS AN ALLOWED EXIT? @V407508 01965000
BE EXTVM YES, GO LOCK VM @V407508 01966000
CR R4,R14 ANOTHER ALLOWED EXIT? @V407508 01967000
BE EXTVM YES, GO LOCK VM @V407508 01968000
CR R5,R14 ANOTHER ALLOWED EXIT? @V407508 01969000
BE EXTVM YES, GO LOCK VM @V407508 01970000
CR R6,R14 IS EXIT FOR AN I/O ERROR? @V407508 01971000
BE PAGCHK YES, CHECK IF IT IS PAGING @V407508 01972000
CR R7,R14 ANOTHER I/O ERROR EXIT? @V407508 01973000
BNE EXTCP NO, GET NEXT CPEXBLOK @V407508 01974000
PAGCHK DS 0H @V407508 01975000
L R10,CPEXR10 GET IOBLOK ADDR FROM CPEXBLOK @V407508 01976000
TM IOBFLAG,IOBPAG IS IOBLOK FOR PAGING? @V407508 01977000
BO EXTVM YES, GO LOCK VM @V407508 01978000
L R8,CPEXR8 GET RDEVBLOK ADDRESS @V407508 01979000
L R10,RDEVFIOB-RDEVBLOK(,R8) GET QUEUED IOBLOK @V407508 01980000
CKLIST DS 0H TEST ALL IOBLOKS QUEUED @V407508 01981000
CR R8,R10 ANY MORE IOBLOKS? @V407508 01982000
BE EXTCP NO, GO GET NEXT CPEXBLOK @V407508 01983000
TM IOBFLAG,IOBPAG IS IOBLOK FOR PAGING? @V407508 01984000
BO EXTVM YES, GO LOCK VM @V407508 01985000
L R10,IOBFPNT GET NEXT IOBLOK ON QUEUE @V407508 01986000
B CKLIST GO CHECK THIS IOBLOK @V407508 01987000
EXTVM DS 0H @V407508 01988000
AIF (NOT &AP).UPTST15 **AIF*** 01988900
L R1,CPEXR11 GET ADDRESS OF ASSOCIATED VM @V407508 01989000
* IN UP-MODE, SUBROUTINE LOCKVM IS A NO-OP. 01990000
BAL R9,LOCKVM TRY TO LOCK THIS VM @V407508 01991000
BNZ DOWN LOCK NOT OBTAINED, TERM VM/370 @V407508 01992000
.UPTST15 ANOP **ANOP** 01992100
B PROCCP LOCK OBTAINED, PROCESS CPEXBLOK @V407508 01993000
DROP R2 STOP USING R2 AS CPEXBLOK BASE @V407508 01994000
EJECT 01995000
* 01996000
* INTERNAL SUBROUTINES 01997000
* 01998000
AIF (NOT &AP).UPTST16 **AIF*** 01998900
LOCKVM DS 0H @V407508 01999000
* R1=ADDR OF VM TO BE LOCKED @V407508 02000000
TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? @V4M0136 02001000
BZR R9 NO, RETURN TO CALLER @V4M0136 02002000
C R1,LASTUSER IS VM = LASTUSER? @V407508 02003000
BER R9 YES, RETURN-ALREADY LOCKED @V407508 02004000
C R1,ASYSVM IS VM = ASYSVM? @V407508 02005000
BER R9 YES, RETURN-NO LOCK NEEDED @V407508 02006000
LOCK OBTAIN,TYPE=VMBLOK,SPIN=NO,SAVE TRY TO LOCK VM @V407508 02007000
BR R9 RETURN TO CALLER @V407508 02008000
* 02009000
UNLOKVM DS 0H UNLOCK A VM @V407508 02010000
* R1=ADDR OF VM TO BE UNLOCKED @V407508 02011000
LH R0,LPUADDR GET LOGICAL CPU ADDRESS @V407508 02012000
CH R0,VMLOCK+2-VMBLOK(,R1) IS VMBLOK LOCKED? @V407508 02013000
BNER R8 NO, RETURN TO CALLER @V407508 02014000
UNLOKVM1 DS 0H SKIP LASTUSER CHECK @V407508 02015000
C R1,LASTUSER IS VM = LASTUSER? @V407508 02016000
BER R8 YES, RETURN-DO NOT UNLOCK @V407508 02017000
C R1,ASYSVM IS VM = ASYSVM? @V407508 02018000
BER R8 YES, RETURN-ASYSVM NOT LOCKED @V407508 02019000
UNLOKVM2 DS 0H SKIP ASYSVM CHECK @V407508 02020000
LOCK RELEASE,TYPE=VMBLOK,SAVE GO UNLOCK THIS VM @V407508 02021000
BR R8 RETURN TO CALLER @V407508 02022000
EJECT 02023000
* 02024000
TSTSYS DS 0H @V407508 02025000
TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? @V407508 02026000
BZR R9 NO, RETURN TO CALLER @V407508 02027000
L R2,=A(DMKLOKSY+2) GET ADDRESS OF SYSTEM LOCK @V407508 02028000
CLC LPUADDR,0(R2) IS SYSTEM LOCK HELD BY THIS PROC?@V407508 02029000
BER R9 YES, RETURN TO CALLER @V407508 02030000
GETSYS DS 0H TRY TO GET SYSTEM LOCK @V407508 02031000
LOCK OBTAIN,TYPE=SYS,SPIN=NO TRY TO GET SYSTEM LOCK @V407508 02032000
BR R9 RETURN TO CALLER @V407508 02033000
* 02034000
FREESYS DS 0H RELEASE SYSTEM LOCK @V407508 02035000
LOCK RELEASE,TYPE=SYS RELEASE SYSTEM LOCK @V407508 02036000
BR R9 RETURN TO CALLER @V407508 02037000
.UPTST16 ANOP **ANOP** 02037100
* 02038000
GETRACE DS 0H GET CURRENT TRACE TABLE ENTRY %V407508 02039000
TRACE CODE=(R14),R15,R2,R3 GET CURRENT TRACE ENTRY %V407508 02040000
BR R1 RETURN TO CALLER %V4M0017 02041000
EJECT 02042000
AIF (NOT &AP).UPTST17 **AIF*** 02042900
* 02043000
STKDEF DS 0H 02044000
TM VMPEND,VMDEFSTK IS A DEFERRED TASK PENDING @V407508 02045000
BOR R9 YES, RETURN TO CALLER @V407508 02046000
L R1,VMDFTPNT GET ADDR OF DEFERRED TASK BLOK @V407508 02047000
USING CPEXBLOK,R1 GET ADDRESSABILITY TO DEF TASK @V407508 02048000
STM R0,R15,CPEXREGS SAVE CURRENT REGS @V407508 02049000
L R2,ADSPCH GET ADDR OF DSP MAIN ENTRY @V407508 02050000
ST R2,CPEXADD SET UP RETURN ADDR FOR DEF TASK @V407508 02051000
CALL DMKSTKDE STACK DEFERRED TASK @V407508 02052000
DROP R1 @V407508 02053000
BR R9 RETURN TO CALLER @V407508 02054000
EJECT 02071000
* 02072000
XTNDAP DS 0H AP-ONLY EXTEND PROCESSING @V407508 02073000
C R11,LASTUSER IS LASTUSER EQUAL TO ASYSVM? @V407508 02074000
BER R9 YES, RETURN TO CALLER @V407508 02075000
L R11,LASTUSER SWITCH R11TO LASTUSER @V4M0173 02076000
CHARGE START START CHARGING LASTUSER @V4M0173 02077000
CALL DMKVMASH CHECK FOR CHANGED PAGES @V407508 02078000
NOUNSHR DS 0H @V4M0136 02082000
CHARGE STOP STOP CHARGING LASTUSER @V4M0173 02083000
L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK @V4M0173 02084000
L R1,LASTUSER GET VALUE OF LASTUSER @V407508 02085000
BAL R8,UNLOKVM2 UNLOCK LASTUSER @V407508 02086000
ST R11,LASTUSER SET LASTUSER TO ASYSVM @V407508 02087000
BR R9 RETURN TO CALLER @V407508 02088000
.UPTST17 ANOP **ANOP** 02088100
* 02089000
INCPROBT DS 0H INCREMENT PROBLEM STATE TIME %V407508 02090000
CLC VMTMOUTQ,PROBSTRT HAS CALCULATION BEEN DONE? %VA07582 02090100
BER R8 YES, RETURN TO CALLER %VA07582 02090200
LM R2,R3,VMTMOUTQ GET TIMER AT PROBLEM STATE END %V407508 02091000
LM R4,R5,PROBSTRT GET TIMER AT PROBLEM STATE START %V407508 02092000
SLR R5,R3 CALC 2ND HALF OF ELAPSED TIME %V407508 02093000
BNM *+6 WAS THERE A CARRY? %V407508 02094000
BCTR R4,0 NO CARRY, SIGNIFICANT DIFFERENCE %V407508 02095000
SLR R4,R2 CALC 1ST HALF OF ELAPSED TIME %V407508 02096000
LM R2,R3,PROBTIME GET TOTAL PROBLEM TIME %V4M0142 02097000
SLR R3,R5 SUBTRCT 2ND HALF OF ELAPSED TIME %V4M0142 02098000
BNM *+6 WAS THERE A CARRY? %V4M0142 02099000
BCTR R2,0 NO CARRY, SIGNIFICANT DIFFERENCE %V4M0142 02100000
SLR R2,R4 SUBTRCT 1ST HALF OF ELAPSED TIME %V4M0142 02101000
STM R2,R3,PROBTIME STORE NEW TOTAL PROBLEM TIME %V4M0142 02102000
BR R8 RETURN TO CALLER %V407508 02103000
EJECT 02104000
AIF (NOT &AP).UPTST18 **AIF*** 02104900
* 02105000
FINDPTSK DS 0H FIND PRIORITY CPEXBLOK FOR VM @V4M0141 02106000
* R1=VM ADDR; R15=DSP STACK ADDR @V407508 02107000
USING CPEXBLOK,R14 USE R14 AS BASE FOR CPEXBLOK @V407508 02108000
LR R14,R15 LOAD POINTER TO START SEARCH @V407508 02109000
FNDNXTP DS 0H @V407508 02110000
L R14,CPEXFPNT GET FIRST/NEXT CPEXBLOK @V407508 02111000
CR R14,R15 ANY CPEXBLOKS LEFT? @V407508 02112000
BE DOWN NO, TERMINATE VM/370 @V4M0136 02113000
C R1,CPEXR11 IS CPEXBLOK FOR THIS VM? @V407508 02114000
BNE FNDNXTP NO, GO GET NEXT CPEXBLOK @V407508 02115000
TM CPEXTYPE,CPEXPRIO IS THIS A PRIORITY CPEXBLOK? @V4M0141 02116000
BNO FNDNXTP NO, GO GET NEXT CPEXBLOK @V407508 02117000
LH R8,CPEXPROC GET ADDR OF RELATED PROCESSOR @V407508 02118000
LTR R8,R8 IS THERE A RELATED PROCESSOR @VA07402 02118100
BZ PICKCPEX NO, TAKE THIS CPEXBLOK @VA07402 02118300
CH R8,LPUADDR IS THIS THE RELATED PROCESSOR @V407508 02119000
BNE SIGNLDSP NO, GO ISSUE DISPATCH SIGNAL @V4M0136 02120000
LR R2,R14 GET ADDRESS OF THIS CPEXBLOK @V407508 02121000
B PROCCP GO PROCESS THIS CPEXBLOK @V407508 02122000
* 02123000
FINDIOB DS 0H FIND IO OR TRQ REQUEST @V407508 02124000
* R1=VM ADDR; R15=DSP STACK ADDR @V407508 02125000
USING IOBLOK,R14 USE R14 AS BASE FOR IOBLOK @V407508 02126000
LR R14,R15 LOAD POINTER TO START SEARCH @V407508 02127000
FNDNXTI DS 0H @V407508 02128000
L R14,IOBFPNT GET FIRST/NEXT IOBLOK @V407508 02129000
CR R14,R15 ANY IOBLOKS LEFT? @V407508 02130000
BER R9 NO, RETURN TO CALLER @V407508 02131000
C R1,IOBUSER IS IOBLOK FOR THIS VM? @V407508 02132000
BNE FNDNXTI NO, GO GET NEXT IOBLOK @V407508 02133000
LR R10,R14 GET ADDRESS OF THIS IOBLOK @V407508 02134000
B PROCIOB GO PROCESS THIS IOBLOK @V407508 02135000
* 02136000
FINDCP DS 0H FIND CPEXBLOK @V407508 02137000
* R1=VM ADDR; R15=DSP STACK ADDR @V407508 02138000
USING CPEXBLOK,R14 USE R14 AS BASE FOR CPEXBLOK @V407508 02139000
LR R14,R15 LOAD POINTER TO START SEARCH @V407508 02140000
FNDNXTC DS 0H @V407508 02141000
L R14,CPEXFPNT GET FIRST/NEXT CPEXBLOK @V407508 02142000
CR R14,R2 ANY PRIOR CPEXBLOKS LEFT? @V4M0141 02143000
BER R9 NO, RETURN TO CALLER @V407508 02144000
C R1,CPEXR11 IS CPEXBLOK FOR THIS VM? @V407508 02145000
BNE FNDNXTC NO, GO GET NEXT CPEXBLOK @V407508 02146000
TM CPEXTYPE,CPEXDEFR+CPEXPRIO IS IT A NORMAL BLOK? @V4M0141 02147000
BNZ FNDNXTC NO, GO GET NEXT CPEXBLOK @V407508 02148000
LH R8,CPEXPROC GET ADDR OF RELATED PROC, IF ANY @V4M0141 02149000
LTR R8,R8 IS THERE A RELATED PROC? @V4M0141 02150000
BZ PICKCPEX NO, TAKE THIS CPEXBLOK @V4M0141 02151000
CH R8,LPUADDRX IS IT STACKED FOR OTHER PROC? @V4M0141 02152000
BE FNDNXTC YES, GO GET NEXT CPEXBLOK @V4M0141 02153000
PICKCPEX DS 0H @V4M0141 02154000
LR R2,R14 GET ADDRESS OF THIS CPEXBLOK @V407508 02155000
B PROCCP GO PROCESS THIS CPEXBLOK @V407508 02156000
DROP R14 STOP USING R14 AS BASE @V407508 02157000
* 02158000
FNDPBLOK DS 0H FIND 1ST PRIORITY BLOK FOR PROC @V4M0141 02159000
BAL R9,LOCKOBDS GET LOCK ON DISPATCH STACKS @VA09257 02160000
LA R15,DMKDSPRQ GET ADDRESS OF DSP STACKS @V407508 02161000
LR R2,R15 LOAD POINTER TO START SEARCH @V407508 02162000
USING CPEXBLOK,R2 USE R2 AS BASE FOR CPEXBLOK @V407508 02163000
NXTP DS 0H @V407508 02164000
L R2,CPEXFPNT GET FIRST/NEXT CPEXBLOK @V407508 02165000
CR R2,R15 ANY CPEXBLOKS LEFT? @V407508 02166000
BE DOWN NO, TERMINATE VM/370 @V407508 02167000
TM CPEXTYPE,CPEXPRIO IS THIS A PRIORITY CPEXBLOK @V4M0141 02168000
BNO NXTP NO, GO GET NEXT CPEXBLOK @V407508 02169000
CLC LPUADDR,CPEXPROC IS THIS THE RELATED PROCESSOR? @V407508 02170000
BNE NXTP NO, GO GET NEXT CPEXBLOK @V407508 02171000
L R1,CPEXR11 GET ADDRESS OF ASSOCIATED VM @V407508 02172000
BAL R9,LOCKVM TRY TO LOCK THIS VM @V407508 02173000
BZ PROCCP GO PROCESS THIS CPEXBLOK @V407508 02174000
DROP R2 STOP USING R2 AS CPEXBLOK BASE @V407508 02175000
DOWN DS 0H TERMINATE VM/370 @V407508 02176000
ABEND 5 EXPECTED BLOK NOT FOUND @V407508 02177000
.UPTST18 ANOP **ANOP** 02177100
EJECT 02178000
*. 02179000
* 02180000
* OPERATION - 02181000
* 02182000
* H. SELECT A USER FOR DISPATCHING 02183000
* 1. IF THE SYSTEM IS LOCKED FOR RUNNING USERS DUE TO EXTEND, 02184000
* CPFRELK BEING SET, OR CPSHRLK BEING SET, GO TO STEP 4 TO 02185000
* LOAD A WAIT STATE. 02186000
* 2. SCAN THE RUN LIST FOR A DISPATCHABLE CANDIDATE - THAT IS, A 02187000
* RUNNABLE VM THAT EITHER HAS NO AFFINITY OR AFFINITY TO THE 02188000
* CURRENT PROCESSOR. TRY TO LOCK THIS VM, IF THE LOCK IS NOT 02189000
* AVAILABLE, LOOK FOR ANOTHER CANDIDATE. IF THE RUN LIST IS 02190000
* EXHAUSTED BEFORE A CANDIDATE IS FOUND, GO TO STEP 4 TO LOAD 02191000
* A WAIT STATE. 02192000
* 3. ONCE A VM IS LOCKED, CALL DMKVMASH IF NECESSARY TO CHECK 02193000
* FOR SHARED SYSTEM VIOLATION; SET UP DISPATCH TIME SLICE; 02194000
* LOAD FLOATING POINT REGS; BUILD RUNPSW, RUNCR0, AND RUNCR1; 02195000
* CALL DMKVATAB IF SHADOW TABLES ARE BAD; SET UP FOR PER (IF 02196000
* PER TRACING IS ACTIVE); AND SET UP FOR ASSIST. BEFORE THE 02197000
* ACTUAL DISPATCH OF THIS VM, PERFORM THE FOLLOWING ADDITIONAL 02198000
* TASKS: WAKE-UP THE OTHER PROCESSOR, IF IT IS IDLE; ISSUE A 02199000
* PTLB IF REQUIRED; AND SET THE CLOCK COMPARATOR IF NECESSARY. 02200000
* THEN DISPATCH THE VM BY LOADING THE TIMERS, CONTROL 02201000
* REGISTERS, GENERAL REGISTERS, AND PSW. 02202000
* 4. IF THE SYSTEM IS EXTENDING OR IF CPSHRLK IS SET, OR IF 02203000
* THERE IS NO DISPATCHABLE USER ON THE RUN LIST, LOAD A WAIT 02204000
* STAT ENABLED FOR EXTERNAL AND I/O INTERRUPTS. IF THIS 02205000
* PROCESSOR IS BEING QUIESCED OF IF CPFRELK IS SET, LOAD A 02206000
* WAIT ENABLED ONLY FOR EXTERNAL INTERRUPTS. 02207000
* 02208000
*. 02209000
SPACE 2 02210000
DONE DS 0H PREPARE TO SEARCH RUN LIST @V407508 02211000
BAL R9,LOCKRLDS RELEASE LOCK ON DSP STACKS @VA09257 02212100
DONE2 DS 0H %V4M0173 02213000
AIF (NOT &AP).UPTST19 **AIF*** 02213900
* IN UP-MODE, SUBROUTINE FREESYS IS A NO-OP. 02214000
BAL R9,FREESYS RELEASE THE SYSTEM LOCK %V407508 02215000
.UPTST19 ANOP **ANOP** 02215100
SPACE 2 02216000
CKUSERS DS 0H %V407508 02217000
AIF (&AP).APBR8 **AIF*** 02217100
CLI XTNDLOCK,SET IS SYSTEM IN EXTEND? %VA07369 02217200
AGO .UPBR8 **AGO*** 02217300
.APBR8 ANOP **ANOP** 02217400
L R2,PREFIXA GET PROCESSOR PREFIX ADDRESS %V407508 02218000
CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? %V407508 02219000
.UPBR8 ANOP **ANOP** 02219100
BE LOADIDLE YES, GO LOAD A WAIT %V4M0006 02220000
CKUSERS2 DS 0H %V407508 02221000
AIF (NOT &AP).UPTST20 **AIF*** 02221900
* IN UP-MODE, FLAG CPFRELK IS NEVER ON. 02222000
CLI CPFRELK-PSA(R2),SET IS CPFRELK FLAG ON? %V407508 02223000
BE IDLEB YES, GO LOAD A WAIT %V4M0006 02224000
.UPTST20 ANOP **ANOP** 02224100
TM CPSTAT2,CPSHRLK LOCKED FOR RUNUSERS? %V408246 02225000
* THE FOLLOWING INSTRUCTION IS NOT PERFORMED BY ECPS. 02226000
BO LOADIDLE YES %V408246 02227000
* RATHER ECPS DOES THE FOLLOWING: 02228000
* BO IDLEECPS YES %V407508 02229000
AIF (NOT &AP).UPTST21 **AIF*** 02229900
LOCKRL DS 0H %V407508 02250000
LOCK OBTAIN,TYPE=RL GET LOCK ON RUNLIST %V407508 02251000
.UPTST21 ANOP **ANOP** 02251100
L R10,SCHRLOC GET IN-Q VMBLOK LIST ANCHOR %V407508 02252000
LR R1,R10 LOAD POINTER TO START SEARCH %V407508 02253000
DROP R11 STOP USING R11 AS VMBLOK BASE %V407508 02254000
USING VMBLOK,R1 USE R1 AS BASE FOR VMBLOK %V407508 02255000
AIF (NOT &AP).UPTST22 **AIF*** 02255900
* THE FLAG IN TEMPSAVE IS NOT MAINTAINED BY ECPS. 02256000
MVI TEMPSAVE,NONE INIT FLAG TO WAKE-UP OTHER PROC %V4M0001 02257000
.UPTST22 ANOP **ANOP** 02257100
FNDUSRA DS 0H %V407508 02258000
L R1,VMQFPNT GET FIRST/NEXT VMBLOK ON RUNLIST %V407508 02259000
CR R1,R10 ANY VMBLOKS LEFT? %V407508 02260000
* THE FOLLOWING INSTRUCTION IS NOT PERFORMED BY ECPS. 02261000
BE IDLEA NO, GO LOAD A WAIT %V407508 02262000
* RATHER ECPS DOES THE FOLLOWING: 02263000
* BE IDLEECPS NO, GO LOAD A WAIT %V407508 02264000
TM VMDSTAT,VMRUN IS THIS VM RUNNABLE? %V407508 02265000
BZ FNDUSRA NO, GO GET NEXT VMBLOK %V407508 02266000
TM VMRSTAT,VMCPWAIT ARE ANY RSTAT FLAGS STILL ON? %V407508 02267000
BNZ FNDUSRA YES, GO GET NEXT VMBLOK %V407508 02268000
AIF (NOT &AP).UPTST23 **AIF*** 02268900
TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? %V4M0173 02269000
BZ FREELOCK NO, SELECT THIS USER TO RUN %V4M0173 02270000
TM VMPEND,VMDEFSTK IS A DEFERRED TASK PENDING? @V4M0173 02271000
BO FNDUSRA YES, SKIP THIS VM @V4M0173 02272000
TM VMAFF,VMAFFON DOES VM HAVE AFFINITY? @V407508 02273000
BNO GETLOCK NO, TRY TO LOCK THIS VMBLOK @V4M0155 02274000
CLC VMAFF,LPUADDR+1 IS AFF FOR THIS PROC? @V407508 02275000
BE GETLOCK YES, TRY TO LOCK THIS VMBLOK @V4M0155 02276000
MVI TEMPSAVE,SET SET FLAG TO WAKE-UP OTHER PROC @V4M0155 02277000
B FNDUSRA GO GET NEXT VMBLOK @V4M0155 02278000
SPACE 02279000
GETLOCK DS 0H @V407508 02280000
L R2,VMSTKCNT GET COUNT OF STACKED BLOCKS @V4M0173 02281000
LTR R2,R2 ARE ANY BLOCKS STACKED FOR VM? @V4M0173 02282000
BNZ FNDUSRA SKIP VM IF THERE ARE BLOCKS @V4M0136 02283000
BAL R9,LOCKVM TRY TO LOCK THIS VM @V407508 02284000
BNZ FNDUSRA LOCK NOT OBTAINED, GET NEXT VM @V407508 02285000
TM VMDSTAT,VMRUN IS VM REALLY RUNNABLE? @V407508 02286000
BNO FREEVM NO, UNLOCK THIS VM & GET ANOTHER @V407508 02287000
TM VMRSTAT,VMCPWAIT ARE ANY RSTAT FLAGS STILL ON? @V407508 02288000
BNZ FREEVM YES, GO UNLOCK THIS VM @V407508 02289000
TM VMPEND,VMDEFSTK IS A DEFERRD TASK PENDING? @V407508 02290000
BO FREEVM YES, UNLOCK THIS VM @V407508 02291000
L R2,VMSTKCNT GET COUNT OF STACKED BLOCKS? @V4M0173 02292000
LTR R2,R2 ARE ANY BLOCKS STACKED FOR VM? @V4M0173 02293000
BZ FREELOCK NO, SELECT THIS VM @V407508 02294000
FREEVM DS 0H @V407508 02295000
BAL R8,UNLOKVM1 UNLOCK VM FROM RUNLIST @V4M0136 02296000
B FNDUSRA GO GET NEXT VMBLOK ON LIST @V407508 02297000
.UPTST23 ANOP **ANOP** 02297100
SPACE 02298000
* ECPS:VM/370 DSP2 EXIT IF VMNOECPS BYTE IS NON-ZERO @VMD0134 02298100
FREELOCK DS 0H %V407508 02299000
LR R10,R1 SAVE VMBLOK JUST SELECTED %V407508 02300000
DROP R1 STOP USING R1 AS BASE FOR VMBLOK %V407508 02301000
LOCK RELEASE,TYPE=RL RELEASE RUNLIST LOCK %V407508 02302000
C R10,RUNUSER IS NEW VM SAME AS RUNUSER? %V407508 02303000
BNE FNDUSRD NO, NO CHANCE FOR FAST DISPATCH %V407508 02304000
USING VMBLOK,R10 USE R10 AS BASE FOR VMBLOK %V407508 02305000
L R0,QUANTUM RESIDUAL SLICE %V408246 02306000
LTR R0,R0 ANY? %V408246 02307000
BM GETQS NO %V408246 02308000
* THE FOLLOWING FAST RE-DISPATCH INSTRUCTIONS ARE NOT 02309000
* IMPLEMENTED BY ECPS. IF THERE IS TIME REMAINING IN THE 02310000
* TIMESLICE, ECPS BRANCHES TO SETQUANT. 02311000
AIF (NOT &AP).UPTST24 **AIF*** 02311900
C R10,LASTUSER IS RUNUSER = LASTUSER @V407508 02312000
BE TSTFAST YES, SEE IF O.K. FOR FAST DISP @V407508 02313000
CLC VMLSTPRC,LPUADDR+1 WAS VM LAST RUN ON THIS PROC @V407508 02314000
BNE SETQUANT NO, TAKE NORMAL PATH @V407508 02315000
ST R10,LASTUSER RESET LASTUSER FOR REDISPATCH @V407508 02316000
TSTFAST DS 0H TEST FOR FAST DISPATCH @V407508 02317000
.UPTST24 ANOP **ANOP** 02317100
TM VMDSTAT,VMDSP+VMRUN+VMINQ EVERYTHING IN ORDER? @V408246 02318000
BNO SETQUANT NO, TAKE NORMAL PATH @V408246 02319000
TM IOOPSW,4 VIRT. PSW IN I/O OLD? @V408246 02320000
BNO SETQUANT NO @V408246 02321000
ST R0,TIMER SET REMAINING TIME SLICE @V408246 02322000
LM R0,R1,IOOPSW INTERRUPTED PSW @V408246 02323000
MVI IOOPSW,0 FLAG I/O OLD PSW NOT VIRTUAL @V408246 02324000
DROP R10 STOP USING R10 AS VMBLOK BASE @V407508 02325000
USING VMBLOK,R11 USE R11 AS VMBLOK BASE @V407508 02326000
LR R11,R10 SWITCH R11 TO NEW VM @V4M0173 02327000
CHARGE START START CHARGING THIS VMBLOK @V4M0173 02328000
L R15,VMMICRO SET UP TO GET MICBLOK ADDRESS @VA06300 02328100
LA R15,0(R15) GET MICBLOK ADDRESS, IF ANY @VA06300 02328200
LTR R15,R15 SEE IF MICBLOK EXISTS @VA06300 02328300
BZ NOVMA NO, SKIP PENDING INTERRUPT CHECK @VA06300 02328400
BAL R9,CHKPENDG GO SEE IF MICPEND SHOULD BE SET @VA06300 02328500
NOVMA DS 0H @VA06300 02328600
MVI CPSTATUS,CPRUN+CPSUPER SET FLAG FOR RUNNING VM @V407508 02329000
MVC PROBSTRT,VMTMOUTQ SAVE TIMER AT PROB STATE STRT @V4M0136 02330000
B DMKDSPA2 SET C.C. AND CONTROL REGS @V408246 02331000
SPACE 02332000
FNDUSRD DS 0H %V408246 02333000
L R2,RUNUSER GET ADDRESS OF LAST RUNNING VM %V407508 02334000
AIF (NOT &AP).UPTST25 **AIF*** 02334900
C R2,LASTUSER IS RUNUSER STILL LOCKED? %V407508 02335000
BNE *+8 NO, LEAVE FLAG ALONE %V407508 02336000
.UPTST25 ANOP **ANOP** 02336100
NI VMDSTAT-VMBLOK(R2),X'FF'-VMDSP RESET FLAG %V407508 02337000
L R2,LASTUSER GET LASTUSER %V407508 02338000
CR R2,R11 IS LASTUSER = ASYSVM? %V407508 02339000
BE GETQS YES, LASTUSER ALREADY UNLOCKED %V407508 02340000
CR R2,R10 IS THIS A SWITCH FROM LASTUSER? %V4M0136 02341000
BE GETQS NO, NO NEED TO CHECK LASTUSER %V4M0136 02342000
TM VMOSTAT-VMBLOK(R2),VMSHR WAS LASTUSER SHARED? %V407508 02343000
BNO FRELAST NO, GO UNLOCK LASTUSER %V407508 02344000
LR R11,R2 SWITCH R11 TO LASTUSER %V4M0173 02345000
CHARGE START START CHARGING LASTUSER %V4M0173 02346000
CKSHRSYS CALL DMKVMASH CHECK FOR CHANGED PAGE %V408246 02347000
CHARGE STOP STOP CHARGING LASTUSER %V4M0173 02360000
FRELAST DS 0H %V407508 02361000
AIF (NOT &AP).UPTST28 **AIF*** 02361900
L R1,LASTUSER GET ADDRESS OF LASTUSER %V407508 02362000
* IN UP-MODE, SUBROUTINE UNLOKVM2 IS A NO-OP. 02363000
BAL R8,UNLOKVM2 UNLOCK LASTUSER %V407508 02364000
.UPTST28 ANOP **ANOP** 02364100
GETQS DS 0H %V408246 02365000
L R0,DMKDSPQS GET FULL TIMESLICE %V408246 02366000
TM VMQLEVEL-VMBLOK(R10),VMCOMP COMPUTE BOUND? %V407508 02367000
BZ *+8 NO -- %V408246 02368000
SLL R0,2 YES - QUADRUPLE SLIICEI %V408246 02369000
SETQUANT DS 0H %V408246 02370000
ST R0,TIMER SET QUANTUM %V408246 02371000
LR R11,R10 SWITCH R11 TO NEW VM %V4M0173 02372000
CHARGE START START CHARGING THIS VMBLOK %V4M0173 02373000
ST R11,LASTUSER SET LASTUSER %V407508 02374000
AIF (NOT &AP).UPTST29 **AIF*** 02374900
* VMLSTPRC IS ALWAYS 0 WHEN THE SYSTEM IS RUNNING ON A 02375000
* PROCESSOR WITHOUT THE MULTI-PROCESSING FEATURE. 02376000
MVC VMLSTPRC,LPUADDR+1 INDICATE VM RUN ON THIS PROC %V407508 02377000
.UPTST29 ANOP **ANOP** 02377100
ST R11,RUNUSER SET RUNUSER %V4M0173 02380000
AIF (NOT &FLOATPT).FPR1 %V407508 02381000
LD Y0,VMFPRS LOAD FLOAT REGS FROM NEW VM %V407508 02382000
LD Y2,VMFPRS+8 .. %V407508 02383000
LD Y4,VMFPRS+16 .. %V407508 02384000
LD Y6,VMFPRS+24 .. %V407508 02385000
.FPR1 ANOP %V407508 02386000
NOFPRS DS 0H %V4M0173 02387000
EJECT 02388000
*---------------------------------------------------------------------* 02389000
* NOW THE ACTUAL DISPATCHING PSW IS BUILT FROM DATA IN * 02390000
* THE "VMPSW" AND STATUS SWITCHES INDICATING THE PSW * 02391000
* FORMAT, REQUESTED EXTENDED FEATURES, ETC. IF DISPATCH * 02392000
* TRACING IS ENABLED, THE RUNNING PSW AND VMBLOK ADDRESS * 02393000
* WILL BE TRACED BEFORE THE CONTROL REGISTERS ARE LOADED * 02394000
* FOR THE USER'S DISPATCH. IF VM ASSIST IS ON, SETUP IS DONE * 02395000
* FOR CONTROL REGISTER 6 AND THE MICBLOK. * 02396000
*---------------------------------------------------------------------* 02397000
L R1,VMPSW+4 GET NEW PSW ADDRESS %V3M4038 02398000
ST R1,RUNPSW+4 START BUILDING PSW FOR DISPATCH %V3M4038 02399000
SLR R0,R0 %V3M4038 02400000
ICM R0,B'0100',VMPSW+1 GET USER KEY AND EMWP BITS %V3M4038 02401000
O R0,=X'070D0000' ADD TRAN+IO+EXT+ECMODE+PROB+MC %V3M4038 02402000
TM VMESTAT,VMEXTCM VIRTUAL MACHINE IN EC-MODE ? %V3M4038 02403000
BO LOADEXT YES - FINISH HIS PSW %V3M4038 02404000
MVI RUNPSW+4,X'00' STRIP OFF ILC, CC, PGM MASK %V3M4038 02405000
NI VMPSW+4,X'3F' THROW AWAY HIS ILC BITS %V3M4038 02406000
ICM R0,B'0010',VMPSW+4 ...ADD CC, PGM MASK TO PSW %V3M4038 02407000
B HALFPSW SAVE FIRST HALF OF PSW %V3M4038 02408000
SPACE 02409000
LOADEXT EQU * LOAD EXTENDED-MODE PSW %V3M4038 02410000
O R0,VMPSW ADD HIS CC, PGM MASK %V3M4038 02411000
HALFPSW ST R0,RUNPSW SET FIRST WORD OF PSW %V3M4038 02412000
SPACE 02413000
PERHAPS DS 0H %V408246 02414000
NI VMMCR6,255-(VMMSHADT+VMMPROB+VMMNOSK+VMMFE) %V408246 02415000
L R0,CPCREG0 ASSUME VM/370 ARCHITECTURE %V3M4038 02416000
L R1,VMSEG AND 2'ND LEVEL MEMORY %V3M4038 02417000
TM VMPSTAT,VMV370R ARE EC-REGS. PRESENT %V3M4038 02418000
BZ SETCREGS NO - STANDARD VM/370 CREGS %V3M4038 02419000
L R2,VMECEXT EC-REGS. ARE IN THE ECBLOK %V3M4038 02420000
USING ECBLOK,R2 %V3M4038 02421000
LCTL C4,C13,EXTCR4 LOAD USER'S VALUES IN REAL CREGS %V3M4038 02422000
TM VMESTAT,VMEXTCM ALSO IN EC-MODE NOW ? %V3M4038 02423000
BZ CHKRUNE NO - STANDARD VM/370 CREGS 0-1 %V3M4038 02424000
TM VMESTAT,VMINVSEG+VMNEWCR0 UNHEALTHY SITUATION %V3M4038 02425000
BZ CHKTRAN BUT WE REALLY CAN'T HAVE IT %V3M4038 02426000
ABEND 2 HOW DID WE GET HERE, ANYWAY ??? 02427000
CHKTRAN TM VMPSW,TRANMODE IN VIRTUAL TRANSLATE MODE ? %V3M4038 02428000
BZ CHKRUNE NO, USE STAN. VM/370 ARCHITECTURE%V3M4038 02429000
L R0,EXTSHCR0 ELSE GET USER'S ARCHITECTURE %V3M4038 02430000
L R1,EXTSHCR1 AND HIS 3'RD LEVEL MEMORY. %V3M4038 02431000
OI VMMCR6,VMMSHADT TURN ON VMA SHADOW TABLE FLAG %V408246 02432000
EJECT 02433000
DROP R2 %V3M4038 02434000
CHKRUNE TM VMESTAT,VMINVPAG+VMSHADT SHADOW TABLES BAD ?? %V3M4038 02435000
BNO SETCREGS IF NOT - READY TO DISPATCH HIM %V3M4038 02436000
CALL DMKVATAB INVALIDATE SHADOW PAGE TABLES %V3M4038 02437000
SPACE 02438000
SETCREGS ST R0,RUNCR0 SET UP FOR CONTROL REGISTER 0. %V3M4038 02439000
ST R1,RUNCR1 SET UP FOR CONTROL REGISTER 1. %V3M4038 02440000
NI VMESTAT,X'FF'-VMINVPAG RESET INVALID PAGE FLAG %V3M4038 02441000
TAKEOFF EQU * ALMOST READY TO DISPATCH HIM %V3M4038 02442000
TM VMTRCTL,VMTRPER IS "PER" TRACING ACTIVE ? %V3M4038 02443000
BZ RELPSW NO. %V3M4038 02444000
RELPER DS 0H %V3M4038 02445000
L R2,VMPERCTL TRACE EXTENSION % PER001 02446000
LCTL C9,C11,PERCR9-PERBLOK(R2) LOAD TRACE C-REGS % PER001 02447000
OI RUNPSW,PERMODE ENABLE PER IN RUNPSW %V3M4038 02448000
SPACE 02449000
RELPSW EQU * FINAL STRETCH BEFORE WE GO... %V3M4038 02450000
LA R9,TSTTRQ1 PREPARE FALL THROUGH ADDRESS %VA06300 02450100
OI VMDSTAT,VMDSP FLAG DISPATCHED RUNUSER %V3M4038 02451000
LA R6,CPCREG6 %V408246 02452000
TM CPSTAT2,CPMICON IS VMA ON FOR SYSTEM ? %V3M4038 02453000
BZ TSTTRQ NO - LEAVE CREG6 ZERO %V407508 02454000
ICM R15,B'0111',VMMADDR IS USER ASSIST ON ? %V3M4038 02455000
BZ TSTTRQ NO - LEAVE CREG6 ZERO %V407508 02456000
TM VMTRCTL,VMTRSVC+VMTRPRV+VMTRBRIN TRACING THESE? %V3M4038 02457000
BNZ TSTTRQ YES - LEAVE VM ASSIST OFF %V407508 02458000
OI VMMCR6,VMMFE TURN ON VMA ASSIST FOR USER %V3M4038 02459000
TM VMOSTAT,VMSHR RUNNING WITH SHARED SYSTEMS %V3M4038 02460000
BZ *+8 IF NOT, ALLOW ISK/SSK BY VMA %V3M4038 02461000
OI VMMCR6,VMMNOSK VMA NOT TO HANDLE ISK/SSK %V3M4038 02462000
TM VMPSW+1,PROBMODE USER IN PROBLEM STATE? %V3M4038 02463000
BZ *+8 NO..PROB BIT IS OK.. %V3M4038 02464000
OI VMMCR6,VMMPROB TURN ON PROBLEM BIT.. %V3M4038 02465000
LA R6,VMMICRO %V408246 02466000
USING MICBLOK,R15 R15 SET UP ABOVE (BY 'ICM') %V3M4038 02467000
CHKPENDG EQU * ENTRY FROM FAST DISPATCH %VA06300 02467100
SLR R4,R4 CLEAR MASK REG %V3M4038 02468000
* HERE TO CHECK FOR PENDING INTERRUPTS 02469000
NI MICVIP,255-MICPEND RESET PENDING INTERRUPT BIT %V3M4038 02470000
L R3,VMVCR0 ECBLOK POINTER %V3M4038 02471000
ICM R4,B'1100',VMIOINT PENDING INTERRUPT MASK %V3M4038 02472000
BZ PGPEND CHECK FOR PSEUDO PAGE FAULTS %V407508 02473000
TM VMESTAT,VMEXTCM USER IN EC MODE ? %V3M4038 02474000
BZ INTPEND NO..CAN'T CONTROL SYSTEM MASK %V3M4038 02475000
L R5,EXTCR2-ECBLOK(,R3) PICK UP I/O MASK BITS %V3M4038 02476000
NR R5,R4 LESS INTERRUPTS NOT PENDING %V3M4038 02477000
BNZ INTPEND MUST TURN ON INT PENDING BIT %V3M4038 02478000
PGPEND DS 0H CHECK FOR PSEUDO PAGE FAULTS %V407508 02479000
TM VMESTAT,VMEXTCM FIRST SEE IF EC-MODE %V407508 02480000
BZ EXPEND NO, CHECK FOR EXTERNL INTERRUPTS %V407508 02481000
TM VMPEND,VMPGPND IS A PSEUDO PAGE FAULT PENDING? %V407508 02482000
BO INTPEND TURN ON INTERRUPT PENDING BIT %V407508 02483000
EXPEND DS 0H CHECK FOR EXTERNAL INTERRUPTS %V407508 02484000
L R4,VMPXINT %V408246 02485000
LTR R4,R4 ANY EXT INT PENDING? %V408246 02486000
BZ TSTTRQ %V407508 02487000
TM VMPSTAT,VMV370R EC MODE MACHINE ? %V3M4038 02488000
BZ *+8 NO..CR0 ALREADY INTACT %V3M4038 02489000
L R3,EXTCR0-ECBLOK(,R3) PICK UP CR0 %V3M4038 02490000
B XPNMSK %V408246 02491000
USING XINTBLOK,R4 %V3M4038 02492000
XPNEXT EQU * %V3M4038 02493000
L R4,XINTNEXT POINTER TO NEXT BLOK %V3M4038 02494000
LTR R4,R4 PENDING EXT INTERRUPT? %V3M4038 02495000
BZ TSTTRQ ALL SET IF NO %V407508 02496000
XPNMSK DS 0H %V408246 02497000
LH R5,XINTMASK PENDING INTERRUPT MASK %V3M4038 02498000
NR R5,R3 LESS INTERRUPTS NOT PENDING %V3M4038 02499000
BZ XPNEXT LOOP THROUGH EXT BLOKS %V3M4038 02500000
INTPEND EQU * %V3M4038 02501000
OI MICVIP,MICPEND SET INTERRUPT PENDING.. %V3M4038 02502000
DROP R15,R4 %V3M4038 02503000
TSTTRQ DS 0H TEST FOR TRQ AND IDLE %V407508 02504000
BR R9 POSSIBLE EXIT TO FAST DISPATCH %VA06300 02504100
TSTTRQ1 EQU * %VA06300 02504200
AIF (NOT &AP).UPTST30 **AIF*** 02504900
TM APSTAT1,APUOPER IS THE AP OPERATIONAL? %V407508 02505000
BNO DSPTRC NO, SKIP TESTS FOR TRQ AND IDLE %V407508 02506000
TM VMPSTAT,VMV370R IS VM AN EC MODE MACHINE @V407508 02507000
BNO TSTIDLE @V407508 02508000
LOCK OBTAIN,TYPE=TR GET THE LOCK ON THE TRQ CHAIN @V407508 02509000
L R10,=A(DMKSCHTQ) GET ADDRESS OF TRQ CHAIN @V407508 02510000
USING TRQBLOK,R10 USE R10 AS BASE FOR TRQBLOK @V407508 02511000
L R10,TRQBFPNT GET FIRST TRQ ON CHAIN @V407508 02512000
C R11,TRQBUSER IS TRQ FOR THIS VM? @V407508 02513000
BNE FRETRQL NO, GO FREE THE TRQ LOCK @V407508 02514000
C R10,ACTIVTRQ IS THIS TRQ ACTIVE ON THIS PROC? @V407508 02515000
BE FRETRQL YES, GO FREE THE TRQ LOCK @V407508 02516000
SCKC TRQBVAL ELSE SET NEW CLK COMPARATOR REQ @V407508 02517000
ST R10,ACTIVTRQ INDICATE THIS TRQ IS ACTIVE @V407508 02518000
DROP R10 STOP USING R10 AS TRQBLOK BASE @V407508 02519000
FRETRQL DS 0H @V407508 02520000
LOCK RELEASE,TYPE=TR RELEASE THE TRQ LOCK @V407508 02521000
TSTIDLE DS 0H @V407508 02522000
MVI TEMPSAVE,NONE TURN OFF WAKE-UP FLAG @V4M0001 02523000
L R2,PREFIXB GET PREFIX VALUE OF OTHER PROC @V407508 02524000
CLI CPSTATUS-PSA(R2),CPWAIT IS OTHER PROC IN WAIT? @V4M0136 02525000
BNE DSPTRC NO, GO TRACE DISPATCH @V4M0136 02526000
BAL R9,WAKSIG WAKE UP IDLE PROC @VA09257 02527000
DSPTRC DS 0H %V407508 02528000
.UPTST30 ANOP **ANOP** 02528100
AIF (NOT &TRACE(9)).TR1 %V3M4038 02529000
TM TRACFLG2,TRAC0A TRACING ACTIVE? %V3M4038 02530000
BZ NOTRAC1 BRANCH IF NOT %V3M4038 02531000
* 02532000
* TRACE DISPATCH OF NEW USER 02533000
* 02534000
LA R14,TRCRUN SET CODE FOR DISPATCH OF USER %V407508 02535000
BAL R1,GETRACE GET CURRENT TRACE TABLE ENTRY %V4M0017 02536000
MVC ONE(THREE,R15),ZEROES CLEAR REST OF FIRST WORD %V4M0173 02537000
ST R11,4(0,R15) TRACE RUNUSER VMBLOK POINTER %V3M4038 02538000
MVC 8(8,R15),RUNPSW AND HIS PSW %V3M4038 02539000
NOTRAC1 EQU * %V407508 02540000
.TR1 ANOP 02541000
LCTL C6,C6,0(R6) LOAD APPROPRIATE VMA VALUE %V407508 02542000
SPACE 02543000
TM APSTAT2,CPPTLBR IS PTLB REQUIRED? %V407508 02544000
BNO MORE NO, CONTINUE WITH DISPATCH %V407508 02545000
NI APSTAT2,X'FF'-CPPTLBR RESET PTLB REQUIRED FLAG %VA07615 02546100
PTLB ISSUE PTLB %VA07615 02547100
MORE DS 0H %V407508 02548000
SLR R15,R15 CLEAR WORK REGISTER %V407508 02549000
ST R15,STACKVM INITIALIZE ADDR FOR DSP REENTRY %V407508 02550000
MVC PROBSTRT,VMTMOUTQ SAVE TIMER AT PROB STATE STRT %V407508 02551000
MVI IOOPSW,0 FLAG I/O PSW NOT VIRTUAL %V408246 02552000
MVC QUANTUM,TIMER CHECKPOINT TIMER AT ENTRY TO %V408246 02553000
* PROBLEM STATE 02554000
LDRPSW DS 0H %V408246 02555000
LCTL C0,C1,RUNCR0 SET-UP VIRT. MEMORY CREGS %V408246 02556000
MVI CPSTATUS,CPRUN SET RUNNING USER FLAG %V407508 02557000
CHARGE STOP STORE SUPERVISOR TIME FOR USER %V407508 02558000
SPT VMTMOUTQ GIVE USER REMAINING TIME LEFT %V3M4038 02559000
LM R0,R15,VMGPRS RESTORE USER REGISTERS %V3M4038 02560000
LPSW RUNPSW -------> %V3M4038 02561000
EJECT 02562000
AIF (NOT &AP).UPTST31 **AIF*** 02562900
* 02563000
* LOAD A WAIT ENABLED ONLY FOR EXTERNAL INTERRUPTS 02564000
* 02565000
IDLEB DS 0H @V407508 02566000
MVI CPSTAT3,CPTIDLE TURN ON IDLE WAIT FLAG @V407508 02567000
LM R0,R1,IDLEPSW GET WAIT STATE PSW @V407508 02568000
STM R0,R1,RUNPSW SAVE FOR WHEN LOADED @V407508 02569000
NI RUNPSW,X'FF'-IOMASK TURN OFF I/O MASK @V407508 02570000
MVC TIMER,FFS AVOID UNNECESSARY TIMER INTS @V407508 02571000
LA R1,IDLEWAIT GET ADDRESS OF TIMER FIELD @V407508 02572000
COUNT APWAITS INCREMENT COUNT OF AP-TYPE WAITS @V407508 02573000
ST R11,RUNUSER SET RUNUSER TO ASYSVM @V407508 02574000
MVC TEMPR0,CPCREG0 MOVE CR0 INTO WORKAREA @V4M0210 02575000
NC TEMPSAVE+2(2),NOCLK TURN OFF EXTRANEOUS BITS @V4M0136 02576000
OI TEMPSAVE+2,MFAMASK+EMSMASK+XCMASK INSURE MFA, @V4M0136 02577000
* EMS, AND XC BITS ARE ON @V4M0136 02578000
LCTL C0,C0,TEMPSAVE LOAD ALTERED CONTROL REG 0 @V4M0136 02579000
B SETWAIT GO TO LOAD WAIT @V407508 02580000
.UPTST31 ANOP **ANOP** 02580100
* 02581000
* LOAD A WAIT ENABLED FOR EXTERNAL & I/O INTERRUPTS 02582000
* 02583000
IDLEECPS DS 0H ECPS EXIT TO LOAD A WAIT STATE @V407508 02584000
L R11,ASYSVM SET R11 TO ASYSVM @V407508 02585000
B LOADIDLE CONTINUE WITH LOADING A WAIT @V407508 02586000
SPACE 02587000
IDLEA DS 0H COME HERE WHEN RUNLIST IS EMPTY @V407508 02588000
AIF (NOT &AP).UPTST32 **AIF*** 02588900
LOCK RELEASE,TYPE=RL RELEASE RUNLIST LOCK @V407508 02589000
CLI TEMPSAVE,SET SHOULD OTHER PROC BE AWOKEN? @V4M0001 02590000
BNE LOADIDLE NO, GO LOAD AN ENABLED WAIT @VA07840 02591000
MVI TEMPSAVE,NONE TURN OFF WAKE-UP FLAG @V4M0001 02592000
L R14,PREFIXB GET PREFIX VALUE OF OTHER PROC @V4M0001 02593000
BAL R9,WAKSIG SIGNAL THE OTH PROC @VA09257 02596000
.UPTST32 ANOP **ANOP** 02596950
LOADIDLE DS 0H NO TASKS CURRENTLY EXECUTABLE @V213235 02597000
L R2,RUNUSER GET ADDRESS OF RUNUSER @V407508 02598000
C R2,LASTUSER IS RUNUSER STILL LOCKED? @V407508 02599000
BNE *+8 NO, SKIP RESETTING OF FLAG @V407508 02600000
NI VMDSTAT-VMBLOK(R2),X'FF'-VMDSP RESET FLAG @V407508 02601000
ST R11,RUNUSER SET RUNUSER TO ASYSVM @V407508 02602000
AIF (NOT &AP).UPTST33 **AIF*** 02602900
TM APSTAT1,APUOPER IS THE AP OPERATIONAL? @V407508 02603000
BNO SETUP NO, GO SET UP PSW FOR WAIT @V407508 02604000
L R2,PREFIXA GET PROCESSOR PREFIX ADDRESS @V407508 02607000
CLI XTNDLOCK-PSA(R2),SET IS SYSTEM IN EXTEND? @V4M0006 02608000
BNE UNDOLAST NO, GO CHECK LASTUSER @V4M0136 02609000
C R11,LASTUSER IS LASTUSER STILL LOCKED? @VA07840 02609100
BE SETUP NO, GO SET UP PSW FOR WAIT @VA07840 02609200
TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? @V4M0136 02610000
BO SETUP YES, GO SET UP PSW FOR WAIT @V4M0136 02611000
BAL R9,XTNDAP DO AP-ONLY EXTEND PROCESSING @V4M0136 02612000
B SETUP GO SET UP PSW FOR WAIT @V4M0136 02613000
UNDOLAST DS 0H @V4M0136 02614000
C R11,LASTUSER IS LASTUSER STILL LOCKED? @VA07840 02614100
BE TSTSTAK NO, GO TEST FOR BLKS TO UNSTACK @VA07840 02614200
L R2,LASTUSER GET ADDRESS OF LASTUSER @V407508 02615000
TM VMOSTAT-VMBLOK(R2),VMSHR IS LASTUSER SHARED @V407508 02616000
BNO UNLLST NO, GO UNLOCK LASTUSER @V407508 02617000
LR R11,R2 SWITCH R11 TO LASTUSER @V4M0173 02618000
CHARGE START START CHARGING LASTUSER @V4M0173 02619000
CALL DMKVMASH CHECK FOR CHANGED PAGES @V407508 02620000
RESET DS 0H @V407508 02625000
CHARGE STOP STOP CHARGING LASTUSER @V4M0173 02626000
L R11,ASYSVM SWITCH R11 TO SYSTEM VMBLOK @V4M0173 02627000
UNLLST DS 0H @V407508 02628000
L R1,LASTUSER GET ADDRESS OF LASTUSER @V407508 02629000
BAL R8,UNLOKVM2 UNLOCK LASTUSER @V407508 02630000
ST R11,LASTUSER SET LASTUSER TO ASYSVM @V407508 02631000
TSTSTAK DS 0H TEST FOR STACKED BLOCKS @VA07840 02631010
L R15,PREFIXB ACCESS OTHER PSA @VA08311 02631014
TM XCPEND-PSA(R15),XCDISP IS DISPATCH XC PENDING ? @VA08311 02631015
BO SETUP YES- SKIP REDUNDANT SIGNAL @VA08311 02631016
LA R15,DMKDSPRQ GET ADDR OF DSP REQUEST STACK @VA07840 02631020
C R15,IOBFPNT-IOBLOK(,R15) IS THE LIST EMPTY? @VA07840 02631030
BNE TSTLOCK NO, GO SEE IF SYSTEM LOCK IS FREE@VA07840 02631040
C R15,CPEXFPNT-CPEXBLOK(,R15) OTHER LIST EMPTY TOO@VA07840 02631050
BE SETUP YES, GO SET UP PSW FOR WAIT @VA07840 02631060
TSTLOCK DS 0H SEE IF SYSTEM LOCK IS FREE @VA07840 02631070
BAL R9,GETSYS GO TRY FOR SYSTEM LOCK @VA07840 02631080
BZ CKCPSTAK SYSTEM LOCK FREE, GO UNSTACK BLKS@VA07840 02631090
.UPTST33 ANOP **ANOP** 02631100
SETUP DS 0H SET UP PSW FOR WAIT @V407508 02632000
LM R0,R1,IDLEPSW WAIT STATE PSW ENABLED FOR EXT. AND I/O 02633000
STM R0,R1,RUNPSW SAVE FOR WHEN LOADED 02634000
MVC TIMER,FFS AVOID UNNECESSARY TIMER INTERRUPTS 02635000
SSM RUNPSW ENABLE FOR INTERRUPTS @V407508 02636000
SSM *+1 DISABLE BEFORE GETTING LOCK @V407508 02637000
LOCK OBTAIN,TYPE=RL GET LOCK ON RUNLIST @V407508 02638000
AIF (NOT &AP).UPTST34 **AIF*** 02638900
L R4,PREFIXB GET PREFIX ADDRESS OF OTHER PROC @V4M0136 02639000
L R4,RUNUSER(R4) GET RUNUSER OF OTHER PROC @V4M0136 02640000
.UPTST34 ANOP **ANOP** 02640100
L R3,=A(DMKSCHRL) ANCHOR FOR LIST OF RUN-Q USERS @V408246 02641000
C R3,VMQFPNT-VMBLOK(,R3) ANY USERS IN RUN-Q? @V408246 02642000
AIF (NOT &AP).UPTST35 **AIF*** 02642900
BE STIDLEWT NO, GO SET IDLE WAIT @V4M0136 02643000
C R4,VMQFPNT-VMBLOK(,R3) IS 1ST USER IN RUN LIST @V4M0136 02644000
* RUNUSER ON THE OTHER PROC? @V4M0136 02645000
BNE CKPAGEWT NO, GO CALC PAGE WAIT STATUS @V4M0136 02646000
C R4,VMQBPNT-VMBLOK(,R3) IS LAST USER IN RUN LIST @V4M0136 02647000
* RUNUSER ON THE OTHER PROC? @V4M0136 02648000
.UPTST35 ANOP **ANOP** 02648100
BNE CKPAGEWT NO, GO CALC PAGE WAIT STATUS @V4M0136 02649000
STIDLEWT DS 0H ONLY ONE USER ON RUN LIST @V4M0136 02650000
LOCK RELEASE,TYPE=RL RELEASE LOCK ON RUN LIST @VA07394 02650100
LDIDLEWT DS 0H SET UP FOR IDLE WAIT @VA07394 02650200
LA R1,IDLEWAIT TIMER FIELD @V408246 02651000
OI CPSTAT3,CPTIDLE TURN ON IDLE WAIT FLAG @V407508 02652000
B SETWAIT ... @V408246 02654000
SPACE 3 02655000
CKPAGEWT DS 0H @V408246 02656000
* CHECK 02657000
LR R1,R3 @V408246 02658000
DROP R11 DROP REAL VMBLOK POINTER @V408246 02659000
USING VMBLOK,R1 TEMPORARY USE R1 AS VMBLOK @V408246 02660000
* POINTER 02661000
SR R0,R0 CLEAR FOR COUNT OF PAGEWAIT PAGES@V408246 02662000
SR R2,R2 CLEAR FOR COUNT OF I/O TASKS @V408246 02663000
NEXTVMBK DS 0H @V408246 02664000
L R1,VMQFPNT NEXT USER ON CHAIN @V408246 02665000
CR R1,R3 AT END OF CHAIN? @V408246 02666000
BE PAGEING YES, CHECK STATUS @V408246 02667000
AIF (NOT &AP).UPTST36 **AIF*** 02667900
CR R1,R4 IS THIS RUNUSER OF OTHER PROC? @V4M0136 02668000
BE NEXTVMBK YES, SKIP THIS VMBLOK @V4M0136 02669000
.UPTST36 ANOP **ANOP** 02669100
TM VMRSTAT,VMPGWAIT IS THIS USER IN PAGE WAIT? @V408246 02670000
BZ IOCYLCES NO @V408246 02671000
LH R5,VMPAGES NO. RESIDENT PAGES @V408246 02672000
CH R5,VMWSPROJ MAXIMUM VALUE? @V408246 02673000
BNL *+8 YES @V408246 02674000
LH R5,VMWSPROJ NO, RESET TO MAX @V408246 02675000
AR R0,R5 ACCUMULATE VALUE @V408246 02676000
B NEXTVMBK @V408246 02677000
IOCYLCES DS 0H @V408246 02678000
AIF (NOT &AP).UPTST38 **AIF*** 02678100
TM VMRSTAT,VMIOWAIT IS THIS USER IN I/O WAIT? @VA07394 02678200
BZ NEXTVMBK NO, GO GET NEXT USER ON CHAIN @VA07394 02678300
.UPTST38 ANOP **ANOP** 02678400
LA R2,1(,R2) INCREMENT COUNT OF I/O WAIT TASKS@V408246 02679000
B NEXTVMBK @V408246 02680000
* 02681000
DROP R1 @V408246 02682000
USING VMBLOK,R11 @V408246 02683000
* 02684000
PAGEING DS 0H @V408246 02685000
LOCK RELEASE,TYPE=RL,SAVE RELEASE LOCK ON RUNLIST @V407508 02686000
L R4,=A(DMKPTRRC) POINTER TO RESERVED PAGE COUNT @V408246 02687000
L R4,0(,R4) RESERVED PAGE COUNT @V408246 02688000
AL R4,DMKDSPNP + PAGEABLE PAGES -> TOTAL @V408246 02689000
* PAGEABLE PAGES 02690000
CR R0,R4 UPPER LIMIT? @V408246 02691000
BNH *+6 NO @V408246 02692000
LR R0,R4 YES, RESET @V408246 02693000
ST R0,PWTPAGES SAVE FOR EXIT FROM WAIT @V407508 02694000
ALR R0,R0 2 * PAGES WAITING @V408246 02695000
CR R0,R4 2 * PAGE-WAIT PAGES > PAGEABLE @V408246 02696000
* PAGES ?? 02697000
BH PIOCYCL YES @V408246 02698000
LTR R2,R2 ANY I/O TASKS? @V408246 02699000
BNZ LOADIO YES @V408246 02700000
AIF (NOT &AP).UPTST39 **AIF*** 02700100
LTR R0,R0 ARE THERE ANY PAGE WAIT PAGES? @VA07394 02700200
BZ LDIDLEWT NO, GO LOAD AN IDLE WAIT @VA07394 02700300
.UPTST39 ANOP **ANOP** 02700400
PIOCYCL DS 0H @V408246 02701000
LA R1,PAGEWAIT SET PAGE WAIT TIMER @V408246 02702000
OI CPSTAT3,CPTPAGE TURN ON PAGE WAIT FLAG @V407508 02703000
B SETWAIT @V408246 02704000
LOADIO DS 0H @V408246 02705000
LA R1,IONTWAIT SET I/O WAIT TIMER @V408246 02706000
OI CPSTAT3,CPTIONT TURN ON I/O WAIT FLAG @V407508 02707000
SETWAIT DS 0H @V408246 02708000
SLR R15,R15 CLEAR WORK REGISTER @V407508 02709000
ST R15,STACKVM INITIALIZE ADDR FOR DSP REENTRY @V407508 02710000
MVI CPSTATUS,CPWAIT FLAG SYSTEM AS IN WAIT @V407508 02711000
SPT 0(R1) SET TIMER POINTED TO BY REG. 1 @V408246 02712000
LM R2,R3,0(R1) SAVE INITIAL TIMER VALUE @V408246 02713000
STM R2,R3,WAITSTRT FOR WAIT EXIT @V407508 02714000
LPSW RUNPSW --ZZZZZZ--ZZZZZ-- 02715000
SPACE 2 02715010
LOCKRLDS DS 0H @VA09257 02715015
LOCK RELEASE,TYPE=DS RELEASE LOCK ON DSP STKS @VA09257 02715020
BR R9 @VA09257 02715025
SPACE 2 02715030
LOCKOBDS DS 0H SPACE SAVER CODE @VA09257 02715035
LOCK OBTAIN,TYPE=DS OBTAIN LOCK ON DSP STKS @VA09257 02715040
BR R9 @VA09257 02715045
EJECT 02716000
* CONSTANTS AND EXECUTED INSTRUCTIONS 02717000
SPACE 02718000
DS 0D 02719000
IDLEPSW DC X'030E0000',X'00000000' WAIT-STATE IDLE PSW 02720000
SPACE 02721000
EXTZBIT DC X'B800C0FF' MUST-BE-ZERO BITS FOR EC-MODE PSW 02722000
SPACE 02723000
TESTSIG TM =AL1(SIGMASK),*-* EXECUTED TO TEST EXT SIGNAL ENABLED 02724000
SPACE 02725000
EXTPARMS DC X'80',C'W',AL2(452) RETURN; WNG; ERROR CODE. @V3M4026 02726000
SPACE 02727000
PSWPARMS DC X'C0',C'W' RETURN, FRET R3 SPACE; WNG MSG. @V3M4026 02728000
* THESE ADDRESSES MUST REMAIN TOGETHER AND IN THIS ORDER 02729000
EXTADDRS DC A(DMKPTRFD) EXIT ALLOWED DURING EXTEND @V407508 02730000
DC A(DMKPTRFE) .. @V407508 02731000
DC A(DMKPTRFP) .. @V407508 02732000
DC A(DMKIOSER) .. @V407508 02733000
DC A(DMKIOSRC) .. @V407508 02734000
SPACE 3 02735000
* MEASUREMENT COUNTERS @V386198 02736000
SPACE 02737000
DMKDSPNP DC F'0' COUNT OF ASSIGNABLE PAGE FRAMES @V386198 02738000
DMKDSPAC DC F'0' ENTRIES TO DMKDSPA 02739000
DMKDSPBC DC F'0' ENTRIES TO DMKDSPB 02740000
DMKDSPEC DC F'0' ENTRIES TO DMKDSPE @V386198 02741000
AIF (NOT &AP).UPTST37 **AIF*** 02741900
DMKDSPRC DC F'0' ENTRIES TO DMKDSPRU @V407508 02742000
DISPWKUP DC X'CFFFFFFF' TURN OFF WAKEUP & DISPATCH @VA08873 02742060
.UPTST37 ANOP **ANOP** 02742100
DMKDSPIT DC F'0' VIRT INTV TIMER INT REF, X'0080' @V2B2638 02743000
DMKDSPCK DC F'0' VIRT CLOCK COMP INT REF, X'1004' @V2B2638 02744000
DMKDSPPT DC F'0' VIRT CPU TIMER INT REF, X'1005' @V2B2638 02745000
SPACE 02747000
APWAITS DC F'0' AP INDUCED WAITS @V407508 02748000
CPPSW DC A(X'000C0000') FIRST HALF OF PSW TO UNSTACK @V407508 02749000
* SWITCH CPEXBLOK @V407508 02750000
PSWADDR DC F'0' SECOND HALF OF PSW @V407508 02751000
NOCLK DC X'E31F' ALL BITS BUT MFA, EMS, AND XC @V4M0136 02752000
IOWINDOW DC X'02' MASK ENABLING FOR I/O INTERRUPTS @V4M0173 02753000
SPACE 02754000
FORCE EQU X'02' PARAMETER FOR CALL TO DMKUSOFF @V200820 02755000
SET EQU X'FF' USED TO TEST IF FLAG IS SET @V407508 02756000
NONE EQU X'00' USED TO TEST IF FLAG IS OFF @V407508 02757000
ONE EQU 1 CONSTANT ONE @V407508 02758000
THREE EQU 3 CONSTANT THREE @V407508 02759000
LNPSW EQU 8 LENGTH OF PSW @V407508 02760000
OFFR15 EQU 12 OFFSET OF R15 IN DSPSAVE @V407508 02761000
EJECT 02762000
LTORG 02763000
EJECT 02764000
COPY VMBLOK 02765000
COPY XINTBLOK @V200198 02766000
COPY PGBLOK @V213135 02767000
EJECT 02768000
COPY TREXT 02769000
COPY PERBLOKS PER001 02769500
COPY VBLOKS 02770000
PSA 02771000
COPY SAVE 02772000
COPY TIMER INCLUDE DSECT FOR TRQBLOK @V407508 02773000
COPY IOBLOKS 02774000
COPY EQU 02775000
COPY RBLOKS @VA04189 02776000
COPY MICBLOK 02777000
COPY VMCBLOKS @V387045 02778000
END DMKDSP @V200820 02779000