Table of Contents

SXSLV

Table Of Contents

  • [00001] PROC FLUSHSM
  • [00002] FLUSHSM - FLUSH THE *STOM* BUFFERS.
  • [00007] FLUSHSM - FLUSH THE *STOM* BUFFERS.
  • [00029] PROC PDATE
  • [00030] PROC REWIND
  • [00031] PROC REWRITR
  • [00032] PROC RTIME
  • [00080] PROC INITSLV1)
  • [00081] INITSLV - INITIALIZE SLAVE EXEC.
  • [00086] INITSLV - INITIALIZATION ROUTINE FOR THE *SSSLV*.
  • [00135] PROC ABORT
  • [00136] PROC MEMORY
  • [00137] PROC MESSAGE
  • [00138] PROC PFD
  • [00139] PROC READ
  • [00140] PROC READW
  • [00141] PROC RECALL
  • [00142] PROC RETERN
  • [00143] PROC REWIND
  • [00144] PROC WRITER
  • [00145] FUNC XCOD C(10)
  • [00146] PROC ZFILL
  • [00147] PROC ZSETFET
  • [00458] PROC SLVEXEC
  • [00459] SLVEXEC - SLAVE EXEC.
  • [00504] PROC ABORT
  • [00505] PROC FLUSHSM
  • [00506] PROC SSOVL
  • [00507] FUNC XCOD C(10)
  • [00508] PROC MESSAGE
  • [00556] PROC SLVINIT
  • [00557] SLVINIT - *SSSLV* INITIALIZER SETUP ROUTINE.
  • [00562] LVINIT - *SSSLV* INITIALIZER SETUP ROUTINE.
  • [00611] PROC ABORT
  • [00612] PROC CALLSS
  • [00613] PROC EXTAB
  • [00614] PROC GETFAM
  • [00615] PROC GETMI
  • [00616] PROC INITDAM
  • [00617] PROC INITSLV
  • [00618] PROC MESSAGE
  • [00619] PROC SETPFP
  • [00620] PROC XARG
  • [00621] FUNC XDXB U
  • [00736] PROC SLVLOOP
  • [00737] SLVLOOP - SLAVE MAIN LOOP.
  • [00742] SLVLOOP - SLVEXEC MAIN LOOP.
  • [00782] PROC FLUSHSM
  • [00783] PROC MEMORY
  • [00784] PROC PDATE
  • [00785] PROC RECALL
  • [00786] PROC RTIME
  • [00787] PROC SLVMTOS
  • [00788] PROC ZFILL
  • [00789] PROC ZSETFET
  • [00956] PROC SLVMTOS
  • [00957] SLVMTOS - PROCESS *MTOS* COMMUNICATION FILE.
  • [00962] SLVMTOS - PROCESS THE *MTOS* COMMUNICATION FILE.
  • [00995] PROC EESET
  • [00996] PROC MESSAGE
  • [00997] PROC PDATE
  • [00998] PROC READ
  • [00999] PROC REWIND
  • [01000] PROC RTIME

Source Code

SXSLV.txt
  1. PROC FLUSHSM;
  2. # TITLE FLUSHSM - FLUSH THE *STOM* BUFFERS. #
  3.  
  4. BEGIN # FLUSH *STOM* BUFFERS #
  5.  
  6. #
  7. ** FLUSHSM - FLUSH THE *STOM* BUFFERS.
  8. *
  9. * *FLUSHSM* WILL UPDATE THE SLAVE WRITE COUNTER AND PACKED
  10. * DATE/TIME FIELDS IN THE SLAVE STATUS WORD OF THE *STOM* FILE
  11. * BUFFER AND UPDATE THE DISK IMAGE OF THE *STOM* FILE BY
  12. * WRITING THE BUFFER TO THE LINK DEVICE.
  13. *
  14. * PROC FLUSHSM.
  15. *
  16. * ENTRY ARRAY *STOMS* IS THE *FET* FOR THE *STOM* FILE
  17. * BUFFER.
  18. *
  19. * EXIT THE NEXT TIME *FLUSHSM* IS TO BE CALLED IS ESTABLISHED
  20. * BY UPDATING THE VARIABLE *STOM$TIME*.
  21. #
  22.  
  23. #
  24. **** PROC FLUSHSM - XREF LIST BEGIN.
  25. #
  26.  
  27. XREF
  28. BEGIN
  29. PROC PDATE; # ISSUE PDATE MACRO #
  30. PROC REWIND; # REWIND FILE #
  31. PROC REWRITR; # REWRITE FILE #
  32. PROC RTIME; # ISSUE RTIME MACRO #
  33. END
  34.  
  35.  
  36. #
  37. **** PROC FLUSHSM - XREF LIST END.
  38. #
  39.  
  40. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  41. *CALL,COMBFAS
  42. *CALL,COMBFET
  43. *CALL,COMXCTF
  44. *CALL,COMXIPR
  45. *CALL,COMXMMF
  46. *CALL,COMXSEB
  47.  
  48.  
  49.  
  50.  
  51.  
  52. #
  53. * UPDATE THE HEADER INFORMATION OF THE *STOM* FILE.
  54. #
  55.  
  56. SM$SWC[0] = SM$SWC[0] + 1;
  57. PDATE(PDATESTAT[0]);
  58. RTIME(RTIMESTAT[0]);
  59. SM$PDATE[0] = PDATEV[0];
  60.  
  61. #
  62. * SET UP THE TIME TO NEXT FLUSH THE *STOM* BUFFERS.
  63. #
  64.  
  65. STOM$TIME = RTIMSECS[0] + SM$DELAY[0];
  66.  
  67. #
  68. * WRITE THE *STOM* BUFFER TO THE *STOM* FILE.
  69. #
  70.  
  71. REWIND(STOMS,RCL);
  72. P<FETSET> = LOC(STOMS);
  73. FET$OUT[0] = FET$FRST[0];
  74. FET$IN[0] = FET$FRST[0] + L$STOM;
  75. REWRITR(STOMS,RCL);
  76. RETURN;
  77. END # FLUSHSM #
  78.  
  79. TERM
  80. PROC INITSLV((MID),(MIDX),(SLVDELAY));
  81. # TITLE INITSLV - INITIALIZE SLAVE EXEC. #
  82.  
  83. BEGIN # INITSLV #
  84.  
  85. #
  86. ** INITSLV - INITIALIZATION ROUTINE FOR THE *SSSLV*.
  87. *
  88. * *INITSLV* INITIALIZES THE *STOM* AND *MTOS* FILES FOR PROCESSING
  89. * BY THE REST OF THE *SSSLV* ROUTINES.
  90. *
  91. * PROC INITSLV((MID),(MIDX),(SLVDELAY))
  92. *
  93. * ENTRY (MID) - MACHINE ID OF THE *SSSLV*.
  94. * (MIDX) - MACHINE INDEX OF THE *SSSLV*.
  95. * (SLVDELAY) - THE INTERVAL IN SECONDS THAT THE
  96. * *SSEXEC* IS TO POLL THE *SSSLV*-S
  97. * COMMUNICATION FILE (*STOM*).
  98. *
  99. * THE CALLING ROUTINE HAS DONE A *SETPFP* TO THE CORRECT
  100. * FAMILY AND USER INDEX.
  101. *
  102. * EXIT THE *STOM* AND *MTOS* FILES ARE ATTACHED WITH FET-S
  103. * AND BUFFERS ESTABLISHED SO THEY CAN BE WRITTEN AND
  104. * READ, RESPECTIVELY.
  105. *
  106. * THE ITEM *SLVEND* IS SET TO A STATUS VALUE OF IDLE IF
  107. * THE IDLE FLAG WAS SET. THIS WILL PERMIT THE OPERATOR
  108. * TO TERMINATE THE *SSSLV* BEFORE INITIALIZATION IS
  109. * COMPLETE.
  110. *
  111. * MESSAGES
  112. * * SLVI ACTIVE, EXEC XXXX.*
  113. * AN INFORMATIVE MESSAGE INDICATING THE INITIAL
  114. * STATUS OF THE *SSEXEC*. *XXXX* = *ACTIVE*
  115. * OR *IDLE*.
  116. *
  117. *
  118. * * SLVI, STBMNOI FILE PROBLEM. *
  119. * A MESSAGE INDICATING THE STATUS OF THE ATTEMPT
  120. * TO ESTABLISH ACCESS TO THE COMMUNICATION FILE
  121. * USED TO SEND MESSAGES TO THE *SSEXEC*.
  122. #
  123.  
  124. ITEM MID C(2); # MACHINE ID OF THE SLAVE EXEC #
  125. ITEM MIDX U; # MACHINE INDEX OF THE *SSSLV* #
  126. ITEM SLVDELAY U; # TIME IN SECONDS FOR MASTER TO
  127.   POLL *STOM* #
  128.  
  129. #
  130. **** PROC INITSLV - XREF LIST BEGIN.
  131. #
  132.  
  133. XREF
  134. BEGIN
  135. PROC ABORT; # ISSUE ABORT MACRO #
  136. PROC MEMORY; # ISSUE MEMORY MACRO #
  137. PROC MESSAGE; # ISSUES MESSAGE MACRO #
  138. PROC PFD; # PERMANENT FILE REQUEST DELAYS #
  139. PROC READ; # READ FILE #
  140. PROC READW; # READ LINE #
  141. PROC RECALL; # ISSUE RECALL MACRO #
  142. PROC RETERN; # RETURN FILE #
  143. PROC REWIND; # REWIND FILE #
  144. PROC WRITER; # WRITE FILE #
  145. FUNC XCOD C(10); # INTEGER TO DISPLAY #
  146. PROC ZFILL; # ZERO FILL AN ARRAY #
  147. PROC ZSETFET; # INITIALIZE *FET* #
  148. END
  149.  
  150. #
  151. **** PROC INITSLV - XREF LIST END.
  152. #
  153.  
  154. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  155. *CALL,COMBFAS
  156. *CALL,COMBFET
  157. *CALL,COMBPFS
  158. *CALL,COMXCTF
  159. *CALL,COMXINT
  160. *CALL,COMSPFM
  161. *CALL,COMXIPR
  162. *CALL,COMXJCA
  163. *CALL,COMXMMF
  164. *CALL,COMXSEB
  165.  
  166. ITEM I U; # INDUCTION VARIABLE #
  167. ITEM INITMTOS U; # INDUCTION VARIABLE #
  168. ITEM INITSTOM U; # INDUCTION VARIABLE #
  169. ITEM MTOSOK B; # CONTROLS LOOP TO ATTACH *MTOS* #
  170. ITEM RB U; # INDEX TO A REQUEST BLOCK #
  171. ITEM ONEMSG B; # CONTROLS DAYFILE MESSAGES #
  172. ITEM STAT U; # SCRATCH VARIABLE #
  173. ITEM STOMOK B; # CONTROLS REDEFINING *STOM* #
  174.  
  175. CONTROL EJECT;
  176.  
  177. #
  178. * INITIALIZE *MTOS*/*STOM* FILE LENGTH VARIABLES.
  179. #
  180.  
  181. L$STOM = (NUMRB + 1) * RBSIZE;
  182. L$MTOSH = (MAXSLV + 1) * 3;
  183. L$MTOS = L$MTOSH + NUMRB * NUMSLV;
  184.  
  185. #
  186. * CALCULATE THE SPACE NEEDED FOR THE *MTOS* BUFFER.
  187. * OBTAIN THE SPACE VIA THE *MEMORY* REQUEST.
  188. #
  189.  
  190. P<MTOSHEAD> = RA$NWA[0];
  191. I = (L$MTOS + PRULEN) / PRULEN;
  192. MTOSBUFL = I * PRULEN + 1;
  193. MEM$AMT[0] = RA$NWA[0] + MTOSBUFL;
  194. MEMORY("CM",MEMREQ,RCL,NA);
  195.  
  196.  
  197. #
  198. * INITIALIZE THE *STOM* FILE.
  199. #
  200.  
  201. P<STOMFILE> = LOC(STOMSBUF);
  202. PFNSTOM = STOMPFN;
  203. CHAR10 = XCOD(MIDX);
  204. CHAR1 = C<9,1>CHAR10;
  205. B<36,6>PFNSTOM = CHAR1;
  206. MSG$SINDX[0] = CHAR1;
  207. ABT$SINDX[0] = CHAR1;
  208. ERR$SINDX[0] = CHAR1;
  209. IDLE$SINDX[0] = CHAR1;
  210. MSGE$SINDX[0] = CHAR1;
  211.  
  212. MSG$NAME[0] = PFNSTOM;
  213.  
  214. IF MIDX EQ 0
  215. THEN # SINGLE MAINFRAME MODE #
  216. BEGIN
  217. MSG$STAT[0] = "ONE MAINFRAME.";
  218. GOTO MODERROR;
  219. END
  220.  
  221.  
  222. STOMOK = TRUE;
  223. ZSETFET(LOC(STOMS),STOMSLFN,LOC(MTOSHEAD),PRULEN + 1,SFETL);
  224. RETERN(STOMS,RCL);
  225. PFD("ATTACH",STOMSLFN,PFNSTOM,"PW",STOMPW,"M","M",
  226. "RC",PFSTAT,"NA",0,"UP",0,0);
  227. IF PFSTAT EQ FBS
  228. THEN # *STOM* BUSY #
  229. BEGIN
  230. GOTO WAITSTOM;
  231. END
  232.  
  233.  
  234. #
  235. * READ THE *STOM* FILE AND INITIALIZE MISSING FIELDS.
  236. * IF THE ATTACH FAILED, THE ENTIRE PERMANENT
  237. * FILE WILL BE INITIALIZED.
  238. #
  239.  
  240. ZFILL(STOMSBUF[0],L$STOM);
  241. IF PFSTAT EQ OK
  242. THEN # INITIALIZE THE *STOM* HEADER #
  243. BEGIN
  244. READ(STOMS,NRCL);
  245. READW(STOMS,STOMSBUF[0],RBSIZE,STAT);
  246. END
  247.  
  248. STOMOK = STAT EQ OK AND PFSTAT EQ OK;
  249. SM$MIDS[0] = MID;
  250. SM$IDLE[0] = FALSE;
  251. IF SLVDELAY LQ 0
  252. THEN
  253. BEGIN
  254. SM$DELAY[0] = SLRP$INTV;
  255. END
  256.  
  257. ELSE
  258. BEGIN
  259. SM$DELAY[0] = SLVDELAY;
  260. END
  261.  
  262. SLOWFOR RB = 1 STEP 1 WHILE STOMOK AND RB LQ NUMRB
  263. DO
  264. BEGIN # INITIALIZE EACH REQUEST BLOCK #
  265.  
  266. READW(STOMS,STOMSBUF[RB],RBSIZE,STAT);
  267.  
  268. IF STAT EQ OK
  269. THEN # INITIALIZE OLD FIELDS #
  270. BEGIN
  271. IF SM$SRC[RB] EQ S"SUBMITTED"
  272. THEN # CANCEL PREVIOUS REQUEST #
  273. BEGIN
  274. SM$SRC[RB] = S"CANCEL";
  275. END
  276.  
  277. END
  278.  
  279. ELSE # ENTIRE REQUEST BLOCK #
  280. BEGIN
  281. STOMOK = FALSE;
  282. ZFILL(STOMSBUF[RB],RBSIZE);
  283. END
  284.  
  285. END # INITIALIZE EACH REQUEST BLOCK #
  286.  
  287. #
  288. * INITIALIZE THE FET TO BE USED FOR DOING
  289. * I/O ON THE *STOM* FILE.
  290. #
  291.  
  292.  
  293. ZSETFET(LOC(STOMS),STOMSLFN,LOC(STOMSBUF),L$STOM + 1,SFETL);
  294.  
  295. #
  296. * IF THE ATTACH OR READ HAD A PROBLEM, PURGE
  297. * THE OLD *STOM* FILE AND DEFINE A NEW ONE. THEN
  298. * WRITE OUT THE INITIALIZED *STOM* FILE AND
  299. * REATTACH *STOM* IN MODIFY MODE.
  300. #
  301.  
  302. IF NOT STOMOK
  303. THEN
  304. BEGIN # CREATE A NEW *STOM* FILE #
  305.  
  306. RETERN(STOMS,RCL);
  307. PFD("PURGE",PFNSTOM,"PW",STOMPW,"RC",PFSTAT,"UP",0,0);
  308. PFD("DEFINE",STOMSLFN,PFNSTOM,"PW",STOMPW,"BR","N",
  309. "R",LINK$DT[0],"RC",PFSTAT,"UP",0,0);
  310. IF PFSTAT NQ OK
  311. THEN
  312. BEGIN
  313. GOTO WAITSTOM;
  314. END
  315.  
  316. FET$OUT[0] = FET$FRST[0];
  317. FET$IN[0] = FET$FRST[0] + L$STOM;
  318. WRITER(STOMS,RCL);
  319. PFD("ATTACH",STOMSLFN,PFNSTOM,"PW",STOMPW,"M","M",
  320. "RC",PFSTAT,"NA",0,"UP",0,0);
  321. IF PFSTAT NQ OK
  322. THEN # REATTACH FAILED #
  323. BEGIN
  324. GOTO WAITSTOM;
  325. END
  326.  
  327. END # CREATE A NEW *STOM* FILE #
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. #
  335. * ATTACH THE *MTOS* FILE AND COMPLETE INITIALIZATION.
  336. #
  337.  
  338. ZSETFET(LOC(MTOSS),MTOSSLFN,LOC(MTOSHEAD),MTOSBUFL,SFETL);
  339. MTOSOK = FALSE;
  340. MSG$NAME[0] = MTBSPFN;
  341.  
  342. FASTFOR INITMTOS = 1 STEP 1 WHILE NOT MTOSOK
  343. DO
  344. BEGIN # INITIALIZE *MTOS* FILE #
  345.  
  346. PFD("ATTACH",MTOSSLFN,MTBSPFN,"PW",MTOSPW,"M","RM",
  347. "RC",PFSTAT,"NA",0,"UP",0,0);
  348. IF PFSTAT NQ OK
  349. THEN
  350. BEGIN
  351. GOTO WAITMTOS;
  352. END
  353.  
  354. REWIND(MTOSS[0],RCL);
  355. READ(MTOSS,RCL);
  356.  
  357. #
  358. * VERIFY LENGTH OF THE *MTOS* FILE IS PER EXPECTATIONS.
  359. #
  360.  
  361. IF FET$IN[0]-FET$OUT[0] NQ L$MTOS OR ##
  362. MSH$NUMRB[0] NQ NUMRB OR ##
  363. MSH$NUMSLV[0] NQ NUMSLV
  364. THEN # *MTOS* FILE IS WRONG LENGTH #
  365. BEGIN
  366. GOTO WAITMTOS;
  367. END
  368.  
  369. #
  370. * LOCATE INDEX OF THIS SLAVE IN THE *MTOS* FILE.
  371. #
  372.  
  373. SINDX = 0;
  374. FASTFOR I = 1 STEP 1 WHILE I LQ MAXSLV AND SINDX EQ 0
  375. DO
  376. BEGIN # SEARCH FOR THE INDEX OF THIS SLAVE #
  377. IF MSH$PFNS[I] EQ PFNSTOM
  378. THEN # FOUND MATCH #
  379. BEGIN
  380. SINDX = I;
  381. END
  382.  
  383. END # SEARCH FOR THE INDEX OF THIS SLAVE #
  384.  
  385. IF SINDX EQ 0
  386. THEN
  387. BEGIN
  388. GOTO WAITMTOS;
  389. END
  390.  
  391. MTOSOK = TRUE;
  392. P<MTOSREPBLK> = LOC(MTOSHEAD) + L$MTOSH + (SINDX-1)*NUMRB;
  393. SM$MSW[0] = MSH$MSW[0];
  394. IF MSH$IDLE[0]
  395. THEN # MASTER WAS IDLED DOWN #
  396. BEGIN
  397. SM$STATM[0] = S"IDLE";
  398. SM$TIMOUT[0] = MAXSECS;
  399. MSGE$STAT[0] = "IDLE";
  400. END
  401.  
  402. ELSE # MASTER IS ACTIVE #
  403. BEGIN
  404. SM$STATM[0] = S"ACTIVE";
  405. SM$TIMOUT[0] = RTIMSECS[0] + SLAV$INTV;
  406. MSGE$STAT[0] = "ACTIVE";
  407. END
  408.  
  409. MESSAGE(MSGEXSTAT,SYSUDF1);
  410. SM$REQCTL[0] = MSH$REQCTL[0] + 1; # FORCE A RESPONSE #
  411. TEST INITMTOS;
  412.  
  413. WAITMTOS:
  414.  
  415. MSGE$FLASH[0] = FLASH;
  416. MSGE$STAT[0] = "IDLE";
  417. IF ONEMSG
  418. THEN
  419. BEGIN # MESSAGE TO B-DISPLAY ONLY #
  420. MESSAGE(MSGEXSTAT,LINE1);
  421. END
  422.  
  423. ELSE
  424. BEGIN # FIRST MESSAGE TO DAYFILE AND B-DISPLAY #
  425. MESSAGE(MSGEXSTAT,SYSUDF1);
  426. ONEMSG = TRUE;
  427. END
  428.  
  429. MSGE$FLASH[0] = NOFLASH;
  430.  
  431. FASTFOR DUMMY = 1 STEP 1 UNTIL DELAYCT
  432. DO
  433. BEGIN
  434. RECALL(0);
  435. END
  436.  
  437. IF RA$IDLEDWN[0]
  438. THEN
  439. BEGIN
  440. SLVEND = S"IDLEMTOS";
  441. RETURN;
  442. END
  443.  
  444. END # INITIALIZE *MTOS* FILE #
  445.  
  446. RETURN;
  447.  
  448.  
  449. WAITSTOM:
  450. MSG$STAT[0] = "FILE PROBLEM.";
  451. MODERROR:
  452. MESSAGE(MSGSLV[0],SYSUDF1);
  453. ABORT;
  454.  
  455. END # INITSLV #
  456.  
  457. TERM
  458. PROC SLVEXEC;
  459. # TITLE SLVEXEC - SLAVE EXEC. #
  460.  
  461. BEGIN # SLVEXEC #
  462.  
  463. #
  464. *** SLVEXEC - MULTIMAINFRAME *MSS* EXECUTIVE PROGRAM.
  465. *
  466. * ON THE MASTER MAINFRAME OF A MULTIMAINFRAME CONFIGURATION, OR IN
  467. * A SINGLE MAINFRAME CONFIGURATION, THE *NOS* PERMANENT FILE
  468. * MANAGER (*PFM*) ISSUES *TDAM* REQUESTS DIRECTLY TO THE *SSEXEC*
  469. * TO CAUSE A PERMANENT FILE TO BE STAGED FROM *MSS* TO DISK. ON
  470. * ALL OTHER MAINFRAMES IN A MULTIMAINFRAME CONFIGURATION, *PFM*
  471. * ISSUES *TDAM* REQUESTS TO THIS *SSSLV* PROGRAM WHICH APPEARS AS
  472. * A SURROGATE *SSEXEC* TO *PFM*. THE *SSSLV* FORWARDS THE
  473. * *TDAM* REQUEST TO THE *SSEXEC* BY WRITING IT ON A PERMANENT
  474. * FILE KNOWN AS THE SLAVE-TO-MASTER (*STOM*) COMMUNICATION FILE.
  475. * WHEN THE *SSEXEC* HAS COMPLETED THE STAGE REQUEST, IT SENDS A
  476. * REPLY STATUS TO THE *SSSLV* VIA ANOTHER COMMUNICATION FILE
  477. * KNOWN AS THE MASTER-TO-SLAVE (*MTOS*) FILE. THE *SSSLV*
  478. * NOTIFIES *PFM* OF THE COMPLETED REQUEST IN THE SAME MANNER AS
  479. * DOES *SSEXEC*. THE FORMAT OF THE *MTOS* AND *STOM* FILES IS
  480. * DESCRIBED IN COMMON DECK *COMXMMF*.
  481. *
  482. * PROC SLVEXEC.
  483. *
  484. * MESSAGES
  485. * * SLVI - IDLED DOWN.*
  486. * AN INFORMATIVE MESSAGE INDICATING THAT THE
  487. * OPERATOR USED THE *IDLE* COMMAND TO TERMINATE
  488. * *SSSLV* PROCESSING.
  489. *
  490. * * SLVI - ERROR TERMINATION (N).*
  491. * AN INFORMATIVE MESSAGE INDICATING THAT AN
  492. * ERROR CONDITION OCCURRED WHILE READING THE
  493. * *MTOS* FILE WHICH PREVENTED FURTHER *SSSLV*
  494. * PROCESSING.
  495. #
  496.  
  497.  
  498. #
  499. **** PROC SLVEXEC - XREF LIST BEGIN.
  500. #
  501.  
  502. XREF
  503. BEGIN
  504. PROC ABORT; # ISSUE ABORT MACRO #
  505. PROC FLUSHSM; # REWRITE THE *STOM* FILE #
  506. PROC SSOVL; # OVERLAY LOADER #
  507. FUNC XCOD C(10); # INTEGER TO DISPLAY #
  508. PROC MESSAGE; # ISSUER MESSAGE MACRO #
  509. END
  510.  
  511. #
  512. **** PROC SLVEXEC - XREF LIST END.
  513. #
  514.  
  515. CONTROL PRESET;
  516.  
  517. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  518. *CALL,COMBFAS
  519. *CALL,COMBOVL
  520. *CALL,COMXIPR
  521. *CALL,COMXMMF
  522. *CALL,COMXSEB
  523. CONTROL EJECT;
  524. SLVEND = S"OK";
  525.  
  526. SSOVL(LSLVINIT,0); # INITIALIZE THE SLAVE EXEC #
  527. IF SLVEND EQ S"OK"
  528. THEN
  529. BEGIN
  530. SSOVL(LSLVLOOP,0); # EXECUTE THE MAIN LOOP #
  531. END
  532.  
  533. SM$IDLE[0] = TRUE;
  534.  
  535. FLUSHSM; # WRITE IDLE STATUS TO THE *STOM*
  536.   FILE #
  537.  
  538. IF SLVEND LS S"LASTIDLE"
  539. THEN # NORMAL TERMINATION #
  540. BEGIN
  541. MESSAGE(IDLETERM,RCL);
  542. STOP;
  543. END
  544.  
  545. ELSE # ABNORMAL TERMINATION #
  546. BEGIN
  547. CHAR10 = XCOD(SLVEND - SLVESTAT"LASTIDLE");
  548. ERR$NUM[0] = C<9,1>CHAR10;
  549. MESSAGE(ERRTERM,RCL);
  550. ABORT;
  551. END
  552.  
  553. END # SLVEXEC #
  554.  
  555. TERM
  556. PROC SLVINIT;
  557. # TITLE SLVINIT - *SSSLV* INITIALIZER SETUP ROUTINE. #
  558.  
  559. BEGIN # SLVINIT #
  560.  
  561. #
  562. ** SLVINIT - *SSSLV* INITIALIZER SETUP ROUTINE.
  563. *
  564. * *SLVINIT* DOES THE INITIALIZATION PROCESSING BY DIRECTLY
  565. * PERFORMING SOME SETUP AND THEN CALLING *INITSLV* TO
  566. * COMPLETE THE INITIALIZATION.
  567. *
  568. * PROC SLVINIT.
  569. *
  570. * ENTRY THE CONTROL COMMAND IMAGE OF THE *SSSLV* CALL IS IN
  571. * *RA* + 70. THE CONTROL COMMAND PARAMETERS ARE BELOW.
  572. *
  573. * SSSLV,Q=NN,S.
  574. *
  575. * Q=NN NN IS THE FREQUENCY IN SECONDS THAT THE *SSSLV*
  576. * AND *SSEXEC* PROGRAMS SHOULD READ THE *STOM*
  577. * AND *MTOS* COMMUNICATION FILES. IF *NN* IS
  578. * GREATER THEN *SLRP$INTV*, THE LATTER IS USED.
  579. *
  580. * S SIMULATED MULTIMAINFRAME MODE.
  581. * IF *S* IS SPECIFIED ON BOTH THE *SSEXEC* AND
  582. * *SSSLV* PROGRAM CALLS, THEN BOTH PROGRAMS MAY
  583. * EXECUTE ON THE SAME MAINFRAME. THIS PERMITS
  584. * PROGRAM AND OPERATIONAL PROCEDURE CHECKOUT USING
  585. * ONLY A SINGLE MAINFRAME.
  586. *
  587. * EXIT THE *MTOS* AND *STOM* FILES ARE ATTACHED AND READY TO
  588. * BE PROCESSED BY THE *SLVLOOP* PROCEDURE WHICH IS THE
  589. * MAINLOOP OF THE *SSSLV*.
  590. *
  591. * MESSAGES
  592. * * SLVI ABNORMAL, SLVINIT.*
  593. * THIS MESSAGE INDICATES THAT A FATAL SYSTEM
  594. * ERROR HAS OCCURRED.
  595. *
  596. * * MSAS MASTER ENABLED - ABORT. *
  597. *
  598. * NOTES IF THE *S* PARAMETER IS SPECIFIED, THE *SSSLV* WILL
  599. * USE COMMUNICATION FILES LOCATED ON THE DEFAULT FAMILY,
  600. * INSTEAD OF ON THE FAMILY CONTAINING THE LINK DEVICE.
  601. #
  602.  
  603.  
  604.  
  605. #
  606. **** PROC SLVINIT - XREF LIST BEGIN.
  607. #
  608.  
  609. XREF
  610. BEGIN
  611. PROC ABORT; # ISSUE ABORT MACRO #
  612. PROC CALLSS; # ISSUE REQUEST TO SUBSYSTEMS #
  613. PROC EXTAB; # SET UP PARAMETER LIST #
  614. PROC GETFAM; # GET TABLE OF FAMILIES #
  615. PROC GETMI; # GET MACHINE INDEX #
  616. PROC INITDAM; # INITIALIZE *TDAM* INTERFACE #
  617. PROC INITSLV; # INITIALIZE *SSSLV* #
  618. PROC MESSAGE; # ISSUE MESSAGE MACRO #
  619. PROC SETPFP; # ISSUE SETPFP MACRO #
  620. PROC XARG; # CRACK PARAMETER LIST #
  621. FUNC XDXB U; # CONVERT DECIMAL TO BINARY #
  622. END
  623.  
  624. #
  625. **** PROC SLVINIT - XREF LIST END.
  626. #
  627.  
  628. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  629. *CALL,COMBFAS
  630. *CALL,COMBPFP
  631. *CALL,COMXCTF
  632. *CALL,COMXEXP
  633. *CALL,COMXINT
  634. *CALL,COMXIPR
  635. *CALL,COMXJCA
  636. *CALL,COMXMMF
  637. *CALL,COMXSEB
  638.  
  639.  
  640. ITEM ARGLIST U; # ARGUMENT LIST #
  641. ITEM DELAYV U; # DELAY VALUE #
  642. ITEM FAMILY C(7); # FAMILY FOR COMMUNICATION FILES #
  643. ITEM FLAG U; # TEMPORARY #
  644. ITEM MID C(2); # MACHINE ID #
  645. ITEM MIDX U; # MACHINE INDEX #
  646. ITEM PBLOCK U = 0; # PARAMETER BLOCK #
  647.  
  648.  
  649. ARRAY MSGLINE [0:3] S(4);
  650. BEGIN
  651. ITEM MSGITEM C(00,00,38) = ["$MSAS MASTER ENABLED - ABORT."];
  652. ITEM MSGZERO U(03,48,12) = [0]; # ZERO BYTE TERMINATOR #
  653. END
  654. CONTROL EJECT;
  655.  
  656. GETFAM(FAMT,DUMMY,LINK[0],DEFAULTORD,DUMMY);
  657. DEF$FAM = FAM$NAME[DEFAULTORD];
  658.  
  659. EXTAB(ARGLIST);
  660. XARG(ARGLIST,0,FLAG);
  661. DELAYV = SLRP$INTV;
  662. GETMI(CMRINFO,EVENT);
  663. IF NOT CMR$SLAVE[0]
  664. THEN # *SLAVE* MODE NOT INDICATED #
  665. BEGIN
  666. MESSAGE(MSGLINE,SYSUDF1);
  667. ABORT;
  668. END
  669.  
  670. EESET$EVT = EESET$ASXE; # MSAS SET UP #
  671. EESET$ASXE = 0;
  672. FAMILY = FAM$NAME[LINK$ORD[0]];
  673. MIDX = CMR$MFID[0];
  674. MID = CMR$MID[0];
  675.  
  676. P<RA$AREA> = 0;
  677. RA$SSCAP[0] = 0;
  678. INITDAM; # INITIALIZE *TDAM* INTERFACE #
  679. CALLSS(0,PBLOCK,NRCL); # REQUEST ACTIVE STATUS #
  680.  
  681. IF FLAG EQ 0
  682. THEN
  683. BEGIN # CONVERT PARAMETERS #
  684.  
  685. IF ARG$QC[0] NQ - 1
  686. THEN # CONVERT Q = DELAY VALUE #
  687. BEGIN
  688. FLAG = XDXB(ARG$QC[0],1,DELAYV);
  689. IF DELAYV GR SLRP$INTV
  690. THEN # DELAY IS TOO LONG #
  691. BEGIN
  692. DELAYV = SLRP$INTV;
  693. END
  694.  
  695. END
  696.  
  697. IF ARG$SC[0] NQ - 1
  698. THEN
  699. BEGIN
  700. FAMILY = DEF$FAM;
  701. MIDX = 4;
  702. MID = "SA";
  703. END
  704.  
  705. END # CONVERT PARAMETERS #
  706.  
  707.  
  708. #
  709. * ISSUE A *SETPFP* SO THE COMMUNICATION FILES CAN BE ACCESSED.
  710. #
  711.  
  712. PFP$WRD0[0] = 0;
  713. PFP$FAM[0] = FAMILY;
  714. PFP$FG1[0] = TRUE; # CHANGE TO LINK FAMILY #
  715. PFP$FG4[0] = TRUE; # CHANGE TO *MSS* USER INDEX #
  716. PFP$UI[0] = DEF$UI;
  717. SETPFP(PFP);
  718. IF PFP$STAT[0] NQ 0
  719. THEN # SETPFP FAILED #
  720. BEGIN
  721. ABT$PROC[0] = "SLVINIT";
  722. MESSAGE(ABTMSG,SYSUDF1);
  723. ABORT;
  724. END
  725.  
  726.  
  727. #
  728. * CALL *INITSLV* TO INITIALIZE COMMUNICATION FILES.
  729. #
  730.  
  731. INITSLV(MID,MIDX,DELAYV);
  732.  
  733. END # SLVINIT #
  734.  
  735. TERM
  736. PROC SLVLOOP;
  737. # TITLE SLVLOOP - SLAVE MAIN LOOP. #
  738.  
  739. BEGIN # SLVLOOP #
  740.  
  741. #
  742. ** SLVLOOP - SLVEXEC MAIN LOOP.
  743. *
  744. * PROC SLVLOOP.
  745. *
  746. * ENTRY INITIALIZATION WAS SUCCESSFUL.
  747. *
  748. * EXIT THE ITEM *SLVEND* (IN *COMXSEB*) IS UPDATED TO
  749. * INDICATE THE REASON FOR TERMINATION OF *SSSLV*
  750. * PROCESSING.
  751. *
  752. * NOTES WHILE THE VARIABLE *SLVEND* HAS THE VALUE *OK*, THE
  753. * MAIN LOOP WILL DO THE FOLLOWING.
  754. *
  755. * 1) TEST THE IDLE FLAG.
  756. *
  757. * 2) LOOK FOR A *TDAM* REQUEST AND ADD IT TO
  758. * THE *STOM* FILE.
  759. *
  760. * 3) CALL *SLVMTOS* TO CHECK THE STATUS OF
  761. * THE *SSEXEC* AND ALSO, TO CHECK IF A
  762. * REPLY STATUS IS AVAILABLE FOR ANY
  763. * PREVIOUSLY SUBMITTED *TDAM* REQUESTS.
  764. *
  765. * 4) CALL *FLUSHSM* TO UPDATE THE SLAVE
  766. * STATUS WORD IN THE *STOM* FILE AND
  767. * REWRITE THE CURRENT *STOM* FILE.
  768. * THIS IS DONE PERIODICALLY OR
  769. * WHENEVER A *TDAM* REQUEST IS ADDED TO
  770. * THE *STOM* FILE BUFFER.
  771. *
  772. * 5) DELAY VIA *RECALL* IF NO WORK IS TO BE
  773. * DONE.
  774. #
  775.  
  776. #
  777. **** PROC SLVLOOP - XREF LIST BEGIN.
  778. #
  779.  
  780. XREF
  781. BEGIN
  782. PROC FLUSHSM; # REWRITE THE *STOM* FILE #
  783. PROC MEMORY; # ISSUE MEMORY MACRO #
  784. PROC PDATE; # ISSUE PDATE MACRO #
  785. PROC RECALL; # ISSUE RECALL MACRO #
  786. PROC RTIME; # ISSUE RTIME MACRO #
  787. PROC SLVMTOS; # PROCESS *MTOS* FILE #
  788. PROC ZFILL; # ZERO FILL AN ARRAY #
  789. PROC ZSETFET; # INITIALIZE *FET* #
  790. END
  791.  
  792. #
  793. **** PROC SLVLOOP - XREF LIST END.
  794. #
  795.  
  796. DEF RCLFACTOR #2#; # NUMBER OF RECALLS TO DELAY ONE
  797.   SECOND #
  798. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  799. *CALL,COMBFAS
  800. *CALL,COMBTDM
  801. *CALL,COMXCTF
  802. *CALL,COMXIPR
  803. *CALL,COMXJCA
  804. *CALL,COMXMMF
  805. *CALL,COMXSEB
  806.  
  807.  
  808.  
  809. ITEM I I; # LOOP COUNTER #
  810. ITEM MAINLOOP U; # MAIN LOOP INDUCTION VARIABLE #
  811. ITEM RB U; # INDEX TO A REQUEST BLOCK #
  812. ITEM RCLCT U; # NUMBER OF RECALLS TO MAKE #
  813. ITEM REQPROC B; # REQUEST PROCESSED FLAG #
  814. ITEM TDASA U; # ASA FROM A *TDAM* REQUEST #
  815. ITEM TDFAM C(7); # FAMILY FROM A *TDAM* REQUEST #
  816. ITEM TDUI U; # USER INDEX FROM *TDAM* REQUEST #
  817.  
  818. CONTROL EJECT;
  819.  
  820. #
  821. * REDUCE FIELD LENGTH SO ONLY ENOUGH *CM* SPACE FOR THE
  822. * *MTOS* BUFFER IS ABOVE THE END OF THIS OVERLAY.
  823. #
  824.  
  825. P<MTOSHEAD> = RA$NWA[0]; # = END OF THIS OVERLAY #
  826. MEM$AMT[0] = RA$NWA[0] + MTOSBUFL;
  827. MEMORY("CM",MEMREQ,RCL,NA);
  828. ZSETFET(LOC(MTOSS),MTOSSLFN,LOC(MTOSHEAD),MTOSBUFL,SFETL);
  829. SLVMTOS;
  830.  
  831. #
  832. * EXECUTE THE MAINLOOP UNTIL ONE OF THE *SSSLV*
  833. * TERMINATION CONDITIONS OCCURS.
  834. * 1). IDLE FLAG BECOMXS SET, OR
  835. * 2). AN I/O ERROR OCCURS ON EITHER THE *MTOS*
  836. * OR *STOM* FILES.
  837. #
  838.  
  839. SLOWFOR MAINLOOP = 1 STEP 1 WHILE SLVEND EQ S"OK"
  840. DO
  841. BEGIN # MAINLOOP #
  842.  
  843. RTIME(RTIMESTAT[0]);
  844. PDATE(PDATESTAT[0]);
  845.  
  846. IF RA$IDLEDWN[0]
  847. THEN
  848. BEGIN
  849. SLVEND = S"IDLE";
  850. END
  851.  
  852. IF RA$TDAM[0] NQ 0
  853. THEN # FOUND A *TDAM* REQUEST #
  854.  
  855. BEGIN # PROCESS THE *TDAM* REQUEST #
  856.  
  857. REQPROC = FALSE;
  858. P<TDAM> = LOC(RA$TDAM[0]);
  859. IF TDAMFC[0] EQ TDAMFCODE"STAGE"
  860. THEN
  861. BEGIN # CHECK STAGE REQUEST #
  862. TDASA = TDAMASA[0];
  863. TDUI = TDAMUI[0];
  864. TDFAM = TDAMFAM[0];
  865.  
  866. FASTFOR RB = 1 STEP 1 WHILE RB LQ NUMRB AND NOT REQPROC
  867. DO
  868.  
  869. BEGIN # SEARCH FOR A DUPLICATE *TDAM* #
  870.  
  871. P<TDAM> = LOC(SM$TDAM[RB]);
  872. IF TDASA EQ TDAMASA[0] ##
  873. AND TDUI EQ TDAMUI[0] ##
  874. AND TDFAM EQ TDAMFAM[0] ##
  875. AND SM$SRC[RB] EQ S"SUBMITTED"
  876. THEN # FOUND A DUPLICATE #
  877. BEGIN
  878. REQPROC = TRUE;
  879. END
  880.  
  881. END # SEARCH FOR A DUPLICATE *TDAM* #
  882.  
  883. END # CHECK STAGE REQUEST #
  884.  
  885. FASTFOR RB = 1 STEP 1 WHILE RB LQ NUMRB AND NOT REQPROC
  886. DO
  887. BEGIN # SEARCH FOR A FREE REQUEST BLOCK #
  888.  
  889. IF SM$SRC[RB] EQ S"AVAIL" AND ##
  890. MSR$MRC[RB] EQ S"AVAIL"
  891. THEN # AVAILABLE REQUEST BLOCK FOUND #
  892. BEGIN # ADD *TDAM* TO *STOM* BUFFER #
  893.  
  894. P<TDAM> = LOC(SM$TDAM[RB]);
  895. TDAMREQST[0] = RA$TDAMRB[0];
  896. SM$SRC[RB] = S"SUBMITTED";
  897. SM$PDATERB[RB] = PDATEV[0];
  898. STOM$TIME = 0; # FORCE WRITE OF *STOM* FILE #
  899. SM$REQCTL[0] = SM$REQCTL[0] + 1;
  900. REQPROC = TRUE;
  901. END # ADD *TDAM* TO *STOM* BUFFER #
  902.  
  903. END # SEARCH FOR A FREE REQUEST BLOCK #
  904.  
  905. IF REQPROC
  906. THEN # REQUEST PROCESSED #
  907. BEGIN
  908. P<TDAM> = LOC(RA$TDAM[0]);
  909. TDAMWORD[0] = 0; # CLEAR FIRST WORD OF *TDAM* #
  910. TEST MAINLOOP;
  911. END
  912.  
  913. #
  914. * IF NO SPACE IS AVAILABLE IN THE REQUEST BLOCKS,
  915. * GO THROUGH REST OF THE MAINLOOP AS IF THERE WERE
  916. * NO *TDAM* REQUEST.
  917. #
  918.  
  919. END # PROCESS THE *TDAM* REQUEST #
  920.  
  921. IF RTIMSECS[0] GR MTOS$TIME
  922. THEN # PROCESS *MTOS* FILE #
  923. BEGIN
  924. SLVMTOS;
  925. END
  926.  
  927. IF RTIMSECS[0] GR STOM$TIME
  928. THEN # WRITE THE *STOM* FILE #
  929. BEGIN
  930. FLUSHSM;
  931. TEST MAINLOOP;
  932. END
  933.  
  934. IF SM$STATM[0] EQ S"ACTIVE"
  935. THEN
  936. BEGIN
  937. RCLCT = SM$DELAY[0] * RCLFACTOR;
  938. END
  939.  
  940. ELSE
  941. BEGIN
  942. RCLCT = SLRP$INTV * RCLFACTOR;
  943. END
  944.  
  945. FASTFOR DUMMY = 1 STEP 1 UNTIL RCLCT
  946. DO
  947. BEGIN
  948. RECALL(0);
  949. END
  950.  
  951. END # MAINLOOP #
  952.  
  953. END # SLVLOOP #
  954.  
  955. TERM
  956. PROC SLVMTOS;
  957. # TITLE SLVMTOS - PROCESS *MTOS* COMMUNICATION FILE. #
  958.  
  959. BEGIN # SLVMTOS #
  960.  
  961. #
  962. ** SLVMTOS - PROCESS THE *MTOS* COMMUNICATION FILE.
  963. *
  964. * *SLVMTOS* WILL READ THE *MTOS* FILE TO A BUFFER, CHECK TO SEE IF
  965. * THE *SSEXEC* HAS CHANGED STATUS, AND IF SO, ISSUE A MESSAGE TO
  966. * THE DAYFILE AND CONSOLE. IF THE *SSEXEC* IS ACTIVE, EACH REPLY
  967. * BLOCK IS EXAMINED TO SEE IF A PREVIOUSLY SUBMITTED STAGE REQUEST
  968. * HAS BEEN COMPLETED.
  969. *
  970. * PROC SLVMTOS.
  971. *
  972. * ENTRY *MTOSS* (IN *COMXSEB*) CONTAINS THE *FET* FOR THE
  973. * *MTOS* COMMUNICATION FILE.
  974. *
  975. * EXIT THE VARIABLE *MTOS$TIME* (IN *COMXSEB*) IS UPDATED TO
  976. * INDICATE THE NEXT TIME THIS ROUTINE IS TO BE CALLED.
  977. * IF AN ERROR CONDITION WAS DETECTED WHILE READING
  978. * THE *MTOS* FILE, *SLVEND* IS SET TO *S"MTOSERR"*.
  979. *
  980. * MESSAGES
  981. * * SLVI ACTIVE, EXEC XXXX.*
  982. * AN INFORMATIVE MESSAGE INDICATING THAT A CHANGE
  983. * IN THE STATUS OF THE *SSEXEC* HAS BEEN NOTICED.
  984. * THE NEW STATUS *XXXX* CAN BE EITHER *ACTIVE*,
  985. * *IDLE*, OR *INACTIVE*.
  986. *
  987. #
  988.  
  989. #
  990. **** PROC SLVMTOS - XREF LIST BEGIN.
  991. #
  992.  
  993. XREF
  994. BEGIN
  995. PROC EESET; # ISSUE EESET (SET EVENT) MACRO #
  996. PROC MESSAGE; # ISSUES MESSAGE MACRO #
  997. PROC PDATE; # ISSUE PDATE MACRO #
  998. PROC READ; # READ FILE #
  999. PROC REWIND; # REWIND FILE #
  1000. PROC RTIME; # ISSUE RTIME MACRO #
  1001. END
  1002.  
  1003. #
  1004. **** PROC SLVMTOS - XREF LIST END.
  1005. #
  1006.  
  1007. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  1008. *CALL,COMBFAS
  1009. *CALL,COMBFET
  1010. *CALL,COMBTDM
  1011. *CALL,COMXIPR
  1012. *CALL,COMXMMF
  1013. *CALL,COMXSEB
  1014.  
  1015.  
  1016. ITEM I U; # INDUCTION VARIABLE #
  1017. ITEM RB U; # INDEX TO A REQUEST BLOCK #
  1018. CONTROL EJECT;
  1019.  
  1020. #
  1021. * READ THE *MTOS* FILE.
  1022. #
  1023.  
  1024. REWIND(MTOSS,RCL);
  1025. P<FETSET> = LOC(MTOSS);
  1026. FET$IN[0] = FET$FRST[0];
  1027. FET$OUT[0] = FET$FRST[0];
  1028. READ(MTOSS,RCL);
  1029. RTIME(RTIMESTAT[0]);
  1030. PDATE(PDATESTAT[0]);
  1031. MTOS$TIME = RTIMSECS[0] + SM$DELAY[0];
  1032.  
  1033. #
  1034. * CHECK THAT THE READ OF *MTOS* IS OK.
  1035. #
  1036.  
  1037. IF FET$AT[0] NQ OK # CIO ERROR #
  1038. OR FET$IN[0] - FET$OUT[0] NQ L$MTOS # WRONG LENGTH #
  1039. THEN
  1040. BEGIN
  1041. SLVEND = S"MTOSERR";
  1042. RETURN;
  1043. END
  1044.  
  1045. #
  1046. * LOCATE INDEX OF THIS SLAVE IN THE *MTOS* FILE.
  1047. #
  1048.  
  1049. SINDX = 0;
  1050. FASTFOR I = 1 STEP 1 WHILE I LQ MAXSLV AND SINDX EQ 0
  1051. DO
  1052. BEGIN
  1053. IF MSH$PFNS[I] EQ PFNSTOM
  1054. THEN # FOUND MATCH #
  1055. BEGIN
  1056. SINDX = I;
  1057. END
  1058.  
  1059. END
  1060.  
  1061. IF SINDX EQ 0
  1062. THEN
  1063. BEGIN
  1064. SLVEND = S"MTOSERR";
  1065. RETURN;
  1066. END
  1067.  
  1068. P<MTOSREPBLK> = LOC(MTOSHEAD) + L$MTOSH + (SINDX-1)*NUMRB;
  1069. CONTROL EJECT;
  1070.  
  1071. #
  1072. * CHECK FOR A CHANGE IN MASTER EXEC STATUS.
  1073. #
  1074.  
  1075. IF MSH$MWC[0] NQ SM$MWC[0]
  1076. THEN # MASTER IS ACTIVE #
  1077. BEGIN # RESET STATUS AND TIME OUT VALUES IN *STOM* #
  1078. IF SM$STATM[0] NQ S"ACTIVE"
  1079. THEN # MASTER RESUMED RUNNING #
  1080. BEGIN
  1081. MSGE$STAT[0] = "ACTIVE.";
  1082. MESSAGE(MSGEXSTAT[0],SYSUDF1);
  1083. END
  1084.  
  1085. SM$MSW[0] = MSH$MSW[0];
  1086. SM$STATM[0] = S"ACTIVE";
  1087. SM$TIMOUT[0] = RTIMSECS[0] + SLAV$INTV;
  1088. END # RESET STATUS AND TIME OUT VALUES IN *STOM* #
  1089.  
  1090. ELSE # MASTER DID NOT UPDATE ITS WRITE
  1091.   COUNTER #
  1092. BEGIN # CHECK FOR TIMEOUT #
  1093. IF SM$TIMOUT[0] LS RTIMSECS[0]
  1094. THEN # MASTER IDLE OR TIMED OUT #
  1095. BEGIN
  1096. IF MSH$IDLE[0]
  1097. THEN
  1098. BEGIN
  1099. MSGE$STAT[0] = "IDLE.";
  1100. END
  1101.  
  1102. ELSE
  1103. BEGIN
  1104. MSGE$STAT[0] = "INACTIVE.";
  1105. END
  1106.  
  1107. MESSAGE(MSGEXSTAT[0],SYSUDF1);
  1108. SM$TIMOUT[0] = MAXSECS;
  1109. SM$STATM[0] = S"DEAD";
  1110. END
  1111.  
  1112. RETURN;
  1113. END # CHECK FOR TIMEOUT #
  1114.  
  1115. CONTROL EJECT;
  1116.  
  1117. #
  1118. * PROCESS REQUEST BLOCKS WHICH HAVE BEEN
  1119. * FINISHED BY MASTER EXEC BY MAKING THEM AVAILABLE.
  1120. #
  1121.  
  1122. FASTFOR RB = 1 STEP 1 UNTIL NUMRB
  1123. DO
  1124. BEGIN # CHECK EACH REQUEST BLOCK #
  1125. IF SM$SRC[RB] NQ S"AVAIL" AND ##
  1126. MSR$MRC[RB] EQ S"FINISHED"
  1127. THEN
  1128. BEGIN # PROCESS FINISHED REQUEST #
  1129. SM$SRC[RB] = S"AVAIL";
  1130. SM$REQCTL[0] = SM$REQCTL[0] + 1;
  1131. SM$PDATE[RB] = PDATEV[0];
  1132. P<TDAM> = LOC(SM$TDAM[RB]);
  1133. IF MSR$REPLY[0] EQ S"OK" AND ##
  1134. TDAMEVENT[0] NQ 0
  1135. THEN # ISSUE THE EVENT #
  1136. BEGIN
  1137. EESET(TDAMEVENT[0]);
  1138. END
  1139.  
  1140. END # PROCESS FINISHED REQUESTS #
  1141.  
  1142. END # CHECK EACH REQUEST BLOCK #
  1143.  
  1144. END # SLVMTOS #
  1145.  
  1146. TERM
1)
MID),(MIDX),(SLVDELAY