Table of Contents

DMTEXT Source

References

Source Listing

DMTEXT.ASSEMBLE.txt
  1. EXT TITLE 'DMTEXT (RSCS) VM/370 - RELEASE 6' 00001000
  2. *. 00002000
  3. * MODULE NAME - 00003000
  4. * 00004000
  5. * DMTEXT 00005000
  6. * 00006000
  7. * FUNCTION - 00007000
  8. * 00008000
  9. * THE DMTEXT MODULE IS THE MSUP EXTERNAL INTERRUPT 00009000
  10. * HANDLER. DMTEXT RECEIVES CONTROL DIRECTLY ON AN 00010000
  11. * EXTERNAL INTERRUPT AND SAVES THE STATUS OF THE 00011000
  12. * EXECUTING TASK IF ONE WAS INTERRUPTED. 00012000
  13. * 00013000
  14. * ATTRIBUTES - 00014000
  15. * 00015000
  16. * REUSABLE, EXECUTABLE DISABLED ONLY 00016000
  17. * 00017000
  18. * ENTRY POINTS - 00018000
  19. * 00019000
  20. * DMTEXT - DIRECTLY ON EXTERNAL INTERRUPT 00020000
  21. * 00021000
  22. * 00022000
  23. * ENTRY CONDITIONS - 00023000
  24. * 00024000
  25. * MAY BE ENTERED AT ANY TIME THE EXTERNAL INTERRUPT 00025000
  26. * MASK IS ON. THE EXTERNAL INTERRUPT CODE IS STORED 00026000
  27. * IN THE EXTERNAL OLD PSW ON ENTRY. 00027000
  28. * 00028000
  29. * 00029000
  30. * EXIT CONDITIONS - 00030000
  31. * 00031000
  32. * NORMAL - 00032000
  33. * 00033000
  34. * ON EXIT TO AN ASYNCHRONOUS EXIT ROUTINE, 00034000
  35. * GPR13 = ADDR OF TASK ELEMENT FOR ASYN EXIT'S TASK 00035000
  36. * GPR14 = RETURN ADDR TO DMTEXT 00036000
  37. * GPR15 = ADDR OF ENTRY TO ASYN EXIT ROUTINE 00037000
  38. * 00038000
  39. * ERROR - 00039000
  40. * 00040000
  41. * NONE (NO ERROR CONDITIONS POSSIBLE) 00041000
  42. EJECT 00042000
  43. * 00043000
  44. * CALLS TO OTHER ROUTINES - 00044000
  45. * 00045000
  46. * DMTDSP - TO RESUME DISPATCHED PROCESSING 00046000
  47. * 00047000
  48. * 00048000
  49. * EXTERNAL REFERENCES - 00049000
  50. * 00050000
  51. * NONE 00051000
  52. * 00052000
  53. * 00053000
  54. * TABLES / WORKAREAS - 00054000
  55. * 00055000
  56. * TAREA - INTERRUPTED TASK'S SAVE AREA, TO SAVE STATUS 00056000
  57. * TASKE - TASK ELEMENT, TO LOCATE TAREA 00057000
  58. * ASYNE - EXTERNAL ASYNCH EXIT ELEMENT, TO LOCATE EXITS 00058000
  59. * 00059000
  60. * 00060000
  61. * 00061000
  62. * REGISTER USAGE - 00062000
  63. * 00063000
  64. * R1 - ASYNCHRONOUS EXIT ELEMENT 00063500
  65. * R2 - PREVIOUS ASYNCHRONOUS EXIT ELEMENT IN CHAIN 00064000
  66. * R4 - NEXT ASYNCHRONOUS EXIT ELEMENT IN CHAIN 00064500
  67. * R5 - LINK REG 00065000
  68. * R9 - LINKTABL FOR TASK TAKING ASYNCH INTERRUPT 00065500
  69. * GPR15 = DMTEXT BASE REGISTER 00067000
  70. * 00068000
  71. * NOTES - 00069000
  72. * 00070000
  73. * NONE 00071000
  74. * 00072000
  75. * OPERATION - 00073000
  76. * 00074000
  77. * 00075000
  78. * IF A TASK WAS EXECUTING AT THE TIME OF THE INTERRUPT, IT IS 00075200
  79. * SUSPENDED. IF THERE HAVE BEEN NO REQUESTS FOR 00075400
  80. * EXTERNAL INTERRUPT ASYNCHRONOUS EXITS, EXIT IS MADE TO 00075600
  81. * THE DISPATCHER. IF THERE HAVE BEEN REQUESTS MADE, THE 00075800
  82. * EXTERNAL INTERRUPT CODE IS EXAMINED. ONLY THE FOLLOWING 00076000
  83. * INTERRUPT CODES ARE SERVICED, ALL OTHERS RESULT IN AN 00076200
  84. * IMMEDIATE EXIT TO THE DISPATCHER: 00076400
  85. * 00076600
  86. * X'1004' - CLOCK COMPARATOR 00076800
  87. * 00077000
  88. * THE QUEUE IS SCANNED TO FIND THE ASYNCHRONOUS QUEUE 00077200
  89. * ELEMENT WHICH CORRESPONDS TO THIS INTERRUPT. 00077400
  90. * 00077600
  91. * FOR CLOCK COMPARATOR INTERRUPTS, THE FIRST ELEMENT SHOULD 00077800
  92. * SATISFY THE SEARCH, SINCE THEY ARE QUEUED IN ASSENDING ORDER 00078000
  93. * WITH THE FIRST ELEMENT BEING THE ACTIVE ONE. 00078200
  94. * THE QUEUE ELEMENT IS DEQUEUED AND RETURNED TO THE POOL. 00078400
  95. * IF THERE IS ANOTHER CLOCK COMPARATOR QUEUE ELEMENT BEHIND 00078600
  96. * IT, IT IS MADE THE ACTIVE ELEMENT AND THE CLOCK COMPARATOR 00078800
  97. * IS SET FOR ITS VALUE; IF THERE ARE NO MORE CLOCK COMPARATOR 00079000
  98. * REQUESTS BEHIND IT, THE CLOCK COMPARATOR IS SET FOR ALL 00079200
  99. * HEX F'S. IN EITHER CASE, THEREAFTER THE USER TASK EXIT 00079400
  100. * IS TAKEN 00079600
  101. * 00079800
  102. * AFTER THE EXIT HAS BEEN TAKEN, RETURN IS MADE TO 00080000
  103. * THE DISPATCHER 00080200
  104. * 00084000
  105. *. 00085000
  106. EJECT 00086000
  107. DMTEXT CSECT 00087000
  108. SPACE 00088000
  109. * EXTERNAL INTERRUPT ENTRY POINT 00089000
  110. SPACE 00090000
  111. USING SVECTORS,0 GET SVECTORS ADDRESSABILITY 00091000
  112. STM R14,R15,SSAVE SAVE WORK REGS TEMPORARILY 00092000
  113. L R15,NEWEXT+4 GET ADDRESS OF ENTRY POINT 00093000
  114. USING DMTEXT,R15 DEFINE ADDRESSING FOR EXTERNAL HANDL 00094000
  115. USING TASKE,R14 GET TASK ELEMENT ADDRESSABILITY 00095000
  116. CLI ACTIVE,X'00' WAS THE DISPATCHER WAITING? 00096000
  117. BE EXTNOSAV DON'T BOTHER TO SAVE REGISTERS IF IT WAS 00097000
  118. SPACE 00098000
  119. L R14,ACTIVE REG 14 = ADDR OF ELEMENT FOR INTERRUPTED TASK 00099000
  120. L R14,TASKSAVE REG.14 = ADDR OF THAT TASK'S SAVE AREA 00100000
  121. DROP R14 00101000
  122. USING TAREA,R14 DEFINE TASK SAVE AREA DSECT ADDRESSA 00102000
  123. SPACE 00103000
  124. MVC TPSW(8),OLDEXT MOVE RESUME PSW TO TASK'S SAVE AREA 00104000
  125. STM R0,R13,TGREG0 SAVE THE INTERRUPTED TASK'S REGISTERS 00105000
  126. MVC TGREG14(8),SSAVE AND MOVE IN SAVED REGS 14 & 15 00106000
  127. MVI ACTIVE,X'00' INDICATE NOT RUNNING DISPATCHED 00107000
  128. SPACE 00108000
  129. DROP R14 00109000
  130. EJECT 00110000
  131. EXTNOSAV EQU * 00111000
  132. USING ASYNE,R1 @VA03349 00112000
  133. LH R0,OLDEXT+2 GET INTERRUPT CODE @VA03349 00112400
  134. CH R0,=X'1004' IS THIS A CLOCK COMPARATOR @VA03349 00112800
  135. BE SRCHQ YES, GO SEARCH THE QUEUE @VA03349 00113200
  136. B EXTGO NOT CC OR RSI, FORGET IT @VA03349 00113600
  137. SRCHQ LA R1,EXTQ-(ASYNNEXT-ASYNE) INITIALIZE ELEM PTR @VA03349 00114000
  138. LOOKNEXT LR R2,R1 SAVE PREV ELEM PTR @VA03349 00114400
  139. ICM R1,B'1111',ASYNNEXT GET ADDR OF NEXT ELEM @VA03349 00114800
  140. BZ CHKTYPE NO MORE ELEMS, DONE @VA03349 00115200
  141. CH R0,ASYNCODE IS THIS ELEM FOR SAME CODE @VA03349 00115600
  142. BNE LOOKNEXT NOPE, GO LOOK AT THE NEXT ONE @VA03349 00116000
  143. BAL R5,SCANLINK GO FIND THE LINKTABL @VA03349 00116400
  144. USING LINKTABL,R9 @VA03349 00116800
  145. MVC LNKCLOCK(8),FFS UNSTAMP LINKTAB @VA03349 00117200
  146. L R13,ASYNTASK PASS TASKE IN R13 @VA03349 00117600
  147. L R3,ASYNEXIT SAVE EXIT ADDRESS @VA03349 00118000
  148. L R4,ASYNNEXT GET PTR TO NEXT (OR ZERO) @VA03349 00118400
  149. ST R4,ASYNNEXT-ASYNE(R2) AND PLACE IN PREV ELEM @VA03349 00118800
  150. L R15,QREQ ELEM UNCHAINED, NOW RETURN IT @VA03349 00119200
  151. BALR R14,R15 ... @VA03349 00119600
  152. L R15,NEWEXT+4 RESTORE BASE REG QUICK LIKE @VA03349 00120000
  153. LTR R1,R4 WAS THERE A NEXT? @VA03349 00120400
  154. BZ SETHI NO, QUEUE EMPTY, GO SET HI VALUE @VA03349 00120800
  155. CLC ASYNCODE(2),=X'1004' IS NEXT A CLOCK COMPARATOR @VA03349 00121200
  156. BNE SETHI NOPE, USE HI VALUE @VA03349 00121600
  157. BAL R5,SCANLINK GO GET THE LINKTABLE @VA03349 00122000
  158. SCKC LNKCLOCK SET THE CLOCK @VA03349 00122400
  159. TAKEXIT LR R15,R3 EXIT ADDR IN R15 @VA03349 00122800
  160. EXITNOW BALR R14,R15 TAKE THE EXIT @VA03349 00123200
  161. L R15,DISPATCH NOW RETURN TO DISPATCHER @VA03349 00123600
  162. BALR R14,R15 ... @VA03349 00124000
  163. SPACE 00124400
  164. SETHI SCKC FFS SET CLOCK COMPARATOR TO FFS @VA03349 00124800
  165. B TAKEXIT AND TAKE THE EXIT @VA03349 00125200
  166. SPACE 00125600
  167. SCANLINK L R8,ASYNTASK GET TASK ELEMENT ADDRESS @VA03349 00126000
  168. L R8,TASKNAME-TASKE(R8) GET TASK NAME @VA03349 00126400
  169. L R9,TLINKS GET LINKTABLE ANCHOR @VA03349 00126800
  170. L R10,0(R9) GET NUMBER OF ENTRIES @VA03349 00127200
  171. LA R9,8(R9) BUMP TO FIRST ENTRY @VA03349 00127600
  172. CHKNEXT TM LFLAG,LACTIVE IS THIS AN ACTIVE LINK? @VA03349 00128000
  173. BZ BUMPNEXT NOPE, THEN SKIP IT, BR. @VA03349 00128400
  174. CL R8,LACTTNME SAME TASK NAME? @VA03349 00128800
  175. BER R5 YES, LINKTABL ENTRY FOUND, RETURN@VA03349 00129200
  176. BUMPNEXT LA R9,LINKLEN(R9) BUMP TO NEXT ENTRY @VA03349 00129600
  177. BCT R10,CHKNEXT AND KEEP LOOKING @VA03349 00130000
  178. DC H'0' THATS THE END OF THE ROAD. @VA03349 00130400
  179. SPACE 00130800
  180. CHKTYPE CH R0,=X'1004' IS THIS A CLOCK COMPARATOR? @VA03349 00131200
  181. BNE EXTGO NOPE, ALL SET @VA03349 00131600
  182. SCKC FFS YES, THEN PREVENT RECURRANCE @VA03349 00132000
  183. SPACE 00139000
  184. EXTGO EQU * 00140000
  185. L R15,DISPATCH REG.15 = ADDRESS OF DISPATCHER ENTRY POINT 00141000
  186. BALR R14,R15 GO TRY TO RUN SOME TASK 00142000
  187. DS 0D @VA03349 00142100
  188. FFS DC 8X'FF' @VA03349 00142200
  189. SPACE 00143000
  190. EJECT 00145000
  191. COPY RSSEQU 00146000
  192. COPY SVECTORS 00148000
  193. COPY TAREA 00150000
  194. COPY TASKE 00152000
  195. COPY ASYNE 00154000
  196. COPY LINKTABL @VA03349 00154500
  197. END 00155000