VSC TITLE 'DMKVSC (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 VALIDATE SERIALIZATION OF INPUT 00002000
*. 00003000
*********************************************************************** 00004000
* * 00005000
*MODULE NAME = DMKVSC * 00006000
* * 00007000
*DESCRIPTIVE NAME = V=R NOTRANS VERIFICATION * 00008000
* * 00009000
*COPYRIGHT = NONE * 00010000
* * 00011000
*STATUS = VM/370 RELEASE 6 * 00012000
* * 00013000
*FUNCTION = DETERMINE THE POSSIBILITY OF AVOIDING TRANSLATING * 00014000
* THE USERS CHANNEL PROGRAM. * 00015000
* * 00016000
*NOTES = THIS MODULE CAN BE DELETED FROM THE LOAD LIST WHEN CP IS * 00017000
* GENNED WITHOUT THE V=R OPTION. * 00018000
* * 00019000
* DEPENDENCIES = NONE * 00020000
* * 00021000
* RESTRICTIONS = NONE * 00022000
* * 00023000
* REGISTER CONVENTIONS = GPR0 CONTAINS ADDRESS OF THE PSA * 00024000
* GPR2 = VIRTUAL CAW * 00025000
* GPR3 = WORK REGISTER * 00026000
* GPR4 = WORK REGISTER * 00027000
* GPR5 = WORK REGISTER * 00028000
* GPR6 = VIRTUAL CHANNEL BLOCK (VCHBLOK) * 00029000
* GPR7 = VIRTUAL CONTROL UNIT BLOCK (VCUBLOK) * 00030000
* GPR8 = VIRTUAL DEVICE BLOCK (VDEVBLOK) * 00031000
* GPR9 = WORK REGISTER * 00032000
* GPR10 = IOBLOK BASE * 00033000
* GPR11 = VMBLOK BASE * 00034000
* GPR12 = DMKVSC BASE * 00035000
* GPR13 = SAVEAREA BASE * 00036000
* GPR14 = EXTERNAL LINKAGE * 00037000
* GPR15 = EXTERNAL LINKAGE * 00038000
* * 00039000
* PATCH LABEL = N/A * 00040000
* * 00041000
*MODULE TYPE = CSECT * 00042000
* * 00043000
* PROCESSOR = ASSEMBLER XF * 00044000
* * 00045000
* MODULE SIZE = SEE ASSEMBLED LISTING * 00046000
* * 00047000
* ATTRIBUTES = SERIALLY REUSABLE, RESIDENT * 00048000
* * 00049000
*ENTRY POINT = DMKVSCVR * 00050000
* * 00051000
* PURPOSE = SCAN CONDITIONS TO SEE IF NOTRANS IS PROPER * 00052000
* * 00053000
* LINKAGE = DMKVSI VIA SVC * 00054000
* * 00055000
*INPUT = * 00056000
* DMKVSCVR * 00057000
* GPR0 = THE ADDRESS OF THE PSA * 00058000
* GPR2 = VIRTUAL CAW * 00059000
* GPR6 = ADDRESS OF VCHBLOK * 00060000
* GPR7 = ADDRESS OF VCUBLOK * 00061000
* GPR8 = ADDRESS OF VDEVBLOK * 00062000
* GPR10 = ADDRESS OF IOBLOK * 00063000
* GPR11 = ADDRESS OF VMBLOK * 00064000
* GPR12 = ADDRESS OF DMKVSC * 00065000
* GPR13 = ADDRESS OF SAVEAREA * 00066000
* * 00067000
*OUTPUT = * 00068000
* * 00069000
* DMKVSCVR * 00070000
* * 00071000
*EXIT-NORMAL = * 00072000
* DMKVSCVR * 00073000
* GPR15 = 0 IMPLYING THAT CHANNEL PROGRAM TRANSLATION CAN * 00074000
* BE BYPASSED. * 00075000
* * 00076000
*EXIT-ERROR = * 00077000
* DMKVSCVR * 00078000
* GPR15 = 4 IMPLYING THAT CHANNEL PROGRAM TRANSLATION CAN * 00079000
* NOT BE BYPASSED. * 00080000
* * 00081000
*EXTERNAL REFERENCES = SEE BELOW * 00082000
* * 00083000
* ROUTINES = DMKFRET - TO RETURN FREE STORAGE * 00084000
* * 00085000
* DATA AREAS = DMKSLC - END OF V=R AREA * 00086000
* PSA - CP CONTROL DATA AREA * 00087000
* * 00088000
* CONTROL BLOCKS = VCHBLOK * 00089000
* VCUBLOK * 00090000
* VDEVBLOK * 00091000
* RCHBLOK * 00092000
* RCUBLOK * 00093000
* RDEVBLOK * 00094000
* VMBLOK * 00095000
* IOBLOK * 00096000
* IOERBLOK * 00097000
* * 00098000
* * 00099000
* * 00100000
*TABLES = NONE * 00101000
* * 00102000
*MACROS = ENTER, EXIT, CALL * 00103000
* * 00104000
*CHANGE ACTIVITY = AS FOLLOWS: * 00105000
* * 00106000
*********************************************************************** 00107000
*. 00108000
EJECT 00109000
COPY OPTIONS @VA09586 00110000
SPACE 00111000
DMKVSC CSECT 00112000
ENTRY DMKVSCVR @VA09586 00113000
USING PSA,R0 @VA09586 00114000
USING VCHBLOK,R6 @VA09586 00115000
USING VCUBLOK,R7 @VA09586 00116000
USING VDEVBLOK,R8 @VA09586 00117000
USING IOBLOK,R10 @VA09586 00118000
USING VMBLOK,R11 @VA09586 00119000
USING DMKVSCVR,R12 ADDRESSABILITY @VA09586 00120000
USING SAVEAREA,R13 @VA09586 00121000
DMKVSCVR DS 0D @VA09849 00122100
STM R0,R14,BALRSAVE SAVE REGS (R0-R14) @VA09849 00122200
LR R12,R15 USE R12 AS BASE @VA09849 00122300
* 00123000
* TEST TO SEE IF THE MSS IS PRESENT IN THIS SYSTEM. 00124000
* IF IT IS, AND THE REAL DEVICE IS A 3330V AND 00125000
* THE VIRTUAL DEVICE IS NOT A 3330V, THEN DMKCCW 00126000
* MUST BE CALLED IN ORDER TO INSERT THE PREFIX 00127000
* CCW'S IN ORDER TO TRAP MSS CYLINDER FAULTS. 00128000
* 00129000
TM VDEVFLG2,VDEVVIRT IS VDEV A 3330V ? @VA09758 00130010
BO TSTRAC NO NEED TO CALL DMKCCW FOR THAT @V60B6B8 00131000
* REASON 00132000
L R15,VDEVREAL GET REAL DEV BLOK @V60B6B8 00133000
CLI RDEVTYPC-RDEVBLOK(R15),CLASDASD IS RDEV A DASD @V60B6B8 00134000
BNE TSTRAC CAN'T BE A VUA @V60B6B8 00135000
TM RDEVFTR-RDEVBLOK(R15),VIRTUAL+SYSVIRT IS IT A @V60B6B8 00136000
* VUA 00137000
BNZ CCWTR2 YES, MUST TRANS THE CHAN PROG @V60B6B8 00138000
TSTRAC EQU * @V60B6B8 00139000
TM VMTRCTL,VMTRSIO SIO TRACING ACTIVE ? @VA01818 00140000
BO CCWTR2 YES, TRANSLATE CCW. @VA01818 00141000
LA R9,0(0,R2) STRIP PROTECTION KEY FROM CAW @VA02481 00142000
CLI VDEVTYPC,CLASTERM TERMINAL TYPE ?? @V200730 00143000
BNE TSTDED NO, SEE IF DEDICATED @V200730 00144000
TM VDEVFLAG,VDEVDIAL IS IT DIALED ?? @V200730 00145000
BO CCWTR2 YES - MUST TRANSLATE CCWS @VA02481 00146000
TSTDED L R15,VDEVREAL SETUP PTR TO RDEVBLOK @VA07835 00147000
USING RDEVBLOK,R15 ADDRESSABILITY @VA07835 00148000
TM RDEVSTA2,RDEVALT ALT PATH DEVICE @VA07835 00149000
BO CCWTR2 MUST GO THRU CCWTRANS @VA07835 00150000
TM VDEVSTAT,VDEVDED DEDICATE DEVICE @VA07835 00151000
BNO TSTNDED NOT DEDICATED CONTINUE @VA05399 00152000
TM VDEVFLAG,VDEVRDO READ/ONLY DEVICE? @VA05399 00153000
BO CCWTR2 YES, DO CCW TRANS @VA05399 00154000
B TSTSENSE NO, CK FOR VIRT SENSE BYTES @VA05399 00155000
TSTNDED CLI VDEVTYPC,CLASDASD DASD DEVICE @VA07835 00156000
BNE CCWTR2 NO, DO CCW TRANS @VA03813 00157000
TM VDEVFLAG,VDEVRDO READ ONLY DEVICE? @VA03813 00158000
BO CCWTR2 YES, DO CCW TRANS @VA03813 00159000
TM VDEVFLG2,VDEVRRF MDISK WITH RES/REL FEATURE? @V407438 00160000
BO CCWTR2 YUP, MUST TRANSLATE CCWS, BR. @V407438 00161000
CLI VDEVTYPE,TYP3330 3330? @VA03813 00162000
BNE DASD3340 NO, TRY 3340 @VA03813 00163000
CLI RDEVMDL,X'0B' MOD 11? @VA03813 00164000
BNE MOD1OR2 NO, TRY MOD 1 OR 2 @VA03813 00165000
CLC VDEVBND(2),=H'808' ALL CYLS USED? @VA03813 00166000
BNL TSTSENSE YES, HOPEFULLY BYPASS CCWTRANS @VA06150 00167000
B CCWTR2 NO, DO CCW TRANS @VA03813 00168000
MOD1OR2 CLC VDEVBND(2),=H'404' ALL CYLS USED? @VA03813 00169000
BNL TSTSENSE YES, HOPEFULLY BYPASS CCWTRANS @VA06150 00170000
B CCWTR2 NO, DO CCW TRANS @VA03813 00171000
DASD3340 CLI VDEVTYPE,TYP3340 3340? @VA03813 00172000
BNE DASD3350 NO, TRY 3350 @VA05091 00173000
CLI RDEVFTR,FTR70MB 70 MB FEATURE? @VA03813 00174000
BNE FEATUR35 NO, TRY FEATURE 35 MB @VA03813 00175000
CLC VDEVBND(2),=H'698' ALL CYLS USED @VA03813 00176000
BNL TSTSENSE YES, HOPEFULLY BYPASS CCWTRANS @VA06150 00177000
B CCWTR2 NO, DO CCW TRANS @VA03813 00178000
FEATUR35 CLI RDEVFTR,FTR35MB 35 MB FEATURE? @VA03813 00179000
BNE CCWTR2 NO, DO CCW TRANS @VA03813 00180000
CLC VDEVBND(2),=H'349' ALL CYLS USED? @VA03813 00181000
BNL TSTSENSE YES, HOPEFULLY BYPASS CCWTRANS @VA06150 00182000
B CCWTR2 NO, DO CCW TRANS @VA03813 00183000
DASD3350 CLI VDEVTYPE,TYP3350 3350? @VA05091 00184000
BNE DASD3380 NO, TRY 3380 HRC011DK 00185490
CLC VDEVBND(2),=H'555' ALL CYLS USED? @VA05091 00186000
BNL TSTSENSE YES, HOPEFULLY BYPASS CCWTRANS @VA06150 00187000
B CCWTR2 NO, DO CCW TRANS @VA05091 00188000
DASD3380 CLI VDEVTYPE,TYP3380 3380? HRC011DK 00188050
BNE DASD2314 NO, TRY 2314 HRC011DK 00188100
TM RDEVMDL,RDEVMD83 IS THIS A -3 HRC011DK 00188150
BNO DASD3382 TRY -2 HRC011DK 00188200
CLC VDEVBND(2),=H'2655' ALL CYLS USED ? HRC011DK 00188250
BNL TSTSENSE YES, HOPEFULLY BYPASS CCWTRANS HRC011DK 00188300
B CCWTR2 NO, DO CCW TRANS HRC011DK 00188350
DASD3382 DS 0H HRC011DK 00188400
TM RDEVMDL,RDEVMD82 IS THIS A -2 HRC011DK 00188450
BNO DASD3381 ASSUME - 1 HRC011DK 00188500
CLC VDEVBND(2),=H'1770' ALL CYLS USED ? HRC011DK 00188550
BNL TSTSENSE YES, HOPEFULLY BYPASS CCWTRANS HRC011DK 00188600
B CCWTR2 NO, DO CCW TRANS HRC011DK 00188650
DASD3381 DS 0H HRC011DK 00188700
CLC VDEVBND(2),=H'0885' ALL CYLS USED ? HRC011DK 00188750
BNL TSTSENSE YES, HOPEFULLY BYPASS CCWTRANS HRC011DK 00188800
B CCWTR2 NO, DO CCW TRANS HRC011DK 00188850
DASD2314 CLI VDEVTYPE,TYP2314 2314 OR 2319? @VA03813 00189000
BNE CCWTR2 NO, DO CCW TRANS @VA03813 00190000
CLC VDEVBND(2),=H'203' ALL CYLS USED? @VA03813 00191000
BL CCWTR2 NO, MUST DO CCWTRANS @VA06150 00192000
DROP R15 @VA04320 00193000
* OSTENSIBLY OK TO OMIT CCW-TRANSLATION: 00194000
* NOTE: R9 STILL POINTS TO THE CHANNEL PROGRAM 00195000
TSTSENSE LA R15,DMKVSCAN CALL SUBROUTINE TO "SCAN" @VA09586 00196000
BALR R14,R15 CHANNEL PROGRAM @VA04320 00197000
CL R15,F10 CHECK FOR HIGH SEVERITY R.C. @VA04320 00198000
BH CCWTR2 MUST CALL DMKCCW IF R.C. = 12 @VA04320 00199000
* RETURN-CODE = 0, 4, OR 8: 00200000
TM VDEVFLAG,VDEVUC ANY VIRTUAL SENSE BYTES ? @VA04320 00201000
BZ NOCCWTR2 IF NONE, NO TRANSLATION NEEDED. @VA04320 00202000
CL R15,F4 YES - SEE IF R.C. = 0, 4, OR 8 @VA04320 00203000
BE CCWTR2 IF = 4, MUST CALL CCW TRANS @VA04320 00204000
BH NOCCWTR2 IF = 8, NO CCW TRANS NEEDED @VA04320 00205000
* FOR R.C. = 0, GET RID OF SENSE BYTES: 00206000
LR R3,R1 PRESERVE R1, @VA04320 00207000
L R1,VDEVIOER POINT TO IOERBLOK, @VA04320 00208000
BAL R2,IOERFRET GIVE BACK SENSE BYTES, @VA04320 00209000
LR R1,R3 RESTORE R1, @VA04320 00210000
B NOCCWTR2 AND BYPASS CCW-TRANSLATION @VA04320 00211000
CCWTR2 EQU * @VA09586 00212000
LA R15,TRANCDE SET NONZERO RETURN CODE @VA09586 00213000
LM R0,R14,BALRSAVE RESTORE REGS (R0-R14) @VA09849 00214100
BR R14 @VA09849 00214200
NOCCWTR2 EQU * @VA09586 00215000
SR R15,R15 SET ZERO RETURN CODE @VA09586 00216000
LM R0,R14,BALRSAVE RESTORE REGS (R0-R14) @VA09849 00217100
BR R14 @VA09849 00217200
SPACE 4 00218000
USING IOERBLOK,R1 @VA03443 00219000
IOERFRET LA R0,IOERSIZE GET SIZE OF IOERBLOK @VA03443 00220000
AH R0,IOEREXT AND THE EXTRA (IF ANY) @VA03443 00221000
CALL DMKFRET AND RELEASE IT @VA03443 00222000
SR R1,R1 AND CLEAR @VA04320 00223000
ST R1,VDEVIOER POINTER TO IOERBLOK @VA04320 00224000
NI VDEVFLAG,255-VDEVUC RESET UNIT CHECK FLAG @VA03443 00225000
UNSTKIO ICM R1,7,VDEVIO ANY I/O PENDING? @VA08629 00225050
BZR R2 NO, NOTHING TO UNSTACK @VA08629 00225100
VIORUNQ L R10,IOBFPNT-IOBLOK(R1) GET POINTER TO NEXT @VA08629 00225150
* PRIOR 00225200
LA R0,IOBSIZE SIZE TO RETURN IN DBLWORDS. @VA08629 00225250
CALL DMKFREE RELEASE PENDING INTERRUPTS @VA08629 00225300
LTR R10,R10 ANYMORE ON CHAIN? @VA08629 00225350
BZR R2 NO, RETURN @VA08629 00225400
LR R1,R10 CONTINUE TO STACK @VA08629 00225450
B VIORUNQ ... @VA08629 00225500
BR R2 AND RETURN @VA03443 00226000
DROP R1 NO MORE IOERBLOK 00227000
SPACE 4 00228000
TRANCDE EQU 4 RETURN CODE INDICATING TRANS. @VA09586 00229000
EJECT 00230000
*. 00231000
* SUBROUTINE NAME - 00232000
* 00233000
* DMKVSCAN 00234000
* 00235000
* FUNCTION - 00236000
* 00237000
* TO SCAN A V=R CHANNEL PROGRAM FOR EXCEPTIONAL CONDITIONS, 00238000
* SUCH AS SENSE COMMANDS, NO-OP'S, I/O TO/FROM PAGE 0, ETC., 00239000
* WITHOUT ACTUALLY TRANSLATING THE PROGRAM. 00240000
* 00241000
* ATTRIBUTES - 00242000
* 00243000
* RESIDENT; SERIALLY REUSABLE; CALLED VIA BALR. 00244000
* 00245000
* ENTRY POINT - 00246000
* 00247000
* DMKVSCAN 00248000
* 00249000
* ENTRY CONDITIONS - 00250000
* 00251000
* R8 = ADDRESS OF VDEVBLOK 00252000
* R9 = ADDRESS OF CHANNEL PROGRAM (HIGH-ORDER BYTE = 0 00253000
* R10 = ADDRESS OF IOBLOK 00254000
* R14 = RETURN REGISTER 00255000
* R15 = A(DMKVSCAN) 00256000
* 00257000
* EXIT CONDITIONS - 00258000
* 00259000
* R0-R14 PRESERVED 00260000
* R15 = 0 (AND CONDITION-CODE = 0): 00261000
* CHANNEL PROGRAM IS OSTENSIBLY LEGITIMATE, 00262000
* AND WILL CLEAR ANY OLD SENSE BYTES. 00263000
* R15 = 4 (AND CONDITION-CODE = 2): 00264000
* CHANNEL PROGRAM CONTAINS A SENSE COMMAND 00265000
* BEFORE ANY CCW'S WHICH WOULD CLEAR SENSE BYTES 00266000
* R15 = 8 (AND CONDITION-CODE = 2): 00267000
* CHANNEL PROGRAM CONTAINS ONLY NO-OP AND/OR TIC CCW'S 00268000
* (ANY EXISTING SENSE BYTES WOULD NOT BE CLEARED) 00269000
* R15 = 12 (AND CONDITION-CODE = 2): 00270000
* CHANNEL PROGRAM STARTS IN PAGE 0, BRANCHES OUT OF 00271000
* THE V=R AREA, OR READS INTO OR WRITES FROM PAGE 0 00272000
* (OR OUT OF THE V=R AREA). 00273000
* 00274000
* CALLS TO OTHER ROUTINES - 00275000
* 00276000
* NONE 00277000
* 00278000
* EXTERNAL REFERENCES 00279000
* 00280000
* DMKSLC = END OF V=R AREA 00281000
* 00282000
* TABLES / WORKAREAS - 00283000
* 00284000
* NONE 00285000
* 00286000
* REGISTER USAGE - 00287000
* 00288000
* GPR R0-R9 WORK REGISTERS 00289000
* GPR 14 = RETURN REGISTER 00290000
* GPR 15 = ADDRESSABILITY; RETURN-CODE AT EXIT 00291000
* 00292000
* NOTES - 00293000
* 00294000
* USED TO DETERMINE WHETHER EXISTING SENSE BYTES (IF ANY) 00295000
* NEED TO BE CLEARED, AND WHETHER IT APPEARS SAFE NOT TO 00296000
* TRANSLATE THE CHANNEL PROGRAM, OR IF DMKCCW MUST BE CALLED. 00297000
* 00298000
* OPERATION - 00299000
* 00300000
* 1. CHECKS TO ENSURE THAT THE CHANNEL PROGRAM DOES NOT START 00301000
* IN PAGE 0, OR ABOVE THE V=R AREA (ERROR 12 IF IT DOES). 00302000
* 00303000
* 1A. IF CHANNEL PROGRAM IS FOR TAPE, THEN CHECK FOR 00304000
* BACKSPACE FILE OR FORWARD SPACE FILE CCWS. IF SO 00305000
* THE CONTROL UNIT MUST NOT BE RELEASED AT INITATION. 00306000
* 00307000
* 2. DETERMINES THE TYPE OF CCW FROM THE LAST 4 BITS OF THE OP 00308000
* CODE (USING THE OP CODE OF THE PREVIOUS CCW IF THE PREVIOUS 00309000
* CCW HAD CHAIN-DATA FLAG SET). 00310000
* 00311000
* 3. FOR "WRITE" CCW'S (OP CODE ENDING IN 01, 05, 09, OR 0D), 00312000
* CHECKS THAT THE DATA ADDRESS IS NOT IN PAGE 0, AND THAT THE 00313000
* ENDING ADDRESS IS NOT ABOVE THE V=R AREA (ERROR 12 IF IT IS). 00314000
* IF OK, INCREMENTS INTERNAL COUNT OF "REGULAR" CCW'S. 00315000
* 00316000
* 4. FOR "READ" CCW'S (OP CODE ENDING IN 02, 06, 0A, OR 0E), 00317000
* IF SKIP FLAG IS SET, JUST INCREMENTS THE INTERNAL COUNT OF 00318000
* "REGULAR" CCW'S. IF NOT, CHECKS DATA ADDRESS AS IN STEP 3. 00319000
* 00320000
* 5. FOR "READ BACKWARD" CCW (OP CODE OF 0C), COMPUTES THE 00321000
* "ENDING ADDRESS" (DATA ADDRESS LESS BYTE COUNT), AND THEN 00322000
* HANDLES AS OTHER READ CCW'S IN STEP 4. 00323000
* 00324000
* 6. FOR A "SENSE" TYPE COMMAND (OP CODE OF 04, 94, OR B4), 00325000
* SETS RETURN-CODE INDICATING SENSE WAS FOUND; THEN CHECKS FOR 00326000
* THE SKIP FLAG SET AND VALID DATA ADDRESS AS IN STEP 4, EXCEPT 00327000
* THAT THE COUNT OF "REGULAR" CCW'S IS NOT INCREMENTED. 00328000
* 00329000
* OTHER CCW OP CODES ENDING IN 04 ARE HANDLED AS READ-TYPE 00330000
* CCW'S (STEP 4). 00331000
* 00332000
* 7. FOR A "NO-OP" CCW (OP CODE OF 03), NO ERROR CHECKING IS 00333000
* DONE, AND NO COUNTS ARE INCREMENTED. (IF NO "REGULAR" CCW'S 00334000
* ARE ENCOUNTERED, RETURN-CODE 8 IS GIVEN UPON EXIT.) 00335000
* 00336000
* OTHER CCW OP CODES ENDING IN 03 ARE HANDLED AS CONTROL-TYPE 00337000
* CCW'S (STEP 8). 00338000
* 00339000
* 8. FOR CONTROL CCW'S (OP CODES ENDING IN 03, 07, 0B, OR 0F, 00340000
* EXCEPT FOR NO-OP = 03), THE COUNT OF "REGULAR" CCW'S IS 00341000
* INCREMENTED, BUT NO OTHER ERROR-CHECKING IS DONE. 00342000
* 00343000
* 9. FOR A CCW ENDING IN 00, THE CCW-SCANNING IS TERMINATED, 00344000
* IN STEP 12. 00345000
* 00346000
* 10. FOR A TIC CCW (OP CODE ENDING IN 08), THE ADDRESS IN 00347000
* THE TIC IS CHECKED TO SEE IF IT FALLS WITHIN THE PORTION OF 00348000
* THE CHANNEL PROGRAM CURRENTLY BEING CHECKED. IF SO, THE 00349000
* PREVIOUS CCW IS CHECKED FOR COMMAND-CHAIN OR DATA-CHAIN SET; 00350000
* IF YES, GOES TO HANDLE "NEXT" CCW AS IN STEP 11; IF NOT, 00351000
* TERMINATES CCW-SCANNING IN STEP 12. 00352000
* 00353000
* IF THE TIC POINTS TO A NEW AREA, CHECKS IF IT IS THE FIRST 00354000
* SUCH TIC; IF NOT, TERMINATES CCW-SCANNING IN STEP 12; IF 00355000
* IT IS THE FIRST, POINTS TO NEW SECTION OF CHANNEL PROGRAM 00356000
* AND STARTS CHECKING IT AT STEP 1. 00357000
* 00358000
* 11. UPON COMPLETION OF CHECKING THE CCW (IN STEPS 3-8), 00359000
* CHECKS IF THE CURRENT CCW HAS COMMAND-CHAIN OR DATA-CHAIN 00360000
* SET; IF YES, ADVANCES 8 BYTES TO NEXT CCW AND CONTINUES 00361000
* SCANNING AT STEP 2; IF NOT, TERMINATES SCANNING AT STEP 12. 00362000
* 00363000
* 12. WHEN SCANNING IS COMPLETE (FROM ERROR 12 OR FROM STEP 10 00364000
* OR 11), DETERMINES FROM TENTATIVE RETURN CODE AND THE COUNT 00365000
* OF THE REGULAR CCW'S WHICH RETURN-CODE SHOULD BE GIVEN. 00366000
* SETS RETURN CODE (0, 4, 8, OR 12), SETS CONDITION CODE, 00367000
* RESTORES NECESSARY REGISTERS, AND RETURNS TO CALLER. 00368000
*. 00369000
SPACE 00370000
AIF (NOT &VIRREAL).NOVR12 @VA04320 00371000
SPACE 00372000
ENTRY DMKVSCAN @VA09586 00373000
USING DMKVSCAN,R15 ADDRESSABILITY @VA09586 00374000
DMKVSCAN STM R0,R9,TEMPSAVE SAVE REGS (R0-R9) @VA09849 00375100
SLR R0,R0 CLEAR RETURN-CODE @VA04320 00376000
ST R0,PRVCOMND CLEAR TEMPORARY STORAGE BYTES @VA04320 00377000
SLR R6,R6 CLEAR COUNT OF TIC CCW'S @VA04320 00378000
SLR R7,R7 CLEAR COUNT OF "REGULAR" CCWS @VA04320 00379000
CCWNXT1 LR R2,R9 GET ADDRESS OF CHANNEL PROGRAM @VA04320 00380000
C R2,F4096 IS IT IN PAGE 0 ? @VA04320 00381000
BNL CCWNXT3 IF NOT, OK - START SCANNING. @VA04320 00382000
* ERROR - CHANNEL PROGRAM STARTS IN PAGE 0, EXCEEDS V=R AREA, 00383000
* OR REFERENCES DATA WHICH DOES THE SAME: 00384000
VIOSCERX LA R0,12 ERROR-CODE INTO R0, @VA04320 00385000
B CCWNXT12 GO EXIT. @VA04320 00386000
SPACE 00387000
* MAIN LOOP TO SCAN THE CHANNEL PROGRAM: 00388000
CCWNXT2 LA R2,8(,R2) POINT TO NEXT USER CCW @VA04320 00389000
CCWNXT3 C R2,=V(DMKSLC) CCW OUT OF V=R RANGE ? @VA04320 00390000
BNL VIOSCERX THAT'S A NO-NO. @VA04320 00391000
LH R3,VIRCOMND REMEMBER "PREVIOUS" CCW COMMAND @VA04320 00392000
* & FLAGS 00393000
STH R3,PRVCOMND ... @VA04320 00394000
LM R3,R4,0(R2) GET CCW COMMAND FROM USER'S PAGE,@VA04320 00395000
LA R1,0(,R3) ADDRESS BITS ONLY INTO R1 @VA04320 00396000
IC R5,0(,R2) PICK UP CCW OP-CODE @VA04320 00397000
CLI 0(R2),X'2F' BACKSPACE FILE ? @VA08687 00398000
BE CHTAPE YES, SEE IF FOR TAPE DEVICE @VA08687 00399000
CLI 0(R2),X'3F' FORWARDSPACE FILE ? @VA08687 00400000
BNE CCWOK NO, CCW IS OK @VA08687 00401000
CHTAPE EQU * @VA08687 00402000
L R8,BALR8 ADDRESS OF VDEVBLOK @VA08687 00403000
TM VDEVTYPC,CLASTAPE TAPE DEVICE ? @VA08687 00404000
BZ CCWOK NO, CCW IS OK @VA08890 00405000
NI IOBFLAG,255-IOBRELCU DO NOT RELEASE CU AT INIT @VA08687 00406000
CCWOK EQU * @VA08687 00407000
N R5,F15 ISOLATE LAST 4 BITS PLEASE @VA04320 00408000
TM PRVFLAG,CD DID "PREVIOUS" CCW HAVE @VA04320 00409000
* CHAIN-DATA SET ? 00410000
BO CCWNXT5 TRF IF YES - BEWARE OF POSSIBLE @VA04320 00411000
* TIC 00412000
STCM R3,8,VIRCOMND IF NOT, REMEMBER OPCODE. @VA04320 00413000
CCWNXT4 STCM R4,8,VIRFLAG REMEMBER CCW+4 = FLAG BITS @VA04320 00414000
IC R5,VIOSCJMP(R5) GET INDEXER FROM THE JUMP TABLE @VA04320 00415000
ALR R5,R5 MUST DOUBLE IT, @VA04320 00416000
B VIOJMP(R5) AND GO "TO THE RIGHT PLACE", @VA04320 00417000
* PER THE LAST 4 BITS OF THE CCW OP-CODE. 00418000
SPACE 00419000
* IF PREVIOUS CCW WAS DATA-CHAINED, LOOK FOR TIC AS THIS COMMAND: 00420000
CCWNXT5 CL R5,F8 IS IT A 'TIC' = '08' ? @VA04320 00421000
BE VIOSC08T BRANCH IF YES. @VA04320 00422000
* OTHERWISE: 00423000
IC R5,VIRCOMND PICK UP OLD CCW OP-CODE @VA04320 00424000
N R5,F15 ISOLATE LAST 4 BITS PLEASE @VA04320 00425000
B CCWNXT4 AND PROCEED USING OLD OP-CODE. @VA04320 00426000
SPACE 00427000
VIOJMP DS 0H "BASE" FOR CODE TO BE "JUMPED TO"@VA04320 00428000
SPACE 00429000
* TIC COMMAND CODE: 00430000
VIOSC08 MVI VIRFLAG,X'00' CLEAR FLAG-BYTE, @VA04320 00431000
VIOSC08T CR R1,R9 TIC TO SOME NEW PLACE ? @VA04320 00432000
BL VIOSC08A YES - BRANCH. @VA04320 00433000
CR R1,R2 IN PRECEDING SECTION OF CODE ? @VA04320 00434000
BNL VIOSC08A NO - BRANCH. @VA04320 00435000
LA R1,8(,R1) 8 BYTES BEYOND TIC-TO ADDRESS @VA04320 00436000
CR R1,R2 IS THIS A TIC TO *-8 ? @VA04320 00437000
BNE CCWNXT11 NO - TIME TO EXIT @VA04320 00438000
CLI VDEVTYPC,CLASTERM TERMINAL ? @VA09352 00438100
BNE CCWNXT2 NO @VA14146 00438210
CLI PRVCOMND,X'09' AUTOPOLL CCW ? @VA09352 00438300
BE CCWNXT2 YES, IT SETS STATUS @VA14146 00438410
CLI PRVCOMND,X'1E' PREPARE CCW ? @VA09352 00438500
BNE CCWNXT11 NO, THIS IS END OF CCWS @VA09352 00438600
B CCWNXT2 LOOK AT NEXT CCW IN STRING @VA14146 00438710
SPACE 00441000
* TIC TO "SOME NEW PLACE": 00442000
VIOSC08A LA R6,1(,R6) BUMP COUNT OF NEW TIC'S @VA04320 00443000
C R6,F1 MORE THAN 1 ? @VA04320 00444000
BH CCWNXT11 YES - THAT'S ENOUGH. @VA04320 00445000
TM 3(R2),07 IS ADDRESS DBL-WORD ALIGNED? @VA05709 00446000
BZ TICOK YES, CONTINUE @VA05709 00447000
S R1,F1 NO, REALIGN FOR DYNAMIC BUFFERING@VA05709 00448000
TICOK LR R9,R1 FIRST ONE - POINT TO NEW STRING @VA05709 00449000
B CCWNXT1 AND START CHECKING IT. @VA04320 00450000
SPACE 00451000
* POSSIBLE NO-OP CCW: 00452000
VIOSC03 CLI VIRCOMND,X'03' IS IT A NO-OP ? @VA04320 00453000
BE CCWNXT9 YES - JUST CHECK CC+CD FLAG. @VA04320 00454000
B VIOSC07 NO - TREAT AS OTHER "CONTROL" CCW@VA04320 00455000
SPACE 00456000
* POSSIBLE SENSE-TYPE CCW: 00457000
VIOSC04 CLI VIRCOMND,X'04' USUAL "SENSE" OP-CODE ? @VA04320 00458000
BE VIOSC04A YES. @VA04320 00459000
CLI VIRCOMND,X'94' OR RESERVE/RELEASE ? @VA04320 00460000
BE VIOSC04A YES. @VA04320 00461000
CLI VIRCOMND,X'B4' ONE MORE CHECK ... @VA04320 00462000
BNE VIOSC02 BR. IF NOT SENSE/RESERVE/RELEASE @VA04320 00463000
* SENSE, RESERVE, OR RELEASE: 00464000
VIOSC04A S R7,F1 HAVE WE HAD ANY OTHER CCW'S YET? @VA04320 00465000
* (DECR TO COMPENSATE FOR ADD BELOW) 00466000
BNM VIOSC02 YES - KEEP OLD RETURN CODE. @VA04320 00467000
LA R0,4 NO - INDICATE SENSE FOUND @VA04320 00468000
B VIOSC02 GO CHECK SKIP FLAG & ADDRESS @VA04320 00469000
SPACE 00470000
* READ BACKWARD CCW: 00471000
VIOSC0C TM VIRFLAG,IDA IDA SET ONCE IN A MILLION YEARS? @VA04320 00472000
BZ CCWNXT7 NOT TODAY @VA04320 00473000
C R1,=V(DMKSLC) IS IDAL TO HIGH ? @VA09352 00473200
BNL VIOSCERX YES, BAD @VA09352 00473400
C R1,F4096 IS IDAL IN PAGE 0 ? @VA09352 00473600
BL VIOSCERX YES, BAD @VA09352 00473800
L R1,0(,R1) YES - GET THE "REAL" ADDRESS @VA04320 00474000
C R1,=V(DMKSLC) IS IDAL ADDRESS TOO BIG? @VA05892 00475000
BNL VIOSCERX TOO BAD @VA05892 00476000
C R1,F4096 IS HIS PAGE 0? @VA05892 00477000
BL VIOSCERX YES, HANDS OFF OURS @VA05892 00478000
NI VIRFLAG,X'FF'-IDA TURN OFF THE FLAG (FOR BELOW) @VA04320 00479000
CCWNXT7 N R4,XRIGHT16 ISOLATE BYTE COUNT, @VA04320 00480000
BCTR R4,0 (LESS 1), AND COMPUTE @VA04320 00481000
SR R1,R4 ADDRESS OF "LAST" BYTE OF DATA @VA04320 00482000
* CONTINUE: 00483000
* READ (FORWARD) CCW: 00484000
VIOSC02 TM VIRFLAG,SKIP SKIP FLAG ON ? @VA04320 00485000
BO VIOSC07 YES - ADDRESS IS IRRELEVANT. @VA04320 00486000
* NO - CONTINUE: 00487000
* "WRITE" CCW: 00488000
VIOSC01 TM VIRFLAG,IDA IDA SET ONCE IN A GREAT WHILE ? @VA04320 00489000
BZ CCWNXT8 NOT THIS TIME @VA09352 00490100
C R1,=V(DMKSLC) IS IDAL TO HIGH ? @VA09352 00490700
BNL VIOSCERX YES, BAD @VA09352 00491300
C R1,F4096 IS IDAL IN PAGE 0 ? @VA09352 00491900
BL VIOSCERX YES, BAD @VA09352 00492500
L R1,0(,R1) GET REAL ADDRESS @VA09352 00493100
CCWNXT8 C R1,F4096 DOES ADDRESS REFERENCE PAGE 0 ? @VA04320 00494000
BL VIOSCERX THAT'S A NO-NO. @VA04320 00495000
N R4,XRIGHT16 ISOLATE BYTE COUNT, @VA04320 00496000
AR R1,R4 COMPUTE END OF DATA AREA, @VA04320 00497000
C R1,=V(DMKSLC) EXCEEDS V=R AREA ? @VA04320 00498000
BH VIOSCERX THAT'S NO GOOD, EITHER. @VA04320 00499000
* OK - CONTINUE: 00500000
* "CONTROL" CCW (OTHER THAN NO-OP): 00501000
VIOSC07 A R7,F1 BUMP COUNT OF "REGULAR" CCW'S @VA04320 00502000
* CONTINUE: 00503000
CCWNXT9 TM VIRFLAG,CC+CD COMMAND OR DATA-CHAINED ? @VA04320 00504000
CCWNXT10 BNZ CCWNXT2 YES - GO GET "NEXT" CCW. @VA04320 00505000
SPACE 00506000
* WHEN ALL THRU, EXIT: 00507000
CCWNXT11 LTR R7,R7 ANY "REGULAR" CCW'S ? @VA04320 00508000
BP CCWNXT12 YES - GO EXIT (R0 IS OK). @VA04320 00509000
LTR R0,R0 IS R0 > 0 ? @VA04320 00510000
BP CCWNXT12 YES (= 4) - LEAVE IT AS IS @VA04320 00511000
LA R0,8 IF NOT, SET RETURN-CODE = 8 @VA04320 00512000
CCWNXT12 LTR R15,R0 RETURN-CODE INTO R15 (& SET CC) @VA04320 00513000
LM R0,R9,TEMPSAVE RESTORE REGS (R0-R9) @VA09849 00514100
BR R14 AND RETURN TO CALLER. @VA04320 00515000
SPACE 00516000
* "INVALID" COMMAND-CODE (LAST 4 BITS OF OP-CODE = 0) 00517000
VIOSC00 EQU CCWNXT11 (TREAT AS "OK", BUT TERMINATE @VA04320 00518000
* SCAN) 00519000
SPACE 00520000
LTORG @VA04320 00521000
SPACE 00522000
* JUMP TABLE DEPENDING ON LAST 4 BITS OF OP-CODE: 00523000
* WHERE TO GO: OP-CODE: 00524000
VIOSCJMP DC AL1((VIOSC00-VIOJMP)/2) 00 ENDS STRING @VA04320 00525000
DC AL1((VIOSC01-VIOJMP)/2) 01 WRITE @VA04320 00526000
DC AL1((VIOSC02-VIOJMP)/2) 02 READ @VA04320 00527000
DC AL1((VIOSC03-VIOJMP)/2) 03 NO-OP OR CONTROL @VA04320 00528000
DC AL1((VIOSC04-VIOJMP)/2) 04 SENSE OR READ @VA04320 00529000
DC AL1((VIOSC01-VIOJMP)/2) 05 WRITE @VA04320 00530000
DC AL1((VIOSC02-VIOJMP)/2) 06 READ @VA04320 00531000
DC AL1((VIOSC07-VIOJMP)/2) 07 CONTROL @VA04320 00532000
DC AL1((VIOSC08-VIOJMP)/2) 08 TIC @VA04320 00533000
DC AL1((VIOSC01-VIOJMP)/2) 09 WRITE @VA04320 00534000
DC AL1((VIOSC02-VIOJMP)/2) 0A READ @VA04320 00535000
DC AL1((VIOSC07-VIOJMP)/2) 0B CONTROL @VA04320 00536000
DC AL1((VIOSC0C-VIOJMP)/2) 0C READ BACKWARD @VA04320 00537000
DC AL1((VIOSC01-VIOJMP)/2) 0D WRITE @VA04320 00538000
DC AL1((VIOSC02-VIOJMP)/2) 0E READ @VA04320 00539000
DC AL1((VIOSC07-VIOJMP)/2) 0F CONTROL @VA04320 00540000
SPACE 00541000
* TEMPORARY STORAGE: 00542000
DS 0F KEEP THE FOLLOWING FOUR IN ORDER:@VA04320 00543000
PRVCOMND DC 1X'00' "PREVIOUS" CCW COMMAND CODE @VA04320 00544000
PRVFLAG DC 1X'00' "PREVIOUS" CCW FLAG BITS @VA04320 00545000
VIRCOMND DC 1X'00' "THIS" VIRTUAL CCW COMMAND CODE @VA04320 00546000
VIRFLAG DC 1X'00' "THIS" VIRTUAL CCW FLAG BITS @VA04320 00547000
SPACE 00548000
.NOVR12 ANOP @VA04320 00549000
EJECT 00550000
COPY VBLOKS @VA04320 00551000
OSVSCOM MSSCOM @V60B6B8 00552000
COPY VCTCA @VA04320 00553000
COPY RBLOKS @VA04320 00554000
COPY VMBLOK @VA04320 00555000
COPY TREXT @VA04320 00556000
COPY IOBLOKS @VA04320 00557000
COPY IOER @VA04320 00558000
PSA @VA04320 00559000
COPY DEVTYPES @VA04320 00560000
COPY EQU @VA04320 00561000
COPY SAVE @VA08305 00562000
END DMKVSC @VA09586 00563000