Table of Contents

DMSITI Source

References

Source Listing

DMSITI.ASSEMBLE.txt
  1. ITI TITLE 'DMSITI (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. *. 00005000
  4. * MODULE: 00006000
  5. * 00007000
  6. * DMSITI P3031 00008000
  7. * 00009000
  8. * FUNCTION: 00010000
  9. * 00011000
  10. * TO HANDLE ALL INPUT/OUTPUT INTERRUPTIONS, PASS 00012000
  11. * CONTROL TO THE INTERRUPT PROCESSING ROUTINE, AND 00013000
  12. * RETURN CONTROL TO THE INTERRUPTED PROGRAM. 00014000
  13. * 00015000
  14. * ATTRIBUTES: 00016000
  15. * 00017000
  16. * NUCLEUS RESIDENT, RE-ENTRANT 00018000
  17. * 00019000
  18. * CALLING SEQUENCE: 00020000
  19. * 00021000
  20. * THIS MODULE IS ENTERED WHEN AN INPUT/OUTPUT OPERATION 00022000
  21. * CAUSES THE I/O NEW PSW TO BE LOADED. 00023000
  22. * 00024000
  23. * ENTRY REQUIREMENTS: 00025000
  24. * 00026000
  25. * NONE 00027000
  26. * 00028000
  27. * ENTRY POINTS: 00029000
  28. * 00030000
  29. * 1. DMSITI, IOINT P3031 00031000
  30. * 00032000
  31. * EXIT CONDITIONS: 00033000
  32. * 00034000
  33. * NONE. 00035000
  34. * 00036000
  35. * CALLS TO OTHER ROUTINES: 00037000
  36. * 00038000
  37. * CALLS VARIOUS INTERRUPT PROCESSING ROUTINES. 00039000
  38. * 00040000
  39. * EXTERNAL REFERENCES: 00041000
  40. * 00042000
  41. * DEVTAB, TABEND, WAITRTN, DEVICE, ADTSECT 00043000
  42. * 00044000
  43. * 00045000
  44. * TABLES/WORK-AREAS: 00046000
  45. * 00047000
  46. * USES IOSECT AS WORK AREA 00048000
  47. * 00049000
  48. * REGISTER USAGE: 00050000
  49. * 00051000
  50. * 0 TO 15 WORK REGISTERS 00052000
  51. * P3031 00053000
  52. * NOTES: P3031 00054000
  53. * P3031 00055000
  54. * NONE P3031 00056000
  55. * 00057000
  56. * OPERATION: 00058000
  57. * 00059000
  58. * DMSITI SAVES THE I/O OLD PSW AND THE CHANNEL STATUS 00060000
  59. * WORD (CSW). IT THEN DETERMINES THE NATURE OF THE 00061000
  60. * DEVICE CAUSING THE INTERRUPTION AND PASSES CONTROL TO 00062000
  61. * THE PROGRAM THAT PROCESSES INTERRUPTIONS FROM THAT 00063000
  62. * DEVICE. IT DOES THIS BY SCANNING THE ENTRIES IN THE 00064000
  63. * DEVICE TABLE (DEVTAB) UNTIL IT FINDS THE ONE 00065000
  64. * CONTAINING THE DEVICE ADDRESS THAT IS THE SAME AS 00066000
  65. * THAT OF THE INTERRUPTING DEVICE. 00067000
  66. * 00068000
  67. * WHEN THE INTERRUPT HANDLING PROGRAM CORRESPONDING TO 00069000
  68. * THE INTERRUPTING DEVICE COMPLETES ITS PROCESSING, IT 00070000
  69. * RETURNS CONTROL TO DMSITI. AT THIS POINT, DMSITI 00071000
  70. * TESTS THE WAIT BIT IN THE SAVED I/O OLD PSW. IF THIS 00072000
  71. * BIT IS OFF, IT USUALLY INDICATES THAT THE 00073000
  72. * INTERRUPTION WAS CAUSED BY A TERMINAL (ASYNCHRONOUS) 00074000
  73. * I/O OPERATION. IN THIS CASE, DMSITI RETURNS CONTROL 00075000
  74. * TO THE INTERRUPTED PROGRAM BY LOADING THE I/O OLD 00076000
  75. * PSW. 00077000
  76. * 00078000
  77. * IF THE WAIT BIT IS ONE, THIS USUALLY INDICATES THAT 00079000
  78. * THE INTERRUPTION WAS CAUSED BY A NON-TERMINAL 00080000
  79. * (SYNCHRONOUS) I/O OPERATION AND THAT THE PROGRAM THAT 00081000
  80. * INITIATED THE OPERATION CALLED THE WAIT FUNCTION 00082000
  81. * PROGRAM TO WAIT FOR A PARTICULAR TYPE OF INTERRUPTION 00083000
  82. * (USUALLY A DEVICE END, SIGNALING THE COMPLETION OF AN 00084000
  83. * I/O OPERATION). IN THIS CASE, DMSITI DETERMINES 00085000
  84. * WHETHER OR NOT AN INTERRUPTION FROM THE INTERRUPTING 00086000
  85. * DEVICE IS BEING WAITED FOR. IT DOES THIS BY CHECKING 00087000
  86. * THE PSEUDO-WAIT BIT IN THE DEVICE TABLE ENTRY FOR THE 00088000
  87. * INTERRUPTING DEVICE. IF THIS BIT IS OFF, THE SYSTEM 00089000
  88. * IS WAITING FOR SOME EVENT OTHER THAN THE INTERRUPTION 00090000
  89. * FROM THE INTERRUPTING DEVICE; DMSITI RETURNS TO THE 00091000
  90. * WAIT STATE BY LOADING THE SAVED I/O OLD PSW. (THIS 00092000
  91. * PSW HAS THE WAIT BIT ON.) 00093000
  92. * 00094000
  93. * IF THE PSEUDO-WAIT BIT IS ON, AN INTERRUPTION FROM A 00095000
  94. * PARTICULAR DEVICE IS BEING WAITED FOR. (THE WAIT 00096000
  95. * FUNCTION PROGRAM SETS THIS BIT WHEN CALLED BY A 00097000
  96. * PROGRAM THAT IS WAITING FOR AN I/O INTERRUPTION FROM 00098000
  97. * A PARTICULAR DEVICE.) IN THIS CASE, DMSITI 00099000
  98. * DETERMINES WHETHER OR NOT THE INTERRUPTION WAS THE 00100000
  99. * ONE BEING WAITED FOR. THE PROGRAM THAT PROCESSES THE 00101000
  100. * INTERRUPTION FROM THE INTERRUPTING DEVICE WILL INFORM 00102000
  101. * DMSITI OF THIS. IF THE INTERRUPTION IS NOT THE ONE 00103000
  102. * BEING WAITED FOR, IOINT LOADS THE SAVED I/O OLD PSW. 00104000
  103. * THIS WILL AGAIN PLACE THE MACHINE IN THE WAIT STATE. 00105000
  104. * 00106000
  105. * IF THE INTERRUPTION IS THE ONE BEING WAITED FOR, 00107000
  106. * DMSITI RESETS BOTH THE PSEUDO-WAIT BIT IN THE DEVICE 00108000
  107. * TABLE ENTRY AND THE WAIT BIT IN THE I/O OLD PSW. IT 00109000
  108. * THEN LOADS THAT PSW. THIS CAUSES CONTROL TO BE 00110000
  109. * RETURNED TO THE WAIT FUNCTION PROGRAM, WHICH, IN 00111000
  110. * TURN, RETURNS CONTROL TO THE PROGRAM THAT CALLED IT 00112000
  111. * TO WAIT FOR THE INTERRUPTION. 00113000
  112. * 00114000
  113. *. 00115000
  114. EJECT 00116000
  115. IOINT START 0 00117000
  116. ENTRY DMSITI P3031 00118000
  117. DMSITI EQU * P3031 00119000
  118. USING NUCON,R0 00120000
  119. EXTRN DEVTAB IO DEVICE TABLE IN NUCON 00121000
  120. EXTRN TABEND ... TABLE END 00122000
  121. EXTRN WAITRTN RETURN-LOCATION IN CMS 'WAIT' FUNCTION 00123000
  122. STM R12,R13,0 SAVE REGISTERS 12 AND 13 00124000
  123. BALR R12,0 OUR ADDRESSABILITY, 00125000
  124. USING *,R12 (IN R12 = "BASE") 00126000
  125. L R13,AIOSECT REFERENCE IOSECT 00127000
  126. USING IOSECT,R13 ... 00128000
  127. STM R0,R15,IOSAVE SAVE ALL REGISTERS, 00129000
  128. MVC IOSAVE+R12*4(8),0 PUT R12 AND R13 WITH OTHER REGS 00130000
  129. LA R14,GO (IN CASE INTERRUPT TO BE IGNORED) 00131000
  130. LM R4,R7,TRUNCR LM R4-R7 FOR HANDY USE, 00132000
  131. LM R8,R11,IONTABL DITTO R8-R11. 00133000
  132. N R4,IOOPSW GET INTERRUPTING DEVICE ADDRESS 00134000
  133. LTR R9,R9 DOES USER-DEFINED-TABLE EXIST AT ALL ? 00135000
  134. BZ TRYREG BZ IF NOT, TRY REGULAR TABLE. 00136000
  135. LA R15,FOUNDU SET FOR FOUND IN USER TABLE. 00137000
  136. SRCHU CH R4,DEVAD(,R9) DOES DEVICE MATCH THAT IN TABLE ? 00138000
  137. BCR 8,R15 'BE' IF YES, WE FOUND IT. 00139000
  138. BXLE R9,R10,SRCHU KEEP LOOKING THRU USER-DEFINED-TABLE. 00140000
  139. TRYREG LA R15,FOUNDR IF NOT THERE, TRY REGULAR DEVICE-TABLE 00141000
  140. SRCH2 CH R4,DEVAD(,R5) IS THIS THE INTERRUPTING DEVICE ? 00142000
  141. BCR 8,R15 'BE' IF YES, WE'VE GOT IT. 00143000
  142. BXLE R5,R6,SRCH2 KEEP LOOKING THRU REGULAR TABLE. 00144000
  143. STH R4,VSTRANGE SAVE VERY STRANGE DEVICE-NOT IN ANY TABLE 00145000
  144. B RETURN AND GO RETURN WHENCE WE CAME ANYHOW. 00146000
  145. SPACE 00147000
  146. * COMES HERE IF INTERRUPTING DEVICE FOUND IN USER-DEFINED-TABLE. 00148000
  147. FOUNDU L R15,INTLOC(,R9) INTERRUPT-ROUTINE-ADDRESS INTO R15, 00149000
  148. ST R9,HOLD SAVE ENTRY-POINTER FOR THIS DEVICE, 00150000
  149. LTR R15,R15 IS INTERRUPT TO BE IGNORED ? 00151000
  150. BCR 8,R14 'BZ' IF YES, 'GO' ON... 00152000
  151. * SET UP REGS 0-3 AS EXPECTED BY DMSHDI P0140 00153000
  152. LM 0,1,IOOPSW SET UP I/O OLD PSW P0140 00154000
  153. LM 2,3,CSW SET UP CSW P0140 00155000
  154. MVC SAVINT(16,R9),IOOPSW SAVE THE INTERRUPT INFORMATION 00156000
  155. TM STATS(R9),ASAP IF NOT, ARE WE TO HANDLE INTERRUPT 'ASAP' 00159000
  156. BO BALR14 BO IF YES, GO TO INTERRUPT ROUTINE NOW. 00160000
  157. TM STATS(R9),PSDOW EXPECTING THIS INTERRUPT ? V0374 00160100
  158. BO BALR14 BO IF YES, GO TO INTERRUPT RTN. V0374 00160200
  159. OI STATS(R9),INTR IF NOT, INDICATE INTERRUPT RECEIVED 00161000
  160. NI STATS(R9),255-INTP BUT NOT YET PROCESSED 00162000
  161. B RETURN ('WAIT' WILL HANDLE IT LATER) 00163000
  162. SPACE 1 00164000
  163. * COMES HERE IF INTERRUPTING-DEVICE IS IN REGULAR (NUCON) TABLE 00165000
  164. FOUNDR L R15,INTLOC(,R5) ADDRESS OF INT. ROUTINE INTO R15, 00166000
  165. ST R5,HOLD SAVE ENTRY-POINTER FOR THIS DEVICE, 00167000
  166. L R3,ADIOSECT REFERENCE DIOSECT 00168000
  167. USING DIOSECT,R3 00169000
  168. MVC OLDEST(32),NEXTO SAVE THE LAST 3 INTERRUPTS, AND 00170000
  169. MVC IOPSW(16),IOOPSW SAVE NEWEST IO-OLD-PSW & CSW 00171000
  170. MVC IOOLD(16),IOOPSW ... 00172000
  171. DROP R3 00173000
  172. LTR R15,R15 IS INTERRUPT TO BE IGNORED ? 00174000
  173. BCR 8,R14 'BZ' IF YES, 'GO' ON ... 00175000
  174. BALR14 BALR R14,R15 CALL APPROPRIATE INTERRUPT ROUTINE... 00176000
  175. * ON RETURN, ASSUME ONLY THAT R14 IS CORRECT ... 00177000
  176. DROP R12 00178000
  177. USING GO,R14 NEW ADDRESSABILITY ... 00179000
  178. GO L R13,AIOSECT RESTORE R13 DSECT ADDRESSABILITY, 00180000
  179. L R5,HOLD 'HOLD' BACK INTO R5, 00181000
  180. LM R6,R9,ADCON6 AND OTHER GOOD STUFF INTO R6-R9 00182000
  181. TM STATS(R5),PSDOW WERE WE WAITING FOR THIS INT. ? 00183000
  182. BZ FURCHEK BZ IF APPARENTLY NOT, MAKE FURTHER CHECK 00184000
  183. LTR 15,15 DOES INTERRUPT HANDLER EXPECT ANOTHER? 00185000
  184. BCR 7,R9 'BNZ' IF YES (R15 NONZERO), NEEDS ANOTHER 00186000
  185. NI IOOPSW+1,255-WAIT NO,CLEAR WAIT BIT 00187000
  186. NI STATS(R5),255-PSDOW-INTR-INTP CLEAR PSDOW,INTR,INTP BITS 00188000
  187. MVC 0(4,R6),NAME(R5) SAVE NAME OF INTERRUPTING DEVICE 00189000
  188. L R1,TAXEADDR GET EXIT QUEUE ADDRESS @VA05024 00189050
  189. LTR R1,R1 IS THERE ONE? @VA05024 00189100
  190. BZ GO3 BRANCH IF NOT @VA05024 00189150
  191. USING CMSTAXE,R1 @VA05024 00189200
  192. GO1 EQU * THERE EXITS RUN ENABLED!! @VA05024 00189250
  193. TM TAXESTAT,TAXEFREQ IS IT ACTIVE? @VA05024 00189300
  194. BZ GO2 BRANCH IF NOT @VA05024 00189350
  195. NI TAXEIOL+1,255-WAIT REMOVE WAIT BIT @VA05024 00189400
  196. GO2 EQU * @VA05024 00189450
  197. L R1,TAXELNK GET NEXT EXIT ADDRESS @VA05024 00189500
  198. LA R1,0(,R1) CLEAR HIGH BYTE @VA05024 00189550
  199. LTR R1,R1 IS THERE ONE? @VA05024 00189600
  200. BNZ GO1 BRANCH IF YES @VA05024 00189650
  201. GO3 EQU * @VA05024 00189700
  202. L 15,IOOPSW+4 GET 'WAIT' RETURN ADDRESS 00190000
  203. MVC IPLPSW(8),IONPSW CREATE PSW @VA12844 00191000
  204. ST 15,IPLPSW+4 ADD WAIT ADDR TO PSW @VA12844 00191500
  205. LM 0,15,IOSAVE RESTORE ALL OTHER REGS @VA12844 00192000
  206. LPSW IPLPSW GO BACK TO WAIT TO CONTINUE PROCE @VA12844 00192500
  207. SPACE 1 00193000
  208. FURCHEK DS 0H MAKE FURTHER CHECK IF PSEUDO-WAIT-BIT WASN'T SET... 00194000
  209. CR R5,R7 WAS THIS INT FROM THE CONSOLE? V0690 00195100
  210. BE WAITCHK YES, NO NEED TO SET FLAGS V0690 00195200
  211. C R8,INTLOC(,R5) DOES INT RTN EXIST FOR THIS DEVICE? V0690 00195300
  212. BE WAITCHK IF NOT, THROW IT AWAY V0690 00195400
  213. LTR R15,R15 WAS INT RTN SATISFIED? V0690 00195500
  214. BNZ WAITCHK NO, DON'T MARK IT PROCESSED V0690 00195600
  215. OI STATS(R5),INTR+INTP MARK IT REC'D AND PROCESSED V0690 00195700
  216. SPACE 1 V0690 00195800
  217. WAITCHK CLC IOOPSW+5(3),AWAITRN+1 DID WE COME FROM CMS WAIT? V0690 00195900
  218. BE RETURN YES, RETURN V0690 00196000
  219. TM MISFLAGS,ATTNHIT WAS ATTENTION HIT? @VA05051 00196200
  220. BZ CLRWAIT BRANCH IF NOT @VA05051 00196300
  221. OI IOOPSW+1,WAIT SET WAIT BIT OF PSW @VA05051 00196400
  222. B RETURN AND CONTINUE @VA05051 00196500
  223. CLRWAIT EQU * @VA05051 00196600
  224. NI IOOPSW+1,255-WAIT REMOVE WAIT BIT @VA05051 00196700
  225. * 00207000
  226. RETURN EQU * 00208000
  227. L R15,AFVS POINT TO FVSECT 00209000
  228. USING FVSECT,R15 00210000
  229. CLI KXFLAG,KXWANT HAS A 'KX' OCCURRED? 00211000
  230. BNE RETURNOK RETURN IS OK IF NOT 00212000
  231. CLI UFDBUSY,0 IS UFD BUSY? 00213000
  232. BNE RETURNOK BETTER RETURN IF SO 00214000
  233. SPACE 00215000
  234. * GO TO KX (KILL EXECUTION) ROUTINE IN THE ABEND RECOVERY MODULE. 00216000
  235. * WE COPY ALL REGISTERS AND PSW INTO THE DMSABN WORK AREA. 00217000
  236. TM TSOFLAGS,TSOATCNL IS FLAG ON? @VA02650 00218200
  237. BZ KILLIT NO, PROCEED ON @VA02650 00218400
  238. NI TSOFLAGS,255-TSOATCNL RESET READ CANCELLED FLAG @VA02650 00218600
  239. KILLIT L R15,=V(DMSABW) POINT TO DMSABN WORK AREA @VA02650 00218800
  240. USING ABWSECT,R15 00219000
  241. MVC ABNREGS(4*16),IOSAVE COPY REGISTERS INTO WORK AREA 00220000
  242. MVC ABNPSW,IOOPSW COPY OVER RESUME PSW 00221000
  243. LA R0,X'222' LOAD ABEND CODE 00222000
  244. STH R0,ABNPSW+2 STORE INTO ABN PSW 00223000
  245. L R15,=V(DMSABNGO) LOAD ENTRY POINT TO DMSABN 00224000
  246. BR R15 AND TRANSFER THERE 00225000
  247. SPACE 00226000
  248. RETURNOK EQU * 00227000
  249. LM R0,R15,IOSAVE RESTORE ALL REGISTERS AND 00228000
  250. LPSW IOOPSW RETURN TO USER 00229000
  251. EJECT 00230000
  252. * 00231000
  253. * CONSTANTS, ETC. 00232000
  254. * 00233000
  255. DS 0F KEEP THE FOLLOWING FOUR IN ORDER .... 00234000
  256. TRUNCR DC X'000007FF' (TO OBTAIN DEVICE WHICH INTERRUPTED) 00235000
  257. ADEVTB DC A(DEVTAB) (R5) ADDRESS OF 1ST ENTRY IN REG. TABLE 00236000
  258. DC F'16' (R6) LENGTH OF EACH ENTRY 00237000
  259. DC A(TABEND-16) (R7) END OF REGULAR DEVICE TABLE 00238000
  260. * 00239000
  261. ADCON6 DS 0F KEEP THE FOLLOWING IN ORDER 00240000
  262. DC V(DEVICE) R6 - 'DEVICE' IN NUCON FOR WAIT 00241000
  263. DC V(CONSOLE) R7 - TO CHECK FOR CONSOLE INTRPT.@VA04225 00242000
  264. DC F'0' (R8) 00243000
  265. DC A(RETURN) (INTO R9 FOR BCR INSTRUCTIONS) 00244000
  266. * 00245000
  267. AWAITRN DC A(WAITRTN) RETURN-LOCATION IN CMS 'WAIT' FUNCTION 00246000
  268. * 00247000
  269. CLEANDE DC X'0000000004000000' 'CLEAN' DE ALL BY ITSELF 00248000
  270. * 00249000
  271. DEVAD EQU 0 DEVICE ADDRESS IN TABLE 00250000
  272. STATS EQU 2 STATUS HALF-WORD 00251000
  273. NAME EQU 4 00252000
  274. INTLOC EQU 8 00253000
  275. SAVINT EQU 12 TO SAVE IO-OLD-PSW & CSW (IF APPLICABLE) 00254000
  276. * 00255000
  277. LTORG 00255100
  278. DMSABW 00256000
  279. FVS 00257000
  280. PSDOW EQU X'80' PSEUDO-WAIT-BIT (SAME AS ALWAYS) 00258000
  281. ASAP EQU X'40' INTERRUPT TO BE HANDLED AS SOON AS POSSIBLE 00259000
  282. INTR EQU X'20' INTERRUPT HAS BEEN RECEIVED 00260000
  283. INTP EQU X'10' INTERRUPT HAS BEEN PROCESSED 00261000
  284. KEEP EQU X'08' KEEP IONTABL BETWEEN CMS COMMANDS 00262000
  285. EJECT 00263000
  286. IOSECT 00264000
  287. DIOSECT 00265000
  288. NUCON 00266000
  289. TSOBLKS @VA05024 00266500
  290. EQUATES 00267000
  291. REGEQU 00268000
  292. END 00269000