VSI TITLE 'DMKVSI (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 VALIDATE SERIALIZATION OF INPUT 00002000
*. 00003000
* MODULE NAME - 00004000
* 00005000
* DMKVSI 00006000
* 00007000
* FUNCTION - 00008000
* 00009000
* TO SIMULATE THE OPERATION OF PRIVILEGED I/O INSTRUCTIONS 00010000
* ISSUED BY VIRTUAL MACHINES 00011000
* 00012000
* ATTRIBUTES - 00013000
* 00014000
* REENTRANT, RESIDENT, ENTERED VIA GOTO FROM DMKPRVLG FOR THE 00015000
* SIMULATION OF AN INSTRUCTION 00016000
* 00017000
* ENTRY POINTS - 00018000
* 00019000
* DMKVSIEX - SIMULATE A SIO, TIO, HIO, TCH, OR CLCH 00020000
* (HIO AND CLCH ARE PROCESSED BY DMKVSJ) 00020200
* 00020400
* DMKVSICH - RE-ENTRY FROM DMKVSJ TO PROCESS CLCH AS A TCH 00020600
* 00021000
* ENTRY CONDITIONS - 00022000
* 00023000
* FOR DMKVSIEX - 00024000
* GPR11 = ADDRESS OF USER'S VMBLOK 00025000
* GPR12 = DMKVSIEX BASE 00026000
* THE FIELD VMINST IN THE USER'S VMBLOK CONTAINS THE I/O 00027000
* INSTRUCTION TO BE SIMULATED 00028000
* 00029000
* NOTE THAT GPR13 DOES NOT POINT TO A SAVEAREA 00030000
* 00030100
* FOR DMKVSICH - 00030200
* GPR12 = DMKVSIEX BASE 00030300
* ALL OTHER REGISTERS CONTAIN THE SAME VALUES THAT THEY 00030400
* HAD IN DMKVSJ 00030500
* 00031000
* EXIT CONDITIONS - 00032000
* 00033000
* FOR DMKVSIEX - NORMAL 00034000
* THE CORRECT STATUS AND CONDITION CODES ARE REFLECTED TO THE 00035000
* VIRTUAL MACHINE, AND, IF APPROPRIATE, THE I/O IS STARTED 00036000
* 00037000
* DMKVSI BRANCHES TO DMKVSJ FOR SUBROUTINES AND FOR 00038000
* EXIT PROCESSING AND HIO AND CLCH SIMULATION 00038200
* 00038400
* 00038600
* 00039000
* CALLS TO OTHER ROUTINES - 00040000
* 00041000
* DMKCCWTR - TO TRANSLATE THE USER'S CHANNEL PROGRAM 00043000
* DMKFREE - TO OBTAIN FREE STORAGE FOR IOBLOKS 00044000
* DMKFRET - TO RETURN USED IOBLOKS TO FREE STORAGE 00045000
* DMKIOSQV - TO SCHEDULE THE VIRTUAL OPERATION 00046000
* DMKVCAST - TO SIMULATE A START I/O TO A VIRTUAL CTCA 00047000
* DMKVCATS - TO SIMULATE A TEST I/O TO A VIRTUAL CTCA 00048000
* DMKSTKIO - TO STACK AN INTERRUPT DUE TO THE COMPLETION OF A 00050000
* VIRTUAL ENABLE CAUSED BY A HIO 00051000
* DMKDSPCH - EXIT VIA GOTO AFTER I/O IS SCHEDULED BY DMKIOSQV 00052000
* DMKVCNEX - EXIT VIA GOTO TO SIMULATE VIRTUAL 1052 CONSOLE 00056000
* DMKVSCVR - TO VERIFY THAT THE NOTRANS OPTION IS VALID 00056100
* DMKVSPTO - TO SIMULATE A TIO TO A UNIT RECORD INPUT DEVICE 00057000
* DMKSCHDL - TO DROP A USER FROM Q 00058000
* DMKVIOC1 - TO REFLECT CONDITION CODE 1 CSW STATUS 00059000
* DMKVIOIN - IOB INTERRUPT RETURN ADDRESS (IOBIRA) 00060000
* DMKVSJEX - TO HANDLE HIO AND CLCH AND SUBROUTINES 00061000
* 00062000
* EXTERNAL REFERENCES - 00063000
* 00064000
* NONE 00065000
* 00066000
* TABLES / WORKAREAS - 00067000
* 00068000
* VCHBLOK,VCUBLOK, AND VDEVBLOK ARE REFERENCED AND UPDATED 00069000
* 00070000
* REGISTER USAGE - 00071000
* 00072000
* GPR0 = CONDITION CODE RETURNED FROM DMKSCNVU 00073000
* GPR1 = SCRATCH - OR USED FOR DEDICATED CHANNEL SUPPORT 00074000
* GPR2 = SCRATCH - OR USED FOR DEDICATED CHANNEL SUPPORT 00075000
* GPR3 = ADDRESS OF VBLOK THAT CONTAINS SUBCHANNEL STATUS 00076000
* GPR4 = CSW STATUS TO BE STORED 00077000
* GPR5 = INTERNAL SUBROUTINE LINKAGE 00078000
* GPR6 = VCHBLOK BASE 00079000
* GPR7 = VCUBLOK BASE 00080000
* GPR8 = VDEVBLOK BASE 00081000
* GPR9 = VIRTUAL DEVICE ADDRESS 00082000
* GPR10 = IOBLOK BASE 00083000
* GPR11 = VMBLOK BASE 00084000
* GPR12 = DMKVSI BASE 00085000
* GPR13 NOT USED 00086000
* GPR14 = EXTERNAL LINKAGE 00087000
* GPR15 = EXTERNAL LINKAGE 00088000
EJECT 00089000
* 00090000
* NOTES - 00091000
* 00092000
* OPERATION - 00093000
* 1. SET CONDITION CODE IN VIRTUAL PSW TO ZERO 00094000
* 2. CALCULATE VIRTUAL UNIT ADDRESS USING REGISTER AND DISPLACE- 00095000
* MENT VALUES PASSED BY PRIVILEGED IN VMINST 00096000
* 3. CALL DMKSCNVU TO LOCATE VCHBLOK, VCUBLOK, AND VDEVBLOK, 00097000
* AND SAVE THE RESULTING CONDITION IN GPR0 00098000
* 4. BRANCH TO HANDLE SIO, TIO, AND TCH, DESCRIBED 00099000
* IN SECTIONS A-C RESPECTIVELY. 00099500
* 5. BRANCH TO DMKVSJ FOR SUBROUTINES AND EXIT PROCESSING 00100000
* AND TO SIMULATE HIO AND CLCH 00100500
*. 00101000
EJECT 00102000
COPY OPTIONS 00103000
COPY LOCAL OPTIONS 00104000
SPACE 2 00105000
DMKVSI CSECT 00106000
ENTRY DMKVSIEX,DMKVSICT,DMKVSICW 00107000
ENTRY DMKVSISI COUNT OF SIO (9C00) INSTRUCTIONS @V2B2638 00108000
ENTRY DMKVSISF COUNT OF SIOF (9CX1) INSTRUCTIONS@V2B2638 00109000
ENTRY DMKVSITI COUNT OF TIO (9DX0) INSTRUCTIONS @V2B2638 00110000
ENTRY DMKVSICI COUNT OF CLRIO (9DX1) @V2B2638 00111000
* INSTRUCTIONS 00112000
ENTRY DMKVSITC COUNT OF TCH (9FXX) INSTRUCTIONS @V2B2638 00115000
ENTRY DMKVSIVS INTERNAL SYM. 'VSIO'(FOR EVMA) @V386198 00116000
ENTRY DMKVSICH FROM VSJ TO PROC CLCH AS A TCH @VA14370 00116100
EXTRN DMKVIOMK @VA12128 00117000
EXTRN DMKVIOIN 00118000
EXTRN DMKVIOC1 00119000
EXTRN DMKSCHDL 00120000
EXTRN DMKCCWTR 00121000
EXTRN DMKIOSQV 00122000
EXTRN DMKSTKIO 00123000
EXTRN DMKSCNVU 00124000
EXTRN DMKVCAST,DMKVCATS @VA12128 00125000
EXTRN DMKVSPEX,DMKVSPTO @VA03503 00126000
EXTRN DMKVCNEX 00127000
EXTRN DMKVSJEX @VA12128 00128000
EXTRN DMKDSPCH @VA12128 00128500
AIF (NOT &VIRREAL).NOVR1 **AIF** 00129100
EXTRN DMKVSCVR @VA09586 00129200
.NOVR1 ANOP 00129300
AIF (NOT &TRACE(6)).TRA1 **AIF** 00130000
EXTRN DMKTRDSI @V4M0240 00131000
.TRA1 ANOP 00132000
AIF (NOT &AP).LOKSY4 00133000
EXTRN DMKLOKSY,DMKDSPRU @VA08305 00134000
.LOKSY4 ANOP 00135000
EXTRN DMKSTKDE,DMKSTKOP,DMKSTKMP @VA08305 00136000
SPACE 2 00137000
USING PSA,R0 00138000
USING VCHBLOK,R6 00139000
EXTRN DMKDSPA @V408246 00140000
EXTRN DMKDSPRQ @V408246 00141000
USING VCUBLOK,R7 00142000
USING VDEVBLOK,R8 00143000
USING IOBLOK,R10 00144000
USING VMBLOK,R11 00145000
USING DMKVSIEX,R12 00146000
EJECT 00147000
*. 00148000
*********************************************************************** 00149000
* 00150000
* 00151000
* EXPANDED VMA PARTIAL EMULATION FUNCTION FOR SIO AND SIOF: 00152000
* 00153000
* INVOKED BY THESE INSTRUCTIONS WHEN EXECUTED IN PROBLEM STATE 00154000
* WITH CONTROL REGISTER 6 BYTE 0 SET TO B'10XXXX1X' (X = 0 OR 1) 00155000
* AND BIT 3 OF THE ASSIST CONTROLS FULLWORD (OFFSET X'14' 00156000
* INTO THE MICBLOK) SET TO 1. 00157000
* 00158000
* REGISTER INPUT: 00159000
* CR 6 = BITS 0-7 ARE THE ASSIST FLAGS; BITS 8-28 ADDRESS 00160000
* THE MICBLOK (THE VIRTUAL MACHINE POINTER LIST) 00161000
* 00162000
* SYSTEM DATA AREAS REFERENCED (BY MODULE WHERE APPLICABLE): 00163000
* DMKPRV - 'DMKPRVMA' (EQUALS 'VMALIST') 00164000
* DMKPSA - 'AVMALIST', 'PRNPSW', CPCREGS, TIMER FIELDS, 00165000
* TRACING INFORMATION, 'CPSTATUS', 'PROPSW' 00166000
* MICBLOK, VCHBLOK, VCUBLOK, VDEVBLOK, VMBLOK 00167000
* 00168000
* 00169000
* 00170000
* EXIT TO 'DMKVSIVS' (PATH AVAILABLE AND NO INTERRUPTS PENDING) 00171000
* NOTE: THE CONTENT OF ANY UNSPECIFIED GPR IS UNPREDICTABLE 00172000
* REGISTER OUTPUT: 00173000
* CR 0 = VALUE FROM 'CPCREG0' 00174000
* CR 8 = VALUE FROM 'CPCREG8' 00175000
* GPR 3 = ADDRESS OF EITHER VCHBLOK, VCUBLOK, OR VDEVBLOK 00176000
* GPR 4 = ZERO 00177000
* GPR 6 = ADDRESS OF THE VCHBLOK 00178000
* GPR 7 = ADDRESS OF THE VCUBLOK 00179000
* GPR 8 = ADDRESS OF THE VDEVBLOK 00180000
* GPR 11 = X'A8' LESS THAN 'MICVPSW' (ADDRESS OF VMBLOK) 00181000
* GPR 12 = ADDRESS OF 'DMKVSIEX' 00182000
* GPR 13 = VIRTUAL DEVICE ADDRESS (RIGHT JUSTIFIED) 00183000
* 00184000
* EXIT TO 'DMKVSIEX' (COULDN'T FIND AN AVAILABLE PATH TO DEVICE) 00185000
* REGISTER OUTPUT: 00186000
* CR 0,8 AND GPR 11,12 SAME AS FOR EXIT TO 'DMKVSIVS' 00187000
* 00188000
*********************************************************************** 00189000
*. 00190000
SPACE 00191000
DMKVSIEX DS 0D %V386198 00192000
NI VMPSW+2,X'FF'-X'30' SET CC = 0 %V386198 00193000
NI VMPSW+4,X'FF'-X'30' SET CC = 0 %V386198 00194000
NI VMDSTAT,X'FF'-VMTIO REMOVE TIO-BUSY FLAG %V386198 00195000
SR R4,R4 SET CSW-STORE SW TO STATUS ONLY %V386198 00196000
CLI VMINST,X'83' DIAG CONSOLE WRITE ?? %V200730 00197000
BE DIAGDEV YES, GO FIND CNTROL BLOCKS %V2B2638 00198000
L R1,VMINST I/O INSTRUCTION BEING EXECUTED %VA01382 00199000
N R1,F4095 KEEP ONLY DISPLACEMENT %V386198 00200000
IC R8,VMINST+2 PICK UP REGISTER NUMBER %V386198 00201000
N R8,F240 KEEP ONLY REGISTER NUMBER %V386198 00202000
BZ DIAGDEV NO REGISTER SPECIFIED %VA01382 00203000
SRL R8,2 GET REGISTER NUMBER X 4 %V386198 00204000
AH R1,VMGPRS+2(R8) COMPUTE DEVICE ADDRESS %V386198 00205000
DIAGDEV LR R13,R1 SAVE DEV ADDRESS %V200730 00206000
CALL DMKSCNVU GO GET VCH, VCU, AND VDEV BLOKS %V386198 00207000
BALR R0,0 PRESERVE CONDITION CODE %V386198 00208000
SPACE 2 00209000
BAL R9,GETLOCK GET SYSTEM LOCK @VA09728 00209100
USING *,R9 NEW ADDRESSABILITY TO HERE @VA12128 00209200
L R12,ADMKVSI RESTORE BASE REG @VA12128 00209300
DROP R9 IT WAS ONLY TEMPORARY @VA12128 00209400
USING DMKVSI,R12 STANDARD ADDRESSABILITY @VA12128 00209500
LA R2,X'30' COND CODE IF DEVICE NOT FOUND %VA01527 00210000
LA R1,1 INCREMENT VALUE %V2B2638 00211000
AL R1,DMKVSICT ADD CALLS TO DMKVSIEX %V2B2638 00212000
ST R1,DMKVSICT AND SAVE %V2B2638 00213000
LA R1,1 INCREMENT VALUE FOR LATER %V2B2638 00214000
SPACE 00215000
CLI VMINST,X'9D' SIO OR TIO ? %V386198 00216000
BL VIOSIO START I/O %V386198 00217000
BE VIOTIO TEST I/O 00218000
CLC VMINST(2),TCHOPER HIO OR TCH? @VMD0117 00219000
BL VIOHIO HALT I/O 00220000
BE VIOTCH TEST CHANNEL @VMD0117 00221000
BH VIOCLCH CLEAR CHANNEL @VMD0117 00222000
EJECT 00223000
*. 00224000
* A. VIRTUAL SIO SIMULATION - 00225000
* 1. IF ALL BLOCKS WERE NOT FOUND, SET VIRTUAL CONDITION 00226000
* CODE 3 AND EXIT. 00227000
* 3. IF THE ADDRESSED SUBCHANNEL IS BUSY OR HAS CE PENDING, 00228000
* SET VIRTUAL CONDITION CODE 2 AND EXIT. 00229000
* 4. IF THE ADDRESSED CU OR DEVICE IS BUSY OR HAS STATUS 00230000
* PENDING, OR, FOR MINIDISKS, IF THE DEVICE IS RESERVED 00231000
* BY ANOTHER USER, STORE STATUS, SET VIRTUAL CC 1, AND EXIT. 00232000
* 5. IF THE PATH TO THE DEVICE IS FREE, TRANS FOR USER'S 00233000
* PAGE 0, AND LOAD HIS VIRTUAL CAW; THEN BASED ON THE 00234000
* VIRTUAL DEVICE TYPE, PROCESS AS FOLLOWS- 00235000
* 6. -IF THE DEVICE IS A TERMINAL, GOTO DMKVCNEX TO SIMULATE 00236000
* THE OPERATION. 00237000
* -IF THE DEVICE IS NON-DEDICATED U/R, GOTO DMKVSPEX 00238000
* TO SIMULATE THE OPERATION. 00239000
* -OTHERWISE, CONSTRUCT AN IOBLOK, STORE THE DEVICE 00240000
* ADDRESS AND CAW, AND CALL DMKCCWTR. 00241000
* 7. IF THE OPERATION IS AN ENABLE TO A VIRTUAL 270X LINE, 00242000
* LET THE IOBLOK STAY ON THE VDEVBLOK FOR THE 'DIAL' CMD. 00243000
* 8. IF THE OPERATION IS DIRECTED AT A VIRTUAL CTCA, CALL 00244000
* DMKVCAST TO SIMULATE THE DEVICE OPERATIONS. 00245000
* 9. OTHERWISE, PLACE THE USER IN IOWAIT AND CALL DMKIOSQV 00246000
* TO SCHEDULE THE REAL I/O OPERATION. 00247000
* 10. EXIT VIA GOTO DMKDSPCH. 00248000
*. 00249000
SPACE 00250000
VIOSIO EQU * %V386198 00251000
CLI VMINST,X'9C' IS IT AN SIO? %V2B2638 00252000
BNE VIOSIO1 NOPE, MUST BE DIAG. %V2B2638 00253000
TM VMINST+1,X'01' IS IT AN SIOF? %V2B2638 00254000
BO SIOF YUP, BR. %V2B2638 00255000
AL R1,DMKVSISI ADD SIO COUNT %V2B2638 00256000
ST R1,DMKVSISI AND RE-STORE %V2B2638 00257000
B VIOSIO1 CONTINUE %V2B2638 00258000
SPACE 00259000
SIOF AL R1,DMKVSISF ADD SIOF COUNT TO INCREMENT %V2B2638 00260000
ST R1,DMKVSISF AND RE-STORE %V2B2638 00261000
SPACE 00262000
VIOSIO1 EQU * HERE WHEN COUNTS ARE BUMPED %V2B2638 00263000
SPM R0 RESTORE COND. CODE FROM DMKSCNVU %V386198 00264000
BNZ VIOEXIT EXIT WITH CC = 3 - DEV NOT FOUND %VA01527 00265000
C R11,AVMREAL V=R USER? @VA08664 00266000
BNE NEEDLOCK NO, MUST HAVE LOCK @VA09201 00266300
CLC VMINST(2),=X'9C01' IS THIS SIOF ? @VA09201 00266600
BNE NEEDLOCK NO, NEED LOCK @VA09201 00266900
TM VDEVSTAT,VDEVDED DEDICATED DEVICE ? @VA09201 00267200
BO VIOSIO2 YES, BYPASS LOCKING @VA09201 00267500
NEEDLOCK EQU * @VA09201 00267800
BAL R9,GETLOCK NO, GO GET THE SYSTEM LOCK @VA08664 00268000
USING *,R9 NEW ADDRESSABILITY TO HERE @VA12128 00268200
L R12,ADMKVSI RESTORE BASE REG @VA12128 00268400
DROP R9 IT WAS ONLY TEMPORARY @VA12128 00268600
USING DMKVSI,R12 STANDARD ADDRESSABILITY @VA12128 00268800
VIOSIO2 EQU * @VA08664 00269000
LR R10,R5 SAVE CCW ADDRESS FROM HVC @VA08664 00270000
BAL R9,CHSCAN IS CHANNEL BUSY OR CE PENDING ? %V386198 00272000
LA R2,X'20' CC IF NOT BUSY, CE PENDING %V386198 00273000
BNZ VIOEXIT CE PENDING - SET CC=2 AND EXIT %V386198 00274000
SPACE 00275000
BAL R9,CUSCAN CHECK IF CU BUSY OR CUE PENDING %V386198 00276000
BO SIOCUE NOT BUSY, CUE PENDING %V386198 00277000
SPACE 00278000
BAL R9,DEVSCAN IS DEVICE BUSY OR INT PENDING ? %V386198 00279000
EJECT 00283000
* 00284000
* RETURN IS HERE IF PATH TO DEVICE IS NOT BUSY AND 00285000
* NO INTERRUPTS ARE PENDING 00286000
* 00287000
CLI VMINST,X'83' DIAG SIO TO CONSOLE ?? %V200730 00288000
BNE VSIO NO, REGULAR SIO %V200730 00289000
LR R2,R10 GET CCW ADDRESS @VA08305 00290000
B TSTDED1 TEST FOR DED CHAN @V200730 00291000
SPACE 00292000
VSIO DS 0H @V200730 00293000
DMKVSIVS EQU VSIO FOR USE AS ENTRY IN EVMA LIST @V386198 00294000
LA R1,CAW LOGICAL ADDRESS OF USER'S CAW 00295000
SL R6,VMCHSTRT CHAN. DISP. @VA01770 00296000
SL R7,VMCUSTRT C.U. DISP. @VA01770 00297000
SL R8,VMDVSTRT DEV. DISP @VA01770 00298000
TRANS 2,1,OPT=(BRING,DEFER) GET USER'S PAGE 0 00299000
AL R6,VMCHSTRT RESTORE VCHANBLOKADDR @VA01770 00300000
AL R7,VMCUSTRT RESTORE CU ADDR @VA01770 00301000
AL R8,VMDVSTRT RESTORE DEV. ADDR @VA01770 00302000
BAL R9,LOADER3 GO RECALC ADDR IN R3 @VA13211 00302500
L R2,0(,R2) GET LOGICAL ADDRESS OF USER'S 1ST 00303000
* CCW 00304000
TSTDED1 DS 0H @V200730 00305000
TM VDEVSTAT,VDEVDED DO WE HAVE A DEDICATED DEVICE 00306000
BO GETIOB YES, GO PERFORM REAL I/O 00307000
SPACE 1 00309000
TM VDEVTYPC,CLASTERM IS IT A TERMINAL DEVICE ? 00310000
BZ TESTUR NO -- CHECK FOR UNIT RECORD 00311000
CLI VDEVTYPE,TYP3210 IS IT A CONSOLE ?? 00312000
BNE GETIOB NO - MUST BE ENABLE TO NON-DEDICATED LINE 00313000
GOTO DMKVCNEX DMKVCNEX HANDLES USER CONSOLE IO 00314000
SPACE 2 00315000
TESTUR TM VDEVTYPC,CLASURI+CLASURO IS IT A UNIT RECORD DEVICE ?? 00316000
BZ GETIOB NO -- IO DONE VIA DMKCCWTR 00317000
GOTO DMKVSPEX DMKVSPEX HANDLES SPOOLED UNIT 00318000
* RECORD IO 00319000
EJECT 00320000
GETIOB EQU * 00321000
OI VDEVSTAT,VDEVBUSY+VDEVCHBS FLAG DEVICE AND CHANNEL 00322000
OI VCHSTAT-VCHBLOK(R3),VCHBUSY MARK THE SUBCHANNEL BUSY 00323000
OI VCUSTAT,VCUBUSY CONTROL UNIT IS BUSY @VA01700 00324000
TM VCHTYPE,VCHBMX BMX CHANNEL ? @VA03150 00325000
BNO IOBFREE NO - DON'T FLAG C U @VA03150 00326000
OI VCUSTAT,VCUACTV FLAG CONTROL UNIT ACTIVE @VA03150 00327000
TM VDEVTYPC,CLASTERM IS THIS A TERMINAL DEVICE? @VA03150 00328000
BNO IOBFREE NO...CONTROL UNIT WILL BE ACTIVE @VA03150 00329000
NI VCUSTAT,255-VCUACTV RESET ACTIVE FLAG @VA03150 00330000
SPACE 00331000
IOBFREE LA R0,IOBSIZE GET CORE 00332000
CALL DMKFREE FOR AN IOBLOK 00333000
LR R10,R1 USE GPR 10 FOR ADDRESSABILITY 00334000
XC IOBLOK(IOBSIZE*8),IOBLOK CLEAR THE IOBLOK 00335000
ST R10,IOBLINK IOBLOK POINTS TO ITSELF (= ORIGINAL COPY) 00336000
* 00337000
* 00338000
OI IOBFLAG,IOBRELCU RELEASE CU @VA01700 00339000
SPACE 00340000
STH R13,IOBVADD SAVE VIRTUAL DEVICE ADDRESS 00341000
L R1,=A(DMKVIOIN) 00342000
ST R1,IOBIRA AND STORE IN IOBLOK 00343000
ST R2,IOBCAW SAVE VIRTUAL ADDRESS OF FIRST CCW 00344000
ST R10,VDEVIOB SAVE ADDRESS OF IOBLOK 00345000
AIF (NOT &VIRREAL).NOVR3 **AIF** 00346000
C R11,AVMREAL IS REQUEST FOR VIRT=REAL USER 00347000
BNE CCWTR NO, TRANSLATE CCW'S @VA09201 00348100
TM VMPSTAT,VMNOTRAN DOES USER WANT CCW TRANSLATION 00349000
BZ CCWTR2 YES, CALL DMKCCW 00350000
CALL DMKVSCVR SEE IF TRANSLATION IS NECESSARY @VA09586 00351000
LTR R15,R15 CHECK RETURN CODE @VA09586 00352000
BZ NOCCWTR2 NO TRANSLATION IS NECESSARY @VA09586 00353000
.NOVR3 ANOP 00354000
EJECT 00442000
CCWTR2 BAL R9,GETLOCK MUST HAVE THE SYSTEM LOCK @VA08305 00443000
USING *,R9 NEW ADDRESSABILITY TO HERE @VA12128 00443100
L R12,ADMKVSI RESTORE BASE REG @VA12128 00443200
DROP R9 IT WAS ONLY TEMPORARY @VA12128 00443300
USING DMKVSI,R12 STANDARD ADDRESSABILITY @VA12128 00443400
CCWTR EQU * @VA09201 00443500
ST R11,IOBMISC FLAG IOB AS PROCESSED BY CCWTRANS@VA08305 00444000
LA R9,0(,R2) IOBCAW (LESS HIGH-ORDER BYTE) INTO R9, 00445000
SL R6,VMCHSTRT MAKE R6 RELATIVE, CHAN. DISP @VA03811 00446000
SL R7,VMCUSTRT MAKE R7 RELATIVE, C.U. DISP @VA03811 00447000
SL R8,VMDVSTRT AND MAKE R8 "RELATIVE" FOR DMKCCW 00448000
L R1,DMKVSICW GET TOTAL CCWTRANS CALL COUNT 00449000
AL R1,F1 BUMP 00450000
ST R1,DMKVSICW AND SAVE 00451000
CALL DMKCCWTR GO TRANSLATE THE CHANNEL PROGRAM 00452000
AL R6,VMCHSTRT RESTORE VCHANNEL BLOCK ADDRESS @VA03811 00453000
AL R7,VMCUSTRT RESTORE VCONTROL UNIT ADDRESS @VA03811 00454000
AL R8,VMDVSTRT NOW LET R8 = A(VDEVBLOK) AGAIN 00455000
BAL R9,LOADER3 GO RECALC ADDR IN R3 @VA13211 00455500
TM IOBSPEC2,IOBCLN CLEANUP JOB FOR CCWTR ?? @VA07728 00456000
BZ NOCCWTR2 NOPE, GOOD, BR. @V407438 00457000
* NOTE: R3 STILL POINTS TO AFFECTED SUBCHANNEL, R4 = 0 FOR STORECSW 00458000
LA R0,IOBSIZE SIZE OF THE IOB @V407438 00459000
LR R1,R10 IOB ADDRESS TO R1 @V407438 00460000
CALL DMKFRET THROW IT AWAY @V407438 00461000
SLR R10,R10 NO MORE IOB @V407438 00462000
NI VDEVSTAT,X'FF'-(VDEVBUSY+VDEVCHBS) UNFLAG DEVICE@V407438 00463000
NI VCHSTAT-VCHBLOK(R3),X'FF'-VCHBUSY UNFLAG SUBCHAN@V407438 00464000
NI VCUSTAT,X'FF'-VCUBUSY UNFLAG CTL UNIT @V407438 00465000
TM VCHTYPE,VCHBMX BMX CHANNEL? @V407438 00466000
BZ REFBUSY NOPE, BR. @V407438 00467000
NI VCUSTAT,X'FF'-VCUACTV UNFLAG CU @V407438 00468000
B REFBUSY NOW GO REFLECT BUSY @V407438 00469000
SPACE 00470000
NOCCWTR2 DS 0H CONNECTOR 00471000
TM IOBFLAG,IOBRELCU C.U. RELEASED AT INIT. ?? @VA06371 00472000
BZ NORSTCUR NO, FLAGS ALL SET @VA06371 00473000
NI IOBFLAG,X'FF'-IOBRELCU RESET C.U. REL. FLAG @VA06371 00474000
NI VCUSTAT,255-VCUBUSY TURN OFF CU BUSY @VA08687 00475000
NORSTCUR EQU * @VA06371 00476000
LTR R1,R1 SHOULD DMKIOSQV BE CALLED?? 00477000
BNZ VIOWAIT YES, GO START REAL I/O 00478000
ST R11,IOBUSER OTHERWISE, SET UP OWNER OF I/O 00479000
TM IOBSTAT,IOBCC3 CC = 0 ? @VA04501 00480000
BNZ VIOGODSP NO..DO NOT RUN OR (TRACE) @VA04501 00481000
B VIOEXITX AND LEAVE @VA08687 00482000
EJECT 00483000
VIOWAIT EQU * 00484000
OI VMRSTAT,VMIOWAIT PLACE USER IN IOWAIT 00485000
LA R15,1 * ADD 1 TO THE VIRTUAL START I/O COUNT 00486000
AL R15,VMIOCNT * FOR ACCOUNTING. 00487000
ST R15,VMIOCNT * 00488000
TM VDEVSTAT,VDEVDED DEDICATE DEVICE? @VA11570 00488100
BO VSIGTLOK YES, CHECK FOR ATTN INT. @VA11570 00488200
CLI VDEVTYPC,CLASSPEC SPECIAL DEVICE? @VA04467 00489000
BNE VIOQREAL NO... @VA04467 00490000
VSIGTLOK DS 0H @VA11570 00490100
BAL R9,GETLOCK MUST HAVE THE LOCK @VA08305 00491000
USING *,R9 NEW ADDRESSABILITY TO HERE @VA12128 00491020
L R12,ADMKVSI RESTORE BASE REG @VA12128 00491040
DROP R9 IT WAS ONLY TEMPORARY @VA12128 00491060
USING DMKVSI,R12 STANDARD ADDRESSABILITY @VA12128 00491080
TM VDEVSTAT,VDEVDED DEDICATE DEVICE? @VA11570 00491100
BO VIOKNCP YES, CHECK FOR ATTN INT. @VA11570 00491200
CLI VDEVTYPE,TYPCTCA IS IT A VIRTUAL CTCA? @VA04467 00492000
BNE VIOKNCP NO...TEST FOR 3704/5 @VA04467 00493000
TM VDEVSTAT,VDEVDED DEDICATED CHANNEL-TO-CHANNEL ? 00494000
BO VIOQREAL YES - START REAL I/O OPERATION 00495000
CALL DMKVCAST START I/O TO VIRTUAL CTCA @VA01092 00496000
B VIOEXITY DO NOT SET CHANNEL ACTIVE @VA01092 00497000
EJECT 00508000
VIOKNCP EQU * @VA04467 00509000
TM VDEVSTAT,VDEVDED DEDICATE DEVICE? @VA11570 00509100
BO VSIATDED YES, GO AHEAD FOR CHECK ATTN. @VA11570 00509200
CLI VDEVTYPE,TYP3705 IS THIS A 3704/5 CTLR? @VA04467 00510000
BNE VIOQREAL NO...NOTHING SPECIAL @VA04467 00511000
VSIATDED DS 0H @VA11570 00511100
TM VDEVINTS,ATTN DID WE HIT THE TIMING WINDOW? @VA04467 00512000
BZ VIOQREAL NO...CONTINUE AS PLANNED @VA04467 00513000
MVI IOBCSW+4,BUSY+ATTN BUSY FROM THE START I/O @VA04467 00514000
NI VDEVINTS,X'FF'-ATTN RESET PENDING INTERRUPT @VA04467 00515000
GOTO DMKVIOC1 GO SET CC = 1 AND STORE CSW @VA05037 00516000
SPACE 00517000
VIOQREAL EQU * @VA08629 00517050
TM IOBSPEC3,IOBSENSE SPECIAL 2250/3250 SITUATION @VA08629 00517100
* OF STANDALONE SENSE WITHOUT EXECUTING SENSE ON REAL HARDWARE 00517150
BZ VIOREAL2 @VA08629 00517200
L R15,IOBCAW ADDRESS OF CHANNEL PROGRAM @VA08629 00517250
LH R14,6(,R15) GET SENSE LENGTH @VA08629 00517300
LH R1,IOBCSW+6 CALCULATE RIGHT RESIDUAL COUNT @VA08629 00517350
SLR R14,R1 ... @VA08629 00517400
STH R14,IOBCSW+6 STORE IN IOBLOK FOR LATER @VA08629 00517450
LA R14,(256*(CE+DE)) PREPARE TO REFLECT CC=0 AND @VA08629 00517500
* CE+DE TO 2250/3250 WITHOUT EXECUTING SENSE ON HARDWARE 00517550
STH R14,IOBCSW+4 NOW DEVICE STATUS @VA08629 00517600
LA R15,8(,R15) CSW POINTS TO 8 PAST SENSE @VA08629 00517650
ST R15,IOBCSW ... @VA08629 00517700
ST R11,IOBUSER STORE VMBLOK ADDRESS IN IOBLOK @VA08629 00517750
CALL DMKSTKIO THIS IOBLOK BEFORE PENDING I/O @VA08629 00517800
NI VMRSTAT,X'FF'-VMIOWAIT TAKE USER OUT OF IOWAIT @VA08629 00517850
B SKIPIOS BYPASS CALLING DMKIOS @VA08629 00517900
VIOREAL2 EQU * @VA08629 00517950
TM VMINST+1,X'01' MAYBE START I/O FAST RELEASE@VA01382 00519000
BZ IOSCALL NO -- JUST CALL DMKIOSQV @VA01382 00520000
TM VMTRCTL,VMTRSIO TRACING START I/O ? @VA01382 00521000
BO IOSCALL YES - USE NORMAL PATH @VA01382 00522000
LA R1,VMVCR0 CHECK FOR BLKMPX ENABLED @VA01382 00523000
TM VMPSTAT,VMV370R IS THERE AN ECBLOK ? @VA01382 00524000
BZ *+8 NO -- ALREADY HAVE CR0 @VA01382 00525000
L R1,VMECEXT POINT TO EXTENDED CR0 @VA01382 00526000
TM 0(R1),BLKMPX BLOCK MULTIPLEXING ENABLED ? @VA01382 00527000
BNZ NOWAIT YES,SIOF @VA08305 00528000
BAL R9,GETLOCK NO,MUST HAVE THE SYSTEM LOCK @VA08305 00529000
USING *,R9 NEW ADDRESSABILITY TO HERE @VA12128 00529200
L R12,ADMKVSI RESTORE BASE REG @VA12128 00529400
DROP R9 IT WAS ONLY TEMPORARY @VA12128 00529600
USING DMKVSI,R12 STANDARD ADDRESSABILITY @VA12128 00529800
B IOSCALL NOW GO CALL IOS @VA08305 00530000
NOWAIT EQU * @VA08305 00531000
OI IOBSPEC,IOBSIOF START I/O FAST RELEASE @VA01382 00532000
NI VMRSTAT,255-VMIOWAIT LET THE USER RUN @VA01382 00533000
AIF (NOT &AP).APCHK4 00534000
TM APSTAT1,APUOPER RUNNING IN AP MODE? @VA08305 00535000
BNO IOSCALL NO,FOLLOW THE NORMAL PATH @VA08305 00536000
TM APSTAT1,PROCIO IS THIS THE MAIN @VA08305 00537000
BNO SWITCH NO,MUST EVENTUALLY SWITCH @VA08305 00538000
L R15,=A(DMKLOKSY) POINT TO THE SYSTEM LOCK @VA08305 00539000
L R15,0(R15) PICK UP THE LOCK WORD @VA08305 00540000
LH R1,LPUADDR AND MY PROCESSOR ID @VA08305 00541000
CR R1,R15 DO I HOLD IT? @VA08305 00542000
BE IOSCALL YES,GO STRAIGHT TO IOS @VA08305 00543000
LTR R15,R15 IS THE LOCK AVAILABLE? @VA08305 00544000
BNZ SWITCH DON'T WASTE TIME TRYING @VA08305 00545000
LOCK OBTAIN,TYPE=SYS,SPIN=NO TRY FOR THE LOCK @VA08305 00546000
BZ IOSCALL GOT IT, GO TO IOS @VA08305 00547000
SWITCH STH R13,VMACTDEV SAVE VADDR FOR DMKTHI @VA08305 00548000
LH R1,VCHADD GET CHANNEL ADDRESS @VA08305 00549000
* NOTE,IF HERE MUST BE DASD OR TAPE 00550000
SRL R1,7 TIMES 2 @VA08305 00551000
L R15,=A(DMKVIOMK) GET ADDRESS OF MASK TABLE @VA08305 00552000
LH R1,0(R1,R15) GET APPROPRIATE MASK @VA08305 00553000
O R1,VMIOACTV-2 ADD TO PRESENT ACTIVE MASK @VA08305 00554000
STH R1,VMIOACTV ... @VA08305 00555000
LA R0,CPEXSIZE SIZE OF CPEXBLOK @VA08305 00556000
CALL DMKFREE GO GET ONE @VA08305 00557000
USING CPEXBLOK,R1 @VA08305 00558000
LR R2,R11 SAVE VMBLOK POINTER @VA08305 00559000
L R11,ASYSVM POINT TO SYSTEM VMBLOK @VA08305 00560000
STM R0,R14,CPEXREGS SAVE ALL THE REGISTERS @VA08305 00561000
LA R15,CALLIOS RETURN ADDRESS AFTER UNSTACK @VA08305 00562000
ST R15,CPEXADD ..... @VA08305 00563000
DROP R1 @VA08305 00564000
LR R11,R2 RESTORE R11 @VA08305 00565000
TM APSTAT1,PROCIO IS THIS THE MAIN PROCESSOR? @VA08305 00566000
BNO STACKOP NO, STACK FOR THE MAIN @VA08305 00567000
CALL DMKSTKMP YES, STACK FOR THIS PROCESSOR @VA08305 00568000
B VIOEXITY NOW EXIT, CC=0 IS ALREADY SET @VA08305 00569000
STACKOP CALL DMKSTKOP STACK FOR OTHER PROCESSOR @VA08305 00570000
B VIOEXITY AND EXIT @VA08305 00571000
CALLIOS CHARGE SWITCH,(R2) START CHARGING ORIGINAL USER @VA08305 00572000
CALL DMKIOSQV NOW CALL IOS @VA08305 00573000
CHARGE SWITCH,ASYSVM EXIT POINTING TO THE SYSTEM @VA08305 00574000
SPACE 00574500
GOTO DMKDSPCH ALL DONE @VA08305 00575000
SPACE 00576000
.APCHK4 ANOP 00577000
IOSCALL EQU * SCHEDULE VIRTUAL MACHINE I/O @VA01382 00578000
CALL DMKIOSQV CALL TO EXECUTE I/O @VA01092 00579000
SKIPIOS STH R13,VMACTDEV SAVE VADDR FOR DMKTHI @VA08629 00580000
TM VDEVTYPC,CLASDASD+CLASTAPE DISK OR TAPE? @VA08776 00581500
BZ VIOEXITY IF NEITHER, BRANCH @VA05377 00582000
LH R1,VCHADD GET CHANNEL ADDRESS 00583000
SRL R1,7 TIMES 2 00584000
L R15,=A(DMKVIOMK) GET ADDRESS OF MASK TABLE @VA05037 00585000
LH R1,0(R1,R15) GET APPROPRIATE MASK @VA05037 00586000
O R1,VMIOACTV-2 ADD TO PRESENT ACTIVE MASK 00587000
STH R1,VMIOACTV ... 00588000
B VIOEXITY AND LEAVE (NO V.M. TRACING DONE HERE). 00589000
SPACE 00590000
SIOCUE EQU * HERE IF A CONTROL UNIT END INTERRUPT IS PENDING 00591000
L R5,=A(256*(SM+BUSY)) SET INTERRUPT STATUS FOR CSW 00592000
NI VCUINTS,X'FF'-CUE CUE FOR ADDRESSED DEVICE - CLEAR CUE 00593000
NI VDEVSTAT,X'FF'-VDEVCUE FROM CU AND DEVICE BLOKS 00594000
L R5,=A(256*(CUE+BUSY)) SET CUE + BUSY INSTEAD 00595000
B STTOTCSW AND GO STORE TOTAL CSW @VA05104 00596000
EJECT 00597000
*---------------------------------------------------------------------* 00597025
* * 00597050
* LOADER3: * 00597075
*---------------------------------------------------------------------* 00597100
* * 00597125
* HERE TO RECALCULATE THE VBLOK ADDRESS EXPECTED IN R3 * 00597150
* AFTER CALLS TO DMKPTRAN AND DMKCCWTR. * 00597175
* * 00597200
* THIS RECALCULATION IS NECESSARY, BECAUSE UPON RETURN * 00597225
* THE CONTENTS OF R3 MAY HAVE BEEN ALTERED (DUE TO RE- * 00597250
* ENTRANCY). * 00597275
*---------------------------------------------------------------------* 00597300
LOADER3 DS 0H HERE TO RECALC VBLOK ADDR IN R3 @VA13211 00597325
LR R3,R6 LOAD ADDR OF VCHBLOK @VA13211 00597350
TM VCHTYPE,VCHSEL IS IT FOR SELECTOR CHANNEL? @VA13211 00597375
BOR R9 YES...RETURN TO CALLER @VA13211 00597400
LR R3,R7 ELSE; LOAD ADDRESS OF VCUBLOK @VA13211 00597425
TM VCUTYPE,VCUSHRD+VCUCTCA SHARED SUB-CHANNEL ? @VA13211 00597450
BNZR R9 YES...RETUNR TO CALLER @VA13211 00597475
LR R3,R8 CHANNEL STATUS IN DEVICE BLOK @VA13211 00597500
BR R9 RETURN TO CALLER @VA13211 00597525
EJECT 00597550
*. 00598000
* B. VIRTUAL TIO SIMULATION - 00599000
* 1. IF ALL VBLOKS WERE NOT FOUND, SET VIRTUAL CONDITION 00600000
* CODE 3 AND EXIT. 00601000
* 3. IF THE VIRTUAL SUBCHANNEL IS BUSY OR HAS AN INTERRUPT 00602000
* PENDING FOR A DEVICE OTHER THAN THE ONE ADDRESSED, SET 00603000
* VIRTUAL CONDITION CODE 2 AND EXIT. 00604000
* 4. IF A CHANNEL END OR CUE IS PENDING FOR THE ADDRESSED 00605000
* DEVICE, SET THE VIRTUAL CC = 1, CLEAR THE INTERRUPT, 00606000
* AND STORE THE CSW. 00607000
* 5. IF THE CUE IS PENDING FOR A DEVICE OTHER THAN THE ONE 00608000
* ADDRESSED, RETURN STATUS OF SM+BUSY, AND DO NOT CLEAR 00609000
* THE INTERRUPT; SET CC= 1, AND EXIT. 00610000
* 6. IF THERE ARE DEVICE CLASS INTERRUPTS PENDING, OR IF 00611000
* THE DEVICE IS "RESERVED" BY ANOTHER USER, STORE THE 00612000
* STATUS AND CLEAR THE INTERRUPTS; SET VIRTUAL CC = 1, 00613000
* AND EXIT. 00614000
* 7. IF NO STATUS IS PENDING ON THE ADDRESSED PATH, 00615000
* AND THE DEVICE IS NOT VIRL SPOOL RDR, EXIT WITH CC=0 00616000
* 8. IF THE DEVICE IS A VIRTUAL CTCA, CALL DMKVCATS FOR 00617000
* SIMULATION OF THE TEST I/O TO AN IDLE DEVICE. 00618000
* 9. IF THE DEVICE IS A DEDICATED CTCA, BUILD AN IOBLOK 00619000
* TO SCHEDULE A REAL TEST I/O AND CALL DMKIOSQV TO PERFORM 00620000
* THE NECESSARY INSTRUCTION. 00621000
* 10. FOR A VIRT READER DEVICE, SET CC=0 IF THE READER HAS 00622000
* ACTIVE FILE. SET CC=1 IF THE RDR IS EMPTY ( DMKVSPTO IS 00623000
* CALLED TO DECIDE IF THE READER IS EMPTY) 00624000
* (A CHANNEL-TO-CHANNEL ADAPTER MAY PRESENT CSW STATUS TO A 00625000
* TEST I/O EVEN THOUGH THE DEVICE HAS NO ACTIVE COMMAND.) 00626000
*. 00627000
SPACE 00628000
VIOTIO EQU * 00629000
BAL R9,GETLOCK GO GET THE SYSTEM LOCK @VA08305 00630000
USING *,R9 NEW ADDRESSABILITY TO HERE @VA12128 00630200
L R12,ADMKVSI RESTORE BASE REG @VA12128 00630400
DROP R9 IT WAS ONLY TEMPORARY @VA12128 00630600
USING DMKVSI,R12 STANDARD ADDRESSABILITY @VA12128 00630800
TM VMINST+1,X'01' IS IT CLRIO? @V2B2638 00631000
BO CLRIO YUP, BR @V2B2638 00632000
AL R1,DMKVSITI ADD TIO COUNT TO INCREMENT @V2B2638 00633000
ST R1,DMKVSITI AND RE-STORE @V2B2638 00634000
B VIOTIO1 CONTINUE @V2B2638 00635000
SPACE 00636000
CLRIO AL R1,DMKVSICI ADD CLRIO COUNT TO INCREMENT @V2B2638 00637000
ST R1,DMKVSICI AND RE-STORE @V2B2638 00638000
SPACE 00639000
VIOTIO1 EQU * HERE WHEN COUNTS ARE BUMPED @V2B2638 00640000
SPM R0 RESTORE COND. CODE FROM DMKSCNVU 00641000
BNZ VIOEXIT EXIT CC = 3 -- DEVICE NOT FOUND @VA01527 00642000
BAL R9,CHSCAN TEST FOR CHANNEL BUSY OR CE PENDING 00644000
BO TIOCE CHANNEL END PENDING -- REFLECT IT 00645000
BAL R9,CUSCAN TEST FOR C.U. BUSY OR CUE PENDING 00647000
BO TIOCUE CONTROL UNIT END PENDING 00648000
BAL R9,DEVSCAN TEST FOR DEVICE BUSY OR INTRPT PENDING 00650000
SPACE 2 00651000
* 00652000
* HERE IF PATH TO DEVICE IS NOT BUSY AND NO 00653000
* INTERRUPTS ARE PENDING 00654000
* 00655000
SPACE 00656000
TM VDEVSTAT,VDEVNRDY IS DEVICE READY ? 00657000
BZ TIOCTCA NO -- CHECK FOR VIRTUAL CHAN-TO-CHAN 00658000
LA R5,UC*256 SET UNIT CHECK STATUS, 00659000
B STORECSW AND GO STORE THE CSW BYTES 4 AND 5 00660000
SPACE 2 00661000
TIOCTCA EQU * TEST FOR DEDICATED DEVICES @VA00398 00662000
LA R3,IOBTIO INDICATE A TIO @VA00398 00663000
TM VDEVSTAT,VDEVDED DEDICATED CHANNEL-TO-CHANNEL ? 00664000
BO CTCAIOB YES - BUILD IOBLOK TO SCHEDULE THE 'TIO' 00665000
TM VCUTYPE,VCUCTCA MIGHT THIS BE VIRTUAL CTCA ? @VA00398 00666000
BZ TIORDR NO- GO CHECK SEE IF IT IS READER @VA03503 00667000
CALL DMKVCATS TIO TO VIRTUAL CTCA 00668000
BNZ STORECSW CC NON-ZERO => CSW STORED 00669000
B VIOEXITX EXIT, CC = 0 00670000
TIORDR EQU * @VA03503 00671000
CLI VDEVTYPC,CLASURI IS IT RDR DEVICE? @VA03503 00672000
BNE VIOEXITX NO- EXIT WITH CC=0 @VA03503 00673000
TM VDEVTYPE,TYPRDR CARD READER TYPE UR INPUT? @VA04204 00674000
BZ VIOEXITX NOPE, EXIT FORTHWITH @VA04204 00675000
L R9,VDEVSPL GET SPOOL CONTROL BLOK @VA03503 00676000
LTR R9,R9 ANY ACTIVE FILE? @VA03503 00677000
BNZ VIOEXITX YES--EXIT WITH CC =0 @VA03503 00678000
CALL DMKVSPTO VSP WILL DO THE FILE SEARCH @VA03503 00679000
BNZ VIOEXITX FILE FOUND--EXIT WITH CC=0 @VA03503 00680000
LA R5,UC*256 EMPTY RDR--SET UC STATUS @VA03503 00681000
B STORECSW GO STORE CSW @VA03503 00682000
TIOCE EQU * HERE IF CE IS PENDING 00683000
TM VDEVSTAT,VDEVCHAN CE PENDING FOR ADDRESSED DEVICE? 00684000
BO TIOCEPND YES... 00685000
LA R2,X'20' NO -- EXIT WITH CC OF 2 00686000
B VIOEXIT 00687000
SPACE 2 00688000
TIOCEPND EQU * 00689000
NI VCHSTAT-VCHBLOK(R3),X'FF'-VCHCEPND CLEAR PENDING 00690000
NI VDEVSTAT,X'FF'-VDEVCHAN AND FROM DEVICE 00691000
LM R4,R5,VDEVCSW PICK UP THE CSW FROM THE DEVICE 00692000
NI VDEVCSW+5,X'FF'-PCI REMOVE PCI 00693000
B STORECSW AND GO STORE CSW 00694000
SPACE 3 00695000
TIOCUE EQU * HERE IF A CUE IS PENDING 00696000
TM VDEVSTAT,VDEVCUE IS CUE PENDING FOR ADDRESSED DEVICE? 00697000
BZ SETSM NO -- 00698000
NI VCUINTS,X'FF'-CUE CLEAR INTERRUPT FROM CU 00699000
NI VDEVSTAT,X'FF'-VDEVCUE AND DEVICE 00700000
L R5,=A(CUE*256) SET CSW STATUS 00701000
B STTOTCSW AND GO STORE TOTAL CSW @VA05104 00702000
SPACE 2 00703000
SETSM L R5,=A(256*(SM+BUSY)) SET CSW STATUS 00704000
B STTOTCSW AND GO STORE TOTAL CSW @VA05104 00705000
EJECT 00706000
*. 00707000
* C. VIRTUAL TCH SIMULATION - 00708000
* 1. IF A VIRTUAL CHANNEL BLOK WAS NOT FOUND, RETURN VIRTUAL 00709000
* CONDITION CODE 3. 00710000
* 3. IF THE ADDRESSED CHANNEL IS NOT A SELECTOR, RETURN 00711000
* VIRTUAL CONDITION CODE 0; MPX AND BMPX ARE NEVER BUSY. 00712000
* 4. IF THE ADDRESSED CHANNEL IS BUSY, SET VIRTUAL CONDITION 00713000
* CODE 2 AND EXIT. 00714000
* 5. IF THE ADDRESSED CHANNEL HAS A CHANNEL CLASS INTERRUPT 00715000
* PENDING, SET CC = 1 AND EXIT. 00716000
* 6. IF THE CHANNEL IS FREE, EXIT. 00717000
*. 00718000
SPACE 00719000
VIOTCH EQU * 00720000
AL R1,DMKVSITC ADD TCH COUNT TO INCREMENT @V2B2638 00721000
ST R1,DMKVSITC AND RE-STORE @V2B2638 00722000
SPM R0 RESTORE COND. CODE FROM DMKSCNVU 00723000
BC 4,VIOEXIT EXIT CC = 3 IF VCHBLOK NOT FOUND @VA01527 00724000
SPACE 00725000
VIOTCH2 DS 0H @VA10311 00726010
TM VCHTYPE,VCHSEL THIS A SELECTOR CHANNEL??? @VA12875 00726011
BNO CKPEND01 NO, CHECK FOR I/O PENDING @VA12875 00726012
TM VCHSTAT,VCHBUSY IS THE CHANNEL BUSY???? @VA12875 00726013
BNO CKPEND01 NO - SEE IF ANY I/O PENDING @VA12875 00726014
LA R2,CC2 SET CC=2: CHANNEL IN BURST MODE @VA12875 00726015
B VIOEXIT EXIT @VA12875 00726016
CKPEND01 DS 0H CHECK FOR INTERRUPT PENDING @VA12875 00726017
TM VMPEND,VMIOPND ANYTHING PENDING? @VA10311 00726020
BNO VIOEXITX NO...GET OUT WITH CC=0 @VA10311 00726030
SR R3,R3 ZERO REGISTER 3 @VA12875 00726033
SR R4,R4 ZERO REGISTER 4 @VA12875 00726036
LH R9,VCHADD GET CHANNEL ADDRESS @VA10311 00726040
SRL R9,7 MAKE IT AN INDEX @VA10311 00726050
AL R9,=A(DMKVIOMK) AND POINT TO INTERRUPT MASK @VA12875 00726060
ICM R4,B'0011',0(R9) FOR THIS CHANNEL @VA12875 00726960
ICM R3,B'0011',VMIOINT LOAD CURRENT PENDING CE @VA12875 00727860
NR R4,R3 IS THERE AN INTERRUPT PENDING?? @VA12875 00728760
BZ VIOEXITX NO ACTY ON CHAN..LEAVE CC=0 @VA12875 00729660
LA R2,X'10' CE IS PENDING - SET CC = 1 00731000
B VIOEXIT AND EXIT 00732000
SPACE 00733000
* 00753000
* RE-ENTRY POINT FROM DMKVSJ TO PROCESS CLCH AS A TCH 00773000
* 00793000
DMKVSICH DS 0D @VA12128 00813000
USING *,R15 ESTABLISH ADDRESSABILITY @VA12128 00833000
L R12,=A(DMKVSI) RESTORE BASE REG @VA12128 00853000
DROP R15 DON'T WANT R15 ANYMORE @VA12128 00873000
USING DMKVSI,R12 RESTORE ADDRESSABILITY @VA12128 00893000
B VIOTCH2 GO PROCESS AS TCH @VA12128 00913000
EJECT 00990000
* COMMON SUBROUTINES USED BY VIOSIO, VIOTIO, VIOTCH 00991000
SPACE 2 00992000
CHSCAN EQU * HERE TO TEST FOR CHANNEL BUSY OR CE PENDING %V386198 00993000
LR R3,R6 SAVE POINTER TO CHANNEL BLOK %V386198 00994000
TM VCHTYPE,VCHSEL SELECTOR CHANNEL ? %VA01771 00995000
BO CHTEST YES %VA01771 00996000
LR R3,R7 SAVE ADDRESS OF VCUBLOK %V386198 00997000
TM VCUTYPE,VCUSHRD+VCUCTCA SHARED SUB-CHANNEL ? %V386198 00998000
BNZ CHTEST YES.. %V386198 00999000
LR R3,R8 CHANNEL STATUS IN DEVICE BLOK %V386198 01000000
SPACE 01001000
CHTEST TM VCHSTAT-VCHBLOK(R3),VCHBUSY IS SUBCHANNEL BUSY? %V386198 01002000
BZ TESTCE NO -- %V386198 01003000
LA R2,X'20' SET CONDITION CODE 2 01004000
CLI VMINST,X'9D' PREVENT TIO BUSY LOOPS 01005000
BNE VIOEXIT NOT A TIO - EXIT 01006000
TM VDEVSTAT,VDEVBUSY DEVICE BUSY ?? 01007000
BZ VIOEXIT NO -- RETURN 01008000
LA R3,CLASSPEC*256+TYPCTCA VIRTUAL CTCA @VM01091 01009000
CH R3,VDEVTYPC IS THIS A CHAN-CHAN ADAPT. @VM01091 01010000
BE CALLSCH YES - CALL SCHEDULAR @VM01091 01011000
CLI VDEVTYPC,CLASTERM TERMINAL CLASS ? @VM01091 01012000
BNE IDLETIO NO - IN IDLE TIO LOOP @VM01091 01013000
TM VDEVSTAT,VDEVDED DEDICATED DEVICE ? @VM01091 01014000
BO CALLSCH YES - CALL SCHEDULAR @VM01091 01015000
TM VDEVFLAG,VDEVENAB VIRTUAL 2702 LINE ? @VM01091 01016000
BZ IDLETIO NO - IN IDLE TIO LOOP @VM01091 01017000
BAL R3,DROPUSER PUT USER IN IDLE STATUS @VM01091 01018000
B SETSM SET UP CSW @VM01091 01019000
CALLSCH BAL R3,DROPUSER PUT USER IN IDLE STATUS @VM01091 01020000
B VIOEXIT AND EXIT @VM01091 01021000
IDLETIO OI VMDSTAT,VMTIO FLAG USER IN TIO BUSY LOOP @VM01091 01022000
B VIOEXIT AND EXIT @VM01091 01023000
DROPUSER OI VMRSTAT,VMIDLE INDICATE IDLE STATUS @VM01091 01024000
CALL DMKSCHDL ALTER USER DISPATCHING STATUS @VM01091 01025000
BR R3 RETURN TO CALLER @VM01091 01026000
SPACE 01027000
TESTCE TM VCHSTAT-VCHBLOK(R3),VCHCEPND CE PENDING ?? %V386198 01028000
BR R9 RETURN TO CALLER WITH CC INTACT %V386198 01029000
SPACE 3 01030000
CUSCAN EQU * HERE TO TEST FOR CU BUSY OR CUE PENDING %V386198 01031000
TM VCUSTAT,VCUBUSY IS THE CONTROL UNIT BUSY? %V386198 01032000
BZ CUFREE NO -- %V386198 01033000
OI VCUSTAT,VCUCUEPN FLAG CUE REQUESTED 01034000
L R5,=A(256*(SM+BUSY)) SET CSW STATUS 01035000
B STTOTCSW STORE AND EXIT @VA05104 01036000
SPACE 2 01037000
CUFREE TM VCUINTS,CUE TEST FOR CUE PENDING %V386198 01038000
BR R9 RETURN WITH CONDITION CODE SET %V386198 01039000
EJECT 01040000
DEVSCAN EQU * HERE TO TEST FOR DEVICE BUSY OR INTS PENDING %V386198 01041000
TM VDEVSTAT,VDEVBUSY IS THE DEVICE BUSY ?? %V386198 01042000
BZ CKINTS NO -- %V386198 01043000
L R5,=A(256*BUSY) SET BUSY STATUS 01044000
B STTOTCSW AND EXIT @VA05104 01045000
SPACE 01046000
CKINTS LH R5,VDEVINTS GET DEVICE INTERRUPTS %V386198 01047000
LTR R5,R5 ANYTHING PENDING ?? %V386198 01048000
BNZ PNDINT PENDING INTERRUPT, BR. %V407438 01049000
TM VDEVFLG2,VDEVRRF MDISK WITH RES/REL FEATURE? %V407438 01050000
BZR R9 NOPE, NO VIRT RES/REL TODAY %V407438 01051000
L R2,VDEVRRB GET THE VRRBLOK ADDRESS @V407438 01052000
USING VRRBLOK,R2 ADDRESS THE VRRBLOK @V407438 01053000
TM VRRSTAT,VRRRES IS THE MDISK RESERVED NOW? @V407438 01054000
BZR R9 NOPE, FREE PATH, BR. @V407438 01055000
TM VDEVFLG2,VDEVRES RESERVED BY THIS GUY? @V407438 01056000
BOR R9 YUP, FREE PATH, BR. @V407438 01057000
REFBUSY OI VDEVFLG2,VDEVODE WE OWE THIS GUY DE WHEN FREE @V407438 01058000
L R5,=A(256*BUSY) DEVICE IS BUSY RIGHT NOW @V407438 01059000
B STORECSW SORRY. @V407438 01060000
SPACE 01061000
PNDINT EQU * @V407438 01062000
SPACE 01063000
CLI VMINST,X'9C' IS IT A SIO 01064000
BNE VIOATTN NO -- 01065000
O R5,=A(256*BUSY) ADD BUSY TO STATUS @VA01803 01066000
VIOATTN EQU * 01067000
SLR R0,R0 ZERO CONSTANT 01068000
TM VDEVINTS,ATTN ATTENTION PENDING ?? 01069000
BZ CLEARDEV NO -- REFLECT A SINGLE INTERRUPT 01070000
TM VDEVFLAG,VDEVPOST PRESENT ALL TO-GETHER ? @VA01653 01071000
BO POSTOFF YES @VA04343 01072000
TM VDEVINTS,X'FF'-(ATTN+UC) ANYTHING ELSE ?? 01073000
BNZ ATTNPLUS YES -- SEPARATE INTERRUPTS, PLEASE 01074000
CLI VDEVTYPC,CLASSPEC MIGHT THIS BE CHAN-TO-CHAN ADAPTER 01075000
BNE CLEARDEV NO -- PRESENT STATUS 01076000
CLI VDEVTYPE,TYPCTCA BETTER BE SURE ABOUT IT 01077000
BNE CLEARDEV NO -- PRESENT STATUS 01078000
TM VDEVINTS,UC IS THERE A UNIT CHECK INCLUDED ? 01079000
BO CLEARDEV YES - GIVE IT TO HIM 01080000
STH R0,VDEVINTS CLEAR DEVICE INTERRUPT STATUS 01081000
NI VDEVSTAT,X'FF'-VDEVPEND ... 01082000
TM VDEVSTAT,VDEVDED DEDICATED CHANNEL-TO-CHANNEL ? 01083000
BCR 1,R9 YES - LET THE 'SIO' GO THROUGH 01084000
L R1,VDEVREAL ACCESS THE CHXBLOK FOR VIRTUAL 01085000
USING CHXBLOK,R1 ... 01086000
TM CHXFLAG,CHBM370 RUNNING IN COMPATIBILITY MODE ? 01087000
BCR 8,R9 YES - LET THE 'SIO' GO THROUGH 01088000
DROP R1 PRESENT INTERRUPT STATUS TO START I/O 01089000
B CLEARDEV PRESENT STATUS @VA04343 01090000
SPACE 01091000
* HERE IF ATTN ALONE, OR NO ATTN 01092000
POSTOFF NI VDEVFLAG,X'FF'-VDEVPOST TURN OFF VDEVPOST @VA04343 01093000
CLEARDEV EQU * CLEAR DEVICE INTERRUPT STATUS 01094000
STH R0,VDEVINTS CLEAR OUT STATUS BYTES 01095000
NI VDEVSTAT,X'FF'-VDEVPEND CLEAR OUT PENDING FLAG 01096000
B STTOTCSW AND GO FINISH REFLECTING @VA05104 01097000
SPACE 01098000
ATTNPLUS EQU * HERE FOR SEPARATE INTERRUPTS 01099000
N R5,=A(X'FFFF'-256*(ATTN+UC)) CLEAR ATTN AND UC 01100000
NI VDEVINTS,ATTN+UC AND LEAVE IN DEVICE 01101000
B STTOTCSW TO STORE CSW @VA12128 01102000
SPACE 3 01111000
CC2 EQU X'20' CONDITION CODE 2 @VA12875 01120000
SPACE 2 01129000
VIOGODSP EQU * @VA12128 01138000
GOTO DMKDSPCH ALL DONE @VA12128 01147000
EJECT 01156000
*** SET UP THE INDEX REGISTER (R14) FOR THE BRANCH TO 01165000
* DMKVSJ TO CONTINUE PROCESSING 01174000
SPACE 2 01183000
VIOCLCH EQU * @VA12128 01192000
LA R14,INDEXA VIOCLCH @VA12128 01201000
B EXITVSJ SET UP BASE AND GO TO DMKVSJ @VA12128 01210000
VIOHIO EQU * @VA12128 01219000
LA R14,INDEXB VIOHIO @VA12128 01228000
B EXITVSJ SET UP BASE AND GO TO DMKVSJ @VA12128 01237000
STTOTCSW EQU * @VA12128 01246000
LA R14,INDEXC STTOTCSW @VA12128 01255000
B EXITVSJ SET UP BASE AND GO TO DMKVSJ @VA12128 01264000
STORECSW EQU * @VA12128 01273000
LA R14,INDEXD STORECSW @VA12128 01282000
B EXITVSJ SET UP BASE AND GO TO DMKVSJ @VA12128 01291000
VIOEXIT EQU * @VA12128 01300000
LA R14,INDEXF VIOEXIT @VA12128 01309000
B EXITVSJ SET UP BASE AND GO TO DMKVSJ @VA12128 01318000
VIOEXITX EQU * @VA12128 01327000
LA R14,INDEXG VIOEXITX @VA12128 01336000
B EXITVSJ SET UP BASE AND GO TO DMKVSJ @VA12128 01345000
VIOEXITY EQU * @VA12128 01354000
LA R14,INDEXH VIOEXITY @VA12128 01363000
B EXITVSJ SET UP BASE AND GO TO DMKVSJ @VA12128 01372000
GETLOCK EQU * @VA12128 01381000
LA R14,INDEXJ GETLOCK @VA12128 01390000
B EXITVSJ SET UP BASE AND GO TO DMKVSJ @VA12128 01399000
CTCAIOB EQU * @VA12128 01408000
LA R14,INDEXK CTCAIOB @VA12128 01417000
SPACE 01426000
EXITVSJ EQU * EXIT TO DMKVSJ @VA12128 01435000
GOTO DMKVSJEX @VA12128 01444000
EJECT 01453000
* 01462000
* DMKVSJ INDEX TABLE 01471000
* 01480000
INDEXA EQU 0 BRANCH TABLE INDEX-VIOCLCH @VA12128 01489000
INDEXB EQU 4 BRANCH TABLE INDEX-VIOHIO @VA12128 01498000
INDEXC EQU 8 BRANCH TABLE INDEX-STTOTCSW @VA12128 01507000
INDEXD EQU 12 BRANCH TABLE INDEX-STORECSW @VA12128 01516000
INDEXE EQU 16 *** UNUSED @VA12128 01525000
INDEXF EQU 20 BRANCH TABLE INDEX-VIOEXIT @VA12128 01534000
INDEXG EQU 24 BRANCH TABLE INDEX-VIOEXITX @VA12128 01543000
INDEXH EQU 28 BRANCH TABLE INDEX-VIOEXITY @VA12128 01552000
INDEXI EQU 32 *** UNUSED @VA12128 01561000
INDEXJ EQU 36 BRANCH TABLE INDEX-GETLOCK @VA12128 01570000
INDEXK EQU 40 BRANCH TABLE INDEX-CTCSIOB @VA12128 01579000
EJECT 01610000
DMKVSICT DC F'0' COUNT OF TOTAL I/O INSTRUCTIONS 01611000
DMKVSICW DC F'0' COUNT OF CALLS TO DMKCCWTR 01612000
DMKVSISI DC F'0' COUNT OF VIRT. SIO'S @V2B2638 01613000
DMKVSISF DC F'0' COUNT OF VIRT. SIOF'S @V2B2638 01614000
DMKVSITI DC F'0' COUNT OF VIRT. TIO'S @V2B2638 01615000
DMKVSICI DC F'0' COUNT OF VIRT. CLRIO'S @V2B2638 01616000
DMKVSITC DC F'0' COUNT OF VIRT. TCH'S @V2B2638 01619000
ADMKVSI DC A(DMKVSI) FOR BASE REG ADDRESSABILITY @VA12128 01620000
TCHOPER DC X'9F00' OPERAND FOR TEST CHANNEL (TCH) @VMD0117 01621000
SPACE 01622000
LTORG 01623000
EJECT 01624000
COPY VBLOKS @VA04320 01625000
OSVSCOM MSSCOM @V60B6B8 01626000
COPY VCTCA @VA04320 01627000
COPY RBLOKS @VA04320 01628000
COPY VMBLOK @VA04320 01629000
COPY TREXT @VA04320 01630000
COPY IOBLOKS @VA04320 01631000
COPY IOER @VA04320 01632000
PSA @VA04320 01633000
COPY DEVTYPES @VA04320 01634000
COPY EQU @VA04320 01635000
COPY SAVE @VA08305 01636000
END DMKVSI @VA04320 01637000