VCH TITLE 'DMKVCH (CP) VM/370 - RELEASE 6' 00001000 ISEQ 73,80 VALIDATE SEQUENCING OF INPUT @V200820 00002000 *. 00003000 * MODULE NAME - 00004000 * 00005000 * DMKVCH 00006000 * 00007000 * FUNCTION - 00008000 * 00009000 * TO 'ATTACH' OR 'DETACH' A REAL CHANNEL AND ALL DEVICES 00010000 * ON IT TO A SPECIFIED USER. 00011000 * 00012000 * +--------+----------------------------+ 00013000 * | ATTACH | CHANNEL X USERID | 00014000 * |--------+----------------------------+ 00015000 * | DETACH | CHANNEL X | 00016000 * +--------+----------------------------+ 00017000 * 00018000 * THE ACTUAL COMMAND LINE IS DECODED BY DMKVDC. 00019000 * 00020000 * ATTRIBUTES - 00021000 * 00022000 * RE-ENTRANT, PAGEABLE, CALLED VIA SVC 00023000 * 00024000 * ENTRY POINT - 00025000 * 00026000 * DMKVCHDC 00027000 * 00028000 * ENTRY CONDITIONS - 00029000 * 00030000 * GPR 1 = FLAGS BUILT BY DMKVDA/DMKVDD 00031000 * GPR 2 = CHANNEL NUMBER IN BYTE 3 00032000 * GPR 3 = FIRST HALF OF USERID 00033000 * GPR 4 = SECOND HALF OF USERID 00034000 * GPR 10 = ADDRESS OF VMBLOK FOR ATTACH TO; DETACH FROM USERID 00035000 * 00036000 * EXIT CONDITION - 00037000 * 00038000 * NORMAL 00039000 * 00040000 * CALLS TO OTHER ROUTINES - 00041000 * 00042000 * DMKERMSG- TO WRITE MESSAGES 00043000 * DMKSCNRA - TO OBTAIN THE HEX REAL DEVICE ADDRESS 00044000 * DMKSCNVU- TO LOCATE VIRTUAL CONTROL BLOKS 00045000 * DMKSCNRU- TO LOCATE REAL DEVICE CONTROL BLOKS 00046000 * DMKSCNRD - TO OBTAIN THE HEX REAL DEVICE ADDRESS 00047000 * DMKVDSAT - TO BUILD VIRTUAL DEVICE BLOCKS FOR ATTACH 00048000 * DMKVDREL - TO RELEASE VIRTUAL BLOCKS FOR DETACH 00049000 * DMKFREE - TO OBTAIN STORAGE 00050000 * DMKFRET - TO RELEASE STORAGE 00051000 * DMKQCNWT - SEND MESSAGES TO THE TERMINAL 00052000 * 00053000 * EXTERNAL REFERENCES - 00054000 * 00055000 * NONE 00056000 * 00057000 * TABLES / WORK AREAS 00058000 * 00059000 * SAVEVCH - AREA USED TO SAVE DEVICE ADDRESS AND TYPE 00060000 * 00061000 * REGISTER USAGE - 00062000 * 00063000 * GPR 0 = SCRATCH 00064000 * GPR 1 = CONTAINS CHANNEL OR DEVICE ADDRESS 00065000 * GPR 2 = WORK REGISTER 00066000 * GPR 3 = WORK REGISTER 00067000 * GPR 4 = WORK REGISTER 00068000 * GPR 5 = WORK REGISTER 00069000 * GPR 6 = ADDRESS OF RCHBLOK/VCHBLOK 00070000 * GPR 7 = ADDRESS OF RCUBLOK/VCUBLOK 00071000 * GPR 8 = ADDRESS OF RDEVBLOK/VDEVBLOK 00072000 * GPR 9 = ADDRESS OF SAVEVCH 00073000 * GPR 10 = ADDRESS OF VMBLOK FOR THE ATTACH TO USER 00074000 * GPR 11 = ADDRESS OF THE VMBLOK DOING THE ATTACHING/DETACHING 00075000 * GPR 12 = BASE REGISTER 00076000 * GPR 13 = ADDRESS OF A STANDARD SAVE AREA 00077000 * 00078000 * NOTES - 00079000 * 00080000 * NONE 00081000 * 00082000 * OPERATION - 00083000 * 00084000 * DMKVCHDC IS CALLED BY DMKVDA (ATTACH) OR DMKVDD (DETACH) A 00085000 * REAL DEVICE AND ALL DEVICES ON THE CHANNEL TO A SPECIFIED 00086000 * USERID. THE ATTACH/DETACH COMMAND HAS BEEN PROCESSED BY 00087000 * DMKVDA/DMKVDD AND FLAGS SET IN GPR1, REPRESENTING THE FUNCTION 00088000 * REQUESTED. THE FOLLOWING CONDITIONS ARE TESTED BEFORE 00089000 * A CHANNEL CAN BE DEDICATED. 00090000 * 00091000 * 1. MUST NOT BE CHANNEL 0 00092000 * 2. VIRTUAL CHANNEL CANNOT ALREADY EXIST. 00093000 * 3. REAL CHANNEL MUST BE ON THE SYSTEM 00094000 * 4. CHANNEL MUST NOT BE DEDICATED TO ANOTHER USER 00095000 * 5. THERE MUST BE NO CP-VOLUMES ON THE CHANNEL 00096000 * 6. SPOOLING DEVICES MUST BE IN A DRAINED CONDITION 00097000 * 7. DEVICES ON THE CHANNEL CANNOT BE ALREADY ATTACHED 00098000 * TO ANY USER'S. 00099000 * 00100000 * IF ALL OF THE ABOVE CONDITIONS ARE SATISFIED; VIRTUAL 00101000 * CHANNEL, CONTROL UNITS, AND DEVICE BLOKS ARE BUILT. THEY ARE 00102000 * MAPPED 1 FOR 1 AGAINST THE REAL CHANNEL, CONTROL UNITS, AND 00103000 * DEVICES. THE DEDICATE BITS ARE TURNED ON. A RESPONSE IS 00104000 * ISSUED TO THE USER THAT THE CHANNEL HAS BEEN ATTACHED. 00105000 * 00106000 * TO DETACH A CHANNEL THE FOLLOWING CONDITIONS MUST BE MET; 00107000 * 00108000 * 1. MUST NOT BE CHANNEL 0 00109000 * 2. THE REAL CHANNEL MUST EXIST 00110000 * 3. THE CHANNEL MUST HAVE ALREADY BEEN DEDICATED TO 00111000 * THIS USER. 00112000 * 00113000 * IF THE ABOVE CONDITIONS ARE MET; VIRTUAL CHANNEL, CONTROL 00114000 * UNITS, AND DEVICE BLOKS ARE MARKED UNAVAILABLE. THE DEDICATE 00115000 * BITS ARE RESET IN THE REAL CONTROL BLOKS. CONTROL REGISTER 2 00116000 * IS CHANGED IF NECCESSARY TO ALLOW THE CHANNEL TO 00117000 * BECOME ACTIVE. 00118000 * 00119000 * RESPONSES - 00120000 * 00121000 * CHAN X ATTACH TO USERID X 00122000 * CHAN X DETACHED USERID X 00123000 * 00124000 * ERROR MESSAGES - 00125000 * 00126000 * DMKVCH034E CHANNEL MISSING OR INVALID 00127000 * DMKVCH040E DEV ADDR DOES NOT EXIST @VA13060 00127500 * DMKVCH048E CHANNEL X DOES NOT EXIST 00128000 * DMKVCH129E CHANNEL X DEVICES IN USE 00129000 * DMKVCH130E CHANNEL X NOT ATTACHED TO USERID @VA13060 00129500 * DMKVCH132E CHANNEL X ALREADY DEFINED BY USERID 00130000 * DMKVCH138E CHANNEL X NOT ATTACHED; INSUFFICIENT FREE STORAGE 00131000 * DMKVCH153E DEVICE VADDR EXCEEDS MAX NO. OF VIRTUAL DEVICES 00131500 *. 00132000 COPY OPTIONS @V407510 00133000 EJECT 00134000 SPACE 2 00135000 DMKVCH CSECT 00136000 EXTRN DMKSCNVU 00137000 EXTRN DMKSCNRU 00138000 EXTRN DMKVDSAT @VA01382 00139000 EXTRN DMKVDREL @V200820 00140000 EXTRN DMKERMSG 00141000 EXTRN DMKCVTBH 00142000 EXTRN DMKSCNAU @V407466 00143000 EXTRN DMKFRERC @V407466 00144000 EXTRN DMKLOCKQ @V407466 00145000 EXTRN DMKLOCKD @V407466 00146000 EXTRN DMKSCNRA @V407466 00147000 SPACE 00148000 USING PSA,R0 00149000 USING RCHBLOK,R6 00150000 USING RCUBLOK,R7 00151000 USING RDEVBLOK,R8 00152000 USING VMBLOK,R11 00153000 USING SAVEAREA,R13 00154000 SPACE 00155000 * EYE CATCHER FOR STORAGE DUMPS 00156000 MODID DC CL8'DMKVCH' 00157000 EJECT 00158000 DMKVCHDC RELOC 00159000 * 00160000 ST R1,VDBITS FLAGS PASSED FROM DMKVDA/DMKVDD 00161000 MVI DEDBITS,X'00' CLEAR BIT SWITCHES 00162000 LA R0,9 Get 9 doublewords of storage HRC040DK 00163100 CALL DMKFREE 00164000 LR R9,R1 00165000 USING SAVEVCH,R9 00166000 BAL R5,YOURVMBK GET ATTACHEE'S VMBLOK @V407510 00167000 XC SAVEVCH(64),SAVEVCH CLEAR THE ENTIRE AREA 00168000 MVC CHANUSER(8),VMUSER USERID WANTING THE CHANNEL 00169000 ST R2,CHANADDR AND SAVE ALSO, THE CHANNEL NUMBER 00170000 SPACE 00172000 SLA R2,8(0) SHIFT AND TEST CHANNEL ADDRESS @VA01382 00173000 BZ VCH034 CHANNEL ZERO IS NOT VALID @VA01382 00174000 STH R2,DEVADDR CHANNEL NUMBER - HIGH ORDER BYTE @VA07711 00174100 LR R1,R2 PUT CHANNEL INTO GPR-1. 00175000 CALL DMKSCNRU DOES REAL CHANNEL EXIST ? 00176000 BC 4,VCH048 ERROR IF CHANNEL BLOCK NOT FOUND 00177000 ST R6,SAVERCH SAVE THE RCHBLOK ADDRESS @VA13280 00178000 TM VDBITS+1,DETACH DETACH COMMAND ISSUED ? @VA01382 00179000 BO CHANDET YES - CHECK VIRTUAL CHANNEL @VA01382 00180000 STM R1,R2,SAVEWRK2 SAVE REGS ACROSS 'TRANS' @VA01382 00181000 L R1,=A(DMKVDSAT) MAKE SURE DMKVDS IS IN CORE @VA01382 00182000 TRANS 2,1,OPT=(BRING,DEFER,SYSTEM) . . .FOR THE SCAN @VA01382 00183000 SPACE 00184000 LM R1,R2,SAVEWRK2 RESTORE CHANNEL ADDR REGS @VA01382 00185000 CALL DMKSCNVU DOES VIRTUAL CHANNEL EXISTS 00186000 BC 11,VCH132 YES - ERROR IF CHANNEL BLOK FOUND 00187000 L R6,SAVERCH RESTORE RCHBLOK ADDRESS @VA13280 00188000 SLR R10,R10 CLEAR R10 @V407466 00189000 SPACE 00190000 STRTSCAN B PASS1 FIRST PASS FOR 'ATTACH CHANNEL' @V407466 00191000 B PASS2 SEC. PASS FOR 'ATTACH CHANNEL' @V407466 00192000 B PASS3 THIRD PASS FOR 'ATTACH CHANNEL' @V407466 00193000 B PASS4 4TH PASS FOR 'ATTACH CHANNEL' @V407466 00194000 B PASS5 5TH PASS FOR 'ATTACH CHANNEL' @V407466 00195000 EJECT 00196000 CHANDET EQU * CHECK FOR CHANNEL ATTACHED @VA01382 00197000 CALL DMKSCNVU SCAN FOR VIRTUAL BLOCKS @VA01382 00198000 BC 4,VCH130 CHANNEL NOT ATTACHED @VA02709 00199000 TM VCHSTAT-VCHBLOK(R6),VCHDED DEDICATED CHAN ? @VA01382 00200000 BZ VCH130 NO -- ERROR @VA01382 00201000 L R6,SAVERCH BACK TO THE RCHBLOK FOR SCAN @VA13280 00202000 SPACE 2 00203000 EJECT 00204000 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00205000 * PASS1 COUNTS THE NUMBER OF VCUBLOKS FOR WHICH STORAGE * 00206000 * SHOULD BE ACQUIRED IN ADVANCE; THIS ROUTINE ALSO * 00207000 * VERIFIES THAT EACH DEVICE ON THE CHANNEL CAN BE ATTACHED. * 00208000 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00209000 SPACE 2 00210000 PASS1 LA R4,2 INCREMENT FACTOR FOR SCAN @V407466 00211000 SLR R2,R2 INDEX FOR CONTROL UNIT SEARCH. 00212000 SLR R14,R14 CLEAR R14 @V407466 00213000 SPACE 00214000 CHKCU EQU * SCAN ALL REAL CONTROL UNITS @VA01382 00215000 LH R7,RCHCUTBL(R2) CONTROL UNIT DISPLACEMENT @VA01382 00216000 LTR R7,R7 IS CONTROL UNIT ON THE SYSTEM ? 00217000 BM INCRCU NO, GET NEXT C.U. TABLE ENTRY 00218000 A R7,ARIOCU LOAD ABSOLUTE ADDRESS OF RCUBLOK. 00219000 SLR R3,R3 INDEX REG. FOR DEVICE TABLE SEARCH 00220000 SPACE 00221000 CHKDEV EQU * SCAN ALL REAL DEVICE BLOCKS @VA01382 00222000 LH R8,RCUDVTBL(R3) REAL DEVICE DISPLACEMENT @VA01382 00223000 LTR R8,R8 DOES DEVICE EXIST ? 00224000 BM INCRDEV NO, GET NEXT DEVICE ENTRY 00225000 OI DEDBITS,DEVIND RDEVICE INDEX FOUND IN RCUBLOK @V407466 00226000 SLL R8,3(0) CONVERT TO BYTE INDEX @V200820 00227000 A R8,ARIODV YES, GET ABSOLUTE ADDR. OF RDEVBLOK. 00228000 SPACE 00229000 TM VDBITS+1,DETACH DETACHING THE CHANNEL 00230000 BO DETCHAN YES -- RELEASE EACH DEVICE @VA01382 00231000 SPACE 00232000 DEVCHEK EQU * CHECK FOR DEVICES IN USE @V407466 00233000 SWITCH SWITCH TO MAIN PROCESSOR @V407510 00234000 TM RDEVSTAT,RDEVBUSY+RDEVSCED+RDEVDED IN USE ? @V407466 00235000 BNZ VCH129 YES, CAN'T DO CHANNEL ATTACH THEN@V407466 00236000 TM RDEVTYPC,CLASDASD+CLASTAPE TAPE OR DASD? @V407466 00237000 BZ NODASTAP NOPE @V407466 00238000 TM RDEVFLAG,RDEVSYS+RDEVOWN SYSTEM OR OWNED? @V407466 00239000 BNZ VCH129 YES, CAN'T HAVE IT THEN @V407466 00240000 B INCRDEV THIS DEVICE IS O.K. @V407466 00241000 SPACE 00242000 NODASTAP TM RDEVTYPC,CLASURI+CLASURO UNIT RECORD IN OR OUT? @V407466 00243000 BZ NOTUR NOPE @V407466 00244000 TM RDEVFLAG,RDEVDRAN YES, IS IT DRAINED? @V407466 00245000 BZ VCH129 NOPE, THEN CAN'T HAVE IT. @V407466 00246000 ICM R15,B'0111',RDEVSPL IS THERE AN ACTIVE SPOOL @V407466 00247000 * FILE? 00248000 BNZ VCH129 YES, CAN'T HAVE IT THEN. @V407466 00249000 B INCRDEV THIS DEVICE IS O.K. @V407466 00250000 SPACE 00251000 NOTUR TM RDEVTYPC,CLASTERM+CLASGRAF GRAPHIC OR TERMINAL? @V407466 00252000 BZ NOTERM NOPE @V407466 00253000 TM RDEVFLAG,RDEVENAB CP ENABLED? @V407466 00254000 BO VCH129 YES, CAN'T HAVE IT THEN. @V407466 00255000 B INCRDEV THIS DEVICE IS O.K. @V407466 00256000 SPACE 00257000 NOTERM CLI RDEVTYPC,CLASSPEC SPECIAL TYPE? @V407466 00258000 BNE INCRDEV NOPE - THIS DEVICE IS O.K. @V407466 00259000 CLI RDEVTYPE,TYP3705 IS IT A 3705 TYPE? @V407466 00260000 BNE INCRDEV NOPE - THIS DEVICE IS O.K. @V407466 00261000 TM RDEVSTAT,RDEVRSVD SYSTEM RESERVED? @V407466 00262000 BO VCH129 YES, CAN'T HAVE IT THEN @V407466 00263000 TM RDEVFLAG,RDEVRCVY IN RECOVERY PROCESS NOW ? @V407466 00264000 BO VCH129 YES - IT'S REALLY IN USE @V407466 00265000 SPACE 00266000 INCRDEV EQU * ADVANCE TO NEXT RDEVBLOK SLOT @V407466 00267000 LA R5,30(0) SIXTEEN DEVICE SLOTS PER RCUBLOK @V407466 00268000 BXLE R3,R4,CHKDEV GET THE NEXT DEVICE @V407466 00269000 SPACE 00270000 TM DEDBITS,DEVIND RDEVICE FOUND ON RCUBLOK @V407466 00271000 BZ INCRCU ADVANCE TO NEXT RCUBLOK SLOT @V407466 00272000 LA R14,1(,R14) ADD 1 TO NO. VCUBLOKS TO BE ACQ. @V407466 00273000 NI DEDBITS,X'FF'-DEVIND RESET DEVICE FOUND BIT @V407466 00274000 INCRCU EQU * ADVANCE TO NEXT RCUBLOK SLOT @V407466 00275000 LA R5,62(0) 32 RCUBLOK SLOTS PER RCHBLOK @V407466 00276000 BXLE R2,R4,CHKCU GET THE NEXT CONTROL UNIT @V407466 00277000 SPACE 00278000 TM VDBITS+1,DETACH DETACHING THE CHANNEL @V407466 00279000 BO ALLDET YES, ALL DEVICES DETACHED @VA07711 00280000 STH R14,CUNUM NO. VCUBLOKS TO BE ACQUIRED @V407466 00281000 LOOP LA R10,4(,R10) INCREM FOR SECOND PASS @V407466 00282000 B STRTSCAN(R10) 2ND PASS RTN FOR 'ATTACH CHANNEL'@V407466 00283000 EJECT 00284000 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00285000 * PASS2 COUNTS THE NUMBER OF VDEVBLOKS FOR WHICH STORAGE MUST BE * 00286000 * ACQUIRED IN ADVANCE; EACH RDEVBLOK IS ONLY COUNTED ONCE. * 00287000 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00288000 SPACE 2 00289000 PASS2 EQU * SECOND PASS FOR 'ATTACH CHANNEL' @V407466 00290000 LA R4,2 INCREM FACTOR FOR SCAN @V407466 00291000 SLR R14,R14 ZERO R14 @V407466 00292000 SLR R2,R2 ... @V407466 00293000 CHKCU2 LH R7,RCHCUTBL(R2) CONTROL UNIT DISPLACEMENT @V407466 00294000 LTR R7,R7 IS CONTROL UNIT ON THE SYSTEM? @V407466 00295000 BM INCRCU2 NO, GET NEXT C.U. TABLE ENTRY @V407466 00296000 A R7,ARIOCU ABSOLUTE ENTRY ADDRESS OF RCUBLOK@V407466 00297000 SLR R3,R3 INDEX REG. FOR DEV. TABLE SEARCH @V407466 00298000 CHKDEV2 EQU * SCAN ALL REAL DEVICE BLOKS @V407466 00299000 LH R8,RCUDVTBL(R3) REAL DEVICE DISPLACEMENT @V407466 00300000 LTR R8,R8 DOES DEVICE EXIST? @V407466 00301000 BM INCRDEV2 NO, GET NEXT DEVICE ENTRY @V407466 00302000 SLL R8,3(0) CONVERT TO BYTE INDEX @V407466 00303000 A R8,ARIODV YES, GET ABSOLUTE RDEVBLOK ADDR @V407466 00304000 TM RDEVADD,DEVCOUNT RDEVBLOK COUNTED PREVIOUSLY? @V407466 00305000 BO INCRDEV2 YES, PROCEED TO NEXT DEVICE @V407466 00306000 OI RDEVADD,DEVCOUNT IND. RDEVBLOK COUNTED @V407466 00307000 LA R14,1(,R14) UP COUNT OF NO. UNIQUE RDEVBLOKS @V407466 00308000 * MUST RESET MY 'DEVCOUNT' MARK IN 'RDEVADD' (OF A 2305) FOR ALL 00308100 * THE RDEVBLOKS EXCEPT THE FIRST ONE. DMKVDS ATTACHES ALL 8 OF THEM 00308200 * WITH ONE CALL. (FIRST ONE IS RESET WHEN I CALL DMKVDS). 00308300 CLC RDEVTYPC(2),=AL1(CLASDASD,TYP2305) @VA12940 00308400 BNE INCRDEV2 NOT A 2305; WE'RE OK @VA12940 00308500 TM RDEVADD+1,7 IS THE ADDRESS 1-7 OR 9-F? @VA12940 00308600 BZ INCRDEV2 ADDRESS IS 0 OR 8: MARK IS OK @VA12940 00308700 NI RDEVADD,X'FF'-DEVCOUNT RESET 'MARK' @VA12940 00308800 INCRDEV2 LA R5,30(0) 16 DEVICE SLOTS PER RCUBLOK @V407466 00309000 BXLE R3,R4,CHKDEV2 GET NEXT DEVICE @V407466 00310000 INCRCU2 LA R5,62(0) 32 CONTROL UNIT SLOTS PER RCHBLOK@V407466 00311000 BXLE R2,R4,CHKCU2 GET NEXT CONTROL UNIT @V407466 00312000 STH R14,DEVNUM NUMBER OF VDEVBLOKS TO ACQUIRE @V407466 00313000 B LOOP PREP FOR PASS3 OF 'ATT CHANNEL' @V407466 00314000 EJECT 00315000 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00316000 * PASS3 SCANS THE RDEVBLOKS RESETTING THE BIT IN THE HIGH ORDER * 00317000 * BYTE WHICH WAS SET AS A PART OF PASS2 PROCESSING. * 00318000 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00319000 SPACE 2 00320000 PASS3 EQU * @V407466 00321000 LA R4,2 INCREM FACTOR FOR SCAN @V407466 00322000 SLR R2,R2 ... @V407466 00323000 CHKCU3 LH R7,RCHCUTBL(R2) CONTROL UNIT DISPLACEMENT @V407466 00324000 LTR R7,R7 IS CONTROL UNIT ON THE SYSTEM? @V407466 00325000 BM INCRCU3 NO, GET NEXT C.U. TABLE ENTRY @V407466 00326000 A R7,ARIOCU ABSOLUTE ENTRY ADDRESS OF RCUBLOK@V407466 00327000 SLR R3,R3 INDEX FOR RCUBLOK DEV. TABLE SRCH@V407466 00328000 CHKDEV3 EQU * SCAN ALL REAL DEVICE BLOKS @V407466 00329000 LH R8,RCUDVTBL(R3) REAL DEVICE DISPLACEMENT @V407466 00330000 LTR R8,R8 DOES DEVICE EXIST? @V407466 00331000 BM INCRDEV3 NO, GET NEXT DEVICE ENTRY @V407466 00332000 SLL R8,3(0) CONVERT TO BYTE INDEX @V407466 00333000 A R8,ARIODV YES, GET ABSOLUTE RDEVBLOK ADDR @V407466 00334000 NI RDEVADD,X'FF'-DEVCOUNT RESET INDICATOR @V407466 00335000 INCRDEV3 LA R5,30(0) 16 DEVICE SLOTS PER RCUBLOK @V407466 00336000 BXLE R3,R4,CHKDEV3 GET NEXT DEVICE @V407466 00337000 INCRCU3 LA R5,62(0) 32 CONTROL UNIT SLOTS PER RCHBLOK@V407466 00338000 BXLE R2,R4,CHKCU3 GET NEXT CONTROL UNIT @VA07240 00339000 B LOOP PREP FOR PASS3 OF 'ATT CHANNEL' @V407466 00340000 EJECT 00341000 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00342000 * PASS4 ACQUIRES ONE VCHBLOK IN ADVANCE IF NECESSARY, AS MANY * 00343000 * VCUBLOKS AS NECESSARY AFTER NUMBER OF EMPTY SLOTS IN EXISTING * 00344000 * TABLE OF VCUBLOKS ARE SUBTRACTED FROM NUMBER REQUIRED AND AS MANY * 00345000 * VDEVBLOKS AS ARE NECESSARY AFTER A SIMILAR CALCULATION IS PERFORMED.* 00346000 * ALL BLOCKS ACQUIRED ARE MADE TO LOOK LIKE EMPTY SLOTS. * 00347000 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00348000 SPACE 2 00349000 PASS4 EQU * @V407466 00350000 STM R6,R9,SAVEWRK6 SAVE REGS FOR LATER @V407466 00351000 BAL R5,LOKUSER THROW A LOCK ON DEVICE BLOCKS @V407466 00352000 SLR R7,R7 CLEAR R7 FOR NEXT COUNTER @VA13217 00352050 LA R0,VDEVSIZE SIZE OF VDEVBLOK @VA13217 00352100 L R1,VMDVSTRT POINT TO VDEVBLOK TABLE @VA13217 00352150 LH R2,VMDVCNT NUMBER OF VDEVBLOKS IN TABLE @VA13217 00352200 BAL R5,EMPSLOT FIND EMPTY SLOTS IN VDEVBLOKS @VA13217 00352250 STH R7,SAVEWRK2 REMEMBER THIS FOR LATER @VA13217 00352300 LH R1,DEVNUM WILL THE REQ'D NO. OF VDEVBLOKS @VA13217 00352350 AH R1,VMDVCNT FIT IN THE HALFWORD OFFSET @VA13217 00352400 SLR R1,R7 ALLOWED? @VA13217 00352450 MH R1,=Y(VDEVSIZE*8) @VA13217 00352500 CL R1,=A(X'8000') @VA13217 00352550 BH ERR153 .. NO, VIRT DEV MAX EXCEEDED @VA13217 00352600 LA R0,VCHSIZE SIZE OF VCHBLOK @V407466 00353000 SLR R2,R2 MAKE SURE R2 ZERO TO START @V407466 00354000 L R1,VMCHSTRT VCHBLOK TABLE POINTER @V407466 00355000 LH R2,VMCHCNT NUMBER BLOCKS IN TABLE @V407466 00356000 SLR R7,R7 CLEAR R7 @V407466 00357000 OI DEDBITS,CHBLD BUILDING VCHBLOK @VA07711 00357100 BAL R5,EMPSLOT SEE IF EMPTY SLOTS @V407466 00358000 LTR R7,R7 ANY EMPTY SLOTS - ONLY NEED ONE @V407466 00359000 BZ ACQVCH ACQUIRE ONE VCHBLOK @V407466 00360000 LR R1,R8 PTR TO EMPTY VCHBLOK @VA07711 00360100 SLR R6,R6 IN. NO FREE STORAGE ACQUIRED @VA07711 00360200 * FOR BLK 00360300 B FORMVCH CONSTRUCT VCHBLOK @VA07711 00360400 EMPVCU SLR R7,R7 CLEAR R7 FOR NEXT COUNTER @V407466 00361000 LA R0,VCUSIZE SIZE OF VCUBLOK @V407466 00362000 L R1,VMCUSTRT VCUBLOK TABLE POINTER @V407466 00363000 LH R2,VMCUCNT NUMBER OF VCUBLOKS @V407466 00364000 BAL R5,EMPSLOT FIND EMPTY SLOTS IN VCUBLOKS @V407466 00365000 LH R6,CUNUM NO. OF VCUBLOKS REQUIRED @V407466 00366000 SR R6,R7 SUBT NO. EMPTY FROM NO. REQUIRED @V407466 00367000 BC 12,EMPVDEV < OR = 0; ACQUIRE NO VCUBLOKS @V407466 00368000 SLR R3,R3 ... @V407466 00369000 LH R2,VMCUCNT NO. EXISTING VCUBLOKS @V407466 00370000 LA R9,VCUSIZE VCUBLOK SIZE IN DBL. WORDS @V407466 00371000 LA R1,VCUSIZE VCUBLOK SIZE IN DBL. WORDS @V407466 00372000 L R8,VMCUSTRT PTR. TO TABLE OF VCUBLOKS @V407466 00373000 OI DEDBITS,CUBLD BUILDING CU BLOCKS @VA07711 00373100 BAL R5,BLDBLOK CREATE TAB. OF VCUBLOKS (OLD+NEW)@V407466 00374000 NI DEDBITS,X'FF'-CUBLD RESET VCUBLOK INDICATOR @VA11369 00374100 SLR R8,R8 CLEAR R8 FOR 'LH' @V407466 00375000 LA R7,VCUSIZE SIZE OF VCUBLOK IN DBL. WDS. @V407466 00376000 LH R8,VMCUCNT NUMBER VCUBLOKS IN OLD TABLE @V407466 00377000 MR R6,R8 NUMBER DBL. WDS. IN OLD TABLE @V407466 00378000 LR R5,R1 SAVE NEW TABLE POINTER @V407466 00379000 L R1,VMCUSTRT POINTER TO OLD TABLE @V407466 00380000 LR R0,R7 TABLE LENGTH TO R0 FOR FRET @V407466 00381000 CALL DMKFRET RETURN THE STORAGE @V407466 00382000 ST R5,VMCUSTRT STORE POINTER TO NEW TABLE @V407466 00383000 STH R3,VMCUCNT STORE NO. OF VCUBLOKS IN TABLE @V407466 00384000 EMPVDEV DS 0H @VA13217 00385100 LH R6,DEVNUM GET NO. OF REQUIRED VDEVBLOKS @VA07240 00390000 SH R6,SAVEWRK2 ACTUAL NO. VDEVBLOKS TO ACQUIRE @VA13217 00391100 BNP ENDPASS4 IF .LE. 0, THIS PASS DONE @VA13217 00392100 SLR R3,R3 R3 ZERO TO START @V407466 00393000 LH R2,VMDVCNT NO. EXISTING VDEVBLOKS @V407466 00394000 LA R9,VDEVSIZE VDEVBLOK SIZE IN DBL. WORDS @V407466 00395000 LA R1,VDEVSIZE ...SAME @V407466 00396000 L R8,VMDVSTRT PTR. TO EXISTING VDEVBLOK TABLE @V407466 00397000 OI DEDBITS,DEVBLD BUILDING VDEVBLOKS @VA07711 00397100 BAL R5,BLDBLOK CREATE NEW VDEVBLOK TAB (OLD+NEW)@V407466 00398000 NI DEDBITS,X'FF'-DEVBLD RESET VDEVBLOK INDICATOR @VA11369 00398100 SLR R8,R8 CLEAR R8 @V407466 00399000 LA R7,VDEVSIZE SIZE OF VDEVBLOK IN DBL.WDS. @V407466 00400000 LH R8,VMDVCNT NUMBER VDEVBLOKS IN OLD TABLE @V407466 00401000 MR R6,R8 NO. DBL. WDS. IN OLD TABLE @V407466 00402000 LR R0,R7 INTO R0 FOR FRET @V407466 00403000 LR R5,R1 SAVE NEW TABLE PTR TEMP. @V407466 00404000 L R1,VMDVSTRT OLD TABLE PTR @V407466 00405000 CALL DMKFRET RELEASE OLD TABLE @V407466 00406000 ST R5,VMDVSTRT STORE NEW TABLE POINTER @V407466 00407000 STH R3,VMDVCNT TOT. NO. VDEVBLOKS IN NEW TABLE @V407466 00408000 ENDPASS4 LM R6,R9,SAVEWRK6 RESTORE REGISTERS @V407466 00409000 OI VCHMODE,VCHW SET 'W' MODE IN DUMMY UDEVBLOK @V407466 00410000 B LOOP GO TO PASS5 OF 'ATTACH CHANNEL' @V407466 00411000 SPACE 00412000 ACQVCH LA R6,1 SINGLE VCHBLOK TO BE ACQUIRED @V407466 00413000 SLR R3,R3 ... @V407466 00414000 LH R2,VMCHCNT NO. OF EXISTING VCHBLOKS @V407466 00415000 LA R9,VCHSIZE VCHBLOK SIZE IN DBL. WORDS @V407466 00416000 LR R1,R9 VCHBLOK SIZE IN DBL. WORDS @VA07711 00417000 L R8,VMCHSTRT PTR TO EXISTING VCHBLOK TABLE @V407466 00418000 BAL R5,BLDBLOK CREATE NEW VCHBLOK TAB. (OLD+NEW)@V407466 00419000 SLR R8,R8 CLEAR R8 FOR 'LH' @V407466 00420000 LA R7,VCHSIZE SIZE OF VCHBLOK IN DBL. WDS. @V407466 00421000 LH R8,VMCHCNT NO. OF VCHBLOKS IN OLD TABLE @V407466 00422000 MR R6,R8 R7 - NO. DBL. WDS. IN OLD TABLE @V407466 00423000 LR R0,R7 ...TO R0 FOR FRET @V407466 00424000 LR R5,R1 SAVE PTR TO NEW TABLE TEMP. @V407466 00425000 L R1,VMCHSTRT BEGINNING OF OLD TABLE @V407466 00426000 CALL DMKFRET RELEASE STORAGE @V407466 00427000 ST R5,VMCHSTRT STORE NEW TABLE PTR IN VMBLOK @V407466 00428000 STH R3,VMCHCNT NO. OF VCHBLOKS IN NEW TABLE @V407466 00429000 B EMPVCU DETERMINE NO. VCUBLOKS TO ACQUIRE@V407466 00430000 SPACE 00431000 EMPSLOT SLL R0,3 CONVERT BLOCK SIZE TO BYTES @VA07711 00432000 LTR R8,R1 ANY ENTRIES IN TABLE? @VA07711 00432100 BCR 13,R5 NO TAB. ENTRIED; ZERO EMPTY SLOTS@V407466 00433000 USING VDEVBLOK,R8 VDEVBLOK ADDRESSABILITY @V407466 00435000 TSTEMP TM VDEVADD,X'80' EMPTY SLOT? @V407466 00436000 BC 1,UPDSLOT YES, UPDATE EMPTY SLOTS @V407466 00437000 NEXTSLOT AR R8,R0 NEXT BLOCK @V407466 00438000 BCT R2,TSTEMP CONTINUE TO LOOK FOR EMPTY SLOTS @V407466 00439000 BR R5 RETURN TO MAINLINE @V407466 00440000 UPDSLOT AH R7,F1+2 ADD ONE MORE EMPTY SLOTWS @V407466 00441000 TM DEDBITS,CHBLD ARE WE BUILDING VCHBLOK @VA07711 00441100 BCR 1,R5 YES, PT TO EMPTY SLOT @VA07711 00441200 B NEXTSLOT CONTINUE SEARCH FOR EMPTY SLOTS @V407466 00442000 DROP R8 @VA07711 00442100 SPACE 00443000 BLDBLOK AR R3,R2 R3=NO. OF EXISTING BLOCKS @V407466 00444000 AR R3,R6 PLUS NUMBER OF NEW BLOCKS 00445000 SRL R0,3 CONVERT TO DLB. WDS. @VA07711 00445100 MR R0,R3 NO. DLB. WDS. (R3*R1 INTO R0-R1) @V407466 00446000 LR R0,R1 NO. OF DOUBLEWORDS TO ACCUIRE 00447000 CALL DMKFRERC ACQUIRE STORAGE @V407466 00448000 BNZ VCH138 INSUFFICIENT FREE STORAGE @V407466 00449000 ST R1,SAVEWRK5 SAVE PTR TO NEW STORAGE TEMP. @V407466 00450000 SLL R9,3 SIZE OF BLOCK TO BYTES @V407466 00451000 BCTR R9,0 SUBTRACE ONE FOR EXECUTED MVC @V407466 00452000 NEXTMVC EX R9,BLDMVC MOVE OLD BLOCK TO NEW @V407466 00453000 TM DEDBITS,DEVBLD ARE WE BUILDING VDEVBLOKS? 00454000 BO VLNK YES, TAKE CARE OF VDEVLINK FIELD 00455000 BLDNEXT LA R1,1(R9,R1) POINT TO NEXT BLOCK IN EACH TAB. 00456000 LA R8,1(R9,R8) ADDING 1 TO MAKE UP FOR SUBTRACT @V407466 00457000 BCT R2,NEXTMVC MOVE NEXT BLOCK @V407466 00458000 LH R8,FFS R8=FFFF @V407466 00459000 NEXTSTOR STH R8,0(R1) STORE FFS IN EMPTY SLOTS @V407466 00460000 TM DEDBITS,DEVBLD ARE WE BUILDING VDEVBLOKS 00461000 BO CLRDEV YES, CLEAR EMPTY VDEVBLOK 00462000 TM DEDBITS,CUBLD BUILDING VCUBLOKS?? 00463000 BO CLRCU YES, CLEAR EMPTY VCUBLOKS 00464000 *OTHERWISE MUST BE BUILDING VCHBLOKS 00465000 USING VCHBLOK,R1 ADDRESSABILITY 00466000 FORMVCH MVC VCHBLOK(VCHCUTBL-VCHBLOK),ZEROES CLEAR @VA07711 00467000 MVC VCHCUTBL(8),FFS ... 00468000 MVC VCHCUTBL+8(24),VCHCUTBL ... 00469000 TM DEDBITS,CHBLD ARE WE BUILDING VCHBLOK? @VA07711 00469050 BZ NEXTBLK NO, GO TO NEXT BLOCK @VA07711 00469075 NI DEDBITS,X'FF'-CHBLD CLEAR VCHBLOK FLAG @VA07711 00469100 L R9,SAVEWRK9 CHANNEL ADDR X'C00' @VA07711 00469125 LH R2,DEVADDR GET CHANNEL ADDRESS @VA07711 00469150 STH R2,VCHADD STORE IN VCHBLOK @VA07711 00469175 OI VCHTYPE,VCHSEL FLAG CHANNELS 1-6 AS SELECTOR @VA07711 00469200 TM VMFSTAT,VMFBMX USER WANT BMX CHANNEL? @VA07711 00469225 BZ *+8 NO, LEAVE THEM AS SELECTOR @VA07711 00469250 MVI VCHTYPE,VCHBMX YES,CHANGE THEM TO BMX @VA07711 00469275 SRL R2,7 MULTIPLY CH ADDR BY 2 @VA07711 00469300 L R7,VMCHSTRT GET OLD TABLE ADDRESS @VA07711 00469325 LTR R6,R6 DID WE ACQUIRE NEW TABLE @VA07711 00469350 BZ VCHORIG YES, GO GET ADDRESS @VA07711 00469375 L R7,SAVEWRK5 GET NEWLY ACQUIRED TABLE @VA07711 00469400 VCHORIG LR R0,R1 ADDR OF BLK JUST CREATED TO R0 @VA07711 00469425 SR R0,R7 DISP OF NEW VCHBLOK IN TABLE @VA07711 00469450 STH R0,VMCHTBL(2) STORE DISP IN VMBLOK @VA07711 00469475 LTR R6,R6 WAS VCH STORAGE ACQ THIS RUN? @VA07711 00469500 BZ EMPVCU NO, GO SEE ABOUT CONTROL UNIT @VA07711 00469525 * BLKS 00469550 NEXTBLK LA R1,1(R9,R1) POINT TO NEXT EMPTY BLOCK 00470000 BCT R6,NEXTSTOR STOR FFS IN NEXT BLOCK @V407466 00471000 L R1,SAVEWRK5 RESTORE PTR TO BEGINNING OF TAB. @V407466 00472000 BR R5 RETURN TO MAINLINE @V407466 00473000 SPACE 00474000 BLDMVC MVC 0(0,R1),0(R8) MOVE OLD BLOCK TO NEW STORAGE @V407466 00475000 SPACE 00476000 USING VDEVBLOK,R1 ADDRESSABILITY 00477000 VLNK CLC VDEVADD(2),FFS EMPTY SLOT?? @V407466 00478000 BE BLDNEXT YES, DON'T WORRY ABOUT VDEVLINK @V407466 00479000 CLI VDEVTYPC,CLASDASD DASD DEVICE?? @V407466 00480000 BNE BLDNEXT NO, MOVE & BUILD NEXT BLOK @V407466 00481000 TM VDEVFLAG,VDEVTDSK T-DISK?? @V407466 00482000 BO BLDNEXT .... @V407466 00483000 L R14,VDEVLINK PTR TO VDEVBLOK FOR SAME MINIDISK@V407466 00484000 * SAME MINIDISK LINKED BY SAME OR DIFFERENT USER 00485000 LTR R14,R14 SAME MINIDISK LINKED BY SOMEONE ELSE @V407466 00486000 BZ BLDNEXT NO, MOVE & BUILD NEXT BLOCK @V407466 00487000 LR R15,R1 R15 POINTS TO NEW BLOCK @V407466 00488000 B BLDCHCK SEE IF VDEVBLOK POINTS TO OLD BLOK @V407466 00489000 BLDLOOP LR R15,R14 SAVE PREVIOUS VDEVBLOK ADDRESS @V407466 00490000 L R14,VDEVLINK-VDEVBLOK(,R14) NEXT VDEVBLOK ADDR @V407466 00491000 BLDCHCK CR R8,R14 DOES IT PT TO OLD BLOK?? @V407466 00492000 BNE BLDLOOP NO, KEEP LOOKING @V407466 00493000 ST R1,VDEVLINK-VDEVBLOK(,R15) POINT IT TO NEW ONE @V407466 00494000 B BLDNEXT MOVE & BUILD NEXT BLOCK @V407466 00495000 SPACE 00496000 CLRDEV DS 0H @VA11369 00498100 XC VDEVADD+2(VDEVSIZE*8-2),VDEVADD+2 CLEAR VDEVBLOK@V407466 00499000 B NEXTBLK CLEAR NEXT EMPTY SLOT @V407466 00500000 SPACE 00501000 USING VCUBLOK,R1 ADDRESSABILITY 00502000 CLRCU DS 0H @VA11369 00503100 MVC VCUBLOK+2(6),ZEROES CLEAR VCUBLOK @V407466 00504000 MVC VCUDVTBL(8),FFS FFS @V407466 00505000 MVC VCUDVTBL+8(24),VCUDVTBL FFS ... @V407466 00506000 B NEXTBLK CLEAR NEXT EMPTY BLOCK @V407466 00507000 DROP R1 00508000 EJECT 00512000 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00513000 * PASS5 PERFORMS THE ACTUAL 'ATTACH CHANNEL' FUNCTION BY CALLING * 00514000 * DMKVDSAT TO ATTACH EACH DEVICE ON THE THE CHANNEL. * 00515000 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00516000 SPACE 2 00517000 PASS5 EQU * @V407466 00518000 USING RDEVBLOK,R8 ADDRESSABILITY @V407466 00519000 LA R4,2 INCREMENT FACTOR FOR SCAN @V407466 00520000 SLR R2,R2 INDEX FOR CONTROL UNIT SEARCH @V407466 00521000 CHKCU5 EQU * SCAN ALL REAL CONTROL UNITS @V407466 00522000 LH R7,RCHCUTBL(R2) CONTROL UNIT DISPLACEMENT @V407466 00523000 LTR R7,R7 IS CONTROL UNIT ON THE SYSTEM? @V407466 00524000 BM INCRCU5 NO, GET NEXT C.U. TABLE ENTRY @V407466 00525000 A R7,ARIOCU LOAD ABSOLUTE ADDRESS OF RCUBLOK @V407466 00526000 SLR R3,R3 INDEX FOR DEVICE TABLE SEARCH @V407466 00527000 CHKDEV5 EQU * SCAN ALL REAL DEVICE BLOCKS @V407466 00528000 LH R8,RCUDVTBL(R3) REAL DEVICE DISPLACEMENT @V407466 00529000 LTR R8,R8 DOES DEVICE EXIST? @V407466 00530000 BM INCRDEV5 NO, GET NEXT DEVICE ENTRY @V407466 00531000 SLL R8,3(0) CONVERT TO BYTE INDEX @V407466 00532000 A R8,ARIODV YES, GET ADDRESS OF RDEVBLOK @V407466 00533000 ATTCHAN EQU * DEDICATE EACH REAL DEVICE @V407466 00534000 STM R2,R8,SAVEWRK2 SAVE CURRENT REGISTERS @V407466 00535000 LA R1,RCUCHA ADDRESS OF THE FIRST CHANNEL @V407438 00536000 LA R2,4 INCREMENT @V407438 00537000 LA R3,RCUCHD ADDRESS OF THE LAST CHANNEL @V407438 00538000 NEXTCH CL R6,0(R1) R6 REPRESENT THIS CU -> CH PATH? @V407438 00539000 BE *+8 YES, PATH FOUND, BR. @V407438 00540000 BXLE R1,R2,NEXTCH NOPE, LOOK AT ALL CHANNEL PATHS @V407438 00541000 LA R2,RCUCHA ADDRESS OF THE BEGINNING AGAIN @V407438 00542000 SLR R1,R2 FIND HOW FAR DOWN WE FOUND IT @V407438 00543000 SRL R1,2 CONVERT TO INDEX FROM 0 TO 3 @V407438 00544000 IC R3,ENABTBL(R1) GET PTH BIT, PUT CU->CH PTH ONLIN@V407438 00545000 EX R3,CUCHENAB (NI RCUSTAT,X'FF'-RCUCHXOF) @V407438 00546000 NI RCUSTAT,X'FF'-RCUDISA PUT THE CONTROL UNIT ONLIN@V407438 00547000 NI RDEVSTAT,X'FF'-RDEVDISA PUT THE DEVICE ON LINE @V407438 00548000 CALL DMKSCNRA REAL DEVICE ADDRESS VIA THIS PATH@V407438 00549000 STH R1,DEVADDR PASS IT ON TO DMKVDS @V407466 00550000 LH R0,RDEVTYPC REAL DEVICE TYPE, CLASS @V407466 00551000 STH R0,VDSTYPC PASS IT ALONG, ALSO @V407466 00552000 LA R2,DEVADDR POINT TO 'UDEVBLOK' FOR VDS @V407466 00553000 LR R1,R8 RDEVBLOK ADDRESS TO GR1 FOR VDS @V407466 00554000 CALL DMKVDSAT,AFFINITY ATTACH THIS DEVICE @V407510 00555000 CH R2,=H'124' EXCEEDED MAX VIRTUAL DEVICES? @VA13217 00555300 BE ERR153 YES, WE MUST'VE GOOFED--ABEND @VA13217 00555600 LM R2,R8,SAVEWRK2 RESTORE SCAN REGISTERS @V407466 00556000 SPACE 00557000 INCRDEV5 EQU * ADVANCE TO NEXT RDEVBLOK SLOT @V407466 00558000 LA R5,30(0) SIXTEEN DEVICE SLOTS PER RCUBLOK @V407466 00559000 BXLE R3,R4,CHKDEV5 GET THE NEXT DEVICE @V407466 00560000 SPACE 00561000 INCRCU5 EQU * ADVANCE TO NEXT RCUBLOK SLOT @V407466 00562000 LA R5,62(0) 32 RCUBLOK SLOTS PER RCHBLOK @V407466 00563000 BXLE R2,R4,CHKCU5 GET THE NEXT CONTROL UNIT @V407466 00564000 SPACE 00565000 ATCHCOMP EQU * CHANNEL HAS BEEN DEDICATED @V407466 00566000 LH R1,DEVADDR PICK UP DEVICE NUMBER @V407466 00567000 CALL DMKSCNVU NOW GET THE VIRTUAL BLOCKS @V407466 00568000 USING VCHBLOK,R6 @V407466 00569000 OI VCHSTAT,VCHDED INDICATE VIRTUAL CHANNEL ALSO DED@V407466 00570000 MVC VCHRCHAD,SAVERCH SAVE RCHBLOK ADDRESS @VA13280 00570500 USING RCHBLOK,R6 BACK TO STANDARD ABBRESSABILITRY @V407466 00571000 CALL DMKSCNRU GET REAL DEVICE ADDRESS BACK @V407466 00572000 BAL R5,FREUSER UNLOCK USER'S BLOCKS @V407466 00573000 B CMDCOMP SEND MSG TO USER @V407438 00574000 SPACE 00575000 * RCU TO RCH BLOCK PATH AVAILABLE BITS IN RCUSTAT 00576000 ENABTBL DC AL1(X'FF'-RCUCHAOF,X'FF'-RCUCHBOF) @V407438 00577000 DC AL1(X'FF'-RCUCHCOF,X'FF'-RCUCHDOF) @V407438 00578000 CUCHENAB NI RCUSTAT,0 ENABLE RCU -> RCH PATH @V407438 00579000 EJECT 00580000 DETCHAN EQU * DETACH DEDICATED CHANNEL DEVICES @VA01382 00581000 STM R2,R8,SAVEWRK2 SAVE REGISTERS 00582000 LH R1,RDEVATT LOAD VIRTUAL DEVICE ADDRESS. 00583000 CALL DMKSCNVU GET VIRTUAL CONTROL BLOCKS 00584000 BC 7,VCH040 BRANCH IF CC=1, 2, OR 3 @VA13060 00584150 SPACE 00585000 USING VCHBLOK,R6 @VA01382 00586000 USING VCUBLOK,R7 ADDRESS THE VIRTUAL BLOCKS @VA01382 00587000 USING VDEVBLOK,R8 @VA01382 00588000 SPACE 00589000 CALL DMKVDREL RELEASE THE VIRTUAL DEVICE @VA01382 00590000 SPACE 00591000 L R2,FFS MASK FIELD 00592000 SLR R3,R3 CLEAR INDEX REGISTER 00593000 LA R4,4 LOAD INCREMENT REGISTER 00594000 LA R5,28 LOAD COMPARAND REGISTER 00595000 LH R1,VDEVADD LOAD VIRTUAL DEVICE ADDRESS 00596000 AR R1,R1 MULTIPLY IT BY 2 00597000 STH R2,VDEVADD INDICATE DEVICE NO LONGER PRESENT 00598000 STH R2,VCUDVTBL(R1) REMOVE DEVICE FROM C.U. TABLE 00599000 SPACE 00600000 DETCULP CL R2,VCUDVTBL(R3) ANY MORE DEVICES ON THIS C.U. 00601000 BNE DETDONE BRANCH IF YES. 00602000 BXLE R3,R4,DETCULP BRANCH IF MORE TABLE ENTRIES. 00603000 LH R1,VCUADD LOAD VIRTUAL C.U. ADDRESS 00604000 SRL R1,3 MULTIPLY IT BY 2 00605000 STH R2,VCUADD INDICATE C.U. NO LONGER EXISTS 00606000 STH R2,VCHCUTBL(R1) REMOVE VCUBLOK FROM TABLE 00607000 SLR R3,R3 ZERO INDEX REGISTER 00608000 SPACE 00609000 DETCHLP CL R2,VCHCUTBL(R3) ANY MORE C.U. ON THIS CHANNEL ? 00610000 BNE DETDONE BRANCH IF YES. 00611000 BXLE R3,R4,DETCHLP BRANCH IF MORE TABLE ENTRIES. 00612000 LH R1,VCHADD LOAD VIRTUAL CHANNEL ADDRESS 00613000 SRL R1,7 MULTIPLY IT BY 2 00614000 STH R2,VCHADD INDICATE CHANNEL NO LONGER EXISTS 00615000 STH R2,VMCHTBL(R1) REMOVE VCHBLOK INDEX FROM TABLE 00616000 SPACE 00617000 DETDONE LM R2,R8,SAVEWRK2 RESTORE REGISTERS 00618000 USING RCHBLOK,R6 00619000 USING RCUBLOK,R7 00620000 USING RDEVBLOK,R8 00621000 B INCRDEV GET NEXT REAL DEVICE TO DETACH. 00622000 EJECT 00623000 ALLDET EQU * @VA07711 00624000 USING VCHBLOK,R6 ADDRESSABILITY @VA07711 00624100 LTR R14,R14 ANY DEVICES DETACHED? @VA07711 00624200 BNZ CMDCOMP YES, USE REGULAR LOGIC @VA07711 00624300 LR R0,R6 SAVE RCHBLOK ADDRESS @VA07711 00624400 LH R1,DEVADDR GET CHANNEL X'C00' @VA07711 00624500 CALL DMKSCNVU GET VIRTUAL BLOCKS @VA07711 00624600 LR R6,R0 RESTORE RCHBLOK ADDRESS @VA07711 00624700 L R0,FFS ... @VA07711 00624800 LH R1,VCHADD CHANNEL ADDRESS @VA07711 00624900 SRL R1,7 TIMES 2 @VA07711 00625000 STH R0,VCHADD CLEAR VCHADD @VA07711 00625100 STH R0,VMCHTBL(R1) AND VMBLOK INDEX @VA07711 00625200 USING RCHBLOK,R6 ADDRESSABILITY @VA07711 00625300 CMDCOMP EQU * CHANNEL IS ATTACHED/DETACHED @VA01382 00626000 OI RCHSTAT,RCHDED MARK CHANNEL DEDICATED @V508690 00626100 TM VDBITS+1,DETACH IS THIS A DETACH ?? @V508690 00626200 BNO CMDCOMP1 NO, LEAVE CHANNEL BLOK ALONE @V508690 00626300 NI RCHSTAT,X'FF'-RCHDED BETTER CLEAR DEDICATE BIT @V508690 00626400 CMDCOMP1 EQU * @V508690 00626500 MVC SAVEVCH(26),=C'CHAN X DETACHED USERIDXX' 00627000 MVC SAVEVCH+18(8),CHANUSER STORE USERID 00628000 LH R1,CHANADDR+2 GET CHANNEL ADDRESS 00629000 CALL DMKCVTBH AND CONVERT TO HEX 00630000 STC R1,SAVEVCH+5 SAVE CONVERTED ADDRESS 00631000 LA R1,SAVEVCH LOAD ADDRESS OF FREE STORAGE 00632000 LA R0,26 SIZE IN BYTES OF THE RESPONSE 00633000 TM VDBITS+1,DETACH IS THE USER DETACHING THE CHANNEL 00634000 BO *+10 YES - MESSAGE ALL SET 00635000 MVC SAVEVCH+8(9),=C'ATTACH TO' CHANGE IT TO ATTACH 00636000 CALL DMKQCNWT,PARM=NORET SEND RESPONSE TO ATTACHEE 00637000 BAL R5,MINEVMBK GET ATTACHER'S VMBLOK @V407510 00638000 SR R3,R3 CLEAR R3 FOR RETURNING THE "RETURN CODE" 00639000 L R2,ASYSOP GET VMBLOK OF SYSTEM OPERATOR 00640000 CL R2,SAVER10 IS SYSTEM OPERATOR SAME AS ATTACHEE ? 00641000 BE OPERATEE YES - 00642000 CALL DMKQCNWT,PARM=NORET+OPERATOR NO - TELL HIM ALSO 00643000 SPACE 00644000 OPERATEE CL R11,SAVER10 IS ATTACHER ALSO THE ATTACHEE ? 00645000 BE FRETMSG YES - NO NEED TO TELL HIM AGAIN 00646000 CL R11,ASYSOP IS ATTACHER THE SYSTEM'S OPERATOR ? 00647000 BE FRETMSG YES - NO NEED TO TELL HIM AGAIN 00648000 B SENDMSG ISSUE THE RESPONSE 00649000 SPACE 00650000 LOKUSER EQU * THROW A LOCK ON DEVICE BLOCKS @V407466 00651000 LA R1,VMUSER POINT TO USERID @V407466 00652000 CALL DMKLOCKQ ... AND LOCK IT @V407466 00653000 LA R0,8 LENGTH OF USERID IN R0 @V407466 00654000 CALL DMKSCNAU USER STILL LOGGED ON @V407466 00655000 BNZ NOTLOGD NO, ERROR @V407466 00656000 BR R5 RETURN TO MAINLINE @V407466 00657000 SPACE 00658000 NOTLOGD EQU * USERID NOT LOGGED ON @V407466 00659000 LA R1,VMUSER USERID @V407466 00660000 LA R0,8 LENGTH @V407466 00661000 LA R2,045(,0) DMKVCH045E @V407466 00662000 B NODATA ISSUE MESSAGE @V407466 00663000 SPACE 00664000 EJECT 00665000 VCH034 SLR R0,R0 NO PARM'S BEING PASSED 00666000 SLR R1,R1 ... 00667000 LA R2,34 MESSAGE NUMBER DMKVCH034 00668000 B NODATA 00669000 VCH040 DS 0H @VA09651 00669100 LA R2,40 MESSAGE NUMBER DMKVCH040E @VA09651 00669500 CALL DMKCVTBH @VA09651 00669600 SR R0,R0 R0, BYTE 3 = 0 => DATA IN R1 @VA13217 00669610 B NODATA @VA09651 00669700 SPACE 00670000 VCH048 LA R2,48 MESSAGE NUMBER DMKVCH048 00671000 B CALLERM 00672000 SPACE 1 00672100 ERR153 LA R2,EMSG153 MSG ID @VA13217 00672200 L R1,CHANADDR GET CHANNEL NUMBER @VA13217 00672300 CALL DMKCVTBH CONVERT TO EBCDIC @VA13217 00672400 ICM R1,B'1110',=C'CH ' DATA IS "CH N" @VA13217 00672500 SR R0,R0 R0 LOW ORDER=0:DATA IN R1 @VA13217 00672600 B NODATA GO SET UP OTHER THINGS @VA13217 00672700 SPACE 00673000 VCH129 LA R2,129 MESSAGE NUMBER DMKVCH129 00674000 B CALLERM 00675000 SPACE 00676000 VCH130 LA R2,130 MESSAGE NUMBER DMKVCH130 00677000 B CALLERM 00678000 SPACE 00679000 VCH132 LA R2,132 MESSAGE NUMBER DMKVCH132 00680000 B CALLERM 00681000 SPACE 00682000 VCH138 LA R2,MSG138 MESSAGE NUMBER DMKVCH138 @V407466 00683000 B CALLERM ... @V407466 00684000 SPACE 00685000 CALLERM LH R1,CHANADDR+2 GET CHANNEL NUMBER AND 00686000 CALL DMKCVTBH CONVERT IT TO HEX 00687000 STC R1,CHANADDR+3 STORE THE RESULT 00688000 LA R1,CHANADDR ADDRESS OF THE DATA TO PASS 00689000 LA R0,16 LENGTH OF THE DATA TO PASS 00690000 SPACE 00691000 NODATA ICM R0,B'1110',MODID+3 MODULE IDENTIFICATION 00692000 ICM R2,B'1000',=X'40' FLAG AREA TO BE FRETTED 00693000 LR R3,R9 ADDRESS OF THE AREA TO BE FRETTED 00694000 ICM R3,B'1000',=X'09' Size of area to be fretted HRC040DK 00695100 LR R4,R1 SAVE REG 1 ACROSS CALL 00696000 BAL R5,FREUSER RELEASE USER'S BLOCKS @V407466 00697000 LR R1,R4 RESTORE REG 1 TO POINT CORRECTLY 00698000 BAL R5,MINEVMBK GET ATTACHER'S VMBLOK @V407510 00699000 CALL DMKERMSG OUTPUT THE MESSAGE 00700000 * RETURN WILL BE MADE DIRECTLY TO DMKVDA FROM DMKERM 00701000 EJECT 00702000 SENDMSG CALL DMKQCNWT,PARM=NORET 00703000 FRETMSG LA R0,9 Size in double words HRC040DK 00704100 LR R1,R9 RETURN "SAVEVCH" STORAGE 00705000 CALL DMKFRET 00706000 ST R3,SAVER2 RETURN THE "RETURN CODE" TO THE CALLER 00707000 EXIT 00708000 SPACE 00709000 YOURVMBK DS 0H @V407510 00710000 L R1,SAVER10 GET ATTACHEE'S VMBLOK @V407510 00711000 SWTCHVM SWITCH TO ATTACHEE'S @V407510 00712000 BR R5 RETURN TO CALLER @V407510 00713000 FREUSER LA R1,VMUSER USERID @V407466 00714000 CALL DMKLOCKD UNLOCK USER'S BLOCKS @V407466 00715000 BR R5 RETURN TO MAINLINE @V407466 00716000 SPACE 00717000 MINEVMBK DS 0H @V407510 00718000 STM R0,R1,SAVEWRK8 DO NOT DESTROY NEEDED REGS @VA07769 00719500 L R1,SAVER11 GET CALLER'S VMBLOK @V407510 00720000 SWTCHVM SWITCH TO ATTACHER @V407510 00721000 LM R0,R1,SAVEWRK8 RESTORE SWITCHVM WORK REGS @VA07769 00722500 BR R5 RETURN TO CALLER @V407510 00723000 SPACE 00724000 * 00725000 * FLAGS DEFINED IN VDBITS 00726000 * 00727000 CHANNEL EQU X'80' DEDICATED CHANNEL OPTION SPECIFIED 00728000 NSYSOP EQU X'40' CALLER IS NOT SYSTEM OPERATOR 00729000 VDETACH EQU X'20' DETACH VIRTUAL DEVICE 00730000 ATTSYST EQU X'10' ATTACH/DETACH TO/FROM "SYSTEM" 00731000 ATTREAD EQU X'08' ATTACH "R/O" 00732000 NOTREDY EQU X'04' DASD DEVICE NOT READY 00733000 SPACE 2 00734000 * 00735000 * FLAGS DEFINED IN VDBITS + 1 00736000 * 00737000 NSLABEL EQU X'80' NON-STANDARD LABEL FORMAT 00738000 BADLABL EQU X'40' READ FAILED FOR DASD LABEL 00739000 CPOWND EQU X'20' ALLOCATION DATA PRESENT ON VOLUME 00740000 ALLOCN EQU X'10' READING ALLOCATION DATA 00741000 DETACH EQU X'08' 'DETACH REAL' IN PROGRESS 00742000 DASENSE EQU X'04' SENSE IN PROGRESS 00743000 SPACE 00744000 SPACE 00745000 * 00746000 * FLAGS DEFINED IN DEDBITS 00747000 * 00748000 DEVIND EQU X'80' RDEVICE FOUND ON RCUBLOK @V407466 00749000 DEVBLD EQU X'40' BUILDING VDEVBLOKS @VA07711 00749100 CUBLD EQU X'20' BUILDING VCUBLOKS @VA07711 00749200 CHBLD EQU X'10' BUILDING VCHBLOK @VA07711 00749300 SPACE 00750000 * MISCELLANEOUS EQUATES 00751000 DEVCOUNT EQU X'80' RDEVBLOK COUNTED PREVIOUSLY IND. @V407466 00752000 EMSG153 EQU 153 EXCEEDED MAX VIRTUAL DEVICES @VA13217 00752500 MSG138 EQU 138 DMKVCH138E @V407466 00753000 SPACE 2 00754000 LTORG 00755000 SPACE 2 00756000 SAVEVCH DSECT 00757000 DS 0CL68 @VA13280 00758000 DEVADDR DS 1H 00759000 ORG SAVEVCH+9 @VA03957 00760000 VCHMODE DS 1X DUMMY UDEVMODE FIELD @VA03957 00761000 VCHW EQU X'08' DEVICE IS TO BE IN 'W' MODE @VA03957 00762000 ORG SAVEVCH+10 00763000 VDSTYPC DS 1H 00764000 ORG SAVEVCH+48 00765000 CHANADDR DS 1F CHANNEL ADDRESS - LOW BYTE 00766000 DS 1F BINARY ZEROES 00767000 CHANUSER DS 1D USERID WANTING THIS CHANNEL (DET/ATT) 00768000 SAVERCH DS 1F RCHBLOK ADDRESS @VA13280 00768500 SPACE 2 00769000 COPY SAVE 00770000 VDBITS EQU SAVEWRK1 00771000 DEDBITS EQU SAVEWRK1+2 00772000 CUNUM EQU SAVEWRK4 NO. VCUBLOKS TO BE ACQUIRED @V407466 00773000 DEVNUM EQU SAVEWRK4+2 NO. VDEVBLOKS TO BE ACQUIRED @V407466 00774000 COPY EQU 00775000 COPY DEVTYPES 00776000 COPY NETWORK @VA01656 00777000 PSA 00778000 COPY VMBLOK 00779000 COPY RBLOKS 00780000 COPY VBLOKS 00781000 END 00782000