SCN TITLE 'DMKSCN (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 VALIDATE SEQUENCING OF INPUT @V200820 00002000
DMKSCN CSECT 00003000
SPACE 00004000
USING PSA,R0 00005000
SPACE 1 00006000
*. 00007000
* MODULE NAME - 00008000
* 00009000
* DMKSCN 00010000
* 00011000
* CONTENTS - 00012000
* 00013000
* DMKSCNRU - FIND THE BLOCKS FOR A GIVEN REAL DEVICE ADDRESS 00014000
* DMKSCNVU - FIND THE BLOCKS FOR A GIVEN VIRTUAL DEVICE ADDRESS 00015000
* DMKSCNVS - SEARCH FOR A DEVICE WITH A GIVEN SERIAL NUMBER 00016000
* DMKSCNRD - COMPUTE FULL REAL DEVICE ADDRESS (IN CCU FORM) 00017000
* DMKSCNVD - COMPUTE VIRTUAL DEVICE ADDRESS ETC. FROM VDEVBLOK 00018000
* DMKSCNAU - FIND THE VMBLOK WITH A GIVEN USERID 00019000
* DMKSCNFD - FIND THE NEXT FIELD IN THE INPUT BUFFER 00020000
* DMKSCNLI - SEARCH VIRTUAL MACHINES FOR LINKS TO GIVEN MINIDISK 00021000
* DMKSCNRN - FIND DEVICE NAME FOR GIVEN REAL DEV ADDRESS 00022000
* DMKSCNVN - FIND DEVICE NAME FOR GIVEN VIRT DEV ADDRESS 00023000
EJECT 00024000
* SUBROUTINE NAME - 00025000
* 00026000
* DMKSCNRU - FIND THE BLOCKS FOR A GIVEN REAL DEVICE ADDRESS 00027000
* 00028000
* FUNCTION - 00029000
* 00030000
* TO RETURN TO THE CALLER THE ADDRESSES OF THE REAL CHANNEL, 00031000
* CONTROL UNIT, AND DEVICE BLOCKS FOR A GIVEN REAL DEVICE. 00032000
* 00033000
* ATTRIBUTES - 00034000
* 00035000
* REENTRANT, RESIDENT, CALLED VIA BALR 00036000
* 00037000
* ENTRY POINT - 00038000
* 00039000
* DMKSCNRU 00040000
* 00041000
* ENTRY CONDITIONS - 00042000
* 00043000
* GPR 1 CONTAINS THE REAL DEVICE ADDRESS 00044000
* GPR 14 = RETURN ADDRESS 00045000
* GPR 15 = ADDRESS OF DMKSCNRU 00046000
* 00047000
* EXIT CONDITIONS - 00048000
* 00049000
* CC = 0 IF ALL BLOCKS ARE FOUND (GPR 6, 7, & 8 ARE VALID) 00050000
* CC = 1 IF CHANNEL BLOCK NOT FOUND (NO REGISTERS VALID) 00051000
* CC = 2 IF CONTROL UNIT BLOCK NOT FOUND (GPR 6 IS VALID) 00052000
* CC = 3 IF DEVICE BLOCK NOT FOUND (GPR 6 AND 7 ARE VALID) 00053000
* NOTE: IF GPR 6, 7 OR 8 ARE NOT VALID THEY WILL BE SET TO -1 00054000
* 00055000
* GPR 1 STILL CONTAINS THE REAL DEVICE ADDRESS 00056000
* GPR 6 POINTS TO THE REAL CHANNEL BLOCK (RCHBLOK) 00057000
* GPR 7 POINTS TO THE REAL CONTROL UNIT BLOCK (RCUBLOK) 00058000
* GPR 8 POINTS TO THE REAL DEVICE BLOCK (RDEVBLOK) 00059000
* 00060000
* CALLS TO OTHER ROUTINES - 00061000
* 00062000
* NONE 00063000
* 00064000
* EXTERNAL REFERENCES - 00065000
* 00066000
* DMKRIOCT - REAL CHANNEL TABLE (INDEX TO REAL CHANNEL BLOCKS) 00067000
* DMKRIOCH - START OF REAL CHANNEL BLOCKS 00068000
* DMKRIOCU - START OF REAL CONTROL UNIT BLOCKS 00069000
* DMKRIODV - START OF REAL DEVICE BLOCKS 00070000
* 00071000
* TABLES / WORK AREAS - 00072000
* 00073000
* NONE 00074000
EJECT 00075000
* REGISTER USAGE - 00076000
* 00077000
* GPR 1 = DEVICE ADDRESS 00078000
* GPR 6 = CHANNEL BLOCK ADDRESS 00079000
* GPR 7 = CONTROL UNIT BLOCK ADDRESS 00080000
* GPR 8 = DEVICE BLOCK ADDRESS 00081000
* GPR 14 = RETURN ADDRESS 00082000
* GPR 15 = BASE ADDRESS 00083000
* 00084000
* GPR 0, 2-5, & 9-13 ARE NOT USED. 00085000
* 00086000
* NOTES - 00087000
* 00088000
* THE CHANNEL, CONTROL UNIT, AND DEVICE TABLES CONTAIN HALFWORD 00089000
* INDICES INTO THE STRINGS OF CHANNEL, CONTROL UNIT, AND DEVICE 00090000
* BLOCKS RESPECTIVELY. A NEGATIVE INDEX VALUE INDICATES THAT 00091000
* THE UNIT DOES NOT EXIST. 00092000
* 00093000
* SINCE DMKSCNRU DOES NOT USE TEMPSAVE OR BALRSAVE, IT CAN BE 00094000
* CALLED BY A ROUTINE WHICH IS ITSELF CALLED VIA BALR, AS LONG 00095000
* AS THAT ROUTINE PRESERVES GPR 14 AND 15 WHEN CALLING DMKSCNRU. 00096000
* 00097000
* OPERATION - 00098000
* 00099000
* 1. THE CHANNEL BITS OF THE REAL DEVICE ARE INDEXED BY 00100000
* DMKRIOCT AND DMKRIOCH TO PRODUCE THE ADDRESS OF THE REAL 00101000
* CHANNEL BLOCK (RCHBLOK) IN GPR 6 (IF IT EXISTS). 00102000
* 00103000
* 2. THE CONTROL UNIT BITS OF THE REAL DEVICE ARE INDEXED BY THE 00104000
* RCHBLOK (FROM STEP 1) AND DMKRIOCU TO PRODUCE THE ADDRESS OF 00105000
* THE REAL CONTROL UNIT BLOCK (RCUBLOK) IN GPR 7 (IF IT EXISTS). 00106000
* 00107000
* 3. THE DEVICE BITS OF THE REAL DEVICE ARE INDEXED BY THE 00108000
* RCUBLOK (FROM STEP 2) AND DMKRIODV TO PRODUCE THE ADDRESS OF 00109000
* THE REAL DEVICE BLOCK (RDEVBLOK) IN GPR 8 (IF IT EXISTS). 00110000
*. 00111000
EJECT 00112000
*********************************************************************** 00113000
* * 00114000
* FIND THE REAL CHANNEL, CONTROL UNIT, AND DEVICE BLOCKS * 00115000
* * 00116000
*********************************************************************** 00117000
SPACE 00118000
*. 00119000
*********************************************************************** 00120000
* 00121000
* 00122000
* CP ASSIST INSTRUCTION "SCNRU" - GET REAL I/O CONTROL BLOCKS 00123000
* 00124000
* 00125000
* OPERANDS: 00126000
* 1 = REAL DEVICE ADDRESS (RIGHT JUSTIFIED) 00127000
* 2 = ADDRESS OF 'ARIOCT' (START OF 16-BYTE DATA LIST) 00128000
* 00129000
* REGISTER INPUT: 00130000
* GPR 14 = EXIT ADDRESS 00131000
* 00132000
* SYSTEM DATA AREAS REFERENCED (BY MODULE): 00133000
* DMKPSA - 'ARIOCT', 'ARIOCH', 'ARIOCU', AND 'ARIODV' 00134000
* DMKRIO - 'DMKRIOCT', RCHBLOK, RCUBLOK 00135000
* 00136000
* 00137000
* EXITS: 00138000
* 00139000
* 1. ADDRESS IN GPR 14 (NORMAL COMPLETION) 00140000
* 00141000
* REGISTER OUTPUT: 00142000
* GPR 6 = ADDRESS OF RCHBLOK (OR -1 IF NO RCHBLOK) 00143000
* GPR 7 = ADDRESS OF RCUBLOK (OR -1 IF NO RCUBLOK) 00144000
* GPR 8 = ADDRESS OF RDEVBLOK (OR -1 IF NO RDEVBLOK) 00145000
* NOTE: THE CONDITION CODE IS SET TO 0, 1, 2, OR 3. 00146000
* 00147000
* 2. NEXT SEQUENTIAL INSTRUCTION (ABNORMAL COMPLETION) 00148000
* 00149000
* NOTE: THIS EXIT IS FUNCTIONALLY EQUIVALENT TO A NO-OP. 00150000
* 00151000
*********************************************************************** 00152000
*. 00153000
SPACE 00154000
ENTRY DMKSCNRU 00155000
DMKSCNRU DS 0D (DBL-WORD-ALIGNED FOR BEST PERF) %V3M4038 00156000
USING *,R15 %V3M4038 00157000
SPACE 00158000
DS 0H EXECUTE CP ASSIST "SCNRU" @V3M4026 00159000
DC X'E60E',S(0(R1),ARIOCT) ***@V386198 00160000
SPACE 00161000
LA R6,X'F00' ISOLATE THE CHANNEL BITS %V3M4038 00162000
NR R6,R1 FROM THE DEVICE-ADDRESS %V3M4038 00163000
SRL R6,7 CHANNEL ADDRESS * 2 %V3M4038 00164000
A R6,ARIOCT ADD CHANNEL TABLE ADDRESS %V3M4038 00165000
LH R6,0(,R6) LOAD RCHBLOK INDEX %V3M4038 00166000
LTR R7,R6 DOES CHANNEL EXIST ? %V3M4038 00167000
BM FFR8 RETURN CC = 1 AND REG 6,7,8 = -1 %V3M4038 00168000
A R6,ARIOCH COMPUTE RCHBLOK ADDRESS %V3M4038 00169000
USING RCHBLOK,R6 %V3M4038 00170000
LA R7,X'0F8' ISOLATE THE CONTROL-UNIT BITS %V3M4038 00171000
NR R7,R1 FROM THE DEVICE-ADDRESS %V3M4038 00172000
SRL R7,2 CU ADDRESS * 2 %V3M4038 00173000
LH R7,RCHCUTBL(R7) LOAD CONTROL UNIT INDEX %V3M4038 00174000
LTR R7,R7 DOES CONTROL UNIT EXIST ? %V3M4038 00175000
BNM COMPRCUB YES %V3M4038 00176000
LA R7,X'0F0' ISOLATE THE CONTROL-UNIT BITS %V3M4038 00177000
NR R7,R1 FROM THE DEVICE-ADDRESS %V3M4038 00178000
SRL R7,2 ALTERNATE CU ADDRESS * 2 %V3M4038 00179000
LH R7,RCHCUTBL(R7) LOAD CONTROL UNIT INDEX %V3M4038 00180000
LTR R8,R7 DOES CONTROL UNIT EXIST ? %V3M4038 00181000
BM SETCC2 BRANCH IF NO %V3M4038 00182000
COMPRCUB A R7,ARIOCU COMPUTE RCUBLOK ADDRESS %V3M4038 00183000
USING RCUBLOK,R7 %V3M4038 00184000
LA R8,X'00F' ISOLATE THE DEVICE BITS %V3M4038 00185000
NR R8,R1 FROM THE DEVICE-ADDRESS %V3M4038 00186000
AR R8,R8 DEVICE ADDRESS * 2 %V3M4038 00187000
LH R8,RCUDVTBL(R8) LOAD RDEVBLOK INDEX %V3M4038 00188000
TM RCUTYPE,RCUSUB IS THIS A SUBORDINATE CU %V3M4038 00189000
BZ *+8 NO- BRANCH %V3M4038 00190000
L R7,RCUPRIME YES- POINT TO THE PRIME CU %V3M4038 00191000
LTR R8,R8 DOES DEVICE EXIST ? %V3M4038 00192000
BM SETCC3 BRANCH IF NO %V3M4038 00193000
SLL R8,3(0) CONVERT TO BYTE INDEX %V3M4038 00194000
A R8,ARIODV COMPUTE RDEVBLOK ADDRESS %V3M4038 00195000
SR R15,R15 SET CC = 0 (AND CLEAR R15) %V3M4038 00196000
BR R14 AND RETURN TO CALLER. %V3M4038 00197000
DROP R6,R7 00198000
EJECT 00199000
*. 00200000
* SUBROUTINE NAME - 00201000
* 00202000
* DMKSCNVU - FIND THE BLOCKS FOR A GIVEN VIRTUAL DEVICE ADDRESS 00203000
* 00204000
* FUNCTION - 00205000
* 00206000
* TO RETURN TO THE CALLER THE ADDRESSES OF THE VIRTUAL CHANNEL, 00207000
* CONTROL UNIT, AND DEVICE BLOCKS FOR A GIVEN VIRTUAL DEVICE. 00208000
* 00209000
* ATTRIBUTES - 00210000
* 00211000
* REENTRANT, RESIDENT, CALLED VIA BALR 00212000
* 00213000
* ENTRY POINT - 00214000
* 00215000
* DMKSCNVU 00216000
* 00217000
* ENTRY CONDITIONS - 00218000
* 00219000
* GPR 1 CONTAINS THE VIRTUAL DEVICE ADDRESS 00220000
* GPR 11 CONTAINS THE VMBLOK ADDRESS 00221000
* GPR 14 = RETURN ADDRESS 00222000
* GPR 15 = ADDRESS OF DMKSCNVU 00223000
* 00224000
* EXIT CONDITIONS - 00225000
* 00226000
* CC = 0 IF ALL BLOCKS ARE FOUND (GPR 6, 7, & 8 ARE VALID) 00227000
* CC = 1 IF CHANNEL BLOCK NOT FOUND (NO REGISTERS VALID) 00228000
* CC = 2 IF CONTROL UNIT BLOCK NOT FOUND (GPR 6 IS VALID) 00229000
* CC = 3 IF DEVICE BLOCK NOT FOUND (GPR 6 AND 7 ARE VALID) 00230000
* NOTE: IF GPR 6, 7 OR 8 ARE NOT VALID THEY WILL BE SET TO -1 00231000
* 00232000
* GPR 1 STILL CONTAINS THE VIRTUAL DEVICE ADDRESS 00233000
* GPR 6 POINTS TO THE VIRTUAL CHANNEL BLOCK (VCHBLOK) 00234000
* GPR 7 POINTS TO THE VIRTUAL CONTROL UNIT BLOCK (VCUBLOK) 00235000
* GPR 8 POINTS TO THE VIRTUAL DEVICE BLOCK (VDEVBLOK) 00236000
* 00237000
* CALLS TO OTHER ROUTINES - 00238000
* 00239000
* NONE 00240000
* 00241000
* EXTERNAL REFERENCES - 00242000
* 00243000
* NONE 00244000
EJECT 00245000
* TABLES / WORK AREAS - 00246000
* 00247000
* NONE 00248000
* THE UNIT DOES NOT EXIST. 00249000
* 00250000
* SINCE DMKSCNVU DOES NOT USE TEMPSAVE OR BALRSAVE, IT CAN BE 00251000
* CALLED BY A ROUTINE WHICH IS ITSELF CALLED VIA BALR, AS LONG 00252000
* AS THAT ROUTINE PRESERVES GPR 14 AND 15 WHEN CALLING DMKSCNVU. 00253000
* 00254000
* OPERATION - 00255000
* 00256000
* 1. THE CHANNEL BITS OF THE VIRTUAL DEVICE ARE INDEXED BY 00257000
* THE CHANNEL TABLE (VMCHTBL) AND VMCHSTRT (BOTH IN THE USER'S 00258000
* VMBLOK) TO PRODUCE THE ADDRESS OF THE VIRTUAL CHANNEL BLOCK 00259000
* (VCHBLOK) IN GPR 6 (IF IT EXISTS). 00260000
* 00261000
* 2. THE CONTROL UNIT BITS OF THE VIRTUAL DEVICE ARE INDEXED BY 00262000
* THE VCHBLOK (FROM STEP 1) AND VMCUSTRT (IN THE VMBLOK) TO 00263000
* PRODUCE THE ADDRESS OF THE VIRTUAL CONTROL UNIT BLOCK 00264000
* (VCUBLOK) IN GPR 7 (IF IT EXISTS). 00265000
* 00266000
* 3. THE DEVICE BITS OF THE VIRTUAL DEVICE ARE INDEXED BY THE 00267000
* VCUBLOK (FROM STEP 2) AND VMDVSTRT (IN THE VMBLOK) TO 00268000
* PRODUCE THE ADDRESS OF THE VIRTUAL DEVICE BLOCK 00269000
* (VDEVBLOK) IN GPR 8 (IF IT EXISTS). 00270000
*. 00271000
EJECT 00272000
*********************************************************************** 00273000
* * 00274000
* FIND THE VIRTUAL CHANNEL, CONTROL UNIT, AND DEVICE BLOCKS * 00275000
* * 00276000
*********************************************************************** 00277000
SPACE 00278000
*. 00279000
*********************************************************************** 00280000
* 00281000
* 00282000
* CP ASSIST INSTRUCTION "SCNVU" - GET VIRTUAL I/O CONTROL BLOCKS 00283000
* 00284000
* 00285000
* OPERANDS: 00286000
* 1 = ADDRESS OF 'VMCHTBL' FROM USER'S VMBLOK 00287000
* 2 = ADDRESS OF 'VMCHSTRT' (START OF 12-BYTE DATA LIST) 00288000
* 00289000
* REGISTER INPUT: 00290000
* GPR 1 = VIRTUAL DEVICE ADDRESS (RIGHT JUSTIFIED) 00291000
* GPR 14 = EXIT ADDRESS 00292000
* 00293000
* SYSTEM DATA AREAS REFERENCED: 00294000
* VCHBLOK, VCUBLOK, VDEVBLOK, VMBLOK 00295000
* 00296000
* 00297000
* EXITS: 00298000
* 00299000
* 1. ADDRESS IN GPR 14 (NORMAL COMPLETION) 00300000
* 00301000
* REGISTER OUTPUT: 00302000
* GPR 6 = ADDRESS OF VCHBLOK (OR -1 IF NO VCHBLOK) 00303000
* GPR 7 = ADDRESS OF VCUBLOK (OR -1 IF NO VCUBLOK) 00304000
* GPR 8 = ADDRESS OF VDEVBLOK (OR -1 IF NO VDEVBLOK) 00305000
* NOTE: THE CONDITION CODE IS SET TO 0, 1, 2, OR 3. 00306000
* 00307000
* 2. NEXT SEQUENTIAL INSTRUCTION (ABNORMAL COMPLETION) 00308000
* 00309000
* NOTE: THIS EXIT IS FUNCTIONALLY EQUIVALENT TO A NO-OP. 00310000
* 00311000
*********************************************************************** 00312000
*. 00313000
SPACE 00314000
ENTRY DMKSCNVU 00315000
DMKSCNVU DS 0D (DBL-WORD-ALIGNED FOR BEST PERF) %V3M4038 00316000
USING *,R15 %V3M4038 00317000
USING VMBLOK,R11 %V3M4038 00318000
SPACE 00319000
DS 0H EXECUTE CP ASSIST "SCNVU" %V3M4038 00320000
DC X'E606',S(VMCHTBL,VMCHSTRT) ***%V3M4038 00321000
SPACE 00322000
LA R6,X'F00' ISOLATE THE CHANNEL BITS %V3M4038 00323000
NR R6,R1 FROM THE DEVICE-ADDRESS %V3M4038 00324000
SRL R6,7 CHANNEL ADDRESS * 2 %V3M4038 00325000
LH R6,VMCHTBL(R6) LOAD VCHBLOK INDEX %V3M4038 00326000
LTR R7,R6 DOES CHANNEL EXIST ? %V3M4038 00327000
BM FFR8 RETURN CC = 1 AND REG 6,7,8 = -1 %V3M4038 00328000
A R6,VMCHSTRT COMPUTE VCHBLOK ADDRESS %V3M4038 00329000
USING VCHBLOK,R6 %V3M4038 00330000
LA R7,X'0F0' ISOLATE THE CONTROL-UNIT BITS %V3M4038 00331000
NR R7,R1 FROM THE DEVICE-ADDRESS %V3M4038 00332000
SRL R7,3 CU ADDRESS * 2 %V3M4038 00333000
LH R7,VCHCUTBL(R7) LOAD CONTROL UNIT INDEX %V3M4038 00334000
LTR R8,R7 DOES CONTROL UNIT EXIST ? %V3M4038 00335000
BM SETCC2 BRANCH IF NO %V3M4038 00336000
A R7,VMCUSTRT COMPUTE VCUBLOK ADDRESS %V3M4038 00337000
USING VCUBLOK,R7 %V3M4038 00338000
LA R8,X'00F' ISOLATE THE DEVICE BITS %V3M4038 00339000
NR R8,R1 FROM THE DEVICE-ADDRESS %V3M4038 00340000
AR R8,R8 DEVICE ADDRESS * 2 %V3M4038 00341000
LH R8,VCUDVTBL(R8) LOAD VDEVBLOK INDEX %V3M4038 00342000
LTR R8,R8 DOES DEVICE EXIST ? %V3M4038 00343000
BM SETCC3 BRANCH IF NO %V3M4038 00344000
A R8,VMDVSTRT COMPUTE VDEVBLOK ADDRESS %V3M4038 00345000
USING VDEVBLOK,R8 %V3M4038 00346000
TM VDEVFLAG,VDEVDET IS VIR DEV BEING DETACHED? %V3M4038 00347000
BO SETCC3A YES - CC3 DEV DOES NOT EXIST %VA05925 00348000
SR R15,R15 SET CC = 0 (AND CLEAR R15) %V3M4038 00349000
BR R14 AND RETURN TO CALLER. %V3M4038 00350000
DROP R6,R7,R8,R11 %V3M4038 00351000
SPACE 00352000
FFR8 LR R8,R7 SET R8 TO -1 %V3M4038 00353000
BR R14 RETURN TO CALLER (CC = 1) %V3M4038 00354000
EJECT 00355000
*. 00356000
* SUBROUTINE NAME - 00357000
* 00358000
* DMKSCNVS - SEARCH FOR A DEVICE WITH A GIVEN SERIAL NUMBER 00359000
* 00360000
* FUNCTION - 00361000
* 00362000
* TO SEARCH ALL THE REAL DEVICE BLOCKS FOR A DEVICE WHOSE VOLUME 00363000
* SERIAL NUMBER MATCHES THE ONE POINTED TO BY REGISTER 1. 00364000
* 00365000
* ATTRIBUTES - 00366000
* 00367000
* REENTRANT, RESIDENT, CALLED VIA BALR 00368000
* 00369000
* ENTRY POINT - 00370000
* 00371000
* DMKSCNVS 00372000
* 00373000
* ENTRY CONDITIONS - 00374000
* 00375000
* GPR 0 CONTAINS THE LENGTH OF THE SERIAL NUMBER 00376000
* GPR 1 POINTS TO THE VOLUME SERIAL NUMBER TO BE SEARCHED FOR 00377000
* GPR 14 = RETURN ADDRESS 00378000
* GPR 15 = ADDRESS OF DMKSCNVS 00379000
* 00380000
* EXIT CONDITIONS - 00381000
* 00382000
* CC = 0 IF A MATCH IS FOUND (GPR 1 IS VALID) 00383000
* CC = 1 IF NO MATCH IS FOUND (GPR 1 IS ZERO) 00384000
* CC = 2 IF LENGTH OF SERIAL NUMBER < 1 OR > 6 (CALLING ERROR) 00385000
* (GPR 1 IS UNCHANGED) 00386000
* 00387000
* GPR 1 POINTS TO THE RDEVBLOK WITH THE SPECIFIED SERIAL NUMBER 00388000
* 00389000
* CALLS TO OTHER ROUTINES - 00390000
* 00391000
* NONE 00392000
* 00393000
* EXTERNAL REFERENCES - 00394000
* 00395000
* DMKRIODV - START OF REAL DEVICE BLOCKS 00396000
* DMKRIODC - COUNT OF REAL DEVICE BLOCKS 00397000
* 00398000
* TABLES / WORK AREAS - 00399000
* 00400000
* THE FIRST 6 BYTES OF BALRSAVE ARE USED TO STORE THE VOLUME 00401000
* SERIAL NUMBER TO BE SEARCHED FOR. 00402000
* 00403000
* BALR2 (WITHIN BALRSAVE) IS USED TO SAVE REGISTER 2 00404000
EJECT 00405000
* REGISTER USAGE - 00406000
* 00407000
* GPR 1 = POINTER TO REAL DEVICE BLOCK 00408000
* GPR 2 = COUNT OF REAL DEVICE BLOCKS 00409000
* GPR 14 = RETURN ADDRESS 00410000
* GPR 15 = BASE REGISTER 00411000
* 00412000
* GPRS 3-13 ARE NOT USED. 00413000
* 00414000
* NOTES - 00415000
* 00416000
* NONE 00417000
* 00418000
* OPERATION - 00419000
* 00420000
* 1. CHECKS NUMBER OF BYTES IN VOLUME SERIAL NUMBER 00421000
* (ERROR IF NOT 1 TO 6 - CONDITION-CODE 2 RETURNED). 00422000
* 00423000
* 2. CHECKS ALL REAL DEVICE BLOCKS FOR AN RDEVBLOK WHOSE 00424000
* VOLUME SERIAL NUMBER MATCHES THAT SPECIFIED; IF THE 00425000
* DEVICE IS OFFLINE, HOWEVER, IT IS NOT CHECKED. 00426000
* 00427000
* 3. RETURNS TO CALLER WITH ADDRESS OF MATCHING RDEVBLOK 00428000
* (IF FOUND), OR ERROR RETURN (CONDITION-CODE 1) IF NOT FOUND. 00429000
*. 00430000
EJECT 00431000
*********************************************************************** 00432000
* * 00433000
* FIND A DEVICE WITH A MATCHING SERIAL NUMBER * 00434000
* * 00435000
*********************************************************************** 00436000
SPACE 00437000
ENTRY DMKSCNVS 00438000
DMKSCNVS DS 0D (DBL-WORD-ALIGNED FOR BEST PERFORMANCE) 00439000
USING *,R15 00440000
ST R2,BALR2 SAVE REGISTER 2 00441000
MVC BALRSAVE(6),BLANKS BLANK OUT FIELD BEFORE MOVE 00442000
LR R2,R0 LOAD LENGTH OF SERIAL NUMBER 00443000
BCTR R2,0 SUBTRACT 1 FOR MVC INSTRUCTION 00444000
CL R2,F5 LENGTH-1 MUST NOT EXCEED 5 00445000
BH VSEREXIT ERROR (CONDITION-CODE 2) IF IT DOES. 00446000
EX R2,BALRMVC MOVE SERIAL NUMBER TO BALRSAVE 00447000
L R1,ARIODV LOAD 1ST RDEVBLOK ADDRESS 00448000
L R2,ARIODC LOAD RDEVBLOK COUNT ADDRESS 00449000
LH R2,0(,R2) LOAD COUNT OF REAL DEVICE BLOCKS 00450000
USING RDEVBLOK,R1 00451000
VSERLOOP TM RDEVSTAT,RDEVDISA+RDEVDED OFFLINE OR DEDICATED ? 00452000
BNZ VSERNEXT YES - DO NOT CHECK IT 00453000
TM RDEVFLAG,RDEVMOUT VOLUME MOUNTED AND NOT ATTACHED ?? 00454000
BO VSERNEXT YES -- CHECK NEXT 00455000
CLC RDEVSER,BALRSAVE DO THE SERIAL NUMBERS MATCH ? 00456000
BE VSEREXIT YES, CC = 0, RETURN TO CALLER 00457000
VSERNEXT LA R1,RDEVSIZE*8(,R1) POINT TO NEXT REAL DEVICE BLOCK 00458000
BCT R2,VSERLOOP LOOP IF MORE BLOCKS 00459000
LR R1,R2 ZERO REGISTER 1 00460000
CLI F0,X'FF' SET CC = 1 00461000
VSEREXIT L R2,BALR2 RESTORE REGISTER 2 00462000
BR R14 RETURN TO CALLER 00463000
DROP R1 00464000
EJECT 00465000
*. 00466000
* SUBROUTINE NAME - 00467000
* 00468000
* DMKSCNRD 00469000
* 00470000
* FUNCTION - 00471000
* 00472000
* TO COMPUTE A FULL REAL DEVICE ADDRESS (IN CCU FORM) FROM THE 00473000
* RDEVADD, RCUADD, AND RCHADD ENTRIES IN THE REAL DEVICE, 00474000
* CONTROL UNIT, AND CHANNEL BLOCKS. 00475000
* 00476000
* ATTRIBUTES - 00477000
* 00478000
* REENTRANT, RESIDENT, CALLED VIA BALR 00479000
* 00480000
* ENTRY POINT - 00481000
* 00482000
* DMKSCNRD 00483000
* 00484000
* ENTRY CONDITIONS - 00485000
* 00486000
* GPR 8 = ADDRESS OF REAL DEVICE BLOCK 00487000
* GPR 14 = RETURN REGISTER 00488000
* GPR 15 = ADDRESS OF DMKSCNRD 00489000
* 00490000
* EXIT CONDITIONS - 00491000
* 00492000
* GPR 1 HOLDS REAL DEVICE ADDRESS IN CCU FORM (IN BITS 16-31) 00493000
* 00494000
* CALLS TO OTHER ROUTINES - 00495000
* 00496000
* NONE 00497000
* 00498000
* EXTERNAL REFERENCES - 00499000
* 00500000
* NONE 00501000
* 00502000
* TABLES / WORK AREAS 00503000
* 00504000
* 00505000
* BALR2-BALR3 OF BALRSAVE USED TO SAVE GPR2 & GPR 3 00506000
* 00507000
* REGISTER USAGE - 00508000
* 00509000
* GPR 1 = COMPUTED CCU DEVICE ADDRESS 00510000
* GPR 2 = CONTROL UNIT BITS / CHANNEL BITS 00511000
* GPR 3 = ADDRESS OF CONTROL UNIT BLOCK / CHANNEL BLOCK 00512000
* GPR 14 = RETURN REGISTER 00513000
* 00514000
* GPRS 0, 4-13, AND 15 ARE NOT USED. 00515000
EJECT 00516000
* NOTES - 00517000
* 00518000
* IF IF IS DESIRED TO HAVE THE REAL DEVICE ADDRESS IN 00519000
* PRINTABLE HEX FORM, THE CALL TO DMKSCNRD MAY BE FOLLOWED 00520000
* IMMEDIATELY BY A CALL TO DMKCVTBH. 00521000
* 00522000
* OPERATION - 00523000
* 00524000
* THE RDEVADD BITS ARE OBTAINED FROM RDEVBLOK; THE RCUADD BITS 00525000
* FROM RCUBLOK (POINTED TO BY RDEVCUA) ARE OR'D WITH RCHADD; 00526000
* FINALLY, THE RCHADD BITS FROM RCHBLOK (POINTED TO BY RCUCHA) 00527000
* ARE OR'D WITH RDEVADD/RCUADD TO FORM THE COMPLETE CCU DEVICE 00528000
* ADDRESS. 00529000
*. 00530000
EJECT 00531000
*********************************************************************** 00532000
* 00533000
* COMPUTE REAL DEVICE ADDRESS IN CCU FORM 00534000
* 00535000
*********************************************************************** 00536000
SPACE 2 00537000
USING RDEVBLOK,R8 00538000
USING DMKSCNRD,R15 @VA01081 00539000
SPACE 00540000
ENTRY DMKSCNRD 00541000
DMKSCNRD STM R2,R3,BALR2 SAVE R2-R3 IN BALRSAVE AREA 00542000
LH R1,RDEVADD GET DEVICE BITS FROM RDEVBLOK 00543000
L R3,RDEVCUA POINT TO CONTROL UNIT BLOCK 00544000
USING RCUBLOK,R3 ... 00545000
LH R2,RCUADD GET CONTROL UNIT BITS FROM RCUBLOK 00546000
OR R1,R2 ADD CONTROL UNIT BITS TO DEVICE BITS 00547000
TM RCUTYPE,RCUSUB IS THIS A SUBORDINATE CU @VA01081 00548000
BZ *+8 NO- BRANCH @VA01081 00549000
L R3,RCUPRIME YES- POINT TO THE PRIME CU @VA01081 00550000
L R3,RCUCHA POINT TO CHANNEL BLOCK 00551000
USING RCHBLOK,R3 ... 00552000
LH R2,RCHADD GET CHANNEL BITS FROM RCHBLOK 00553000
OR R1,R2 ADD TO DEVICE/CONTROL UNIT BITS 00554000
LM R2,R3,BALR2 RESTORE R2-R3 AND 00555000
BR R14 RETURN TO CALLER (THAT'S ALL, FOLKS). 00556000
SPACE 00557000
DROP R3,R8 00558000
EJECT 00559000
*. 00560000
* SUBROUTINE NAME - 00561000
* 00562000
* DMKSCNRA 00563000
* 00564000
* FUNCTION - 00565000
* TO COMPUTE A FULL REAL DEVICE ADDRESS (IN CUU FORM) FROM THE 00566000
* RDEVADD, RCUADD, AND RCHADD ENTRIES IN THE REAL DEVICE, 00567000
* CONTROL UNIT, AND CHANNEL BLOCKS. 00568000
* 00569000
* ATTRIBUTES - 00570000
* 00571000
* REENTRANT, RESIDENT, CALLED VIA BALR 00572000
* 00573000
* ENTRY POINT - 00574000
* 00575000
* DMKSCNRA 00576000
* 00577000
* ENTRY CONDITIONS - 00578000
* 00579000
* GPR 6 = ADDRESS OF THE REAL CHANNEL BLOCK 00580000
* GPR 7 = ADDRESS OF THE PRIME OR ALTERNATE CONTROL UNIT BLOCK 00581000
* GPR 8 = ADDRESS OF REAL DEVICE BLOCK 00582000
* GPR 14 = RETURN REGISTER 00583000
* GPR 15 = ADDRESS OF DMKSCNRA 00584000
* 00585000
* EXIT CONDITIONS - 00586000
* 00587000
* CC = 0 00588000
* GPR 1 HOLDS REAL DEVICE ADDRESS IN CCU FORM (IN BITS 16-31) 00589000
* 00590000
* CC = 1 00591000
* CONTROL UNIT BLOCK COULD NOT BE FOUND 00592000
* ALL REGISTERS ARE UNMODIFIED 00593000
* 00594000
* CALLS TO OTHER ROUTINES - 00595000
* 00596000
* NONE 00597000
* 00598000
* EXTERNAL REFERENCES - 00599000
* 00600000
* NONE 00601000
* 00602000
* TABLES / WORK AREAS 00603000
* 00604000
* BALR2 OF BALRSAVE USED TO SAVE GPR2 00605000
* 00606000
EJECT 00607000
* REGISTER USAGE - 00608000
* 00609000
* GPR 1 = COMPUTED CCU DEVICE ADDRESS 00610000
* GPR 2 = CONTROL UNIT BLOCK ADDRESS / CONTROL UNIT ADDRESS 00611000
* GPR 6 = RCHBLOK ADDRESS 00612000
* GPR 7 = RCUBLOK ADDRESS 00613000
* GPR 8 = RDEVBLOK ADDRESS 00614000
* GPR 14 = RETURN REGISTER 00615000
* 00616000
* GPRS 0, 3-5, 9-13, AND 15 ARE NOT USED. 00617000
* NOTES - 00618000
* 00619000
* IF IT IS DESIRED TO HAVE THE REAL DEVICE ADDRESS IN 00620000
* PRINTABLE HEX FORM, THE CALL TO DMKSCNRA MAY BE FOLLOWED 00621000
* IMMEDIATELY BY A CALL TO DMKCVTBH. 00622000
* 00623000
* OPERATION - 00624000
* 00625000
* THE RDEVADD BITS ARE OBTAINED FROM THE RDEVBLOK (R8). 00626000
* THE RCHADD BITS ARE OBTAINED FROM THE RCHBLOK (R6). 00627000
* THE RCUADD BITS ARE OBTAINED FROM THE RCUBLOK WHICH 00628000
* REPRESENTS THE PATH TO THE R7 RCUBLOK. IF THE RDEVBLOK 00629000
* POINTS TO A SUBORDINATE CONTROL UNIT, THEN THE SUBORDINATE 00630000
* CONTROL UNIT BLOCK RDEVADD BITS WILL BE USED TO CONSTRUCT 00631000
* THE ADDRESS. 00632000
* THE RDEVADD BITS ARE OR'D WITH THE RCUADD BITS WHICH ARE 00633000
* OR'D WITH THE RCHADD BITS TO FORM THE CCU ADDRESS RETURNED 00634000
* IN R1. 00635000
* 00636000
*. 00637000
EJECT 00638000
*********************************************************************** 00639000
* 00640000
* COMPUTE REAL DEVICE ADDRESS IN CCU FORM 00641000
* 00642000
*********************************************************************** 00643000
SPACE 2 00644000
USING RCHBLOK,R6 @V407438 00645000
USING RCUBLOK,R7 @V407438 00646000
USING RDEVBLOK,R8 @V407438 00647000
USING DMKSCNRA,R15 @V407438 00648000
SPACE 00649000
ENTRY DMKSCNRA @V407438 00650000
DMKSCNRA ST R2,BALR2 SAVE R2 IN BALRSAVE AREA @V407438 00651000
CL R7,RDEVCUA IS R7 FROM THE 'A' PATH? @V407438 00652000
BNE RACKCUAS NOT PRIME, GO CHECK SUBORDINATE @V407438 00653000
LH R2,RCUADD GET CONTROL UNIT ADDRESS @V407438 00654000
B SETADDR AND CONTINUE. @V407438 00655000
RACKCUAS L R2,RDEVCUA GET ADDRESS OF CONTROL UNIT @V407438 00656000
CL R7,RCUPRIME-RCUBLOK(R2) IS THIS THE R7 CUBLOK? @V407438 00657000
BNE RACKCUB NOPE, GO TRY THE 'B' PATH(S) @V407438 00658000
LH R2,RCUADD-RCUBLOK(R2) YES, GET ADDR OF CU @V407438 00659000
B SETADDR AND CONTINUE @V407438 00660000
RACKCUB CL R7,RDEVCUB IS R7 FROM THE 'B' PATH? @V407438 00661000
BNE RACKCUBS NOPE, GO CKECK FOR SUBORDINATE @V407438 00662000
LH R2,RCUADD YES, GET CONTROL UNIT ADDRESS @V407438 00663000
B SETADDR AND CONTINUE @V407438 00664000
RACKCUBS L R2,RDEVCUB GET ADDR OF CONTROL UNIT @V407438 00665000
LTR R2,R2 DOES IT EXIST? @V407438 00666000
BZ RACC1 NOPE, BAD BLOCKS, NO ADDR TODAY @V407438 00667000
CL R7,RCUPRIME-RCUBLOK(R2) IS THIS THE R7 CUBLOK? @V407438 00668000
BNE RACC1 NOPE, BAD BLOCKS, NO ADDR TODAY @V407438 00669000
LH R2,RCUADD-RCUBLOK(R2) YES, GET ADDR OF CU @V407438 00670000
SETADDR LH R1,RDEVADD GET DEVICE ADDRESS @V407438 00671000
OR R1,R2 ADD IN THE CONTROL UNIT @V407438 00672000
LH R2,RCHADD GET CHANNEL ADDRESS @V407438 00673000
OR R1,R2 ADD IN THE CHANNEL ADDRESS @V407438 00674000
CLR R1,R1 SET CONDITION CODE 0 @V407438 00675000
B RAXIT DONE, BR. @V407438 00676000
SPACE 00677000
RACC1 TM *,X'FF' SET CONDITION CODE 1 @V407438 00678000
RAXIT L R2,BALR2 RESTORE REGISTER @V407438 00679000
BR R14 AND RETURN @V407438 00680000
DROP R6,R7,R8 NO MORE RBLOKS @V407438 00681000
EJECT 00682000
*. 00683000
* SUBROUTINE NAME - 00684000
* 00685000
* DMKSCNNP 00686000
* 00687000
* FUNCTION - 00688000
* 00689000
* FIND THE RCHBLOK AND RCUBLOK WHICH REPRESENTS THE NEXT 00690000
* LOGICAL PATH TO THE DEVICE 00691000
* 00692000
* ATTRIBUTES - 00693000
* 00694000
* REENTRANT, RESIDENT, CALLED VIA BALR 00695000
* 00696000
* ENTRY POINT - 00697000
* 00698000
* DMKSCNNP 00699000
* 00700000
* ENTRY CONDITIONS - 00701000
* 00702000
* GPR 6 = ADDRESS OF THE REAL CHANNEL BLOCK 00703000
* GPR 7 = ADDRESS OF THE PRIME OR ALTERNATE CONTROL UNIT BLOCK 00704000
* GPR 8 = ADDRESS OF REAL DEVICE BLOCK 00705000
* GPR 14 = RETURN REGISTER 00706000
* GPR 15 = ADDRESS OF DMKSCNNP 00707000
* 00708000
* EXIT CONDITIONS - 00709000
* 00710000
* CC = 0 00711000
* GPR 6 HOLDS THE RCHBLOK ADDRESS OF THE NEXT PATH 00712000
* GPR 7 HOLDS THE RCUBLOK ADDRESS FOR THE NEXT PATH 00713000
* 00714000
* CC = 1 00715000
* THERE ARE NO MORE PATHS FOR THIS DEVICE 00716000
* 00717000
* CALLS TO OTHER ROUTINES - 00718000
* 00719000
* NONE 00720000
* 00721000
* EXTERNAL REFERENCES - 00722000
* 00723000
* NONE 00724000
* 00725000
* TABLES / WORK AREAS 00726000
* 00727000
* BALR3-BALR7 OF BALRSAVE USED TO SAVE GPR3-GPR7 00728000
* 00729000
* REGISTER USAGE - 00730000
* 00731000
* GPR 3 = BEGINNING OF CHANNEL SEARCH ADDRESS 00732000
* GPR 4 = INCREMENT 00733000
* GPR 5 = ENDING OF CHANNEL SEARCH ADDRESS 00734000
* GPR 6 = RCHBLOK ADDRESS 00735000
* GPR 7 = RCUBLOK ADDRESS 00736000
* GPR 8 = RDEVBLOK ADDRESS 00737000
* GPR 14 = RETURN REGISTER 00738000
* 00739000
* GPRS 0-2, 9-13 AND 15 ARE NOT USED. 00740000
EJECT 00741000
* 00742000
* OPERATION - 00743000
* 00744000
* THE R7 RCUBLOK IS SEARCHED TO FIND THE CURRENT R6 RCHBLOK. 00745000
* IF IT IS FOUND, THE NEXT RCUCHX FIELD IS EXAMINED FOR A 00746000
* POSSIBLE PATH. IF THERE IS A PATH, EXIT WITH CONDITION 00747000
* CODE 0. IF THERE IS NO RCUCHX (VALUE = 0) OR ALL RCUCHX 00748000
* FIELDS ARE EXAMINED AND THE CURRENT R6 IS NOT FOUND (MEANING 00749000
* EITHER R6 REPRESENTS RCUCHD OR IT DOES NOT APPEAR IN THE 00750000
* R7 RCUBLOK) THEN THE RDEVBLOK IS SEARCHED TO FIND WHICH 00751000
* RCUBLOK THE CURRENT R7 POINTS TO. IF R7 REPRESENTS THE 00752000
* RDEVCUA PATH AND THERE IS NO RDEVCUB, EXIT WITH CONDITION 00753000
* CODE 1. IF R7 REPRESENTS THE RDEVCUB ALREADY, EXIT WITH 00754000
* CONDITON CODE 1. IF R7 REPRESENTS THE RDEVCUA PATH AND 00755000
* THERE EXISTS AN RDEVCUB PATH, RETURN WITH THE FIRST CHANNEL 00756000
* PATH ON THE NEW CONTROL UNIT. 00757000
* 00758000
*. 00759000
EJECT 00760000
*********************************************************************** 00761000
* 00762000
* FIND THE NEXT LOGICAL PATH TO THE DEVICE 00763000
* 00764000
*********************************************************************** 00765000
SPACE 2 00766000
USING RCHBLOK,R6 @V407438 00767000
USING RCUBLOK,R7 @V407438 00768000
USING RDEVBLOK,R8 @V407438 00769000
USING DMKSCNNP,R15 @V407438 00770000
SPACE 00771000
ENTRY DMKSCNNP @V407438 00772000
DMKSCNNP STM R3,R7,BALR3 SAVE REGS IN BALRSAVE AREA @V407438 00773000
LA R3,RCUCHA ADDRESS OF FIRST EXAMINED CHAN @V407438 00774000
LA R4,4 INCREMENT @V407438 00775000
LA R5,RCUCHC ADDRESS OF THE LAST EXAMINED CHAN@V407438 00776000
CL R6,0(R3) IS THIS THE CURRENT CHANNEL? @V407438 00777000
BE NXTCH YES, BR @V407438 00778000
BXLE R3,R4,*-8 KEEP LOOKING @V407438 00779000
CHKNXTCU CL R7,RDEVCUA DOES R7 REPRESENT 1ST CTL UNIT? @V407438 00780000
BE NXTCU YES, GO GET NEXT CTL UNIT @V407438 00781000
L R3,RDEVCUA MAKE SURE PLEASE... @V407438 00782000
CL R7,RCUPRIME-RCUBLOK(R3) ... @V407438 00783000
BE NXTCU FOUND IT, GO GET NEXT CTL UNIT @V407438 00784000
NPCC1 TM *,X'FF' NO MORE PATHS, BR. @V407438 00785000
LM R3,R7,BALR3 RESTORE REGS @V407438 00786000
BR R14 RETURN TO CALLER @V407438 00787000
SPACE 00788000
NXTCU L R7,RDEVCUB GET NEXT CTL UNIT @V407438 00789000
LTR R7,R7 IS IT REALLY THERE? @V407438 00790000
BZ NPCC1 NOPE, NO MORE PATHS, BR. @V407438 00791000
TM RCUTYPE,RCUSUB IS THIS A SUBORDINATE? @V407438 00792000
BZ *+8 NOPE, BR. @V407438 00793000
L R7,RCUPRIME ADDRESS THE PRIME CTL UNIT @V407438 00794000
L R6,RCUCHA GET THE NEXT PATH CHANNEL BLOCK @V407438 00795000
NPCC0 LM R3,R5,BALR3 RESTORE CLOBBERED REGS @V407438 00796000
TM *+1,X'00' SET CC0 @V407438 00797000
BR R14 RETURN TO CALLER @V407438 00798000
SPACE 00799000
NXTCH L R6,4(R3) GET THE NEXT CHANNEL @V407438 00800000
LTR R6,R6 DOES THIS CHANNEL EXIST? @V407438 00801000
BZ CHKNXTCU NOPE, TRY FOR NEXT CU @V407438 00802000
B NPCC0 YES, EXIT WITH CC0 (R7 UNCHANGED)@V407438 00803000
DROP R6,R7,R8 NO MORE RBLOKS @V407438 00804000
EJECT 00805000
*. 00806000
* SUBROUTINE NAME - 00807000
* 00808000
* DMKSCNVD 00809000
* 00810000
* FUNCTION - 00811000
* 00812000
* TO COMPUTE A FULL VIRTUAL DEVICE ADDRESS (IN CCU FORM), PLUS 00813000
* THE ADDRESSES OF THE VIRTUAL CHANNEL AND CONTROL UNIT BLOCKS, 00814000
* FROM A SPECIFIED VIRTUAL DEVICE BLOCK. 00815000
* 00816000
* ATTRIBUTES - 00817000
* 00818000
* REENTRANT, RESIDENT, CALL VIA BALR 00819000
* 00820000
* ENTRY POINT - 00821000
* 00822000
* DMKSCNVD 00823000
* 00824000
* ENTRY CONDITIONS - 00825000
* 00826000
* GPR 8 = ADDRESS OF VIRTUAL DEVICE BLOCK 00827000
* GPR 11 = ADDRESS OF USER'S VMBLOK 00828000
* GPR 14 = RETURN REGISTER 00829000
* GPR 15 = ADDRESS OF DMKSCNVD 00830000
* 00831000
* EXIT CONDITIONS - 00832000
* 00833000
* IF SUCCESSFUL: 00834000
* 00835000
* CC = 0 00836000
* 00837000
* GPR 1 HOLDS VIRTUAL DEVICE ADDRESS IN CCU FORM (BITS 16-31) 00838000
* GPR 6 = ADDRESS OF VIRTUAL CHANNEL BLOCK 00839000
* GPR 7 = ADDRESS OF VIRTUAL CONTROL UNIT BLOCK 00840000
* GPR 8 = ADDRESS OF VIRTUAL DEVICE BLOCK (SAME AS AT ENTRY) 00841000
* GPR 15 = 0 00842000
* 00843000
* IF NOT FOUND: 00844000
* 00845000
* CC = 1, AND ALL REGISTERS SAME AS AT ENTRY. 00846000
* 00847000
* CALLS TO OTHER ROUTINES - 00848000
* 00849000
* NONE 00850000
* 00851000
* EXTERNAL REFERENCES - 00852000
* 00853000
* NONE 00854000
EJECT 00855000
* TABLES / WORK AREAS 00856000
* 00857000
* 00858000
* BALR1-BALR8 OF BALRSAVE USED TO SAVE GPR 1 - 8 00859000
* 00860000
* REGISTER USAGE - 00861000
* 00862000
* GPR 1 = WORK REGISTER, & FINALLY COMPUTED CCU DEVICE ADDRESS 00863000
* GPRS 2-5 = INDEXING REGISTERS FOR BXLE LOOPS 00864000
* GPR 6 = ADDRESS OF VCHBLOK 00865000
* GPR 7 = ADDRESS OF VCUBLOK 00866000
* GPR 8 = ADDRESS OF VDEVBLOK 00867000
* GPR 11 = ADDRESS OF USER'S VMBLOK 00868000
* GPR 14 = RETURN REGISTER 00869000
* GPR 15 = BASE REGISTER 00870000
* 00871000
* GPRS 0, 9-10, AND 12-13 ARE NOT USED. 00872000
* 00873000
* NOTES - 00874000
* 00875000
* NONE 00876000
* 00877000
* OPERATION - 00878000
* 00879000
* INDEXES THRU THE VIRTUAL CHANNEL AND CONTROL UNIT BLOCKS 00880000
* LOOKING FOR AN INDEX WHICH MATCHES THE GIVEN DEVICE ADDRESS; 00881000
* IF FOUND, COMPUTES VIRTUAL DEVICE BLOCK FOR THAT COMBINATION; 00882000
* IF IT MATCHES GPR 8 AT INPUT, THE DESIRED CCU DEVICE ADDRESS 00883000
* IS COMPUTED, AND EXIT MADE. IF NOT, THE REMAINING 00884000
* VIRTUAL BLOCKS ARE SEARCHED UNTIL A MATCH IS FOUND, OR UNTIL 00885000
* ALL BLOCKS HAVE BEEN EXHAUSTED (AN ERROR CONDITION). 00886000
*. 00887000
EJECT 00888000
*********************************************************************** 00889000
* 00890000
* COMPUTE VIRTUAL DEVICE ADDRESS IN CCU FORM, ETC. 00891000
* 00892000
*********************************************************************** 00893000
SPACE 3 00894000
USING VDEVBLOK,R8 00895000
USING VMBLOK,R11 00896000
USING DMKSCNVD,R15 00897000
ENTRY DMKSCNVD 00898000
DMKSCNVD STM R1,R8,BALR1 ENTER, SAVE NEEDED REGISTERS 00899000
LH R3,VDEVADD VIRTUAL DEVICE ADDRESS BITS INTO R3, 00900000
ALR R3,R3 DOUBLE IT TO FORM CU/DEV INDEX HALFWORD 00901000
LA R4,2 LOAD INDEX INCREMENT 00902000
LA R5,30 LOAD INDEX COMPARAND 00903000
SR R1,R1 ZERO VMCHTBL INDEX 00904000
SCNNCH LH R6,VMCHTBL(R1) LOAD NEXT CHANNEL BLOK INDEX 00905000
LTR R6,R6 DOES CHANNEL EXIST ? 00906000
BM SCNXCH NO, INDEX TO NEXT ONE 00907000
A R6,VMCHSTRT POINT TO VCHBLOK 00908000
USING VCHBLOK,R6 00909000
SR R2,R2 ZERO VCHCUTBL INDEX 00910000
SCNNCU LH R7,VCHCUTBL(R2) LOAD NEXT CU BLOK INDEX 00911000
LTR R7,R7 DOES CONTROL UNIT EXIST 00912000
BM SCNXCU NO, INDEX TO NEXT ONE 00913000
A R7,VMCUSTRT POINT TO VCUBLOK 00914000
USING VCUBLOK,R7 00915000
LH R8,VCUDVTBL(R3) LOAD DEVICE BLOK INDEX 00916000
LTR R8,R8 DOES DEVICE EXIST ? 00917000
BM SCNXCU NO, INDEX TO NEXT CONTROL UNIT 00918000
A R8,VMDVSTRT POINT TO VDEVBLOK 00919000
C R8,BALR8 IS IT THE ONE WE WERE LOOKING FOR? 00920000
BE SCNFOUND YES - GOOD SHOW. 00921000
SCNXCU BXLE R2,R4,SCNNCU BRANCH IF MORE CONTROL UNITS ON THIS CHAN 00922000
SCNXCH BXLE R1,R4,SCNNCH BRANCH IF MORE CHANNELS ON THIS MACHINE 00923000
LM R1,R8,BALR1 NOT FOUND - SOMEBODY GOOFED; RESTORE REGS 00924000
B SETCC1 GO SET CONDITION-CODE 1 AND EXIT. 00925000
SPACE 00926000
* WE HAVE FOUND ALL THREE BLOCKS ASSOCIATED WITH THE DEVICE: 00927000
SCNFOUND LH R1,VCHADD GET CHANNEL BITS, 00928000
AH R1,VCUADD 'OR' IN CONTROL UNIT BITS, 00929000
AH R1,VDEVADD AND DEVICE BITS 00930000
LM R2,R5,BALR2 RESTORE R2 THRU R5, 00931000
SR R15,R15 CLEAR CONDITION-CODE, 00932000
BR R14 AND RETURN TO CALLER. 00933000
* 00934000
DROP R6,R7,R8,R11 00935000
EJECT 00936000
*. 00937000
* SUBROUTINE NAME - 00938000
* 00939000
* DMKSCNAU - FIND THE VMBLOK WITH A GIVEN USERID 00940000
* 00941000
* FUNCTION - 00942000
* 00943000
* TO SEARCH THE CHAIN OF VMBLOKS FOR ONE WHOSE USERID MATCHES 00944000
* THE ONE POINTED TO BY REGISTER 1. 00945000
* 00946000
* ATTRIBUTES - 00947000
* 00948000
* REENTRANT, RESIDENT, CALLED VIA BALR 00949000
* 00950000
* ENTRY POINT - 00951000
* 00952000
* DMKSCNAU 00953000
* 00954000
* ENTRY CONDITIONS - 00955000
* 00956000
* GPR 0 CONTAINS THE LENGTH OF THE USERID 00957000
* GPR 1 POINTS TO A USERID WHOSE VMBLOK IS TO BE FOUND 00958000
* GPR 14 = RETURN ADDRESS 00959000
* GPR 15 = ADDRESS OF DMKSCNAU 00960000
* 00961000
* EXIT CONDITIONS - 00962000
* 00963000
* CC = 0 IF A MATCHING VMBLOK IS FOUND (GPR 1 IS VALID) 00964000
* CC = 1 IF NO MATCH IS FOUND (GPR 1 NOT VALID) 00965000
* CC = 2 IF LENGTH OF USERID < 1 OR > 8 (CALLING ERROR) 00966000
* CC = 3 IF VMBLOK FOUND BUT IN LOGON OR LOGOFF, 00967000
* (GPR1 IS VALID). 00968000
* 00969000
* GPR 1 POINTS TO THE VMBLOK WITH THE SPECIFIED USERID 00970000
* 00971000
* CALLS TO OTHER ROUTINES - 00972000
* 00973000
* NONE 00974000
* 00975000
* EXTERNAL REFERENCES - 00976000
* 00977000
* ASYSVM - ADDRESS OF SYSTEM VMBLOK 00978000
* 00979000
* TABLES / WORK AREAS - 00980000
* 00981000
* THE FIRST 8 BYTES OF BALRSAVE ARE USED TO SAVE THE USERID 00982000
* TO BE SEARCHED FOR. 00983000
* 00984000
* BALR2 - BALR4 (WITHIN BALRSAVE) ARE USED 00985000
* TO SAVE REGISTERS 2 THRU 4. 00986000
EJECT 00987000
* REGISTER USAGE - 00988000
* 00989000
* GPR 1 = VMBLOK BASE REGISTER 00990000
* GPR 2 = ADDRESS OF SYSTEM VMBLOK (STARTING/ENDING POINT) 00991000
* GPR 3-4 USERID WHILE SEARCH IS BEING MADE 00992000
* GPR 14 = RETURN ADDRESS 00993000
* GPR 15 = BASE REGISTER 00994000
* 00995000
* GPRS 5-13 ARE NOT USED. 00996000
* 00997000
* NOTES - 00998000
* 00999000
* NONE 01000000
* 01001000
* OPERATION - 01002000
* 01003000
* 1. CHECKS NUMBER OF BYTES IN USERID 01004000
* (ERROR IF NOT 1 TO 8 - CONDITION-CODE 2 RETURNED). 01005000
* 01006000
* 2. STARTING FROM THE SYSTEM VMBLOK, CHECKS ALL ACTIVE VMBLOKS 01007000
* FOR A USERID WHICH MATCHES THAT SPECIFIED. RETURNS ADDRESS 01008000
* OF MATCHING VMBLOK IF FOUND, BUT SETS CONDITION-CODE 3 01009000
* IF THE USER IS IN LOGOFF STATUS (CONDITION-CODE 0 IF NOT). 01010000
* 01011000
* 3. RETURNS CONDITION-CODE 1 IF USERID WAS NOT FOUND. 01012000
*. 01013000
EJECT 01014000
*********************************************************************** 01015000
* * 01016000
* FIND THE VMBLOK WITH A GIVEN USERID * 01017000
* * 01018000
*********************************************************************** 01019000
SPACE 01020000
ENTRY DMKSCNAU 01021000
DMKSCNAU DS 0D (DBL-WORD-ALIGNED FOR BEST PERFORMANCE) 01022000
USING *,R15 01023000
STM R2,R4,BALR2 SAVE REGISTERS 2 THRU 4 01024000
MVC BALRSAVE(8),BLANKS BLANK OUT FIELD BEFORE MOVE 01025000
LR R2,R0 LOAD LENGTH OF USERID 01026000
BCTR R2,0 SUBTRACT 1 FOR MVC INSTRUCTION 01027000
CL R2,F7 LENGTH-1 MUST NOT EXCEED 7 01028000
BH FINDEXIT ERROR (CONDITION-CODE 2) IF IT DOES. 01029000
EX R2,BALRMVC MOVE USERID TO BALRSAVE 01030000
L R1,ASYSVM START FROM SYSTEM VMBLOK 01031000
USING VMBLOK,R1 01032000
L R1,VMPNT START WITH 1ST USER POINTED TO BY SYSVM, 01033000
LTR R2,R1 SAVE (& CHECK) STARTING VMBLOK ADDRESS 01034000
BZ FINDREST IF NOBODY HOME AT ALL, EXIT WITH CC = 1. 01035000
LM R3,R4,BALRSAVE USERID WE WANT TO MATCH INTO R3-R4 01036000
FINDLOOP CL R3,VMUSER DOES 1ST HALF OF USERID MATCH ? 01037000
BE FIND2ND YES, CHECK 2ND HALF (PROBABLY OK). 01038000
FINDNEXT L R1,VMPNT LOAD NEXT VMBLOK ADDRESS 01039000
CR R1,R2 ARE WE BACK AT THE BEGINNING ? 01040000
BNE FINDLOOP NO, CONTINUE SEARCH 01041000
FINDREST LM R2,R4,BALR2 IF NOT FOUND, RESTORE REGISTERS 2 THRU 4 01042000
B SETCC1 SET CC = 1 AND RETURN TO CALLER 01043000
SPACE 01044000
FIND2ND CL R4,VMUSER+4 DOES 2ND HALF OF USERID MATCH ? 01045000
BNE FINDNEXT IF NOT, GO CHECK NEXT VMBLOK. 01046000
TM VMRSTAT,VMLOGOFF USER IN LOGOFF STATUS ? 01047000
* NO, CC = 0 - YES, CC = 3 01048000
BO FINDEXIT YES, GOOD ENOUGH. 01049000
TM VMRSTAT,VMLOGON NOPE, THEN TRY LOGON TOO. 01050000
FINDEXIT LM R2,R4,BALR2 RESTORE REGISTERS 2 THRU 4 01051000
BR R14 RETURN TO CALLER 01052000
DROP R1 01053000
EJECT 01054000
*. 01055000
* SUBROUTINE NAME - 01056000
* 01057000
* DMKSCNFD - FIND THE NEXT FIELD IN THE INPUT BUFFER 01058000
* 01059000
* FUNCTION - 01060000
* 01061000
* TO FIND THE NEXT FIELD IN AN INPUT MESSAGE BUFFER. 01062000
* 01063000
* ATTRIBUTES - 01064000
* 01065000
* REENTRANT, RESIDENT, CALLED VIA BALR 01066000
* 01067000
* ENTRY POINT - 01068000
* 01069000
* DMKSCNFD 01070000
* 01071000
* ENTRY CONDITIONS - 01072000
* 01073000
* GPR 9 POINTS TO AN 18 DOUBLE WORD INPUT BUFFER. 01074000
* GPR 11 CONTAINS THE USER'S VMBLOK ADDRESS 01075000
* GPR 14 = RETURN ADDRESS 01076000
* GPR 15 = ADDRESS OF DMKSCNFD 01077000
* 01078000
* THE LAST DOUBLE WORD OF THE INPUT BUFFER MUST CONTAIN THE 01079000
* ADDRESS OF THE NEXT BYTE TO BE LOOKED AT AND A COUNT OF THE 01080000
* REMAINING BYTES IN THE BUFFER. 01081000
* 01082000
* EXIT CONDITIONS - 01083000
* 01084000
* CC = 0 IF A FIELD IS FOUND 01085000
* CC = 1 IF A LOGICAL CARRIAGE RETURN IF FOUND 01086000
* CC = 2 IF THE END OF THE BUFFER IS REACHED 01087000
* 01088000
* GPR 0 CONTAINS THE NUMBER OF BYTES IN THE FIELD 01089000
* GPR 1 POINTS TO THE FIRST BYTE OF THE FIELD 01090000
* 01091000
* THE LAST DOUBLE WORD OF THE INPUT BUFFER CONTAINS 01092000
* THE UPDATED LOCATION POINTER AND COUNT. 01093000
* 01094000
* CALLS TO OTHER ROUTINES - 01095000
* 01096000
* NONE 01097000
* 01098000
* EXTERNAL REFERENCES - 01099000
* 01100000
* NONE 01101000
* 01102000
* TABLES / WORK AREAS - 01103000
* 01104000
* BALR2 - BALR5 (WITHIN BALRSAVE) ARE USED 01105000
* TO SAVE REGISTERS 2 THRU 5. 01106000
EJECT 01107000
* REGISTER USAGE - 01108000
* 01109000
* GPR 0 = FIELD LENGTH 01110000
* GPR 1 = START OF FIELD 01111000
* GPR 2 = NEXT BYTE LOCATION 01112000
* GPR 3 = BUFFER BYTE COUNT 01113000
* GPR 4 = RDEVBLOK BASE REGISTER 01114000
* GPR 5 = 1 01115000
* GPR 9 = ADDRESS OF INPUT BUFFER 01116000
* GPR 11 = ADDRESS OF VMBLOK 01117000
* GPR 14 = RETURN ADDRESS 01118000
* GPR 15 = BASE REGISTER 01119000
* 01120000
* GPRS 6-8, 10, & 12-13 ARE NOT USED. 01121000
* 01122000
* NOTES - 01123000
* 01124000
* NONE 01125000
* 01126000
* OPERATION 01127000
* 01128000
* 1. CHECKS TO SEE IF ANY BYTES AT ALL ARE LEFT IN INPUT BUFFER 01129000
* (ERROR IF NOT - CONDITION-CODE 2 IS RETURNED). 01130000
* 01131000
* 2. SCANS REMAINING BYTES IN INPUT BUFFER FOR A NON-BLANK 01132000
* CHARACTER. (CONDITION-CODE 2 IS RETURNED IF NO NON-BLANK 01133000
* FIELD IS FOUND). 01134000
* 01135000
* 3. SCANS FIELD WHERE NON-BLANK CHARACTER WAS FOUND FOR A 01136000
* LOGICAL CARRIAGE RETURN (DEFINED IN TERMINAL VDEVBLOK) 01137000
* OR UNTIL NUMBER OF BYTES IS EXHAUSTED (WHICHEVER OCCURS 01138000
* FIRST). 01139000
* 01140000
* 4. CHECKS NUMBER OF BYTES FOUND IN NON-BLANK FIELD. 01141000
* (IF ZERO - ONLY POSSIBLE IF A LOGICAL CARRIAGE RETURN 01142000
* WAS THE ONLY CHARACTER - RETURNS A CONDITION-CODE 1). 01143000
* 01144000
* 5. OTHERWISE, RETURNS ADDRESS OF NON-BLANK FIELD (IN GPR 1) 01145000
* AND NUMBER OF BYTES IN FIELD (IN GPR 0) TO CALLER 01146000
* (WITH CONDITION-CODE = 0). 01147000
*. 01148000
EJECT 01149000
*********************************************************************** 01150000
* * 01151000
* SCAN FOR THE NEXT FIELD IN THE INPUT BUFFER * 01152000
* * 01153000
*********************************************************************** 01154000
SPACE 01155000
ENTRY DMKSCNFD 01156000
DMKSCNFD DS 0D (DBL-WORD-ALIGNED FOR BEST PERFORMANCE) 01157000
USING *,R15 01158000
USING BUFFER,R9 01159000
USING VMBLOK,R11 01160000
STM R2,R5,BALR2 SAVE REGISTERS 2 THRU 5 01161000
LM R2,R3,BUFNXT LOAD BUFFER POINTER AND COUNT 01162000
LTR R3,R3 IS THE COUNT ZERO ? 01163000
BNP SCANZERO YES, INDICATE END OF BUFFER 01164000
LA R5,1 SET R5 = 1 FOR INCREMENTING USE 01165000
LA R2,0(,R2) CLEAR HIGH ORDER BYTE 01166000
SCANFRST CLI 0(R2),C' ' IS THIS THE START OF A FIELD ? 01167000
BNE SCANSTRT BRANCH IF YES 01168000
AR R2,R5 POINT TO NEXT BYTE 01169000
BCT R3,SCANFRST SUBTRACT 1 FROM COUNT - BRANCH IF MORE 01170000
STM R2,R3,BUFNXT SAVE NEW BUFFER POINTER AND COUNT 01171000
SCANZERO LM R2,R5,BALR2 RESTORE REGISTERS 2 THRU 5 01172000
B SETCC2 GO SET CC = 2 AND RETURN TO CALLER. 01173000
CNOP 2,8 DBL-WORD-ALIGN 'SCANLAST' LOOP BELOW 01174000
SCANSTRT LR R1,R2 SAVE POINTER TO START OF FIELD 01175000
SCANLAST CLI 0(R2),C' ' IS THIS THE END OF THE FIELD ? 01176000
BE SCANLEND BRANCH IF YES 01177000
CLI 0(R2),X'15' IS THIS THE END OF THE LOGICAL LINE ? 01178000
BE SCANLEND BRANCH IF YES 01179000
AR R2,R5 POINT TO NEXT BYTE 01180000
BCT R3,SCANLAST SUBTRACT 1 FROM COUNT - BRANCH IF MORE 01181000
SCANLEND STM R2,R3,BUFNXT SAVE NEW BUFFER POINTER AND COUNT 01182000
SR R2,R1 COMPUTE THE LENGTH OF THE FIELD 01183000
LR R0,R2 SAVE IN GPR 0 01184000
LM R2,R5,BALR2 RESTORE REGISTERS 2 THRU 5 01185000
BZ SETCC1 BRANCH IF ZERO LENGTH 01186000
SR R15,R15 SET CC = 0 (AND CLEAR R15) 01187000
BR R14 AND RETURN TO CALLER. 01188000
SPACE 01189000
DROP R9,R11 01190000
EJECT 01191000
*. 01192000
* SUBROUTINE NAME - 01193000
* 01194000
* DMKSCNLI - SEARCH VIRTUAL MACHINES FOR LINKS TO GIVEN MINIDISK 01195000
* 01196000
* FUNCTION - 01197000
* 01198000
* TO SEARCH THE LOGGED ON VIRTUAL MACHINES FOR ANY LINKS TO 01199000
* A SPECIFIED MINIDISK. A LINK IS ANY VIRTUAL DEVICE WHOSE 01200000
* RDEVBLOK POINTER & RELOCATION FACTOR MATCH THOSE SPECIFIED. 01201000
* 01202000
* ATTRIBUTES - 01203000
* 01204000
* REENTRANT, RESIDENT, CALLED VIA BALR 01205000
* 01206000
* ENTRY POINT - 01207000
* 01208000
* DMKSCNLI 01209000
* 01210000
* ENTRY CONDITIONS - 01211000
* 01212000
* GPR 1 CONTAINS THE ADDRESS OF THE RDEVBLOK 01213000
* GPR 2 CONTAINS ADDRESS OF UDEVBLOK FOR DEVICE 01214000
* GPR 11 CONTAINS THE VMBLOK ADDRESS OF CURRENT USER 01215000
* GPR 14 = RETURN ADDRESS 01216000
* GPR 15 = ADDRESS OF DMKSCNLI 01217000
* 01218000
* EXIT CONDITIONS - 01219000
* 01220000
* CC = 0 IF NO LINKS ARE FOUND. 01221000
* CC = 1 IF ANY READ/ONLY LINKS ARE FOUND BUT NO WRITE LINKS. 01222000
* CC = 2 IF ANY WRITE LINKS ARE FOUND. 01223000
* 01224000
* GPR 0 = NUMBER OF READ/ONLY LINKS. 01225000
* GPR 1 = NUMBER OF WRITE LINKS. 01226000
* GPR 2 = ADDRESS OF VDEVBLOK FOR A WRITE LINK, OR IF NONE, 01227000
* ADDRESS OF VDEVBLOK FOR A READ/ONLY LINK, IF ANY. 01228000
* GPR 3 = ADDRESS OF VMBLOK OF A R/O USER (IF ANY), OR ZERO 01229000
* 01230000
* CALLS TO OTHER ROUTINES - 01231000
* 01232000
* NONE 01233000
* 01234000
* EXTERNAL REFERENCES - 01235000
* 01236000
* NONE 01237000
* 01238000
* TABLES / WORK AREAS - 01239000
* 01240000
* BALR3 - BALR10 (WITHIN BALRSAVE) ARE USED 01241000
* TO SAVE REGISTERS 3 THRU 10. 01242000
EJECT 01243000
* REGISTER USAGE - 01244000
* 01245000
* GPR 2 = POINTER TO VDEVBLOK FOR WRITE LINK 01246000
* GPR 3 = NUMBER OF READ/ONLY LINKS FOUND 01247000
* GPR 4 = NUMBER OF WRITE LINKS FOUND 01248000
* GPR 5 = POINTER TO VDEVBLOK FOR 1ST LINK FOUND 01249000
* GPR 6 = RELOCATION FACTOR OF VDEVBLOK BEING CHECKED 01250000
* GPR 7 = SIZE IN BYTES OF ONE VDEVBLOK 01251000
* GPR 8 = VIRTUAL DEVICE BLOCK ADDRESS 01252000
* GPR 9 = SCRATCH 01253000
* GPR 10 = VMBLOK ADDRESSES OF OTHER USERS BEING CHECKED 01254000
* GPR 11 = VMBLOK ADDRESS OF CURRENT USER 01255000
* GPR 14 = RETURN ADDRESS 01256000
* GPR 15 = BASE REGISTER 01257000
* 01258000
* GPR 12-13 ARE NOT USED. 01259000
* 01260000
* NOTES - 01261000
* 01262000
* NONE 01263000
* 01264000
* OPERATION - 01265000
* 01266000
* 1. STARTS WITH VMBLOK SPECIFIED BY CALLER - GO TO STEP 2. 01267000
* 01268000
* 2. FOR EACH VMBLOK, SEARCHES ALL VIRTUAL DEVICE BLOCKS 01269000
* FOR A VDEVREAL POINTER AND VDEVRELN RELOCATION FACTOR 01270000
* MATCHING THAT SUPPLIED BY THE CALLER (IGNORING ANY DEDICATED 01271000
* DASD DEVICES). IF FOUND, GO TO STEP 4. 01272000
* 01273000
* 3. IF NOT FOUND, REPEATS STEP 2 FOR ALL VMBLOKS UNTIL 01274000
* THE CHAIN OF VMBLOKS IS EXHAUSTED. RETURNS CONDITION CODE 0 01275000
* AND A ZERO VALUE IN GPR'S 0 THRU 3 IF NO LINKS WERE FOUND. 01276000
* 01277000
* 4. IF A LINK WAS FOUND (FROM STEP 2), REMEMBERS THE 01278000
* VDEVBLOK CURRENTLY POINTED TO AS THE ANCHOR FOR THE CHAIN 01279000
* OF LINKS, AND GO TO STEP 5. 01280000
* 01281000
* 5. CHECKS ALL LINKS IN THE CHAIN, COUNTING WRITE LINKS AND 01282000
* READ LINKS. REMEMBERS WHERE ANY READ OR WRITE LINK WAS FOUND 01283000
* (MOST RECENT ONE TAKING PRIORITY). 01284000
* 01285000
* 6. REPEATS STEP 5 UNTIL CHAIN HAS BEEN COMPLETELY SEARCHED. 01286000
* IF THE CHAIN ANCHOR IS NOT FOUND, I.E., THE ANCHOR POINTS 01287000
* INTO THE CHAIN BUT IS NOT PART OF IT, AN ABEND 1 IS ISSUED. 01288000
* IF ANY WRITE LINKS WERE FOUND IN STEP 5, RETURNS THE ADDRESS 01289000
* OF THE VDEVBLOK FOR THE MOST RECENT ONE FOUND, IN GPR 2. IF 01290000
* NOT, RETURNS THE ADDRESS OF THE VDEVBLOK FOR THE FIRST READ 01291000
* LINK FOUND, IN GPR 2 (ALSO RETURNING THE OWNER'S VMBLOK 01292000
* ADDRESS IN GPR 3). IN ANY EVENT, RETURNS THE COUNT OF READ 01293000
* LINKS IN GPR 0, AND WRITE LINKS IN GPR 1, AND THE CONDITION- 01294000
* CODE 1 OR 2 AS APPROPRIATE (SEE EXIT CONDITIONS). 01295000
*. 01296000
EJECT 01297000
*********************************************************************** 01298000
* * 01299000
* FIND ALL THE LINKS TO A GIVEN MINIDISK * 01300000
* * 01301000
*********************************************************************** 01302000
SPACE 01303000
ENTRY DMKSCNLI 01304000
DMKSCNLI DS 0D (DBL-WORD-ALIGNED FOR BEST PERFORMANCE) 01305000
USING *,R15 01306000
STM R3,R10,BALR3 SAVE REGISTERS 3 THRU 10 01307000
LR R6,R2 ACCESS UDEVBLOK VIA GPR 6 01308000
USING UDEVBLOK,R6 01309000
LM R2,R5,ZEROES CLEAR R2 THRU R5 01310000
ST R3,BALR3 CLEAR R3 TO BE RETURNED TO CALLER 01311000
LA R7,VDEVSIZE*8 R7 = SIZE IN BYTES OF ONE VDEVBLOK 01312000
LR R10,R11 START WITH OURSELVES 01313000
USING VMBLOK,R10 ... 01314000
LINKLCNT LH R9,VMDVCNT COUNT OF HOW MANY VDEVBLOKS 01315000
LTR R9,R9 (IF ANY) 01316000
BNP LINKNUSR TRF IF NONE AT ALL - TRY NEXT USER. 01317000
L R8,VMDVSTRT POINT TO BLOCK OF VIRTUAL DEVICE(S) 01318000
USING VDEVBLOK,R8 ... 01319000
LINKCKAD TM VDEVADD,X'80' BEWARE OF NULL BLOCK (MINUS SIGN THERE) 01320000
BO LINKNVDV TRF IF YES - LOOK AT NEXT ONE. 01321000
TM VDEVTYPC,CLASDASD IT IT A DASD DEVICE @VA01026 01322000
BZ LINKNVDV NO, SKIP THIS ONE @VA01026 01323000
CL R1,VDEVREAL DOES CALLER'S R1 MATCH REAL DEV. BLOCK ? 01324000
BE LINKFIND TRF IF YES - CHECK IT. 01325000
LINKNVDV AR R8,R7 ADVANCE TO NEXT BLOCK IN THE GROUP 01326000
BCT R9,LINKCKAD ITERATE THRU BLOCKS IN THE GROUP. 01327000
LINKNUSR L R10,VMPNT GET NEXT USER IN CHAIN OF VMBLOKS 01328000
CR R10,R11 END? 01329000
BNE LINKLCNT NO 01330000
LINKRETN LR R0,R3 COUNT OF R/O LINK(S) INTO R0, 01331000
LTR R1,R4 COUNT OF WRITE LINK(S) INTO R1 01332000
BP LINKEXIT IF PLUS, EXIT WITH COND. CODE = 2 01333000
LR R2,R5 POINTER TO VDEVBLOK (IF ANY) INTO R2, 01334000
LCR R3,R0 IF 0, SET COND. CODE 0 OR 1 PER R0 01335000
LINKEXIT LM R3,R10,BALR3 RESTORE NECESSARY REGISTERS 01336000
BR R14 AND EXIT TO CALLER. 01337000
SPACE 01338000
LINKFIND LH R0,VDEVRELN RELOCATION FACTOR INTO R0 01339000
CH R0,UDEVRELN DOES IT MATCH CALLER'S ? 01340000
BNE LINKNVDV TRF IT NOT - FORGET IT. 01341000
TM VDEVSTAT,VDEVDED IS THIS A DEDICATED DEVICE ? 01342000
BO LINKNVDV IF YES, FORGET IT. 01343000
TM VDEVFLAG,VDEVTDSK @VA11217 01343300
BO LINKNVDV @VA11217 01343600
CLI VDEVTYPE,TYP2311 MIGHT THIS BE A PSEUDO-2311 ? 01344000
BNE LINKFUND NO - FOUND A LINK 01345000
IC R0,UDEVFTR GET 'FTR2311T,FTR2311B' BITS, IF ANY 01346000
N R0,=A(FTR2311T+FTR2311B) ...AND ONLY THOSE BITS 01347000
BZ LINKFUND IT'S A REAL 2311 01348000
N R0,VDEVFLAG-3 SAME DEVICE IF FLAGS MATCH... 01349000
BZ LINKNVDV NO MATCH - DIFFERENT DEVICE 01350000
LINKFUND EQU * FOUND A LINK TO SAME MDISK 01351000
USING RDEVBLOK,R1 @VA03170 01352000
LH R1,RDEVLNKS SET UPPER LIMIT ON LOOP @VA03170 01353000
DROP R1 @VA03170 01354000
LR R5,R8 REMEMBER WHERE WE FOUND THE FIRST ONE 01355000
LA R9,1 1 INTO R9 FOR BUMPING COUNTS 01356000
ALR R1,R9 BUMP LIMIT FOR EXTRA MEASURE @VA03170 01357000
LINKNEXT TM VDEVFLAG,VDEVRDO IS IT READ-ONLY? 01358000
BO LINKREAD TRF IF YES. 01359000
LR R2,R8 REMEMBER WHERE WRITE DISK WAS 01360000
AR R4,R9 BUMP COUNT OF WRITE LINK(S) FOUND 01361000
B LINKCONT GO LOOK FOR NEXT VDEVBLOK. 01362000
SPACE 01363000
LINKREAD AR R3,R9 BUMP COUNT OF READ LINK(S) FOUND 01364000
MVC BALR3(4),VDEVUSER RETURN VMBLOK ADDR OF R/O USER IN R3 01365000
LINKCONT L R8,VDEVLINK POINT TO NEXT VDEVBLOK 01366000
CR R8,R5 ARE WE BACK WHERE WE STARTED ? 01367000
BE LINKRETN FOUND THE START OF THE CHAIN @VA03170 01368000
BCT R1,LINKNEXT CHECK THE NEXT LINK @VA03170 01369000
ABEND 1 @VA03170 01370000
DROP R8,R10 01371000
EJECT 01372000
* COMMON CODE TO SET THE CONDITION-CODE TO 1, 2, OR 3 01373000
* AND RETURN TO THE CALLER VIA R14: 01374000
SPACE 01375000
DROP R15 (ADDRESSABILITY DOES NOT MATTER) 01376000
SPACE 2 01377000
SETCC1 CLI F0,X'FF' SET CC = 1 01378000
BR R14 RETURN TO CALLER 01379000
SPACE 3 01380000
SETCC2 CLI FFS,X'00' SET CC = 2 %V3M4038 01381000
BR R14 RETURN TO CALLER %V3M4038 01382000
SPACE 3 01383000
SETCC3A L R8,FFS MAKE REG 8 NEG. %VA05925 01384000
SETCC3 TM FFS,X'FF' SET CC = 3 %V3M4038 01385000
BR R14 RETURN TO CALLER %V3M4038 01386000
SPACE 3 01387000
BALRMVC MVC BALRSAVE(0),0(R1) EXECUTED TO MOVE STUFF TO BALRSAVE 01388000
SPACE 3 01389000
LTORG - IF ANY - 01390000
EJECT 01391000
*. SUBROUTINE NAME - 01392000
* 01393000
* DMKSCNRN 01394000
* 01395000
* FUNCTION - 01396000
* 01397000
* RETURN TO THE CALLER THE NAME OF THE DEVICE IN GPR 1 01398000
* 01399000
* ENTRY POINT - 01400000
* 01401000
* DMKSCNRN - DEVICE NAME FOR A GIVEN REAL DEVICE 01402000
* DMKSCNVN - DEVICE NAME FOR A GIVEN VIRTUAL DEVICE 01403000
* 01404000
* ENTRY CONDITIONS - 01405000
* 01406000
* GPR 8 ADDRESS OF THE RDEVBLOK (DMKSCNRN) 01407000
* GPR 8 ADDRESS OF THE VDEVBLOK (DMKSCNVN) 01408000
* GPR 14 RETURN ADDRESS 01409000
* GPR 15 ADDRESS OF DMKSCNRN 01410000
* 01411000
* EXIT CONDITION 01412000
* 01413000
* GPR 8 UNCHANGED 01414000
* GPR 14 UNCHANGED 01415000
* GPR 1 CONTAINS THE NAME OF THE DEVICE 01416000
* 01417000
* CALLS TO OTHER ROUTINES - 01418000
* 01419000
* NONE 01420000
* 01421000
* EXTERNAL REFERENCES - 01422000
* 01423000
* NONE 01424000
* 01425000
* TABLES / WORK AREAS 01426000
* 01427000
* BALR2-BALR4 OF BALRSAVE USED FOR GPRS 2 - 4 01428000
* 01429000
* REGISTER USAGE - 01430000
* 01431000
* GPR 2 = INDEX REG 01432000
* GPR 3 = INDEX REG 01433000
* GPR 8 = ADDRESS OF RDEVBLOK OR VDEVBLOK 01434000
* GPR 14 = RETURN ADDRESS 01435000
* GPR 15 = BASE REG. 01436000
* 01437000
* 01438000
* NOTES - 01439000
* 01440000
* NONE 01441000
EJECT 01442000
* 01443000
* OPERATION - 01444000
* 01445000
* USES THE DEVICE CLASS AND TYPE FIELDS IN THE DEVICE BLOCK 01446000
* TO LOCATE THE CORRESPONDING DEVICE NAME. REGISTER 1 01447000
* IS THEN LOADED WITH THIS NAME AND EXITS TO THE CALLER. 01448000
*. 01449000
SPACE 2 01450000
ENTRY DMKSCNRN,DMKSCNVN 01451000
SPACE 01452000
USING DMKSCNRN,R15 COMMON BASE FOR SCNVN, SCNRN 01453000
USING VDEVBLOK,R8 01454000
SPACE 01455000
DMKSCNVN STM R2,R4,BALR2 SAVE VOLATILE REGISTERS 01456000
LA R4,VDEVTYPC POINT TO DEVICE CLASS, TYPE FIELDS 01457000
LA R15,DMKSCNRN-DMKSCNVN(0,R15) ADJUST ADDRESSABILITY 01458000
B SCNRNINT JOIN COMMON LOGIC 01459000
SPACE 01460000
USING RDEVBLOK,R8 SWITCH TO REAL DEVICE BLOCK 01461000
DMKSCNRN STM R2,R4,BALR2 SAVE VOLATILE REGISTERS 01462000
LA R4,RDEVTYPC POINT TO DEVICE CLASS, TYPE FIELDS 01463000
DROP R8 01464000
SCNRNINT SR R2,R2 CLEAR WORK REGISTER 01465000
SR R3,R3 ZERO 01466000
ICM R2,B'1000',0(R4) INSERT DEVICE CLASS 01467000
SRL R2,1 CORRECTION FACTOR 01468000
SCNRNDEV BXLE R2,R2,SCNRNFND BRANCH WHEN BIT IS SHIFTED OUT . 01469000
LA R3,1(0,R3) COUNT NUMBER OF SHIFTS 01470000
B SCNRNDEV LOOP THRU ALL POSSIBILITIES 01471000
SCNRNFND TM 0(R4),CLASTERM LINE OR CONSOLE DEVICE ? 01472000
BO SCNRNTRM IF LINE OR CONS BRANCH 01473000
CLI 0(R4),CLASSPEC SPECIAL DEVICE CLASS ? 01474000
BE SCNRNSPC YES - CHECK FOR CTCA 01475000
TM 0(R4),CLASURO+CLASURI SPECIAL CASE FOR RDR/PRT/PUN 01476000
BZ SCNRNEXT IF NOT UNIT RECORD, EXIT 01477000
TM 0(R4),CLASURO CHECK FOR OUTPUT SPOOL DEVICE 01478000
BNZ SCNRNURO BRANCH IF EITHER. 01479000
TM 1(R4),TYPRDR IS DEVICE A CARD READER ? 01480000
BO SCNRNEXT IF YES, BRANCH 01481000
LA R3,4(0,R3) RE-ADJUST, UNSUPPORTED DEVICE 01482000
B SCNRNEXT EXIT 01483000
EJECT 01484000
SCNRNTRM TM 1(R4),TYP2700+TYPTELE2+TYPIBM1+TYPSDLC @V67CDF1 01485000
* IS IT A TP USAGE LINE ? 01485500
BNZ SCNRNEXT YES, EXIT .INDEX POINTER IS CORRECT. 01486000
CLI 1(R4),TYP3210 VIRTUAL MACHINE CONSOLE ? 01487000
BNE SCNRNEXT BRANCH ON UNDEFINED TERMINALS. 01488000
LA R3,8(0,R3) ADJUST INDEX FOR CONSOLE 01489000
B SCNRNEXT EXIT. 01490000
SCNRNURO TM 1(R4),TYPPUN TEST FOR PUNCH 01491000
BO SCNRNEXT IF ITS A PUNCH, EXIT 01492000
LA R3,3(0,R3) RE-ADJUST FOR 'DEV' UNSUPPORTED 01493000
TM 1(R4),TYPPRT IS IT A PRINTER ? 01494000
BZ SCNRNEXT NO - INDEX IS CORRECT 01495000
LA R3,1(0,R3) ADJUST FOR SPOOL PRINTER 01496000
B SCNRNEXT 01497000
SCNRNSPC TM 1(R4),TYPCTCA+TYP3705+TYP3851 SUPPORTED DEVICE @V407466 01498000
BZ SCNRNEXT NO -- R3 IS SET ALREADY@V200820 01499000
LA R3,3(0,R3) POINT TO 'CTCA' @V200820 01500000
CLI 1(R4),TYPCTCA IS THAT RIGHT ? @V200820 01501000
BE SCNRNEXT YES - LET IT BE SO @V200820 01502000
LA R3,1(0,R3) MUST BE A 3705 'CTLR' @V200820 01503000
CLI 1(R4),TYP3705 3705 'CTLR' @V407466 01504000
BE SCNRNEXT YES, LET IT BE SO @V407466 01505000
LA R3,1(0,R3) POINT TO 'MSC ' @V407466 01506000
SCNRNEXT SLL R3,2 MULTI INDEX VALUE BY 4 01507000
L R1,SCNRNTBL(R3) LOAD DEVICE NAME INTO R 1 01508000
LM R2,R4,BALR2 RESTORE REGS 2 - 4 01509000
BR R14 RETURN TO CALLER. 01510000
SPACE 2 01511000
* THE FOLLOWING TABLE IS POSITIONAL AND SHOULD NOT BE CHANGED 01512000
* 01513000
SCNRNTBL DS 0F ALIGN 01514000
DC CL4'LINE' CONSTANT 01515000
DC CL4'GRAF' CONSTANT 01516000
DC CL4'RDR ' CONSTANT 01517000
DC CL4'PUN ' CONSTANT 01518000
DC CL4'TAPE' CONSTANT 01519000
DC CL4'DASD' CONSTANT 01520000
DC CL4'DEV ' CONSTANT 01521000
DC CL4'PRT ' CONSTANT 01522000
DC CL4'CONS' CONSTANT 01523000
DC CL4'CTCA' CONSTANT 01524000
DC CL4'CTLR' CONSTANT @V200820 01525000
DC CL4'MSC ' CONSTANT @V407466 01526000
EJECT 01527000
COPY DEVTYPES 01528000
PSA 01529000
COPY CONBUF 01530000
COPY EQU 01531000
COPY VMBLOK 01532000
COPY RBLOKS 01533000
COPY VBLOKS 01534000
COPY UDIRECT 01535000
END 01536000