Table of Contents

DMTWAT Source

References

Source Listing

DMTWAT.ASSEMBLE.txt
  1. WAT TITLE 'DMTWAT (RSCS) VM/370 - RELEASE 6' 00001000
  2. *. 00002000
  3. * MODULE NAME - 00003000
  4. * 00004000
  5. * DMTWAT 00005000
  6. * 00006000
  7. * FUNCTION - 00007000
  8. * 00008000
  9. * THE DMTWAT MODULE IS A TASK SERVICE ROUTINE WHICH 00009000
  10. * IS CALLED DIRECTLY FROM TASK PROGRAMS BY MEANS OF 00010000
  11. * BRANCH AND LINK. DMTWAT PROVIDES EVENT 00011000
  12. * SYNCHRONIZATION BY MEANS OF SUSPENDING A TASK'S 00012000
  13. * EXECUTION UNTIL SOME SPECIFIED EVENT IS SIGNALLED 00013000
  14. * COMPLETE BY ANOTHER PROCESS IN THE SYSTEM. 00014000
  15. * 00015000
  16. * ATTRIBUTES - 00016000
  17. * 00017000
  18. * REUSABLE, NON-INTERRUPTABLE 00018000
  19. * 00019000
  20. * ENTRY POINTS - 00020000
  21. * 00021000
  22. * DMTWAT - SUSPEND DISPATCHING UNTIL COMPLETION IS 00022000
  23. * SIGNALLED 00023000
  24. * 00024000
  25. * ENTRY CONDITIONS - 00025000
  26. * 00026000
  27. * GPR1 = ADDR OF A SYNCH LOCK IF THE FULLWORD CONTENTS 00027000
  28. * ADDRESSED = F'0' 00028000
  29. * ADDR OF A LIST OF SYNCH LOCKS OTHERWISE 00029000
  30. * GPR14 = RETURN ADDRESS 00030000
  31. * GPR15 = ENTRY ADDRESS 00031000
  32. * 00032000
  33. * EXIT CONDITIONS - 00033000
  34. * 00034000
  35. * NORMAL - 00035000
  36. * 00036000
  37. * TO THE DISPATCHER WHEN PROCESSING IS COMPLETE 00037000
  38. * 00038000
  39. * ERROR - 00039000
  40. * 00040000
  41. * NONE 00041000
  42. * 00042000
  43. EJECT 00043000
  44. * 00044000
  45. * CALLS TO OTHER ROUTINES - 00045000
  46. * 00046000
  47. * NONE 00047000
  48. * 00048000
  49. * EXTERNAL REFERENCES - 00049000
  50. * 00050000
  51. * NONE 00051000
  52. * 00052000
  53. * TABLES / WORKAREAS - 00053000
  54. * 00054000
  55. * DMTVEC - SUPERVISOR COMMON AREA 00055000
  56. * 00056000
  57. * REGISTER USAGE - 00057000
  58. * 00058000
  59. * GPR0 = UNUSED 00059000
  60. * GPR1 = SYNCH LOCK POINTER, OR LOCK LIST POINTER 00060000
  61. * GPR2 = SCRATCH 00061000
  62. * GPR3 = SCRATCH 00062000
  63. * GPR4 = SCRATCH 00063000
  64. * GPR5 = TASK ELEMENT POINTER 00064000
  65. * GPR6 = SCRATCH 00065000
  66. * GPR7 = UNUSED 00066000
  67. * GPR8 = UNUSED 00067000
  68. * GPR9 = UNUSED 00068000
  69. * GPR10 = UNUSED 00069000
  70. * GPR11 = UNUSED 00070000
  71. * GPR12 = UNUSED 00071000
  72. * GPR13 = UNUSED 00072000
  73. * GPR14 = UNUSED 00073000
  74. * GPR15 = ENTRY ADDRESS, BASE REGISTER 00074000
  75. * 00075000
  76. * NOTES - 00076000
  77. * 00077000
  78. * NONE 00078000
  79. * 00079000
  80. * OPERATION - 00080000
  81. * 00081000
  82. * DMTWAT BEGINS BY SUSPENDING THE CALLING TASK'S 00082000
  83. * EXECUTION THROUGH THE FREEZE SVC. IF A SINGLE 00083000
  84. * SYNCH LOCK IS SPECIFIED IN THE CALL, IT IS 00084000
  85. * INSPECTED TO SEE IF IT HAS ALREADY BEEN POSTED. 00085000
  86. * IF THE SPECIFIED SYNCH LOCK IS POSTED, CONTROL IS 00086000
  87. * IMMEDIATELY PASSED TO DMTDSP, THE MSUP DISPATCHER. 00087000
  88. * IF THE SYNCH LOCK IS NOT POSTED, THE "WAITING" BIT 00088000
  89. * IS SET IN THE CALLING TASK'S TASK ELEMENT, THE 00089000
  90. * ADDRESS OF THE TASK ELEMENT IS SET IN THE SYNCH 00090000
  91. * LOCK, AND CONTROL IS PASSED TO THE DISPATCHER. 00091000
  92. * 00092000
  93. * IF A LIST OF SYNCH LOCKS IS SPECIFIED IN THE CALL, 00093000
  94. * EACH SYNCH LOCK IN THE LIST WHICH IS NOT FLAGGED 00094000
  95. * TO BE SKIPPED IS INSPECTED TO SEE IF IT HAS 00095000
  96. * ALREADY BEEN POSTED. IF AT LEAST ONE HAS BEEN 00096000
  97. * POSTED, CONTROL IS IMMEDIATELY PASSED TO THE MSUP 00097000
  98. * DISPATCHER. IF NO SYNCH LOCK IN THE LIST IS 00098000
  99. * POSTED, THE "WAITING" AND "LOCKLIST" BITS IN THE 00099000
  100. * CALLING TASK'S TASK ELEMENT ARE SET TO ONE, THE 00100000
  101. * ADDRESS OF THE CALLING TASK ELEMENT IS SET INTO 00101000
  102. * EACH SYNCH LOCK IN THE LIST WHICH IS NOT FLAGGED 00102000
  103. * TO BE SKIPPED, AND CONTROL IS PASSED TO THE 00103000
  104. * DISPATCHER. 00104000
  105. * 00105000
  106. *. 00106000
  107. EJECT 00107000
  108. DMTWAT CSECT 00108000
  109. SPACE 00109000
  110. * ENTRY POINT FOR CALL TO DMTWAT ROUTINE 00110000
  111. SPACE 00111000
  112. FREEZE SET REG.14 = ADDR OF TASK SAVE AREA AND SAVE STATE 00112000
  113. SPACE 00113000
  114. USING DMTWAT,R15 USE ENTRY REGISTER FOR ADDRESSING 00114000
  115. USING SVECTORS,0 GET SVECTORS ADDRESSABILTIY 00115000
  116. USING TASKE,R5 GET TASK ELEMENT ADDRESSABILTIY 00116000
  117. SPACE 00117000
  118. L R2,0(R1) REG 2 = CONTENTS OF SYNLOCK; OR FIRST LIST ENTR 00118000
  119. LR R3,R1 SAVE REG.1 IN CASE OF WAITABLE LIST CALL 00119000
  120. LR R4,R2 SAVE REG.2 FOR SAME REASON 00120000
  121. L R5,ACTIVE REG.5 = ADDRESS OF CALLER'S TASK ELEMENT 00121000
  122. LA R5,0(R5) SET TOP BYTE (ID CODE) TO ZERO 00122000
  123. LA R6,0(R2) CLEAR TOP BYTE IN CASE IT IS A POSTED SYNLOCK 00123000
  124. LTR R6,R6 IS THIS THE FIRST ENTRY OF A LIST? 00124000
  125. BNZ WAITLIST ALL SYNLOCKS MUST CONTAIN 0 IN BYTES 1->3 00125000
  126. CLI 0(R1),X'00' IT IS A SYNLOCK - IS IT ALREADY POSTED? 00126000
  127. BNE WAITGO YEP - LEAVE IT ALONE AND GO TO THE DISPATCHER 00127000
  128. ST R5,0(R1) OTHERWISE SET TASK ELEMENT ADDRESS IN SYNLOCK 00128000
  129. B WAITSTOP SET TASK WAITING AND EXIT TO DISPATCHER 00129000
  130. SPACE 00130000
  131. WAITLIST EQU * 00131000
  132. TM 0(R1),X'40' IS THIS ENTRY FLAGGED TO BE SKIPPED? 00132000
  133. BO WAITPASS YES - CHECK IT FOR TERMINATION BIT IMMEDIATELY 00133000
  134. CLI 0(R2),X'00' IS THIS SYNLOCK ALREADY POSTED? 00134000
  135. BNE WAITGO YEP - DON'T TOUCH THE SYNLOCKS AND DISPATCH 00135000
  136. WAITPASS EQU * 00136000
  137. LTR R2,R2 WAS THAT THE LAST LIST ENTRY? 00137000
  138. BM WAITSET YES - NOTHING POSTED, SO SET UP TO WAIT 00138000
  139. LA R1,4(R1) OTHERWISE REG.1 = ADDR OF NEXT LIST ENTRY 00139000
  140. L R2,0(R1) REG.2 = CONTENTS OF NEXT LIST ENTRY 00140000
  141. B WAITLIST CHECK THIS SYNLOCK ENTRY FOR EARLY POST 00141000
  142. SPACE 00142000
  143. WAITSET EQU * 00143000
  144. OI TASKSTAT,LOCKLIST FLAG DISPATCHER TO CLEAR SYN LOCKS 00144000
  145. WAITNEXT EQU * 00145000
  146. TM 0(R3),X'40' IS THE SKIP BIT SET IN THIS LIST ENTRY? 00146000
  147. BO WAITSKIP YEP - DON'T MESS WITH THE SYNLOCK 00147000
  148. ST R5,0(R4) SET TASK ELEMENT ADDRESS IN THIS SYNLOCK 00148000
  149. WAITSKIP EQU * 00149000
  150. LTR R4,R4 WAS THAT THE LAST LIST ENTRY? 00150000
  151. BM WAITSTOP SET TASK WAITING AND DISPATCH IF IT WAS 00151000
  152. LA R3,4(R3) REG.3 = ADDRESS OF THE NEXT LIST ENTRY 00152000
  153. L R4,0(R3) REG.4 = ADDRESS OF THE NEXT SYNLOCK 00153000
  154. B WAITNEXT SET THIS ONE TO WAIT AND CONTINUE SCAN 00154000
  155. SPACE 00155000
  156. WAITSTOP EQU * 00156000
  157. OI TASKSTAT,WAITING SET TASK NON-DISPATCHABLE 00157000
  158. SPACE 00158000
  159. WAITGO EQU * 00159000
  160. L R15,DISPATCH REG.15 = ENTRY ADDRESS OF DISPATCHER 00160000
  161. BALR R14,R15 ENTER THE DISPATCHER FOR NEXT LAP 00161000
  162. EJECT 00162000
  163. COPY SVECTORS 00163000
  164. EJECT 00164000
  165. COPY TAREA 00165000
  166. EJECT 00166000
  167. COPY TASKE 00167000
  168. EJECT 00168000
  169. COPY RSSEQU 00169000
  170. END 00170000