User Tools

Site Tools


cdc:nos2.source:nam5871:msetil

MSETIL

Table Of Contents

  • [00010] PROC MSETIL1)
  • [00065] PROC ABORT
  • [00066] PROC MCLRIL
  • [00067] PROC OMSG
  • [00068] PROC OTIME
  • [00069] PROC XRECALL
  • [00070] PROC XTRACE

Source Code

MSETIL.txt
  1. *DECK MSETIL
  2. USETEXT NIPDEF
  3. USETEXT LLCB
  4. USETEXT MSGIDX
  5. USETEXT NBT
  6. USETEXT PIT
  7. USETEXT PT
  8. USETEXT SYSTIME
  9. USETEXT STATTAB
  10. PROC MSETIL((CBADDR)); # REQUEST NIP/PIP INTERLOCK #
  11. STARTIMS;
  12. #
  13. *1DC MSETIL
  14. * 1. PROC NAME AUTHOR DATE
  15. * MSETIL J.C. LEE 80/04/01
  16. *
  17. * 2. FUNCTIONAL DESCRIPTION.
  18. * REQUEST NIP/PIP INTERLOCK
  19. *
  20. * 3. METHOD USED.
  21. * SET REQUEST INTERLOCK FLAG IN PIT ENTRY REQUEST WORD,
  22. * WAIT FOR ALL RUNNING PIP-S TO ACKNOWLEDGE THE INTERLOCK REQ.
  23. *
  24. * 4. ENTRY PARAMETERS.
  25. * CBADDR ZERO IF ALL PIP(S) ARE TO BE INTERLOCKED,
  26. * LLCB ADDRESS IF ONLY A SPECIFIC
  27. * PIP IS TO BE INTERLOCKED
  28. *
  29. * 5. EXIT PARAMETERS.
  30. * NONE
  31. *
  32. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  33. * NIPDEF LLCB NBT PIT PT OSIZE
  34. * SYSTIME MSGIDX
  35. * STATTAB STATISTICS TABLE
  36. *
  37. * 7. ROUTINES AND OVERLAYS CALLED.
  38. * MCLRIL CLEAR INTERLOCK REQUEST
  39. * OTIME GET (DEADSTART) REAL TIME CLOCK VALUE
  40. * XRECALL RECALL
  41. * XTRACE TRACE CALL
  42. * OMSG ISSUE DAYFILE MESSAGE
  43. *
  44. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  45. * "NO INTERLOCK"
  46. *
  47. * W A R N I N G - THIS PROCEDURE IS LOADED WITH PRIMARY OVERLAY
  48. * MGBGCLT, MDRPTR, MCHKPTR, MAJPTR
  49. * AND XCHKPCR. THEREFORE WHENEVER THIS ROUTINE
  50. * IS MODIFIED, CHECK MUST BE MADE TO MAKE SURE
  51. * THE OVERLAYS MGBGCLT, MDRPTR, MCHKPTR,
  52. * MAJPTR AND XCHKPCR WILL NOT EXCEED THE
  53. *CALL OSIZE
  54. *
  55. * THIS PROCEDURE IS CALLED BY MGBGCLT, NPHECP,
  56. * AND NPPCT.
  57. *
  58.  #
  59. STOPIMS;
  60. #
  61.   EXTERNAL VARIABLES
  62. #
  63. XREF
  64. BEGIN
  65. PROC ABORT; # ABORT PROCEDURE #
  66. PROC MCLRIL; # CLEAR INTERLOCK REQUEST #
  67. PROC OMSG; # ISSUE DAYFILE MESSAGE #
  68. PROC OTIME; # GET REAL TIME CLOCK VALUE #
  69. PROC XRECALL; # RECALL #
  70. PROC XTRACE; # TRACE CALL #
  71. END
  72. #
  73.   INTERNAL VARIABLES
  74. #
  75. ARRAY CURTIME P(1); # WORD TO STORE CURRENT TIME #
  76. BEGIN
  77. ITEM CURSECS U(0,0,24); # SYSTIME IN SECONDS #
  78. ITEM SMILS U(0,24,36); # STARTING TIME IN MILLESECONDS #
  79. END
  80.  
  81. DEF ACKTIME #25#;
  82. ITEM
  83. CBADDR, # PCB ADDRESS #
  84. INDEX, # INDEX FOR PIT ENTRY #
  85. IDXMIN, # MINIMUM INDEX #
  86. IDXMAX, # MAXIMUM INDEX #
  87. NOTACK B, # FLAG FOR INTRLK NOT ACKED #
  88. TIMEC = 0, # SAVE INITIAL TIME #
  89. FLAG B; # TEMPORARY FLAG #
  90.  
  91. CONTROL IFEQ STAT,1;
  92. ARRAY ETIME P(1); # RTIME BUFFER FOR ENDING TIME #
  93. BEGIN
  94. ITEM EMILS U(0,24,36); # ENDING TIME IN MILLESECONDS #
  95. END
  96.  
  97. ITEM STTEMP; # TEMPORARY STATISTICS VARIABLE #
  98. ITEM TIMESC = 0; # SAVE INITIAL TIME IN MILLESEC #
  99. CONTROL FI;
  100.  
  101.  
  102. # ******************************************************************** #
  103. BEGIN
  104.  
  105. CONTROL IFEQ DEBUG,1;
  106. XTRACE("MSETI") ;
  107. CONTROL FI;
  108.  
  109. OTIME(CURTIME);
  110. TIMEC = CURSECS[0]; # SAVE CURRENT TIME IN SECS #
  111.  
  112. CONTROL IFEQ STAT,1;
  113. TIMESC = SMILS[0];
  114. CONTROL FI;
  115.  
  116. NOTACK = FALSE;
  117. IF CBADDR NQ 0
  118. THEN # INTERLOCK A SPECIFIC PIP ONLY #
  119. BEGIN
  120. P<LLCB> = CBADDR; # LLCB ADDRESS #
  121.  
  122. IF LLCBID[0] NQ LLCBIDVALUE
  123. THEN # IF NOT LLCB #
  124. GOTO EXIT; # NO INTERLOCK IS REQUIRED #
  125.  
  126. IDXMIN = LLCBPITIDX[0]; # PIT ENTRY INDEX #
  127. IDXMAX = IDXMIN;
  128. END
  129. ELSE # NEED TO INTERLOCK ALL PIPS #
  130. BEGIN
  131. IDXMIN = 1; # INDEX FOR FIRST PIT ENTRY #
  132. IDXMAX = MAXPIP; # INDEX FOR LAST PIT ENTRY #
  133. END
  134. FOR INDEX = IDXMIN STEP 1 UNTIL IDXMAX
  135. DO # INTERLOCK ALL PIPS #
  136. BEGIN
  137. IF PITPUF[INDEX] AND # PIT ENTRY IS IN USE #
  138. NOT PITC[INDEX] # PIP HAS NOT DROPPED OUT #
  139. THEN # NEED TO INTERLOCK THIS PIP #
  140. BEGIN
  141. IF PITACK[INDEX]
  142. THEN # PREVIOUS ACK WAS NOT CLEARED #
  143. BEGIN
  144. GOTO EXIT; # DO NOT NEED INTERLOCK #
  145.  
  146. END
  147. IF PITAF[INDEX]
  148. THEN # INTERLOCK ABANDONED LAST TIME #
  149. BEGIN
  150. CONTROL SLOWLOOP;
  151. FOR INDEX = INDEX WHILE PITACK[INDEX]
  152. DO # WAIT FOR ACK TO BE CLEARED #
  153. BEGIN
  154. XRECALL(0);
  155. END
  156. PITAF[INDEX] = FALSE; # CLEAR ABANDON FLAG #
  157. END
  158. PITPF[INDEX] = TRUE; # SET INTERLOCK REQUEST #
  159. END
  160. END
  161. #
  162.   CHECK FOR ACKNOWLEDGEMENT OF INTERLOCK
  163. #
  164. FOR INDEX = IDXMIN STEP 1 UNTIL IDXMAX
  165. DO # CHECK ALL PIPS #
  166. BEGIN
  167. FLAG = TRUE;
  168. CONTROL SLOWLOOP;
  169. FOR INDEX = INDEX WHILE FLAG AND NOT NOTACK
  170. DO # UNTIL INTERLOCK ACKNOWLEDGED OR ABANDONED #
  171. BEGIN
  172. IF PITPF[INDEX] AND NOT PITACK[INDEX]
  173. THEN # PIP HAS ACKNOWLEDGED INTERLOCK#
  174. BEGIN
  175. XRECALL(0);
  176. OTIME(CURTIME); # GET CURRENT TIME #
  177. IF CURSECS[0] - TIMEC GR ACKTIME
  178. THEN # AT LEAST 2 SECONDS HAVE PASSED#
  179. BEGIN # DO NOT WAIT ANY LONGER #
  180. NOTACK = TRUE; # SET PIP NOT INTERLOCKED FLAG #
  181. END # TERMINATE EXECUTION OF LOOP #
  182. END
  183. ELSE # INTLCK NOT REQ-ED OR ACK-ED #
  184. FLAG = FALSE;
  185. END
  186. END
  187. IF NOTACK # IF INTLCK NOT ACK-ED #
  188. THEN
  189. BEGIN
  190. MCLRIL; # CLEAR INTERLOCK REQUEST #
  191. OMSG(DFMSG19); # " NO INTERLOCK" #
  192. ABORT(0,0);
  193. END
  194. EXIT:
  195.  
  196. CONTROL IFEQ STAT,1;
  197. OTIME(ETIME); # GET SYSTEM TIME AT END OF PROCEDURE #
  198. ST$NMS = ST$NMS + 1; # INCREMENT NUMBER OF TIMES MSETIL CALLED #
  199. STTEMP = EMILS[0] - TIMESC; # TIME SPENT WAITINT FOR INTERLOCK#
  200. ST$TMS = ST$TMS + STTEMP; # TOTAL TIME SPENT IN MSETIL #
  201. IF ST$LMS LS STTEMP
  202. THEN # FOUND LARGER TIME INTERVAL IN ROUTINE #
  203. BEGIN
  204. ST$LMS = STTEMP; # NEW LARGEST TIME INTERVAL #
  205. END
  206. CONTROL FI;
  207.  
  208. RETURN;
  209. END
  210. TERM
1)
CBADDR
cdc/nos2.source/nam5871/msetil.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator