SNC TITLE 'DMKSNC (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 VALIDATE SERIALIZATION OF INPUT @V200899 00002000
*. 00003000
* MODULE NAME - 00004000
* 00005000
* DMKSNC - SAVE 370X CONTROL PROGRAM IMAGE 00006000
* (DIAGNOSE CODE X'0050' FROM DMKHVCAL) 00007000
* 00008000
* ATTRIBUTES - 00009000
* 00010000
* RE-ENTRANT, PAGEABLE, CALLED VIA SVC 00011000
* 00012000
* ENTRY CONDITIONS - 00013000
* 00014000
* GPR5 = ADDRESS OF SAVEAREA FIELD CONTAINING 'R1' 00015000
* OF DIAGNOSE (VADDR OF CCPARM) 00016000
* GPR6 = ADDRESS OF SAVEAREA FIELD CONTAINING 'R2' 00017000
* OF DIAGNOSE (FOR RETURN CODE) 00018000
* GPR11 = ADDRESS OF CALLER'S VMBLOK 00019000
* GPR12 = ADDRESS OF ENTRY POINT 00020000
* GPR13 = ADDRESS OF SAVEAREA 00021000
* 00022000
* EXIT CONDITIONS - 00023000
* 00024000
* NORMAL - 00025000
* 'R2' FIELD = 0 00026000
* 00027000
* ERROR - 00028000
* 'R2' FIELD = ERROR RETURN CODE NUMBER 00029000
* 00030000
* CALLS TO OTHER ROUTINES - 00031000
* 00032000
* DMKQCNWT - TO WRITE MESSAGE TO CONSOLE 00033000
* DMKPTRUL - TO UNLOCK A PAGE 00034000
* DMKSCNVS - TO FIND A VOLUME 00035000
* DMKRPAPT - TO WRITE A PAGE ON BACKING DEVICE 00036000
* DMKCVTBH - TO CONVERT BINARY TO HEX 00037000
* DMKPTRAN - LOCATE AND FETCH A PAGE OF VIRTUAL STORAGE 00038000
* DMKERMSG - TO SEND ERROR MESSAGES TO TERMINAL 00039000
* 00040000
* EXTERNAL REFERENCES - 00041000
* 00042000
* TABLES / WORKAREAS - 00043000
* 00044000
* DMKRNTBL - NCP NAME TABLE 00045000
* 00046000
* REGISTER USAGE - 00047000
* 00048000
* GPR3 = CCPARM BASE 00049000
* GPR4 = NCPTBL BASE 00050000
* GPR8 = RDEVBLOK BASE 00051000
* GPR11 = VMBLOK BASE 00052000
* GPR12 = MODULE BASE 00053000
* GPR13 = SAVEAREA BASE 00054000
* GPR14 = EXTERNAL LINKAGE 00055000
* GPR15 = EXTERNAL LINKAGE 00056000
*. 00057000
EJECT 00058000
COPY OPTIONS @V200899 00059000
COPY LOCAL @V200899 00060000
SPACE 3 00061000
DMKSNC START 0 @V200899 00062000
SPACE 00063000
MODID DC CL8'DMKSNC' @V200899 00064000
SPACE 2 00065000
USING PSA,R0 @V200899 00066000
USING VMBLOK,R11 @V200899 00067000
USING SAVEAREA,R13 @V200899 00068000
SPACE 2 00069000
EXTRN DMKPTRUL @V200899 00070000
EXTRN DMKRNTBL @V200899 00071000
EXTRN DMKSCNVS @V200899 00072000
EXTRN DMKRPAPT @V200899 00073000
EXTRN DMKERMSG @V200899 00074000
EJECT 00075000
*. 00076000
* SUBROUTINE NAME - 00077000
* 00078000
* DMKSNCP - SAVE 370X CONTROL PROGRAM IMAGE 00079000
* 00080000
* FUNCTION - 00081000
* 00082000
* TO SAVE A PAGE FORM VERSION OF A NETWORK CONTROL PROGRAM 00083000
* THE NAME OF THE NCP AND THE DASD LOCATION AT WHICH IT IS TO BE 00084000
* SAVED IS DEFINED IN THE CP MODULE DMKSYS 00085000
* 00086000
* OPERATION - 00087000
* 00088000
* 1. TRANS IN AND LOCK THE NCPTBL. 00089000
* 2. TRANS IN USER PAGE CONTAINING CCPARM. 00090000
* 3. SCAN THE NCPTBL TO FIND THE ENTRY WITH AN 'NCPNAME' THAT 00091000
* MATCHES THE ENTRY FOR THE SPECIFIED 'CCPNAME'. IF NONE IS 00092000
* FOUND CALL DMKERMSG TO SEND ERROR MESSAGE DMKSNC044E. 00093000
* 4. DETERMINE IF DASD STORAGE SPACE IS LARGE ENOUGH TO 00094000
* CONTAIN THE SAVED IMAGE AND RESOURCE DATA. IF NOT, 00095000
* CALL DMKERMSG TO SEND DMKSNC178E MESSAGE. 00096000
* 5. CALL DMKSCNVS TO FIND THE VOLUME THAT IS TO CONTAIN THE 00097000
* SAVED NCP. IF NOT FOUND, CALL DMKERMSG TO SEND ERROR 00098000
* MESSAGE DMKSNC171E. 00099000
* 6. DETERMINE STARTING DASD LOCATION AND NUMBER OF PAGES / CYL 00100000
* FOR NCPVOL DEVICE FROM NCPTBL DATA. 00101000
* 7. SET UP GROUP OF RESOURCE PAGES (SPECIFIED IN THE CCPARM) 00102000
* TO BE SAVED. 00103000
* 8. TRANS IN THE NEXT PAGE TO BE SAVED. CALL DMKRPAPT TO 00104000
* WRITE THE PAGE TO THE NCPVOL. IF AN I/O ERROR OCCURS, CALL 00105000
* DMKERMSG TO SEND DMKSNC435E MESSAGE. 00106000
* 9. IF ALL THE PAGES IN THIS GROUP HAVE BEEN PROCESSED, GO TO 00107000
* STEP 10. ELSE - BUMP TO THE NEXT PAGE AND GO BACK TO 00108000
* STEP 8. 00109000
* 10. SET UP GROUP OF NCP CORE IMAGE PAGES (SPECIFIED IN THE 00110000
* CCPARM) TO BE SAVED. 00111000
* 11. TRANS IN THE NEXT PAGE TO BE SAVED. CALL DMKRPAPT TO 00112000
* WRITE THE PAGE TO THE NCPVOL. IF AN I/O ERROR OCCURS, CALL 00113000
* DMKERMSG TO SEND MESSAGE DMKSNC435E. 00114000
* 12. IF ALL THE PAGES IN THIS GROUP HAVE BEEN PROCESSED, GO TO 00115000
* STEP 13. ELSE - BUMP TO THE NEXT PAGE AND GO BACK TO 00116000
* STEP 11. 00117000
* 13. CALL DMKPTRUL TO UNLOCK THE NCPTBL. 00118000
* 14. SET RETURN CODE AND EXIT TO CALLER. 00119000
* 00120000
* ERROR MESSAGES - 00121000
* 00122000
* DMKSNC044E SYSTEM (NAME) DOES NOT EXIST 00123000
* DMKSNC171E SYSTEM (NAME) VOLID (VOLID) NOT MOUNTED 00124000
* DMKSNC178E SYSTEM (NAME) EXCEEDS AVAILABLE DASD SPACE 00125000
* DMKSNC179E SYSTEM (NAME) VOLID (VOLID) NOT CP-OWNED 00126000
* DMKSNC435E PAGING ERROR WRITING SAVED SYSTEM 00127000
*. 00128000
EJECT 00129000
DMKSNCP RELOC @V200899 00130000
L R1,0(R5) LOAD VADDR OF CCPARM TO R1 @V200899 00131000
ST R1,SAVEWRK1 SAVE VADDR OF RESOURCE DATA START@V200899 00132000
L R1,=A(DMKRNTBL) LOAD ADDRESS OF NCPTBL @V200899 00133000
LTR R1,R1 ANY NAMENCP MACROS AT ALL ? @V200820 00134000
BNP NSV044A NO -- SYSTEM DOES NOT EXIST @V200820 00135000
TRANS 2,1,OPT=(BRING,DEFER,LOCK,SYSTEM) @V200899 00136000
ST R2,SAVEWRK3 SAVE RADDR OF NCPTBL FOR UNLOCK @V200899 00137000
LR R4,R2 ADDRESS OF NCPTABLE TO R4 @V200899 00138000
USING NCPTBL,R4 @V200899 00139000
L R1,SAVEWRK1 VADDR OF CCPARM TO R1 @V200899 00140000
LA R0,4095 CHECK FOR PAGE ALIGNMENT @V200820 00141000
NR R0,R1 START ON A PAGE BOUNDARY ? @V200820 00142000
BNZ REFSPEC NO -- SPECIFICATION EXCEPTION @V200820 00143000
TRANS 2,1,OPT=(BRING,DEFER),ADEX=REFADDR GET PAGE @V200820*00144000
CONTAINING CCPARM @V200899 00145000
LR R3,R2 REAL ADDR TO WORK REG @V200899 00146000
USING CCPARM,R3 @V200899 00147000
L R2,CCPADDR LOAD STARTING ADDRESS OF NCP @V200899 00148000
ST R2,SAVEWRK9 AND PUT AWAY FOR USE LATER @V200899 00149000
LRA R0,0(,R2) IS THIS A VALID ADDR. @V304635 00150000
BC 8+2,SNCP1 CONTINUE IF IT'S NOT A SEG @V408246 00151100
* EXCEPTION 00151200
LR R1,R2 VIRT ADDR TO R1 FOR CALL TO PTR @V408246 00151300
CALL DMKPTRAN,PARM=DEFER OTHERWISE LET PTRAN HANDLE @V408246 00151400
BC 2,REFADDR ADDRESSING ERROR @V408246 00151500
LR R2,R1 RESTORE R2 @V408246 00151600
SNCP1 DS 0H @V408246 00151700
LA R0,4095 CHECK FOR PAGE-ALIGNMENT @V200820 00152000
NR R0,R2 START ON A PAGE BOUNDARY ? @V200820 00153000
BNZ REFSPEC NO -- SPECIFICATION EXCEPTION @V200820 00154000
MVC SAVEWRK6(8),CCPNAME SAVE NCPNAME IN CASE NEEDED @V200899*00155000
FOR ERROR MESSAGE @V200899 00156000
NAMECHEK CLC NCPNAME(8),CCPNAME IS THIS CORRECT ENTRY @V200899 00157000
BE SIZECHK BRANCH IF YES @V200899 00158000
L R5,NCPPNT LOAD DISPLACEMENT TO NEXT ENTRY @V200899 00159000
AR R4,R5 ADDRESS OF NEXT ENTRY TO R4 @V200899 00160000
LTR R5,R5 LAST ENTRY ??? @V200899 00161000
BNZ NAMECHEK BRANCH IF NOT @V200899 00162000
B NSV044 INVALID NAME @V200899 00163000
SPACE 00164000
SIZECHK EQU * @V200899 00165000
SR R2,R2 ZERO R2 FOR USE AS ACCUM REG @V200899 00166000
ICM R1,15,CCPSIZE NCP STORAGE SIZE @VA03320 00167000
BZ REFSPEC ERROR IF ZERO @VA03320 00168000
LA R1,4095(R1) BUMP BY PAGE SIZE - 1 FOR ANY @V200899 00169000
* OVERFLOW 00170000
SRL R1,12 DIVIDE BY 4096 FOR NUM. OF PAGES @V200899 00171000
ST R1,SAVEWRK4 SAVE NUM. OF PAGES OF NCP CORE @V200899 00172000
AR R2,R1 ADD RESULT IN R2 @V200899 00173000
ICM R1,15,CCPPSIZE CCPARM SIZE @VA03320 00174000
BZ REFSPEC ERROR IF ZERO @VA03320 00175000
LA R1,4095(R1) BUMP TO TAKE CARE OF ANY OVERFLOW@V200899 00176000
SRL R1,12 DIVIDE BY 4096 @V200899 00177000
ST R1,SAVEWRK5 SAVE NUM. OF RESOURCE DATA PAGES @V200899 00178000
AR R2,R1 ADD THIS TO R2 FOR TOTAL NUMBER @V200899 00179000
* OF PAGES TO BE SAVED 00180000
CLR R2,R1 WRAP AROUND? @VA03320 00181000
BNH REFSPEC MAYBE - ERROR ANYWAY @VA03320 00182000
CL R2,NCPPAGCT WILL THE NCP FIT IN DASD SLOT @V200899 00183000
BH NSV178 NOPE !!!! @V200899 00184000
SPACE 00185000
LA R0,6 VOL SER LENGTH @V200899 00186000
LA R1,NCPVOL NOW LET US SEE IF RIGHT NCPVOL @V200899 00187000
* SPECIFIED 00188000
CALL DMKSCNVS ... @V200899 00189000
BNZ NSV171 CAN'T SAVE SYSTEM WITHOUT A DISK @V200820 00190000
SPACE 00191000
LR R8,R1 RDEVBLOK TO R8 @V200899 00192000
USING RDEVBLOK,R8 @V200899 00193000
TM RDEVFLAG,RDEVOWN OWNED VOLUME ???? @V200899 00194000
BZ NSV179 ALMOST MADE IT- NOT CP-OWNED @V200820 00195000
LA R0,32 MAXIMUM PAGES/CYL ON 2314 @V200899 00196000
TM RDEVTYPE,TYP2314 IS THIS A 2314 ???? @V200899 00197000
BO STOMAXPG YES ----- @V200899 00198000
LA R0,120 MUST BE 3350 @V304498 00199000
CLI RDEVTYPE,TYP3350 IS THIS A 3350 ???? @V304498 00200000
BE STOMAXPG YES ---- @V304498 00201000
LA R0,96 Must be a 3375 HRC106DK 00201100
CLI RDEVTYPE,TYP3375 Is this a 3375 ???? HRC106DK 00201200
BO STOMAXPG Yes ----- HRC106DK 00201300
LA R0,150 Must be a 3380 HRC106DK 00201400
CLI RDEVTYPE,TYP3380 Is this a 3380 ???? HRC106DK 00201500
BO STOMAXPG Yes ----- HRC106DK 00201600
LA R0,57 TRY 3330 @V200899 00202000
TM RDEVTYPE,TYP3330 IS IT ???? @V200899 00203000
BO STOMAXPG YES ---- @V200899 00204000
LA R0,24 MUST BE 3340 OR 2305 @V2A2029 00205000
SPACE 00206000
STOMAXPG SLL R0,8 SHIFT UP EIGHT @V200899 00207000
ST R0,SAVEWRK2 SAVE FOR LATER USE @V200899 00208000
L R5,NCPSTART LOAD CCPD FROM SYSTABLE @V200899 00209000
IC R5,RDEVCODE+1 INSERT DEVICE CODE @V200899 00210000
SPACE 00211000
BAL R10,NCPTUNLK UNLOCK DMKRNTBL @V200899 00212000
DROP R8 @V200899 00213000
SPACE 00214000
L R10,F4096 LOAD CONSTANT FOR BUMPING PAGES @V200899 00215000
L R7,F256 LOAD CONSTANT FOR BUMPING CCPD @V200899 00216000
SVRESDAT EQU * @V200899 00217000
L R8,SAVEWRK1 PICK UP VADDR OF RESOURCE DATA @V200899 00218000
L R9,SAVEWRK5 NUMBER OF RESOURCE DATA PAGES @V200820 00219000
BAL R6,SAVELOOP GO TO SAVE SUBROUTINE @V200899 00220000
SVNCPIM EQU * @V200899 00221000
L R8,SAVEWRK9 PICK UP STARTING VADDR OF NCP @V200899 00222000
L R9,SAVEWRK4 PICK UP NUM. OF PAGES IN NCP @V200899 00223000
BAL R6,SAVELOOP GO TO SAVE SUBROUTINE @V200899 00224000
SAVEFINI EQU * @V200899 00225000
SR R2,R2 SET ZERO RETURN CODE @V200899 00226000
L R6,SAVER6 LOAD USER RET REG PTR @V200899 00227000
ST R2,0(,R6) PASS RET CODE TO USER @V200899 00228000
B SNCEXIT SET RETURN CODE FOR DMKHVC @V200820 00229000
SPACE 2 00230000
REFADDR EQU * REFLECT VIRTUAL ADDRESS EXCEPTION@V200820 00231000
BAL R10,NCPTUNLK UNLOCK NCPTBL @V200820 00232000
REFADDR2 EQU * NCPTBL ALREADY UNLOCKED 00232500
LA R2,X'005' INTERRUPT CODE FOR ADDR ERROR @V200820 00233000
ST R2,SAVER0 PASS PROGRAM INTRPT CODE IN GR0 @V200820 00234000
B SNCEXIT . . .AND SET GR2 NON-ZERO FOR HVC@V200820 00235000
SPACE 00236000
REFSPEC EQU * SPECIFICATION ERROR IN DIAGNOSE @V200820 00237000
BAL R10,NCPTUNLK UNLOCK NCPTBL @V200820 00238000
LA R2,X'006' INTERRUPT CODE FOR SPEC ERROR @V200820 00239000
ST R2,SAVER0 PASS CODE IN GR0 FOR DMKHVC @V200820 00240000
* B SNCEXIT SET GR2 NON-ZERO FOR INTERRUPT @V200820 00241000
SPACE 00242000
SNCEXIT EQU * SET RETURN CODE FOR DMKHVC @V200820 00243000
ST R2,SAVER2 ZERO = O.K., OTHERWISE => INTRPT @V200820 00244000
EXIT , RETURN @V200820 00245000
EJECT 00246000
*---------------------------------------------------------------------* 00247000
* REGISTER USAGE DURING SAVE LOOP * 00248000
* R5 - CCPD OF CURRENT PAGE ON NCPVOL. * 00249000
* R6 - LINKAGE REGISTER * 00250000
* R7 - CONSTANT USED TO INCREMENT CCPD IN R5. * 00251000
* R8 - CURRENT PAGE ADDRESS. * 00252000
* R10 - CONSTANT USED TO INCREMENT ADDRESS IN R8. * 00253000
*---------------------------------------------------------------------* 00254000
SPACE 00255000
SAVELOOP EQU * @V200899 00256000
LCTL C1,C1,VMSEG GET SEGMENT TABLE ORIGIN @VA04871 00256500
LRA R0,0(,R8) MAKE SURE ADDRESS IS VALID @V304635 00257000
BC 8+2,SAVELP1 CONTINUE IF IT'S NOT A SEG @V408246 00258100
* EXCEPTION 00258200
LR R1,R8 VIRT ADDR TO R1 FOR CALL TO PTR @V408246 00258300
CALL DMKPTRAN,PARM=DEFER OTHERWISE LET PTRAN HANDLE @V408246 00258400
BC 2,REFADDR2 ADDRESSING ERROR @V408246 00258500
SAVELP1 DS 0H @V408246 00258600
LR R1,R8 LOAD ADDRESS @V200899 00259000
LR R0,R5 LOAD CCPD @V200899 00260000
CALL DMKRPAPT,PARM=IOERETN WRITE PAGE OUT TO NCPVOL @V200899 00261000
BNZ NSV435 GET OUT ON ERROR FROM WRITE @V200899 00262000
AR R5,R7 BUMP CCPD TO NEXT DASD PAGE @V200899 00263000
LR R1,R5 CCPD TO R1 @V200899 00264000
N R1,=X'0000FF00' SAVE PAGE NUMBER @V200899 00265000
CL R1,SAVEWRK2 CHECK IT AGAINST MAXIMUM PER CYL @V200899 00266000
BNH PAGBUMP BRANCH IF STILL ON SAME CYLINDER @V200899 00267000
A R5,=X'00010000' ADD ONE TO 'CC' @V200899 00268000
ICM R5,2,F1+3 RESET 'P' TO ONE @V200899 00269000
SPACE 00270000
PAGBUMP EQU * . . . @V200899 00271000
AR R8,R10 BUMP PAGE @V200899 00272000
BCT R9,SAVELOOP BRANCH IF MORE PAGES TO SAVE @V200899 00273000
BR R6 RETURN TO CALLER @V200899 00274000
SPACE 3 00275000
VOLDERR EQU * BUILD PARM STRING FOR DMKERMSG @V200820 00276000
MVC SAVEWRK8+1(6),NCPVOL VOL SER FOR ERR MSG @V200899 00277000
MVI SAVEWRK8,X'00' INSERT SEPARATER @V200899 00278000
LA R0,15 LENGTH OF FIELDS @V200899 00279000
LA R1,SAVEWRK6 ADDRESS OF FIELDS @V200899 00280000
BR R10 RETURN @V200820 00281000
SPACE 2 00282000
NCPTUNLK L R2,SAVEWRK3 LOAD ADDRESS OF NCPTBL @V200899 00283000
CALL DMKPTRUL UNLOCK IT @V200899 00284000
BR R10 RETURN @V200899 00285000
EJECT 00286000
NSV044 EQU * SYSTEM NAME DOES NOT EXIST @V200820 00287000
BAL R10,NCPTUNLK GO GET RID OF NCPTBL @V200899 00288000
NSV044A EQU * SYSTEM NAME TABLE DOES NOT EXIST @V200820 00289000
LA R0,8 FIELD LENGTH @V200899 00290000
LA R1,SAVEWRK6 FIELD ADDRESS @V200899 00291000
LA R2,44 ERROR CODE @V200899 00292000
B CALLERM ..... @V200899 00293000
SPACE 00294000
NSV178 BAL R10,NCPTUNLK UNLOCK NCPTBL PAGE @V200899 00295000
LA R0,8 COUNT TO R0 @V200899 00296000
LA R1,SAVEWRK6 ADDRESS OF PARMS TO R1 @V200899 00297000
LA R2,178 ERROR CODE @V200899 00298000
B CALLERM ..... @V200899 00299000
SPACE 00300000
NSV179 EQU * SYSTEM NAME VOLID NOT CP-OWNED @V200820 00301000
BAL R10,VOLDERR BUILD STRING FOR DMKERMSG @V200820 00302000
BAL R10,NCPTUNLK UNLOCK NCPTBL @V200820 00303000
LA R2,179 ERROR CODE @V200820 00304000
B CALLERM SEND THE MESSAGE @V200820 00305000
SPACE 00306000
NSV171 EQU * SYSTEM NAME VOLID NOT MOUNTED @V200820 00307000
BAL R10,VOLDERR BUILD STRING FOR DMKERMSG @V200820 00308000
BAL R10,NCPTUNLK UNLOCK NCPTBL @V200899 00309000
LA R2,171 ERROR CODE @V200899 00310000
B CALLERM @V200899 00311000
SPACE 00312000
NSV435 EQU * @V200899 00313000
LA R2,435 ERROR CODE @V200899 00314000
SPACE 3 00315000
SLR R1,R1 ZIP THE PARM REG @V200899 00316000
SLR R0,R0 ...AND THE LENGTH REG @V200899 00317000
CALLERM ICM R0,14,MODID+3 INSERT THE MODULE INDENT. @V200899 00318000
L R6,SAVER6 LOAD RET REG ADDR PTR @V200899 00319000
ST R2,0(R6) SET RETURN CODE @V200899 00320000
ICM R2,8+4,=X'8000' RETURN HERE AFTER MSG @V200820 00321000
CALL DMKERMSG SEND THE MESSAGE @V200899 00322000
SR R2,R2 SET RETURN CODE ZERO (NO INTRPT) @V200820 00323000
B SNCEXIT RETURN TO DMKHVCAL @V200820 00324000
SPACE 3 00325000
LTORG @V200899 00326000
EJECT 00327000
COPY CCPARM @V200899 00328000
COPY NCPTBL @V200899 00329000
PSA @V200899 00330000
COPY EQU @V200899 00331000
COPY VMBLOK @V200899 00332000
COPY RBLOKS @V200899 00333000
COPY SAVE @V200899 00334000
COPY DEVTYPES @V200899 00335000
END DMKSNC @V200820 00336000