User Tools

Site Tools


cdc:nos2.source:nam5871:xchkcet

XCHKCET

Table Of Contents

  • [00018] PRGM XCHKCET
  • [00102] PROC ABORT
  • [00103] PROC MCLRIL
  • [00104] PROC MGETS
  • [00105] PROC MRELS
  • [00106] PROC MSETIL
  • [00107] PROC OVLCALL
  • [00108] PROC XTRACE
  • [00109] PROC BLDKWL
  • [00110] PROC OSREQ
  • [00111] PROC OMSG

Source Code

XCHKCET.txt
  1. *DECK XCHKCET
  2. USETEXT NIPDEF
  3. USETEXT CET
  4. USETEXT DRHDR
  5. USETEXT FREETAB
  6. USETEXT MEM
  7. USETEXT MSGIDX
  8. USETEXT NBT
  9. USETEXT INPARUT
  10. USETEXT OVERLAY
  11. USETEXT PARAMS
  12. USETEXT PIT
  13. USETEXT PT
  14. USETEXT KDIS
  15. USETEXT KSTTAB
  16. USETEXT STATTAB
  17. USETEXT SYSTIME
  18. PRGM XCHKCET; # CALL PIP AND PROCESS CET CHANGES #
  19.  
  20. STARTIMS;
  21. #
  22. *1DC XCHKCET
  23. * 1. PROC NAME AUTHOR DATE
  24. * XCHKCET L.T. NGUYEN 81/07/31
  25. *
  26. * 2. FUNCTIONAL DESCRIPTION
  27. * - PROCESS EST CHANGES
  28. * - UPDATE STATUS PIT AND NBT.
  29. *
  30. * 3. METHOD
  31. * CHECK THE CHANGE FLAG ( CETC1 ) IN EST :
  32. * - IF ON
  33. * . INDEX THROUGH PIT TABLE TO FIND PIT ENTRY CORRESPONDING TO
  34. * PIP NUMBER. IF NEW ENTRY, SET UP PIT TABLE.
  35. * . LOOK FOR FREE NBTE ENTRY, SET UP THE NEW NBTE AND
  36. * POINTER IN PITE. IF NEW PIP, DO PIP CALL. IF NO NBTE
  37. * ENTRY FOUND, ERROR EXIT. SET CHANGE FLAG CETC1 IN
  38. * EST TO FALSE BEFORE LEAVING THE ROUTINE.
  39. *
  40. * - IF NOT ON
  41. * . XEXEC CALLS THE ROUTINE PERIODICALLY ( 10 SECS ). UPDATE
  42. * STATUS OF PIT TABLE BY SCANNING IT
  43. * . IF PIP DROPPED AND ALL NBTE ENTRIES ARE ZERO, RELEASE
  44. * PIP BUFFER AREAS.
  45. * . IF DROPPING PIP COMPLETED AND THERE IS A NON-ZERO NBTE,
  46. * CALL PIP AGAIN ( EST WAS TURNED ON BEFORE PIP DROPPED OUT
  47. * COMPLETELY.
  48. * . IF AN ACTIVE PIP HAS REQUESTED A DUMP BUFFER ALLOCATE IT.
  49. * REQUEST MORE BUFFER FOR DUMP.
  50. *
  51. * 4. ENTRY PARAMETERS
  52. * - NONE.
  53. *
  54. * 5. EXIT PARAMETERS
  55. * -
  56. *
  57. * 6. COMDECKS CALLED
  58. * - CET
  59. * - DRHDR
  60. * - MEM
  61. * - MSGIDX
  62. * - NBT
  63. * - OVERLAY
  64. * - PARAMS
  65. * - PIT
  66. * - PT
  67. * - KDIS
  68. * - NIPDEF
  69. * - STATTAB
  70. * - OPSIZE
  71. * - SYSTIME CURRENT RTIME VALUE
  72. *
  73. * 7. ROUTINES AND OVERLAYS CALLED
  74. * ABORT - ABORT NIP
  75. * MCLRIL - CLEAR NIP/PIP INTERLOCK
  76. * MGETS - ALLOCATE BUFFER
  77. * MSETIL - SET NIP/PIP INTERLOCK
  78. * OVLCALL - LOAD AND EXECUTE OVERLAY
  79. * XTRACE - TRACE PROCEDURE CALL
  80. * KADD - ADD ENTRY INTO K-DISPLAY
  81. * KPUT - UPDATE K-DISPLAY STATUS
  82. * OSREQ - CALL PIP
  83. * OMSG - ISSUE DAYFILE MESSAGE
  84. *
  85. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  86. *
  87. * * BAD PIP NUMBER IN EST ENTRY *
  88. *
  89. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE PRIMARY
  90. *CALL OPSIZE
  91. * THIS ROUTINE IS CALLED WHEN INFORMATION IN EST CHANGED,
  92. * OR XEXEC WILL CALL PERIODICALLY ( 10 SECS ) TO UPDATE
  93. * PIT TABLE.
  94. *
  95.  #
  96. STOPIMS;
  97. #
  98.   EXTERNAL VARIABLES
  99. #
  100. XREF
  101. BEGIN
  102. PROC ABORT; # ABORT NIP #
  103. PROC MCLRIL; # CLEAR NIP/PIP INTERLOCK #
  104. PROC MGETS;
  105. PROC MRELS;
  106. PROC MSETIL; # SET NIP/PIP INTERLOCK #
  107. PROC OVLCALL;
  108. PROC XTRACE;
  109. PROC BLDKWL; # FORMAT KWL TO ADD EST TO ST #
  110. PROC OSREQ; # CALL PIP #
  111. PROC OMSG ;
  112. LABEL RJMAIN;
  113. END
  114. #
  115.   INTERNAL VARIABLES
  116. #
  117. ARRAY ABTMSG S(4); # ABORT NIP DAYFILE MESSAGE #
  118. BEGIN
  119. ITEM ABTMSG1 C(0,00,35)=[" XCHKCET - BAD PIP NO IN EST ENTRY."];
  120. ITEM ABTMSGE U(3,30,30)=[0];
  121. END
  122.  
  123. BASED ARRAY PITNBTW S(1); # TEMPLATE FOR NBT ENTRY WD IN PIT #
  124. BEGIN
  125. ITEM PITNBTWH B(00,00,01); # HALT NPU FLAG #
  126. ITEM PITNBTWE U(00,30,06); # NBT TABLE ENTRY INDEX #
  127. ITEM PITNBTWA I(00,42,18); # NBT ENTRY ADDRESS #
  128. END
  129.  
  130. ARRAY ITPIP S(1); # PIP CALL WORD #
  131. BEGIN
  132. ITEM ITNAME C(0,0,3) = ["PIP"]; # PIP NAME #
  133. ITEM ITFILL1 U(0,18,1) = [0];
  134. ITEM ITRCALL B(0,19,1) = [FALSE]; # NO RECALL #
  135. ITEM ITFILL2 U(0,20,4) = [0];
  136. ITEM ITFUNC U(0,24,12); # PIP CALL TYPE #
  137. ITEM ITFILL3 U(0,36,6) = [0];
  138. ITEM ITADDR U(0,42,AL); # PARAMETER WORD ADDRESS #
  139. END
  140.  
  141. ITEM J U ;
  142. ITEM INDEX;
  143. ITEM PIPCALL B;
  144. ITEM FOUND B;
  145. ITEM NBTIX;
  146. ITEM PIPNR;
  147. ITEM TEMP;
  148. ITEM NBTENR;
  149. ITEM NBTEADDR;
  150. ITEM PNAME C(10) = "CCET"; # PROC NAME PASSED TO ERROR MSG #
  151. ARRAY ALRT S(3) ;
  152. BEGIN
  153. ITEM ALRT1 C(0,0,20)=["$REQUEST *K* DISPLAY"] ;
  154. ITEM ALRT2 U(2,0,60)=[0] ;
  155. END
  156.  
  157. #**********************************************************************#
  158. BEGIN
  159.  
  160. CONTROL IFEQ DEBUG,1;
  161. XTRACE("XCHCE") ;
  162. CONTROL FI;
  163.  
  164. #
  165.   CHECK IF WE HAVE ANY ALERT TO INFORM
  166. #
  167. IF NOT KDVW[0] # K DISPLAY NOT BEING VIEWED #
  168. AND (KDNAL[0] NQ 0 # ALERT(S) PENDING #
  169. OR KDALERT[0] # K DISPLAY ALERT OUTSTANDING #
  170. OR HRL EQ 0) # MAX FL REACHED , ALERT OPERATOR #
  171. THEN
  172. OMSG(ALRT,2) ;
  173.  
  174. PIPCALL = FALSE ; # ASSUMMING NO PIP CALL#
  175. IF CETC1[1]
  176. THEN # PROCESS CET CHANGES #
  177. BEGIN
  178. FOR INDEX = CETHSIZE STEP 1 UNTIL CETBS[0]-1
  179. DO
  180. IF CETC2[INDEX]
  181. THEN
  182. BEGIN
  183. CETOFF[INDEX] = FALSE;
  184. CETNON[0] = CETNON[0] + 1;
  185. CETNOFF[0] = CETNOFF[0] - 1;
  186.  
  187. #
  188.   CHECK PIP NUMBER FROM EST ENTRY
  189. #
  190. PIPNR = CETPIP[INDEX]; # PIP NUMBER FROM CET ENTRY #
  191. IF PIPNR LS 1 OR # PIP NUMBER IS TOO SMALL #
  192. PIPNR GR 4 # PIP NUMBER IS TOO LARGE #
  193. THEN # ABORT NIP FOR BAD EST ENTRY #
  194. BEGIN
  195. OMSG(ABTMSG,0); # ISSUE DAYFILE MESSAGE #
  196. ABORT(0,0); # ABORT NIP #
  197. END
  198. FOUND = FALSE; # RESET TO SEARCH EMPTY NBTE#
  199. FOR NBTIX = 0 WHILE NOT FOUND
  200. AND NBTIX LQ NBTMAXID
  201. DO
  202. BEGIN
  203. IF NOT NBTIUF[NBTIX]
  204. THEN # FREE NBTE FOUND #
  205. FOUND = TRUE;
  206. ELSE
  207. NBTIX = NBTIX + NBTFETNO;
  208. END
  209. IF FOUND
  210. THEN
  211. BEGIN
  212. #
  213.   SET UP PIT ENTRY
  214. #
  215. IF NOT PITPUF[PIPNR]
  216. THEN # NEW PIT ENTRY USED #
  217. BEGIN
  218. PIPCALL = TRUE; # NEED TO CALL PIP INTO PP #
  219. PITC[PIPNR] = FALSE;
  220. PITACK[PIPNR] = FALSE;
  221. PITPF[PIPNR] = FALSE;
  222. PITESF[PIPNR] = FALSE;
  223. PITAF[PIPNR] = FALSE;
  224. FOUND = FALSE;
  225. FOR TEMP = 1 STEP 1 UNTIL MAXPIP
  226. DO # CHECK IF ANY OTHER PIPS #
  227. BEGIN
  228. IF PITPUF[TEMP]
  229. THEN # THERE IS ANOTHER PIP RUNNING #
  230. BEGIN
  231. FOUND = TRUE;
  232. END
  233. END
  234. IF NOT FOUND
  235. THEN # THIS PIP WILL DO EST SCAN #
  236. BEGIN
  237. PITESF[PIPNR] = TRUE; # SET EST SCAN FLAG #
  238. END
  239. PITPUF[PIPNR] = TRUE; # SET PIT ENTRY IN USE FLAG #
  240. END
  241. NBTENR = NBTIX/NBTFETNO; # NBTE NUMBER #
  242. NBTEADDR = LOC(NBTIUF[NBTIX]); # NBTE ADDRESS #
  243. FOR TEMP = NBTEADDR STEP 1 UNTIL NBTEADDR+NBTESIZE-1
  244. DO
  245. MEMORY[TEMP] = 0; # CLEAR NBTE AREA #
  246. FOUND = FALSE; # RESET TO PLACE NBTE ADDR IN PITE #
  247. #
  248.   LOOK FOR FREE NBT ENTRY IN PIT TABLE ENTRY
  249. #
  250. P<PITNBTW> = LOC(PITNBTE1[PIPNR]); # ADDR OF 1ST NBT ENT#
  251. TEMP = 0;
  252. FOR PIPNR=PIPNR WHILE NOT FOUND AND
  253. TEMP LQ MAXNPU-1
  254. DO # CHECK EACH NBT ENTRY WORD IN PIT ENTRY #
  255. BEGIN
  256. IF PITNBTWA[TEMP] EQ 0
  257. THEN # FOUND EMPTY NBT ENTRY IN PIT TABLE #
  258. BEGIN
  259. FOUND = TRUE;
  260. END
  261. ELSE # CHECK NEXT SLOT IN PIT TABLE ENTRY #
  262. BEGIN
  263. TEMP = TEMP + 1;
  264. END
  265. END
  266. IF FOUND
  267. THEN
  268. BEGIN
  269. NBTNAE[0] = NBTNAE[0] + 1; # INCREMENT ACTIVE NBTE CNT #
  270. NBTNFE[0] = NBTNFE[0] - 1; # DECREMENT FREE NBTE COUNT #
  271. NBTIUF[NBTIX] = TRUE; # SET NBTE USE FLAG #
  272. NBTINDX[NBTIX] = NBTENR; # SET NBTE NUMBER #
  273. NBTPIP[NBTIX] = PIPNR; # PLACE PIP NUMBER #
  274. NBTEST[NBTIX] = CETEST[INDEX];
  275. NBTCH[NBTIX] = CETCH[INDEX];
  276. NBTEQ[NBTIX] = CETEQ[INDEX];
  277. NBTET[NBTIX] = CETET[INDEX] ;
  278. NBTHN[NBTIX] = CETHN[INDEX];
  279. NBTSAM[NBTIX] = CETSAM[INDEX];
  280. IF KDST[0]
  281. THEN # ADD EST ENTRY TO STATUS DISPLAY #
  282. BLDKWL(KST"EST",CETHN[INDEX],0,KADDIDVALUE);
  283. MGETS(NINBMIN,P<DRHDRWD>,FALSE); # GET INBOUND BUFFER #
  284. NBTFIRST[NBTIX] = P<DRHDRWD>;# SET FIRST POINTER #
  285. NBTIN[NBTIX] = P<DRHDRWD>; # SET IN POINTER #
  286. NBTTA[NBTIX] = P<DRHDRWD> + NINBMIN/2;
  287. NBTOUT[NBTIX] = P<DRHDRWD>; # SET OUT POINTER #
  288. NBTLIMIT[NBTIX] = P<DRHDRWD> + NINBMIN; # SET LIMIT PTR#
  289. NBTBAF[NBTIX] = TRUE;
  290. NBTOF[NBTIX+4] = FALSE; # CLEAR OFF FLAG #
  291. NBTTN[NBTIX+1] = CETTN[INDEX]; # CDCNET FE TERM NODE #
  292. NBTCII[NBTIX+1] = NBTIX; # INITIAL INPUT FET INDEX #
  293. NBTRJCNT[NBTIX+1] = 0; # INIT REJECT COUNT #
  294. NBTCOFF[NBTIX+1] = NINBMIN/2; # INIT THRESHOLD OFFSET #
  295. NBTCSIZE[NBTIX+1] = NINBMIN; # INIT SIZE OF BUFFER #
  296. NBTRTIME[NBTIX+1] = RTSECS[0] + NINBRJTO; #INIT TIMEOUT#
  297. BLKID[0] = PIBIDVALUE;
  298.  
  299. CONTROL IFEQ STAT,1;
  300. ST$NIB = ST$NIB + 1;
  301. CONTROL FI;
  302.  
  303. NBTAF[NBTIX+4] = TRUE; # SET NPU ACTIVE #
  304. NBTMF[NBTIX+4] = TRUE; # SET NPU INITIAL #
  305.  
  306. PITNBTWE[TEMP] = NBTENR + 1; # NBT ENTRY INDEX #
  307. PITNBTWA[TEMP] = NBTEADDR; # NBT ENTRY ADDRESS #
  308. IF PITC[PIPNR]
  309. THEN # PIP FOR THIS PIT ENTRY HAS DROPPED OUT #
  310. BEGIN
  311. PIPCALL = TRUE; # CALL IT BACK INTO PP AGAIN #
  312. PITC[PIPNR] = FALSE;
  313. END
  314. END
  315. ELSE
  316. #
  317.   PIT IS FULL (WINDOW WHEN THIS CAN HAPPEN-
  318.   WHERE NAM HAS NOT CLEARED A FREE ENTRY YET )
  319.   #
  320. GOTO EXIT;
  321. END
  322. ELSE
  323. #
  324.   NBTE IS FULL ( WINDOW WHEN THIS CAN HAPPEN-
  325.   WHERE NAM HAS NOT CLEARED A FREE ENTRY YET)
  326.   #
  327. GOTO EXIT;
  328.  
  329. IF PIPCALL
  330. THEN
  331. BEGIN
  332. ITFUNC = FCDRIVE; # PIP CALL TYPE #
  333. ITADDR[0] = LOC(PITW0[PIPNR]); # ADDR OF PIT ENTRY #
  334. OSREQ(ITPIP); # CALL DEDICATED PIP #
  335. PIPCALL = FALSE;
  336. END
  337. CETC2[INDEX] = FALSE;
  338. END
  339. CETC1[1] = FALSE;
  340.  
  341. END
  342. ELSE # CALL PIP FOR CET CHANGES #
  343. BEGIN
  344. FOUND = FALSE; # FLAG PIP FOR SCAN EST DROP#
  345. TEMP = 0; # ACTIVE PIP ENTRY INDEX #
  346. #
  347.   CHECK FOR NEW PIP TO SCAN EST IF OLD PIP DROPPED OUT
  348.   ALSO CLEAR IN USE FLAG FOR PIPS WHICH DROPPED OUT AND RELEASE
  349.   ANY PRU BUFFERS THEY MAY STILL BE HOLDING.
  350. #
  351. FOR INDEX = 1 STEP 1 UNTIL MAXPIP
  352. DO
  353. BEGIN
  354. IF PITPUF[INDEX]
  355. THEN
  356. BEGIN
  357. IF PITC[INDEX]
  358. THEN # THIS PIP HAS DROPPED OUT #
  359. BEGIN
  360. PITPUF[INDEX] = FALSE; # CLEAR PIT ENTRY IN USE FLAG #
  361. PARAMS1 = 1; # 1 PRU BUFFER SIZE #
  362. PARAMS2 = INDEX; # PIT ENTRY INDEX #
  363. OVLNAME = NPRLBP; # NAME OF OVERLAY TO LOAD #
  364. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  365. END
  366. ELSE # THIS PIT ENTRY IS STILL IN USE #
  367. BEGIN
  368. TEMP = INDEX; # REMEMBER THIS PIP NUMBER #
  369. IF PITESF[INDEX]
  370. THEN
  371. BEGIN
  372. FOUND = TRUE; # FOUND PIP WHICH IS SCANNING EST #
  373. END
  374. END
  375. END
  376. END
  377. IF NOT FOUND AND
  378. TEMP NQ 0
  379. THEN # FOUND NEW PIP TO DO EST SCAN #
  380. BEGIN
  381. PITESF[TEMP] = TRUE; # SET SCAN EST FLAG #
  382. END
  383. IF CETC[1]
  384. THEN
  385. BEGIN
  386. CETC[1] = FALSE;
  387. IF TEMP EQ 0 # IF NO ACTIVE PIT ENTRY #
  388. THEN
  389. BEGIN
  390. ITFUNC[0] = FCSCAN;
  391. ITADDR[0] = P<CET> ;
  392. OSREQ(ITPIP); # CALL PIP FOR SCAN EST #
  393. END
  394. END
  395. END
  396.  
  397. EXIT:
  398. GOTO RJMAIN; # RETURN #
  399. ERRXIT:
  400. PARAMS1 = DFMSG01; # NIP FATAL ERROR PROC = XXXX. #
  401. PARAMS6 = PNAME; # PROC = CCET #
  402. OVLNAME = XERRMSGP;
  403. OVLCALL;
  404. END
  405. TERM
cdc/nos2.source/nam5871/xchkcet.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator