ITI TITLE 'DMSITI (CMS) VM/370 - RELEASE 6' 00001000
SPACE 2 00002000
*. 00005000
* MODULE: 00006000
* 00007000
* DMSITI P3031 00008000
* 00009000
* FUNCTION: 00010000
* 00011000
* TO HANDLE ALL INPUT/OUTPUT INTERRUPTIONS, PASS 00012000
* CONTROL TO THE INTERRUPT PROCESSING ROUTINE, AND 00013000
* RETURN CONTROL TO THE INTERRUPTED PROGRAM. 00014000
* 00015000
* ATTRIBUTES: 00016000
* 00017000
* NUCLEUS RESIDENT, RE-ENTRANT 00018000
* 00019000
* CALLING SEQUENCE: 00020000
* 00021000
* THIS MODULE IS ENTERED WHEN AN INPUT/OUTPUT OPERATION 00022000
* CAUSES THE I/O NEW PSW TO BE LOADED. 00023000
* 00024000
* ENTRY REQUIREMENTS: 00025000
* 00026000
* NONE 00027000
* 00028000
* ENTRY POINTS: 00029000
* 00030000
* 1. DMSITI, IOINT P3031 00031000
* 00032000
* EXIT CONDITIONS: 00033000
* 00034000
* NONE. 00035000
* 00036000
* CALLS TO OTHER ROUTINES: 00037000
* 00038000
* CALLS VARIOUS INTERRUPT PROCESSING ROUTINES. 00039000
* 00040000
* EXTERNAL REFERENCES: 00041000
* 00042000
* DEVTAB, TABEND, WAITRTN, DEVICE, ADTSECT 00043000
* 00044000
* 00045000
* TABLES/WORK-AREAS: 00046000
* 00047000
* USES IOSECT AS WORK AREA 00048000
* 00049000
* REGISTER USAGE: 00050000
* 00051000
* 0 TO 15 WORK REGISTERS 00052000
* P3031 00053000
* NOTES: P3031 00054000
* P3031 00055000
* NONE P3031 00056000
* 00057000
* OPERATION: 00058000
* 00059000
* DMSITI SAVES THE I/O OLD PSW AND THE CHANNEL STATUS 00060000
* WORD (CSW). IT THEN DETERMINES THE NATURE OF THE 00061000
* DEVICE CAUSING THE INTERRUPTION AND PASSES CONTROL TO 00062000
* THE PROGRAM THAT PROCESSES INTERRUPTIONS FROM THAT 00063000
* DEVICE. IT DOES THIS BY SCANNING THE ENTRIES IN THE 00064000
* DEVICE TABLE (DEVTAB) UNTIL IT FINDS THE ONE 00065000
* CONTAINING THE DEVICE ADDRESS THAT IS THE SAME AS 00066000
* THAT OF THE INTERRUPTING DEVICE. 00067000
* 00068000
* WHEN THE INTERRUPT HANDLING PROGRAM CORRESPONDING TO 00069000
* THE INTERRUPTING DEVICE COMPLETES ITS PROCESSING, IT 00070000
* RETURNS CONTROL TO DMSITI. AT THIS POINT, DMSITI 00071000
* TESTS THE WAIT BIT IN THE SAVED I/O OLD PSW. IF THIS 00072000
* BIT IS OFF, IT USUALLY INDICATES THAT THE 00073000
* INTERRUPTION WAS CAUSED BY A TERMINAL (ASYNCHRONOUS) 00074000
* I/O OPERATION. IN THIS CASE, DMSITI RETURNS CONTROL 00075000
* TO THE INTERRUPTED PROGRAM BY LOADING THE I/O OLD 00076000
* PSW. 00077000
* 00078000
* IF THE WAIT BIT IS ONE, THIS USUALLY INDICATES THAT 00079000
* THE INTERRUPTION WAS CAUSED BY A NON-TERMINAL 00080000
* (SYNCHRONOUS) I/O OPERATION AND THAT THE PROGRAM THAT 00081000
* INITIATED THE OPERATION CALLED THE WAIT FUNCTION 00082000
* PROGRAM TO WAIT FOR A PARTICULAR TYPE OF INTERRUPTION 00083000
* (USUALLY A DEVICE END, SIGNALING THE COMPLETION OF AN 00084000
* I/O OPERATION). IN THIS CASE, DMSITI DETERMINES 00085000
* WHETHER OR NOT AN INTERRUPTION FROM THE INTERRUPTING 00086000
* DEVICE IS BEING WAITED FOR. IT DOES THIS BY CHECKING 00087000
* THE PSEUDO-WAIT BIT IN THE DEVICE TABLE ENTRY FOR THE 00088000
* INTERRUPTING DEVICE. IF THIS BIT IS OFF, THE SYSTEM 00089000
* IS WAITING FOR SOME EVENT OTHER THAN THE INTERRUPTION 00090000
* FROM THE INTERRUPTING DEVICE; DMSITI RETURNS TO THE 00091000
* WAIT STATE BY LOADING THE SAVED I/O OLD PSW. (THIS 00092000
* PSW HAS THE WAIT BIT ON.) 00093000
* 00094000
* IF THE PSEUDO-WAIT BIT IS ON, AN INTERRUPTION FROM A 00095000
* PARTICULAR DEVICE IS BEING WAITED FOR. (THE WAIT 00096000
* FUNCTION PROGRAM SETS THIS BIT WHEN CALLED BY A 00097000
* PROGRAM THAT IS WAITING FOR AN I/O INTERRUPTION FROM 00098000
* A PARTICULAR DEVICE.) IN THIS CASE, DMSITI 00099000
* DETERMINES WHETHER OR NOT THE INTERRUPTION WAS THE 00100000
* ONE BEING WAITED FOR. THE PROGRAM THAT PROCESSES THE 00101000
* INTERRUPTION FROM THE INTERRUPTING DEVICE WILL INFORM 00102000
* DMSITI OF THIS. IF THE INTERRUPTION IS NOT THE ONE 00103000
* BEING WAITED FOR, IOINT LOADS THE SAVED I/O OLD PSW. 00104000
* THIS WILL AGAIN PLACE THE MACHINE IN THE WAIT STATE. 00105000
* 00106000
* IF THE INTERRUPTION IS THE ONE BEING WAITED FOR, 00107000
* DMSITI RESETS BOTH THE PSEUDO-WAIT BIT IN THE DEVICE 00108000
* TABLE ENTRY AND THE WAIT BIT IN THE I/O OLD PSW. IT 00109000
* THEN LOADS THAT PSW. THIS CAUSES CONTROL TO BE 00110000
* RETURNED TO THE WAIT FUNCTION PROGRAM, WHICH, IN 00111000
* TURN, RETURNS CONTROL TO THE PROGRAM THAT CALLED IT 00112000
* TO WAIT FOR THE INTERRUPTION. 00113000
* 00114000
*. 00115000
EJECT 00116000
IOINT START 0 00117000
ENTRY DMSITI P3031 00118000
DMSITI EQU * P3031 00119000
USING NUCON,R0 00120000
EXTRN DEVTAB IO DEVICE TABLE IN NUCON 00121000
EXTRN TABEND ... TABLE END 00122000
EXTRN WAITRTN RETURN-LOCATION IN CMS 'WAIT' FUNCTION 00123000
STM R12,R13,0 SAVE REGISTERS 12 AND 13 00124000
BALR R12,0 OUR ADDRESSABILITY, 00125000
USING *,R12 (IN R12 = "BASE") 00126000
L R13,AIOSECT REFERENCE IOSECT 00127000
USING IOSECT,R13 ... 00128000
STM R0,R15,IOSAVE SAVE ALL REGISTERS, 00129000
MVC IOSAVE+R12*4(8),0 PUT R12 AND R13 WITH OTHER REGS 00130000
LA R14,GO (IN CASE INTERRUPT TO BE IGNORED) 00131000
LM R4,R7,TRUNCR LM R4-R7 FOR HANDY USE, 00132000
LM R8,R11,IONTABL DITTO R8-R11. 00133000
N R4,IOOPSW GET INTERRUPTING DEVICE ADDRESS 00134000
LTR R9,R9 DOES USER-DEFINED-TABLE EXIST AT ALL ? 00135000
BZ TRYREG BZ IF NOT, TRY REGULAR TABLE. 00136000
LA R15,FOUNDU SET FOR FOUND IN USER TABLE. 00137000
SRCHU CH R4,DEVAD(,R9) DOES DEVICE MATCH THAT IN TABLE ? 00138000
BCR 8,R15 'BE' IF YES, WE FOUND IT. 00139000
BXLE R9,R10,SRCHU KEEP LOOKING THRU USER-DEFINED-TABLE. 00140000
TRYREG LA R15,FOUNDR IF NOT THERE, TRY REGULAR DEVICE-TABLE 00141000
SRCH2 CH R4,DEVAD(,R5) IS THIS THE INTERRUPTING DEVICE ? 00142000
BCR 8,R15 'BE' IF YES, WE'VE GOT IT. 00143000
BXLE R5,R6,SRCH2 KEEP LOOKING THRU REGULAR TABLE. 00144000
STH R4,VSTRANGE SAVE VERY STRANGE DEVICE-NOT IN ANY TABLE 00145000
B RETURN AND GO RETURN WHENCE WE CAME ANYHOW. 00146000
SPACE 00147000
* COMES HERE IF INTERRUPTING DEVICE FOUND IN USER-DEFINED-TABLE. 00148000
FOUNDU L R15,INTLOC(,R9) INTERRUPT-ROUTINE-ADDRESS INTO R15, 00149000
ST R9,HOLD SAVE ENTRY-POINTER FOR THIS DEVICE, 00150000
LTR R15,R15 IS INTERRUPT TO BE IGNORED ? 00151000
BCR 8,R14 'BZ' IF YES, 'GO' ON... 00152000
* SET UP REGS 0-3 AS EXPECTED BY DMSHDI P0140 00153000
LM 0,1,IOOPSW SET UP I/O OLD PSW P0140 00154000
LM 2,3,CSW SET UP CSW P0140 00155000
MVC SAVINT(16,R9),IOOPSW SAVE THE INTERRUPT INFORMATION 00156000
TM STATS(R9),ASAP IF NOT, ARE WE TO HANDLE INTERRUPT 'ASAP' 00159000
BO BALR14 BO IF YES, GO TO INTERRUPT ROUTINE NOW. 00160000
TM STATS(R9),PSDOW EXPECTING THIS INTERRUPT ? V0374 00160100
BO BALR14 BO IF YES, GO TO INTERRUPT RTN. V0374 00160200
OI STATS(R9),INTR IF NOT, INDICATE INTERRUPT RECEIVED 00161000
NI STATS(R9),255-INTP BUT NOT YET PROCESSED 00162000
B RETURN ('WAIT' WILL HANDLE IT LATER) 00163000
SPACE 1 00164000
* COMES HERE IF INTERRUPTING-DEVICE IS IN REGULAR (NUCON) TABLE 00165000
FOUNDR L R15,INTLOC(,R5) ADDRESS OF INT. ROUTINE INTO R15, 00166000
ST R5,HOLD SAVE ENTRY-POINTER FOR THIS DEVICE, 00167000
L R3,ADIOSECT REFERENCE DIOSECT 00168000
USING DIOSECT,R3 00169000
MVC OLDEST(32),NEXTO SAVE THE LAST 3 INTERRUPTS, AND 00170000
MVC IOPSW(16),IOOPSW SAVE NEWEST IO-OLD-PSW & CSW 00171000
MVC IOOLD(16),IOOPSW ... 00172000
DROP R3 00173000
LTR R15,R15 IS INTERRUPT TO BE IGNORED ? 00174000
BCR 8,R14 'BZ' IF YES, 'GO' ON ... 00175000
BALR14 BALR R14,R15 CALL APPROPRIATE INTERRUPT ROUTINE... 00176000
* ON RETURN, ASSUME ONLY THAT R14 IS CORRECT ... 00177000
DROP R12 00178000
USING GO,R14 NEW ADDRESSABILITY ... 00179000
GO L R13,AIOSECT RESTORE R13 DSECT ADDRESSABILITY, 00180000
L R5,HOLD 'HOLD' BACK INTO R5, 00181000
LM R6,R9,ADCON6 AND OTHER GOOD STUFF INTO R6-R9 00182000
TM STATS(R5),PSDOW WERE WE WAITING FOR THIS INT. ? 00183000
BZ FURCHEK BZ IF APPARENTLY NOT, MAKE FURTHER CHECK 00184000
LTR 15,15 DOES INTERRUPT HANDLER EXPECT ANOTHER? 00185000
BCR 7,R9 'BNZ' IF YES (R15 NONZERO), NEEDS ANOTHER 00186000
NI IOOPSW+1,255-WAIT NO,CLEAR WAIT BIT 00187000
NI STATS(R5),255-PSDOW-INTR-INTP CLEAR PSDOW,INTR,INTP BITS 00188000
MVC 0(4,R6),NAME(R5) SAVE NAME OF INTERRUPTING DEVICE 00189000
L R1,TAXEADDR GET EXIT QUEUE ADDRESS @VA05024 00189050
LTR R1,R1 IS THERE ONE? @VA05024 00189100
BZ GO3 BRANCH IF NOT @VA05024 00189150
USING CMSTAXE,R1 @VA05024 00189200
GO1 EQU * THERE EXITS RUN ENABLED!! @VA05024 00189250
TM TAXESTAT,TAXEFREQ IS IT ACTIVE? @VA05024 00189300
BZ GO2 BRANCH IF NOT @VA05024 00189350
NI TAXEIOL+1,255-WAIT REMOVE WAIT BIT @VA05024 00189400
GO2 EQU * @VA05024 00189450
L R1,TAXELNK GET NEXT EXIT ADDRESS @VA05024 00189500
LA R1,0(,R1) CLEAR HIGH BYTE @VA05024 00189550
LTR R1,R1 IS THERE ONE? @VA05024 00189600
BNZ GO1 BRANCH IF YES @VA05024 00189650
GO3 EQU * @VA05024 00189700
L 15,IOOPSW+4 GET 'WAIT' RETURN ADDRESS 00190000
MVC IPLPSW(8),IONPSW CREATE PSW @VA12844 00191000
ST 15,IPLPSW+4 ADD WAIT ADDR TO PSW @VA12844 00191500
LM 0,15,IOSAVE RESTORE ALL OTHER REGS @VA12844 00192000
LPSW IPLPSW GO BACK TO WAIT TO CONTINUE PROCE @VA12844 00192500
SPACE 1 00193000
FURCHEK DS 0H MAKE FURTHER CHECK IF PSEUDO-WAIT-BIT WASN'T SET... 00194000
CR R5,R7 WAS THIS INT FROM THE CONSOLE? V0690 00195100
BE WAITCHK YES, NO NEED TO SET FLAGS V0690 00195200
C R8,INTLOC(,R5) DOES INT RTN EXIST FOR THIS DEVICE? V0690 00195300
BE WAITCHK IF NOT, THROW IT AWAY V0690 00195400
LTR R15,R15 WAS INT RTN SATISFIED? V0690 00195500
BNZ WAITCHK NO, DON'T MARK IT PROCESSED V0690 00195600
OI STATS(R5),INTR+INTP MARK IT REC'D AND PROCESSED V0690 00195700
SPACE 1 V0690 00195800
WAITCHK CLC IOOPSW+5(3),AWAITRN+1 DID WE COME FROM CMS WAIT? V0690 00195900
BE RETURN YES, RETURN V0690 00196000
TM MISFLAGS,ATTNHIT WAS ATTENTION HIT? @VA05051 00196200
BZ CLRWAIT BRANCH IF NOT @VA05051 00196300
OI IOOPSW+1,WAIT SET WAIT BIT OF PSW @VA05051 00196400
B RETURN AND CONTINUE @VA05051 00196500
CLRWAIT EQU * @VA05051 00196600
NI IOOPSW+1,255-WAIT REMOVE WAIT BIT @VA05051 00196700
* 00207000
RETURN EQU * 00208000
L R15,AFVS POINT TO FVSECT 00209000
USING FVSECT,R15 00210000
CLI KXFLAG,KXWANT HAS A 'KX' OCCURRED? 00211000
BNE RETURNOK RETURN IS OK IF NOT 00212000
CLI UFDBUSY,0 IS UFD BUSY? 00213000
BNE RETURNOK BETTER RETURN IF SO 00214000
SPACE 00215000
* GO TO KX (KILL EXECUTION) ROUTINE IN THE ABEND RECOVERY MODULE. 00216000
* WE COPY ALL REGISTERS AND PSW INTO THE DMSABN WORK AREA. 00217000
TM TSOFLAGS,TSOATCNL IS FLAG ON? @VA02650 00218200
BZ KILLIT NO, PROCEED ON @VA02650 00218400
NI TSOFLAGS,255-TSOATCNL RESET READ CANCELLED FLAG @VA02650 00218600
KILLIT L R15,=V(DMSABW) POINT TO DMSABN WORK AREA @VA02650 00218800
USING ABWSECT,R15 00219000
MVC ABNREGS(4*16),IOSAVE COPY REGISTERS INTO WORK AREA 00220000
MVC ABNPSW,IOOPSW COPY OVER RESUME PSW 00221000
LA R0,X'222' LOAD ABEND CODE 00222000
STH R0,ABNPSW+2 STORE INTO ABN PSW 00223000
L R15,=V(DMSABNGO) LOAD ENTRY POINT TO DMSABN 00224000
BR R15 AND TRANSFER THERE 00225000
SPACE 00226000
RETURNOK EQU * 00227000
LM R0,R15,IOSAVE RESTORE ALL REGISTERS AND 00228000
LPSW IOOPSW RETURN TO USER 00229000
EJECT 00230000
* 00231000
* CONSTANTS, ETC. 00232000
* 00233000
DS 0F KEEP THE FOLLOWING FOUR IN ORDER .... 00234000
TRUNCR DC X'000007FF' (TO OBTAIN DEVICE WHICH INTERRUPTED) 00235000
ADEVTB DC A(DEVTAB) (R5) ADDRESS OF 1ST ENTRY IN REG. TABLE 00236000
DC F'16' (R6) LENGTH OF EACH ENTRY 00237000
DC A(TABEND-16) (R7) END OF REGULAR DEVICE TABLE 00238000
* 00239000
ADCON6 DS 0F KEEP THE FOLLOWING IN ORDER 00240000
DC V(DEVICE) R6 - 'DEVICE' IN NUCON FOR WAIT 00241000
DC V(CONSOLE) R7 - TO CHECK FOR CONSOLE INTRPT.@VA04225 00242000
DC F'0' (R8) 00243000
DC A(RETURN) (INTO R9 FOR BCR INSTRUCTIONS) 00244000
* 00245000
AWAITRN DC A(WAITRTN) RETURN-LOCATION IN CMS 'WAIT' FUNCTION 00246000
* 00247000
CLEANDE DC X'0000000004000000' 'CLEAN' DE ALL BY ITSELF 00248000
* 00249000
DEVAD EQU 0 DEVICE ADDRESS IN TABLE 00250000
STATS EQU 2 STATUS HALF-WORD 00251000
NAME EQU 4 00252000
INTLOC EQU 8 00253000
SAVINT EQU 12 TO SAVE IO-OLD-PSW & CSW (IF APPLICABLE) 00254000
* 00255000
LTORG 00255100
DMSABW 00256000
FVS 00257000
PSDOW EQU X'80' PSEUDO-WAIT-BIT (SAME AS ALWAYS) 00258000
ASAP EQU X'40' INTERRUPT TO BE HANDLED AS SOON AS POSSIBLE 00259000
INTR EQU X'20' INTERRUPT HAS BEEN RECEIVED 00260000
INTP EQU X'10' INTERRUPT HAS BEEN PROCESSED 00261000
KEEP EQU X'08' KEEP IONTABL BETWEEN CMS COMMANDS 00262000
EJECT 00263000
IOSECT 00264000
DIOSECT 00265000
NUCON 00266000
TSOBLKS @VA05024 00266500
EQUATES 00267000
REGEQU 00268000
END 00269000