LAX TITLE 'DMTLAX (RSCS) VM/370 - RELEASE 6' 00001000 *. 00002000 * MODULE NAME - 00003000 * 00004000 * DMTLAX 00005000 * 00006000 * FUNCTION - 00007000 * 00008000 * THIS ROUTINE FUNCTIONS AS THE LINE ALLOCATION TASK FOR 00009000 * RSCS. THE MAJOR PART OF THIS ROUTINE FUNCTIONS AS AN 00010000 * ASYNCHRONOUS EXIT BEING ALERTED BY DMTREX. 00011000 * 00012000 * ATTRIBUTES - 00013000 * 00014000 * REUSABLE 00015000 * 00016000 * ENTRY POINTS - 00017000 * 00018000 * DMTLAX - AT TASK INITIATION 00019000 * 00020000 * ENTRY CONDITIONS - 00021000 * 00022000 * NONE 00023000 * 00024000 * EXIT CONDITIONS - 00025000 * 00026000 * NORMAL - THIS ROUTINE WILL ALWAYS BE ACTIVE 00027000 * ERROR - THIS ROUTINE WILL ALWAYS BE ACTIVE 00028000 * 00029000 * 00030000 * CALLS TO OTHER ROUTINES - 00031000 * 00032000 * DMTWAT - SUPERVISOR WAIT ROUTINE 00033000 * 00034000 * EXTERNAL REFERENCES - 00035000 * 00036000 * TPORTS - SWITCHABLE PORT TABLE 00037000 * 00038000 EJECT 00039000 * TABLES / WORKAREAS - 00040000 * 00041000 * 00042000 * NONE 00043000 * 00044000 * 00045000 * REGISTER USAGE - 00046000 * 00047000 * ALL SUBROUTINES IN THE MODULE CONFORM GENERALLY TO THIS USAGE; 00048000 * ANY INDIVIDUAL DEVIATIONS OR EXTENSIONS ARE LISTED WITH THE 00049000 * COMMAND DESCRIPTION 00050000 * 00051000 * GPR0 = WORK 00052000 * GPR1 = WORK 00053000 * GPR2 = LINK TABLE ADDRESSABILITY 00054000 * GPR3 = WORK 00055000 * GPR4 = WORK 00056000 * GPR5 = WORK 00057000 * GPR6 = WORK 00058000 * GPR7 = WORK 00059000 * GPR8 = WORK 00060000 * GPR9 = WORK 00061000 * GPR10 = WORK 00062000 * GPR11 = WORK 00063000 * GPR12 = BASE REGISTER 00064000 * GPR13 = WORK 00065000 * GPR14 = RETURN REGISTER ON CALL 00066000 * GPR15 = ENTRY ADDRESS ON AN EXTERNAL CALL 00067000 * 00068000 * NOTES - 00069000 * 00070000 * NONE 00071000 * 00072000 * OPERATION - 00073000 * 00074000 * 00075000 * 1. UPON TASK INITIATION, INITIAL SWITCHABLE PORT TABLE 00076000 * AND SETUP AYNCH EXIT REQUEST. 00077000 * 00078000 * 2. IF LINE ADDRESS NOT SUPPLIED, SCAN THE PORT TABLE 00079000 * FOR AN AVAILABLE LINE. IF NONE FOUND RETURN WITH ERROR. 00080000 * 00081000 * 3. WHEN LINE IS FOUND, VALIDATE THAT THE LINE IS NOT IN 00082000 * USE BY ANOTHER LINK. 00083000 * 00084000 * 4. VALIDATE THE DEVICE TYPE OF THE PORT SPECIFIED. IF NOT 00085000 * AVAILABLE OR NOT CORRECT DEVICE TYPE RETURN WITH ERROR. 00086000 * 00087000 *. 00088000 EJECT 00089000 DMTLAX CSECT 00090000 SPACE 00091000 LAXSAVE DC 0D'0' BEGINNING OF MONITOR SAVE AREA 00092000 SPACE 00093000 LAXPSW DC X'FF04',AL2(0),A(LAXINIT) INITIAL PSW FOR DISPATCH 00094000 SPACE 00095000 LAXREG0 DC F'0' INITIAL REGISTER CONTENTS 00096000 LAXREG1 DC F'0' 00097000 LAXREG2 DC F'0' 00098000 LAXREG3 DC F'0' 00099000 LAXREG4 DC F'0' 00100000 LAXREG5 DC F'0' 00101000 LAXREG6 DC F'0' 00102000 LAXREG7 DC F'0' 00103000 LAXREG8 DC F'0' 00104000 LAXREG9 DC F'0' 00105000 LAXREG10 DC F'0' 00106000 LAXREG11 DC F'0' 00107000 LAXREG12 DC A(DMTLAX) BASE REGISTER FOR FIRST PAGE 00108000 LAXREG13 DC F'0' 00109000 LAXREG14 DC F'0' 00110000 LAXREG15 DC A(LAXINIT) ENTRY ADDRESS AT INITIATION 00111000 SPACE 00112000 REQLOCK DC F'0' SYNCH LOCK FOR REQUEST ARRIVAL 00113000 EJECT 00114000 *. 00115000 * 00116000 * ENTRY NAME - 00117000 * 00118000 * 00119000 * 00120000 * FUNCTION - 00121000 * 00122000 * 00123000 * 00124000 * CALLS TO OTHER ROUTINES - 00125000 * 00126000 * 00127000 * 00128000 * OPERATION - 00129000 * 00130000 * 00131000 * 00132000 * RESPONSES - 00133000 * 00134000 * NONE 00135000 * 00136000 * ERROR MESSAGES - 00137000 * 00138000 * NONE 00139000 * 00140000 *. 00141000 SPACE 00142000 LAXINIT DC 0H'0' SET ALIGNMENT FOR START OF CODE 00143000 SPACE 00144000 USING DMTLAX,R12 DEFINE FIRST PAGE ADDRESSABILITY 00145000 USING SVECTORS,0 DEFINE SVECTORS ADDRESSABILITY 00146000 USING LINKTABL,R2 DEFINE LINKTABLE ADDRESSABILITY 00147000 SPACE 2 00148000 * 00149000 * INITIALIZE SCAN REGISTER SETUP 00150000 * 00151000 L R1,TPORTS ADDR OF PORT TABLE START 00152000 L R3,0(R1) COUNT OF ENTRIES 00153000 SLL R3,1 *2 = LENGTH OF ENTRIES 00154000 LA R1,8(R1) ADDR OF FIRST ENTRY 00155000 LR R2,R1 MAKE FIRST ENTRY NEXT 00156000 ALR R3,R1 AND SET END ADDR 00157000 STM R1,R3,LAXSETUP SAVE FOR ALERT CALLS 00158000 EJECT 00159000 * 00160000 * INITIALIZE ALERT EXIT 00161000 * 00162000 SLR R0,R0 => REQ FOR ALERT EXIT 00163000 LA R1,LAXALERT ALERT EXIT ENTRY 00164000 L R15,ASYNREQ ENTRY FOR ASYN SERVICE 00165000 BALR R14,R15 REQUEST THE ALERT EXIT 00166000 SPACE 00167000 * (ASSUME SUCCESSFUL RETURN) 00168000 SPACE 2 00169000 * 00170000 * DONE WITH DISPATCHED WORK 00171000 * 00172000 LAXHANG EQU * 00173000 XC LAXLOCK(4),LAXLOCK CLEAR ENDLESS SYNCH LOCK 00174000 LA R1,LAXLOCK SET TO WAIT ON IT 00175000 L R15,WAITREQ WAIT SERVICE ENTRY 00176000 BALR R14,R15 WAIT FOREVER 00177000 B LAXHANG FOR AESTHETICS 00178000 EJECT 00179000 * 00180000 * LAX ALERT EXIT 00181000 * 00182000 LAXALERT DC 0H'0' 00183000 LR R12,R15 SET LAX BASE 00184000 LA R15,LAXALERT-DMTLAX DISPLACEMENT TO ENTRY 00185000 SLR R12,R15 SET BASE A(DMTREX) 00186000 SPACE 00187000 CL R0,LAXREX IS CALLER 'REX '? 00188000 BNE LAXPRIV REJECT IF NOT 00189000 CLI 0(R1),X'05' REQ LONG ENOUGH? 00190000 BL LAXSHORT NOPE - REJECT 00191000 CLI 1(R1),X'01' ONLY LEGAL REQ CODE? 00192000 BNE LAXCODE NO - REJECT 00193000 SPACE 00194000 MVC LAXPORT(2),4(R1) SET REQUESTED ADDRESS 00195000 SLR R0,R0 CLEAR FOR ICM 00196000 ICM R0,B'0011',4(R1) ANY SPECIFIED? 00197000 BNZ LAXQUERY YES - VALIDATE, SCAN LINKS 00198000 SPACE 2 00199000 * 00200000 * SCAN THE AVAILABLE PORT TABLE 00201000 * 00202000 LM R7,R9,LAXSETUP INITIALIZE FOR SCAN 00203000 CLR R7,R9 TOP = END? 00204000 BE LAXMISS YEP - EMPTY TABLE 00205000 LR R6,R8 KEEP START ADDR IN REG.6 00206000 LAXNEXT EQU * 00207000 LR R4,R8 SAVE CURRENT ADDR IN REG.4 00208000 LA R8,2(R8) SET NEXT ENTRY ADDR 00209000 CLR R8,R9 AT END OF TABLE? 00210000 BL LAXCHECK NO - SO FAR SO GOOD 00211000 LR R8,R7 CONTINUE AT TABLE TOP 00212000 LAXCHECK EQU * 00213000 TM 0(R4),X'F0' IN USE? 00214000 BZ LAXHIT NO - TAKE IT 00215000 LAXRETRY EQU * 00216000 CLR R6,R8 BACK TO START? 00217000 BNE LAXNEXT NOPE - TRY ANOTHER 00218000 SPACE 00219000 * 00220000 * NONE FOUND 00221000 * 00222000 LAXMISS EQU * 00223000 MVI 2(R1),X'02' SET UNAVAILABLE RESPONSE 00224000 BR R14 AND RETURN 00225000 EJECT 00226000 * 00227000 * AVAILABLE ENTRY ADDRESS IN REG.4 00228000 * 00229000 LAXHIT EQU * 00230000 ST R8,LAXSETUP+4 SET NEW NEXT 00231000 LR R5,R4 SAVE R4 FOR LATER @VM01118 00231500 LH R2,0(R4) FREE PORT ADDR 00232000 DIAG R2,R3,X'24' WHAT IS IT REALLY? 00233000 BC 1,LAXRETRY NOT ATTACHED - TRY AGAIN 00234000 CLM R3,B'1100',=AL1(CLASTERM,TYP2700) LINE PORT? @VM01118 00235010 BE *+12 YES, SET UP PORT ADDRESS @V2D3931 00236100 CLM R3,B'1100',=AL1(CLASTERM,TYPBSC) LINE PORT ? @V2D3931 00236200 BNE LAXRETRY NO, TRY AGAIN @V2D3931 00236300 STH R2,LAXPORT SET FREE PORT ADDRESS 00237000 OI 0(R5),X'F0' MARK FREE PORT IN USE @VM01118 00238010 SPACE 00239000 LAXSCAN EQU * 00240000 L R2,TLINKS ADDR OF START OF LINK TABLE 00241000 L R3,0(R2) COUNT OF LINKS 00242000 BCTR R3,0 DO NOT COUNT LOCAL TABLE 00243000 LTR R3,R3 ANY LEFT? 00244000 BZ LAXLKOK NO - NO LINES IN USE ...? 00245000 LA R2,8(R2) START AT LOCAL TABLE 00246000 LAXLKNEX EQU * 00247000 LA R2,LINKLEN(R2) TO NEXT LINK TABLE 00248000 TM LFLAG,LACTIVE IS IT ACTIVE? 00249000 BNO LAXLKSKP NO - SKIP IT 00250000 CLC LAXPORT(2),LACTLINE IS LINE IN USE HERE? 00251000 BNE LAXLKSKP NO - TRY ANOTHER LINK 00252000 LTR R0,R0 IN USE - ADDR SUPPLIED? 00253000 BNZ LAXBUSY YES - QUIT WITH ERROR 00254000 B LAXRETRY NO - TRY TO FIND ANOTHER 00255000 LAXLKSKP EQU * 00256000 BCT R3,LAXLKNEX DO ENTIRE LINK TABLE 00257000 SPACE 00258000 * 00259000 * LINE AVAILABLE -- USE IT 00260000 * 00261000 LAXLKOK EQU * 00262000 MVC 4(2,R1),LAXPORT O.K. EITHER WAY 00263000 SPACE 00264000 MVI 2(R1),X'00' SET SUCCESSFUL RESPONSE 00265000 BR R14 RETURN 00266000 SPACE 2 00267000 LAXBUSY EQU * 00268000 CLI 0(R1),X'0F' REQ LONG ENOUGH FOR LINKID? 00269000 BL LAXSHORT NOPE - GIVE SHORT RETURN 00270000 MVC 8(8,R1),LINKID RETURN ID OF LINK USING IT 00271000 B LAXMISS AND RETURN NOT AVAILABLE 00272000 EJECT 00273000 LAXQUERY EQU * 00274000 LR R6,R0 LINE ADDRESS? 00275000 DIAG R6,R7,X'24' WHAT IS IT REALLY? 00276000 BC 1,LAXCC3 NOT ATTACHED 00277000 CLM R7,B'1100',=AL1(CLASTERM,TYP2700) LINE PORT? 00278000 BE LAXSCAN YES - SEE IF IN USE 00279000 CLM R7,B'1100',=AL1(CLASTERM,TYPBSC) LINE PORT ? @V2D3931 00279100 BE LAXSCAN YES, SEE IF IN USE @V2D3931 00279200 SPACE 00280000 MVI 2(R1),X'04' SAY NOT LINE PORT 00281000 BR R14 AND RETURN 00282000 SPACE 00283000 LAXCC3 EQU * 00284000 MVI 2(R1),X'08' SAY NOT ATTACHED 00285000 BR R14 AND RETURN 00286000 SPACE 00287000 LAXPRIV EQU * 00288000 MVI 2(R1),X'80' SET WRONG TASK NAME 00289000 BR R14 AND RETURN 00290000 SPACE 2 00291000 LAXSHORT EQU * 00292000 MVI 2(R1),X'20' SET SHORT REQ CODE 00293000 BR R14 AND RETURN TO MSUP 00294000 SPACE 2 00295000 LAXCODE EQU * 00296000 MVI 2(R1),X'40' SET INVALID REQ CODE 00297000 BR R14 AND RETURN 00298000 EJECT 00299000 * 00300000 * LAX CONSTANT AND VARIABLE AREA 00301000 * 00302000 SPACE 2 00303000 LAXREX DC 0F'0',CL4'REX' ONLY VALID CALLER 00304000 SPACE 00305000 LAXLOCK DC 0F'0',X'00',AL3(0) TO SUSPEND DISPATCHING 00306000 SPACE 00307000 LAXSETUP DC A(0) START OF PORT TABLE 00308000 DC A(0) NEXT ENTRY TO LOOK AT 00309000 DC A(0) END OF PORT TALBE 00310000 SPACE 00311000 LAXPORT DC X'0000' LINE ADDR WORK FIELD 00312000 EJECT 00313000 COPY SVECTORS 00314000 EJECT 00315000 COPY LINKTABL 00316000 EJECT 00317000 COPY RSSEQU 00318000 EJECT 00319000 COPY DEVTYPES 00320000 EJECT 00321000 END 00322000