CIT TITLE 'DMSCIT (CMS) VM/370 - RELEASE 6' 00001000 SPACE 2 00002000 * 00020000 * MODULE: 00021000 * 00022000 * DMSCIT 00023000 * 00024000 * FUNCTION: 00025000 * 00026000 * TO PROCESS THE INTERRUPTIONS FOR ALL CMS TERMINAL 00027000 * INPUT/OUTPUT OPERATIONS AND START THE NEXT I/O 00028000 * OPERATION UPON COMPLETION OF THE CURRENT I/O 00029000 * OPERATION. 00030000 * 00031000 * ENTRY POINTS: 00032000 * 00033000 * DMSCITA,CONSI - PROCESS TERMINAL INTERRUPTS 00034000 * DMSCITB - START NEXT I/O OPERATION 00035000 * DMSCITDB - TO FREE I/O BUFFERS FROM STACKS 00036000 * 00037000 * ATTRIBUTES: 00038000 * 00039000 * REENTRANT, NUCLEUS RESIDENT, CALLED BY BALR 00040000 * 00041000 * SUBROUTINE 00042000 * 00043000 * DMSCITA 00044000 * 00045000 * FUNCTION: 00046000 * 00047000 * TO PROCESS CMS TERMINAL I/O INTERRUPTS. 00048000 * 00049000 * ENTRY POINT 00050000 * 00051000 * DMSCITA 00052000 * 00053000 * ENTRY REQUIREMENTS: 00054000 * 00055000 * GPR 5 = ADDRESS OF DEVICE TABLE EENTRY FOR CONSOLE. 00056000 * 00057000 * EXIT CONDITIONS: 00058000 * 00059000 * GPR 15 = 0 INDICATES DE INTERRUPT RECEIVED, NO LONGER 00060000 * WAITING. 00061000 * 00062000 * GPR 15 = 4 INDICATES STILL WAITING FOR DE INTERRUPT. 00063000 * 00064000 * ERROR- 00065000 * GOTO DMSERR ON PERMANENT CONSOLE ERROR 00066000 * 00067000 * CALLS TO OTHER ROUTINES: 00068000 * 00069000 * DMSCITB, DMSFREB, DMSERR 00070000 * 00071000 * EXTERNAL REFERENCES: 00072000 * 00073000 * DMSNUC 00074000 * 00075000 * TABLES / WORKAREAS: 00076000 * 00077000 * NONE 00078000 * 00079000 * REGISTER USAGE: 00080000 * 00081000 * GPR0-9, 11, 12 - WORK REGISTERS 00082000 * GPR5 - DEVICE TABLE ENTRY 00083000 * GPR10 - NOT USED 00084000 * GPR13 - BASE REGISTER 00085000 * GPR14 - LINKAGE 00086000 * 00087000 * OPERATION: 00088000 * 00089000 * UPON RECEIVING CONTROL DMSCITA DETERMINES THE TYPE OF 00090000 * INTERRUPTION. IF THE STATUS BYTES INDICATE NEITHER 00091000 * DEVICE END, UNIT EXCEPTION NOR ATTENTION, DMSCITA 00092000 * RETURNS TO DMSITI 00093000 * WITH REGISTER 15 SET TO 4 INDICATING THAT THE I/O IS 00094000 * STILL IN PROCESS. 00095000 * 00096000 * IF DEVICE END STATUS IS PRESENT, INDICATING THE 00097000 * COMPLETION OF AN I/O OPERATION, DMSCITA TESTS WHETHER 00098000 * THE FINISHED OPERATION WAS A READ OR A WRITE. IF IT 00099000 * WAS A WRITE, DMSCITA DELETES THE FIRST WRITE BUFFER 00100000 * FROM THE OUTPUT STACK AREA AND MOVES THE REMAINING 00101000 * WRITE BUFFERS TO THE BEGINNING OF THE OUTPUT STACK 00102000 * AREA. IF THERE ARE ANY MORE WRITE OPERATIONS 00103000 * PENDING, DMSCITA BALR'S TO DMSCITB TO START THE FIRST 00104000 * OPERATION IN THE OUTPUT STACK. IF THE OPERATION IS 00105000 * STARTED SUCCESSFULLY, DMSCITA RETURNS TO DMSITI WITH 00106000 * REGISTER 15 SET TO ZERO. IF THE OPERATION WAS 00107000 * STARTED UNSUCCESSFULLY, BECAUSE THE USER PUSHED THE 00108000 * ATTENTION KEY, IT IS TREATED THE SAME AS ANY 00109000 * ATTENTION INTERRUPT. ANY OTHER ERRORS CAUSE 00110000 * TERMINATION. 00111000 * 00112000 * IF THE DEVICE END STATUS INDICATES THAT A READ 00113000 * OPERATION COMPLETED, DMSCITA TESTS WHETHER THE READ 00114000 * WAS GENERATED BY AN ATTENTION INTERRUPT. IF IT WAS A 00115000 * NORMAL READ, THE INPUT BUFFER IS CHAINED TO THE END 00116000 * OF THE FINISH READ STACK. IF ANY WRITES ARE PENDING, 00117000 * THE FIRST ONE IS STARTED AS THOUGH A WRITE OPERATION 00118000 * HAD JUST COMPLETED. IF THE READ WAS GENERATED BY AN 00119000 * ATTENTION, THE INPUT BUFFER IS CHECKED TO SEE IF IT 00120000 * CONTAINS THE HO, HT, RT, RO, HX, SO, OR HB 00121000 * IMMEDIATE COMMANDS. IF NOT, IT IS TREATED 00122000 * THE SAME AS A NORMAL READ. IF HO IS FOUND, 00123000 * THE HALT OVERRIDE FLAG IS SET. IF HT IS FOUND, 00124000 * THE HALT TYPING FLAG IS SET. IF RT IS FOUND, 00125000 * THE HALT TYPING FLAG IS SET OFF. IF HX IS FOUND, 00126000 * THE HALT EXECUTION FLAG IS SET. IF SO IS 00126400 * FOUND, THE SUSPEND OVERRIDES FLAG IS SET. 00126800 * IF RO IS FOUND, THE OVERRIDES FLAG IS SET AND 00127200 * THE SUSPEND OVERRIDES FLAG IS TURNED OFF. 00127600 * IF HB IS FOUND, THE BATSTOP FLAG IS SET. 00128000 * IF ONE OF THE IMMEDIATE COMMANDS IS FOUND, THE INPUT 00128400 * BUFFER IS RETURNED TO FREE STORAGE BY BALRING TO 00129000 * ROUTINE DMSFREB. ANY PENDING WRITE OPERATIONS ARE 00130000 * THEN STARTED. 00131000 * 00132000 * IF THE I/O INTERRUPT WAS CAUSED BY AN ATTENTION, 00133000 * THE ATTENTION EXIT QUEUE IS SEARCHED FOR AN 00134000 * ELIGIBLE EXIT. IF ONE IS FOUND CONTROL IS PASSED 00135000 * TO IT. ON RETURN DMSCITA RETURNS TO DMSITI. 00136000 * IF NO EXIT IS FOUND 00137000 * DMSCITA GETS 17 DOUBLE WORDS FROM FREE STORAGE BY 00138000 * BALRING TO ROUTINE DMSFREB. THE ADDRESS OF THE BUFFER 00139000 * IS PLACED IN THE PENDING READ POINTER AND DMSCITB IS 00140000 * BALR'ED TO START THE I/O. RETURN IS THEN MADE TO 00141000 * DMSITI. 00142000 * IF UNIT EXCEPTION THE COMPLETED OPERATION TYPE 00143000 * IS CHECKED. IF IT IS AN ATTENTION READ THE READ 00144000 * START I/O IS REISSUED. OTHERWISE THE RESIDUAL 00145000 * CSW BYTE COUNT IS COMPARED TO THE CCW BYTE COUNT. 00146000 * IF NOT EQUAL THE READ SIO IS REISSUED (USER 00147000 * CANCELLED INPUT LINE) . IF EQUAL, THE READ TER- 00148000 * MINATED FLAG IS SET AND THE INTERRUPT IS TREATED 00149000 * AS AN ATTENTION (ABOVE). 00150000 * 00151000 * SUBROUTINE 00152000 * 00153000 * DMSCITB 00154000 * 00155000 * FUNCTION: 00156000 * 00157000 * TO START THE NEXT TERMINAL INPUT/OUTPUT OPERATION. 00158000 * 00159000 * ENTRY POINT 00160000 * 00161000 * DMSCITB 00162000 * 00163000 * ENTRY REQUIREMENTS: 00164000 * 00165000 * GPR 1 = ADDRESS OF INPUT OR OUTPUT BUFFER. 00166000 * 00167000 * EXIT CONDITIONS: 00168000 * 00169000 * GPR 15 = 0 IF I/O WAS SUCCESSFULLY STARTED. 00170000 * GPR 15 = 4 IF CSW WAS STORED. 00171000 * GPR 15 = 5 IF ATTENTION READ ISSUED WITH A READ OUTSTANDING 00171500 * 00172000 * ERROR- 00173000 * 00174000 * GOTO DMSERR V1A DMSCITA ON PERMANENT CONSOLE ERROR 00175000 * 00176000 * CALLS TO OTHER ROUTINES: 00177000 * 00178000 * DMSERR 00179000 * 00180000 * EXTERNAL REFERENCES: 00181000 * 00182000 * DMSNUC 00183000 * 00184000 * TABLES / WORKAREAS: 00185000 * 00186000 * NONE. 00187000 * 00188000 * REGISTER USAGE: 00189000 * 00190000 * GPR1, GPR8 - WORK REG. 00191000 * GPR9 - DEVICE ADDRESS 00192000 * GPR14 - RETURN 00193000 * GPR15 - BASE 00194000 * 00195000 * OPERATION: 00196000 * 00197000 * DMSCITB BUILDS A CCW STRING AND STARTS THE I/O 00198000 * OPERATION. IF THE I/O STARTED SUCCESSFULLY RETURN IS 00199000 * MADE TO THE CALLER WITH REGISTER 15 SET TO ZERO. IF 00200000 * THE CSW WAS STORED BY THE START I/O INSTRUCTION, 00201000 * REGISTER 15 IS SET TO 4 BEFORE RETURNING. IF THE 00202000 * CHANNEL IS BUSY, A TEST I/O INSTRUCTION IS EXECUTED 00203000 * UNTIL THE CHANNEL IS FREE. AT WHICH TIME, THE I/O 00204000 * OPERATION IS RETRYED. 00205000 * 00206000 * SUBROUTINE 00207000 * 00208000 * DMSCITDB 00209000 * 00210000 * FUNCTION 00211000 * 00212000 * CLEAR READ AND WRITE STACKS. 00213000 * 00214000 * ENTRY CONDITIONS 00215000 * 00216000 * R14=RETURN, R15=ADDRESSABILITY 00217000 * 00218000 * CALLS TO OTHER ROUTINES 00219000 * 00220000 * DMSFREB 00221000 * 00222000 * EXTERNAL REFERENCES 00223000 * 00224000 * DMSNUC 00225000 * 00226000 * TABLES/WORKAREAS 00227000 * 00228000 * NONE 00229000 * 00230000 * REGISTER USAGE 00231000 * 00232000 * R13 BASE 00233000 * 0,1,3-6,14,15 WORK 00234000 * 00235000 * OPERATION 00236000 * RESET THE WRITE STACK POINTER TO ELIMINATE ALL 00237000 * STACKED WRITES. CLEAR FINISHED AND PENDING READ 00238000 * POINTERS, RETURN ANY ATTENTION READ BUFFERS TO 00239000 * FREE STORAGE. RETURN TO CALLER 00240000 *. 00241000 EJECT 00242000 DMSCITA START 00243000 CONSI EQU * 00244000 ENTRY CONSI 00245000 ENTRY DMSCITB,DMSCITDB 00246000 USING *,13 00247000 LR 13,15 RESET BASE 00248000 USING NUCON,R0 00249000 USING NUCDSECT,5 00250000 LH 9,NCDEVAD SET R9 TO 1052 ADDRESS 00251000 LR 12,14 SAVE RETURN REGISTER 00252000 NI TSOFLAGS,255-TSOATCNL RESET READ CANCELLED FLAG 00253000 CKSTAT TM CSW+5,X'FF' ANY SEVERE ERRORS 00254000 BZ CKSTAT1 NO 00255000 CITERR1 DMSERR TEXT='PERMANENT CONSOLE ERROR, RE-IPL CMS', X00256000 TYPCALL=BALR,HALT=YES,DISP=SIO,LET=T,NUM=171 00257000 BAL R14,CITERR1 00258000 CKSTAT1 CLI CSW+4,CE+DE CHANNEL END DEVICE END P3108 00259000 BE CEDE YES, LOOK FOR POSSIBLE ATTENTION P3108 00260000 TM CSW+4,DE DEVICE END WO/CE P3108 00261000 BO HNDLDE YES, GO HANDLE IT 00262000 TM CSW+4,ATTN NO, WAS IT FOR ATTENTION?" 00263000 BO SETWAIT BRANCH IF SO @VA05051 00264500 TM CSW+4,UE WAS LINE CANCELLED 00265000 BO HNDLUE YES 00266000 TM CSW+4,CE NO, WAS IT CHANNEL END? 00267000 BO CEONLY YES, GO WAIT FOR DE 00268000 BAL R14,CITERR1 00269000 CEONLY LA 15,CE SET R15 FOR IOINT 00270000 BR 14 AND RETURN TO IT 00271000 CEDE L R2,CSW FIND CHANNEL PROGRAM P3108 00272000 SH R2,=H'16' P3108 00273000 TM 0(R2),X'0A' WAS IT A READ P3108 00274000 BNO HNDLDE NO P3108 00275000 L R2,0(R2) GET READ BUFFER ADDRESS P3108 00276000 CLI 0(R2),0 WAS IT A NULL LINE P3108 00277000 BNE HNDLDE NO P3108 00278000 TIO 0(R9) CHECK CONSOLE P3108 00279000 BZ HNDLDE CLEAR, GO HANDLE DEVICE END P3108 00280000 BC 4,CSWSTORD BRANCH IF CSW STORED P3108 00281000 BAL R14,CITERR1 SOMETHING WRONG P3108 00282000 CSWSTORD OI TSOFLAGS,TSOATCNL ASSUME READ CANCELLED BY ATTENTP3108 00283000 XC PENDREAD(4),PENDREAD CLEAR PENDING READ POINTERP3108 00284000 B HNDLATTN HANDLE ATTENTION P3108 00285000 EJECT 00285500 HNDLUE L R1,CURRIOOP GET READ PARAMETERS 00286000 TM 0(R1),LONGOP+NOATTN @V2D4598 00286250 BZ HNDLUE2 NORMAL, CLEAR & RESTART @V2D4598 00286500 BM HNDLUE3 LONG, CLEAR & RESTART @V2D4598 00286750 OI 0(R1),RDATTNZ LONG, NO ATTN RESTART @V2D4598 00287000 L R2,CSW ASSUMING IT'S OUR CCW, @V2D4598 00287250 LA R2,8(,R2) THAT IS... @V2D4598 00287500 B HNDLDE2 RETURN WHAT WE GOT @V2D4598 00287750 HNDLUE2 EQU * @V2D4598 00288000 LA R14,LNNORMOP(,R1) POINT CLEAR-SINK TO BUFFER @V2D4598 00288250 SR R15,R15 AND GET BUFFER LENGTH @V2D4598 00288500 IC R15,TONRMLEN(,R1) INTO MVCL SINK-LENGTH @V2D4598 00288750 B HNDLUE4 GO CLEAR BUFFER @V2D4598 00289000 HNDLUE3 EQU * @V2D4598 00289250 L R14,0(,R1) POINT CLEAR-SINK AT USER BUFFER @V2D4598 00289500 LH R15,TOLNGLEN(,R1) AND ITS LENGTH IN MVCL REG @V2D4598 00289750 HNDLUE4 EQU * @V2D4598 00290000 SR R3,R3 ZERO MVCL SOURCE-LENGTH, @V2D4598 00290250 MVCL R14,R2 AND CLEAR BUFFER 00290500 TM DBGFLAGS,DBGEXEC+DBGEXINT ARE WE IN DEBUG ? @VA00770 00291100 BO NORMRD YES..HOLD ON THE READ @VA00770 00291200 B STRTCON1 REISSUE READ 00292000 EJECT 00294000 HNDLDE L 2,CSW GET LAST COMMAND ADDRESS+8 00295000 LA 2,0(,2) 00296000 HNDLDE2 LA R3,CONCCWS+16 @V2D4598 00297000 CR 2,3 IS IT MY CCW STRING? 00298000 BE CSWOK YES, GO ON 00299000 CLC NUMPNDWR,=H'0' NO, ARE THERE ANY WRITES PENDING ? 00300000 BE CLR15 NO, IGNORE THE 'DE' 00301000 LTR 2,2 WAS THERE ANY COMMAND ADDRESS? 00302000 BZ CSWOK NO, WE'LL HOPE IT'S OK 00303000 BAL R14,CITERR1 00304000 * 00305000 CSWOK L 2,CURRIOOP GET ADDRESS OF LAST I/O WORK AREA 00306000 TM 0(2),X'0A' WAS IT A READ OPERATION? 00307000 BO READFIN YES, GO PROCESS IT 00308000 * 00309000 WRITFIN LA R3,LNLONGOP-LNNORMOP OFFSET TO NEXT WRITE (?) @V2D4598 00309600 TM 0(R2),LONGOP WAS IT A LONG OPERATION? @V2D4598 00310200 BO WRITFIN2 YES, CONTINUE @V2D4598 00310800 IC R3,TONRMLEN(,R2) NO, GET SIZE OF DATA @V2D4598 00311400 WRITFIN2 LA R3,LNNORMOP(R3,R2) R3 PTS TO NEXT WRITE IN STK @V2D4598 00312000 C R3,PENDWRIT IS THERE ONE ? 00313000 BNL STKEMPTY BRANCH IF HIGH OR EQUAL, IE., EMPTY NOW 00314000 LH R8,NUMPNDWR GET NUMBER OF ENTRIES IN STACK 00315000 LTR 8,8 CHECK ITS VALUE 00316000 BNP STKEMPTY IF ZERO OR INVALID, FORCE EMPTY STACK 00317000 LR 1,2 MORE ENTRIES TO COME, DELETE CURRENT FROM 00318000 BAL 14,PACK THE STACK AND PACK REMAINING IN FRONT 00319000 BCT 8,STKRESET REDUCE STACK ENTRY COUNT 00320000 STKEMPTY LA R3,CONSTACK SET R3 TO START OF STACK BUFFER 00321000 ST R3,PENDWRIT RESETSTACK POINTER 00322000 SR 8,8 CLEAR COUNTER OF ENTRIES 00323000 STKRESET STH R8,NUMPNDWR AND SET REMAINING ENTRY COUNT IN STACK 00324000 LTR R8,R8 ANY PENDING WRITES 00325000 BZ CLR15 NO, RETURN 00326000 TRYWRT LA R1,CONSTACK YES, TRY STARTING FIRST IN STACK 00327000 LA R15,DMSCITB 00328000 BALR 14,15 00329000 LTR 15,15 DID SIO GET STARTED? 00330000 BZ EXIT YEP, GO AWAY 00331000 CLI CSW+4,X'90' PENDING ATTENTION 00332000 BE HNDLATTN YES 00333000 BAL R14,CITERR1 00334000 EJECT 00335000 READFIN EQU * @VA05051 00335400 NI MISFLAGS,255-ATTNHIT REMOVE ATTENTION BIT @VA05051 00335900 TM 0(R2),FROMATTN WAS READ GENERATED BY 'ATTN'?@VA05051 00336400 BZ NORMRD NO, BRANCH 00337000 TM DBGFLAGS,DBGEXEC+DBGEXINT ARE WE IN DEBUG? @VA04109 00337400 BO NORMRD YES--BRANCH @VA04109 00337800 CLI 4(R2),X'0' IF NOT A TWO CHARACTER CMD @VA02167 00338200 BNE NORMRD SKIP THE FANCY STUFF @VA02167 00338400 LH R8,2(R2) GET A WORKABLE COPY @VA02167 00338600 O R8,=CL4' ' CONVERT TO UPPER CASE @VA02167 00338800 CH R8,=CL2'HT' HALT TYPING? @VA02167 00339000 BE KILTYP @VA02167 00339200 CH R8,=CL2'RT' RESUME TYPING? @VA02167 00339400 BE ENBTYP @VA02167 00339600 CH R8,=CL2'HX' HALT EXECUTION? @VA02167 00339800 BE KILLX @VA02167 00340000 CH R8,=CL2'HO' HALT OVERRIDE? @VA02167 00340200 BE HLTOVR @VA02167 00340400 CH R8,=CL2'SO' SUSPEND OVERRIDE? @VA02167 00340600 BE SUSOVR @VA02167 00340800 CH R8,=CL2'RO' RESUME OVERRIDE? @VA02167 00341000 BE RESOVR BRANCH IF YES @VM01080 00341700 CH R8,=CL2'HB' HALT BATCH ? @V2D2721 00342400 BE HLTBAT @V2D2721 00343100 NORMRD EQU * 00344000 LH 3,NUMFINRD UPDATE FINISHED READ COUNT 00345000 LA 3,1(,3) 00346000 STH 3,NUMFINRD 00347000 L R2,PENDREAD GET ADDRESS OF START OF READ WORK AREA 00348000 XC PENDREAD,PENDREAD ZERO PENDING READ POINTER 00349000 L 3,LSTFINRD ADD CURRENT FINISHED READ TO CHAIN 00350000 LTR 3,3 00351000 BZ FSTATTRD 00352000 ST 2,0(,3) 00353000 B SETLSTRD 00354000 FSTATTRD ST 2,FSTFINRD IF FIRST FINISHED READ, SET IT 00355000 SETLSTRD ST 2,LSTFINRD ALWAYS SET LAST FINISHED READ POINTER 00356000 CKWRTSTK EQU * 00357000 CLC NUMPNDWR,=H'0' ANY WRITES PENDING ? 00358000 L R9,=V(CONSOLE) GET CONSOLE DEVICE ADDRESS 00359000 LH R9,0(,R9) ... 00360000 BNE TRYWRT YES, GO DO IT 00361000 CLR15 SR 15,15 NO, TIME TO RETURN TO 'IOINT' 00362000 EXIT LR 14,12 RESTORE RETURN REGISTER 00363000 BR 14 00364000 * 00365000 ENBTYP NI MSGFLAGS,255-NOTYPING RESET NO TYPING FLAG 00370000 B FRETX 00371000 SPACE 00372000 USING SVCSECT,R15 00373000 HLTOVR EQU * 00374000 L R15,ASVCSECT POINT TO SVCSECT 00375000 OI OVSTAT,OVSHO TURN ON 'HALT OVERRIDES' FLAG 00376000 NI OVSTAT,X'FF'-OVSSO TURN OFF 'SUSPEND' FLAG 00377000 B FRETX GO RELEASE BUFFER 00378000 SPACE 00379000 SUSOVR EQU * 00380000 L R15,ASVCSECT POINT TO SVCSECT 00381000 OI OVSTAT,OVSSO TURN ON 'SUSPEND OVERRIDES' FLAG 00382000 B FRETX GO RELEASE BUFFER 00383000 SPACE 00384000 RESOVR EQU * 00385000 L R15,ASVCSECT POINT TO SVCSECT 00386000 OI OVSTAT,OVSON TURN ON OVERRIDES 00387000 NI OVSTAT,X'FF'-OVSSO TURN OFF 'SUSPEND OVERRIDES' FLG 00388000 B FRETX GO RELEASE BUFFER 00389000 DROP R15 00390000 SPACE 00391000 * 00392000 KILLX EQU * 00393000 L R15,AFVS POINT TO FVSECT @VA07100 00393100 USING FVSECT,R15 FOR ADDRESSABILITY @VA07100 00393200 CLI UFDBUSY,X'02' IS ABEND IN PROCESS ? @VA07100 00393300 BE NORMRD GO BACK TO ABEND PROCESSING @VA07100 00393400 CLC DATIPCMS(4),=F'0' IPL STORAGE SET? @VA14055 00393430 BE NORMRD NO - SO SKIP THE MESS @VA14055 00393460 OI TSOFLAGS,TSOATCNL INDICATE ATTN DURING READ @VA02650 00393500 OI KXFLAG,KXWANT INDICATE KX HAS OCCURRED 00396000 DROP R15 00397000 B FRETX GO RELEASE THE 'ATTN' BUFFER 00398000 * @V2D2721 00398250 HLTBAT OI BATFLAG2,BATSTOP STOP BATCH AFTER CURRENT JOB@V2D2721 00398500 B FRETX GO RELEASE THE LINE BUFFER @V2D2721 00398750 * 00399000 KILTYP OI MSGFLAGS,NOTYPING SET "KT" FLAG-BIT 00400000 LA R9,CONSTACK 00401000 SR 8,8 00402000 DELETE C R9,PENDWRIT YES, ARE WE AT END OF ENTRIES? 00403000 BNL ENDELETE YES, GO AWAY 00404000 TM 0(9),X'80' IS ENTRY A PRIORITY TYPE? 00405000 BO SKPDELET YES, DON'T DELETE IT FROM STACK 00406000 LR 1,9 NO, GO OVERLAY THIS ENTRY WITH ALL ABOVE 00407000 BAL 14,PACK 00408000 B DELETE 00409000 ENDELETE STH R8,NUMPNDWR RESET NUMBER OF WRITES IN STACK 00410000 FRETX L R1,PENDREAD GET ADDRESS OF READ WORK AREA 00411000 XC PENDREAD,PENDREAD ZERO PENDING READ POINTER 00412000 LA 0,17 00413000 DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR 00414000 B CKWRTSTK GO LOOK FOR SOME TYPING TO DO 00415000 * 00416000 SKPDELET SR 1,1 00417000 IC 1,1(,9) GET LENGTH OF PRIORITY ENTRY 00418000 LA 9,2(1,9) UPDATE R9 TO BYPASS IT 00419000 LA 8,1(,8) 00420000 B DELETE 00421000 EJECT 00422000 SETWAIT EQU * @VA05051 00422100 OI MISFLAGS,ATTNHIT SET ATTENTION BIT @VA05051 00422200 USING CMSTAXE,R1 @V1D1709 00422500 HNDLATTN L R1,TAXEADDR GET EXIT QUEUE ADDR 00423000 LTR R1,R1 DOES ONE EXIST 00424000 BZ ATTNREAD NO, START AN ATTENTION READ 00425000 NC PENDREAD(4),PENDREAD IS THERE A PENDING READ? @VA01844 00425200 BZ TESTEXC IF SO, CANCEL IT @VA01844 00425400 OI TSOFLAGS,TSOATCNL ... AND INDICATE SO @VA01844 00425600 XC PENDREAD(4),PENDREAD ........... @VA01844 00425800 TESTEXC EQU * @V1D1709 00426000 TM TAXESTAT,TAXEFREQ HAS EXIT BEEN TAKEN @V1D1709 00426500 BNO ACTIVE NO, IT WILL BE NEXT 00427000 L R1,TAXELNK YES, LOOK AT NEXT @V1D1709 00428000 LA R1,0(0,R1) CLEAR HI BYTE 00429000 LTR R1,R1 IS THERE ANOTHER 00430000 BNP ATTNREAD NO MORE EXITS, ISSUE READ 00431000 B TESTEXC GO CHK THIS EXIT BLOCK 00432000 ACTIVE L R14,AIOSECT ADR OF I/O SAVE AREA 00433000 MVC TAIERSAV(64),0(R14) SAVE ATTN TIME REGS IN TAIE @V1D1709 00434000 TM IOOPSW+1,WAIT WAS CMS WAITING? @VA05024 00434100 BZ MVPSW BRANCH IF NOT @VA05024 00434200 L R14,WAITSAVE+4 GET WAITD PLIST POINTER @VA05024 00434300 LA R14,CON8(,R14) POINT TO SYMBOLIC NAMES @VA05024 00434400 SR R15,R15 CLEAR A REGISTER @VA05024 00434500 CHKSYM EQU * @VA05024 00434600 CLC CONSOLE,0(R14) WAITING ON CONSOLE? @VA05024 00434700 BE NIPSW BRANCH IF SO @VA05024 00434800 LA R14,CON4(,R14) POINT TO NEXT NAME @VA05024 00434900 C R15,0(,R14) IS THERE ONE? @VA05024 00435000 BNE CHKSYM BRANCH IF YES @VA05024 00435100 TM OSSFLAGS,OSWAIT SLEEPING ON OS ECB? @V305665 00435440 BZ MVPSW BRANCH IF NOT @V305665 00435460 NIPSW NI IOOPSW+1,255-WAIT WAKE UP SLEEPING PRINCESS @V2D4598 00435540 MVPSW EQU * @V1D1709 00435600 MVC TAXEIOL(4),IOOPSW SAVE LEFT HALF IO OLD PSW @V1D1709 00436000 MVC TAIEIAD(4),IOOPSW+4 SAVE RIGHT HALH IO OLD PSW @V1D1709 00436400 MVC TAXETSOF(1),TSOFLAGS SAVE CANCELLED READ @V1D1709 00436800 NI TSOFLAGS,255-TSOATCNL RESET CANCEL READ FLAG P3108 00437000 ST R12,TAXERTNA SAVE RETURN ADDR. @V1D1709 00438000 LA R14,STAXRET SET RETURN LOCATION 00439000 LA R13,TAXEEXTS SET UP SAVE AREA @V1D1709 00440000 MVC TAXEIOWS(44),WAITSAVE SAVE DMSIOW REGS. @V1D1709 00441000 XC NUMPNDWR(2),NUMPNDWR CLEAR WRITE STACK V0001 00441100 LA R15,CONSTACK V0001 00441200 ST R15,PENDWRIT V0001 00441300 L R15,TAXEEXIT LOAD EXIT ADDR. @V1D1709 00442000 OI TAXESTAT,TAXEFREQ INDICATE EXIT TAKEN @V1D1709 00442300 DROP R1 @V1D1709 00442600 USING CMSTAXE,R2 @V1D1709 00442900 LR R2,R1 PUT ARRD TAXE INTO R2 @V1D1709 00443200 LA R1,TAIEMSGL GET ADDR. OF TAIE @V1D1709 00443500 ST R1,TAXETAIE PUT IT IN PARAMETER LIST @V1D1709 00443800 LA R1,TAXETAIE SET R1 TO ATTN EXIT PARA LIST@V1D1709 00444100 LPSW 0(R2) GO TO EXIT ROUTINE @V1D1709 00444400 DROP R2 @V1D1709 00444700 STAXRET BALR R13,0 REESTABLISH ADDR. 00445000 USING *,R13 00446000 L R13,BASELOC 00447000 USING DMSCITA,R13 00448000 SSM *+1 GO DISABLED 00449000 L R1,TAXEADDR GET EXIT QUEUE 00450000 USING CMSTAXE,R1 @V1D1709 00451000 STAXRET2 EQU * @V1D1709 00451300 L R2,TAXELNK POINTER TO NEXT TAXE @V1D1709 00451600 LA R2,0(0,R2) CLEAR HI BYTE P3108 00452000 LTR R2,R2 ANY MORE 00453000 BZ STAXRET1 NO, R1 HAS RIGHT CMSTAXE 00454000 TM 8(R2),TAXEFREQ WAS THIS EXIT TAKEN @V1D1709 00455000 BNO STAXRET1 NO, MUST BE RET FROM PREVIOUS EXIT 00456000 LR R1,R2 YES, LOOK AT NEXT EXIT 00457000 B STAXRET2 00458000 STAXRET1 EQU * @V1D1709 00459000 NI TAXESTAT,255-TAXEFREQ RESET 'TAKEN' INDICATOR @V1D1709 00459500 L R12,TAXERTNA RESTORE RETURN ADDR. @V1D1709 00460000 NI MISFLAGS,255-ATTNHIT REMOVE ATTENTION BIT @VA05051 00460500 L R6,AIOSECT ADDRESS OF IO SAVE AREA 00461000 MVC 0(64,R6),TAIERSAV RESTORE REGS FROM ATTN RTN. @V1D1709 00462000 MVC IOOPSW(4),TAXEIOL RESTORE LEFT HALF IO OLD PSW @V1D1709 00462500 MVC IOOPSW+4(4),TAIEIAD RESTORE RT HALF IO OLD @V1D1709 00463000 MVC WAITSAVE(44),TAXEIOWS RESTORE DMSIOW REGS. @V1D1709 00463500 TM TAXETSOF,TSOATCNL WAS READ CANCELLED? @V1D1709 00464000 BNO CLR15 @VA05885 00466100 OI TSOFLAGS,TSOATCNL YES, SET FLAG P3108 00467000 B CLR15 @VA05885 00469100 DROP R1 @V1D1709 00469500 ATTNREAD LA R0,17 17 DBL WORDS READ WORK AREA 00470000 DMSFREE DWORDS=(0),TYPCALL=BALR 00471000 MVI 0(1),0 ZERO OUT THE AREA 00472000 MVC 1(135,1),0(1) 00473000 ST R1,PENDREAD SAVE ADDRESS OF AREA 00474000 MVI 4(1),X'4A' SET FLAG FOR ATTENTION READ 00475000 MVI 5(1),130 SET DESIRED LENGTH TO 130 00476000 LA 1,4(,1) SET R1 FOR 'STNEWCON' 00477000 STRTCON1 LA R15,DMSCITB START CONSOLE 00481000 BALR 14,15 00482000 LTR 15,15 GOOD SIO? 00483000 BNZ ATTNPEND NO, CHECK FOR ATTENTION PENDING @VA02650 00484300 TM TSOFLAGS,TSOATCNL WAS READ TERMINATED BY ATTN? @VA02650 00484600 BZ EXIT NO, GO AWAY @VA02650 00484900 LA R15,5 INDICATE THAT READ TERM. BY ATTN @VA02650 00485200 B EXIT GET OUT @VA02650 00485500 ATTNPEND CLI CSW+4,X'90' ATTENTION PENDING? @VA02650 00485800 BE STRTCON1 YES, IGNORE AT THIS TIME 00486000 BAL R14,CITERR1 00487000 EJECT 00488000 USING DMSCITB,R15 00489000 DMSCITB DS 0H @V2D4598 00489500 SR R8,R8 @V2D4598 00490000 MVN CONCCWS(1),0(R1) MOVE CCW OPCODE '1' OR 'A' @V2D4598 00490500 LA R7,LNNORMOP(,R1) DATADDR (ASSUMING SHORT OP) @V2D4598 00491000 IC R8,TONRMLEN(,R1) LENGTH (DITTO) @V2D4598 00491500 TM 0(R1),LONGOP IS IT SHORT? @V2D4598 00492000 BNO BUILD YES, CONTINUE @V2D4598 00492500 ICM R7,B'0111',TOLNGADR(R1) NO, R7 GETS ADDRESS, @V2D4598 00493000 ICM R8,B'0011',TOLNGLEN(R1) AND R8 GETS LENGTH @V2D4598 00493500 BUILD STCM R7,B'0111',CONCCWS+1 STORE BUFFER ADDRESS @V2D4598 00494000 STH R8,CONCCWS+6 AND LENGTH @V2D4598 00494500 LA 8,CONCCWS GET ADDRESS OF CCW CHAIN 00495000 TRYAGAIN ST 8,CAW SET CAW 00496000 SIO 0(9) ISSUE SIO 00497000 BC 7,CKCC START OK? 00498000 ST R1,CURRIOOP YES, SAVE WORKAREA ADDRESS 00499000 SR R7,R7 CLEAR R7 FOR RETURN CODE @VA04854 00499125 RETURN TM 0(R1),X'01' WAS THIS A WRITE? @VA04854 00499250 BNO RETURN1 NO; NOTHING TO FREE @VA04854 00499375 TM 0(R1),LONGOP YES; WAS IT A "LONG" ONE? @VA04854 00499500 BNO RETURN1 NO; NOTHING TO FREE @VA04854 00499625 LH R8,TOLNGLEN(,R1) YES; GET LENGTH OF LINE, @VA04854 00499750 ICM R1,B'0111',TOLNGADR(R1) AND ITS ADDRESS @VA04854 00499875 LA R0,7(,R8) ROUND UP THE LENGTH, @VA04854 00500000 SRL R0,3 AND EXPRESS IT IN DOUBLEWORDS @VA04854 00500125 LR R8,R14 SAVE RETURN ADDRESS @VA04854 00500250 DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR @VA04854 00500375 LR R14,R8 RESTORE RETURN ADDRESS @VA04854 00500500 RETURN1 LR R15,R7 RESTORE RETURN CODE @VA04854 00500625 BR R14 RETURN TO CALLER @VA04854 00500750 * 00502000 CKCC BC 3,CCERR BRANCH IF NOT CSW STORED 00503000 CLI CSW+4,X'14' WAS IT NOT-READY TO READY PENDING 00504000 BE TRYAGAIN YES, REISSUE START I/O 00505000 LA R7,4 SET ERROR RETURN CODE @VA04854 00506000 B RETURN1 @VA05913 00507100 * 00508000 CCERR BC 1,CC3 BAD ERROR, BREAKIT TO 2 OR 3 00509000 TIO 0(9) UNIT BUSY, WAIT FOR END 00510000 BC 7,CCERR 00511000 B TRYAGAIN 00512000 * 00513000 CC3 EQU * @VA06123 00513500 L R13,=A(DMSCITA) @VA06123 00514000 DROP R15 @VA06123 00514500 USING DMSCITA,R13 @VA06123 00515000 BAL R14,CITERR1 TERMINATE @VA06123 00515500 EJECT 00517000 * ROUTINE TO PACK NEWER ENTRIES IN 'STKBUF' DOWN OVER 00518000 * SPECIFIED ENTRY TO BE DELETED. ON ENTRY, R1 HAS 00519000 * THE ADDRESS OF ENTRY TO BE OVERLAYED. 00520000 * ROUTINE DOES NOT SAVE REGISTERS, AND USES THE FOLLOWING 00521000 * REGISTERS: R4,R5,R6,R7. @V2D4598 00522000 * @V2D4598 00523000 PACK DS 0H @V2D4598 00524000 LA R4,LNLONGOP ASSUME R1 PTS TO LONG WRITE @V2D4598 00525000 TM 0(R1),LONGOP IS IT ONE? @V2D4598 00526000 BO PACK2 -YES, NEXT OP AT R1+LNLONGOP @V2D4598 00527000 IC R4,TONRMLEN(,R1) NO, NEXT WRITE AT R1 + ... @V2D4598 00528000 LA R4,LNNORMOP(,R4) ...LNNORMOP+DATASIZE @V2D4598 00529000 * @V2D4598 00530000 PACK2 ALR R4,R1 R4 POINTS TO NEXT WRITE @V2D4598 00531000 L R5,PENDWRIT R5 POINTS TO END OF STACK @V2D4598 00532000 CR R4,R5 ARE THERE MORE? @V2D4598 00533000 ST R1,PENDWRIT (ASSUME NOT) @V2D4598 00534000 BNLR R14 EXIT IF NOTHING TO MOVE @V2D4598 00535000 * @V2D4598 00536000 SLR R5,R4 R5 IS LENGTH OF STACKED WRITES @V2D4598 00537000 LR R7,R5 SO IS R7, FOR MVCL @V2D4598 00538000 LR R6,R1 R6 IS SINK, R4 IS SOURCE @V2D4598 00539000 MVCL R6,R4 PACK THE WRITE-STACK DOWN @V2D4598 00540000 ST R6,PENDWRIT CORRECT END-OF-STACK PTR @V2D4598 00541000 BR R14 AND EXIT @V2D4598 00542000 EJECT 00548000 USING *,13 00549000 DMSCITDB EQU * @VA06123 00550000 LR R13,R15 @VA06123 00550100 LR 6,14 SAVE RETURN-ADDRESS 00551000 LA R14,CONSTACK RESET WRITE-STACK POINTER 00552000 ST R14,PENDWRIT ... 00553000 SR 3,3 00554000 STH R3,NUMPNDWR 00555000 LH R4,NUMFINRD ANY READ BUFFERS TO RELEASE 00556000 LTR 4,4 00557000 BZ CKPENRD NO, MAYBE NOT 00558000 L 5,FSTFINRD MAYBE YES 00559000 CKFINRD LTR 1,5 00560000 BZ CKPENRD NO ADDRESS, IGNORE CHAIN 00561000 L R5,0(,R1) GET NEXT AREA ADDRESS 00562000 TM 4(1),X'40' IS IT AN 'ATTN' BUFFER? 00563000 BZ CKR4 NO, DON'T FREE IT 00564000 LA 0,17 YES, FREE IT UP 00565000 DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR 00566000 CKR4 BCT 4,CKFINRD LOOP IF MORE 00567000 CKPENRD ST 3,FSTFINRD INSURE CONSTANTS ARE SET TO ZERO 00568000 ST 3,LSTFINRD 00569000 STH 3,NUMFINRD 00570000 L R5,PENDREAD IS THERE A PENDING READ ? 00571000 LTR 1,5 00572000 BZ ENDES NO ADDRESS, SO IGNORE IT 00573000 TM 4(1),X'40' IS IT AN ATTENTION READ? 00574000 BZ ENDES NO, DON'T RELEASE IT 00575000 LA 0,17 YES 00576000 DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR 00577000 ENDES ST R3,PENDREAD INSURE ZERO CONSTANTS 00578000 LR 14,6 RESTORE RETURN-ADDRESS 00579000 SR 15,15 00580000 BR 14 00581000 DS 0D 00582000 BASELOC DC A(DMSCITA) 00584000 CONSOLE DC CL4'CON1' @VA06165 00584100 CON4 EQU 4 @VA06165 00584110 CON8 EQU 8 @VA06165 00584120 SPACE 2 00585000 LTORG 00586000 SPACE 00587000 NUCDSECT DSECT 00588000 NCDEVAD DS H 00589000 NCSTATS DS H 00590000 NCWAITB EQU NCSTATS 00591000 NCDEVTP EQU NCSTATS+1 00592000 NCNAME DS CL4 00593000 NCINTRTN DS A 00594000 NUCNSIZE EQU *-NUCDSECT 00595000 * @V2D4598 00595040 * EQUATES TO DESCRIBE CONSOLE OP-STRINGS @V2D4598 00595080 * @V2D4598 00595120 LNNORMOP EQU 2 LENGTH OF A NORMAL CONSOP @V2D4598 00595160 LNLONGOP EQU 6 '' '' LONG '' @V2D4598 00595200 TONRMLEN EQU 1 OFFSET TO NORMAL LENGTH-BYTE @V2D4598 00595240 TOLNGLEN EQU 4 '' '' LONG LENGTH-HLFWD @V2D4598 00595280 TOLNGADR EQU 1 '' '' LONG BUFFADDR @V2D4598 00595320 * @V2D4598 00595360 * BITS IN THE HIGH HALF OF WRITE CONSOP OPCODE @V2D4598 00595400 * @V2D4598 00595440 PRTYWRIT EQU X'80' PRIORITY WRITE OPERATION @V2D4598 00595480 * @V2D4598 00595520 * BITS IN THE HIGH HALF OF A READ OPCODE @V2D4598 00595560 * @V2D4598 00595600 RDATTNZ EQU X'80' READ TERMINATED BY ATTENTION @V2D4598 00595640 FROMATTN EQU X'40' READ IN RESPONSE TO ATTENTION @V2D4598 00595680 NOATTN EQU X'20' READ TO NOT BE RETRIED IF @V2D4598 00595720 * * ENDED BY ATTENTION @V2D4598 00595760 * @V2D4598 00595800 * BITS IN HIGH HALF OF EITHER OPCODE @V2D4598 00595840 * @V2D4598 00595880 LONGOP EQU X'10' OPERATION TO/FROM USER BUFFER @V2D4598 00595920 * @V2D4598 00595960 EJECT 00596000 NUCON 00597000 FVS 00598000 TSOBLKS @V1D1709 00598500 SVCSECT 00599000 EQUATES 00600000 REGEQU 00601000 END 00602000