VDR TITLE 'DMKVDR (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 VALIDATE SEQUENCING OF SYSIN @V200020 00002000
COPY OPTIONS @V200020 00003000
COPY LOCAL @V200020 00004000
SPACE 2 00005000
*. 00006000
* MODULE NAME - 00007000
* 00008000
* DMKVDR 00009000
* 00010000
* CONTENTS - 00011000
* 00012000
* DMKVDREL - SUBROUTINE TO RELEASE A VIRTUAL DEVICE 00013000
*. 00014000
SPACE 2 00015000
DMKVDR START 00016000
SPACE 00017000
MODID DC CL8'DMKVDR' PAGEABLE MODULE IDENTIFIER @V200020 00018000
SPACE 00019000
USING PSA,R0 @V200020 00020000
USING VMBLOK,R11 @V200020 00021000
USING SAVEAREA,R13 @V200020 00022000
SPACE 00023000
EXTRN DMKVSPCO,DMKVSPCR @V200020 00024000
EXTRN DMKSTKCP @VA12861 00024500
EXTRN DMKCVTBH,DMKSCNRN,DMKSCNRD @V200020 00025000
EXTRN DMKIOSQR,DMKCFPRD,DMKTDKRL,DMKACODV @V200020 00026000
EXTRN DMKIOSRW,DMKVCARS @V200020 00027000
EXTRN DMKPTRPW @VA08037 00027200
EXTRN DMKSSSRL @VA11344 00027600
EJECT 00028000
*. 00029000
* SUBROUTINE NAME - 00030000
* 00031000
* DMKVDREL - SUBROUTINE TO RELEASE A VIRTUAL DEVICE 00032000
* 00033000
* FUNCTION - 00034000
* 00035000
* TO PERFORM THE NECESSARY FUNCTIONS TO RELEASE A REAL OR 00036000
* VIRTUAL DEVICE FROM A VIRTUAL MACHINE. 00037000
* 00038000
* ATTRIBUTES - 00039000
* 00040000
* REENTRANT, PAGEABLE, CALLED VIA SVC 00041000
* 00042000
* ENTRY POINT - 00043000
* 00044000
* DMKVDREL 00045000
* 00046000
* ENTRY CONDITIONS - 00047000
* 00048000
* GPR 1 = VIRTUAL DEVICE ADDRESS 00049000
* GPR 6 = ADDRESS OF VCHBLOK 00050000
* GPR 7 = ADDRESS OF VCUBLOK 00051000
* GPR 8 = ADDRESS OF VDEVBLOK 00052000
* GPR 11 = ADDRESS OF USER'S VMBLOK 00053000
* GPR 12 = ADDRESS OF DMKVDREL 00054000
* GPR 13 = ADDRESS OF STANDARD SAVE AREA 00055000
* 00056000
* EXIT CONDITIONS - 00057000
* 00058000
* DEVICE HAS BEEN RELEASED FROM THE VIRTUAL MACHINE 00059000
* 00060000
* CALLS TO OTHER ROUTINES - 00061000
* 00062000
* DMKCFPRD 00063000
* DMKACODV 00064000
* DMKCVTBH 00065000
* DMKQCNWT 00066000
* DMKFREE 00067000
* DMKSCNRD 00068000
* DMKSCNRN 00069000
* DMKIOSQR 00070000
* DMKTDKRL 00071000
* DMKVSPCR 00072000
* DMKVSPCO 00073000
* DMKVCARS 00074000
* DMKFRET 00075000
* DMKPTRPW 00075200
* 00076000
* EXTERNAL REFERENCES - 00077000
* 00078000
* DMKIOSRW 00079000
* TABLES / WORK AREAS - 00080000
* 00081000
* VMBLOK 00082000
* VCHBLOK 00083000
* VCUBLOK 00084000
* VDEVBLOK 00085000
* VSPXBLOK 00086000
* IOBLOK 00087000
* 00088000
* REGISTER USAGE - 00089000
* 00090000
* GPR 6 = ADDRESS OF VCHBLOK 00091000
* GPR 7 = ADDRESS OF VCUBLOK 00092000
* GPR 8 = ADDRESS OF VDEVBLOK 00093000
* GPR 10 = ADDRESS OF IOBLOK 00094000
* GPR 11 = ADDRESS OF USER'S VMBLOK 00095000
* GPR 12 = BASE REGISTER 00096000
* GPR 13 = ADDRESS OF STANDARD SAVE AREA 00097000
* GPRS 0-5 AND 14-15 ARE WORK REGISTERS. 00098000
* GPR 9 IS NOT USED. 00099000
* 00100000
* NOTES - 00101000
* 00102000
* NONE 00103000
* OPERATION - 00104000
* 00105000
* 1. A CALL IS MADE TO DMKCFPRD TO RESET THE DEVICE AND 00106000
* CLEAR ANY ACTIVE IOBLOK OR PENDING I/O INTERRUPTS. 00107000
* 00108000
* 2. CHECKS ARE THEN MADE TO SEE IF THE DEVICE IS DEDICATED, 00109000
* A DISK STORAGE DEVICE, A UNIT RECORD DEVICE, A SPECIAL 00110000
* DEVICE, OR A CONSOLE DEVICE. (IF NONE OF THESE, AN ABEND 00111000
* VIA SVC 0 IS GENERATED, INDICATING AN INTERNAL CODING ERROR.) 00112000
* 00113000
* 3. DEDICATED DEVICE: THE RDEVBLOK ADDRESS IS OBTAINED FROM 00114000
* THE VDEVBLOK, AND ITS ADDRESS IS THEN CLEARED. IF THE DEVICE 00115000
* IS A TAPE, AN IOBLOK TO REWIND AND UNLOAD THE TAPE IS BUILT, 00116000
* AND DMKIOSQR IS CALLED TO START THE OPERATION. IN ANY EVENT, 00117000
* THE DMKACODV ACCOUNTING ROUTINE IS CALLED, THE DEDICATED FLAG 00118000
* BITS IN THE RDEVBLOK AND VDEVBLOK ARE CLEARED, THE OPERATOR IS 00119000
* SENT A MESSAGE THAT THE DEVICE HAS BEEN RELEASED (BY WHAT 00120000
* USER), AND RETURN IS MADE. 00121000
* 00122000
* 4. DISK STORAGE DEVICE: THE RDEVBLOK ADDRESS IS OBTAINED 00123000
* FROM THE VDEVBLOK, AND ITS ADDRESS (VDEVREAL) IS THEN CLEARED. 00124000
* IF THE DEVICE IS A T-DISK, DMKACODV IS CALLED TO BUILD AN 00125000
* ACCOUNTING RECORD. THEN DMKTDKRL IS CALLED TO RETURN THE 00126000
* T-DISK SPACE TO THE SYSTEM, AND RETURN IS MADE. IF NOT, THE 00127000
* COUNT OF LINKS TO THE DISK IN THE RDEVBLOK IS DECREMENTED, AND 00128000
* THE CHAIN OF LINKS TO THE DISK ACCESSIBLE VIA THE VDEVBLOK IS 00129000
* ADJUSTED TO DELETE THE CALLER'S USERID. RETURN IS THEN MADE. 00130000
* 00131000
* 5. UNIT RECORD DEVICE: IF NO FILES ARE OPEN, RETURN IS MADE. 00132000
* IF YES, THEN DMKVSPCO IS CALLED TO CLOSE THE PRINTER OR PUNCH, 00133000
* OR DMKVSPCR IS CALLED TO CLOSE THE READER, AND RETURN IS MADE. 00134000
* 00135000
* 6. SPECIAL DEVICE: IF THE DEVICE IA A VIRTUAL CHANNEL- 00136000
* TO-CHANNEL ADAPTER (CTCA), DMKVCARS IS CALLED TO RESET THE 00137000
* UNIT AND DISCONNECT IT FROM ANOTHER ADAPTER, IF NEEDED. 00138000
* IF IT IS NOT A VIRTUAL CTCA, RETURN IS IMMEDIATE. 00139000
* 00140000
* 7. CONSOLE DEVICE: IF THE DEVICE IS NOT A 1052 TYPE DEVICE, 00141000
* EXIT IS IMMEDIATELY MADE TO THE CALLER. IF CONSOLE SPOOL 00142000
* FILE IS ACTIVE; CALL DMKVSPCO TO CLOSE THE FILE. 00143000
* RETURN IS THEN MADE TO THE CALLER. 00144000
*. 00145000
SPACE 2 00146000
*********************************************************************** 00147000
* 00148000
* DMKVDREL = SUBROUTINE TO RELEASE A VIRTUAL DEVICE 00149000
* 00150000
*********************************************************************** 00151000
SPACE 00152000
DMKVDREL RELOC RELEASE A VIRTUAL DEVICE @V200020 00153000
CALL DMKPTRPW @VA08037 00153200
L R1,=A(DMKCFPRD) AVOID LOSING CONTROL DURING @VA04788 00153350
TRANS 2,1,OPT=(BRING,DEFER,SYSTEM) SVC TO DMKCFPRD @VA04788 00153700
USING VDEVBLOK,R8 @V200020 00154000
TM VDEVFLAG,VDEVDIAL IS IT A DIALED DEVICE? @VA12861 00154020
BZ COMMON NO, CONTINUE @VA12861 00154040
CLC VDEVREAL,F0 HAS DIAL PROCESS COMPLETED? @VA12861 00154060
BE COMMON YES, CONTINUE @VA12861 00154080
CLI VDEVTYPC,CLASGRAF IS IT GRAPHIC? @VA12861 00154100
BNE COMMON NO, CONTINUE @VA12861 00154120
** IF IT IS TO RELEASE/DROP A DIALED IN CONSOLE, PROCESS THE 00154140
** PENDING I/O FIRST. THAT IS, GET A CPEXBLOK TO RETURN TO 00154160
** PROCESS RESET/DROP DEVICE FOR A DIALED CONSOLE AFTER ITS 00154180
** OUTSTANDING I/O IS PROCESSED CORRECTLY. 00154200
LA R0,CPEXSIZE GET A CPEXBLOK @VA12861 00154220
CALL DMKFREE @VA12861 00154240
USING CPEXBLOK,R1 CPEXBLOK ADDRESSABILITY @VA12861 00154260
LA R15,COMMON SAVE RETURN ADDRESS @VA12861 00154280
STM R15,R14,CPEXADD AND ALL THE REGISTERS. @VA12861 00154300
CALL DMKSTKCP STACK THE CPEXBOK @VA12861 00154320
GOTO DMKDSPCH AND EXIT. @VA12861 00154340
DROP R1 @VA12861 00154360
COMMON EQU * @VA12861 00154380
OI VDEVFLAG,VDEVDET PREVENT VIR I/O TO DEV @VA04343 00154500
SR R0,R0 ZERO WORK REGISTER 00155000
CALL DMKCFPRD RESET THE DEVICE 00156000
SWITCH MAKE SURE WE ARE ON THE IO PROCESSOR @V4075A0 00156100
TM VDEVSTAT,VDEVDED IS THIS A DEDICTED DEVICE? @V407438 00157000
BO RELDEDD BRANCH IF YES 00158000
TM VDEVTYPC,CLASDASD IS THIS A DISK STORAGE DEVICE ? 00159000
BO RELDISK BRANCH IF YES 00160000
TM VDEVTYPC,CLASURI+CLASURO IS THIS A UNIT RECORD DEVICE ? 00161000
BNZ RELURDV BRANCH IF YES 00162000
TM VDEVTYPC,CLASSPEC IS THIS A SPECIAL DEVICE ? 00163000
BO RELSPEC BRANCH IF YES 00164000
TM VDEVTYPC,CLASTERM IS THIS A CONSOLE DEVICE ? 00165000
BO RELCONS BRANCH IF YES 00166000
B RELEXIT LEAVE NOW 00167000
SPACE 3 00168000
RELDEDD L R2,VDEVREAL LOAD ATTACHED RDEVBLOK ADDRESS 00169000
USING RDEVBLOK,R2 00170000
TM VDEVTYPC,CLASTAPE IS THIS A TAPE DRIVE ? 00171000
BO RELTAPE BRANCH IF YES 00172000
CLC RDEVTYPC(2),=AL1(CLASDASD,TYP2305) FIXED HEAD? @VA01855 00173000
BNE RELDOFF NO -- NORMAL HANDLING @V200820 00174000
TM RDEVADD+1,X'07' IS THIS THE BASE EXPOSURE ? @V200820 00175000
BNZ RELDRUM NO -- ONLY CUT ONE CARD @V200020 00176000
EJECT 00177000
RELDOFF EQU * PUNCH AN ACCOUNTING CARD 00178000
CALL DMKACODV,AFFINITY @V4075A0 00179100
RELDRUM EQU * @V200020 00180000
TM RDEVTYPC,CLASDASD DASD DEVICE? @VA11344 00180100
BZ NOTMSS NO THEN IT'S NOT AN MSS DEVICE @VA11344 00180200
TM PSAMSS,MSSPRES IS THE MSS PRESENT? @VA11344 00180300
BNO NOTMSS NO - THEN DON'T ISSUE ANY RLQSH @VA11344 00180400
TM RDEVFLAG,RDEVVMNT WAS THIS VOL MOUNTED BY CP? @VA11344 00180500
BNO NOTMSS NO - THEN DON'T ISSUE RELINQUISH @VA11344 00180600
CALL DMKSSSRL ELSE ISSUE A RELINQUISH REQUEST @VA11344 00180700
NOTMSS DS 0H @VA11344 00180800
ST R0,VDEVREAL ZERO RDEVBLOK ADDRESS @V200020 00181000
NI VDEVSTAT,255-VDEVDED TURN OFF DEDICATED FLAG 00182000
NI RDEVSTAT,255-RDEVDED TURN OFF DEDICATED FLAG 00183000
TM RDEVTYPC,CLASDASD IS THIS A DISK STORAGE DEV ?@V200020 00184000
BZ NOTDASD NO-DO NOT TURN ON THE MOUNTED BIT@VA11344 00185000
OI RDEVFLAG,RDEVMOUT INDICATE VOLUME NOT ATTACHED 00186000
NOTDASD DS 0H @VA11344 00186500
L R1,ASYSVM SET VMBLOK POINTER... 00187000
ST R1,RDEVUSER ...TO POINT TO SYSTEM VMBLOK 00188000
LH R6,RDEVATT REMEMBER VIRT. ADDR. FOR MESSAGE 00189000
MVC RDEVATT(2),ZEROES CLEAR THE VIRTUAL ADDRESS 00190000
MVC RDEVTMAT,ZEROES ZERO TIME ATTACHED 00191000
TM RDEVTYPC,CLASURO IS IT A 3800 POSSIBLY? @V60B9BA 00191100
BZ NOT3800 XFER IF NOT @V60B9BA 00191200
CLI RDEVTYPE,TYP3800 IS IT REALLY A 3800 ? @V60B9BA 00191300
BNE NOT3800 XFER IF NOT @V60B9BA 00191400
MVC RDEVOVLY,BLANKS BLANK OUT THE FLASH OVERLAY @V60B9BA 00191500
MVI RDEVCURP,22 ASSUME PAGE SIZE OF 11 IN. @V60B9BA 00191600
MVC RDEVDELP,ZEROES ZERO THE DEL PURGE ANCHOR @V60B9BA 00191700
NOT3800 EQU * @V60B9BA 00191800
TM VDEVSTAT,VDEVCATT ATTACHED VIA CONSOLE FUNCTION ? 00192000
BZ RELEXIT NO - SKIP THE MESSAGE 00193000
NI VDEVSTAT,X'FF'-VDEVCATT TURN OFF FLAG BIT 00194000
MVI SAVEWRK2,X'40' CLEAR PSEUDO-BUFFER 00195000
MVC SAVEWRK2+1(31),SAVEWRK2 ... 00196000
MVC SAVEWRK4+1(8),=C'DETACHED' CUE... 00197000
LR R8,R2 SET R8 = ADDRESS OF RDEVBLOK, 00198000
CALL DMKSCNRN GET EBCDIC DEVICE TYPE-NAME 00199000
ST R1,SAVEWRK2 ...INTO START OF MESSAGE 00200000
CALL DMKSCNRD DEVICE-ADDRESS TO CCU FORM, 00201000
CALL DMKCVTBH CONVERT ADDRESS TO PRINTABLE CHARACTERS 00202000
STCM R1,B'0111',SAVEWRK3+1 REAL ADDRESS 00203000
MVC SAVEWRK6+3(8),VMUSER USERID 00204000
LR R1,R6 VIRTUAL ADDRESS 00205000
CALL DMKCVTBH 00206000
STCM R1,B'0111',SAVEWRK9 ... 00207000
LA R0,SAVEWRK9+3-SAVEWRK2 MESSAGE LENGTH 00208000
LA R1,SAVEWRK2 LOAD MESSAGE ADDRESS 00209000
CALL DMKQCNWT,PARM=NORET+OPERATOR NOTIFY THE OPERATOR 00210000
RELEXIT L R8,SAVER8 POINT TO VDEVBLOK AGAIN @VA04788 00211000
NI VDEVFLAG,X'FF'-VDEVDET VDEVDET NO LONGER NEEDED @VA04788 00211250
EXIT @VA04343 00211500
EJECT 00212000
RELTAPE EQU * HRC003DK 00213590
TM VDEVFLG2,VDEVTNR NO TAPE RUN ASKED ? HRC003DK 00213680
BO RELDOFF YES - JUST GO BACK HRC003DK 00213770
LA R0,IOBSIZE GET AN IOBLOK HRC003DK 00213860
CALL DMKFREE GET AN IOBLOK FOR REWIND AND UNLOAD 00214000
LR R10,R1 LOAD IOBLOK BASE REGISTER 00215000
USING IOBLOK,R10 00216000
XC IOBLOK(IOBSIZE*8),IOBLOK CLEAR THE IOBLOK 00217000
MVI IOBFLAG,IOBRELCU INDICATE CU RELEASED AT INITIATION 00218000
L R1,ASYSVM STORE SYSTEM VMBLOK ADDRESS IN IOBLOK 00219000
ST R1,IOBUSER .. 00220000
L R1,=A(DMKIOSRW) STORE INTERRUPT RETURN ADDRESS IN IOBLOK 00221000
ST R1,IOBIRA .. 00222000
LA R0,3 SIZE OF RCWTASK NEEDED @VA04137 00223200
CALL DMKFREE GET THE RCWTASK @VA04137 00223400
USING RCWTASK,R1 ADDRESSABILITY @VA04137 00223600
XC RCWTASK(24),RCWTASK CLEAR RCWTASK @VA04137 00223800
LA R15,3 ESTABLISH RCWTASK SIZE @VA04137 00224000
STH R15,RCWCCNT STORE TOTAL NO OF DBL-WORDS @VA04137 00224200
L R15,FFS INITIALIZE RCWHEAD... @VA04137 00224400
STH R15,RCWHEAD ...TO 'FFFF' @VA04137 00224600
LA R15,RCWCCW NOW WE HAVE TO... @VA04137 00224800
ST R15,IOBCAW ...POINT IOBCAW TO THE CCW AND...@VA04137 00225000
MVC 0(8,R15),RUNCCW ...MOVE RUN CCW TO RCWTASK @VA04137 00225200
DROP R1 @VA04137 00225400
LR R8,R2 LOAD RDEVBLOK BASE REGISTER 00226000
CALL DMKIOSQR REWIND AND UNLOAD THE TAPE DRIVE 00227000
L R8,SAVER8 RELOAD VDEVBLOK ADDRESS 00228000
B RELDOFF CONTINUE 00229000
DROP R2,R10 00230000
EJECT 00231000
RELDISK L R2,VDEVREAL LOAD RDEVBLOK ADDRESS 00232000
USING RDEVBLOK,R2 00233000
TM VDEVFLAG,VDEVTDSK IS THIS A T-DISK ? 00234000
BO RELTDSK BRANCH IF YES 00235000
ST R0,VDEVREAL ZERO RDEVBLOK ADDRESS 00236000
LH R3,RDEVLNKS GET COUNT OF LINKS @VA03163 00237000
S R3,F1 DECREMENT AND TEST @VA03163 00238000
BP RELPOS STILL SOME LEFT, FIND NEXT ONE @VA03163 00239000
BNZ ABEND3 NO LINKS TO BEGIN WITH: ERROR @VA03163 00240000
TM PSAMSS,MSSPRES IS THE MSS PRESENT? @VA11344 00241000
BNO RELPOS1 NO - THEN DON'T ISSUE RELINQUISH @VA11344 00241100
TM RDEVFLAG,RDEVVMNT THIS VOL MNTD BY CP? @VA11344 00241200
BNO RELPOS1 NO - THEN DON'T RELINQUISH IT! @VA11344 00241300
* 00241400
* ISSUE A RELINQUISH REQUEST FOR THIS VOLUME 00241500
* 00241600
CALL DMKSSSRL ISSUE RELINQUISH REQUEST @VA11344 00241700
* 00242000
RELPOS1 DS 0H @VA11344 00242300
RELPOS STH R3,RDEVLNKS RESET COUNT OF LINKS @VA03163 00243000
L R4,VDEVLINK GET NEXT VIRTUAL DEVICE BLOCK @VA03163 00244000
LTR R4,R4 IS IT THERE? @VA03163 00245000
BZ RELEXIT NO OUR WORK IS DONE @VA03163 00246000
LA R3,1(,R3) BUMP LINK COUNT FOR SCAN @VA03163 00247000
LR R1,R8 SAVE OUR VDEVBLOK ADDR @VA03163 00248000
RELLINK LR R15,R8 SAVE PREVIOUS VDEVBLOK ADDR @VA03163 00249000
L R8,VDEVLINK LOAD NEXT VDEV POINTER @VA03163 00250000
CR R8,R1 DOES IT MATCH OURS? @VA03163 00251000
BE RELRESET YES, DELINK @VA03163 00252000
BCT R3,RELLINK NO, LOOP @VA03163 00253000
B ABEND3 OUR BLOCK NEVER FOUND IN CHAIN @VA03163 00254000
SPACE 1 00255000
RELRESET ST R4,VDEVLINK-VDEVBLOK(R15) OUR FWD PTR TO PREV BK@V407438 00255200
ST R0,VDEVLINK CLEAR OLD VDEVBLOK LINK FIELD @V407438 00255400
L R1,VDEVRRB GET THE MDISK RES/REL BLOCK @V407438 00255600
ST R0,VDEVRRB CLEAR THE POINTER TO IT @V407438 00255800
NI VDEVFLG2,X'FF'-VDEVRRF NO MORE RES/REL FTR HERE @V407438 00256000
CR R4,R8 DOES DET. DEVICE LINK TO ITSELF? @V407438 00256200
BNE RELEXIT NOPE, NOT LAST ONE, BR. @V407438 00256400
LTR R1,R1 IS THERE A VRRBLOK? @V407438 00256600
BZ RELEXIT NOPE, DONE, BR. @V407438 00256800
LA R0,VRRSIZE YUP, GET ITS SIZE @V407438 00257000
CALL DMKFRET RETURN STORAGE TO THE SYSTEM @V407438 00257200
B RELEXIT EXIT @VA03163 00258000
SPACE 3 00259000
ABEND3 ABEND 3 @VA03163 00260000
EJECT 00261000
RELTDSK DS 0H RELEASE A T-DISK 00262000
CALL DMKACODV CALL ACOUNTING ROUTINE TO CUT A CARD 00263000
LH R0,VDEVBND NUMBER OF CYLINDERS TO RELEASE 00264000
LH R1,VDEVRELN FIRST CYLINDER OF AREA 00265000
L R8,VDEVREAL RDEVBLOK OF ASSIGNED DEVICE 00266000
CALL DMKTDKRL RETURN T-DISK SPACE TO CP 00267000
B RELEXIT EXIT 00268000
DROP R2 00269000
SPACE 2 00270000
* INPUT OR OUTPUT SPOOLED DEVICE: 00271000
RELURDV DS 0H NOTE: R0 = 0 00272000
TM VDEVTYPC,CLASURO IS THIS AN OUTPUT TYPE DEVICE ? 00273000
BO RELOPUT BRANCH IF YES 00274000
C R0,VDEVSPL IS AN INPUT FILE OPEN ? 00275000
BE RELEXIT IF NOT, GO EXIT. 00276000
SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 00277000
CALL DMKVSPCR IF YES, CLOSE THE CARD READER 00278000
AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 00279000
B RELEXIT AND GO EXIT 00280000
SPACE 00281000
RELOPUT BAL R3,CLOSSPL CLOSE ANY SPOOL FILE-FRET XBLOK @VA04507 00282100
TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER?? @V386298 00283100
BNO RELEXIT NO--GO EXIT @V386298 00283200
LA R0,VFCBSIZE GET SIZE OF FORMS CONTROL BLOCK, 00296000
LA R2,VDEVFCBK POINT TO FORMS CONTROL BLOCK (IF ANY) 00297000
B RELFRET AND GO RETURN IT TO FREE STORAGE. 00298000
SPACE 2 00299000
RELSPEC EQU * RELEASE SPECIAL-CLASS DEVICES 00300000
CLI VDEVTYPE,TYPCTCA CHANNEL-TOCHANNEL ADAPTER ? 00301000
BNE RELEXIT NO - FORGET IT 00302000
CALL DMKVCARS RESET ADAPTER + FRET BLOCKS 00303000
B RELEXIT 00304000
EJECT 00305000
RELCONS CLI VDEVTYPE,TYP1052 IS THIS A CONSOLE DEVICE ? 00306000
BNE RELEXIT BRANCH IF NO 00307000
BAL R3,CLOSSPL CLOSE ANY SPOOL FILE-FRET XBLOK @VA04507 00308100
L R0,FFS SET TO MINUS ONE @VA04507 00309100
STH R0,VMVTERM NO MORE VIRTUAL CONSOLE @VM08536 00314000
LA R2,VDEVCON POINT TO THE CONTROL BLOCK @VA00881 00315000
L R3,0(R2) GET CONTROL BLOCK ADDRESS @VA00881 00316000
LTR R3,R3 IS THERE ONE @VA00881 00317000
BZ RELEXIT NONE @VA00881 00318000
USING VCONCTL,R3 @VA00881 00319000
SR R0,R0 CLEAR @V200730 00320000
L R1,VCONRBUF GET READ BUFFER ADDRESS @V200730 00321000
LTR R1,R1 IS THERE ONE ?? @V200730 00322000
BZ RELC3 NO, CONT @V200730 00323000
LH R0,VCONRBSZ GET BUFFER SIZE HRC101DK 00324490
CALL DMKFRET FRET IT @V200730 00325000
RELC3 L R1,VCONWBUF GET WRITE BUFFER ADDRESS 00326000
LTR R1,R1 IS THERE ONE ?? 00327000
BZ RELC4 NO, CONT 00328000
IC R0,VCONWBSZ GET BUFFER SIZE 00329000
CALL DMKFRET FRET BUFFER 00330000
RELC4 DS 0H 00331000
L R1,VCONBUF GET DATA BUFFER POINTER @VA00881 00332000
LTR R1,R1 DOES ONE EXIST @VA00881 00333000
BZ RELC2 NO @VA00881 00334000
SR R0,R0 CLEAR HIGH ORDER BYTES @VA00881 00335000
LH R0,VCONBFSZ LOAD DATA BUFFER SIZE HRC101DK 00336490
CALL DMKFRET RETURN THE DATA BUFFER @VA00881 00337000
SR R0,R0 @VM08825 00338000
ST R0,VCONBUF CLEAR DATA BUFFER POINTER @VM08825 00339000
DROP R3 @VA00881 00340000
RELC2 LA R0,VCONSIZE LOAD CONTROL BLOCK SIZE @VA00881 00341000
RELFRET L R1,0(,R2) GET CONTROL BLOCK ADDRESS 00342000
LTR R1,R1 (IF ANY) 00343000
BZ RELEXIT EXIT IF NONEXISTENT. 00344000
CALL DMKFRET RETURN THE CONTROL BLOCK TO CP 00345000
SR R0,R0 CLEAR ADDRESS OF 'GONE' CONTROL BLOCK 00346000
ST R0,0(,R2) ... 00347000
B RELEXIT GO EXIT . . . 00348000
* HERE TO CLEAN UP VIRTUAL SPOOL DEVICE BEFORE DETACHING 00348050
SPACE 2 00348100
CLOSSPL C R0,VDEVSPL IS AN OUTPUT FILE OPEN? @VA04507 00348150
BE RELOEXTN IF NOT, DONT TRY TO CLOSE IT @VA04507 00348200
SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA04507 00348250
CALL DMKVSPCO,PARM=0 CLOSE PRT, PUN OR CONS @VA04507 00348300
AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA04507 00348350
RELOEXTN L R1,VDEVEXTN ADDRESS OF VSPXBLOK @VA04507 00348400
LTR R1,R1 DOES ONE EXIST? @VA04507 00348450
BZR R3 NOPE-RETURN @VA04507 00348500
SR R0,R0 CLEAR COUNT REGISTER @VA04507 00348550
ST R0,VDEVEXTN NO MORE VSPXBLOK @VA04507 00348600
IC R0,VSPXLEN-VSPXBLOK(R1) SET COUNT REG @VA04507 00348650
CALL DMKFRET RELEASE VSPXBLOK STORAGE @VA04507 00348700
BR R3 RETURN @VA04507 00348750
EJECT 00348800
EJECT 00349000
RUNCCW CCW X'0F',0,SILI,1 REWIND AND UNLOAD FOR TAPE D@V200020 00350000
SPACE 2 00351000
LTORG @V200020 00352000
EJECT 00353000
COPY SAVE @V200020 00354000
COPY EQU @V200020 00355000
COPY DEVTYPES @V200020 00356000
PSA @V200020 00357000
COPY VMBLOK @V200020 00358000
COPY RBLOKS @V200020 00359000
COPY VBLOKS @V200020 00360000
COPY IOBLOKS @V200020 00361000
END DMKVDR @V200020 00362000