VDS TITLE 'DMKVDS (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 VALIDATE SEQUENCING OF SYSIN 00002000
SPACE 00003000
DMKVDS CSECT 00004000
SPACE 00005000
EXTRN DMKTDKGT 00006000
EXTRN DMKSYSCK @VM08883 00007000
EXTRN DMKSCNVU 00008000
EXTRN DMKSCNLI @VA04747 00008010
EXTRN DMKSCNRD,DMKSCNRU @V200820 00009000
EXTRN DMKCVTBH,DMKERMSG @V200820 00010000
EXTRN DMKCVTAB @VA04301 00010100
EXTRN DMKFRERC CALL TO DMFREE WITH RETURN CODE @V3E7466 00010110
EXTRN DMKSPLDL @V60B9BA 00010200
SPACE 00011000
USING PSA,R0 00012000
USING RDEVBLOK,R1 00013000
USING UDEVBLOK,R2 00014000
USING VDEVBLOK,R8 00015000
USING VMBLOK,R11 00016000
USING DMKVDS,R12 00017000
USING SAVEAREA,R13 00018000
SPACE 00019000
*. 00020000
* MODULE NAME - 00021000
* 00022000
* DMKVDS 00023000
* 00024000
* CONTENTS - 00025000
* 00026000
* DMKVDSAT - SUBROUTINE TO ATTACH A VIRTUAL DEVICE 00027000
* DMKVDSDF - SUBROUTINE TO DEFINE A VIRTUAL DEVICE 00028000
* DMKVDSLK - SUBROUTINE TO LINK TO A VIRTUAL DASD DEVICE 00029000
EJECT 00030000
* SUBROUTINE NAME - 00031000
* 00032000
* DMKVDSAT - SUBROUTINE TO ATTACH A VIRTUAL DEVICE 00033000
* 00034000
* FUNCTION - 00035000
* 00036000
* TO PERFORM THE INTERNAL FUNCTIONS NECESSARY TO 00037000
* ATTACH A VIRTUAL DEVICE TO A USER. 00038000
* 00039000
* ATTRIBUTES - 00040000
* 00041000
* REENTRANT, PAGEABLE, CALLED VIA SVC 00042000
* 00043000
* ENTRY POINTS - 00044000
* 00045000
* DMKVDSAT 00046000
* 00047000
* ENTRY CONDITIONS - 00048000
* 00049000
* GPR 1 = ADDRESS OF RDEVBLOK TO BE ATTACHED 00050000
* GPR 2 = ADDRESS OF UDEVBLOK FOR THE VIRT ADDR 00051000
* GPR 11 = ADDRESS OF USER'S VMBLOK 00052000
* GPR 12 = ADDRESS OF DMKVDSAT 00053000
* GPR 13 = ADDRESS OF STANDARD SAVE AREA 00054000
* 00055000
* EXIT CONDITIONS - 00056000
* 00057000
* VIRTUAL DEVICE BLOCK HAS BEEN CREATED (IF NECESSARY) 00058000
* AND INITIALIZED AS NEEDED. 00059000
* 00060000
* CC = 0 IF SUCCESSFUL (AND GPR2 = 0) 00061000
* CC = 1 IF UNSUCCESSFUL - ERROR-CODE RETURNED IN GPR 2 00062000
* 00063000
* GPR 1 = ADDRESS OF REAL DEVICE BLOCK (UNCHANGED) 00064000
* GPR 2 = ERROR-CODE AS FOLLOWS (IF UNSUCCESSFUL): 00065000
* 8 = SPOOL DEVICE NOT DRAINED 00066000
* 12 = REAL DEVICE IS OFFLINE 00067000
* 16 = DEVICE IS IN USE BY SYSTEM 00068000
* 20 = DASD DEVICE IS CP OWNED 00069000
* 24 = REAL DEVICE IS DEDICATED 00070000
* 32 = STORAGE REQUEST NOT SATISFIED. 00070100
* 124 = MAX NO. OF VIRT DEV DEFINED 00070200
* GPR 8 = ADDRESS OF VIRTUAL DEVICE BLOCK 00071000
* 00072000
* CALLS TO OTHER ROUTINES - 00073000
* 00074000
* DMKFRERC - TO OBTAIN VCHBLOK, VCUBLOK AND VDEVBLOK 00075000
* DMKFRET - TO RETURN A VCHBLOK, VCUBLOK, OR VDEVBLOK TO FREE 00076000
* STORAGE (IF A LARGER ONE IS NEEDED) 00077000
* DMKSCNVU - TO FIND THE VCHBLOK, VCUBLOK, AND/OR VDEVBLOK FOR 00078000
* A VIRTUAL DEVICE. 00079000
* DMKSPLDL - TO DELETE THE SPOOL FILES ON THE DELAY PURGE 00079100
* QUEUE OF A 3800 PRINTER TO BE ATTACHED 00079200
* 00080000
* EXTERNAL REFERENCES - 00081000
* 00082000
* NONE 00083000
EJECT 00084000
* TABLES / WORK AREAS - 00085000
* 00086000
* RDEVBLOK 00087000
* UDEVBLOK 00088000
* VCHBLOK 00089000
* VCUBLOK 00090000
* VDEVBLOK 00091000
* 00092000
* REGISTER USAGE - 00093000
* 00094000
* GPR 6 = ADDRESS OF VCHBLOK 00095000
* GPR 7 = ADDRESS OF VCUBLOK 00096000
* GPR 8 = ADDRESS OF VDEVBLOK 00097000
* GPR 9 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDBLOK 00098000
* GPR 10 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDVDEV 00099000
* GPR 11 = ADDRESS OF USER'S VMBLOK 00100000
* GPR 12 = BASE REGISTER 00101000
* GPR 13 = ADDRESS OF STANDARD SAVE AREA 00102000
* 00103000
* GPRS 0-5 AND 14-15 ARE WORK REGISTERS. 00104000
* 00105000
* NOTES - 00106000
* 00107000
* NONE 00108000
* 00109000
* OPERATION - 00110000
* 00111000
* 1. THE REAL DEVICE BLOCK IS CHECKED TO SEE IF THE REAL DEVICE 00112000
* IS OFFLINE, ATTACHED TO THE SYSTEM, OWNED BY CP, OR ALREADY 00113000
* ATTACHED. IF SO, A CONDITION-CODE 1 AND A SPECIFIC ERROR CODE 00114000
* IN GPR 2 ARE RETURNED TO THE CALLER (SEE EXIT CONDITIONS). 00115000
* 00116000
* 2. IF NOT, THEN A VIRTUAL DEVICE BLOCK (AND CONTROL UNIT BLOCK 00117000
* AND/OR CHANNEL BLOCK, IF NECESSARY) IS CREATED AND INITIALIZED 00118000
* (USING INTERNAL SUBROUTINES BLDVDEV & BLDBLOK). 00119000
* 00120000
* 3. FINALLY, DMKVDSAT FLAGS THE REAL DEVICE AS DEDICATED 00121000
* (I.E. ATTACHED), AND FILLS IN OTHER DATA AS NEEDED IN THE 00122000
* VIRTUAL AND REAL DEVICE BLOCKS, AND RETURNS TO THE CALLER. 00123000
* 00124000
* ERROR MESSAGES - 00125000
* 00126000
* DMKVDS465W CTLR XXX EMULATOR LINES IN USE BY SYSTEM 00127000
*. 00128000
EJECT @V4075A0 00128100
COPY OPTIONS @V4075A0 00128200
EJECT @V4075A0 00128300
EJECT 00129000
DC CL8'DMKVDS' MODULE IDENTIFIER. 00130000
SPACE 00131000
DMKVDSAT RELOC , SUBROUTINE TO ATTACH A REAL DEVICE 00132000
SWITCH MAKE SURE WE ARE ON THE IO PROCESSOR @V4075A0 00132100
SPACE 2 00133000
TM RDEVSTAT,RDEVDISA+RDEVDED CHECK REAL DEVICE 00134000
BNZ ATTBUSY BRANCH IF OFFLINE OR ALREADY IN USE 00135000
TM RDEVTYPC,CLASDASD+CLASTAPE DASD OR TAPE ? @V200820 00136000
BNZ ATTDATA YES -- @V200820 00137000
TM RDEVTYPC,CLASURI+CLASURO INPUT OR OUTPUT ? @V200820 00138000
BNZ ATTURIO YES -- SPOOL @V200820 00139000
TM RDEVTYPC,CLASTERM+CLASGRAF TERM OR GRAPHIC ? @V200820 00140000
BNZ ATTRMGR YES -- @V200820 00141000
CLI RDEVTYPC,CLASSPEC CLASS SPECIAL ? @V200820 00142000
BNE ATTBLDV NO -- JUST ATTACH IT @V200820 00143000
SPACE 00144000
ATTSPEC EQU * DEDICATE CLASSPEC @V200820 00145000
CLI RDEVTYPE,TYP3705 IS THIS A 3704 OR 3705 ? @V200820 00146000
BNE ATTBLDV NO -- @V200820 00147000
TM RDEVSTAT,RDEVRSVD LINES IN USE BY THE SYSTEM ?@V200820 00148000
BO ATTSHRD YES -- @V200820 00149000
TM RDEVFLAG,RDEVRCVY IN RECOVERY BY SYSTEM? @VA01656 00150000
BO ATTSHRD YES -- CAN'T ATTACH THEN @VA01656 00151000
TM RDEVFLAG,RDEVLNCP IS THERE AN ACTIVE NICLIST ?@V200820 00152000
BZ ATTSPEP NO -- CHECK EMULATOR LINES @V200820 00153000
LH R3,RDEVMAX MAXIMUM RESOURCE I.D. @V200820 00154000
LA R3,1(0,R3) PLUS ONE FOR NO. OF NICBLOKS @V200820 00155000
MH R3,=AL2(NICSIZE) GR3 = NICLIST SIZE IN DBL-WD@V200820 00156000
LR R0,R3 . . . @VM08559 00157000
L R1,RDEVNICL START OF THE NICLIST @V200820 00158000
CALL DMKFRET RETURN IT TO FREE STORAGE @V200820 00159000
L R1,SAVER1 RECOVER RDEVBLOK ADDRESS @V200820 00160000
SLR R3,R3 @V200820 00161000
ST R3,RDEVNICL NO MORE ACTIVE NICLIST @V200820 00162000
NI RDEVFLAG,255-RDEVLNCP NO MORE NCP @V200820 00163000
STH R3,RDEVMAX CLEAR RESOURCE I.D. COUNT @V200820 00164000
ATTSPEP EQU * @V200820 00165000
TM RDEVFLAG,RDEVEPLN EP-LINES IN USE BY SYSTEM ? @V200820 00166000
BZ ATTBLDV NO -- O.K. TO ATTACH @V200820 00167000
LR R8,R1 RDEVBLOK TO GR8 @V200820 00168000
CALL DMKSCNRD GET DEVICE ADDRESS IN GR1 @V200820 00169000
CALL DMKCVTBH CONVERT @V200820 00170000
ICM R1,8,BLANKS PUT A BLANK HIGH-ORDER @V200820 00171000
L R0,MSGHEAD MODULE ID, LENGTH @V200820 00172000
L R2,MSGPARM FLAGS, MSG NUMBER @V200820 00173000
CALL DMKERMSG,AFFINITY @V4075A0 00174100
LM R1,R2,SAVER1 RESTORE RDEVBLOK, UDEVBLOK PTRS @V200820 00175000
B ATTBLDV GO ATTACH THE 370X @V200820 00176000
SPACE 00177000
ATTRMGR EQU * DEDICATE CLASTERM OR CLASGRAF @V200820 00178000
TM RDEVFLAG,RDEVENAB IN USE BY THE SYSTEM ? @V200820 00179000
BO ATTSHRD YES -- @V200820 00180000
CLI RDEVTYPC,CLASGRAF GRAF DEVICE? @VA09765 00180100
BNE ATTBLDV NO, CONTINUE @VA09765 00180150
CLC RDEVNAME,TST3138 3138? @VA09765 00180200
BE GRAFCONS YES, BRANCH @VA09765 00180250
CLC RDEVNAME,TST3148 3148? @VA09765 00180300
BE GRAFCONS YES, BRANCH @VA09765 00180350
CLC RDEVNAME,TST3158 3158? @VA09765 00180400
BE GRAFCONS YES, BRANCH @VA09765 00180450
CLC RDEVNAME,TST3036 3036? @VA09765 00180500
BE GRAFCONS YES, BRANCH @VA09765 00180550
CLC RDEVNAME,TST3066 3066? @VA09765 00180600
BNE ATTBLDV NO, BRANCH @VA09765 00180650
GRAFCONS DS 0H @VA09765 00180700
OI UDEVSTAT,UDEV3158 SET INDICATOR @VA09765 00180750
B ATTBLDV GO ATTACH THE DEVICE @V200820 00181000
SPACE 00182000
ATTURIO EQU * DEDICATE CLASURI OR CLASURO @V200820 00183000
TM RDEVFLAG,RDEVDRAN IS THE DEVICE DRAINED ? @V200820 00184000
BZ ATTDRAN NO -- @V200820 00185000
ICM R15,15,RDEVSPL CHECK FOR ACTIVE SFBLOK @V200820 00186000
BNZ ATTDRAN YES - CANNOT ATTACH @V200820 00187000
CLI RDEVTYPE,TYP3800 IS IS A 3800 PRINTER ? @V60B9BA 00187010
BNE ATTBLDV GO ATTACH IF NOT 3800 @V60B9BA 00187020
SPACE 1 00187030
* THE DELAY PURGE QUEUE MUST BE PURGED FOR A 3800 PRINTER @V60B9BA 00187040
* BEFORE ATTACHING IT TO THE USER @V60B9BA 00187050
SPACE 1 00187060
LR R10,R7 SAVE R7 FOR NOW @V60B9BA 00187070
NOCALL4 L R7,RDEVDELP GET THE DELAYED PURGE ANCHOR @V60B9BA 00187080
LTR R7,R7 ANYTHING THERE ? @V60B9BA 00187090
BZ NOCALL5 XFER IF NOTHING THERE @V60B9BA 00187100
MVC RDEVDELP,0(R7) NEXT ONE IS NOW FIRST @V60B9BA 00187110
CALL DMKSPLDL GO AND DELETE IT @V60B9BA 00187120
B NOCALL4 DO FOR NEXT ONE ALSO @V60B9BA 00187130
NOCALL5 LR R7,R10 RESTORE R7 @V60B9BA 00187140
B ATTBLDV ATTACH THE DEVICE @V200820 00188000
SPACE 00189000
ATTDATA EQU * DEDICATE CLASDASD OR CLASTAPE @V200820 00190000
TM RDEVFLAG,RDEVSYS+RDEVOWN IN USE BY SYSTEM ? @V200820 00191000
BNZ ATTBUSY YES -- @V200820 00192000
LA R4,8(0,0) LOOP COUNTER IF 2305 DEVICE @V200820 00193000
SPACE 00194000
ATTBLDV EQU * BUILD VDEVBLOK, DEDICATE DEVICE @V200820 00195000
BAL R10,BLDVDEV @V200820 00196000
USING VCHBLOK,R6 @VA01041 00197000
USING VCUBLOK,R7 @VA01041 00198000
OI RDEVSTAT,RDEVDED FLAG REAL DEVICE AS DEDICATED 00199000
NI RDEVFLAG,X'FF'-RDEVMOUT INDICATE MOUNTED AND ATTACHED 00200000
ST R11,RDEVUSER STORE ATTACHED USER'S VMBLOK ADDRESS 00201000
LH R0,UDEVADD STORE ATTACHED VIRTUAL ADDRESS 00202000
STH R0,RDEVATT .. 00203000
L R15,=A(DMKSYSCK) @VM08883 00204000
STCK 0(R15) OBTAIN ATTACH TIME @VM08883 00205000
BC 3,DOWNWEGO CLOCK NOT FUNCTIONING @VA04301 00205100
MVC RDEVTMAT,0(R15) AND SAVE IT. @VM08883 00206000
OI VDEVSTAT,VDEVDED FLAG VIRTUAL DEVICE AS DEDICATED 00207000
LH R0,RDEVTYPC MAKE VIRTUAL DEVICE TYPE SAME AS REAL 00208000
STH R0,VDEVTYPC .. 00209000
CH R0,=AL1(CLASSPEC,TYPCTCA) IS THIS A CTCA ? 00210000
BNE ATTNCTC NO -- O.K. AS IS 00211000
MVI VCUTYPE,VCUCTCA CONTROL UNIT IS CHAN-TO-CHAN@VA01041 00212000
MVI VCHTYPE,VCHSEL FORCE CHANNEL TYPE TO SELECTOR @VA05197 00212500
ATTNCTC EQU * 00213000
ST R1,VDEVREAL STORE ATTACHED RDEVBLOK ADDRESS 00214000
BAL R9,CHEKRSRL CHECK WHETHER RESERVE/RELEASE VALID CCW 00215000
CLI RDEVTYPC,CLASDASD DASD DEVICE ? @V200820 00216000
BNE ATTEXIT NO -- ALL DONE @V200820 00217000
CLI RDEVTYPE,TYP2305 MULTIPLE-EXPOSURE DRUM ? @V200820 00218000
BNE ATTCHKRD NO -- TEST FOR READ/ONLY @V200820 00219000
TM UDEVMODE,X'18' SEPARATE R/O CHECK @VA02888 00220000
BNZ *+8 NOT READ/ONLY ATTACH @V200820 00221000
OI VDEVFLAG,VDEVRDO MAKE VIRTUAL DEVICE R/O @V200820 00222000
MVI VCUTYPE,X'00' CONTROL UNIT IS NOT SHARED @VA01041 00223000
LR R8,R1 RDEVBLOK TO GR8 @V200820 00224000
CALL DMKSCNRD GET REAL DEVICE ADDR IN CCU FORM @VA04098 00225000
LA R1,1(0,R1) NEXT EXPOSURE @V200820 00226000
CALL DMKSCNRU LOCATE THE NEXT RDEVBLOK @V200820 00227000
LR R1,R8 . . .IN GR1 @V200820 00228000
L R2,SAVER2 RECOVER THE UDEVBLOK @V200820 00229000
LH R3,UDEVADD VIRTUAL DEVICE ADDRESS @V200820 00230000
LA R3,1(0,R3) INCREMENT @V200820 00231000
STH R3,UDEVADD . . . @V200820 00232000
BCT R4,ATTBLDV BUILD EIGHT VDEVBLOK'S @V200820 00233000
LH R3,UDEVADD @V200820 00234000
S R3,F8 RESTORE ORIGINAL ADDRESS @V200820 00235000
STH R3,UDEVADD . . . @V200820 00236000
LH R1,UDEVADD GET ITS ADDRESS PLEASE @VA04098 00237000
CALL DMKSCNVU REOBTAIN VDEVBLOK (MAY HAVE MOVED@VA04098 00238000
B ATTEXIT ALL DONE @V200820 00239000
SPACE 00240000
ATTCHKRD TM UDEVMODE,X'18' IS THIS TO BE A R/O LINK/ATTACH? @VA02888 00241000
BNZ ATTEXIT IF NOT, GO EXIT. 00242000
OI VDEVFLAG,VDEVRDO YES, FLAG VIRTUAL DEVICE AS READ-ONLY 00243000
ATTEXIT ST R8,SAVER8 RETURN VDEVBLOK ADDRESS 00244000
TM VCHTYPE,VCHSEL SELECTOR CHANNEL? @VA03072 00245000
BNZ ATTCOMP NO -- ALL SET AS IS @VA01041 00246000
CLI VDEVTYPC,CLASTAPE SHARED TYPE? @VA02808 00247000
BE SETSHRD SET SHARED SUB-CHAN CTL UNIT @VA02808 00248000
CLI VDEVTYPC,CLASGRAF GRAF CLASS? @VA02808 00249000
BNE ATTCOMP NON-SHARED CTL UNIT @VA02808 00250000
TM VDEVTYPE,TYP3277+TYP3278 3270? @V60A6B6 00251000
BZ ATTCOMP NO--NON SHARED @V60A6B6 00252000
TM UDEVSTAT,UDEV3158 IS IT A 3158? @VA02100 00253000
BO ATTCOMP YES, NOT SHARED @VA02100 00254000
SETSHRD OI VCUTYPE,VCUSHRD SHARED SUB-CHANNEL CTL UNIT @VA02808 00255000
ATTCOMP EQU * SET RETURN CODE AND EXIT @VA01041 00256000
SR R0,R0 SET CC = 0 00257000
ST R0,SAVER2 PASS BACK ZERO RETURN CODE 00258000
VDSEXIT EXIT RETURN TO CALLER 00259000
SPACE 2 00260000
DROP R1,R6,R7 @VA01041 00261000
EJECT 00262000
*. 00263000
* SUBROUTINE NAME - 00264000
* 00265000
* DMKVDSDF - SUBROUTINE TO DEFINE A VIRTUAL DEVICE 00266000
* 00267000
* FUNCTION - 00268000
* 00269000
* TO PERFORM THE INTERNAL FUNCTIONS NECESSARY TO 00270000
* DEFINE A NEW VIRTUAL DEVICE FOR A USER. 00271000
* 00272000
* ATTRIBUTES - 00273000
* 00274000
* REENTRANT, PAGEABLE, CALLED VIA SVC 00275000
* 00276000
* ENTRY POINTS - 00277000
* 00278000
* DMKVDSDF 00279000
* 00280000
* ENTRY CONDITIONS - 00281000
* 00282000
* GPR 2 = ADDRESS OF USER DEVICE BLOCK 00283000
* GPR 11 = ADDRESS OF USER'S VMBLOK 00284000
* GPR 12 = ADDRESS OF DMKVDSDF 00285000
* GPR 13 = ADDRESS OF STANDARD SAVE AREA 00286000
* 00287000
* EXIT CONDITIONS - 00288000
* 00289000
* VIRTUAL DEVICE BLOCK HAS BEEN CREATED (IF NECESSARY) 00290000
* AND INITIALIZED AS NEEDED. 00291000
* 00292000
* CC = 0 IF SUCCESSFUL (AND GPR2 = 0) 00293000
* CC = 1 IF UNSUCCESSFUL - ERROR-CODE RETURNED IN GPR 2 00294000
* 00295000
* GPR 2 = ERROR-CODE AS FOLLOWS (IF UNSUCCESSFUL): 00296000
* 28 = SPACE NOT AVAILABLE 00297000
* GPR 8 = ADDRESS OF VIRTUAL DEVICE BLOCK 00298000
* 00299000
* CALLS TO OTHER ROUTINES - 00300000
* 00301000
* DMKFREE - TO OBTAIN A VCHBLOK, VCUBLOK, VDEVBLOK OR VSPXBLOK 00302000
* DMKFRET - TO RETURN A VCHBLOK, VCUBLOK, OR VDEVBLOK TO FREE 00303000
* STORAGE (IF A LARGER ONE IS NEEDED) 00304000
* DMKTDKGT - TO OBTAIN T-DISK SPACE 00305000
* DMKSCNVU - TO FIND THE VCHBLOK, VCUBLOK, AND/OR VDEVBLOK FOR 00306000
* A VIRTUAL DEVICE. 00307000
* 00308000
* EXTERNAL REFERENCES - 00309000
* 00310000
* NONE 00311000
EJECT 00312000
* TABLES / WORK AREAS - 00313000
* 00314000
* UDEVBLOK 00315000
* VCHBLOK 00316000
* VCUBLOK 00317000
* VDEVBLOK 00318000
* VSPXBLOK 00318100
* 00319000
* REGISTER USAGE - 00320000
* 00321000
* GPR 6 = ADDRESS OF VCHBLOK 00322000
* GPR 7 = ADDRESS OF VCUBLOK 00323000
* GPR 8 = ADDRESS OF VDEVBLOK 00324000
* GPR 9 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDBLOK 00325000
* GPR 10 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDVDEV 00326000
* GPR 11 = ADDRESS OF USER'S VMBLOK 00327000
* GPR 12 = BASE REGISTER 00328000
* GPR 13 = ADDRESS OF STANDARD SAVE AREA 00329000
* 00330000
* GPRS 0-5 AND 14-15 ARE WORK REGISTERS. 00331000
* 00332000
* NOTES - 00333000
* 00334000
* NONE 00335000
* 00336000
* OPERATION - 00337000
* 00338000
* 1. A VIRTUAL DEVICE BLOCK (AND CONTROL UNIT BLOCK AND/OR 00339000
* CHANNEL BLOCK, IF NECESSARY) IS CREATED AND INITIALIZED 00340000
* (USING INTERNAL SUBROUTINES BLDVDEV & BLDBLOK). 00341000
* 00342000
* 2. THE DEVICE CLASS AND TYPE (PROVIDED BY THE CALLER) ARE 00343000
* STORED IN THE VIRTUAL DEVICE BLOCK, AND APPROPRIATE STEPS 00344000
* ARE TAKEN TO INITIALIZE THE VIRTUAL DEVICE BLOCK, AS NEEDED, 00345000
* FOR A TERMINAL, UNIT RECORD, OR T-DISK TYPE OF DEVICE. 00346000
* IN ADDITION, FOR A UNIT RECORD OUTPUT DEVICE, THE 00346100
* SMALL SIZED VSPXBLOK WITHOUT ROOM FOR THE TAG FIELD 00346200
* IS GOTTEN VIA DMKFREE AND THEN INITIALIZED. 00346300
* 00347000
* 3. WHEN ALL APPROPRIATE DATA HAS BEEN FILLED IN THE VIRTUAL 00348000
* DEVICE BLOCK, RETURN IS MADE TO THE CALLER. 00349000
*. 00350000
EJECT 00351000
DMKVDSDF RELOC SUBROUTINE TO DEFINE A VIRTUAL DEVICE 00352000
TM UDEVSTAT,UDEVTDSK DEFINING A T-DISK ? 00353000
BO DEFTDSK YES - SPECIAL HANDLING 00354000
BAL R10,BLDVDEV BUILD A VIRTUAL DEVICE BLOCK 00355000
LA R10,ATTEXIT SET R10 = A(ATTEXIT) FOR 'BR' & 'BCR' USE 00356000
LH R0,UDEVTYPC SET DEVICE CLASS AND TYPE 00357000
STH R0,VDEVTYPC .. 00358000
CLI VDEVTYPE,TYP1052 IS THIS A PRIMARY CONSOLE DEVICE ? 00359000
BE DEFTERM YES -- NEEDS VCONCTL 00360000
TM VDEVTYPC,CLASURI+CLASURO IS THIS A SPOOLED DEVICE ? 00361000
BNZ DEFSPOOL BRANCH IF YES 00362000
TM VDEVTYPC,CLASSPEC+CLASGRAF GRAF OR CTCA? @VA09186 00362100
BZR R10 NO-LEAVE IT @VA09186 00362200
OI VDEVSTAT,VDEVNRDY TURN ON NOT READY @VA09186 00362300
CLC VDEVTYPC(2),=AL1(CLASSPEC,TYPCTCA) IS IT CTCA? @VA12155 00363500
BCR 7,R10 'BNE ATTEXIT' NO - LEAVE IT ALONE 00364000
MVI VCUTYPE-VCUBLOK(R7),VCUCTCA MARK CTL UNIT ALSO 00366000
CLI VCHADD-VCHBLOK(R6),X'00' IS THIS CHANNEL ZERO ? @VA01771 00367000
BER R10 YES - EXIT. @VA01771 00368000
MVI VCHTYPE-VCHBLOK(R6),VCHSEL MAKE CTCA CHANNEL @VA01771 00369000
* SELECTOR. 00370000
BR R10 ...AND EXIT 00371000
SPACE 00372000
DEFTERM EQU * DEFINE PRIMARY VIRTUAL MACHINE CONSOLE 00373000
LA R0,VCONSIZE YES, LOAD BLOCK SIZE 00374000
CALL DMKFREE GET A VIRTUAL CONSOLE CONTROL BLOCK 00375000
ST R1,VDEVCON STORE ADDRESS IN VDEVBLOK 00376000
XC 0(VCONSIZE*8,R1),0(R1) CLEAR VCONCTL BLOK TO 0 00377000
LR R1,R8 VDEVBLOK ADDRESS TO GR1 @V200820 00378000
SL R1,VMDVSTRT COMPUTE DISPLACEMENT REFERENCE @V200820 00379000
STH R1,VMVTERM ...SET IT IN VMBLOK FOR OTHERS @V200820 00380000
DEFSPOOL IC R0,UDEVCLAS SET SPOOLED CLASS 00383000
STC R0,VDEVCLAS .. 00384000
MVI VDEVCOPY+1,X'01' DEFAULT TO ONE COPY @V200930 00385000
TM VDEVTYPC,CLASURI IS IT UNIT RECORD INPUT ?? @V200930 00386000
BO DEFSPLIN YES, CONT @V200930 00387000
TM UDEVSTAT,UDEVRDEF IS DEVICE RE-DEFINED? @VA12263 00387030
BO NOVSPXBK YES.. DON'T REALLOCATE @VA12263 00387060
LA R0,VSPXSIZ1 GET BASIC VSPXBLOK FOR URO DEVS @VA09273 00387100
CALL DMKFREE GO AND GET IT @V60B9BA 00387200
ST R1,VDEVEXTN POINT TO IT FROM VDEVBLOK @V60B9BA 00387300
USING VSPXBLOK,R1 ADDRESSIBILITY @V60B9BA 00387400
XC VSPXBLOK(VSPXSIZ1*8),VSPXBLOK CLEAR THE BLOCK @VA09273 00387500
MVC VSPXDIST,VMDIST DEFAULT DISTRIBUTION @V60B9BA 00387600
MVI VSPXLEN,VSPXSIZ1 MOVE IN ITS SIZE @VA09273 00387700
DROP R1 NO LONGER NEEDED @V60B9BA 00387800
NOVSPXBK EQU * @VA12263 00387900
CLI VDEVTYPE,TYP3210 CONSOLE DEVICE ? 00388000
BCR 7,R10 BNE ATTEXIT - NO 00389000
L R14,VMTERM ACCESS TERMINAL RDEVBLOK @VA10103 00389100
USING RDEVBLOK,R14 @VA10103 00389200
OI VDEVSFLG,VDEVTERM INDICATE TERM COPY FOR SPOOLED CONS 00390000
CLI VDEVCLAS,0 CLASS PRESENT ? 00391000
BNE *+8 YES - 00392000
MVI VDEVCLAS,C'T' MOVE IN DEFAULT CLASS T 00393000
LTR R14,R14 RDEVBLOK PRESENT ? 00394000
BZR R10 NO, EXIT. (TO ATTEXIT) @VA03322 00395000
CLI RDEVTYPC,CLASGRAF IS THIS A LOCAL 3270? @VA03322 00396000
BE DEFOPR YES. @VA03322 00397000
CLC RDEVTYPC(2),=AL1(CLASTERM,TYPBSC) REMOTE 3270? @VA03322 00398000
BNER R10 NO, EXIT. (TO ATTEXIT) @VA03322 00399000
DEFOPR EQU * @VA03322 00400000
TM VMOSTAT,VMSYSOP IS THIS THE SYSTEM OPERATOR ?? @V200730 00401000
BCR 8,R10 NO, ATTEXIT @V200730 00402000
OI VDEVFLAG,VDEVCSPL INDICATE CONSOLE SPOOL ACTIVE 00403000
DROP R14 00404000
BR R10 "B ATTEXIT". 00405000
SPACE 00406000
DEFSPLIN DS 0H 'DEFINE' SPOOLED INPUT: 00407000
OI VDEVSFLG,VDEVEOF INDICATE EOF VIA UNIT EXCEPTION 00408000
BR R10 AND "B ATTEXIT". 00409000
SPACE 2 00410000
DEFTDSK EQU * DEFINE TEMPORARY DASD DEVICE 00411000
LH R0,UDEVNCYL NUMBER OF CYLINDERS REQUIRED 00412000
SLR R1,R1 ... 00413000
IC R1,UDEVTYPE DEVICE TYPE REQUESTED 00414000
CALL DMKTDKGT GET SOME DASD SPACE 00415000
LTR R8,R8 WAS IT SUCCESSFUL ? 00416000
BZ ATTNSPC NO - EXIT WITH ERROR 00417000
ST R8,SAVEWRK6 SAVE REAL DEVICE BLOCK ADDRESS 00418000
ST R1,SAVEWRK7 ...AND START CYLINDER NUMBER 00419000
BAL R10,BLDVDEV BUILD A VIRTUAL DEVICE BLOCK 00420000
LH R0,UDEVTYPC DEVTYPC, DEVTYPE 00421000
STH R0,VDEVTYPC ... 00422000
LM R0,R1,SAVEWRK6 RDEVBLOK, CYL.NO. 00423000
STH R1,VDEVRELN RELOCATION FACTOR 00424000
ST R0,VDEVREAL RDEVBLOK POINTER 00425000
LR R1,R0 VDEVREAL INTO R1, AND 00426000
BAL R9,CHEKRSRL CHECK WHETHER RESERVE/RELEASE VALID CCW 00427000
LH R0,UDEVNCYL NUMBER OF CYLINDERS 00428000
STH R0,VDEVBND ... 00429000
L R15,=A(DMKSYSCK) @VM08883 00430000
STCK 0(R15) GET CURRENT TOD VALUE @VM08883 00431000
BC 12,CLOCKOK IS CLOCK FUNCTIONING? @VA04301 00431250
DOWNWEGO GOTO DMKCVTAB CLOCK DAMAGED...ABEND CVT001 @VA04301 00431500
CLOCKOK EQU * @VA04301 00431750
MVC VDEVTMAT,0(R15) SAVE WORD ZERO @VM08883 00432000
OI VDEVFLAG,VDEVTDSK THIS IS A T-DISK 00433000
B ATTEXIT ... 00434000
SPACE 2 00435000
USING RDEVBLOK,R1 (RESTORE FOR USE BY NEXT SUBROUTINE) 00436000
EJECT 00437000
*. 00438000
* SUBROUTINE NAME - 00439000
* 00440000
* DMKVDSLK - SUBROUTINE TO LINK TO A VIRTUAL DASD DEVICE 00441000
* 00442000
* FUNCTION - 00443000
* 00444000
* TO PERFORM THE INTERNAL FUNCTIONS NECESSARY TO 00445000
* LINK A VIRTUAL DEVICE TO A USER. 00446000
* 00447000
* ATTRIBUTES - 00448000
* 00449000
* REENTRANT, PAGEABLE, CALLED VIA SVC 00450000
* 00451000
* ENTRY POINTS - 00452000
* 00453000
* DMKVDSLK 00454000
* 00455000
* ENTRY CONDITIONS - 00456000
* 00457000
* GPR 1 = ADDRESS OF REAL DEVICE BLOCK 00458000
* GPR 2 = ADDRESS OF USER DEVICE BLOCK 00459000
* GPR 3 = ADDRESS OF VDEVBLOK FOR ANY EXISTING LINK (OR 0) 00460000
* GPR 11 = ADDRESS OF USER'S VMBLOK 00461000
* GPR 12 = ADDRESS OF DMKVDSLK 00462000
* GPR 13 = ADDRESS OF STANDARD SAVE AREA 00463000
* 00464000
* EXIT CONDITIONS - 00465000
* 00466000
* VIRTUAL DEVICE BLOCK HAS BEEN CREATED (IF NECESSARY) 00467000
* AND INITIALIZED AS NEEDED. 00468000
* 00469000
* CC = 0 IF SUCCESSFUL (AND GPR2 = 0) 00470000
* CC = 1 IF UNSUCCESSFUL - ERROR-CODE RETURNED IN GPR 2 00471000
* 00472000
* GPR 1 = ADDRESS OF REAL DEVICE BLOCK (UNCHANGED) 00473000
* GPR 2 = ERROR-CODE AS FOLLOWS (IF UNSUCCESSFUL): 00474000
* 12 = DEVICE IS OFFLINE 00475000
* 20 = DEVICE OWNED BY CP 00476000
* 24 = ALREADY ATTACHED 00477000
* GPR 8 = ADDRESS OF VIRTUAL DEVICE BLOCK 00478000
* 00479000
* CALLS TO OTHER ROUTINES - 00480000
* 00481000
* DMKFREE - TO OBTAIN A VCHBLOK, VCUBLOK, OR VDEVBLOK 00482000
* DMKFRET - TO RETURN A VCHBLOK, VCUBLOK, OR VDEVBLOK TO FREE 00483000
* STORAGE (IF A LARGER ONE IS NEEDED) 00484000
* DMKSCNVU - TO FIND THE VCHBLOK, VCUBLOK, AND/OR VDEVBLOK FOR 00485000
* A VIRTUAL DEVICE. 00486000
* 00487000
* EXTERNAL REFERENCES - 00488000
* 00489000
* NONE 00490000
EJECT 00491000
* TABLES / WORK AREAS - 00492000
* 00493000
* RDEVBLOK 00494000
* UDEVBLOK 00495000
* VCHBLOK 00496000
* VCUBLOK 00497000
* VDEVBLOK 00498000
* 00499000
* REGISTER USAGE - 00500000
* 00501000
* GPR 6 = ADDRESS OF VCHBLOK 00502000
* GPR 7 = ADDRESS OF VCUBLOK 00503000
* GPR 8 = ADDRESS OF VDEVBLOK 00504000
* GPR 9 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDBLOK 00505000
* GPR 10 = RETURN REGISTER FOR INTERNAL SUBROUTINE BLDVDEV 00506000
* GPR 11 = ADDRESS OF USER'S VMBLOK 00507000
* GPR 12 = BASE REGISTER 00508000
* GPR 13 = ADDRESS OF STANDARD SAVE AREA 00509000
* 00510000
* GPRS 0-5 AND 14-15 ARE WORK REGISTERS. 00511000
* 00512000
* NOTES - 00513000
* 00514000
* NONE 00515000
* 00516000
* OPERATION - 00517000
* 00518000
* 1. THE REAL DEVICE BLOCK IS CHECKED TO SEE IF THE REAL DEVICE 00519000
* IS OFFLINE, OWNED BY CP, OR ALREADY ATTACHED TO THE USER. 00520000
* IF SO, A CONDITION-CODE 1 AND A SPECIFIC ERROR CODE IN GPR 2 00521000
* ARE RETURNED TO THE CALLER (SEE EXIT CONDITIONS). 00522000
* 00523000
* 2. IF NOT, THEN A VIRTUAL DEVICE BLOCK (AND CONTROL UNIT BLOCK 00524000
* AND/OR CHANNEL BLOCK, IF NECESSARY) IS CREATED AND INITIALIZED 00525000
* (USING INTERNAL SUBROUTINES BLDVDEV & BLDBLOK). 00526000
* 00527000
* 3. FINALLY, DMKVDSLK INCREMENTS THE COUNT OF LINKS IN THE 00528000
* REAL DEVICE BLOCK, REVISES THE CHAIN OF LINKS FOR THE 00529000
* ADDED LINK, AND FILLS IN OTHER DATA AS NEEDED IN THE VIRTUAL 00530000
* AND REAL DEVICE BLOCKS, AND RETURNS TO THE CALLER. 00531000
*. 00532000
EJECT 00533000
DMKVDSLK RELOC SUBROUTINE TO LINK TO A VIRTUAL DASD DEVICE 00534000
SWITCH MAKE SURE WE ARE ON THE IO PROCESSOR @V4075A0 00534100
TM RDEVSTAT,RDEVDISA+RDEVDED CHECK REAL DEVICE 00535000
BNZ ATTBUSY BRANCH IF OFFLINE OR ALREADY IN USE 00536000
CALL DMKSCNLI @VA04747 00536050
LR R3,R2 @VA04747 00536100
LM R1,R2,SAVER1 @VA04747 00536150
ST R3,SAVEWRK9 REMEMBER R3 AT INPUT TO VDSLK 00537000
BAL R10,BLDVDEV BUILD A VIRTUAL DEVICE BLOCK 00538000
LH R4,RDEVLNKS ADD 1 TO COUNT OF LINKS TO THIS VOLUME 00539000
LA R4,1(,R4) .. 00540000
STH R4,RDEVLNKS .. 00541000
LH R0,UDEVTYPC SET VIRTUAL DEVICE CLASS AND TYPE 00543000
STH R0,VDEVTYPC .. 00544000
LH R0,UDEVRELN SET RELOCATION FACTOR 00545000
STH R0,VDEVRELN .. 00546000
LH R0,UDEVNCYL ALSO NUMBER OF CYLINDERS 00547000
STH R0,VDEVBND ... 00548000
ST R1,VDEVREAL STORE POINTER TO RDEVBLOK 00549000
TM UDEVSTAT,UDEVVRR VIRTUAL RESERVE/RELEASE? @V3E7466 00550000
BZ RRFEAT NO, SEE IF R/R HARDWARE FEATURE @V3E7466 00550100
OI VDEVFLG2,VDEVRRF VIRTUAL RESERVE/RELEASE @V3E7466 00550200
RRFEAT BAL R9,CHEKRSRL SE IF RESERVE/RELEASE VALID CCWS @V3E7466 00550300
CLI UDEVTYPE,TYP2311 IS THIS A REAL OR FAKE 2311 ? 00551000
BNE LNK02 NOPE - SOME OTHER DASD DEVICE. 00552000
OC VDEVFLAG(1),UDEVFTR YES, SET POSSIBLE VDEV231T/B FLAGBIT 00553000
LNK02 LR R4,R8 SAVE VDEVBLOK ADDRESS 00554000
L R3,SAVEWRK9 RECOVER R3 = 00 OR POINTER TO A VDEVBLOK 00555000
LTR R3,R3 ANY EXISTING LINKS (FROM CALLER) ? 00556000
BZ LNK03 BRANCH IF NO 00557000
L R4,VDEVLINK-VDEVBLOK(,R3) LOAD POINTER TO NEXT BLOCK 00558000
ST R8,VDEVLINK-VDEVBLOK(,R3) SET POINTER TO THIS BLOCK 00559000
LNK03 ST R4,VDEVLINK POINT THIS BLOCK TO NEXT ONE 00560000
TM UDEVSTAT,UDEVVRR WANT VIRTUAL RES/REL? @V407438 00560050
BZ ATTCHKRD NOPE, BR. @V407438 00560100
L R1,VDEVRRB-VDEVBLOK(R4) VRRBLOK FRM NXT IN CHAIN@V407438 00560150
* IT COULD BE ME, IF SO, R1=0 00560200
* TO DIRECTORY UPDATE 00560250
LTR R1,R1 IS THERE ALREADY A VRRBLOK? @V407438 00560300
BNZ SETEND YES, USE EXISTING VRRBLOK @V407438 00560350
LA R0,VRRSIZE SIZE OF THE VIRT RES/REL BLOCK @V407438 00560400
CALL DMKFREE GET STORAGE FOR IT @V407438 00560450
USING VRRBLOK,R1 ADDRESS THE BLOCK VIA R1 @V407438 00560500
XC VRRBLOK(VRRSIZE*8),VRRBLOK CLEAR THE BLOCK @V407438 00560550
SETEND LR R0,R8 REM. WHERE VDEVLINK CHAIN ENDS @V407438 00560600
SETVRR ST R1,VDEVRRB VDEVBLOK POINTS TO VRRBLOK @V407438 00560650
OI VDEVFLG2,VDEVRRF RES/REL FTR INST ON THIS MDSK @V407438 00560700
L R8,VDEVLINK ON TO THE NEXT VDEVBLOK NOW... @V407438 00560750
CLR R0,R8 IS THIS THE END OF THE CHAIN? @V407438 00560800
BNE SETVRR NOPE, KEEP GOING @V407438 00560850
B ATTCHKRD GO CHECK IF TO FLAG R/O, AND THEN EXIT. 00561000
DROP R1 NO MORE VRRBLOK @V407438 00561500
EJECT 00562000
* BLDVDEV - BUILD A VIRTUAL DEVICE 00563000
* (AN INTERNAL SUBROUTINE) 00564000
* 00565000
* AT ENTRY: 00566000
* R2 = ADDRESS OF USER DEVICE BLOCK 00567000
* R10 = RETURN REGISTER 00568000
* SAVEWRK9 = R3 AT INPUT TO DMKVDSLK, OR IMMATERIAL 00569000
* 00570000
* AT EXIT: 00571000
* R1-R3 RESTORED 00572000
* R6 = ADDRESS OF VIRTUAL CHANNEL BLOCK 00573000
* R7 = ADDRESS OF VIRTUAL CONTROL UNIT BLOCK 00574000
* R8 = ADDRESS OF VIRTUAL DEVICE BLOCK 00575000
* SAVEWRK9 = UPDATED R3 FOR DMKVDSLK, OR IMMATERIAL 00576000
* 00577000
BLDVDEV EQU * BUILD VDEVBLOK, VCUBLOK, VCHBLOK @VM08537 00578000
STM R1,R3,BALR1 SAVE GR1-3 AT SUBRTN ENTRY @VM08537 00579000
MVI SAVEWRK1,X'00' CLEAR A FLAG BYTE @VM08537 00580000
LH R1,UDEVADD LOAD THE VIRTUAL DEVICE ADDRESS 00581000
CALL DMKSCNVU FIND THE VIRT CHAN AND CU BLOCK ADDRESSES 00582000
LR R5,R1 SAVE THE VIRTUAL DEVICE ADDRESS 00583000
BC 1,BLDDVBK BRANCH IF BOTH CHAN AND CU BLOCKS FOUND 00584000
BC 2,BLDCUBK BRANCH IF ONLY CHANNEL BLOCK FOUND 00585000
BC 8,BLDFIN BRANCH IF ALL EXIST - JUST FINISH UP. 00586000
* OTHERWISE, BUILD ALL THREE: 00587000
DROP R2 00588000
* BUILD A VIRTUAL CHANNEL BLOCK 00589000
LA R0,VCHSIZE LOAD CHANNEL BLOCK SIZE 00590000
L R1,VMCHSTRT GET POINTER TO VCHBLOK TABLE 00591000
LH R2,VMCHCNT GET NUMBER OF BLOCKS IN TABLE 00592000
BAL R9,BLDBLOK BUILD A VIRTUAL CHANNEL BLOCK 00593000
ST R1,VMCHSTRT STORE UPDATED VCHBLOK TABLE POINTER 00594000
STH R2,VMCHCNT STORE NEW VCHBLOK COUNT 00595000
LR R6,R8 LOAD VCHBLOK BASE REGISTER 00596000
USING VCHBLOK,R6 00597000
MVC VCHBLOK(VCHCUTBL-VCHBLOK),ZEROES CLEAR START OF VCHBLOK 00598000
MVC VCHCUTBL(8),FFS SET VCHCUTBL TO FFFFFFFF'S 00599000
MVC VCHCUTBL+8(24),VCHCUTBL ... 00600000
LA R2,X'F00' STORE CHANNEL ADDRESS IN VCHBLOK 00601000
NR R2,R5 .. 00602000
STH R2,VCHADD .. 00603000
BZ BLDCH01 BRANCH IF CHANNEL 0 - MULTIPLEXER CHANNEL 00604000
OI VCHTYPE,VCHSEL FLAG CHANNELS 1-6 AS SELECTOR CHANNELS 00605000
TM VMFSTAT,VMFBMX DOES USER WANT BLOK MULTIPLEXER @VA01771 00606000
* CHANS. 00607000
BZ *+8 NO - LEAVE THEM AS SELECTOR @VA01771 00608000
MVI VCHTYPE,VCHBMX YES - CHANGE THEM TO BLOK MULTI. @VA01771 00609000
BLDCH01 SRL R2,7 MULTIPLE CHANNEL ADDR BY 2 00610000
SR R8,R1 COMPUTE DISP. OF THIS VCHBLOK 00611000
STH R8,VMCHTBL(R2) STORE IN APPROPRIATE CHANNEL TABLE SLOT 00612000
OI SAVEWRK1,NEWVCH IND. NEW VCHBLOK BUILT 00612100
SPACE 00613000
* BUILD A VIRTUAL CONTROL UNIT BLOCK 00614000
BLDCUBK LA R0,VCUSIZE LOAD CONTROL UNIT BLOCK SIZE 00615000
L R1,VMCUSTRT GET POINTER TO VCUBLOK TABLE 00616000
LH R2,VMCUCNT GET NUMBER OF BLOCKS IN TABLE 00617000
BAL R9,BLDBLOK BUILD A VIRTUAL CONTROL UNIT BLOCK 00618000
ST R1,VMCUSTRT STORE UPDATED VCUBLOK TABLE POINTER 00619000
STH R2,VMCUCNT STORE NEW VCUBLOK COUNT 00620000
LR R7,R8 LOAD VCUBLOK BASE REGISTER 00621000
USING VCUBLOK,R7 00622000
MVC VCUBLOK(VCUDVTBL-VCUBLOK),ZEROES CLEAR START OF VCUBLOK 00623000
MVC VCUDVTBL(8),FFS SET VCUDVTBL TO FFFFFFFF'S 00624000
MVC VCUDVTBL+8(24),VCUDVTBL ... 00625000
LA R2,X'0F0' STORE CU ADDRESS IN VCUBLOK 00626000
NR R2,R5 .. 00627000
STH R2,VCUADD 00628000
SRL R2,3 MULTIPLY CTL UNIT ADDRESS BY 2 @VA01041 00629000
SR R8,R1 COMPUTE DISPLACEMENT OF THIS VCUBLOK 00630000
STH R8,VCHCUTBL(R2) STORE IN APPROPRIATE CU TABLE SLOT 00631000
OI SAVEWRK1,NEWVCU IND. NEW VCUBLOK BUILT 00631100
SPACE 00632000
* BUILD A VIRTUAL DEVICE BLOCK 00633000
BLDDVBK LA R0,VDEVSIZE LOAD DEVICE BLOCK SIZE 00634000
L R1,VMDVSTRT GET POINTER TO VDEVBLOK TABLE 00635000
LH R2,VMDVCNT GET NUMBER OF BLOCKS IN TABLE 00636000
OI SAVEWRK1,NEWVDEV BUILDING NEW VDEVBLOK NOW @V3E7466 00637000
BAL R9,BLDBLOK BUILD A VIRTUAL DEVICE BLOCK 00638000
ST R1,VMDVSTRT STORE UPDATED VDEVBLOK TABLE POINTER 00639000
STH R2,VMDVCNT STORE NEW VDEVBLOK COUNT 00640000
LR R3,R8 SAVE VDEVBLOK ADDRESS 00641000
LA R2,X'00F' STORE DEVICE ADDRESS IN VDEVBLOK 00642000
NR R2,R5 .. 00643000
STH R2,VDEVADD .. 00644000
AR R2,R2 MULTIPLY DEVICE ADDRESS BY 2 00645000
SR R3,R1 COMPUTE DISPLACEMENT OF THIS VDEVBLOK 00646000
STH R3,VCUDVTBL(R2) STORE IN APPROPRIATE DEVICE TABLE SLOT 00647000
BLDFIN XC VDEVADD+2(VDEVSIZE*8-2),VDEVADD+2 CLEAR REMAINDER OF BLK 00648000
ST R11,VDEVUSER STORE USER'S VMBLOK ADDRESS IN VDEVBLOK 00649000
LM R1,R3,BALR1 RESTORE GR1-3 AT SUBRTN ENTRY @VM08537 00650000
BR R10 AND EXIT TO MAIN CODE. 00651000
LIMITERR DS 0H @VA09651 00651100
LA R2,124 SET RETURN CODE 124 FOR @VA13217 00651200
* ATTACH,DEFINE, AND LINK 00651300
ST R2,SAVER2 @VA09651 00651400
LCR R2,R2 SET CC=1 @VA09651 00651500
B VDSEXIT RETURN TO CALLER @VA09651 00651600
EJECT 00652000
* BLDBLOK - BUILD ONE NEW CHANNEL-, CONTROL UNIT-, OR DEVICE-BLOCK 00653000
* (AN INTERNAL SUBROUTINE) 00654000
* 00655000
* AT ENTRY: 00656000
* R0 = VCHSIZE, VCUSIZE, OR VDEVSIZE 00657000
* R1 = VMCHSTRT, VMCUSTRT, OR VMDVSTRT (IF ANY) 00658000
* R2 = VMCHCNT, VMCUCNT, OR VMDVCNT (IF ANY) 00659000
* R9 = RETURN-REGISTER 00660000
* SAVEWRK1 = X'00' IF CHANNEL OR CONTROL UNIT BLOCK WANTED, 00661000
* OR X'80' IF DEVICE BLOCK WANTED. 00662000
* SAVEWRK9 = R3 AT INPUT TO DMKVDSLK, OR IMMATERIAL 00663000
* 00664000
* AT EXIT: 00665000
* R1 = UPDATED VMCHSTRT, VMCUSTRT, OR VMDVSTRT 00666000
* R2 = UPDATED VMCHCNT, VMCUCNT, OR VMDVCNT 00667000
* R8 = NEW CHANNEL-, CONTROL UNIT-, OR DEVICE-BLOCK 00668000
* SAVEWRK9 = UPDATED R3 FOR DMKVDSLK, OR IMMATERIAL 00669000
* 00670000
BLDBLOK LTR R8,R1 ANY ENTRIES IN THE TABLE ? 00671000
BNP BLDNEW NO, BUILD ONE NEW BLOCK 00672000
* YES, LOOK FOR AN EMPTY SLOT 00673000
LR R3,R2 SAVE THE BLOCK COUNT 00674000
SLL R0,3 CONVERT SIZE TO NUMBER OF BYTES 00675000
BLDSLOT TM VDEVADD,X'80' IS THIS SLOT AVAILABLE ? 00676000
BCR 1,R9 "BO" IF YES - RETURN. 00677000
AR R8,R0 NO, POINT TO NEXT BLOCK 00678000
BCT R3,BLDSLOT LOOP IF MORE BLOCKS IN TABLE 00679000
SR R8,R1 COMPUTE OLD TABLE LENGTH 00680000
ST R8,SAVEWRK2 SAVE FOR LATER CALL TO FRET 00681000
ST R1,SAVEWRK3 SAVE OLD TABLE ADDRESS 00682000
LR R3,R0 SAVE THE BLOCK SIZE 00683000
AR R0,R8 COMPUTE NEW TABLE LENGTH 00684000
CLM R0,3,DEVLIM EXCEEDING MAX VIRTUAL DEVICES @VA13217 00684500
BH LIMITERR YES, DONT BUILD NEW TAB; LEAVE @VA13217 00684510
SRL R0,3 CONVERT TO NUMBER OF DOUBLE WORDS 00685000
CALL DMKFRERC GET FREE STORAGE FOR NEW TABLE @V3E7466 00686000
BNZ NOSTOR CC=1 - INSUFFICIENT STORAGE @V3E7466 00686100
STM R1,R2,SAVEWRK4 SAVE NEW TABLE ADDRESS & OLD BLOCK COUNT 00687000
LR R0,R3 RESTORE THE BLOCK SIZE 00688000
BCTR R3,0 SUBTRACT 1 FOR EXECUTED MVC 00689000
LR R8,R1 LOAD NEW TABLE ADDRESS 00690000
L R1,SAVEWRK3 LOAD OLD TABLE ADDRESS 00691000
BLDMOVE EX R3,BLDXMVC MOVE OLD BLOCK TO NEW LOCATION 00692000
TM SAVEWRK1,NEWVDEV BUILDING NEW VDEVBLOK NOW?? @V3E7466 00693000
BZ BLDNEXT BRANCH IF NO 00694000
CLI VDEVTYPC,CLASDASD IS THIS A DASD DEVICE ? 00695000
BNE BLDNEXT BRANCH IF NO 00696000
TM VDEVFLAG,VDEVTDSK IS IT A T-DISK 00697000
BO BLDNEXT YES- BRANCH (NO LINKS) 00698000
L R14,VDEVLINK LOAD SHARED DEVICE LINK 00699000
LTR R14,R14 IS THIS A SHARED DEVICE ? 00700000
BZ BLDNEXT BRANCH IF NOT. 00701000
LR R15,R8 LET R15 POINT TO NEW BLOCK, AND 00702000
B BLDCHCK GO SEE IF OLD BLOCK POINTED TO ITSELF. 00703000
BLDLOOP LR R15,R14 SAVE PREVIOUS VDEVBLOK ADDRESS 00704000
L R14,VDEVLINK-VDEVBLOK(,R14) LOAD NEXT VDEVBLOK ADDRESS 00705000
BLDCHCK CR R1,R14 DOES IT POINT TO THE OLD BLOCK ? 00706000
BNE BLDLOOP NO, KEEP LOOKING 00707000
ST R8,VDEVLINK-VDEVBLOK(,R15) YES, POINT IT TO NEW ONE 00708000
CL R1,SAVEWRK9 DOES OLD BLOCK MATCH R3 AT ENTRY TO VDSLK 00709000
BNE BLDNEXT NOPE. 00710000
ST R8,SAVEWRK9 IF YES, NEW "R3" FOR VDSLK CODE. 00711000
BLDNEXT AR R1,R0 POINT TO NEXT OLD BLOCK 00712000
AR R8,R0 POINT TO NEXT NEW BLOCK 00713000
BCT R2,BLDMOVE BRANCH IF MORE BLOCKS IN THE TABLE 00714000
LM R0,R1,SAVEWRK2 RELOAD OLD TABLE SIZE AND ADDRESS 00715000
SRL R0,3 CONVERT SIZE TO NUMBER OF DOUBLE WORDS 00716000
CALL DMKFRET RETURN OLD TABLE TO FREE STORAGE 00717000
LM R1,R2,SAVEWRK4 RELOAD NEW TABLE ADDRESS AND COUNT 00718000
LA R2,1(,R2) ADD 1 TO THE COUNT 00719000
BR R9 RETURN TO BLDVDEV ROUTINE. 00720000
SPACE 00721000
BLDNEW CALL DMKFRERC GET STORAGE FOR ONE NEW BLOCK @V3E7466 00722000
BNZ NOSTOR CC=1 - INSUFFICIENT STORAGE @V3E7466 00722100
LR R8,R1 LOAD NEW BLOCK ADDRESS 00723000
LA R2,1 SET COUNT TO 1 00724000
BR R9 RETURN TO BLDVDEV ROUTINE. 00725000
SPACE 2 00726000
BLDXMVC MVC VDEVBLOK(0),0(R1) MOVE ONE BLOCK FROM OLD TABLE TO NEW 00727000
EJECT 00727100
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00727200
* BITS DEFINED IN FIRST BYTE OF SAVEWRK1 * 00727300
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00727400
SPACE 2 00727500
NEWVDEV EQU X'80' BUILDING NEW VDEVBLOK @V3E7466 00727600
NEWVCH EQU X'40' NEW VCHBLOK ALREADY BUILT @V3E7466 00727700
NEWVCU EQU X'20' NEW VCUBLOK ALREADY BUILT @V3E7466 00727800
SPACE 00727900
SPACE 2 00728000
USING RDEVBLOK,R1 00729000
USING VDEVBLOK,R8 00730000
CHEKRSRL TM RDEVFTR,FTRRSRL IS RESERVE/RELEASE VALID CCW ? 00731000
BCR 8,R9 <BZ> NO - JUST EXIT. 00732000
OI VDEVFLAG,VDEVRSRL YES - SET FLAG-BIT IN VDEVBLOK 00733000
BR R9 AND EXIT. 00734000
EJECT 00735000
* RDEVSTAT MUST BE TESTED IN THIS ORDER 00736000
ATTBUSY TM RDEVSTAT,RDEVDISA IS THE DEVICE OFFLINE ? 00737000
LA R2,12 R2=12 FOR 'DEVICE IS OFFLINE' 00738000
BO ATTRETN BRANCH IF YES. 00739000
TM RDEVSTAT,RDEVDED IS IT ALREADY DEDICATED ? 00740000
LA R2,24 R2=24 FOR 'ALREADY ATTACHED' 00741000
BO ATTRETN BRANCH IF YES. 00742000
TM RDEVFLAG,RDEVOWN IS IT OWNED BY CP ? 00743000
LA R2,20 R2=20 FOR 'DEVICE OWNED BY CP' 00744000
BO ATTRETN BRANCH IF YES. 00745000
* MUST BE A SYSTEM VOLUME, THEN: 00746000
ATTSHRD LA R2,16 R2 = 16: 'ATTACHED TO SYSTEM' 00747000
B ATTRETN 00748000
SPACE 00749000
ATTDRAN LA R2,8 SPOOL DEVICE NOT DRAINED @V200820 00750000
B ATTRETN @V200820 00751000
NOSTOR TM SAVEWRK1,NEWVDEV ARE WE BUILDING VDEVBLOK? @V3E7466 00751025
BO CHKNEWCU YES, SEE IF NEW VCUBLOK BUILT @V3E7466 00751050
TM SAVEWRK1,NEWVCH DID WE BUILD NEW VCHBLOK?? @V3E7466 00751075
BO PATCHVCH YES, MUST MEAN THIS REQ. FOR VCU @V3E7466 00751100
B NOSTOR2 ISSUE INSUFF. STORAGE MSG. @V3E7466 00751125
SPACE 00751150
CHKNEWCU TM SAVEWRK1,NEWVCU DID WE BUILD NEW VCUBLOK? @V3E7466 00751175
BO PATCHVCU YES, MUST UNDO WHAT HAS BEEN DONE@V3E7466 00751200
TM SAVEWRK1,NEWVCH DID WE BUILD NEW VCHBLOK?? @V3E7466 00751225
BO PATCHVCH YES, MUST UNDO WHAT HAS BEEN DONE@V3E7466 00751250
NOSTOR2 LA R2,RC32 INSUFFICIENT STORAGE FOR BLOCKS @V3E7466 00751275
B ATTRETN RETURN TO CALLER @V3E7466 00751300
SPACE 00751325
PATCHVCU LA R2,FFS MAKE BLOCK LOOK LIKE EMPTY SLOT @V3E7466 00751350
STH R2,VCUADD ... @V3E7466 00751375
LA R1,X'0F0' PUT X'FFFF' IN CUTBL INDEX @V3E7466 00751400
NR R1,R5 ... @V3E7466 00751425
SRL R1,3 ... @V3E7466 00751450
STH R2,VCHCUTBL(R1) STORE IN CORRECT CU TABLE SLOT @V3E7466 00751475
TM SAVEWRK1,NEWVCH NEW VCHBLOK BUILT ALSO? @V3E7466 00751500
BZ NOSTOR2 NO, PATCH WORK ALL DONE @V3E7466 00751525
PATCHVCH LA R2,FFS MAKE BLOCK LOOK LIKE EMPTY SLOT @V3E7466 00751550
STH R2,VCHADD ... @V3E7466 00751575
LA R1,X'F00' STORE X'FFFF' IN CORRECT VMCHTBL SLOT@V3E7466 00751600
NR R1,R5 ... @V3E7466 00751625
STH R2,VMCHTBL(R1) ... @V3E7466 00751650
B NOSTOR2 NOW GO ISSUE ERROR MSG @V3E7466 00751675
SPACE 00752000
ATTNSPC LA R2,28 'SPACE NOT AVAILABLE' 00753000
SPACE 00754000
ATTRETN ST R2,SAVER2 RETURN ERROR-CODE TO CALLER IN R2 00755000
LCR R2,R2 PLUS-TO-MINUS SETS CONDITION-CODE = 1 00756000
B VDSEXIT NOW GO RETURN TO CALLER. 00757000
RC32 EQU 32 INSUFFICIENT FREE STORAGE @V3E7466 00757100
SPACE 00758000
DS 0F @V200820 00759000
MSGHEAD DC C'VDS',X'00' DMKERMSG PARMS FOR @V200820 00760000
MSGPARM DC X'80E6',AL2(465) MSG= DMKVDS465W @V200820 00761000
TST3036 DC X'3036' @VA09765 00761050
TST3066 DC X'3066' @VA09765 00761100
TST3138 DC X'3138' @VA09765 00761150
TST3148 DC X'3148' @VA09765 00761200
TST3158 DC X'3158' @VA09765 00761250
DEVLIM DC X'7FFF' @VA09651 00761500
SPACE 3 00762000
LTORG 00763000
SPACE 00764000
ENTRY DMKVDSND 00765000
DMKVDSND EQU * SHOW "THE END" OF DMKVDS ON LOAD MAP. 00766000
EJECT 00767000
COPY EQU 00768000
COPY DEVTYPES 00769000
PSA 00770000
COPY SAVE 00771000
COPY VMBLOK 00772000
COPY RBLOKS 00773000
COPY NETWORK @V200820 00774000
COPY VBLOKS 00775000
COPY IOBLOKS 00776000
COPY IOER 00777000
COPY UDIRECT 00778000
END 00779000