TDK TITLE 'DMKTDK (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 00002000
*. 00003000
* MODULE NAME - 00004000
* 00005000
* DMKTDK 00006000
* 00007000
* CONTENTS - 00008000
* 00009000
* DMKTDKGT - OBTAIN TDISK SPACE 00010000
* DMKTDKRL - RELEASE TDISK SPACE 00011000
* 00012000
EJECT 00013000
* SUBROUTINE NAME - 00014000
* 00015000
* DMKTDKGT 00016000
* 00017000
* FUNCTION - 00018000
* 00019000
* TO ALLOCATE CYLINDERS OF TDISK SPACE FROM CP OWNED VOLUMES 00020000
* 00021000
* ATTRIBUTES - 00022000
* 00023000
* REENTRANT, PAGEABLE, CALLED VIA SVC 00024000
* 00025000
* ENTRY POINTS - 00026000
* 00027000
* DMKTDKGT 00028000
* 00029000
* ENTRY CONDITIONS - 00030000
* 00031000
* GPR0 = NUMBER OF CYLINDERS REQUIRED 00032000
* GPR1 = DEVICE TYPE REQUIRED 00033000
* GPR12 = ADDRESS OF DMKTDKGT 00034000
* GPR13 = ADDRESS OF SAVEAREA 00035000
* 00036000
* EXIT CONDITIONS - 00037000
* 00038000
* NORMAL - 00039000
* GPR1 = CYLINDER NUMBER OF 1ST CYLINDER ALLOCATED 00040000
* GPR8 = ADDRESS OF RDEVBLOK CONTAINING VOLUME 00041000
* 00042000
* ERROR - 00043000
* GPR8 = 0 - NO SPACE AVAILABLE 00044000
* 00045000
* CALLS TO OTHER ROUTINES - 00046000
* 00047000
* DMKIOSQR 00048000
* 00049000
* EXTERNAL REFERENCES - 00050000
* 00051000
* CHAIN ANCHORS FOR DEVICES WITH OWNED VOLUMES MOUNTED. 00052000
* DMKPGTP5,DMKPGT5P,DMKPGTP0,DMKPGT4P,DMKPGTP4 00053000
* DMKPGTT5,DMKPGT5T,DMKPGTT0,DMKPGT4T,DMKPGTT4 00054000
* 00055000
* TABLES / WORKAREAS - 00056000
* 00057000
* ALOCBLOK 00058000
* 00059000
EJECT 00060000
* REGISTER USAGE - 00061000
* 00062000
* GPR0-4 - SCRATCH 00063000
* GPR5 = OWNED VOLUME DEVICE LIST ANCHOR 00064000
* GPR6 = ALOCBLOK BASE 00065000
* GPR7 = ALOCMAP CYLINDER POINTER 00066000
* GPR8 = RDEVBLOK BASE 00067000
* GPR9-11 - NOT USED 00068000
* GPR12 = DMKTDK BASE 00069000
* GPR13 = SAVEAREA BASE 00070000
* GPR14 = INCREMENT REGISTER FOR BXLE (=1) 00071000
* GPR15 = COMPARAND REGISTER FOR BXLE 00072000
* 00073000
* NOTES - 00074000
* 00075000
* NONE 00076000
* 00077000
* OPERATION - 00078000
* 00079000
* 1. LOCATE AN RDEVBLOK FOR A DEVICE CONTAINING A VOLUME OF 00080000
* THE DESIRED TYPE; IF NONE CAN BE FOUND RETURN A VALUE OF 00081000
* ZERO IN GPR8 AND EXIT 00082000
* 2. LOCATE AN ALOCBLOK FOR TDISK SPACE ON THE ALLOCATION CHAIN 00083000
* FROM THE RDEVBLOK; IF NONE CAN BE FOUND GO TO STEP 1; 00084000
* OTHERWISE, CONTINUE 00085000
* 3. LOCATE AN UNALLOCATED CYLINDER ON THE ALLOCATION MAP AND 00086000
* VERIFY THAT ENOUGH CONTIGUOUS CYLINDERS EXIST TO SATISFY 00087000
* THE REQUEST; IF ENOUGH CYLINDERS ARE NOT AVAILABLE GO TO 00088000
* STEP 2; OTHERWISE, CONTINUE 00089000
* 4. MARK THE CYLINDERS ALLOCATED IN THE ALLOCATION MAP AND 00090000
* ERASE TRACK ZERO OF THIS EXTENT TO ZEROES. RETURN THE 00091000
* ADDRESS OF THE FIRST CYLINDER ALLOCATED TO THE CALLER 00092000
* IN GPR1 AND THE ADDRESS OF THE RDEVBLOK IN GPR8; THEN, 00093000
* EXIT TO THE CALLER. 00094000
*. 00095000
EJECT 00096000
COPY OPTIONS 00097000
COPY LOCAL OPTIONS 00098000
EJECT 00099000
DMKTDK CSECT 00100000
SPACE 3 00101000
EXTRN DMKPGTT5 2305 OWNED VOLUME ANCHOR 00102000
EXTRN DMKPGT5T 3350 OWNED VOLUME ANCHOR @V304498 00103000
EXTRN DMKPGT7T 3375 owned volume anchor HRC106DK 00103100
EXTRN DMKPGT8T 3380 owned volume anchor HRC106DK 00103200
EXTRN DMKPGTT0 3330 OWNED VOLUME ANCHOR 00104000
EXTRN DMKPGT4T 3340 OWNED VOLUME ANCHOR @V2A2029 00105000
EXTRN DMKPGTT4 2314 OWNED VOLUME ANCHOR 00106000
EXTRN DMKPGTP5 2305 OWNED VOLUME ANCHOR (PREF) 00107000
EXTRN DMKPGT5P 3350 OWNED VOLUME ANCHOR (PREF) @V304498 00108000
EXTRN DMKPGT7P 3375 owned volume anchor (pref) HRC106DK 00108100
EXTRN DMKPGT8P 3380 owned volume anchor (pref) HRC106DK 00108200
EXTRN DMKPGTP0 3330 OWNED VOLUME ANCHOR (PREF) 00109000
EXTRN DMKPGT4P 3340 OWNED VOLUME ANCHOR (PREF) @V2A2029 00110000
EXTRN DMKPGTP4 2314 OWNED VOLUME ANCHOR (PREF) 00111000
EXTRN DMKIOSQR 00112000
SPACE 00113000
USING PSA,R0 00114000
USING ALOCBLOK,R6 00115000
USING RDEVBLOK,R8 00116000
USING SAVEAREA,R13 00117000
SPACE 2 00118000
USING *,R12 00119000
EJECT 00120000
ID DC CL8'DMKTDK' MODULE NAME 00121000
SPACE 2 00122000
DMKTDKGT RELOC 00123000
LA R14,1 ESTABLISH INCREMENT REGISTER FOR BXLE 00124000
C R1,=A(TYP3340) 3340 TYPE OF DASD SPACE NEEDED ? @V2A2029 00125000
BE TYPE3340 YES - BRANCH @V2A2029 00126000
C R1,=A(TYP3350) 3350 TYPE OF DASD SPACE NEEDED ? @V304498 00127000
BE TYPE3350 YES - BRANCH @V304498 00128000
C R1,=A(TYP3375) 3375 type of dasd space needed ? HRC106DK 00128100
BE TYPE3375 Yes - branch HRC106DK 00128200
C R1,=A(TYP3380) 3380 type of dasd space needed ? HRC106DK 00128300
BE TYPE3380 Yes - branch HRC106DK 00128400
C R1,=A(TYP3330) TEST FOR TYPE OF DASD SPACE NEEDED 00129000
BH TYPE2314 MUST BE 2314 00130000
BL TYPE2305 OR IF LOW, MUST BE 2305 00131000
L R5,=A(DMKPGTT0) 3330 - GET LIST ANCHOR 00132000
L R2,=A(DMKPGTP0) GET LIST ANCHOR FOR PREF. VOLUMES 00133000
B GETDEVIC AND GO FIND A DEVICE 00134000
SPACE 00135000
TYPE3350 L R5,=A(DMKPGT5T) GET LIST ANCHOR FOR 3350 @V304498 00136000
L R2,=A(DMKPGT5P) GET LIST ANCHOR FOR PREF. VOL'S @V304498 00137000
B GETDEVIC AND REJOIN BELOW @V304498 00138000
SPACE 00139000
TYPE3375 L R5,=A(DMKPGT7T) Get list anchor for 3375 HRC106DK 00139100
L R2,=A(DMKPGT7P) Get list anchor for pref. vol's HRC106DK 00139200
B GETDEVIC and rejoin below HRC106DK 00139300
SPACE 1 HRC106DK 00139400
TYPE3380 L R5,=A(DMKPGT8T) Get list anchor for 3380 HRC106DK 00139500
L R2,=A(DMKPGT8P) Get list anchor for pref. vol's HRC106DK 00139600
B GETDEVIC and rejoin below HRC106DK 00139700
SPACE 1 HRC106DK 00139800
TYPE2314 L R5,=A(DMKPGTT4) GET LIST ANCHOR FOR 2314 00140000
L R2,=A(DMKPGTP4) GET LIST ANCHOR FOR PREF. VOLUMES 00141000
B GETDEVIC AND REJOIN BELOW 00142000
SPACE 00143000
TYPE3340 L R5,=A(DMKPGT4T) GET LIST ANCHOR FOR 3340 @V2A2029 00144000
L R2,=A(DMKPGT4P) GET LIST ANCHOR FOR PREF. @V2A2029 00145000
* VOLUMES 00146000
B GETDEVIC AND REJOIN BELOW @V2A2029 00147000
SPACE 00148000
TYPE2305 L R5,=A(DMKPGTT5) GET LIST ANCHOR FOR 2305 00149000
L R2,=A(DMKPGTP5) GET LIST ANCHOR FOR PREF. VOLUMES 00150000
SPACE 00151000
GETDEVIC L R8,0(,R5) GET NEXT DEVICE ON LIST 00152000
LTR R8,R8 IS THE LIST EMPTY ?? 00153000
BZ CKPREF NO - GO SEE IF THERE IS ANOTHER LIST 00154000
SPACE 00155000
GETALLN1 LA R6,RDEVALLN POINT TO ALOCBLOK LIST ANCHOR 00156000
SPACE 00157000
GETALLN2 L R6,ALOCPNT POINT TO NEXT ALOCBLOK ON LIST 00158000
LTR R6,R6 LOOK FOR A TDISK BLOK 00159000
BP GETALLN2 STILL CHAINING PAGING BLOKS 00160000
BM GETMAP FOUND ONE -- 00161000
SPACE 00162000
L R8,RDEVPNT POINT TO NEXT DEVICE ON LIST 00163000
C R8,0(,R5) BACK TO START ?? 00164000
BNE GETALLN1 NO -- LOOK FOR SPACE ON THIS DEVICE -- 00165000
SPACE 00166000
CKPREF EQU * TEST FOR ADDITIONAL DEVICE LIST TO PROCESS 00167000
CLR R5,R2 PROCESSING THE PREFERRED LIST ? 00168000
BE NOTSPACE YES -- NO TDISK SPACE AVAILABLE 00169000
LR R5,R2 POINT TO PREFERRED LIST ANCHOR 00170000
B GETDEVIC AND CONTINUE 00171000
SPACE 00172000
NOTSPACE EQU * HERE IF NO SPACE AVAILABLE 00173000
SLR R8,R8 INDICATE NO DEVICE TO CALLER 00174000
B SETDEVIC INDICATE SO TO CALLER 00175000
EJECT 00176000
GETMAP EQU * FIND SOME UNALLOCATED CYLINDERS 00177000
LH R1,ALOCCYL2 GET LAST CYLINDER ON THIS BLOK 00178000
SH R1,ALOCCYL1 GET NUMBER OF CYLINDERS AVAILABLE-1 00179000
L R0,SAVER0 GET NUMBER OF CYLINDERS REQUESTED 00180000
SR R0,R14 DECREMENT NUMBER ASKED BY ONE 00181000
CLR R0,R1 ENOUGH IN THIS BLOK ?? 00182000
BH GETALLN2 NO -- SEE IF MORE ALOCBLOKS 00183000
SPACE 00184000
LA R15,ALOCMAP(R1) POINT TO LAST BYTE IN MAP 00185000
SR R15,R0 POINT TO LAST BYTE TO TEST 00186000
LA R7,ALOCMAP POINT TO 1ST BYTE TO TEST 00187000
LR R4,R7 AND SAVE ITS ADDRESS 00188000
SPACE 2 00189000
GETCYL CLI 0(R7),0 IS THE CYLINDER ALLOCATED ?? 00190000
BE GETNXTCL NO -- 00191000
CYLOOP BXLE R7,R14,GETCYL LOOP UNTIL AN UNALLOCATED CYLINDER IS 00192000
B GETALLN2 FOUND, OR UNTIL NONE ARE LEFT 00193000
SPACE 00194000
GETNXTCL LTR R3,R0 ONLY ONE CYLINDER NEEDED ? 00195000
BZ ALLOCATE YES -- 00196000
SLR R3,R14 DECREMENT COUNT ONE MORE 00197000
ST R7,SAVEWRK2 SAVE ALOCBLOK POINTER @VA03157 00198000
LR R9,R3 SET REG FOR EXECUTE @VA03157 00199000
ALLOCCLC CL R9,F255 CHECKING MORE THAN 256 CHARS @VA03157 00200000
BNH ALCCLCEX NO, GO COMPARE @VA03157 00201000
L R10,F255 LOAD REG FOR MAX COMPARE LENGTH @VA03157 00202000
EX R10,CKCYL GO COMPARE FOR MAX LENGTH @VA03157 00203000
BE CONTLOOP CONTINUE COMPARING @VA03157 00204000
L R7,SAVEWRK2 RESTORE ALOCBLOK FLAG POINTER @VA03157 00205000
B CYLOOP NOT ENOUGH CYLS, LOOK AGAIN @VA03157 00206000
CONTLOOP A R7,F256 INCREMENT POINTER @VA03157 00207000
S R9,F256 DECREMENT COMPARE LENGTH BY 256 @VA03157 00208000
B ALLOCCLC LOOP @VA03157 00209000
ALCCLCEX EX R9,CKCYL TEST FOR ENOUGH CONTIGUOUS CYLS @VA03157 00210000
L R7,SAVEWRK2 RESTORE ALOCBLOK FLAG POINTER @VA03157 00211000
BNE CYLOOP NOT ENOUGH -- KEEP LOOKING 00212000
SPACE 00213000
ALLOCATE MVI 0(R7),X'AA' FLAG 1ST CYLINDER AS ALLOCATED 00214000
LTR R0,R0 ONLY 1 CYLINDER TO ALLOCATE ? 00215000
BZ SETCYL YES -- 00216000
ALLOCMVC CL R3,F255 FLAG MORE THAN 256 @VA03157 00217000
BNH ALCMVCEX NO, GO FLAG @VA03157 00218000
EX R10,MOVEALLN FLAG MAXIMUM @VA03157 00219000
A R7,F256 INCREMENT POINTER @VA03157 00220000
S R3,F256 DECREMENT LENGTH BY 256 @VA03157 00221000
B ALLOCMVC LOOP @VA03157 00222000
ALCMVCEX EX R3,MOVEALLN ALLOCATE REST OF CYS @VA03157 00223000
L R7,SAVEWRK2 RESTORE ALOCBLOK COUNTER @VA03157 00224000
SPACE 00225000
SETCYL EQU * CALCULATE CYLINDER NUMBER ALLOCATED 00226000
SR R7,R4 GET DISPLACEMENT FROM START OF MAP 00227000
AH R7,ALOCCYL1 GET CYLINDER NUMBER 00228000
ST R7,SAVER1 PASS BACK TO CALLER IN GPR1 00229000
LH R7,RDEVLNKS OBTAIN USE COUNT @VA04364 00229300
ALR R7,R14 INCREMENT BY ONE @VA04364 00229600
STH R7,RDEVLNKS STORE UPDATED COUNT @VA04364 00229900
SPACE 00230000
SETDEVIC EQU * PASS BACK RDEVBLOK ADDRESS 00231000
ST R8,SAVER8 IN GPR8 00232000
LTR R8,R8 TDISK SPACE FOUND ?? 00233000
BNZ RLEXIT YES - GO CLEAR FIRST CYLINDER 00234000
EXIT 00235000
EJECT 00236000
*. 00237000
* 00238000
* SUBROUTINE NAME - 00239000
* 00240000
* DMKTDKRL 00241000
* 00242000
* FUNCTION - 00243000
* 00244000
* TO RELEASE TDISK SPACE TO THE POOL OF FREE SPACE 00245000
* 00246000
* ATTRIBUTES - 00247000
* 00248000
* REENTRANT, PAGEABLE, CALLED VIA SVC 00249000
* 00250000
* ENTRY POINTS - 00251000
* 00252000
* DMKTDKRL 00253000
* 00254000
* ENTRY CONDITIONS - 00255000
* 00256000
* GPR0 = NUMBER OF CYLINDERS TO RELEASE 00257000
* GPR1 = CYLINDER NUMBER OF FIRST CYLINDER TO RELEASE 00258000
* GPR8 = ADDRESS OF RDEVBLOK FOR DEVICE ON WHICH SPACE IS 00259000
* ALLOCATED 00260000
* GPR12 = ADDRESS OF DMKTDKRL 00261000
* GPR13 = ADDRESS OF SAVEAREA 00262000
* 00263000
* EXIT CONDITIONS - 00264000
* 00265000
* NONE 00266000
* 00267000
* CALLS TO OTHER ROUTINES - 00268000
* 00269000
* DMKFREE - OBTAIN STORAGE FOR AN IO TASK BLOK 00270000
* DMKFRET - RETURN IOTASK TO FREE STORAGE 00271000
* DMKIOSQR - SCHEDULE IO TO ERASE TRACK 0 CYLINDER 0 00272000
* DMKDSPCH - EXIT VIA GOTO TO AWAIT IO INTERRUPT 00273000
* 00274000
* EXTERNAL REFERENCES - 00275000
* 00276000
* NONE 00277000
* 00278000
* TABLES / WORKAREAS - 00279000
* 00280000
* ALOCBLOK 00281000
* 00282000
* REGISTER USAGE - 00283000
* 00284000
* GPR0-5 - SCRATCH 00285000
* GPR6 = ALOCBLOK BASE 00286000
* GPR7 = SCRATCH 00287000
* GPR8 = RDEVBLOK BASE 00288000
* GPR9-11 NOT USED 00289000
* GPR12 = DMKTDK BASE 00290000
* GPR13 = SAVEAREA BASE 00291000
* GPR14,15 NOT USED 00292000
* 00293000
* 00294000
* NOTES - 00295000
* 00296000
* NONE 00297000
* 00298000
* OPERATION - 00299000
* 00300000
* 1. LOCATE THE ALOCBLOK FOR TDISK SPACE ON THE CHAIN FROM THE 00301000
* RDEVBLOK WHOSE ADDRESS IS PASSED IN GPR8 00302000
* 2. CALCULATE THE STARTING ADDRESS AND LENGTH OF THE BYTE 00303000
* STRING THAT REPRESENTS THE CYLINDER ALLOCATION 00304000
* 3. VERIFY THAT THE CYLINDERS ARE IN FACT ALLOCATED 00305000
* 4. DE-ALLOCATE THE SPACE BY SETTING THE APPROPRIATE BYTES 00306000
* TO ZERO 00307000
* 5. EXIT TO THE CALLER 00308000
* 5. ERASE TRACK 0 OF THE FIRST CYLINDER RETURNED 00309000
* 6. EXIT TO CALLER 00310000
*. 00311000
EJECT 00312000
DMKTDKRL RELOC 00313000
LA R6,RDEVALLN POINT TO ALOCATION CHAIN ANCHOR 00314000
SPACE 00315000
FINDALLN L R6,ALOCPNT POINT TO NEXT ALOCBLOK ON CHAIN 00316000
LTR R6,R6 LOOK FOR TDISK ALLOCATION 00317000
BP FINDALLN STILL CHAINING PAGE ALLOCATION 00318000
BM TDK1A FOUND IT 00319000
ABEND 1 GPR8 MUST BE FOULED UP 00320000
TDK1A EQU * 00321000
SPACE 00322000
CH R1,ALOCCYL1 CHECK RANGE OF THIS BLOK 00323000
BL FINDALLN TOO LOW FOR THIS BLOCK 00324000
CH R1,ALOCCYL2 ... 00325000
BH FINDALLN TOO HIGH FOR THIS BLOK 00326000
SPACE 00327000
LR R2,R1 SAVE STARTING CYLINDER NUMBER 00328000
SH R2,ALOCCYL1 GET RELATIVE CYLINDER NUMBER 00329000
LA R7,ALOCMAP(R2) POINT TO BYTE FOR 1ST CYLINDER 00330000
CLI 0(R7),X'AA' IS IT ALLOCATED ?? 00331000
BNE NOTALLN NO -- DISASTER 00332000
BCTR R0,R0 GET NUMBER OF CYLINDERS TO DEALLOCATE-1 00333000
AR R1,R0 GET LAST CYLINDER TO DEALLOCATE 00334000
CH R1,ALOCCYL2 IN THIS RANGE ?? 00335000
BH NOTALLN NO -- DISASTER 00336000
LTR R3,R0 ONLY ONE TO DE-ALLOCATE 00337000
BZ DEALOCAT YES -- GO DO IT 00338000
BCTR R3,0 GET NUMBER TO DEALLOCATE-2 00339000
ST R7,SAVEWRK2 SAVE ALOCBLOK POINTER @VA03157 00340000
LR R9,R3 SET REG FOR EXECUTE @VA03157 00341000
DEALCCLC CL R9,F255 COMPARE GREATER THAN 256 CHARS @VA03157 00342000
BNH DEACLCEX NO, GO COMPARE @VA03157 00343000
L R10,F255 LOAD REG FOR MAX COMPARE LENGTH @VA03157 00344000
EX R10,CKCYL GO COMPARE FOR MAX LENGTH @VA03157 00345000
BNE NOTALLN NOT ALLOCATED @VA03157 00346000
A R7,F256 INCREMENT POINTER BY MAX @VA03157 00347000
S R9,F256 DECREMENT COMPARE LENGTH BY 256 @VA03157 00348000
B DEALCCLC LOOP @VA03157 00349000
DEACLCEX EX R9,CKCYL TEST FOR ALLOCATED CYLINDERS @VA03157 00350000
BNE NOTALLN NOT ALLOCATED @VA03157 00351000
L R7,SAVEWRK2 RESTORE ALOCBLOK POINTER @VA03157 00352000
SPACE 00353000
DEALOCAT MVI 0(R7),0 DEALLOCATE 1ST CYLINDER 00354000
LTR R0,R0 ONLY ONE TO DO ?? 00355000
BZ USECOUNT YES, UPDATE USE COUNT @VA04364 00356500
DEALCMVC CL R3,F255 FLAG MORE THAN 256 @VA03157 00357000
BNH DEAMVCEX NO, GO FLAG @VA03157 00358000
EX R10,MOVEALLN FLAG MAXIMUM @VA03157 00359000
A R7,F256 INCREMENT POINTER FOR FLAGGING @VA03157 00360000
S R3,F256 DECREMENT FLAG LENGTH BY 256 @VA03157 00361000
B DEALCMVC LOOP @VA03157 00362000
DEAMVCEX EX R3,MOVEALLN DEALLOCATE REST OF CYS @VA03157 00363000
USECOUNT LH R7,RDEVLNKS OBTAIN USE COUNT @VA04364 00363300
BCTR R7,0 DECREMENT BY ONE @VA04364 00363600
STH R7,RDEVLNKS STORE UPDATED COUNT @VA04364 00363900
EJECT 00364000
RLEXIT EQU * ERASE VIRTUAL CYLINDER 0, TRACK 0, FOR SECURITY 00365000
LA R0,IOTASKSZ GET STORAGE FOR 00366000
CALL DMKFREE AN IOBLOK AND CHANNEL PROGRAM 00367000
LR R10,R1 USE STANDARD 00368000
USING IOBLOK,R10 ADDRESSABILITY 00369000
XC IOBLOK(IOTASKSZ*8),IOBLOK CLEAR THE BLOK TO 0 00370000
MVI IOBFLAG,IOBCP AND FLAG IT AS A CP TASK 00371000
L R0,SAVER1 GET STARTING CYLINDER 00372000
STH R0,IOBCYL AND SAVE IN IOBLOK 00373000
STH R0,IOCC AND AS SEEK ADDRESS 00374000
CLI RDEVTYPE,TYP3340 3340 TYPE DEVICE ? @V2A2029 00375000
BNE SETIOB NO -- CONTINUE @V2A2029 00376000
TM RDEVFTR,FTR70MB 70MB DATA MODULE MOUNTED ? @V2A2029 00377000
BZ *+8 NO -- GO @V2A2029 00378000
NI IOBCYL+1,X'FE' QUEUE ON LOWEST LOGICAL CYL @V2A2029 00379000
SETIOB LR R0,R13 SAVE GPR13 (SAVE AREA BASE) @V2A2029 00380000
LR R1,R11 ADDRESS OF USER VMBLOK 00381000
LA R2,TDKIRA GET ADDRESS FOR INTERRUPT RETURN 00382000
LA R3,IOSEEK GET ADDRESS OF 1ST CCW 00383000
STM R0,R3,IOBMISC ,IOBUSER, IOBIRA, AND IOBCAW 00384000
LM R0,R9,SEEK PICK UP MODEL CCW'S 00385000
ALR R0,R10 AND RELOCATE THEIR DATA ADDRESSES 00386000
ALR R2,R10 .... 00387000
ALR R4,R10 ... 00388000
ALR R6,R10 .. 00389000
ALR R8,R10 . 00390000
STM R0,R9,IOSEEK SAVE CCW'S IN IOTASK 00391000
LM R0,R3,TIC SET UP REMAINDER OF CHANNEL PROGRAM 00392000
ALR R0,R10 ... 00393000
ALR R2,R10 .. 00394000
STM R0,R3,IOTIC . 00395000
SPACE 00396000
L R8,SAVER8 RESTORE ADDRESS OF RDEVBLOK 00397000
CLI RDEVTYPE,TYP2314 IS THIS A 2314/2319 ? 00398000
BNE *+8 NO -- SET SECTOR IS A LEGAL COMMAND 00399000
MVI IOSS,X'03' NOP THE SET SECTOR 00400000
MVI IOR1R,1 SET TO WRITE RECORD 1 00401000
CALL DMKIOSQR AND START THE ERASE 00402000
GOTO DMKDSPCH ... GO TO DISPATCH TO AWAIT THE INTERRUPT 00403000
EJECT 00404000
TDKIRA EQU * HERE WHEN THE I/O HAS FINISHED 00405000
USING *,R12 TEMPORARY ADDRESSABILITY AT ENTRY 00406000
SL R12,=A(TDKIRA-DMKTDK) RE-ESTABLISH 00407000
USING DMKTDK,R12 STANDARD ADDRESSABILITY 00408000
L R13,IOBMISC RESTORE ADDRESS OF SAVEAREA 00409000
LA R0,IOTASKSZ GET SIZE OF TASK 00410000
LR R1,R10 AND ITS ADDRESS 00411000
CALL DMKFRET RETURN THE IOTASK TO FREE STORAGE 00412000
EXIT AND RETURN TO CALLER .. 00413000
SPACE 3 00414000
NOTALLN ABEND 2 00415000
EJECT 00416000
* INSTRUCTIONS EXECUTED TO TEST AND SET ALLOCATION 00417000
SPACE 00418000
CKCYL CLC 0(*-*,R7),1(R7) TEST FOR UNALLOCATED CYLINDERS 00419000
SPACE 00420000
MOVEALLN MVC 1(*-*,R7),0(R7) ALLOCATE/DEALLOCATE CYLINDERS 00421000
SPACE 2 00422000
* MODEL CHANNEL PROGRAM TO ERASE CYLINDER 0, TRACK 0 OF TDISK AREA 00423000
SPACE 00424000
SEEK CCW X'07',IOBB-IOBLOK,CC+SILI,6 SEEK 00425000
SFM CCW X'1F',IOBB-IOBLOK,CC+SILI,1 SET FILE MASK 00426000
RR0 CCW X'16',IOCC-IOBLOK,CC+SILI,4 READ RECORD 0 00427000
SS CCW X'23',IOSS-IOBLOK+7,CC+SILI,1 SET SECTOR 1 00428000
SRCHID CCW X'31',IOCC-IOBLOK,CC+SILI,5 SEARCH ID =, RECORD 0 00429000
TIC CCW X'08',IOSRCHID-IOBLOK,0,0 TIC 00430000
WR1 CCW X'1D',IOREC1-IOBLOK,SILI,8 WRITE CKD, RECORD 1 00431000
LTORG 00432000
EJECT 00433000
COPY ALLOC 00434000
COPY SAVE 00435000
COPY RBLOKS 00436000
COPY IOBLOKS 00437000
IOBLOK DSECT CONTINE THE IOBLOK DSECT 00438000
ORG , MAKE SURE WE'RE AT THE END @V200820 00439000
IOCCWS DS 7D DEFINE SPACE FOR ERASE CHANNEL PROGRAM 00440000
ORG IOCCWS DEFINE THE CCWS 00441000
IOSEEK DS D SEEK 00442000
IOSFM DS D SET FILE MASK - ALLOW FORMAT WRITES 00443000
IORR0 DS D READ RECORD 0 TO OBTAIN REAL CYLINDER 00444000
IOSS DS D SET SECTOR 3330/40/50/75/80/2305 HRC106DK 00445100
IOSRCHID DS D SEARCH ID EQUAL ON RECORD 0 00446000
IOTIC DS D TRANSFER IN CHANNEL UNTIL SEARCH = 00447000
IOWR1 DS D WRITE RECORD 1, ERASE REST OF TRACK 00448000
IODATA DS 2D DEFINE SPACE FOR SEARCH DATA AND REC. 1 00449000
ORG IODATA DEFINE THE DATA FIELDS 00450000
IOBB DS H BIN NUMBER 00451000
IOCC DS H CYLINDER NUMBER 00452000
IOHHR DS 3X HEAD AND RECORD FOR SEARCH 00453000
DS X UNUSED 00454000
IOREC1 DS D COUNT FIELD FOR RECORD 1 00455000
ORG IOREC1 00456000
IOR1CC DS H CYLINDER 00457000
IOR1HH DS H HEAD 00458000
IOR1R DS X RECORD 00459000
IOR1KL DS X KEY LENGTH 00460000
IOR1DL DS H DATA LENGTH (= 0) 00461000
IOTASKSZ EQU (*-IOBLOK)/8 TASK SIZE IN DOUBLE WORDS 00462000
EJECT 00463000
PSA 00464000
COPY EQU 00465000
COPY DEVTYPES 00466000
END 00467000