Table of Contents

DMTDSP Source

References

Source Listing

DMTDSP.ASSEMBLE.txt
  1. DSP TITLE 'DMTDSP (RSCS) VM/370 - RELEASE 6' 00001000
  2. *. 00002000
  3. * MODULE NAME - 00003000
  4. * 00004000
  5. * DMTDSP 00005000
  6. * 00006000
  7. * FUNCTION - 00007000
  8. * 00008000
  9. * THE DMTDSP MODULE IS THE MSUP DISPATCHER. IT IS 00009000
  10. * INTENDED TO BE ENTERED AS AN EXIT FROM SUPERVISOR 00010000
  11. * FUNCTIONS WHICH WERE ENTERED FOLLOWING AN 00011000
  12. * INTERRUPT, OR WHICH "UNDISPATCHED" A TASK BY MEANS 00012000
  13. * OF THE FREEZE SVC FUNCTION. DMTDSP MUST BE ENTERED 00013000
  14. * WITH ALL PSW MASKS OFF (EXCEPT MACHINE CHECK). 00014000
  15. * 00015000
  16. * ATTRIBUTES - 00016000
  17. * 00017000
  18. * REUSABLE, NON-INTERRUPTABLE 00018000
  19. * 00019000
  20. * ENTRY POINTS - 00020000
  21. * 00021000
  22. * DMTDSP - RESUME DISPATCHED EXECUTION, OR WAIT 00022000
  23. * 00023000
  24. * ENTRY CONDITIONS - 00024000
  25. * 00025000
  26. * GPR15 = ENTRY ADDRESS 00026000
  27. * 00027000
  28. * OTHER REGISTER CONTENTS ARE NOT USED, ALTHOUGH BY 00028000
  29. * CONVENTION GPR14 POINTS TO THE LOCATION FROM WHICH 00029000
  30. * DMTDSP WAS CALLED (HANDY FOR MALFUNCTION ANALYSIS) 00030000
  31. * 00031000
  32. * EXIT CONDITIONS - 00032000
  33. * 00033000
  34. * NORMAL - 00034000
  35. * 00035000
  36. * A TASK WHICH HAS BEEN SELECTED FOR EXECUTION 00036000
  37. * IS RESTARTED BY RESTORING ITS SAVED STATUS. 00037000
  38. * IF NO TASK IS READY FOR EXECUTION, A MASKED ON 00038000
  39. * WAIT STATE PSW IS LOADED. 00039000
  40. * 00040000
  41. * ERROR - 00041000
  42. * 00042000
  43. * NONE 00043000
  44. * 00044000
  45. EJECT 00045000
  46. * 00046000
  47. * CALLS TO OTHER ROUTINES - 00047000
  48. * 00048000
  49. * NONE 00049000
  50. * 00050000
  51. * EXTERNAL REFERENCES - 00051000
  52. * 00052000
  53. * NONE 00053000
  54. * 00054000
  55. * 00055000
  56. * TABLES / WORKAREAS - 00056000
  57. * 00057000
  58. * DMTVEC - SUPERVISOR COMMON AREA 00058000
  59. * 00059000
  60. * REGISTER USAGE - 00060000
  61. * 00061000
  62. * GPR0 = UNUSED 00062000
  63. * GPR1 = TASK ELEMENT POINTER 00063000
  64. * GPR2 = TASK SAVE AREA POINTER 00064000
  65. * GPR3 = SCRATCH 00065000
  66. * GPR4 = SCRATCH 00066000
  67. * GPR5 = UNUSED 00067000
  68. * GPR6 = UNUSED 00068000
  69. * GPR7 = UNUSED 00069000
  70. * GPR8 = UNUSED 00070000
  71. * GPR9 = UNUSED 00071000
  72. * GPR10 = UNUSED 00072000
  73. * GPR11 = UNUSED 00073000
  74. * GPR12 = UNUSED 00074000
  75. * GPR13 = UNUSED 00075000
  76. * GPR14 = UNUSED 00076000
  77. * GPR15 = ENTRY ADDRESS, BASE REGISTER 00077000
  78. * 00078000
  79. * NOTES - 00079000
  80. * 00080000
  81. * THE CONDITIONS UNDER WHICH THIS DISPATCHER OPERATES 00081000
  82. * ARE SUFFICIENTLY SIMPLE THAT A WIDE VARIETY OF DISPATCHING 00082000
  83. * ALGORITHMS MAY BE EASILY EMPLOYED BY MODIFICATION TO 00083000
  84. * THE PROGRAMMING. 00084000
  85. * 00085000
  86. * OPERATION - 00086000
  87. * 00087000
  88. * DMTDSP SCANS THE TASK ELEMENT QUEUE FOR A TASK 00088000
  89. * WHICH IS READY FOR EXECUTION. THE FIRST SUCH TASK 00089000
  90. * FOUND IS DISPATCHED. IF NO READY TASK IS FOUND, 00090000
  91. * DMTDSP LOADS A MASKED ON WAIT STATE PSW. WHEN A 00091000
  92. * TASK IS DISPATCHED, ITS TASK ELEMENT IS ENQUEUED 00092000
  93. * AT THE END OF THE TASK QUEUE, REDUCING THE TASK TO 00093000
  94. * LOWEST PRIORITY FOR THE NEXT DISPATCH. THE EFFECT 00094000
  95. * OF THIS IS A 'ROUND ROBIN' DISPATCHING ALGORITHM. 00095000
  96. * 00096000
  97. * THE TASK TO BE DISPATCHED IS INSPECTED TO SEE IF 00097000
  98. * IT HAD BEEN WAITING ON A LIST OF SYNCH LOCKS. IF 00098000
  99. * SO, EACH SYNCH LOCK IN THE LIST WHICH HAD BEEN 00099000
  100. * WAITED ON AND HAD NOT BEEN POSTED IS CLEARED TO 00100000
  101. * ZERO. THE TASK ID AND TASK ELEMENT FOR THE TASK TO 00101000
  102. * BE DISPATCHED ARE STORED IN LOW STORAGE. THE 00102000
  103. * TASK'S GENERAL REGISTERS ARE RELOADED FROM THE 00103000
  104. * TASK SAVE AREA, AND THE TASK'S RESUME PSW FROM THE 00104000
  105. * TASK SAVE AREA IS LOADED. 00105000
  106. * 00106000
  107. *. 00107000
  108. EJECT 00108000
  109. DMTDSP CSECT 00109000
  110. SPACE 00110000
  111. * ENTRY POINT FOR SUPERVISOR DISPATCH 00111000
  112. SPACE 00112000
  113. USING DMTDSP,R15 ADDRESS WITH ENTRY REGISTER 00113000
  114. USING SVECTORS,0 GET SVECTORS ADDRESSABILTIY 00114000
  115. USING TASKE,R1 GET TASK ELEMENT ADDRESSABILTIY 00115000
  116. SPACE 00116000
  117. LA R2,TASKQ GET START OF TASKQ 00117000
  118. GONEXTQ EQU * 00118000
  119. ICM R1,B'1111',TASKNEXT-TASKE(R2) GET NEXT IN QUEUE 00119000
  120. BZ GONOGO ALL DONE 00120000
  121. TM TASKSTAT,WAITING+LIMBO WANTS TO RUN? 00121000
  122. BZ GOTOIT YES 00122000
  123. LR R2,R1 GET THE NEXT IN CHAIN 00123000
  124. B GONEXTQ AND CONTINUE 00124000
  125. SPACE 1 00125000
  126. GOTOIT EQU * 00126000
  127. MVC TASKNEXT-TASKE(4,R2),TASKNEXT DEQUEUE 00127000
  128. LR R3,R2 SET UP FOR SCAN TO END 00128000
  129. GOLURCH EQU * 00129000
  130. LR R2,R3 MAKE LAST CURRENT 00130000
  131. ICM R3,B'1111',TASKNEXT-TASKE(R2) GET NEXT 00131000
  132. BNZ GOLURCH NOT LAST ONE 00132000
  133. ST R1,TASKNEXT-TASKE(R2) CHAIN TO END 00133000
  134. ST R3,TASKNEXT AND TERMINATE THE CHAIN 00134000
  135. L R2,TASKSAVE REG.2 = SAVE AREA OF TASK TO BE DISPATCH 00135000
  136. USING TAREA,R2 DEFINE TASK SAVE AREA DSECT ADDRESSA 00136000
  137. SPACE 00137000
  138. ST R1,ACTIVE SET ADDRESS OF ELEMENT TO BE DISPATCHED 00138000
  139. MVC ACTIVE(1),TASKID SET TASK ID TO BE DISPATCHED 00139000
  140. TM TASKSTAT,LOCKLIST DID TASK WAIT ON A SYNCH LOCK LIST 00140000
  141. BNO GOGOGO NOPE - NO NEED TO CLEAN UP 00141000
  142. NI TASKSTAT,X'FF'-LOCKLIST OTHERWISE RESET CLEANUP FLAG 00142000
  143. L R3,TGREG1 SET REG.3 TO ADDRESS OF START OF LOCK LIST 00143000
  144. GOUNLOCK EQU * 00144000
  145. L R4,0(R3) REG.4 = CONTENTS OF THIS LOCK LIST ENTRY 00145000
  146. TM 0(R3),X'40' IS THE SKIP FLAG SET FOR THIS ENTRY? 00146000
  147. BO GOSKIPIT YEP - CHECK FOR END OF LIST FLAG 00147000
  148. XC 1(3,R4),1(R4) CLEAR SYNCH LOCK TASK ELEMENT ADDR FIELD 00148000
  149. GOSKIPIT EQU * 00149000
  150. LTR R4,R4 IS THE END OF LIST FLAG SET HERE? 00150000
  151. BM GOGOGO YEP - ALL DONE - GO DISPATCH THE TASK 00151000
  152. LA R3,4(R3) OTHERWISE REG.3 = ADDR OF NEXT LIST ENTRY 00152000
  153. B GOUNLOCK PROCESS TO THE END OF THE LIST 00153000
  154. SPACE 00154000
  155. GOGOGO EQU * 00155000
  156. MVC NEWPSW(8),TPSW GET IT'S PSW IN LOW CORE 00156000
  157. LM R0,R15,TGREG0 LOAD TASK'S SAVED REGISTERS 00157000
  158. LPSW NEWPSW AND DISPATCH THE SELECTED TASK 00158000
  159. SPACE 00159000
  160. GONOGO EQU * 00160000
  161. XC ACTIVE(4),ACTIVE CLEAR ACTIVE FIELD 00161000
  162. LPSW GOWAIT LOAD A MASKED ON WAIT STATE PSW 00162000
  163. SPACE 00163000
  164. DS 0D 00164000
  165. GOWAIT DC X'FF060000',A(0) STANDARD WAIT STATE PSW @VM01136 00165010
  166. EJECT 00166000
  167. COPY RSSEQU 00167000
  168. EJECT 00168000
  169. COPY SVECTORS 00169000
  170. EJECT 00170000
  171. COPY TAREA 00171000
  172. EJECT 00172000
  173. COPY TASKE 00173000
  174. END 00174000