VSJ TITLE 'DMKVSJ (CP) VM/370 - RELEASE 6' 00001000 ISEQ 73,80 VALIDATE SERIALIZATION OF INPUT 00002000 *. 00003000 * MODULE NAME - 00004000 * 00005000 * DMKVSJ 00006000 * 00007000 * FUNCTION - 00008000 * 00009000 * TO SIMULATE THE OPERATION OF PRIVILEGED I/O INSTRUCTIONS 00010000 * ISSUED BY VIRTUAL MACHINES (HIO, CLCH) 00011000 * 00012000 * ATTRIBUTES - 00013000 * 00014000 * REENTRANT, RESIDENT, ENTERED VIA GOTO FROM DMKPRVLG FOR THE 00015000 * SIMULATION OF AN INSTRUCTION (HIO, CLCH) 00016000 * 00017000 * ENTRY POINTS - 00018000 * 00019000 * DMKVSJEX - SIMULATE A HIO, CLCH AND SUBROUTINES 00020000 * 00021000 * ENTRY CONDITIONS - 00022000 * 00023000 * FOR DMKVSJEX - 00024000 * GPR11 = ADDRESS OF USER'S VMBLOK 00025000 * GPR12 = DMKVSJEX BASE 00026000 * GPR9 = RETURN SDDRESS IN DMKVSI IF THE ENTRY IS FOR THE 00027000 * GETLOCK SUBROUTINE 00028000 * 00029000 * THE FIELD VMINST IN THE USER'S VMBLOK CONTAINS THE I/O 00030000 * INSTRUCTION TO BE SIMULATED 00031000 * 00032000 * NOTE THAT GPR13 DOES NOT POINT TO A SAVEAREA 00033000 * 00034000 * EXIT CONDITIONS - 00035000 * 00036000 * FOR DMKVSJEX - NORMAL 00037000 * THE CORRECT STATUS AND CONDITION CODES ARE REFLECTED TO THE 00038000 * VIRTUAL MACHINE, AND, IF APPROPRIATE, THE I/O IS STARTED 00039000 * 00040000 EJECT 00041000 * 00042000 * CALLS TO OTHER ROUTINES - 00043000 * 00044000 * DMKFREE - TO OBTAIN FREE STORAGE FOR IOBLOKS 00045000 * DMKIOSQV - TO SCHEDULE THE VIRTUAL OPERATION 00046000 * DMKVCASH - TO SIMULATE A HALT I/O TO A VIRTUAL CTCA 00047000 * DMKSTKIO - TO STACK AN INTERRUPT DUE TO THE COMPLETION OF A 00048000 * VIRTUAL ENABLE CAUSED BY A HIO 00049000 * DMKDSPCH - EXIT VIA GOTO AFTER I/O IS SCHEDULED BY DMKIOSQV 00050000 * DMKTRDSI - TO TRACE AN I/O OPER. (SIO, TIO, HIO, TCH, CLCH) 00051000 * DMKVSCVR - TO VERIFY THAT THE NOTRANS OPTION IS VALID 00052000 * DMKVIOIN - IOB INTERRUPT RETURN ADDRESS (IOBIRA) 00053000 * DMKCCHRF - CALLED TO REFLECT CHANNEL CHECK TO VIRTUAL MACHINE 00054000 * 00055000 * EXTERNAL REFERENCES - 00056000 * 00057000 * NONE 00058000 * 00059000 * TABLES / WORKAREAS - 00060000 * 00061000 * VCHBLOK,VCUBLOK, AND VDEVBLOK ARE REFERENCED AND UPDATED 00062000 * 00063000 * REGISTER USAGE - 00064000 * 00065000 * GPR0 = CONDITION CODE RETURNED FROM DMKSCNVU 00066000 * GPR1 = SCRATCH - OR USED FOR DEDICATED CHANNEL SUPPORT 00067000 * GPR2 = SCRATCH - OR USED FOR DEDICATED CHANNEL SUPPORT 00068000 * GPR3 = ADDRESS OF VBLOK THAT CONTAINS SUBCHANNEL STATUS 00069000 * GPR4 = CSW STATUS TO BE STORED 00070000 * GPR5 = INTERNAL SUBROUTINE LINKAGE 00071000 * GPR6 = VCHBLOK BASE 00072000 * GPR7 = VCUBLOK BASE 00073000 * GPR8 = VDEVBLOK BASE 00074000 * GPR9 = VIRTUAL DEVICE ADDRESS 00075000 * GPR10 = IOBLOK BASE 00076000 * GPR11 = VMBLOK BASE 00077000 * GPR12 = DMKVSJ BASE 00078000 * GPR13 NOT USED 00079000 * GPR14 = EXTERNAL LINKAGE 00080000 * GPR15 = EXTERNAL LINKAGE 00081000 EJECT 00082000 * 00083000 * NOTES - 00084000 * 00085000 * OPERATION - 00086000 * 1. BRANCH TO HANDLE HIO AND CLCH AS DESCRIBED IN 00087000 * SECTIONS A-B RESPECTIVELY. 00088000 * 2. RETURN TO DMKVSI AS NEEDED. 00089000 * . DMKVSICH 00090000 * . R9 FROM GETLOCK SUBROUTINE 00091000 *. 00092000 EJECT 00093000 COPY OPTIONS 00094000 COPY LOCAL OPTIONS 00095000 SPACE 2 00096000 DMKVSJ CSECT 00097000 ENTRY DMKVSJEX @VA12128 00098000 ENTRY DMKVSJHI COUNT OF HIO (9EX0) INSTRUCTIONS @VA12128 00099000 ENTRY DMKVSJHD COUNT OF HDV (9EX1) INSTRUCTIONS @VA12128 00100000 EXTRN DMKVIOMK,DMKVIOXK 00101000 EXTRN DMKVSICH HANDLE CLCH AS TCH @VA12128 00102000 EXTRN DMKSTKDE @VA12128 00103000 EXTRN DMKVIOIN,DMKVSIEX 00104000 EXTRN DMKIOSQV 00105000 EXTRN DMKSTKIO 00106000 EXTRN DMKSCNVU 00107000 EXTRN DMKVCASH @VA12128 00108000 EXTRN DMKCCHRF @V508690 00109000 EXTRN DMKSSSMQ,DMKDSPCH @V60B6B8 00110000 AIF (NOT &TRACE(6)).TRA1 **AIF** 00111000 EXTRN DMKTRDSI @V4M0240 00112000 .TRA1 ANOP 00113000 AIF (NOT &AP).LOKSY4 00114000 EXTRN DMKLOKSY,DMKDSPRU @VA08305 00115000 .LOKSY4 ANOP 00116000 SPACE 2 00117000 USING PSA,R0 00118000 USING VCHBLOK,R6 00119000 EXTRN DMKDSPA @V408246 00120000 EXTRN DMKDSPRQ @V408246 00121000 USING VCUBLOK,R7 00122000 USING VDEVBLOK,R8 00123000 USING IOBLOK,R10 00124000 USING VMBLOK,R11 00125000 USING DMKVSJEX,R12 00126000 EJECT 00127000 DMKVSJEX DS 0D @VA12128 00128000 B VSJBRNCH(R14) GO TO PROPER ROUTINE AS INDEXED @VA12128 00129000 * BY REGISTER 14. R14 WAS LOADED BY DMKVSI 00130000 * WITH THE PROPER INDEX 00131000 SPACE 00132000 VSJBRNCH EQU * TABLE OF ROUTINES FOR DMKVSJ @VA12128 00133000 B VIOCLCH CLCH SIMULATION @VA12128 00134000 B VIOHIO HIO SIMULATION @VA12128 00135000 B STTOTCSW STORE TOTAL CSW @VA12128 00136000 B STORECSW STORE CSW @VA12128 00137000 B VIOEXIT2 GENERAL EXITS @VA12128 00138000 B VIOEXIT EXITS @VA12128 00139000 B VIOEXITX EXITS @VA12128 00140000 B VIOEXITY EXITS @VA12128 00141000 B VIOGODSP GO TO THE DISPATCHER @VA12128 00142000 B GETLOCK GET THE SYSTEM LOCK @VA12128 00143000 B CTCAIOB BUILD IOBLOCK TO SCHEDULE TIO @VA12128 00144000 EJECT 00145000 * 00146000 * A. VIRTUAL CLCH SIMULATION - 00147000 * 00148000 * 1. IF A NECESSARY CONTROL BLOCK WAS NOT FOUND, RETURN VIRTUAL 00149000 * CONDITION CODE 3. 00150000 * 00151000 * 2. IF CHANNEL IS DEDICATED: 00152000 * - ISSUE CLCH INSTRUCTION, 00153000 * - RECORD THE CLCH INFORMATION IN THE NEXT TRACE TABLE 00154000 * ENTRY, 00155000 * - SET C.C. IN VIRTUAL PSW. 00156000 * 00157000 * 3. IF CHANNEL IS NOT DEDICATED, SIMULATE CLCH AS A TCH. 00158000 * (SEE TCH SIMULATION DESCRIPTION ABOVE.) 00159000 * 00160000 VIOCLCH DS 0H @VMD0117 00161000 AL R1,DMKVSJCC ADD CLCH COUNT TO INCREMENT @VA12128 00162000 ST R1,DMKVSJCC STORE CLEAR CHANNEL COUNT @VA12128 00163000 SPM R0 RESTORE COND. CODE FROM DMKSCNVU @VMD0117 00164000 BC 4,VIOEXIT SET CC = 3. (DMKSCNVU RETURNS @VA07864 00165000 * A CC OF 1 WHEN THE VCHBLOK WAS 00166000 * NOT FOUND) 00167000 TM VCHSTAT,VCHDED IS CHANNEL DEDICATED? @VA07864 00168000 BNO CLCHEXIT NO, TREAT CLCH AS A TCH @VA12128 00169000 SWITCH MAKE SURE WE ARE ON I/O PROC @VMV0003 00170000 LH R1,VCHADD GET CHANNEL ADDR - REAL=VIRTUAL @VMV0003 00171000 * CLRCH 0(R1) ISSUE REAL CLRCH INSTRUCTION @VMV0003 00172000 DC X'9F01' ISSUE REAL CLRCH INSTRUCTION @VMV0003 00173000 DC S(0(1)) FOR SPECIFIED CHANNEL @VMV0003 00174000 AIF (NOT &TRACE(9)).NTCLCH1 **AIF** 00175000 BALR R0,0 PRESERVE C.C. FROM CLRCH INSTR. @VMD0117 00176000 CCTRACE DS 0H @VMD0117 00177000 TM TRACFLG2,TRACBEF I/O TRACING ACTIVE? @VMV0003 00178000 BZ CLRCHNOT NO -- RESTORE CC AND RETURN @VMV0003 00179000 TRACE CODE=TRCCLCH,R14,R1,R2 GET A TRACE ENTRY @VMD0117 00180000 STCM R0,8,1(R14) MOVE IN CONDITION CODE @VMD0117 00181000 NI 1(R14),X'30' LEAVE ONLY THE CONDITION CODE @VMD0117 00182000 STH R13,2(0,R14) STORE DEVICE ADDR IN TRACE ENTRY @VMD0117 00183000 ST R11,4(,R14) STORE VMBLOK POINTER @VMD0117 00184000 MVC 8(8,R14),VDEVCSW STORE VIRTUAL CSW @VMD0117 00185000 CLRCHNOT EQU * RESTORE COND CODE, RETURN @VMV0003 00186000 SPM R0 RESTORE COND. CODE FROM CLCH @VMD0117 00187000 .NTCLCH1 ANOP 00188000 BZ VIOEXITX CLCH WAS PERFORMED @VMD0117 00189000 LA R2,X'10' INDICATE CC SHOULD BE SET TO 1 @VMD0117 00190000 BC 4,VIOEXIT CC 1 IS MEANINGLESS FOR A CLCH @VMD0117 00191000 LA R2,X'20' INDICATE CC SHOULD BE SET TO 2 @VMD0117 00192000 BC 2,VIOEXIT CHANNEL IS BUSY @VMD0117 00193000 LA R2,X'30' INDICATE CC SHOULD BE SET TO 3 @VMD0117 00194000 B VIOEXIT CHANNEL IS NOT OPERATIONAL @VMD0117 00195000 SPACE 00196000 CLCHEXIT EQU * 00197000 L R15,=A(DMKVSICH) ADDRESS IN DMKVSI TO GO TO @VA12128 00198000 BR R15 GO TO DMKVSI @VA12128 00199000 EJECT 00200000 *. 00201000 * B. VIRTUAL HIO SIMULATION - 00202000 * 1. IF ALL VBLOKS WERE NOT FOUND, SET VIRTUAL CONDITION 00203000 * CODE = 3 AND EXIT. 00204000 * 3. IF A VIRTUAL CHANNEL END IS PENDING, EXIT WITH CC = 0 00205000 * 4. IF THE CONTROL UNIT OR DEVICE IS BUSY, STORE CSW 00206000 * STATUS OF ZERO, SET CC = 1, AND EXIT. 00207000 * 5. IF THE VIRTUAL CU IS BUSY, STORE SM+BUSY, SET CC = 1, 00208000 * AND EXIT. 00209000 * 6. IF THE VIRTUAL SUBCHANNEL IS MARKED BUSY FOR A NON-TP 00210000 * DEVICE, DO A REAL "HIO" AND RETURN THE CSW STATUS AND 00211000 * COND. CODE TO THE USER; IF THE BUSY DEVICE IS A VIRTUAL 00212000 * ENABLED 270X LINE THAT HAS NOT YET BEEN DIALED, UNCHAIN 00213000 * THE IOBLOK,AND CALL DMKSTKIO TO REFLECT A CE-DE-UE TO 00214000 * THE CALLER. 00215000 * 7. IF THE DEVICE IS A VIRTUAL CTCA, CALL DMKVCASH TO 00216000 * PERFORM THE NECESSARY SIMULATION OF THE HALT I/O. 00217000 * 8. IF THE DEVICE IS A DEDICATED CTCA, BUILD AN IOBLOK 00218000 * AND SCHEDULE A REAL HALT I/O VIA A CALL TO DMKIOSQV. 00219000 * (A REAL HALT I/O MUST BE PERFORMED EVEN IF THE DEVICE IS IDLE 00220000 * SINCE IT IS USED TO TERMINATE THE Y-SIDE CHANNEL PROGRAM.) 00221000 *. 00222000 SPACE 00223000 VIOHIO EQU * 00224000 BAL R9,GETLOCK GO GET THE SYSTEM LOCK @VA08305 00225000 TM VMINST+1,X'01' IS IT HDV? @V2B2638 00226000 BO VIOHDV YUP, BR @V2B2638 00227000 AL R1,DMKVSJHI ADD HIO COUNT TO INCREMENT @VA12128 00228000 ST R1,DMKVSJHI AND RE-STORE @VA12128 00229000 B VIOHIO1 CONTINUE @V2B2638 00230000 SPACE 00231000 VIOHDV AL R1,DMKVSJHD ADD HDV COUNT TO INCREMENT @VA12128 00232000 ST R1,DMKVSJHD AND RE-STORE @VA12128 00233000 SPACE 00234000 VIOHIO1 EQU * HERE WHEN COUNTS ARE BUMPED @V2B2638 00235000 SPM R0 RESTORE COND. CODE FROM DMKSCNVU 00236000 BNZ VIOEXIT EXIT CC = 3 -- DEVICE NOT FOUND @VA01527 00237000 SPACE 00238000 LR R3,R6 POINT TO VCHBLOK 00239000 TM VCHTYPE,VCHSEL SELECTOR CHANNEL? @VA03072 00240000 BNZ HIOCHAN YES --- @VA01771 00241000 LR R3,R7 NO -- POINT TO VCUBLOK 00242000 TM VCUTYPE,VCUSHRD+VCUCTCA SHARED SUB-CHANNEL ? 00243000 BNZ HIOCHAN YES --- @VA01771 00244000 LR R3,R8 NO -- POINT TO VDEVBLOK 00245000 HIOCHAN EQU * TEST FOR SUB-CHANNEL BUSY @VA01771 00246000 TM VCHSTAT-VCHBLOK(R3),VCHBUSY TEST STATUS OF SUBCHANNEL 00247000 BO REALHIO CHANNEL IS BUSY - GO DO REAL HIO 00248000 TM VCHSTAT-VCHBLOK(R3),VCHCEPND IS CHANNEL END PENDING? 00249000 BO VIOEXITX CE PENDING -- EXIT WITH CC = 0 00250000 TM VCUSTAT,VCUBUSY IS THE CU BUSY ?? 00251000 BO VIRHIO YES -- GO DO VIRTUAL HIO 00252000 TM VCUINTS,CUE IS A CUE PENDING ?? 00253000 BO HIOCUE YES -- 00254000 EJECT 00255000 * 00256000 * VIRTUAL HIO TO DEVICE 00257000 * 00258000 VIRHIO SR R5,R5 ZERO STATUS 00259000 CLI VDEVTYPC,CLASSPEC SPECIAL CLASS DEVICE? @VA04040 00260000 BNE STORECSW NOPE - STORE THE CSW @VA04040 00261000 LA R3,IOBHIO IF DEDICATED ADAPTER, THIS IS A HALT I/O 00262000 TM VDEVSTAT,VDEVDED DEDICATED CHANNEL-TO-CHANNEL ? 00263000 BO CTCAIOB YES - BUILD IOBLOK TO SCHEDULE THE 'HIO' 00264000 VCTCHIO EQU * SIMULATE HIO TO VIRTUAL CTCA 00265000 LR R1,R13 CTCA ADDRESS TO R1 00266000 CALL DMKVCASH ... 00267000 BNZ STORECSW CC NON-ZERO => CSW STORED 00268000 B VIOEXITX EXIT WITH CC = 0 00269000 SPACE 00270000 HIOCUE EQU * HERE IF CUE IS PENDING 00271000 TM VDEVSTAT,VDEVCUE IS IT FOR THE ADDRESSED DEVICE 00272000 BO VIRHIO YES -- DO VIRTUAL HIO 00273000 L R5,=A(256*(SM+BUSY)) CAN'T DO HIO IF CU OCCUPIED 00274000 B STORECSW STORE AND EXIT 00275000 SPACE 00276000 REALHIO EQU * HERE TO DO A REAL HIO 00277000 TM VDEVTYPC,CLASTERM+CLASSPEC IS IT A LINE OR A CTCA ? 00278000 BZ HIO NO -- DO REAL HIO 00279000 TM VDEVSTAT,VDEVDED IS IT A DEDICATED LINE ?? 00280000 BO HIO YES - DO HIO 00281000 CLI VDEVTYPC,CLASTERM IS THIS A DIALED LINE ? 00282000 BE DIALHIO YES - SIMULATE HIO 00283000 CLI VDEVTYPE,TYPCTCA IS THIS VIRTUAL CTCA ? 00284000 BE VCTCHIO YES -- SIMULATE HIO 00285000 B HIO OTHERWISE, DO REAL HIO 00286000 SPACE 00287000 DIALHIO EQU * SIMULATE HIO FOR DIALED LINES 00288000 SLR R5,R5 SET CSW STATUS ZERO @VA01527 00289000 TM VDEVFLAG,VDEVENAB ENABLED NOW? @VA01527 00290000 BZ STORECSW N0...GIVE CC=1 @VA01527 00291000 TM VDEVFLAG,VDEVDIAL IN DIAL PROCESS NOW? @VA01527 00292000 BO VIOEXITX YES....EXIT CC=0 @VA01527 00293000 NI VDEVFLAG,255-VDEVENAB HAS BEEN HALTED @VA01527 00294000 L R10,VDEVIOB R10 = ENABLE IOBLOK @VA01527 00295000 L R1,IOBRCAW ADDRESS OF ENABLE CCW @VA01527 00296000 MVC IOBCSW+6(2),6(R1) RESIDUAL COUNT @VA01527 00297000 LA R1,8(0,R1) THE ONE THAT WAS ACTIVE @VA01527 00298000 ICM R1,8,IOBRCAW RESTORE CAW KEY @VA01527 00299000 ST R1,IOBCSW SET AS CSW ADDRESS @VA01527 00300000 LA R1,(CE+DE+UE)*256 CSW STATUS @VA01527 00301000 STH R1,IOBCSW+4 . . . @VA01527 00302000 CALL DMKSTKIO @VA01527 00303000 B STORECSW GIVE CC=1 TO HIO @VA01527 00304000 EJECT 00305000 HIO EQU * HERE TO DO REAL LIVE HIO 00306000 SWITCH MAKE SURE WE ARE ON THE IO PROCESSOR @V4075A0 00307000 L R3,VDEVREAL GET POINTER TO REAL DEVICE BLOK 00308000 LTR R3,R3 ANY RDEVBLOK ? @VA13707 00308100 BZ VIOEXITX EXIT, NO NEED TO PERFORM HDV @VA13707 00308200 L R10,RDEVAIOB-RDEVBLOK(R3) GET POINTER TO ACTIVE IOBLOK 00309000 LTR R10,R10 IS THERE ONE ?? 00310000 BZ VIOEXITX NO -- 00311000 CL R10,VDEVIOB IS IT THE CURRENT OPERATION? @VA03436 00312000 BNE VIOEXITX NO--EXIT @VA03436 00313000 LH R1,VCHADD GET CHANNEL ADDRESS 00314000 SRL R1,7 TIMES 2 00315000 L R15,=A(DMKVIOXK) ADDRESS THE MASK TABLE @VA05037 00316000 LH R1,0(R1,R15) PICK UP "TURN-OFF" MASK @VA05037 00317000 N R1,VMIOACTV-2 TURN OFF PREVIOUSLY ACTIVE CHANNEL 00318000 STH R1,VMIOACTV ... 00319000 TM VCHTYPE,VCHBMX BMX CHANNEL? @VA03150 00320000 BNO *+8 NO, SKIP CALL TO SCAN @VA03150 00321000 BAL R14,SCANALL ANYTHING ELSE GOING ON ? @VA03150 00322000 LH R5,IOBRADD GET REAL DEVICE ADDRESS 00323000 HDV 0(R5) HALT THE I/O @VA03436 00324000 AIF (NOT &TRACE(9)).NTR1 @VA03431 00325000 BAL R15,HIOTRACE TRACE HALT I/O @VA03431 00326000 DC X'0F00' TRACE ENTRY FLAG @VA03431 00327000 .NTR1 ANOP 00328000 BZ VIOEXITX CC = 0, INTERRUPT PENDING 00329000 BC 4,HIOSTCSW CC = 1, CSW STORED 00330000 LA R2,X'20' SET CC = 2 00331000 BC 2,VIOEXIT2 IT WAS CONDITION CODE 2 EXIT @VA10542 00332000 LA R2,X'30' SET CC 3 00333000 B VIOEXIT AND LEAVE 00334000 SPACE 00335000 HIOSTCSW EQU * HERE WHEN CSW IS STORED BY REAL HIO 00336000 CLC CSW+4(2),ZEROES HALT DEVICE CC=1 STATUS=0 @VA10542 00337000 BNE HIONZSTA NO BRANCH @VA10542 00338000 NI VDEVSTAT,255-VDEVCHBS RESET CHANNEL BUSY @VA10542 00339000 HIONZSTA EQU * @VA10542 00340000 LH R5,CSW+4 GET STATUS FROM REAL CSW 00341000 B STORECSW AND GO STORE IN VIRTUAL CSW 00342000 EJECT 00343000 CTCAIOB EQU * @VA08496 00344000 OI VMRSTAT,VMIOWAIT PUT VIRTUAL MACHINE IN IOWAIT @VA08496 00345000 LA R0,IOBSIZE GET FREE STORAGE FOR AN IOBLOK 00346000 CALL DMKFREE ... 00347000 LR R10,R1 ADDRESS VIA GR10 00348000 USING IOBLOK,R10 00349000 XC IOBLOK(IOBSIZE*8),IOBLOK CLEAR ENTIRE BLOCK 00350000 * (NOTE: "IOBLINK" FILLED IN BY DMKIOSQV) 00351000 STH R13,IOBVADD SET VIRTUAL DEVICE ADDRESS 00352000 L R1,=A(DMKVIOIN) SET INTERRUPT RETURN 00353000 ST R1,IOBIRA ... 00354000 ST R10,VDEVIOB SAVE ACTIVE IOBLOK ADDRESS 00355000 STC R3,IOBSPEC SET 'IOBTIO' OR 'IOBHIO' FLAG 00356000 OI VDEVSTAT,VDEVBUSY MARK THE DEVICE TEMPORARILY BUSY 00357000 CALL DMKIOSQV SCHEDULE THE TEST I/O OR HALT I/O 00358000 B VIOEXITY EXIT - NO TRACING YET 00359000 SPACE 1 00360000 * CHECK FOR HALT I/O TRACE TABLE ENTRY 00361000 AIF (NOT &TRACE(9)).NTR2 @VA03431 00362000 HIOTRACE EQU * CP TRACE TABLE ENTRY FOR HIO @VA03431 00363000 TM TRACFLG2,TRACBEF I/O TRACING ACTIVE? @VA03431 00364000 BZ HIONOTRC NO -- RESTORE CC AND RETURN @VA03431 00365000 TRACE CODE=TRCHALT,R14,R1,R2 @V4075A0 00366000 STCM R15,8,1(R14) MOVE IN COND CODE @VA03431 00367000 NI 1(R14),X'30' . . . AND ONLY THE COND CODE @VA03431 00368000 STH R5,2(0,R14) SAVE THE REAL DEVICE ADDRESS @VA03431 00369000 ST R10,4(0,R14) IOBLOK ADDRESS, IF ANY @VA03431 00370000 MVC 8(4,R14),CAW CHANNEL ADDRESS WORD @VA03431 00371000 XC 12(4,R14),12(R14) CLEAR LAST WORD @VA03431 00372000 CLI 1(R14),X'10' CONDITION CODE ONE? @VA03431 00373000 BNE *+10 NO -- DO NOT MOVE IN CSW @VA03431 00374000 MVC 12(4,R14),CSW+4 MOVE IN CSW STATUS @VA03431 00375000 HIONOTRC EQU * RESTORE COND CODE, RETURN @VA03431 00376000 SPM R15 RESET COND CODE @VA03431 00377000 B 2(0,R15) SKIP OVER TRACE FLAG ON RETURN @VA03431 00378000 .NTR2 ANOP 00379000 EJECT 00380000 SCANALL STM R7,R8,TEMPSAVE SAVE THESE REGS @VA03150 00381000 NI VCUSTAT,255-VCUACTV RESET CU ACTIVE FLAG @VA03150 00382000 LA R4,2 LOAD INDEX INCREMENT @VA03150 00383000 LA R5,30 LOAD INDEX COMPARAND VALUE @VA03150 00384000 SR R3,R3 ZERO VCUDVTBL INDEX @VA03150 00385000 RESNDV LH R8,VCUDVTBL(R3) LOAD NEXT VDEVBLOK INDEX @VA03150 00386000 LTR R8,R8 DOES DEVICE EXIST ? @VA03150 00387000 BM RESXDV NO, INDEX TO NEXT ONE @VA03150 00388000 A R8,VMDVSTRT POINT TO VDEVBLOK @VA03150 00389000 TM VDEVSTAT,VDEVBUSY IS DEVICE BUSY ? @VA03150 00390000 BNO RESXDV NO, INDEX TO NEXT ONE @VA03150 00391000 TM VDEVTYPC,CLASTERM IS THIS A TERMINAL? @VA03150 00392000 BO RESXDV YES, SKIP IT AND CHECK NEXT DEV @VA03150 00393000 OI VCUSTAT,VCUACTV C U STILL ACTIVE THEN @VA03150 00394000 REACTIVE LH R1,VCHADD GET CHANNEL ADDRESS @VA03150 00395000 SRL R1,7 TIMES 2 @VA03150 00396000 L R15,=A(DMKVIOMK) ADDRESS THE MASK TABLE @VA05037 00397000 LH R1,0(R1,R15) PICK UP "TURN-ON" MASK @VA05037 00398000 O R1,VMIOACTV-2 ADD IT BACK @VA03150 00399000 STH R1,VMIOACTV CHANNEL STILL ACTIVE @VA03150 00400000 LM R7,R8,TEMPSAVE RESTORE REGS @VA03150 00401000 SR R4,R4 CLEAR REG BEFORE RETURN @VA07336 00402000 BR R14 RETURN @VA03150 00403000 RESNCU LH R7,VCHCUTBL(R2) LOAD NEXT VCUBLOK INDEX @VA03150 00404000 LTR R7,R7 DOES C U EXIST ? @VA03150 00405000 BM RESXCU NO - GET NEXT ONE @VA03150 00406000 A R7,VMCUSTRT POINT TO VCUBLOK @VA03150 00407000 TM VCUSTAT,VCUACTV IS C U ACTIVE ? @VA03150 00408000 BO REACTIVE RESET CHANNEL ACTIVE @VA03150 00409000 B RESXCU CONTINUE WITH NEXT CU @VA03150 00410000 RESXDV BXLE R3,R4,RESNDV BRANCH IF MORE DEVICES ON C U @VA03150 00411000 SR R2,R2 ZERO VCHCUTBL INDEX @VA03150 00412000 RESXCU BXLE R2,R4,RESNCU BRANCH IF MORE CONTROL UNITS @VA03150 00413000 LM R7,R8,TEMPSAVE RESTORE REGS @VA03150 00414000 SR R4,R4 CLEAR REG BEFORE RETURN @VA07336 00415000 BR R14 RETURN @VA03150 00416000 EJECT 00417000 STTOTCSW EQU * HERE TO STORE CSW @VA05104 00418000 LA R1,CSW GET VIRTUAL ADDRESS @VA05104 00419000 SL R6,VMCHSTRT CHAN DISPOSITION @VA05104 00420000 SL R7,VMCUSTRT CU DISPOSITION @VA05104 00421000 SL R8,VMDVSTRT DEV DISPOSITION @VA05104 00422000 TRANS 2,1,OPT=(BRING,DEFER) @VA05104 00423000 AL R6,VMCHSTRT RESTORE CHAN ADDRESS @VA05104 00424000 AL R7,VMCUSTRT RESTORE CU ADDRESS @VA05104 00425000 AL R8,VMDVSTRT RESTORE DEV ADDRESS @VA05104 00426000 SLL R5,16 MOVE CSW STATUS @VA05104 00427000 B STCSW GO STORE TOTAL CSW @VA05104 00428000 EJECT 00429000 STORECSW EQU * HERE TO STORE THE CSW 00430000 LA R1,CSW GET VIRTUAL ADDRESS 00431000 SL R6,VMCHSTRT CHAN. DISP @VA01770 00432000 SL R7,VMCUSTRT CU DISP @VA01770 00433000 SL R8,VMDVSTRT DEV DISP @VA01770 00434000 TRANS 2,1,OPT=(BRING,DEFER) GET USER PAGE 0 00435000 AL R6,VMCHSTRT RESTORE CHAN ADDR @VA01770 00436000 AL R7,VMCUSTRT RESTORE CU ADDR @VA01770 00437000 AL R8,VMDVSTRT RESTORE DEV ADDR @VA01770 00438000 STH R5,4(,R2) STORE STATUS -- 00439000 LTR R4,R4 SAVE ENTIRE CSW ?? 00440000 BZ *+8 NO -- 00441000 STCSW STM R4,R5,0(R2) STORE THE WHOLE THING @VA05104 00442000 TM 5(R2),CDC+CCC+IFCC ANY CHANNEL ERRORS ? @V508690 00443000 BZ NOCHAN NO, CONTINUE NORMAL PROCESSING @V508690 00444000 ICM R1,15,VDEVIOER GET ADDRESS OF IOERBLOK @V508690 00445000 BZ NOCHAN NO IOERBLOK, FORGET IT @V508690 00446000 CALL DMKCCHRF REFLECT CHANNEL ERROR TO VIRT. @V508690 00447000 * MACH. 00448000 NOCHAN EQU * @V508690 00449000 AIF (NOT &TRACE(9)).TR1 **AIF** 00450000 TM TRACFLG2,TRAC0D TRACING ACTIVE? 00451000 BZ NOTRAC1 BRANCH IF NOT 00452000 TRACE CODE=TRCCSW,R15,R14,R3 @V4075A0 00453000 MVC 1(1,R15),VMINST SAVE OPCODE OF IO INST. 00454000 STH R13,2(,R15) SAVE VIRTUAL DEVICE ADDRESS 00455000 ST R11,4(,R15) SAVE VMBLOK ADDRESS 00456000 MVC 8(8,R15),0(R2) SAVE CSW 00457000 NOTRAC1 EQU * 00458000 .TR1 ANOP 00459000 LA R2,X'10' SET CONDITION CODE ONE 00460000 SPACE 00461000 CLM R2,B'1100',VDEVINTS LAST INTERRUPT CLEARED ? 00462000 BNE VIOEXIT NO -- 00463000 LH R3,VDEVADD GET DEVICE ADDRESS (0-F) 00464000 AR R3,R3 MULTIPLY BY 2 00465000 L R15,=A(DMKVIOXK) ADDRESS THE UNFLAG TABLE @VA05037 00466000 LA R3,0(R3,R15) POINT TO UNFLAGGING MASK @VA05037 00467000 NC VCUDVINT,0(R3) UNFLAG INTERRUPTING DEVICE @VA01232 00468000 BNZ VIOEXIT MORE PENDING IN THE C.U. 00469000 LH R3,VCUADD GET CONTROL UNIT ADDRESS (00-F0) 00470000 SRL R3,3 TIMES 2 00471000 LA R3,0(R3,R15) POINT TO UNFLAGGING MASK @VA05037 00472000 NC VCHCUINT,0(R3) UNFLAG INTERRUPTING C.U. @VA01232 00473000 BNZ VIOEXIT MORE PENDING IN THE CHANNEL 00474000 LH R3,VCHADD GET CHANNEL ADDRESS (000-600) 00475000 SRL R3,7 TIMES 2 00476000 LA R3,0(R3,R15) POINT TO MASK ENTRY @VA05037 00477000 NC VMIOINT,0(R3) UNFLAG PENDING CHANNEL @VA07503 00478000 BNZ VIOEXIT MORE INTERRUPTS PENDING 00479000 SPACE 00480000 NI VMPEND,X'FF'-VMIOPND UNFLAG SUMMARY PENDING BIT 00481000 B VIOEXIT @VA10542 00482000 SPACE 3 00483000 * 00484000 * EXITS FROM DMKVSJEX 00485000 * 00486000 SPACE 3 00487000 VIOEXIT2 NI VDEVSTAT,255-VDEVCHBS RESET CHANNEL BUSY @VA10542 00488000 VIOEXIT EQU * 00489000 * 00490000 * TEST FOR A CONDITION CODE 3. IF FOUND, GO TO TEST 00491000 * FOR THE SITUATION WHERE A VIRTUAL DEVICE IS 00492000 * NOT YET DEFINED BECAUSE AN MSS MOUNT IS IN 00493000 * PROCESS 00494000 * 00495000 LA R0,CC3 CONDITION CODE 3 @V60B6B8 00496000 CR R0,R2 @V60B6B8 00497000 BE CHKMOUNT VIRT DEV NOT AVAIL, TEST FOR @V60B6B8 00498000 * MSS MOUNT 00499000 TESTEC EQU * @V60B6B8 00500000 TM VMESTAT,VMEXTCM EXTENDED CONTROL MACHINE ?? 00501000 BZ VIOSETC NO -- 00502000 EX R2,SETECC SET EC-MODE PSW CC 00503000 B VIOEXITX AND LEAVE 00504000 VIOSETC EQU * 00505000 EX R2,SETCC SET CONDITION CODE 00506000 SPACE 2 00507000 VIOEXITX EQU * FINISHED WITH SIMULATION 00508000 AIF (NOT &TRACE(6)).TRA3 **AIF** 00509000 TM VMTRCTL,VMTRSIO V.M. SIO TRACING WANTED ? 00510000 BZ VIOEXITY NOT TODAY. 00511000 SLR R10,R10 YES - SIGNAL NO IOBLOK TO BE USED, 00512000 LR R1,R13 VIRTUAL ADDRESS INTO R1 PLEASE 00513000 BAL R9,GETLOCK GET THE SYSTEM LOCK @VA09727 00514000 CALL DMKTRDSI CALL TRACE RTN SIO ENTRY POINT @V4M0240 00515000 .TRA3 ANOP 00516000 SPACE 00517000 VIOEXITY EQU * CONTINUE: 00518000 TM VMDSTAT,VMTIO VM IN TIO OR SIO BUSY LOOP ?? 00519000 BNO VIONWAIT NO- LEAVE DISPATCHABLE 00520000 CLI VDEVTYPC,CLASTERM SLOW SPEED TERMINAL DEVICE 00521000 BNE VIOGODSP NO- LEAVE NON-DISPATCHABLE 00522000 OI VMRSTAT,VMIDLE YES- DROP THE TERMINAL USER FROM Q 00523000 B VIOGODSP AND LEAVE NON-DISPATCHABLE 00524000 SPACE 00525000 VIONWAIT NI VMRSTAT,X'FF'-VMEXWAIT TAKE OUT OF SIMULATION WAIT 00526000 AIF (NOT &AP).APCHK5 00527000 TM APSTAT1,APUOPER RUNNING AN AP SYSTEM? @VA08305 00528000 BNO FASTDSP NO, FAST DISPATCH @VA08305 00529000 L R15,=A(DMKLOKSY+2) POINT AT SYSTEM LOCK @VA08305 00530000 CLC LPUADDR,0(R15) IS THE LOCK ALREADY HELD @VA08305 00531000 BNE FASTDSP NO, CANNOT EXIT TO MAIN @VA08305 00532000 L R15,PREFIXB ACCESS OTHER PSA @VA09257 00533000 TM XCPEND-PSA(R15),XCDISP DISPATCH PENDING? @VA09257 00534000 BZ CKRQ NO DISPATCH PENDING. @VA09257 00535000 LOCK RELEASE,TYPE=SYS YES,RELEASE GLOBAL LOCK. @VA09257 00536000 B FASTDSP FAST REDISPATCH @VA09257 00537000 SPACE 00538000 CKRQ DS 0H @VA09257 00539000 L R15,=A(DMKDSPRQ) STACKED REQUEST BLOCK POINTER @V408246 00540000 C R15,IOBFPNT-IOBLOK(,R15) ANY PRESENTS WAITING @V408246 00541000 * FROM IOS? 00542000 BNE VIOGODSP YES, BETTER CHECK ON THEM @V408246 00543000 .APCHK5 ANOP 00544000 SPACE 00545000 FASTDSP GOTO DMKDSPA FAST RESTART @VA08305 00546000 SPACE 00547000 VIOGODSP EQU * 00548000 GOTO DMKDSPCH AND TO TO DISPATCH 00549000 EJECT 00550000 * 00551000 * SUBROUTINE USED BY DMKVSI AND DMKVSJ 00552000 * EXIT FROM THE ROUTINE IS ON REG 9 00553000 * 00554000 GETLOCK EQU * TEST IF LOCK ALREADY HELD @VA08305 00555000 AIF (NOT &AP).APCHK6 00556000 TM APSTAT1,APUOPER IS THIS AN AP SYSTEM? @VA08305 00557000 BNOR R9 NO, RETURN TO CALLER @VA08305 00558000 L R15,=A(DMKLOKSY) GET ADDRESS OF SYSTEM LOCK @VA08305 00559000 L R15,0(R15) PICK UP THE LOCK WORD @VA08305 00560000 LH R14,LPUADDR AND PROCESSOR ID @VA08305 00561000 CR R14,R15 IS THE SYSTEM LOCK HELD? @VA08305 00562000 BCR 8,R9 YES,LOCK HELD @VA08305 00563000 LTR R15,R15 IS THE LOCK AVAILABLE @VA08305 00564000 BNZ DEFEREX NO, DON'T WASTE TIME TRYING @VA08305 00565000 LOCK OBTAIN,TYPE=SYS,SPIN=NO,SAVE @VA08305 00566000 BCR 8,R9 GOT THE LOCK, RETURN TO CALLER @VA08305 00567000 DEFEREX L R15,VMDFTPNT LOCK NOT OBTAINABLE.... @VA08305 00568000 USING CPEXBLOK,R15 GET DEFERRED EXECUTION-BLOCK, @VA08305 00569000 STM R0,R14,CPEXREGS SAVE CALLERS REGS @VA08305 00570000 LA R14,LOCKRTN GET ADDR OF EXECUTION RETURN PT @VA08305 00571000 ST R14,CPEXADD AND EXECUTION RETURN POINT @VA08305 00572000 DROP R15 IS IN REG 14 @VA08305 00573000 LR R1,R15 AND DEFER EXECUTION OF @VA08305 00574000 CALL DMKSTKDE @VA08305 00575000 GOTO DMKDSPRU @VA08305 00576000 LOCKRTN DS 0H DEFERRED EXECUTION RETURN POINT @VA08305 00577000 LCTL C1,C1,VMSEG RELOAD CONTROL REG 1 AFTER DEFER @VA08305 00578000 .APCHK6 ANOP 00579000 BR R9 RETURN TO CALLER @VA08305 00580000 SPACE 2 00581000 SETCC OI VMPSW+4,0 EXECUTED TO SET CONDITION CODE 00582000 SETECC OI VMPSW+2,0 EXECUTED TO SET CC IN EC-MODE PSW 00583000 CC3 EQU X'30' CONDITION CODE 3 @V60B6B8 00584000 EJECT 00585000 CHKMOUNT EQU * @V60B6B8 00586000 * 00587000 * AT THIS POINT WE ARE ABOUT TO RETURN TO THE CALLER 00588000 * WITH A CONDITION CODE 3 (DEVICE NOT AVAILABLE). 00589000 * IF THE MSS IS IN THE SYSTEM, THE DEVICE MAY 00590000 * BE "NOT AVAILABLE" BECAUSE AN MSS MOUNT IS IN 00591000 * PROCESS. IF THAT IS THE CASE, STACK THIS VIRTUAL 00592000 * REQUEST UNTIL THE MOUNT COMPLETES. 00593000 * 00594000 TM PSAMSS,MSSPRES IS THE MSS IN THIS SYSTEM @V60B6B8 00595000 BZ TESTEC NO, STANDARD RETURN @V60B6B8 00596000 L R3,=V(DMKSSSMQ) WAIT Q FOR MSS MOUNTS @V60B6B8 00597000 L R3,0(R3) PICK UP ACTUAL QUEUE @V60B6B8 00598000 USING OSVSCOM,R3 ASSEMBLER ADDRESSABILITY @V60B6B8 00599000 TESTCOM EQU * IS THERE A MSSCOM BLOCK @V60B6B8 00600000 LTR R3,R3 IS THE CHAIN PTR 0 @V60B6B8 00601000 BZ TESTEC YES, WERE NOT WAITING ON MSS @V60B6B8 00602000 CLC VMUSER(VMUSERL),MSSUSER ARE WE WAITING @V60B6B8 00603000 BNE NXTCOM NOT ON THIS BLOCK @V60B6B8 00604000 L R4,MSSTASK1 TASK THAT IS WAITING @V60B6B8 00605000 CH R13,CPEXMISC-CPEXBLOK(R4) VIRT DEV WAITING @V60B6B8 00606000 BNE NXTCOM THIS VIRT DEV NOT WAITING @V60B6B8 00607000 LA R0,CPEXSIZE SIZE OF A CPEXBLOK @V60B6B8 00608000 CALL DMKFREE GET DYNAMIC STORAGE @V60B6B8 00609000 USING CPEXBLOK,R1 @V60B6B8 00610000 ST R1,MSSTASK3 @VMI2006 00611000 STM R0,R15,CPEXREGS SAVE REGS FOR LATER DISPATCH @V60B6B8 00612000 L R0,=A(DMKVSIEX) REDISPATCH ADDRESS @VA12128 00613000 ST R0,CPEXADD FIELD FOR DISPATCHER LATER @V60B6B8 00614000 ST R0,CPEXR12 FIELD FOR DMKVSI BASE LATER @VA12128 00615000 ST R13,CPEXMISC SAVE VADDR WHICH IS WAITING @V60B6B8 00616000 GOTO DMKDSPCH WAIT FOR THE MSS @V60B6B8 00617000 DROP R1 @V60B6B8 00618000 NXTCOM EQU * GET NEXT MSSCOM BLOCK @V60B6B8 00619000 L R3,MSSNEXT CHAIN PTR @V60B6B8 00620000 B TESTCOM SEE IF THERE IS ONE @V60B6B8 00621000 DROP R3 @V60B6B8 00622000 VMUSERL EQU 8 LENGTH OF VMUSER FIELD @V60B6B8 00623000 EJECT 00624000 DMKVSJHI DC F'0' COUNT OF VIRT. HIO'S @VA12128 00625000 DMKVSJHD DC F'0' COUNT OF VIRT. HDV'S @VA12128 00626000 DMKVSJCC DC F'0' COUNT OF VIRTUAL CLCH'S @VA12128 00627000 SPACE 00628000 LTORG 00629000 EJECT 00630000 COPY VBLOKS @VA04320 00631000 OSVSCOM MSSCOM @V60B6B8 00632000 COPY VCTCA @VA04320 00633000 COPY RBLOKS @VA04320 00634000 COPY VMBLOK @VA04320 00635000 COPY TREXT @VA04320 00636000 COPY IOBLOKS @VA04320 00637000 COPY IOER @VA04320 00638000 PSA @VA04320 00639000 COPY DEVTYPES @VA04320 00640000 COPY EQU @VA04320 00641000 COPY SAVE @VA08305 00642000 END DMKVSJ @VA04320 00643000