DEH TITLE 'DMKDEH (CP) VM/370 - RELEASE 6' 00001000 ISEQ 73,80 00002000 COPY OPTIONS 00003000 COPY LOCAL 00004000 SPACE 2 00005000 *. 00006000 * MODULE NAME - 00007000 * 00008000 * DMKDEH 00009000 * 00010000 * CONTENTS - 00011000 * 00012000 * DMKDEHIN - 'DEFINE' A VIRTUAL CHANNEL OR VIRTUAL STORAGE 00013000 *. 00014000 SPACE 00015000 DMKDEH CSECT 00016000 SPACE 00017000 DC CL8'DMKDEH' PAGEABLE MODULE IDENTIFIER 00018000 SPACE 00019000 USING SAVEAREA,R13 00020000 USING DMKDEH,R12 00021000 USING VMBLOK,R11 00022000 USING PSA,0 00023000 SPACE 2 00024000 EXTRN DMKCVTDB,DMKCVTBD 00025000 EXTRN DMKUDRFU,DMKUDRMD,DMKUDRRV 00026000 EXTRN DMKCFPRR,DMKPGSPO,DMKBLDRL,DMKBLDRT 00027000 EXTRN DMKERMSG 00028000 EXTRN DMKQCNWT @VA01771 00029000 EJECT 00030000 *. 00031000 * SUBROUTINE NAME - 00032000 * 00033000 * DMKDEHIN - 'DEFINE' (OR REDEFINE) A VIRTUAL CHANNEL/STORAGE 00034000 * 00035000 * FUNCTION - 00036000 * 00037000 * TO DYNAMICALLY ALTER OR AUGMENT THE VIRTUAL MACHINE 00038000 * DEVICE CONFIGURATION OR STORAGE SIZE. 00039000 * 00040000 * COMMAND LINE FORMAT - 00041000 * 00042000 * +--------+---------------------------------------+ 00043000 * | DEFINE | STORAGE NNNNNK | 00044000 * | | STORAGE NNM | 00045000 * | | | 00046000 * | | CHANNELS | 00047000 * +--------+---------------------------------------+ 00048000 * 00049000 * ATTRIBUTES - 00050000 * 00051000 * REENTRANT, PAGEABLE, CALLED VIA SVC 00052000 * 00053000 * ENTRY CONDITIONS - 00054000 * 00055000 * GPR 0 = LENGTH OF ARGUMENT IN COMMAND LINE 00056000 * GPR 1 = ADDRESS OF ARGUMENT 00057000 * GPR 9 = ADDRESS OF COMMAND BUFFER 00058000 * GPR 10 = DUMMY UDEVBLOK ADDRESS 00059000 * GPR 11 = ADDRESS OF USER'S VMBLOK 00060000 * GPR 12 = ADDRESS OF DMKDEHIN 00061000 * GPR 13 = ADDRESS OF STANDARD SAVE AREA 00062000 * 00063000 * EXIT CONDITIONS - 00064000 * 00065000 * EXIT TO CALLER (DMKDEF) IF SUCCESSFUL, OR TO DMKERMSG WITH 00066000 * ERROR-CODE (SEE ERROR MESSAGES) IF UNSUCCESSFUL. 00067000 EJECT 00068000 * CALLS TO OTHER ROUTINES - 00069000 * 00070000 * DMKCVTDB 00071000 * DMKCVTBD 00072000 * DMKERMSG 00073000 * DMKUDRFU 00074000 * DMKUDRRD 00075000 * DMKUDRRV 00076000 * DMKPGSPO 00077000 * DMKCFPRR 00078000 * DMKCFPRD 00079000 * DMKBLDRL 00080000 * DMKBLDRT 00081000 * DMKQCNWT 00082000 * DMKFREE 00083000 * 00084000 * EXTERNAL REFERENCES - 00085000 * 00086000 * NONE 00087000 * 00088000 * TABLES / WORK AREAS - 00089000 * 00090000 * NONE 00091000 * 00092000 * REGISTER USAGE - 00093000 * 00094000 * GPR 9 = ADDRESS OF COMMAND BUFFER 00095000 * GPR 11 = ADDRESS OF USER'S VMBLOK 00096000 * GPR 12 = BASE REGISTER 00097000 * GPR 13 = ADDRESS OF STANDARD SAVE AREA 00098000 * 00099000 * GPRS 0-5 AND 14-15 ARE WORK REGISTERS. 00100000 * 00101000 * GPRS 6-8 AND 10 ARE NOT USED. 00102000 * 00103000 * NOTES - 00104000 * 00105000 * THIS MODULE WAS CREATED TO HOLD LOGIC THAT USED TO BE LOCATED 00106000 * IN DMKDEF WHEN THAT MODULE OUTGREW A PAGE. THIS MODULE 00107000 * ALWAYS EXITS BACK TO DMKDEF (ITS ONLY CALLER). 00108000 * 00109000 EJECT 00110000 * OPERATION - 00111000 * 00112000 * STORAGE REDEFINED VIRTUAL STORAGE 00113000 * STOR " " " 00114000 * CHANNELS REDEFINES VIRTUAL CHANNELS 00115000 * CHAN " " " 00116000 * 1. FOR DEFINE STORAGE, AFTER THE USUAL CHECKS FOR COMMAND 00117000 * VALIDITY, THE USER MACHINE BLOCK IN THE CP DIRECTORY FOR THE 00118000 * USER IS CHECKED TO ENSURE THAT THE DESIRED STORAGE SIZE DOES 00119000 * NOT EXCEED THE MAXIMUM STORAGE SIZE PERMITTED TO THE USER. 00120000 * (IF TOO LARGE, ERROR MESSAGE AND CODE RETURNED). IF OK, THEN 00121000 * ALL TABLES PERTAINING TO THE STORAGE PRESENTLY IN USE FOR THE 00122000 * USER'S VIRTUAL MACHINE ARE RETURNED TO FREE STORAGE, AND NEW 00123000 * SEGMENT, PAGE, AND SWAP TABLES ARE CREATED BASED ON THE 00124000 * REQUESTED STORAGE SIZE. 00125000 * 00126000 * 2. FOR DEFINE CHANNELS, AFTER THE VALIDATION OF THE COMMAND, 00127000 * DMKCFPRR IS CALLED TO RESET THE VIRTUAL MACHINE. THE VIRTUAL 00128000 * MACHINES CONTROL BLOCKS (I/O) ARE THE SCANNED, AND THE VIRTUAL 00129000 * CHANNELS ARE FLAGGED ACCORDING TO THE OPTION REQUESTED. ANY 00130000 * VIRTUAL CHANNEL THAT HAS A CTCA ATTACHED TO IT WILL BE FLAGGED 00131000 * AS BEING A SELECTOR CHANNEL. 00132000 * 00133000 * RESPONSES - 00134000 * 00135000 * 'STORAGE = NNNNNK' 00136000 * 'CHANNELS = XXX' 00137000 * 00138000 * NOTE - NORMAL RESPONSES WILL BE SUPPRESSED IF USER ISSUED 00139000 * "SET IMSG OFF" COMMAND. 00140000 * 00141000 * ERROR MESSAGES - 00142000 * 00143000 * DMKDEH025E STORAGE MISSING OR INVALID 00144000 * DMKDEH026E OPERAND MISSING OR INVALID 00145000 * DMKDEH092E DEV VADDR NOT DEFINED; TYPE VADDR ALREADY DEFINED 00146000 * DMKDEH094E STORAGE EXCEEDS ALLOWED MAXIMUM 00147000 *. 00148000 EJECT 00149000 DMKDEHIN RELOC , DEFINE OR RE-DEFINE VIRTUAL DEVICE 00150000 USING DMKDEH,R12 00151000 USING UDEVBLOK,R10 .... 00152000 SPACE 00153000 CLI UDEVTYPC,X'FF' IS IT 'DEFINE STORAGE' ? 00154000 BE DEFCORE YES 00155000 B DEFCHAN ONLY OTHER CHOICE IS DEFINE CHAN 00156000 EJECT 00157000 DEFCORE EQU * RE-DEFINE VIRTUAL MEMORY SIZE 00158000 LR R2,R0 PARM LENGTH 00159000 BCTR R2,0 ...MINUS ONE 00160000 LA R3,0(R2,R1) LOOK FOR THE "K" 00161000 LA R4,10(0) SHIFT COUNT FOR 'K' PARM 00162000 CLI 0(R3),C'K' ...WHICH MUST BE THERE 00163000 BE DEFCOREK YES - MULTIPLIER = 1024 BYTES 00164000 LA R4,18(0) SHIFT COUNT FOR 'M' PARM 00165000 CLI 0(R3),C'M' THIS IS THE OTHER CHOICE 00166000 BNE INVCORE SORRY 00167000 DEFCOREK EQU * 00168000 LR R0,R2 COUNT OF PARM - "K" 00169000 C R0,F5 PARM COUNT OVER 5 ? (00000K) 00170000 BH INVCORE YES -- INVALID STORAGE VALUE 00171000 CALL DMKCVTDB CONVERT STORAGE SIZE 00172000 BNZ INVCORE 00173000 LTR R1,R1 STORAGE VALUE OF ZERO ? 00174000 BZ INVCORE YES - INVALID STORAGE VALUE 00175000 CLI 0(R3),C'M' DEFINING BY MEG? 00176000 BNE MUSTBEK @VA04509 00177000 CL R1,F16 ASKING FOR MORE THAN 16 MEG? @VA04509 00178000 BH INVCORE YES - CANT DO @VA04509 00179000 B NOROUND @VA04509 00180000 MUSTBEK CL R1,F8 AT LEAST MINIMUM 8K? @VA04509 00181000 BL INVCORE NO 00182000 CL R1,=F'16384' ASKING FOR MORE THAN 16 MEG? @VA04509 00183000 BH INVCORE YES - CANT DO @VA04509 00184000 LA R1,3(,R1) ROUND UP TO PAGE BOUNDARY 00185000 SRL R1,2(0) ... 00186000 NOROUND EQU * 00187000 SLL R1,2(R4) 'K' = 1024 BYTES, 'M' = 1,048,576 BYTES 00188000 ST R1,DEVADDR SAVE IT HERE FOR NOW 00189000 CL R1,VMSTOR MAYBE I CAN GET AWAY WITH A MSG @VA05181 00190000 BE STORMSG JUST NEEDS MSG @V408246 00191000 BL SKIPDIR IF LESS, THEN NO NEED TO CHECK @V408246 00192000 * DIRECTORY 00193000 * SEE IF SPECIFIED SIZE EXCEEDS USER MAXIMUM 00194000 LA R0,UDBFSIZE DIRECTORY BUFFER BLOCK 00195000 CALL DMKFREE 00196000 LR R2,R1 00197000 USING UDBFBLOK,R2 00198000 XC UDBFVADD(8),UDBFVADD CLEAR LAST DBL-WD 00199000 LA R1,VMUSER POINT TO USERID 00200000 LA R0,8 ...LENGTH 00201000 CALL DMKUDRFU FIND HIS DIRECTORY 00202000 LA R1,UDIRDISP-UDIRBLOK(,R2) POINT TO 'UDIRDISP' 00203000 CALL DMKUDRMD READ NEXT BLOCK (UMACBLOK) @V407466 00204000 L R4,UMACMCOR-UMACBLOK(,R2) GET MAXIMUM CORE SIZE 00205000 DROP R2 00206000 CALL DMKUDRRV RELEASE HIS DIRECTORY 00207000 LR R1,R2 ADDRESS OF UDBFBLOK 00208000 LA R0,UDBFSIZE ITS SIZE 00209000 CALL DMKFRET GIVE IT BACK 00210000 CL R4,DEVADDR CHECK AGAINST SPECIFIED SIZE 00211000 BL EXCESIV HE WANTS TOO MUCH 00212000 SKIPDIR EQU * @V304635 00213000 SLR R2,R2 RELEASE ALL OF USERS STORAGE. @V304635 00214000 CALL DMKCFPRR RESET THE VM @V304635 00215000 OI VMQSTAT,VMINHMIG PREVET MIGRATION @V408246 00216000 CALL DMKPGSPO,PARM=UNLOCK RELEASE ALL STORAGE @V304735 00217000 L R1,VMSIZE GET OLD STORAGE SIZE @V304635 00218000 SRL R1,12 RANGE OF STORAGE SIZE. @V304635 00219000 BCTR R1,R0 MINUS 1 PAGE @V304635 00220000 CALL DMKBLDRL,PARM=DELPAGES+DELSEGS RELEASE OLD .. @V304635 00221000 L R1,DEVADDR NEW STORAGE SIZE @V304635 00222000 ST R1,VMSIZE .... @V304635 00223000 ST R1,VMSTOR SAVE MEMORY SIZE.. @V304635 00224000 SRL R1,12 RANGE FOR 'DMKBLD' @V304635 00225000 BCTR R1,R0 MINUS 1 PAGE. @V304635 00226000 LA R2,NEWSEGS+VRALOC BUILD SEGEMNTS ONLY @V408246 00227000 TM VMPSTAT,VMREAL V=R POSSIBLE ? @V408246 00228000 BZ *+8 NO, R2 ALL SET @V408246 00229000 LA R2,NEWPAGES(,R2) YES, BUILD ALL TABLES @V408246 00230000 CALL DMKBLDRT @V408246 00231000 NI VMQSTAT,255-VMINHMIG ALLOW MIGRATION @V408246 00232000 * TYPE VERIFICATION MSG IF INFO MSGS NOT SUPPRESSED BY USER 00233000 STORMSG EQU * @V2A3663 00234000 TM VMMLVL2,VMMIMSG USER WANT THE MSG? @V2A3663 00235000 BZ DEFEXIT NOPE @V2A3663 00236000 MVI SAVEWRK2,X'40' CLEAR BUFFER 00237000 MVC SAVEWRK2+1(31),SAVEWRK2 ... 00238000 MVC SAVEWRK2(8),DEFLAST "STORAGE " 00239000 MVI SAVEWRK4,C'=' ... 00240000 L R1,VMSTOR NEW CORE SIZE @VA06246 00241000 SRL R1,10(0) DIVIDE BY 1024 00242000 CALL DMKCVTBD 00243000 STC R0,SAVEWRK4+2 USE FIVE-DIGIT NUMBER 00244000 STCM R1,B'1111',SAVEWRK4+3 ... 00245000 MVI SAVEWRK5+3,C'K' ... 00246000 LA R0,SAVEWRK6-SAVEWRK2 MESSAGE LENGTH 00247000 LA R1,SAVEWRK2 MESSAGE ADDRESS @VM01072 00248000 CALL DMKQCNWT,PARM=NORET GO GIVE HIM THE MESSAGE 00249000 B DEFEXIT CLEAN UP AND BEAT IT 00250000 EJECT 00251000 DEFCHAN MVI DEFLAGS,X'00' CLEAR OUT FLAG BYTE @VM01072 00252000 CL R0,F3 ARG = 3 BYTES LONG? @VM01072 00253000 BNE INVTYPE NOPE, TOO BAD @VM01072 00254000 CLC 0(3,R1),=C'SEL' REQUEST FOR SELECTOR CHANNEL @VM01072 00255000 BNE *+8 NOPE, SKIP @VM01072 00256000 MVI DEFLAGS,VCHSEL YUP, SET FOR SELECTOR @VM01072 00257000 CLC 0(3,R1),=C'BMX' REQUEST FOR BLOCK MPX? @VM01072 00258000 BNE *+8 NO - @VA01771 00259000 MVI DEFLAGS,VCHBMX YES - FLAG AS SUCH. @VA01771 00260000 CLI DEFLAGS,X'00' WAS IT SEL OR BMX ? @VA01771 00261000 BE INVTYPE NO - SEND ERROR MESSAGE @VA01771 00262000 CALL DMKCFPRR RESET THE VIRTUAL MACHINE. @VA01771 00263000 NI VMFSTAT,X'FF'-VMFBMX TURN OFF BMX BIT @VA01771 00264000 USING VCHBLOK,R6 @VA01771 00265000 USING VCUBLOK,R7 @VA01771 00266000 CLI DEFLAGS,VCHBMX BLOCK MULTIPLEXER CHANNEL @VA01771 00267000 BNE *+8 NO @VA01771 00268000 OI VMFSTAT,VMFBMX SET UP FOR QUERY COMMAND. @VA01771 00269000 SLR R3,R3 CLEAR @VA01771 00270000 SLR R1,R1 ZERO VMCHTBL INDEX REG. @VA01771 00271000 LA R4,2 LOAD INDEX INCREMENT @VA01771 00272000 LA R5,30 LOAD INDEX COMPARAND @VA01771 00273000 DEFCH LH R6,VMCHTBL(R1) LOAD NEXT CHANNEL BLOK INDEX. @VA01771 00274000 LTR R6,R6 DOES CHANNEL EXIST. @VA01771 00275000 BM DEFXCH NO - INDEX TO NEXT ONE. @VA01771 00276000 AL R6,VMCHSTRT GET ADDRESS OF CHANNEL BLOK @VA01771 00277000 CH R3,VCHADD IS THIS CHANNEL ZERO ? @VA01771 00278000 BE DEFXCH YES - GO GET NEXT CHANNEL BLOK. @VA01771 00279000 MVC VCHTYPE,DEFLAGS SET IT PER DEFINE CMD.. @VA01771 00280000 SLR R2,R2 ZERO VCHCUTBL INDEX @VA01771 00281000 DEFCU LH R7,VCHCUTBL(R2) LOAD NEXT CU BLOK INDEX. @VA01771 00282000 LTR R7,R7 DOES CONTROL UNIT EXIST. @VA01771 00283000 BM DEFXCU NO - INDEX TO NEXT ONE. @VA01771 00284000 AL R7,VMCUSTRT POINT TO VCUBLOK @VA01771 00285000 TM VCUTYPE,VCUCTCA CHANNEL TO CHANNEL ADAPTER CU ? @VA01771 00286000 BZ DEFXCU NO - GET NEXT CONTROL UNIT @VA01771 00287000 MVI VCHTYPE,VCHSEL MARK CHANNEL AS SELECTOR. @VA01771 00288000 B DEFXCH NOW GET NEXT CHANNEL TO PROCESS. @VA01771 00289000 SPACE 1 00290000 DEFXCU BXLE R2,R4,DEFCU BR. IF MORE CU ON THIS CHANNEL. @VA01771 00291000 DEFXCH BXLE R1,R4,DEFCH BR. IF MORE CHANNELS ON THIS VM. @VA01771 00292000 TM VMMLVL2,VMMIMSG USER WANT THE MSG?? @V2A3663 00293000 BZ CHXIT NO @V2A3663 00294000 MVC SAVEWRK2(14),=C'CHANNELS = BMX' ASSUME BMX @V2A3663 00295000 TM VMFSTAT,VMFBMX ARE THEY BLOCK MULTIPLEXER ? @VA01771 00296000 BO *+10 YES - PUT OUT RESPONSE @VA01771 00297000 MVC SAVEWRK2+11(3),=C'SEL' NO - CHANGE TO SELECTOR @VA01771 00298000 LA R0,14 MESSAGE LENGTH @VA01771 00299000 LA R1,SAVEWRK2 SET BUFFER ADDRESS @VA01771 00300000 CALL DMKQCNWT,PARM=NORET @VA01771 00301000 CHXIT EXIT @V2A3663 00302000 EJECT 00303000 DEFEXIT EQU * EXIT WITH NO SPECIAL SETTINGS 00304000 EXIT 00305000 EJECT 00306000 INVTYPE EQU * OPERAND MISSING OR INVALID 00307000 LA R2,026(,0) MSG= DMKDEH026E 00308000 B MSGONLY NO EXTRA DATA 00309000 INVCORE EQU * STORAGE MISSING OR INVALID 00310000 LA R2,025(,0) MSG= DMKDEH025E 00311000 B MSGONLY NO EXTRA DATA 00312000 EXCESIV EQU * STORAGE EXCEEDS ALLOWED MAXIMUM 00313000 LA R2,094(,0) MSG= DMKDEH094E 00314000 SPACE 00315000 MSGONLY EQU * MSG WITHOUT VARIABLE FIELDS 00316000 SLR R0,R0 00317000 SLR R1,R1 00318000 B *+8 SKIP OVER 'LA' FOR R1 00319000 MSGSEND EQU * SEND ERROR MESSAGE 00320000 LA R1,SAVEWRK2 VARIABLE DATA LOCATION 00321000 MSGIDBLD EQU * BUILD MOD ID FOR MSG @V60B6B8 00322000 ICM R0,B'1110',DMKDEH+3 MODULE IDENTIFIER 00323000 CALL DMKERMSG BUILD + TYPE ERROR MESSAGE 00324000 * "DMKERMSG" WILL NOT RETURN 00325000 SPACE 2 00326000 * BITS DEFINED FOR CALL TO DMKPGS 00327000 UNLOCK EQU X'02' UNLOCK ANY 'LOCKED' PAGES @V304735 00328000 SPACE 2 00329000 DEFLAST DC C'STORAGE ' 00330000 DEFENTS EQU *-DEFLAST LENGTH OF ONE ENTRY 00331000 EJECT 00332000 LTORG 00333000 EJECT 00334000 COPY SAVE 00335000 SPACE 00336000 * FIELDS DEFINED WITHIN THE SAVEAREA : 00337000 * 00338000 DEFLAGS EQU SAVEWRK1 INTERNAL FLAGS FOR 'DEFINE' 00339000 DEVADDR EQU SAVEWRK2 DEVICE ADDRESS FOR RE-DEFINE 00340000 * EQUATES DEFINING FIELDS WITHIN THE SAVE AREA 00341000 ************************************************************ 00342000 FIRSTADR EQU SAVEWRK2 @V60B6B8 00343000 LASTADDR EQU SAVEWRK3 @V60B6B8 00344000 CURRADDR EQU SAVEWRK4 @V60B6B8 00345000 FIRSTBUF EQU SAVEWRK5 @V60B6B8 00346000 CURRBUFF EQU SAVEWRK6 @V60B6B8 00347000 RDEVADR1 EQU SAVEWRK7 @V60B6B8 00348000 ADDR2 EQU SAVEWRK8 @V60B6B8 00349000 SPACE 00350000 ************************************************************ 00351000 EJECT 00352000 * 00353000 EJECT 00354000 COPY VMBLOK 00355000 COPY VBLOKS 00356000 COPY RBLOKS 00357000 COPY IOBLOKS 00358000 COPY UDIRECT 00359000 COPY DEVTYPES 00360000 COPY EQU 00361000 PSA 00362000 END DMKDEH 00363000