Table of Contents

DMTASY Source

References

Source Listing

DMTASY.ASSEMBLE.txt
  1. ASY TITLE 'DMTASY (RSCS) VM/370 - RELEASE 6' 00001000
  2. *. 00002000
  3. * MODULE NAME - 00003000
  4. * 00004000
  5. * DMTASY 00005000
  6. * 00006000
  7. * FUNCTION - 00007000
  8. * 00008000
  9. * DMTASY IS A SUPERVISOR SERVICE ROUTINE MODULE 00009000
  10. * WHICH INITIATES AND TERMINATES ASYNCHRONOUS EXIT 00010000
  11. * REQUESTS FOR TASK PROGRAMS. ASYNCHRONOUS EXIT 00011000
  12. * REQUESTS FOR ASYNCHRONOUS I/O INTERRUPT, EXTERNAL 00012000
  13. * INTERRUPT, AND ALERT EXIT REQUESTS ARE HANDLED BY 00013000
  14. * THIS ROUTINE. 00014000
  15. * 00015000
  16. * ATTRIBUTES - 00016000
  17. * 00017000
  18. * REUSABLE 00018000
  19. * 00019000
  20. * ENTRY POINTS - 00020000
  21. * 00021000
  22. * DMTASY - INITIATE OR TERMINATE AN ASYNCH EXIT 00022000
  23. * 00023000
  24. * ENTRY CONDITIONS - 00024000
  25. * 00025000
  26. * R0 - ASYNCH EXIT CODE: 00025500
  27. * X'00000000' FOR TASK ALERT EXIT 00026000
  28. * X'0000XXXX' FOR ASYNCH I/O INT EXIT 00026500
  29. * X'XXXX0000' FOR EXTERNAL INTERRUPT EXIT 00027000
  30. * 00027500
  31. * WHERE XXXX IS AN I/O ADDRESS OR AN EXTERNAL CODE 00028000
  32. * 00028500
  33. * R1 - ZERO TO TERMINATE A REQUEST 00029000
  34. * - ADDR OF TASK ASYNCH EXIT ROUTINE TO SET A REQUEST 00029500
  35. * 00030000
  36. * R2+R3 - FOR CLOCK COMPARATOR EXITS ONLY, CLOCK COMP VALUE 00030500
  37. * 00031000
  38. * R14 - RETURN ADDRESS 00031500
  39. * R15 - ENTRY ADDRESS 00032000
  40. * 00036000
  41. * EXIT CONDITIONS - 00037000
  42. * 00038000
  43. * NORMAL - 00039000
  44. * 00040000
  45. * GPR15 = X'00' ON ALL SUCCESSFUL REQUESTS 00041000
  46. * 00042000
  47. * ERROR - 00043000
  48. * 00044000
  49. * R15 - 04 IF TERMINATE REQ FOR NON-EXISTENT EXIT 00044500
  50. * - 08 IF INITIATE REQ OF SAME CODE FOR SAME TASK 00045000
  51. * - 0C IF INITIATING ILLEGAL EXTERNAL CODE 00045500
  52. * VALID CODES ARE: 00046000
  53. * X'1004' FOR CLOCK COMPARATOR 00046500
  54. * - 10 ERROR FROM QRQ GETTING A QUEUE ELEMENT 00047000
  55. * 00050000
  56. EJECT 00051000
  57. * 00052000
  58. * CALLS TO OTHER ROUTINES - 00053000
  59. * 00054000
  60. * DMTQRQ - TO RESERVE AND RELEASE SUP QUEUE ELEMENTS 00055000
  61. * 00056000
  62. * EXTERNAL REFERENCES - 00057000
  63. * 00058000
  64. * NONE 00059000
  65. * 00060000
  66. * 00061000
  67. * TABLES / WORKAREAS - 00062000
  68. * 00063000
  69. * DMTVEC - SUPERVISOR COMMON AREA 00064000
  70. * ASYNCH INTERRUPT EXIT REQUEST ELEMENT 00065000
  71. * TASK ELEMENT 00066000
  72. * 00067000
  73. * REGISTER USAGE - 00068000
  74. * 00069000
  75. * R0 - EXIT CODE 00070000
  76. * R1 - NEW ASYNE 00071000
  77. * R2 - TASK EXIT ADDRESS 00072000
  78. * R3 - PREVIOUS ASYNE IN CHAIN 00073000
  79. * R4 - NEXT ASYNE IN CHAIN 00074000
  80. * R5 - LINK 00075000
  81. * R6 - CALLING TASKS TASKE 00076000
  82. * R7 - WORK 00077000
  83. * R8 - WORK 00078000
  84. * R9 - LINKTABL 00079000
  85. * R10 - WORK 00080000
  86. * R11 - WORK 00081000
  87. * R12 - DMTASY BASE REG 00082000
  88. * R13 - TASK SAVE AREA POINTER 00083000
  89. * R14 - RETURN ADDRESS 00084000
  90. * R15 - ENTRY ADDRESS 00085000
  91. * 00086000
  92. * OPERATION - 00086500
  93. * 00087000
  94. * DMTASY BEGINS BY UNCONDITIONALLY SUSPENDING THE 00087500
  95. * CALLING TASK'S EXECUTION WITH A FREEZE SVC. FOR AN 00088000
  96. * INITIATE EXIT REQUEST, THE APPROPRIATE QUEUE IS 00088500
  97. * SCANNED FOR AN EXISTING SIMILAR REQUEST FOR THE SAME 00089000
  98. * TASK. IF NONE IS FOUND, A SUPERVISOR STATUS QUEUE 00089500
  99. * ELEMENT IS GOTTEN BY A CALL TO DMTQRQ, THE NEW EXIT 00090000
  100. * ELEMENT IS BUILT FROM THE SUPPLIED INFORMATION, AND 00090500
  101. * IT IS QUEUED ON THE APPROPRIATE CHAIN. 00091000
  102. * FOR CLOCK COMPARATOR REQUESTS, THE NEW REQUEST IS 00091500
  103. * QUEUED IN THE APPROPRIATE PLACE IN THE QUEUE. THE 00092000
  104. * EXTERNAL QUEUE IS ORDERED IN THE FOLLOWING WAY: 00092500
  105. * 00093000
  106. * 1. CLOCK COMPARATOR INTERRUPTS IN ASCENDING CLOCK VALUE 00093500
  107. * ORDER. 00094000
  108. * 2. ALL OTHER EXTERNAL REQUESTS. 00094500
  109. * 00095000
  110. * IF THE NEW REQUEST IS NOW THE LOWEST CLOCK REQUEST, 00095500
  111. * ITS CLOCK VALUE IS SET IN THE CLOCK COMPARATOR. 00096000
  112. * 00096500
  113. * IF AN ELEMENT IS FOUND AND A TERMINATE REQUEST IS BEING 00097000
  114. * MADE, THE ELEMENT IS DEQUEUED AND RETURNED TO THE FREEQ. 00097500
  115. * IF THE RETURNED ELEMENT REPRESENTS THE ACTIVE CLOCK 00098000
  116. * COMPARATOR, THE CLOCK COMPARATOR IS SET TO ALL F'S. 00098500
  117. * 00099000
  118. * NOTE: 00099500
  119. * 00100000
  120. * THE EXTERNAL INTERRUPT QUEUE IS MAINTAINED IN THE 00100500
  121. * FOLLOWING ORDER: 00101000
  122. * 00101500
  123. * . CLOCK COMPARATOR REQUESTS IN ASCENDING CLOCK ORDER. 00102000
  124. * THE FIRST CLOCK COMPARATOR ENTRY REPRESENTS THE 00102500
  125. * CLOCK VALUE WHICH HAS BEEN SET (UNLESS NONE HAS BEEN 00103000
  126. * REQUESTED, IN WHICH CASE THE CLOCK COMPARATOR IS FF'S) 00103500
  127. * 00104000
  128. * . ALL OTHER EXTERNAL INTERRUPT REQUESTS IN ANY ORDER. 00104500
  129. * 00105000
  130. * CLOCK COMPARATOR EXIT REQUESTS ARE INITIATED BY THIS 00105500
  131. * ROUTINE. THEY ARE TERMINATED BY EITHER A TERMINATE 00106000
  132. * REQUEST TO THIS ROUTINE OR BY THE OCCURENCE OF THE 00106500
  133. * INTERRUPT. 00107000
  134. * 00111000
  135. * 00112000
  136. *. 00113000
  137. EJECT 00114000
  138. DMTASY CSECT 00115000
  139. SPACE 00116000
  140. * ENTRY POINT FOR CALL TO DMTASY ROUTINE 00117000
  141. SPACE 00118000
  142. FREEZE SAVE CALLING TASK'S STAT AND GET S/A ADDR 00119000
  143. SPACE 00120000
  144. LR R13,R14 REG.13 = ADDRESS OF CALLER'S TASK SAVE AREA 00121000
  145. USING TAREA,R13 DEFINE TASK SAVE AREA DSECT ADDRESSA 00122000
  146. USING SVECTORS,0 GET SVECTORS ADDRESSABILITY 00123000
  147. USING ASYNE,R4 GET ASYN ELEMENT ADDRESSABILITY 00124000
  148. USING TASKE,R6 ADDRESS THE TASK ELEMENT @VA03349 00124500
  149. SPACE 00125000
  150. LA R12,0(R15) REG.12 = BASE REGISTER FOR ASYN ROUTINE 00126000
  151. USING DMTASY,R12 DEFINE DMTASY ADDRESSABILITY 00127000
  152. SPACE 00128000
  153. XC TGREG15(4),TGREG15 SET RETURN CODE TO ZERO FOR NOW 00129000
  154. LR R2,R1 SAVE EXIT ADDR IN R2 @VA03349 00130000
  155. L R6,ACTIVE GET ACTIVE TASK ELEMENT @VA03349 00130400
  156. LTR R0,R0 TASK ALERT SET REQUEST? @VA03349 00130800
  157. BNZ EXTIO NOPE, EXT OR I/O, BR. @VA03349 00131200
  158. LA R4,ALERTQ SET UP FOR ALERT CHAIN @VA03349 00131600
  159. IC R0,TASKID USE TASKID FOR CODE ON ALERTS @VA03349 00132000
  160. B SCAN01 AND PROCEED WITH THE SCAN @VA03349 00132400
  161. SPACE 00132800
  162. EXTIO LA R4,IOEXITQ ASSUME I/O EXIT REQUEST @VA03349 00133200
  163. OC TGREG0(2),TGREG0 IS IT FOR I/O? @VA03349 00133600
  164. BZ SCAN01 YES, BR @VA03349 00134000
  165. SRL R0,16 SHIFT EXT CODE TO LOW ORDER BYTES@VA03349 00134400
  166. LA R4,EXTQ GET THE EXTERNAL QUEUE ANCHOR @VA03349 00134800
  167. SPACE 00135200
  168. SCAN01 LTR R1,R1 SET OR TERMINATE REQUEST? @VA03349 00135600
  169. BZ ASYTERM TERMINATE, GO PROCESS @VA03349 00136000
  170. GETNEXT BAL R5,SCANQ GO SCAN FOR R0 INT CODE TYPE @VA03349 00136400
  171. BNZ NONEFND CODE NOT FOUND ON CHAIN @VA03349 00136800
  172. USING ASYNE,R4 @VA03349 00137200
  173. OC TGREG0(2),TGREG0 IS THIS AN EXT REQUEST? @VA03349 00137600
  174. BZ ASREJECT SETTING SECOND NON-EXT IS A NONO @VA03349 00138000
  175. CLC TASKID(1),ASYNID EXT, SAME TASK SETTING 2ND ? @VA03349 00138400
  176. BE ASREJECT YES, THATS ALSO A NONO @VA03349 00138800
  177. B GETNEXT GO LOOK THROUGH ALL ELEMENTS @VA03349 00139200
  178. SPACE 00139600
  179. NONEFND OC TGREG0(2),TGREG0 IS THIS AN EXT SET REQUEST? @VA03349 00140000
  180. BNZ SETEXT YES, BR @VA03349 00140400
  181. GETELEM BAL R5,ASYBLD GO GET AN ELEMENT @VA03349 00140800
  182. ST R1,ASYNNEXT-ASYNE(R3) CHAIN IN NEW ELEMENT @VA03349 00141200
  183. SPACE 00141600
  184. ASEXIT L R15,DISPATCH GOTO DISPATCHER @VA03349 00142000
  185. BALR R14,R15 ... @VA03349 00142400
  186. EJECT 00142800
  187. SETEXT CH R0,=X'1004' REQUESTING CLOCK COMP INT? @VA03349 00143200
  188. BNE NOSUCH NOPE-DON'T KNOW WHAT YOU'RE DOING@VA03349 00143600
  189. LA R4,EXTQ BEGINNING OF QUEUE AGAIN @VA03349 00144000
  190. SLR R7,R7 CLEAR EXT COUNT @VA03349 00144400
  191. BAL R5,ASYBLD GO GET AND INITIALIZE AN ELEM @VA03349 00144800
  192. NXTREQ LR R3,R4 SAVE PREVIOUS POINTER @VA03349 00145200
  193. ICM R4,B'1111',ASYNNEXT GET NEXT ENTRY @VA03349 00145600
  194. BZ CHKFLAG END OF CHAIN, GO SEE WHERE WE ARE@VA03349 00146000
  195. CH R0,ASYNCODE STILL LOOKIN AT CLOCK COMPS? @VA03349 00146400
  196. BNE CHKFLAG NOPE, MUST BE AT END OF CCOMPS @VA03349 00146800
  197. LA R7,1(R7) BUMP CLOCK COMP COUNT @VA03349 00147200
  198. BAL R5,SCANLINK GO GET THE LINKTABL ENTRY @VA03349 00147600
  199. USING LINKTABL,R9 @VA03349 00148000
  200. CLC TGREG2(8),LNKCLOCK IS NEW VALUE < THIS ONE? @VA03349 00148400
  201. BNL NXTREQ NOPE, NOT RIGHT PLACE YET. @VA03349 00148800
  202. CL R7,F1 IS THIS THE ACTIVE CLOCK ASYNE @VA03349 00149200
  203. BNE TSTAMP NOPE, THEN CHAIN IN FRONT OF IT. @VA03349 00149600
  204. SETCLOCK SCKC TGREG2 SET THE NEW CLOCK COMP VALUE @VA03349 00150000
  205. TSTAMP ST R1,ASYNNEXT-ASYNE(R3) CHAIN PREV TO NEW... @VA03349 00150400
  206. ST R4,ASYNNEXT-ASYNE(R1) AND NEW TO NEXT @VA03349 00150800
  207. LR R4,R1 SET ASYNE = NEW ONE @VA03349 00151200
  208. BAL R5,SCANLINK GO GET THE CALLERS LINKTABLE @VA03349 00151600
  209. MVC LNKCLOCK(8),TGREG2 STAMP THE LINKTABL @VA03349 00152000
  210. B ASEXIT DONE. @VA03349 00152400
  211. SPACE 00152800
  212. CHKFLAG LTR R7,R7 IS THE CLOCK RUNNING NOW? @VA03349 00153200
  213. BNZ TSTAMP YES, CHAIN THIS ENTRY ON END. @VA03349 00153600
  214. B SETCLOCK NO, THEN MAKE IT RUNNING. @VA03349 00154000
  215. EJECT 00154400
  216. ASYTERM SLR R7,R7 CLEAR CLOCK COMP COUNT @VA03349 00154800
  217. FINDNEXT BAL R5,SCANQ GO SCAN THE QUEUE FOR SAME CODE @VA03349 00155200
  218. BNZ ASNOFIND NOT THERE, CANT TERMINATE THEN. @VA03349 00155600
  219. LA R7,1(R7) UP CLOCK COMP COUNT @VA03349 00156000
  220. CLC TASKID(1),ASYNID DID WE FIND THE RIGHT REQUEST @VA03349 00156400
  221. BNE FINDNEXT NOPE, KEEP LOOKING @VA03349 00156800
  222. OC TGREG0(2),TGREG0 EXT TERMINATION REQUEST? @VA03349 00157200
  223. BZ UNCHAIN NOPE, I/O OR ASY SIG, GO UNCHAIN @VA03349 00157600
  224. CLC ASYNCODE(2),=X'1004' CLOCK COMP? @VA03349 00158000
  225. BNE NOSUCH NOPE, DONT KNOW WHAT YOURE DOING @VA03349 00158400
  226. BAL R5,SCANLINK GO GET THIS GUYS LINKTABL @VA03349 00158800
  227. MVC LNKCLOCK(8),FFS CLEAR THE CLOCK VALUE @VA03349 00159200
  228. CL R7,F1 IS THIS THE ACTIVE (FIRST) ASYNE @VA03349 00159600
  229. BNE UNCHAIN NOPE, JUST DEQUEUE AND RETURN. @VA03349 00160000
  230. LR R1,R4 SAVE OLD ELEM ADDR FOR RETURN @VA03349 00160400
  231. L R4,ASYNNEXT GET POINTER TO NEXT @VA03349 00160800
  232. ST R4,ASYNNEXT-ASYNE(R3) AND PUT IN PREVIOUS @VA03349 00161200
  233. LTR R4,R4 IS THERE A NEXT ELEM? @VA03349 00161600
  234. BZ STAMPHI NO, USE A HIGH VALUE @VA03349 00162000
  235. CLC ASYNCODE(2),=X'1004' IS IT CLOCK COMP @VA03349 00162400
  236. BNE STAMPHI NOPE, NOMORE CLOCK COMP REQUESTS @VA03349 00162800
  237. BAL R5,SCANLINK GO GET THIS GUYS LINKTABL @VA03349 00163200
  238. SCKC LNKCLOCK MAKE THIS THE ACTIVE CLOCK COMP @VA03349 00163600
  239. B RETELEM NOW GO RETURN THE DEQUED ELEM @VA03349 00164000
  240. SPACE 00164400
  241. UNCHAIN LR R1,R4 SAVE ELEM TO RETURN @VA03349 00164800
  242. L R4,ASYNNEXT GET PTR TO NEXT @VA03349 00165200
  243. ST R4,ASYNNEXT-ASYNE(R3) AND PUT IN PREVIOUS @VA03349 00165600
  244. B RETELEM NOW RETURN THE ELEMENT @VA03349 00166000
  245. SPACE 00166400
  246. STAMPHI SCKC FFS SET A HIGH CLOCK COMP VALUE @VA03349 00166800
  247. RETELEM L R15,QREQ RETURN THE DEQUEUED ELEMENT @VA03349 00167200
  248. BALR R14,R15 ... @VA03349 00167600
  249. B ASEXIT DONE @VA03349 00168000
  250. EJECT 00168400
  251. SCANLINK L R8,ASYNTASK GET TASK ELEMENT ADDRESS @VA03349 00168800
  252. L R8,TASKNAME-TASKE(R8) GET TASK NAME @VA03349 00169200
  253. L R9,TLINKS GET LINKTABLE ANCHOR @VA03349 00169600
  254. L R10,0(R9) GET NUMBER OF ENTRIES @VA03349 00170000
  255. LA R9,8(R9) BUMP TO FIRST ENTRY @VA03349 00170400
  256. CHKNEXT TM LFLAG,LACTIVE IS THIS TASK ACTIVE? @VA03349 00170800
  257. BZ BUMPNEXT NOPE, THEN SKIP IT. @VA03349 00171200
  258. CL R8,LACTTNME SAME TASK NAME? @VA03349 00171600
  259. BER R5 YES, LINKTABL ENTRY FOUND, RETURN@VA03349 00172000
  260. BUMPNEXT LA R9,LINKLEN(R9) BUMP TO NEXT ENTRY @VA03349 00172400
  261. BCT R10,CHKNEXT AND KEEP LOOKING @VA03349 00172800
  262. DC H'0' THATS THE END OF THE ROAD. @VA03349 00173200
  263. EJECT 00173600
  264. SCANQ LR R3,R4 SAVE PREV POINTER @VA03349 00174000
  265. ICM R4,B'1111',ASYNNEXT GET NEXT ELEM IN Q @VA03349 00174400
  266. BZ SETCC1 END OF CHAIN, NOT FOUND, RET CC1 @VA03349 00174800
  267. CH R0,ASYNCODE ARE THE INT CODES THE SAME? @VA03349 00175200
  268. BER R5 YES, ALL SET, RETURN CC0 @VA03349 00175600
  269. B SCANQ AND GO BACK FOR MORE @VA03349 00176000
  270. SPACE 00176400
  271. SETCC1 TM *,X'FF' SET CC=1 @VA03349 00176800
  272. BR R5 AND RETURN @VA03349 00177200
  273. DROP R4 NO MORE ASYNE @VA03349 00177600
  274. SPACE 3 00178000
  275. USING ASYNE,R1 @VA03349 00178400
  276. ASYBLD SLR R1,R1 CLEAR FOR CALL @VA03349 00178800
  277. L R15,QREQ CALL QRQ FOR AN ELEMENT @VA03349 00179200
  278. BALR R14,R15 ... @VA03349 00179600
  279. LTR R15,R15 DID WE GET IT? @VA03349 00180000
  280. BNZ QELEMERR NOPE, TERMINATE WITH QUEUE ERROR @VA03349 00180400
  281. XC ASYNE(ASYNLEN),ASYNE CLEAR THE BLOCK @VA03349 00180800
  282. STCM R6,B'0111',ASYNTASK+1 SAVE ACTIVE TASK TASKE @VA03349 00181200
  283. ST R2,ASYNEXIT SET EXIT ADDRESS @VA03349 00181600
  284. STH R0,ASYNCODE SET EXIT REQUEST CODE @VA03349 00182000
  285. MVC ASYNID(1),TASKID SET ACTIVE TASKID IN ELEM @VA03349 00182400
  286. BR R5 @VA03349 00182800
  287. DROP R1 @VA03349 00183200
  288. SPACE 3 00183600
  289. EJECT 00188000
  290. ASNOFIND EQU * 00189000
  291. LA R15,4 SET ERROR CODE 4 FOR ELEMENT NOT FOUND 00190000
  292. B ASEREXIT AND GO EXIT 00191000
  293. SPACE 00192000
  294. ASREJECT EQU * 00193000
  295. LA R15,8 SET ERROR CODE 8 FOR EXIT ALREADY CLAIMED 00194000
  296. B ASEREXIT AND EXIT @VA03349 00195000
  297. SPACE 00195500
  298. NOSUCH LA R15,12 ATTEMPTING TO SET ILLEGAL CODE @VA03349 00196000
  299. B ASEREXIT @VA03349 00196500
  300. SPACE 00197000
  301. QELEMERR LA R15,16 ERROR GETTING A QUEUE ELEM @VA03349 00197500
  302. SPACE 00198000
  303. ASEREXIT EQU * 00199000
  304. ST R15,TGREG15 STORE CODE IN CALLER'S REG.15 SAVE AREA 00200000
  305. B ASEXIT AND RETURN THROUGH THE DISPATCHER 00201000
  306. DS 0D @VA03349 00201100
  307. FFS DC 8X'FF' @VA03349 00201200
  308. F1 DC F'1' @VA03349 00201300
  309. EJECT 00202000
  310. COPY RSSEQU 00203000
  311. COPY SVECTORS 00205000
  312. COPY TAREA 00207000
  313. COPY ASYNE 00209000
  314. ASYNLEN EQU *-ASYNNEXT @VA03349 00209100
  315. COPY LINKTABL @VA03349 00210000
  316. COPY TASKE 00211000
  317. END 00212000