User Tools

Site Tools


cdc:nos2.source:opl871:sxmain
1)
EXPIRTIME
2)
TDAMIN),(NEWOK),TDAMOUT)
  • [00113] ENTDAM - ENTER NEW *TDAM* REQUEST FOR PROCESSING.
  • [00118] ENTDAM - ENTER NEW *TDAM* REQUEST FOR PROCESSING.
  • [00139] ENTRY #
  • [00149] PROC ADD$LNK
  • [00150] PROC DEL$LNK
  • [00288] PROC FLUSHMS
  • [00290] FLUSHMS - FLUSH THE *MTOS* BUFFERS.
  • [00295] FLUSHMS - FLUSH THE *MTOS* BUFFERS.
  • [00328] PROC MESSAGE
  • [00329] PROC PDATE
  • [00330] PROC REWIND
  • [00331] PROC REWRITR
  • [00332] PROC RTIME
  • [00407] PROC MAINLP
  • [00409] MAINLP - MAIN LOOP OF *SSEXEC*.
  • [00414] MAINLP - MAIN LOOP OF *SSEXEC*.
  • [00434] PROC CKPFETC
  • [00435] PROC FLUSHMS
  • [00436] PROC GETACT
  • [00437] PROC KCG
  • [00438] PROC KPROC
  • [00439] PROC SSOVL
  • [00440] PROC RCLTEST
  • [00441] PROC RTIME
  • [00442] PROC RTRNBUF
  • [00443] PROC SCAN$LTCT
  • [00444] PROC SLAVERP
  • [00445] PROC TERMTST
  • [00446] PROC TRYTDAM
  • [00447] PROC WAKE$UP
  • [00732] PROC MNGMEM((MEMCHNG),RESP)
    • [00734] MNGMEM - MANAGE MEMORY.
    • [00739] MNGMEM - MANAGE MEMORY.
    • [00765] PROC MEMORY
    • [00841] PROC MSASDIR
    • [00843] MSASDIR - *SSEXEC* DIRECTOR.
    • [00848] MSASDIR - *SSEXEC* DIRECTOR.
    • [00885] PROC ABORT
    • [00886] PROC GETMI
    • [00887] PROC SSOVL
    • [00888] PROC MAINLP
    • [00889] PROC MESSAGE
    • [00890] PROC STARTUP
    • [00989] PROC NEWWORK
    • [00991] NEWWORK - ACQUIRES NEW WORK FOR *SSEXEC* TO PROCESS.
    • [00996] NEWWORK - ACQUIRES NEW WORK FOR *SSEXEC* TO PROCESS.
    • [01019] PROC CRELSLK
    • [01020] PROC DSNTDAM
    • [01021] PROC HLRQENQ
    • [01022] PROC SSOVL
    • [01023] PROC MOVERP
    • [01024] PROC SCAN$LTCT
    • [01025] PROC SLAVERP
    • [01026] PROC TDAM$RP
    • [01027] PROC UCP$RES
    • [01028] PROC UCP$RP
    • [01194] PROC RCLTEST
    • [01196] RCLTEST - TESTS RECALL CRITERIA FOR *SSEXEC*.
    • [01201] RCLTEST - TESTS RECALL CRITERIA FOR *SSEXEC*.
    • [01225] PROC DOZER
    • [01226] PROC GETACT
    • [01227] PROC RTIME
    • [01228] PROC SWAPPER
    • [01384] PROC RCLMLK
    • [01386] RCLMLK - RECLAIM INTERLOCKED CATALOGS AND MAPS.
    • [01391] RCLMLK - RECLAIM INTERLOCKED CATALOGS AND MAPS.
    • [01418] PROC ABORT
    • [01419] PROC CRCLMLK
    • [01420] PROC MESSAGE
    • [01421] PROC MRCLMLK
    • [01422] PROC RTIME
    • [01423] PROC SETPFP
    • [01502] PROC SCAN$LTCT
    • [01504] SCAN$LTCT - PROCESS SWAPPED OUT *UCP*-S.
    • [01509] SCAN$LTCT - PROCESS SWAPPED OUT *UCP*-S.
    • [01531] PROC RTIME
    • [01532] PROC SFCALL
    • [01533] PROC UCP$RES
    • [01590] PROC SLAVERP(CALLERCTL)
    • [01592] SLAVERP - SLAVE REQUEST PROCESSOR.
    • [01597] SLAVERP - SLAVE REQUEST PROCESSOR.
    • [01668] PROC MESSAGE
    • [01669] PROC PDATE
    • [01670] PROC READ
    • [01671] PROC REWIND
    • [01672] PROC RTIME
    • [01673] PROC SLVRBP
    • [01674] FUNC XCOD C(10)
    • [01675] PROC ZSETFET
    • [01852] PROC SLVRBP
    • [01854] SLVRBP - SLAVE REQUEST BLOCK PROCESSOR.
    • [01859] SLVRBP - SLAVE REQUEST BLOCK PROCESSOR.
    • [01884] PROC SLVTDAM
    • [01958] PROC SLVTDAM((RB),REJCNT)
      • [01960] SLVTDAM - SLAVE *TDAM* REQUEST PROCESSOR.
      • [01965] SLVTDAM - SLAVE *TDAM* REQUEST PROCESSOR.
      • [02010] PROC ENTDAM
      • [02012] PROC MSG
      • [02013] PROC SRCHDS
      • [02121] PROC STARTUP
      • [02123] STARTUP - HANDLES ALL *SSEXEC* INITIALIZATION.
      • [02127] STARTUP - HANDLES ALL *SSEXEC* INITIALIZATION.
      • [02148] PROC KPROC
      • [02149] PROC KREQ
      • [02150] PROC SSOVL
      • [02151] PROC LLRQENQ
      • [02152] PROC MSG
      • [02153] PROC RECALL
      • [02295] PROC SWAPPER((EXPIRTIME
      3)
      SSN),(STAT
      4)

      SXMAIN

      Table Of Contents

      • [00001] PROC DOZER1)
      • [00003] DOZER - PUT *SSEXEC* INTO RECALL.
      • [00008] DOZER - PUT *SSEXEC* INTO RECALL.
      • [00035] PROC KCG
      • [00036] PROC RECALL
      • [00037] PROC RTIME
      • [00038] PROC SLAVERP
      • [00111] PROC ENTDAM2)
      • [02297] SWAPPER - REDUCE FIELD LENGTH AND GO INTO RECALL.
      • [02302] SWAPPER - REDUCE FIELD LENGTH AND GO INTO RECALL.
      • [02332] PROC ABORT
      • [02333] PROC DOZER
      • [02334] PROC MESSAGE
      • [02335] PROC MSG
      • [02336] PROC MNGMEM
      • [02337] PROC SSOVL
      • [02338] PROC READ
      • [02339] PROC RECALL
      • [02340] PROC REWIND
      • [02341] PROC WRITEF
      • [02342] FUNC XCDD C(10)
      • [02343] PROC ZSETFET
      • [02500] PROC TELLSLV3)
      • [02502] TELLSLV - TELL *SSSLV* A STAGE REQUEST HAS COMPLETED.
      • [02507] TELLSLV - TELL *SSSLV* A STAGE REQUEST HAS COMPLETED.
      • [02587] PROC TERMTST
      • [02589] TERMTST - TESTS THE TERMINATION CRITERIA.
      • [02594] TERMTST - TESTS THE TERMINATION CRITERIA.
      • [02680] PROC TRYTDAM
      • [02682] TRYTDAM - SERVICES THE *TDAM* BUFFER.
      • [02687] TRYTDAM - SERVICES THE *TDAM* BUFFER.
      • [02709] PROC ENTDAM
      • [02764] PROC WAKE$UP
      • [02766] WAKE$UP - WAKE UP DELAYED PROCESSES.
      • [02771] WAKE$UP - WAKE UP DELAYED PROCESSES.
      • [02791] PROC ADD$LNK
      • [02792] PROC DEL$LNK
      • [02793] PROC RTIME
      </WRAP> === Source Code ===
      SXMAIN.txt
      1. PROC DOZER((EXPIRTIME));
      2.  
      3. # TITLE DOZER - PUT *SSEXEC* INTO RECALL. #
      4.  
      5. BEGIN # DOZER #
      6.  
      7. #
      8. ** DOZER - PUT *SSEXEC* INTO RECALL.
      9. *
      10. * *DOZER* ISSUES REPEATED *RECALL* REQUESTS UNTIL
      11. * THE EXPIRATION TIME HAS BEEN REACHED, OR UNTIL
      12. * ONE OF SEVERAL REACTIVATION CONDITIONS OCCURS.
      13. *
      14. * PROC DOZER((EXPIRTIME))
      15. *
      16. * ENTRY (EXPIRTIME) = DELAY EXPIRATION TIME.
      17. *
      18. * EXIT ONE OF THE FOLLOWING CONDITIONS IS MET -
      19. * 1. EXPIRATION TIME HAS BEEN REACHED.
      20. * 2. THE *TDAM* BUFFER IS NOT EMPTY.
      21. * 3. THE *UCP* BUFFER IS NOT EMPTY.
      22. * 4. THE *K* DISPLAY BUFFER IS NOT EMPTY.
      23. * 5. THE CPU DRIVER COMPLETE FLAG (*DRVRRECALL*) IS SET.
      24. * 6. THE *IDLE* BIT IS SET.
      25. * 7. THE STOM FILE IS NOT EMPTY.
      26. #
      27.  
      28.  
      29. #
      30. **** PROC DOZER - XREF LIST BEGIN.
      31. #
      32.  
      33. XREF
      34. BEGIN
      35. PROC KCG; # KEEP COPIES GOING #
      36. PROC RECALL; # SUSPEND PROCESSING #
      37. PROC RTIME; # GET TIME SINCE LAST DEADSTART #
      38. PROC SLAVERP; # CHECK SLAVE FILE #
      39. END
      40.  
      41. #
      42. **** PROC DOZER - XREF LIST END.
      43. #
      44.  
      45. ITEM EXPIRTIME U; # EXPIRATION TIME #
      46.  
      47. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      48. *CALL,COMBFAS
      49. *CALL,COMBCHN
      50. *CALL,COMBFET
      51. *CALL,COMBKDD
      52. *CALL,COMBUCR
      53. *CALL,COMBUDT
      54. *CALL,COMXCTF
      55. *CALL,COMXIPR
      56. *CALL,COMXJCA
      57. *CALL,COMXMMF
      58. *CALL,COMXMSC
      59.  
      60. ITEM I U; # INDUCTION VARIABLE #
      61. CONTROL EJECT;
      62.  
      63. #
      64. * ISSUE *RECALL* REQUESTS UNTIL EXPIRATION TIME, OR UNTIL
      65. * ANOTHER CRITERIA FOR RESUMPTION OF PROCESSING IS MET.
      66. #
      67.  
      68. FASTFOR I = 0 WHILE RTIMSECS[0] LS EXPIRTIME
      69. DO
      70. BEGIN # ISSUE *RECALL* REQUESTS #
      71.  
      72. RECALL(0);
      73.  
      74. IF CHN$BOC[LCHN"KC$GOING"] NQ 0
      75. THEN
      76. BEGIN
      77. KCG;
      78. END
      79.  
      80. IF (RA$TDAM[0] NQ 0 AND CHN$BOC[LCHN"RTD$FRSPC"] NQ 0) ##
      81. OR RA$SSCINLK[0] ##
      82. OR KB$CLEAR[0] NQ 0 ##
      83. OR DRVRRECALL ##
      84. OR CHN$BOC[LCHN"HL$PFMWAIT"] NQ 0 ##
      85. OR CHN$BOC[LCHN"HL$DELAY"] NQ 0 ##
      86. OR CHN$BOC[LCHN"LL$DELAY"] NQ 0 ##
      87. OR RA$IDLEDWN[0]
      88. THEN # RESUME *SSEXEC* ACTIVITY #
      89. BEGIN
      90. RETURN;
      91. END
      92.  
      93. RTIME(RTIMESTAT[0]);
      94.  
      95. #
      96. * PROCESS *SLAVE* REQUESTS.
      97. #
      98.  
      99. IF RTIMSECS[0] GQ STOM$EXPIR
      100.  
      101. THEN
      102. BEGIN
      103. SLAVERP(EXPIRTIME);
      104. END
      105.  
      106. END # ISSUE *RECALL* REQUESTS #
      107.  
      108. END # DOZER #
      109.  
      110. TERM
      111. PROC ENTDAM((TDAMIN),(NEWOK),TDAMOUT);
      112.  
      113. # TITLE ENTDAM - ENTER NEW *TDAM* REQUEST FOR PROCESSING. #
      114.  
      115. BEGIN # ENTDAM #
      116.  
      117. #
      118. ** ENTDAM - ENTER NEW *TDAM* REQUEST FOR PROCESSING.
      119. *
      120. * *ENTDAM* ENTERS A NEW *TDAM* REQUEST FOR PROCESSING AS FOLLOWS:
      121. * 1) FOR A STAGE REQUEST, IT SEARCHES THE *HLRQ* AND *RTRQ* CHAINS
      122. * TO SEE IF THIS REQUEST HAS ALREADY BEEN ENTERED.
      123. * 2) IF IT IS NOT A DUPLICATE OF A STAGE REQUEST, IF THE *NEWOK*
      124. * PARAMETER ALLOWS IT, AND IF SPACE EXISTS IN THE *RTRQ* FREE
      125. * SPACE CHAIN, THE *TDAM* ENTRY IS ADDED TO THE *RTRQ* CHAIN.
      126. *
      127. * ENTRY (TDAMIN) = LOCATION OF THE INCOMING *TDAM* REQUEST.
      128. * (NEWOK) = 0, IT IS OK TO CREATE A NEW *RTRQ* ENTRY.
      129. *
      130. * EXIT (TDAMOUT) = LOCATION OF THE NEW OR DUPLICATE
      131. * *TDAM* ENTRY. =0, IF NOT A DUPLICATE, AND
      132. * A NEW *RTRQ* ENTRY WAS NOT CREATED.
      133. *
      134. #
      135.  
      136. ITEM TDAMIN U; # LOCATION OF INCOMING *TDAM*
      137.   REQUEST #
      138. ITEM NEWOK U; # CONTROLS CREATION OF NEW *RTRQ*
      139.   ENTRY #
      140. ITEM TDAMOUT U; # LOCATION OF ACCEPTED *TDAM*
      141.   REQUEST #
      142.  
      143. #
      144. **** PROC ENTDAM - XREF LIST BEGIN.
      145. #
      146.  
      147. XREF
      148. BEGIN
      149. PROC ADD$LNK; # ADD ENTRY TO CHAIN #
      150. PROC DEL$LNK; # DELETE ENTRY FROM CHAIN #
      151. END
      152.  
      153. #
      154. **** PROC ENTDAM - XREF LIST END.
      155. #
      156.  
      157. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      158. *CALL,COMBFAS
      159. *CALL,COMBCHN
      160. *CALL,COMBTDM
      161. *CALL,COMXHLR
      162. *CALL,COMXJCA
      163. *CALL,COMXMSC
      164.  
      165.  
      166. ITEM ASAX U; # *ASA* VALUE FROM *TDAMIN* #
      167. ITEM EVENTID U; # EVENT ID #
      168. ITEM FAM C(7); # FAMILY FROM *TDAMIN* #
      169. ITEM I I; # LOOP INDEX #
      170. ITEM LINK U; # ADDRESS OF NEW CHAIN ENTRY #
      171. ITEM OFFSET U; # INCREMENT TO GET TO *TDAM* ENTRY
      172.   FROM THE LINK ADDRESS #
      173. ITEM SFX U; # SUBFAMILY INDEX FROM *TDAMIN* #
      174.  
      175. BASED
      176. ARRAY TDAMBUF [0:0] S(6);
      177. BEGIN
      178. ITEM TDAMBUF60 C(00,00,60); # *TDAM* REQUEST #
      179. END
      180.  
      181. CONTROL EJECT;
      182. P<TDAM> = TDAMIN;
      183. FAM = TDAMFAM[0];
      184. SFX = TDAMSBF[0];
      185.  
      186. P<ASA> = LOC(TDAMASA[0]);
      187. ASAX = TDAMASA[0];
      188.  
      189. EVENTID = TDAMEVENT[0];
      190.  
      191. #
      192. * SEARCH FOR DUPLICATE STAGE REQUEST IN *HLRQ* OR *RTRQ*.
      193. #
      194.  
      195. IF TDAMFC[0] EQ TDAMFCODE"STAGE"
      196. THEN
      197. BEGIN # SEARCH FOR DUPLICATE #
      198. LINK = CHN$BOC[LCHN"HL$ACTV"];
      199.  
      200. REPEAT WHILE LINK NQ 0
      201. DO
      202. BEGIN # SEARCH HLRQ CHAIN #
      203. P<HLRQ> = LINK;
      204. P<TDAM> = LOC(HLR$TDAM[0]);
      205. LINK = HLR$LNK2;
      206.  
      207. IF FAM EQ TDAMFAM[0] ##
      208. AND SFX EQ TDAMSBF[0] ##
      209. AND ASAX EQ TDAMASA[0]
      210. THEN # MATCH FOUND #
      211. BEGIN
      212. TDAMOUT = LOC(TDAM[0]);
      213.  
      214. IF TDAMEVENT[0] EQ 0
      215. THEN
      216. BEGIN
      217. TDAMEVENT[0] = EVENTID;
      218. END
      219.  
      220. RETURN;
      221. END # MATCH MADE #
      222.  
      223. END # SEARCH OF HLRQ CHAIN COMPLITE #
      224.  
      225. LINK = CHN$BOC[LCHN"RTD$ACT"];
      226.  
      227. REPEAT WHILE LINK NQ 0
      228. DO
      229. BEGIN # SEARCH CHAIN #
      230. P<TDAM> = LINK + 1;
      231. P<LINKWRD> = LINK;
      232. LINK = LINK$ADR[0];
      233.  
      234. IF FAM EQ TDAMFAM[0] ##
      235. AND SFX EQ TDAMSBF[0] ##
      236. AND ASAX EQ TDAMASA[0]
      237. THEN # MATCH FOUND #
      238. BEGIN
      239. TDAMOUT = LOC(TDAM[0]);
      240. IF TDAMEVENT[0] EQ 0
      241. THEN
      242. BEGIN
      243. TDAMEVENT[0] = EVENTID;
      244. END
      245.  
      246. RETURN;
      247. END
      248.  
      249. END # SEARCH CHAIN #
      250.  
      251. END # SEARCH FOR DUPLICATE #
      252.  
      253. #
      254. * IF OK, PLACE REQUEST IN A NEW *RTRQ* ENTRY.
      255. #
      256.  
      257. LINK = CHN$BOC[LCHN"RTD$FRSPC"];
      258.  
      259. IF (NEWOK EQ 0) ##
      260. AND (LINK NQ 0)
      261. THEN # ADD TO *RTRQ* #
      262. BEGIN
      263. TDAMOUT = LINK+1;
      264. P<TDAM> = LINK+1;
      265. DEL$LNK(LINK,LCHN"RTD$FRSPC",0);
      266. ADD$LNK(LINK,LCHN"RTD$ACT",0);
      267. P<TDAMBUF> = TDAMIN;
      268. TDAMREQST[0] = TDAMBUF60[0];
      269. IF (TDAMFC[0] EQ TDAMFCODE"STAGE" ##
      270. AND CHN$BOC[LCHN"HL$FRSPC"] NQ 0) ##
      271. OR (TDAMFC[0] NQ TDAMFCODE"STAGE")
      272. THEN
      273. BEGIN
      274. STG$MSK = 0;
      275. END
      276.  
      277. END
      278.  
      279. ELSE
      280. BEGIN
      281. TDAMOUT = 0;
      282. END
      283.  
      284. RETURN;
      285. END # ENTDAM #
      286.  
      287. TERM
      288. PROC FLUSHMS;
      289.  
      290. # TITLE FLUSHMS - FLUSH THE *MTOS* BUFFERS. #
      291.  
      292. BEGIN # FLUSHMS #
      293.  
      294. #
      295. ** FLUSHMS - FLUSH THE *MTOS* BUFFERS.
      296. *
      297. * *FLUSHMS* IS CALLED TO UPDATE THE MASTER-TO-SLAVE
      298. * (*MTOS*) COMMUNICATION FILE BY REWRITING THE *MTOS*
      299. * FILE BUFFER TO THE LINK DEVICE.
      300. *
      301. * PROC FLUSHMS.
      302. *
      303. * ENTRY THE *FET* AND BUFFER FOR THE *MTOS* FILE
      304. * ARE INITIALIZED.
      305. *
      306. * EXIT THE VARIABLE *MTOS$EXPIR* IS UPDATED TO
      307. * INDICATE THE NEXT TIME THIS PROCEDURE SHOULD
      308. * BE CALLED. IF THE *DRYUP* FLAG IS SET, OR
      309. * IF NO SLAVE MAINFRAMES REMAIN DEFINED, *MTOS$EXPIR*
      310. * IS SET TO A LARGE VALUE.
      311. *
      312. * MESSAGES
      313.   * EXEC SMF MODE - ALL SLAVES OMITTED.*
      314. * A MESSAGE INDICATING THAT THE *SSEXEC*
      315. * IS UNABLE TO COMMUNICATE WITH ANY *SSSLV*
      316. * PROGRAM AND IS NOW RUNNING IN SINGLE
      317. * MAINFRAME MODE.
      318. *
      319. #
      320.  
      321.  
      322. #
      323. **** PROC FLUSHMS - XREF LIST BEGIN.
      324. #
      325.  
      326. XREF
      327. BEGIN
      328. PROC MESSAGE; # ISSUE MESSAGE #
      329. PROC PDATE; # GET PACKED DATE AND TIME #
      330. PROC REWIND; # REWIND FILE #
      331. PROC REWRITR; # REWRITE FILE #
      332. PROC RTIME; # GET TIME SINCE DEADSTART #
      333. END
      334.  
      335. #
      336. **** PROC FLUSHMS - XREF LIST END.
      337. #
      338.  
      339. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      340. *CALL,COMBFAS
      341. *CALL,COMBFET
      342. *CALL,COMXCTF
      343. *CALL,COMXIPR
      344. *CALL,COMXMMF
      345.  
      346.  
      347. ARRAY MSGOMITALL [0:0] S(4); # SLAVE OMITTED MESSAGE #
      348. BEGIN
      349. ITEM MSGO$TEXT C(00,00,38) # MESSAGE TEXT #
      350. = [" EXEC SMF MODE - ALL SLAVES OMITTED."];
      351. ITEM MSGO$EOL U(03,48,12) = [0]; # END OF LINE #
      352. END
      353.  
      354.  
      355. CONTROL EJECT;
      356.  
      357. #
      358. * UPDATE THE HEADER INFORMATION OF THE *MTOS* FILE.
      359. #
      360.  
      361. MSH$MWC[0] = MSH$MWC[0] + 1;
      362. PDATE(PDATESTAT[0]);
      363. MSH$PDATE[0] = PDATEV[0];
      364.  
      365. #
      366. * SET UP THE TIME TO NEXT FLUSH THE *MTOS* BUFFERS.
      367. #
      368.  
      369. RTIME(RTIMESTAT[0]);
      370. IF SLVACTIVE
      371. THEN # USE SMALL DELAY #
      372. BEGIN
      373. MTOS$EXPIR = RTIMSECS[0] + SLRP$INTV;
      374. END
      375.  
      376. ELSE # USE LARGE DELAY #
      377. BEGIN
      378. MTOS$EXPIR = RTIMSECS[0] + SLAV$INTV;
      379. END
      380.  
      381. IF DRYUP OR SLAVECTR EQ 0
      382. THEN
      383. BEGIN
      384. MTOS$EXPIR = MAXSECS;
      385. MSH$IDLE[0] = TRUE;
      386. END
      387.  
      388. IF SLAVECTR EQ 0
      389. THEN
      390. BEGIN
      391. MESSAGE(MSGOMITALL,SYSUDF1);
      392. END
      393.  
      394. #
      395. * WRITE THE *MTOS* BUFFER TO THE *MTOS* FILE.
      396. #
      397.  
      398. REWIND(MTOSM,RCL);
      399. P<FETSET> = LOC(MTOSM);
      400. FET$OUT[0] = FET$FRST[0];
      401. FET$IN[0] = FET$FRST[0] + L$MTOS;
      402. REWRITR(MTOSM,RCL);
      403. RETURN;
      404. END # FLUSHMS #
      405.  
      406. TERM
      407. PROC MAINLP;
      408.  
      409. # TITLE MAINLP - MAIN LOOP OF *SSEXEC*. #
      410.  
      411. BEGIN # MAINLP #
      412.  
      413. #
      414. ** MAINLP - MAIN LOOP OF *SSEXEC*.
      415. *
      416. * *MAINLP* IS THE MAIN PROCESSING LOOP WHICH IS CALLED
      417. * BY *MSASDIR*.
      418. *
      419. * PROC MAINLP
      420. *
      421. * ENTRY INITIALIZATION HAS BEEN PERFORMED.
      422. *
      423. * EXIT PROCESSING HAS BEEN TERMINATED IN RESPONSE
      424. * TO THE *N.IDLE* COMMAND FROM THE CONSOLE
      425. * OR BY A FATAL ERROR CONDITION.
      426. #
      427.  
      428. #
      429. **** PROC MAINLP - XREF LIST BEGIN.
      430. #
      431.  
      432. XREF
      433. BEGIN
      434. PROC CKPFETC; # CHECK *UGET* COMPLETE #
      435. PROC FLUSHMS; # FLUSH M-TO-S FILE #
      436. PROC GETACT; # GET ACTIVITY COUNT #
      437. PROC KCG; # KEEP COPIES GOING #
      438. PROC KPROC; # *K* DISPLAY PROCESSOR #
      439. PROC SSOVL; # LOAD *MSAS* OVERLAYS #
      440. PROC RCLTEST; # PERFORM RECALL TEST #
      441. PROC RTIME; # GET TIME SINCE LAST DEADSTART #
      442. PROC RTRNBUF; # RETURN BUFFER SPACE #
      443. PROC SCAN$LTCT; # SCAN THE *LTCT* #
      444. PROC SLAVERP; # SLAVE REQUEST PROCESSOR #
      445. PROC TERMTST; # PERFORM TEMINATION TEST #
      446. PROC TRYTDAM; # SERVICE THE *TDAM* BUFFER #
      447. PROC WAKE$UP; # REACTIVATE DELAYED PROCESSES #
      448. END
      449.  
      450. #
      451. **** PROC MAINLP - XREF LIST END.
      452. #
      453.  
      454. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      455. *CALL,COMBFAS
      456. *CALL,COMBCHN
      457. *CALL,COMBCPR
      458. *CALL,COMBOVL
      459. *CALL,COMBTDM
      460. *CALL,COMXCTF
      461. *CALL,COMXJCA
      462. *CALL,COMXMFD
      463. *CALL,COMXMSC
      464.  
      465. ITEM STAT I; # STATUS RETURN VALUE #
      466.  
      467. CONTROL EJECT;
      468.  
      469. #
      470. * REPEAT MAIN LOOP UNTIL *TERMINATE* FLAG IS SET.
      471. #
      472.  
      473. TERMINATE = FALSE;
      474.  
      475. REPEAT WHILE NOT TERMINATE
      476. DO
      477. BEGIN # MAIN PROCESSING LOOP #
      478.  
      479. #
      480. * SET *DRYUP* FLAG IF *IDLEDOWN* IS SET.
      481. #
      482.  
      483. DRYUP = RA$IDLEDWN[0];
      484.  
      485. #
      486. * SERVICE THE *K* DISPLAY BUFFER.
      487. #
      488.  
      489. KPROC;
      490.  
      491. #
      492. * SERVICE THE *TDAM* BUFFER.
      493. #
      494.  
      495. IF RA$TDAM[0] NQ 0 ##
      496. AND CHN$BOC[LCHN"RTD$FRSPC"] NQ 0
      497. THEN
      498. BEGIN
      499. TRYTDAM;
      500. END
      501.  
      502. #
      503. * PERIODICALLY SCAN *LTCT* FOR SWAPPED *UCP*-S.
      504. #
      505.  
      506. RTIME(RTIMESTAT[0]);
      507. IF RTIMSECS[0] GQ UCP$EXPIR
      508. THEN
      509. BEGIN
      510. SCAN$LTCT;
      511. END
      512.  
      513.  
      514. IF GLPFMFL
      515. THEN
      516. BEGIN
      517. GOTO NEXTCHK;
      518. END
      519.  
      520. #
      521. * TEST FOR REASON TO LOAD NEW WORK OVERLAY.
      522. #
      523.  
      524. #
      525. * PERIODICALLY RECLAIM CATALOG AND SMA MAP INTERLOCKS.
      526. #
      527.  
      528. RTIME(RTIMESTAT[0]);
      529. IF GLBINTLK AND RTIMSECS[0] GQ ITLK$EXPIR
      530. THEN # RECLAIM CATALOG INTERLOCKS #
      531. BEGIN
      532. RCLMCAT = TRUE;
      533. END
      534.  
      535. IF MAPINTLK AND RTIMSECS[0] GQ MAP$EXPIR
      536. THEN # RECLAIM SMA MAP INTERLOCKS #
      537. BEGIN
      538. RCLMMAP = TRUE;
      539. END
      540.  
      541. IF RCLMCAT OR RCLMMAP
      542. THEN
      543. BEGIN
      544. SSOVL(LNEWWORK,0); # LOAD *NEWWORK* OVERLAY #
      545. GOTO NEXTCHK;
      546. END
      547.  
      548. #
      549. * CHECK FOR REQUEST IN *UCP* BUFFER WHICH CAN BE PROCESSED.
      550. * IF THE REQUEST IS TYPE 4 OR AN UPDATE-UDT TYPE 5, THERE
      551. * MUST BE AN AVAILABLE *LLRQ* ENTRY AND FULL INITIALIZATION
      552. * MUST NOT BE IN PROGRESS.
      553. #
      554.  
      555. IF RA$SSCINLK[0]
      556. THEN # *UCP* BUFFER CONTAINS REQUEST #
      557. BEGIN # CHECK *UCP* REQUEST #
      558. P<CPR> = RA$SSCAP[0] + 2;
      559.  
      560. IF ((CPR$RQT[0] EQ TYP"TYP4" ##
      561. OR (CPR$RQT[0] EQ TYP"TYP5" ##
      562. AND CPR$RQC[0] EQ REQTYP5"SSA$UUDT")) ##
      563. AND (CHN$BOC[LCHN"LL$FRSPC"] NQ 0 ##
      564. AND NOT INITIALIZE)) ##
      565. OR (CPR$RQT[0] NQ TYP"TYP4" ##
      566. AND NOT (CPR$RQT[0] EQ TYP"TYP5" ##
      567. AND CPR$RQC[0] EQ REQTYP5"SSA$UUDT"))
      568. THEN # REQUEST CAN BE PROCESSED #
      569. BEGIN
      570. SSOVL(LNEWWORK,0); # LOAD *NEWWORK* OVERLAY #
      571. GOTO NEXTCHK;
      572. END
      573.  
      574. END # CHECK *UCP* REQUEST #
      575.  
      576. #
      577. * CHECK IF DESTAGING IS TO BE INITIATED.
      578. #
      579.  
      580. IF (DSC$INIT NQ 0) ##
      581. AND (NOT INITIALIZE) ##
      582. AND (CHN$BOC[LCHN"HL$FRSPC"] NQ 0)
      583. THEN
      584. BEGIN
      585. SSOVL(LNEWWORK,0); # LOAD *NEWWORK* OVERLAY #
      586. GOTO NEXTCHK;
      587. END
      588.  
      589.  
      590. #
      591. * CHECK *RTRQ* FOR *TDAM* REQUEST WHICH CAN BE PROCESSED.
      592. #
      593.  
      594. IF CHN$BOC[LCHN"RTD$ACT"] NQ 0 ##
      595. AND (NOT INITIALIZE) ##
      596. AND (STG$MSK EQ 0)
      597. THEN # CAN PROCESS *TDAM* REQUESTS #
      598. BEGIN
      599. SSOVL(LNEWWORK,0); # LOAD *NEWWORK* OVERLAY #
      600. GOTO NEXTCHK;
      601. END
      602.  
      603. #
      604. * CHECK EXPIRATION TIME FOR PROCESSING *SLAVE* REQUESTS.
      605. #
      606.  
      607.  
      608. NEXTCHK:
      609. RTIME(RTIMESTAT[0]);
      610. IF RTIMSECS[0] GQ STOM$EXPIR ##
      611. AND GLBDSFL
      612. THEN # CAN ACCEPT SLAVE REQUESTS #
      613. BEGIN
      614. SLAVERP(0);
      615. END
      616.  
      617. #
      618. * PERIODICALLY FLUSH MASTER-TO-SLAVE FILE.
      619. #
      620.  
      621. IF RTIMSECS[0] GQ MTOS$EXPIR
      622. THEN
      623. BEGIN
      624. FLUSHMS;
      625. END
      626.  
      627. #
      628. * CHECK FOR PFM REQUEST COMPLETE BEFORE PROCESSING
      629. * MORE HLRQ REQUESTS.
      630. #
      631.  
      632.  
      633. IF GLPFMFL
      634. THEN
      635. BEGIN
      636. CKPFETC(NAME[0],PFMSTAT);
      637. GLPFMFL = PFMSTAT LS 0; # SET IF PFM REQUEST NOT COMPLETE #
      638. END # PFM REQUEST COMPLETE #
      639.  
      640.  
      641. #
      642. * SERVICE HIGH LEVEL PROCESSES.
      643. #
      644.  
      645. IF CHN$BOC[LCHN"HL$DELAY"] NQ 0
      646. THEN # *HLRQ* DELAY CHAIN POPULATED #
      647. BEGIN
      648. WAKE$UP; # REACTIVATE DELAYED PROCESSES #
      649. END
      650.  
      651. IF (NOT GLPFMFL) # PFM UGET/UREPLACE ACTIVE #
      652. AND (NOT INITIALIZE) #DELAY DURING FULL INITIALIZATION #
      653. AND ((CHN$BOC[LCHN"HL$READY"] NQ 0) ##
      654. OR (CHN$BOC[LCHN"HL$PFMWAIT"] NQ 0))
      655. THEN # ADVANCE HIGH LEVEL REQUESTS #
      656. BEGIN
      657. SSOVL(LHLRQMTR,0); # LOAD *HLRQMTR* OVERLAY #
      658. END
      659.  
      660. #
      661. * RETURN BUFFER SPACE IF POSSIBLE.
      662. #
      663.  
      664. IF GLBRTRNB
      665. THEN
      666. BEGIN # GLOBAL FLAG SET #
      667. GETACT(STAT);
      668. P<ACTSTAT> = LOC(STAT);
      669. IF ACT$STCNT[0] EQ 0
      670. THEN # NO CURRENT ACTIVITY #
      671. BEGIN
      672. RTRNBUF;
      673. END
      674.  
      675. END # GLOBAL FLAG SET #
      676.  
      677. #
      678. * SERVICE LOW LEVEL PROCESSES.
      679. #
      680.  
      681. IF CHN$BOC[LCHN"LL$DELAY"] NQ 0
      682. THEN # *LLRQ* DELAY CHAIN POPULATED #
      683. BEGIN
      684. WAKE$UP; # REACTIVATE DELAYED PROCESSES #
      685. END
      686.  
      687. RTIME(RTIMESTAT[0]);
      688. IF DRVRRECALL ##
      689. OR (CHN$BOC[LCHN"LL$READY"] NQ 0) ##
      690. THEN # LOW LEVEL REQUESTS TO ADVANCE #
      691. BEGIN
      692. SSOVL(LLLRQMTR,0); # LOAD *LLRQMTR* OVERLAY #
      693. END
      694.  
      695. #
      696. * KEEP COPY OPERATIONS GOING.
      697. #
      698.  
      699. IF CHN$BOC[LCHN"KC$GOING"] NQ 0
      700. THEN
      701. BEGIN
      702. KCG;
      703. END
      704.  
      705. #
      706. * DETERMINE IF *SSEXEC* CAN GO INTO RECALL.
      707. #
      708.  
      709. RCLTEST;
      710.  
      711. #
      712. * CHECK *DRYUP* FLAG.
      713. #
      714.  
      715. IF DRYUP
      716. THEN # DO TERMINATION TEST #
      717. BEGIN
      718. TERMTST;
      719. END
      720.  
      721. END # MAIN PROCESSING LOOP #
      722.  
      723. #
      724. * EXIT FROM MAIN LOOP.
      725. #
      726.  
      727. RETURN;
      728.  
      729. END # MAINLP #
      730.  
      731. TERM
      732. PROC MNGMEM((MEMCHNG),RESP);
      733.  
      734. # TITLE MNGMEM - MANAGE MEMORY. #
      735.  
      736. BEGIN # MNGMEM #
      737.  
      738. #
      739. ** MNGMEM - MANAGE MEMORY.
      740. *
      741. * *MNGMEM* PROCESSES REQUESTS FOR AN INCREASE OR DECREASE
      742. * IN USABLE MEMORY. BASED ON THE CURRENT UNUSED MEMORY AND
      743. * THE AMOUNT OF CHANGE REQUESTED, A *MEMORY* CALL IS MADE
      744. * AND FIELD LENGTH VALUES ARE UPDATED.
      745. *
      746. * MNGMEM((MEMCHNG),RESP).
      747. *
      748. * ENTRY (MEMCHNG) = CHANGE IN MEMORY REQUESTED.
      749. *
      750. * EXIT (RESP) - RESPONSE TO MEMORY REQUEST.
      751. * = 0, REQUEST DENIED.
      752. * = OTHER, * FWA* OF NEW MEMORY BLOCK IF AN
      753. * INCREASE IN MEMORY WAS REQUESTED.
      754. #
      755.  
      756. ITEM MEMCHNG I; # CHANGE IN MEMORY REQUESTED #
      757. ITEM RESP U; # RESPONSE TO MEMORY REQUEST #
      758.  
      759. #
      760. **** PROC MNGMEM - XREF LIST BEGIN.
      761. #
      762.  
      763. XREF
      764. BEGIN
      765. PROC MEMORY; # REQUEST MEMORY CHANGE #
      766. END
      767.  
      768. #
      769. **** PROC MNGMEM - XREF LIST END.
      770. #
      771.  
      772. DEF MEMAU #O"100"#; # MEMORY ALLOCATION UNIT #
      773.  
      774. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      775. *CALL,COMBFAS
      776. *CALL,COMXMSC
      777.  
      778. ITEM AMTMEM I; # AMOUNT OF MEMORY NEEDED #
      779. ITEM BLKMEM I; # MEMORY BLOCK SIZE #
      780.  
      781. ARRAY MEMSTAT [0:0] P(1); # MEMORY REQUEST #
      782. BEGIN
      783. ITEM MEMVAL U(00,00,30); # NEW FIELD LENGTH VALUE #
      784. END
      785.  
      786. CONTROL EJECT;
      787.  
      788. #
      789. * CALCULATE SIZE OF FIELD LENGTH TO REQUEST.
      790. #
      791.  
      792. IF (MEMCHNG GQ 0 ##
      793. AND MEMCHNG GR UNU$FL) ##
      794. OR ((UNU$FL - MEMCHNG) GQ MEMAU)
      795. THEN
      796. BEGIN # MEMORY REQUEST NEEDED #
      797. AMTMEM = MEMCHNG - UNU$FL;
      798. IF AMTMEM GQ 0
      799. THEN # IF *FL* TO BE INCREASED #
      800. BEGIN
      801. BLKMEM = (((AMTMEM - 1)/MEMAU) + 1) * MEMAU;
      802. END
      803.  
      804. ELSE # IF *FL* TO BE DECREASED #
      805. BEGIN
      806. BLKMEM = ((AMTMEM / MEMAU) * MEMAU);
      807. END
      808.  
      809. MEMVAL[0] = CUR$FL + BLKMEM;
      810.  
      811. #
      812. * REQUEST FIELD LENGTH CHANGE AND UPDATE RELEVANT VALUES.
      813. #
      814.  
      815. MEMORY("CM",MEMSTAT,RCL,NA);
      816. IF MEMVAL[0] NQ (CUR$FL + BLKMEM)
      817. THEN # IF MEMORY REQUEST DENIED #
      818. BEGIN
      819. RESP = 0;
      820. RETURN;
      821. END
      822.  
      823. CUR$FL = MEMVAL[0]; # UPDATE *FL* VALUES #
      824. NFLCHNG = NFLCHNG + 1;
      825. IF CUR$FL GR MAX$FL
      826. THEN # UPDATE MAXIMUM *FL* REACHED #
      827. BEGIN
      828. MAX$FL = CUR$FL;
      829. END
      830.  
      831. END # MEMORY REQUEST NEEDED #
      832.  
      833. RESP = NEXTADR; # RETURN *FWA* OF MEMORY AREA TO
      834.   CALLER #
      835. NEXTADR = NEXTADR + MEMCHNG;
      836. UNU$FL = CUR$FL - NEXTADR;
      837. RETURN;
      838. END # MNGMEM #
      839.  
      840. TERM
      841. PROC MSASDIR;
      842.  
      843. # TITLE MSASDIR - *SSEXEC* DIRECTOR. #
      844.  
      845. BEGIN # MSASDIR #
      846.  
      847. #
      848. ** MSASDIR - *SSEXEC* DIRECTOR.
      849. *
      850. * *MSASDIR* IS THE OVERALL DIRECTOR WHICH INITIATES
      851. * THE MAJOR PHASES OF *SSEXEC* ACTIVITY. IF THE
      852. * *MASTER/*SLAVE* FLAG IN *CMR* INDICATES *SLAVE*
      853. * MODE, A JOB ADVANCE OCCURS AND *SSSLV* IS LOADED.
      854. * *MSASDIR* CALLS *STARTUP* TO DO ALL INITIALIZATION,
      855. * AND THEN CALLS *MAINLP* FROM WHICH ALL MAJOR PROCESSING
      856. * ROUTINES ARE CALLED. WHEN TERMINATION CONDITIONS
      857. * OCCUR, CONTROL RETURNS TO *MSASDIR*, WHICH THEN CALLS
      858. * *WRAPUP* TO DO ALL NORMAL TERMINATION PROCESSING.
      859. *
      860. * PROC MSASDIR
      861. *
      862. * ENTRY CONTROL COMMAND PARAMETERS HAVE BEEN PLACED IN JOB
      863. * COMMUNICATION AREA AND CONTROL REGISTER R1 IS SET
      864. * TO 0 (INITIAL LOAD OF EXEC) OR *RESTART* (DEFINED
      865. * IN *COMXMSC*).
      866. *
      867. * EXIT TERMINATION IS DUE TO ONE OF THE FOLLOWING
      868. * 1. *MSAS* HAS BEEN TERMINATED NORMALLY VIA
      869. * AN *N.IDLE* CONSOLE COMMAND. R1 IS UNCHANGED.
      870. *
      871. * MESSAGES
      872. * * SSEXEC TERMINATING.*.
      873. * * SLAVE MODE - LOADING SSSLV.*.
      874. * * FATAL INITIALIZATION ERROR.*.
      875. * * OPERATOR IDLE OF EXEC.*.
      876. #
      877.  
      878.  
      879. #
      880. **** PROC MSASDIR - XREF LIST BEGIN.
      881. #
      882.  
      883. XREF
      884. BEGIN
      885. PROC ABORT; # CALLS *ABORT* MACRO #
      886. PROC GETMI; # GET MACHINE INFORMATION #
      887. PROC SSOVL; # LOAD *MSAS* OVERLAYS #
      888. PROC MAINLP; # MAIN PROCESSING LOOP #
      889. PROC MESSAGE; # ISSUE MESSAGE #
      890. PROC STARTUP; # *SSEXEC* INITIALIZER #
      891. END
      892.  
      893. #
      894. **** PROC MSASDIR - XREF LIST END.
      895. #
      896.  
      897. STATUS MSGTYPE # TYPE OF MESSAGE TO ISSUE #
      898. HEADER, # MESSAGE HEADER #
      899. SLAVE, # SLAVE MODE #
      900. FATAL, # FATAL ERROR #
      901. IDLE; # EXEC IDLED #
      902.  
      903. CONTROL PRESET;
      904. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      905. *CALL,COMBFAS
      906. *CALL,COMBCMD
      907. *CALL,COMBKDA
      908. *CALL,COMBMCT
      909. *CALL,COMBOVL
      910. *CALL,COMBTDM
      911. *CALL,COMBUCR
      912. *CALL,COMBUDT
      913. *CALL,COMXCTF
      914. *CALL,COMXIPR
      915. *CALL,COMXMFD
      916. *CALL,COMXMMF
      917. *CALL,COMXMSC
      918.  
      919. ITEM TERMTYPE S:MSGTYPE; # TERMINATION TYPE #
      920.  
      921. ARRAY MSGLINE [0:3] S(4); # CONTAINS DAYFILE MESSAGES #
      922. BEGIN
      923. ITEM MSGITEM C(00,00,38)=[ # CHARACTER STRINGS #
      924. "$SSEXEC TERMINATING.",
      925. "$MSAS MASTER DISABLED - ABORT.",
      926. "$FATAL INITIALIZATION ERROR.",
      927. "$OPERATOR IDLE OF EXEC."];
      928. ITEM MSGZERO U(03,48,12)=[0]; # ZERO BYTE TERMINATOR #
      929. END
      930.  
      931. CONTROL EJECT;
      932.  
      933. #
      934. * CHECK FOR *MASTER* OR *SLAVE* MAINFRAME STATUS.
      935. #
      936.  
      937. GETMI(CMRINFO[0],EVENT);
      938. IF CMR$SLAVE[0]
      939. THEN # *SLAVE* MODE INDICATED #
      940. BEGIN
      941. FATALERR = TRUE;
      942. TERMTYPE = S"SLAVE";
      943. GOTO ENDJOB; # CAUSE JOB ADVANCE #
      944. END
      945.  
      946. #
      947. * PERFORM *SSEXEC* INITIALIZATION.
      948. #
      949.  
      950. STARTUP;
      951.  
      952. IF FATALERR
      953. THEN # FATAL ERROR IN INITIALIZATION #
      954. BEGIN
      955. TERMTYPE = S"FATAL";
      956. GOTO ENDJOB;
      957. END
      958.  
      959. #
      960. * ENTER MAIN PROCESSING LOOP.
      961. #
      962.  
      963. MAINLP;
      964.  
      965. #
      966. * PERFORM TERMINATION PROCESSING.
      967. #
      968.  
      969. SSOVL(LWRAPUP,0);
      970. TERMTYPE = S"IDLE";
      971.  
      972. #
      973. * ISSUE TERMINATION MESSAGES AND ADVANCE TO NEXT JOB STEP.
      974. #
      975.  
      976. ENDJOB:
      977. MESSAGE(MSGLINE[MSGTYPE"HEADER"],SYSUDF1);
      978. MESSAGE(MSGLINE[TERMTYPE],SYSUDF1);
      979. IF FATALERR
      980. THEN
      981. BEGIN
      982. ABORT;
      983. END
      984.  
      985. RETURN;
      986. END # MSASDIR #
      987.  
      988. TERM
      989. PROC NEWWORK;
      990.  
      991. # TITLE NEWWORK - ACQUIRES NEW WORK FOR *SSEXEC* TO PROCESS. #
      992.  
      993. BEGIN # NEWWORK #
      994.  
      995. #
      996. ** NEWWORK - ACQUIRES NEW WORK FOR *SSEXEC* TO PROCESS.
      997. *
      998. * *NEWWORK* DETERMINES IF ANY NEW WORK EXISTS WHICH
      999. * CAN BE ACCEPTED AT THIS TIME. FOR ANY ACCEPTABLE
      1000. * NEW WORK, THE APPROPRIATE REQUEST PROCESSOR IS CALLED
      1001. * (*UCP*, *TDAM*, *SLAVE*, *SCAN$LTCT*, AND/OR *SSMOVE*
      1002. * REQUEST PROCESSOR). IF EITHER *RCLMCAT* OR *RCLMMAP*
      1003. * (DEFINED IN *ECTFCOM*) IS TRUE, THEN THE *RCLMLK* OVERLAY
      1004. * IS LOADED TO RECLAIM CATALOG OR MAP INTERLOCKS.
      1005. *
      1006. * PROC NEWWORK
      1007. *
      1008. * ENTRY TEST FOR NEW WORK IN *MAINLP* IS SUCCESSFUL.
      1009. *
      1010. * EXIT NEW REQUESTS PROCESSED AS FAR AS POSSIBLE.
      1011. #
      1012.  
      1013. #
      1014. **** PROC NEWWORK - XREF LIST BEGIN.
      1015. #
      1016.  
      1017. XREF
      1018. BEGIN
      1019. PROC CRELSLK; # RELEASE CATALOG INTERLOCKS #
      1020. PROC DSNTDAM; # GET NEXT DESTAGE REQUEST #
      1021. PROC HLRQENQ; # BUILD *HLRQ* ENTRY #
      1022. PROC SSOVL; # LOAD *MSAS* OVERLAYS #
      1023. PROC MOVERP; # *SSMOVE* REQUEST PROCESSOR #
      1024. PROC SCAN$LTCT; # SCAN LONG TERM CONNECT TABLE #
      1025. PROC SLAVERP; # *SSSLV* REQUEST PROCESSOR #
      1026. PROC TDAM$RP; # *TDAM* REQUEST PROCESSOR #
      1027. PROC UCP$RES; # REPLY TO A *UCP* #
      1028. PROC UCP$RP; # *UCP* REQUEST PROCESSOR #
      1029. END
      1030.  
      1031. #
      1032. **** PROC NEWWORK - XREF LIST END.
      1033. #
      1034.  
      1035. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      1036. *CALL,COMBFAS
      1037. *CALL,COMBCHN
      1038. *CALL,COMBCPR
      1039. *CALL,COMBOVL
      1040. *CALL,COMBTDM
      1041. *CALL COMBUDT
      1042. *CALL COMBUCR
      1043. *CALL,COMXCTF
      1044. *CALL,COMXHLR
      1045. *CALL,COMXJCA
      1046. *CALL,COMXLTC
      1047. *CALL,COMXMFD
      1048. *CALL,COMXMSC
      1049.  
      1050.  
      1051.  
      1052. ITEM ACTIVEHLRQ I; # *HLRQ* COUNT #
      1053. ITEM HLRQADR U; # *HLRQ* ENTRY ADDRESS #
      1054. ITEM I I; # INDEX COUNTER #
      1055. ITEM LINK I; # LINK TO NEXT *HLRQ* #
      1056. ITEM STAT U; # STATUS #
      1057. CONTROL EJECT;
      1058.  
      1059. #
      1060. * PROCESS *UCP* REQUESTS. ALL TYPE 4 REQUESTS AND ALL UPDATE-UDT
      1061. * TYPE 5 REQUESTS REQUIRE AN AVAILABLE *LLRQ* ENTRY.
      1062. #
      1063.  
      1064. IF RA$SSCINLK[0]
      1065. THEN # *UCP* BUFFER CONTAINS REQUEST #
      1066. BEGIN # CHECK *UCP* REQUEST #
      1067. P<CPR> = RA$SSCAP[0] + 2;
      1068.  
      1069. IF ((CPR$RQT[0] EQ TYP"TYP4") ##
      1070. OR ((CPR$RQT[0] EQ TYP"TYP5") ##
      1071. AND (CPR$RQC[0] EQ REQTYP5"SSA$UUDT")) ##
      1072. AND (CHN$BOC[LCHN"LL$FRSPC"] NQ 0)) ##
      1073. OR ((CPR$RQT[0] NQ TYP"TYP4") ##
      1074. AND ((CPR$RQT[0] NQ TYP"TYP5") ##
      1075. OR (CPR$RQC[0] NQ REQTYP5"SSA$UUDT")))
      1076. THEN # REQUEST CAN BE PROCESSED #
      1077. BEGIN
      1078. UCP$RP;
      1079. END
      1080.  
      1081. END # CHECK *UCP* REQUEST #
      1082.  
      1083. #
      1084. * PROCESS ONLY UCP REQUESTS IF IN FULL INITIALIZATION.
      1085. #
      1086.  
      1087. IF INITIALIZE
      1088. THEN # STOP REQUEST PROCESSING #
      1089. BEGIN # EXIT #
      1090. RETURN;
      1091. END # EXIT #
      1092.  
      1093. #
      1094. * RECLAIM CATALOG OR MAP INTERLOCKS IF NECESSARY.
      1095. #
      1096.  
      1097. IF RCLMCAT OR RCLMMAP
      1098. THEN # INTERLOCKS TO BE RECLAIMED #
      1099. BEGIN
      1100. SSOVL(LRCLMLK,0);
      1101. END
      1102.  
      1103. #
      1104. * PROCESS *TDAM* REQUESTS.
      1105. #
      1106.  
      1107. IF CHN$BOC[LCHN"RTD$ACT"] NQ 0 ##
      1108. AND (STG$MSK EQ 0)
      1109. THEN # REQUEST CAN BE PROCESSED #
      1110. BEGIN
      1111. TDAM$RP;
      1112. END
      1113.  
      1114. #
      1115. * CHECK IF DESTAGING IS TO BE INITIATED.
      1116. #
      1117.  
      1118. IF DSC$INIT EQ 0
      1119. THEN
      1120. BEGIN
      1121. RETURN;
      1122. END
      1123.  
      1124. ACTIVEHLRQ = 0;
      1125. LINK = CHN$BOC[LCHN"HL$ACTV"];
      1126.  
      1127. REPEAT WHILE LINK NQ 0
      1128. DO
      1129. BEGIN # SEARCH *HLRQ* CHAIN #
      1130. P<HLRQ> = LINK;
      1131. LINK = HLR$LNK2;
      1132. ACTIVEHLRQ = ACTIVEHLRQ + 1;
      1133. END # COUNT THE ACTIVE NUMBER OF *HLRQ-S* #
      1134.  
      1135. IF ACTIVEHLRQ NQ 0
      1136. THEN
      1137. BEGIN # LET ONE OVER BUFFER COUNT START #
      1138. ACTIVEHLRQ = ACTIVEHLRQ - 1;
      1139. END
      1140.  
      1141. IF ACTIVEHLRQ EQ MAX$ACHN
      1142. THEN
      1143. BEGIN
      1144. DSC$INIT = 0;
      1145. DSC$WRESRS = 1;
      1146. END
      1147.  
      1148. IF (DSC$INIT NQ 0) ##
      1149. AND (CHN$BOC[LCHN"HL$FRSPC"] NQ 0) ##
      1150. THEN
      1151. BEGIN
      1152.  
      1153. IF DSC$LKMSK NQ 0
      1154. THEN
      1155. BEGIN
      1156. CRELSLK(DSC$FAM,DSC$LKMSK,0,STAT);
      1157. DSC$LKMSK = 0;
      1158. END
      1159.  
      1160. HLRQENQ(HLRQADR);
      1161. P<HLRQ> = HLRQADR;
      1162. HLR$HPN[0] = HLRPN"DESTAGE";
      1163. HLR$RESP[0] = ERRST"NXTSUBF";
      1164.  
      1165. DSNTDAM(HLRQADR);
      1166.  
      1167. P<TDAM> = LOC(HLR$TDAM[0]);
      1168. IF TDAMFC[0] EQ TDAMFCODE"NOREQ"
      1169. THEN # DONE WITH DESTAGING #
      1170. BEGIN
      1171. LTCENTRY = DSC$LTCT;
      1172. IF DSC$LTCT NQ 0 AND LTC$RQI[LTCENTRY] EQ REQNAME"RQIMOVE"
      1173. THEN # REPLY TO *SSMOVE* #
      1174. BEGIN
      1175. LTC$RQR[LTCENTRY] = RESPTYP2"OK2";
      1176. UCP$RES; # NOTIFY *SSMOVE* #
      1177. DSC$LTCT = 0;
      1178. END
      1179.  
      1180. STG$MSK = 0;
      1181. DSC$FAM = 0;
      1182. DSC$INIT = 0;
      1183. DSC$WRESRS = 0;
      1184. HLR$HPS[0] = PROCST"COMPLETE";
      1185. END
      1186.  
      1187. END
      1188.  
      1189.  
      1190. RETURN;
      1191. END # NEWWORK #
      1192.  
      1193. TERM
      1194. PROC RCLTEST;
      1195.  
      1196. # TITLE RCLTEST - TESTS RECALL CRITERIA FOR *SSEXEC*. #
      1197.  
      1198. BEGIN # RCLTEST #
      1199.  
      1200. #
      1201. ** RCLTEST - TESTS RECALL CRITERIA FOR *SSEXEC*.
      1202. *
      1203. * *RCLTEST* CHECKS WHETHER THE CRITERIA FOR
      1204. * PUTTING *SSEXEC* INTO RECALL ARE MET. IF THE
      1205. * EARLIEST EXPIRATION TIME EXCEEDS A DEFINED
      1206. * THRESHOLD (*SWAPTHRESH*), *SSEXEC* ALSO REDUCES
      1207. * ITS FIELD LENGTH BEFORE GOING INTO RECALL.
      1208. *
      1209. * PROC RCLTEST
      1210. *
      1211. * ENTRY CALLED UNCONDITIONALLY BY *MAINLP* EACH
      1212. * TIME THROUGH THE LOOP.
      1213. *
      1214. * EXIT CRITERIA FOR RECALL ARE NOT MET, EXPIRATION
      1215. * TIME HAS BEEN REACHED, OR A CONDITION FOR
      1216. * RESUMING ACTIVITY HAS BEEN SATISFIED.
      1217. #
      1218.  
      1219. #
      1220. **** PROC RCLTEST - XREF LIST BEGIN.
      1221. #
      1222.  
      1223. XREF
      1224. BEGIN
      1225. PROC DOZER; # PUT *SSEXEC* INTO RECALL #
      1226. PROC GETACT; # GET ACTIVITY COUNT #
      1227. PROC RTIME; # GET TIME SINCE LAST DEADSTART #
      1228. PROC SWAPPER; # REDUCE FIELD LENGTH OF *SSEXEC*
      1229.   #
      1230. END
      1231.  
      1232. #
      1233. **** PROC RCLTEST - XREF LIST END.
      1234. #
      1235.  
      1236.  
      1237. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      1238. *CALL,COMBFAS
      1239. *CALL,COMBCHN
      1240. *CALL,COMBKDA
      1241. *CALL,COMBKDD
      1242. *CALL,COMBTDM
      1243. *CALL,COMBUDT
      1244. *CALL,COMXCTF
      1245. *CALL,COMXIPR
      1246. *CALL,COMXJCA
      1247. *CALL,COMXMFD
      1248. *CALL,COMXMSC
      1249.  
      1250. ITEM I U; # COUNTER #
      1251. ITEM J U; # COUNTER #
      1252. ITEM EXPIRTIME U; # EXPIRATION TIME #
      1253. ITEM PPUSTAT U; # STATUS FROM *GETACT* #
      1254.  
      1255. CONTROL EJECT;
      1256.  
      1257. #
      1258. * RETURN IF THERE IS WORK TO BE DONE.
      1259. #
      1260.  
      1261. IF (RA$TDAM[0] NQ 0 AND CHN$BOC[LCHN"RTD$FRSPC"] NQ 0) ##
      1262. OR RA$SSCINLK ##
      1263. OR KB$CLEAR[0] NQ 0 ##
      1264. OR DRVRRECALL
      1265. THEN
      1266. BEGIN
      1267. RETURN;
      1268. END
      1269.  
      1270. IF (CHN$BOC[LCHN"RTD$ACT"] NQ 0 AND STG$MSK EQ 0 ##
      1271. AND NOT INITIALIZE) ##
      1272. OR (DSC$INIT NQ 0 AND CHN$BOC[LCHN"HL$FRSPC"] NQ 0 ##
      1273. AND NOT INITIALIZE) ##
      1274. OR CHN$BOC[LCHN"HL$READY"] NQ 0 ##
      1275. OR CHN$BOC[LCHN"LL$READY"] NQ 0
      1276. THEN # ACTIVE CHAINS NOT ALL EMPTY #
      1277. BEGIN
      1278. RETURN;
      1279. END
      1280.  
      1281. #
      1282. * CALCULATE RECALL EXPIRATION AS THE MINIMUM OF VARIOUS
      1283. * OTHER EXPIRATION TIMES.
      1284. #
      1285.  
      1286. EXPIRTIME = MAXTIME;
      1287. IF MINQ$EXPIR GR 0
      1288. THEN
      1289. BEGIN
      1290. EXPIRTIME = MINQ$EXPIR;
      1291. END
      1292.  
      1293. IF ITLK$EXPIR GR 0 ##
      1294. AND ITLK$EXPIR LS EXPIRTIME
      1295. THEN
      1296. BEGIN
      1297. EXPIRTIME = ITLK$EXPIR;
      1298. END
      1299.  
      1300. IF MAP$EXPIR GR 0 AND MAP$EXPIR LS EXPIRTIME
      1301. THEN
      1302. BEGIN
      1303. EXPIRTIME = MAP$EXPIR;
      1304. END
      1305.  
      1306. IF UCP$EXPIR GR 0 ##
      1307. AND UCP$EXPIR LS EXPIRTIME
      1308. THEN
      1309. BEGIN
      1310. EXPIRTIME = UCP$EXPIR;
      1311. END
      1312.  
      1313. IF KDIS$EXPIR GR 0 ##
      1314. AND KDIS$EXPIR LS EXPIRTIME
      1315. THEN
      1316. BEGIN
      1317. EXPIRTIME = KDIS$EXPIR;
      1318. END
      1319.  
      1320. IF KSM$EXPIR GR 0 ##
      1321. AND KSM$EXPIR LS EXPIRTIME
      1322. THEN # SM DISPLAY UP #
      1323. BEGIN # PRESERVE #
      1324. EXPIRTIME = KSM$EXPIR;
      1325. END # PRESERVE #
      1326.  
      1327. #
      1328. * PUT *SSEXEC* INTO RECALL. IF THE EXPIRATION TIME EXCEEDS A
      1329. * THRESHOLD, NO PP IS ACTIVE, THE * REQUEST K-DISPLAY* MESSAGE
      1330. * IS NOT ON THE *B-DISPLAY* AND NO CONNECTED *UCP*-S ARE SWAPPED
      1331. * OUT, REDUCE FIELD LENGTH FIRST.
      1332. #
      1333.  
      1334. RTIME(RTIMESTAT[0]);
      1335.  
      1336. IF (EXPIRTIME - RTIMSECS[0] GR SWAPTHRESH) ##
      1337. AND (NOT DRVRRECALL) ##
      1338. AND KREQCLEAR ##
      1339. AND (NOT GLBUCPSW) ##
      1340. AND CHN$BOC[LCHN"HL$ACTV"] EQ 0
      1341.  
      1342. THEN
      1343. BEGIN
      1344. IF (DSC$INIT EQ 0)
      1345. AND (DSC$WRESRS EQ 1)
      1346. THEN
      1347. BEGIN
      1348. DSC$INIT = 1;
      1349. DSC$WRESRS = 0;
      1350. SLOWFOR I = 1STEP 1 UNTIL MAXSMUNIT
      1351. DO
      1352. BEGIN
      1353. SM$DSRFW[I] = 0;
      1354. END
      1355. SLOWFOR J = 0 STEP 1 UNTIL MAXSF
      1356. DO
      1357. BEGIN
      1358. SCR$WTDRD[J] = FALSE;
      1359. END
      1360. END
      1361. GETACT(PPUSTAT); # CHECK FOR ACTIVE PPU #
      1362. P<ACTSTAT> = LOC(PPUSTAT);
      1363. IF (ACT$STCNT[0] EQ 0)
      1364. AND (DSC$INIT EQ 0)
      1365. THEN # NO ACTIVE PPU #
      1366. BEGIN
      1367. SWAPPER(EXPIRTIME); # REDUCE FIELD LENGTH AND RECALL #
      1368. RETURN;
      1369. END
      1370.  
      1371. ELSE # PPU STILL ACTIVE #
      1372. BEGIN
      1373. EXPIRTIME = RTIMSECS[0] + SWAPTHRESH;
      1374. END
      1375.  
      1376. END
      1377.  
      1378. DOZER(EXPIRTIME); # ISSUE RECALL REQUEST #
      1379.  
      1380. RETURN;
      1381. END # RCLTEST #
      1382.  
      1383. TERM
      1384. PROC RCLMLK;
      1385.  
      1386. # TITLE RCLMLK - RECLAIM INTERLOCKED CATALOGS AND MAPS. #
      1387.  
      1388. BEGIN # RCLMLK #
      1389.  
      1390. #
      1391. ** RCLMLK - RECLAIM INTERLOCKED CATALOGS AND MAPS.
      1392. *
      1393. * *RCLMLK* RECLAIMS INTERLOCKED CATALOGS AND/OR SMA MAPS.
      1394. *
      1395. * PROC RCLMLK
      1396. *
      1397. * ENTRY (RCLMCAT) - RECLAIM CATALOG INTERLOCKS FLAG
      1398. * (DEFINED IN *ECTFCOM*).
      1399. * = TRUE, RECLAIM CATALOGS.
      1400. * = FALSE, DO NOT RECLAIM CATALOGS.
      1401. * (RCLMMAP) - RECLAIM SMA MAP INTERLOCKS FLAG
      1402. * (DEFINED IN *ECTFCOM*).
      1403. * = TRUE, RECLAIM MAPS.
      1404. * = FALSE, DO NOT RECLAIM MAPS.
      1405. *
      1406. * EXIT CATALOG AND/OR MAP INTERLOCKS HAVE BEEN RECLAIMED, AND
      1407. * EXPIRATION TIMES HAVE BEEN ADJUSTED IF NECESSARY.
      1408. *
      1409. * MESSAGES * EXEC ABNORMAL, RCLMLK.*.
      1410. #
      1411.  
      1412. #
      1413. **** PROC RCLMLK - XREF LIST BEGIN.
      1414. #
      1415.  
      1416. XREF
      1417. BEGIN
      1418. PROC ABORT; # ABORT PROCESSING #
      1419. PROC CRCLMLK; # RECLAIM CATALOG INTERLOCKS #
      1420. PROC MESSAGE; # ISSUE DAYFILE MESSAGE #
      1421. PROC MRCLMLK; # RECLAIM SMA MAP INTERLOCKS #
      1422. PROC RTIME; # GET CURRENT TIME #
      1423. PROC SETPFP; # SET FAMILY AND USER INDEX #
      1424. END
      1425.  
      1426. #
      1427. **** PROC RCLMLK - XREF LIST END.
      1428. #
      1429.  
      1430. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      1431. *CALL,COMBFAS
      1432. *CALL,COMBCMS
      1433. *CALL,COMBPFP
      1434. *CALL,COMXCTF
      1435. *CALL,COMXIPR
      1436. *CALL,COMXMSC
      1437.  
      1438. ITEM I I; # INDUCTION VARIABLE #
      1439. ITEM STAT I; # ERROR STATUS #
      1440.  
      1441. CONTROL EJECT;
      1442.  
      1443. #
      1444. * RECLAIM CATALOG INTERLOCKS.
      1445. #
      1446.  
      1447. IF RCLMCAT
      1448. THEN
      1449. BEGIN # RECLAIM CATALOGS #
      1450. RCLMCAT = FALSE;
      1451. CRCLMLK(STAT);
      1452. END # RECLAIM CATALOGS #
      1453.  
      1454. #
      1455. * RECLAIM SMA MAP INTERLOCKS.
      1456. #
      1457.  
      1458. IF RCLMMAP
      1459. THEN
      1460. BEGIN # RECLAIM SMA MAPS #
      1461. PFP$WRD0[0] = 0;
      1462. PFP$FG1[0] = TRUE;
      1463. PFP$FG4[0] = TRUE;
      1464. PFP$FAM[0] = DEF$FAM;
      1465. PFP$UI[0] = DEF$UI;
      1466. SETPFP(PFP[0]);
      1467. IF PFP$STAT NQ OK
      1468. THEN
      1469. BEGIN
      1470. FE$RTN[0] = "RCLMLK.";
      1471. MESSAGE(FEMSG[0],UDFL1);
      1472. ABORT;
      1473. END
      1474.  
      1475. RCLMMAP = FALSE;
      1476. MAPINTLK = FALSE;
      1477. MAP$EXPIR = 0;
      1478. FASTFOR I = 1 STEP 1 UNTIL MAXSM
      1479. DO
      1480. BEGIN
      1481. MRCLMLK(I,STAT);
      1482. IF STAT EQ CMASTAT"INTLK"
      1483. THEN
      1484. BEGIN
      1485. MAPINTLK = TRUE;
      1486. END
      1487.  
      1488. END
      1489.  
      1490. IF MAPINTLK
      1491. THEN
      1492. BEGIN
      1493. RTIME(RTIMESTAT[0]);
      1494. MAP$EXPIR = RTIMSECS[0] + MAP$INTV;
      1495. END
      1496.  
      1497. END # RECLAIM SMA MAPS #
      1498.  
      1499. END # RCLMLK #
      1500.  
      1501. TERM
      1502. PROC SCAN$LTCT;
      1503.  
      1504. # TITLE SCAN$LTCT - PROCESS SWAPPED OUT *UCP*-S. #
      1505.  
      1506. BEGIN # SCAN$LTCT #
      1507.  
      1508. #
      1509. ** SCAN$LTCT - PROCESS SWAPPED OUT *UCP*-S.
      1510. *
      1511. * *SCAN$LTCT* SCANS THE *LTCT* TO REISSUE *UCP* RESPONSE CALLS
      1512. * FOR ENTRIES WHICH HAVE THE SWAPPED-UCP FLAG SET. IT IS CALLED
      1513. * PERIODICALLY FROM *MAINLP*.
      1514. *
      1515. * PROC SCAN$LTCT
      1516. *
      1517. * ENTRY IF THE GLOBAL SWAPPED *UCP* FLAG (*GLBUCPSW*)
      1518. * IS SET, AN ATTEMPT IS MADE TO RESPOND TO ANY
      1519. * PREVIOUSLY SWAPPED OUT *UCP*-S. IF *GLBUCPSW*
      1520. * IS NOT SET, NO PROCESSING IS DONE.
      1521. *
      1522. * EXIT ANY SWAPPED-OUT *UCP*-S HAVE BEEN PROCESSED.
      1523. #
      1524.  
      1525. #
      1526. **** PROC SCAN$LTCT - XREF LIST BEGIN.
      1527. #
      1528.  
      1529. XREF
      1530. BEGIN
      1531. PROC RTIME; # GET TIME SINCE LAST DEADSTART #
      1532. PROC SFCALL; # INTERFACE TO *SFCALL* MACRO #
      1533. PROC UCP$RES; # NOTIFY *UCP* OF COMPLETION #
      1534. END
      1535.  
      1536. #
      1537. **** PROC SCAN$LTCT - XREF LIST END.
      1538. #
      1539.  
      1540. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      1541. *CALL,COMBFAS
      1542. *CALL,COMBUCR
      1543. *CALL,COMXCTF
      1544. *CALL,COMXIPR
      1545. *CALL,COMXLTC
      1546. *CALL,COMXMSC
      1547.  
      1548. CONTROL EJECT;
      1549.  
      1550. #
      1551. * ONLY PROCESS SWAPPED OUT *UCP*-S.
      1552. #
      1553.  
      1554. IF NOT GLBUCPSW
      1555. THEN
      1556. BEGIN
      1557. RETURN;
      1558. END
      1559.  
      1560. UCP$EXPIR = 0;
      1561.  
      1562. GLBUCPSW = FALSE;
      1563. FASTFOR LTCENTRY = 1 STEP 1 UNTIL LTCTCNT
      1564. DO
      1565. BEGIN # CHECK FOR *UCP* SWAPPED #
      1566. IF LTC$UCPSW[LTCENTRY]
      1567. THEN
      1568. BEGIN # CHECK SWAP IN STATUS #
      1569. IF LTC$SFFCC[LTCENTRY]
      1570. THEN
      1571. BEGIN
      1572. UCP$RES;
      1573. END
      1574.  
      1575. ELSE
      1576. BEGIN
      1577. GLBUCPSW = TRUE;
      1578. RTIME(RTIMESTAT[0]);
      1579. UCP$EXPIR = RTIMSECS[0] + UCP$INTV;
      1580. END
      1581.  
      1582. END # CHECK SWAP IN STATUS #
      1583.  
      1584. END # CHECK FOR *UCP* SWAPPED #
      1585.  
      1586. RETURN;
      1587. END # SCAN$LTCT #
      1588.  
      1589. TERM
      1590. PROC SLAVERP(CALLERCTL);
      1591.  
      1592. # TITLE SLAVERP - SLAVE REQUEST PROCESSOR. #
      1593.  
      1594. BEGIN # SLAVERP #
      1595.  
      1596. #
      1597. ** SLAVERP - SLAVE REQUEST PROCESSOR.
      1598. *
      1599. * *SLAVERP* IS PERIODICALLY CALLED TO READ AND PROCESS THE
      1600. * COMMUNICATION FILE FROM EACH DEFINED *SSSLV*. AN INFORMATIVE
      1601. * OPERATOR MESSAGE WILL BE DISPLAYED FOR ANY *SSSLV* WHOSE
      1602. * ACTIVE/INACTIVE STATUS HAS CHANGED SINCE THE PREVIOUS TIME ITS
      1603. * COMMUNICATION FILE WAS READ. ALSO, THE STATUS OF EACH REQUEST
      1604. * BLOCK FOR EACH ACTIVE *SSSLV* IS EXAMINED TO DETERMINE IF ANY
      1605. * PROCESSING BY THE *SSEXEC* IS REQUIRED. IF STAGE REQUESTS ARE
      1606. * DETECTED, THEY ARE ADDED TO THE *HLRQ*.
      1607. *
      1608. * PROC SLAVERP(CALLERCTL)
      1609. *
      1610. * ENTRY (CALLERCTL) =0, IF CALLED BY *MAINLP*.
      1611. * .NQ. 0, IF CALLED BY *DOZER*.
      1612. *
      1613. * THE IDENTITY AND PREVIOUS STATUS OF EACH DEFINED SLAVE
      1614. * EXEC IS CONTAINED IN THE BUFFER FOR THE HEADER PORTION
      1615. * OF THE *MTOS* FILE.
      1616. * (NXTRB) = THE NEXT REQUEST BLOCK FROM WHICH A STAGE
      1617. * REQUEST WILL BE ACCEPTED.
      1618. *
      1619. * EXIT (CALLERCTL) =0, IF CALLED BY *DOZER* AND SLAVE
      1620. * REQUESTS NEED TO BE PROCESSED.
      1621. * UNCHANGED OTHERWISE.
      1622. *
      1623. * THE VARIABLE *STOM$EXPIR* IS UPDATED
      1624. * TO REFLECT THE NEXT TIME THIS PROCEDURE SHOULD BE
      1625. * CALLED.
      1626. *
      1627. * THE HEADER PORTION OF THE *MTOS* FILE BUFFER IS
      1628. * UPDATED TO REFLECT ANY NEW STATUS INFORMATION FOR EACH
      1629. * *SSSLV*. THE REPLY BLOCK PORTION OF THE *MTOS* FILE
      1630. * IS UPDATED TO REFLECT ANY RESPONSE TO REQUESTS IN THE
      1631. * REQUEST BLOCKS (SEE THE COMPOSITE REQUEST/REPLY BLOCK
      1632. * STATUS DESCRIPTION IN *COMXMMF*).
      1633. *
      1634. * NOTES IF THE *STOM* FILE FOR A GIVEN *SSSLV* ENCOUNTERS A
      1635. * READ ERROR OR IF THE FILE LENGTH IS DIFFERENT FROM
      1636. * WHAT IS EXPECTED, THE STATUS OF THAT *SSSLV*
      1637. * WILL BE SET TO UNDEFINED. IF THIS RESULTS IN NO
      1638. * DEFINED *SSSLV*, THEN THE *STOM$EXPIR* WORD WILL BE
      1639. * SET TO A VERY LARGE VALUE SO THE *SSSLV* REQUEST
      1640. * PROCESSOR IS NEVER CALLED.
      1641. *
      1642. * MESSAGES * EXEC - SLAVE N XXXX.*
      1643. * AN INFORMATIVE MESSAGE INDICATING THAT
      1644. * A CHANGE IN THE STATUS OF THE INDICATED
      1645. * *SSSLV* PROGRAM HAS BEEN DETECTED. THE
      1646. * NEW *SSSLV* STATUS IS INDICATED BY *XXXX*,
      1647. * WHICH CAN BE *ACTIVE* OR *INACTIVE*.
      1648. *
      1649. * * EXEC - SLAVE N OMITTED -*
      1650. * - STOM FILE ERROR.*
      1651. * THIS MESSAGE INDICATES THAT AN ERROR CONDITION
      1652. * WAS DETECTED WHILE READING THE COMMUNICATION
      1653. * FILE FROM THE SPECIFIED *SSSLV* PROGRAM.
      1654. * THE *SSEXEC* WILL CONTINUE TO OPERATE, BUT WILL
      1655. * NOT ATTEMPT TO RECEIVE REQUESTS FROM THE
      1656. * SPECIFIED *SSSLV* PROGRAM.
      1657. *
      1658. #
      1659.  
      1660. ITEM CALLERCTL U; # CALLER IDENTIFICATION #
      1661.  
      1662. #
      1663. **** PROC SLAVERP - XREF LIST BEGIN.
      1664. #
      1665.  
      1666. XREF
      1667. BEGIN
      1668. PROC MESSAGE; # ISSUE MESSAGE MACRO #
      1669. PROC PDATE; # ISSUE PDATE MACRO #
      1670. PROC READ; # READ FILE #
      1671. PROC REWIND; # REWIND FILE #
      1672. PROC RTIME; # ISSUE RTIME MACRO #
      1673. PROC SLVRBP; # SLAVE REQUEST BLOCK PROCESSOR #
      1674. FUNC XCOD C(10); # INTEGER TO DISPLAY #
      1675. PROC ZSETFET; # INITIALIZE *FET* #
      1676. END
      1677.  
      1678. #
      1679. **** PROC SLAVERP - XREF LIST END.
      1680. #
      1681.  
      1682. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      1683. *CALL,COMBFAS
      1684. *CALL,COMBFET
      1685. *CALL,COMXCTF
      1686. *CALL,COMXIPR
      1687. *CALL,COMXJCA
      1688. *CALL,COMXMMF
      1689. *CALL,COMXMSC
      1690.  
      1691.  
      1692. ITEM DELAY U; # NUMBER OF SECONDS UNTIL NEXT
      1693.   READ OF *STOM* #
      1694. ITEM DELTART I; # CHANGE IN THRESHOLD #
      1695. ITEM PASSCTR U; # DUMMY INDUCION VARIABLE #
      1696. CONTROL EJECT;
      1697.  
      1698. SLVACTIVE = FALSE; # ASSUME NO SLAVES ACTIVE #
      1699. DELAY = SLRP$INTV;
      1700. RELOOP = FALSE;
      1701. SLOWFOR PASSCTR = 1 STEP 1 UNTIL 2
      1702. DO
      1703. BEGIN # *STOM* SCAN #
      1704. IF (NOT RELOOP OR NXTRB NQ 0) ##
      1705. AND PASSCTR EQ 2
      1706. THEN # EXIT IF SECOND PASS NOT NEEDED
      1707.   OR NOT USEFUL #
      1708. BEGIN
      1709. TEST PASSCTR;
      1710. END
      1711.  
      1712. SLOWFOR SINDX = 1 STEP 1 UNTIL NUMSLV
      1713. DO
      1714. BEGIN # PROCESS NEXT SLAVE #
      1715. P<MTOSREPBLK> = LOC(MTOSHEAD) + L$MTOSH + (SINDX-1)*NUMRB;
      1716. IF NOT MSH$DEFD[SINDX]
      1717. THEN # SLAVE NOT DEFINED #
      1718. BEGIN
      1719. TEST SINDX;
      1720. END
      1721.  
      1722. #
      1723. * READ *STOM* FILE.
      1724. #
      1725.  
      1726. ZSETFET(LOC(STOMM),MSH$PFNS[SINDX],LOC(STOMMBUF), ##
      1727. STOMBUFL,SFETL);
      1728. P<STOMFILE> = LOC(STOMMBUF);
      1729. REWIND(STOMM,RCL);
      1730. READ(STOMM,RCL);
      1731. PDATE(PDATESTAT[0]);
      1732. RTIME(RTIMESTAT[0]);
      1733.  
      1734. #
      1735. * CHECK FOR FILE LENGTH OK AND NO *CIO* ERRORS.
      1736. #
      1737.  
      1738. IF (FET$AT[0] NQ 0) ##
      1739. OR (FET$IN[0]-FET$OUT[0] LS L$STOM)
      1740. THEN # *STOM* READ ERROR OR TOO SHORT #
      1741. BEGIN # ISSUE ERROR MESSAGE #
      1742. MSH$DEFD[SINDX] = FALSE;
      1743. SLAVECTR = SLAVECTR - 1;
      1744. CHAR10 = XCOD(SINDX);
      1745. SLVN$INDX[0] = C<9,1>CHAR10;
      1746. SLVN$STAT[0] = "OMITTED - ";
      1747. MESSAGE(SLVNSTAT,SYSUDF1);
      1748. MMFD$PROB[0] = "STOM FILE ERROR.";
      1749. MESSAGE(MMFDETAIL,SYSUDF1);
      1750. NXTRB = 0;
      1751. TEST SINDX;
      1752. END # ISSUE ERROR MESSAGE #
      1753.  
      1754. IF DELAY GR SM$DELAY[0] ##
      1755. AND SM$DELAY[0] NQ 0
      1756. THEN
      1757. BEGIN
      1758. DELAY = SM$DELAY[0];
      1759. END
      1760.  
      1761. #
      1762. * CHECK FOR CHANGE IN STATUS OF SLAVE EXEC.
      1763. #
      1764.  
      1765. SLVN$INDX[0] = C<6,1>MSH$PFNS[SINDX];
      1766. IF SM$SWC[0] NQ MSH$SWC[SINDX]
      1767. THEN # SLAVE IS ACTIVE #
      1768. BEGIN # ACTIVE STATUS #
      1769. SLVACTIVE = TRUE;
      1770. IF MSH$STATS[SINDX] NQ S"ACTIVE"
      1771. THEN
      1772. BEGIN
      1773. SLVN$STAT[0] = "ACTIVE.";
      1774. MSH$STATS[SINDX] = S"ACTIVE";
      1775. MESSAGE(SLVNSTAT,SYSUDF1);
      1776. END
      1777.  
      1778. MSH$SSW[SINDX] = SM$SSW[0];
      1779. MSH$TIMOUT[SINDX] = RTIMSECS[0] + SLAV$INTV;
      1780. END # ACTIVE STATUS #
      1781.  
      1782. ELSE # CHECK FOR TIMEOUT #
      1783. BEGIN # CHECK STATUS #
      1784. IF MSH$TIMOUT[SINDX] LS RTIMSECS[0]
      1785. THEN
      1786. BEGIN
      1787. SLVN$STAT[0] = "INACTIVE.";
      1788. MESSAGE(SLVNSTAT,SYSUDF1);
      1789. NXTRB = 0;
      1790. MSH$TIMOUT[SINDX] = MAXSECS;
      1791. MSH$STATS[SINDX] = S"DEAD";
      1792. TEST SINDX;
      1793. END
      1794.  
      1795. ELSE
      1796. BEGIN
      1797. SLVACTIVE = TRUE;
      1798. END
      1799.  
      1800. END # CHECK STATUS #
      1801.  
      1802. #
      1803. * EXAMINE EACH REQUEST BLOCK ON THE *STOM* FILE
      1804. * AND PROCESS ACCORDING TO ITS COMPOSITE STATUS.
      1805. #
      1806.  
      1807. IF SM$REQCTL[0] NQ MSH$REQCTL[SINDX]
      1808. THEN
      1809. BEGIN
      1810. IF (CALLERCTL EQ 0)
      1811. THEN # OK TO CALL *SLVRBP* #
      1812. BEGIN
      1813. SLVRBP;
      1814. END
      1815.  
      1816. ELSE # RETURN TO CALLER #
      1817. BEGIN
      1818. CALLERCTL = 0;
      1819. RETURN;
      1820. END
      1821.  
      1822. END
      1823.  
      1824. END # PROCESS NEXT SLAVE #
      1825.  
      1826. END # *STOM* SCAN #
      1827.  
      1828. #
      1829. * ESTABLISH THE NEXT TIME THE SLAVE REQUEST PROCESSOR
      1830. * IS TO BE CALLED.
      1831. #
      1832.  
      1833. IF NOT SLVACTIVE
      1834. THEN # USE LARGER DELAY INTERVAL #
      1835. BEGIN
      1836. DELAY = SLAV$INTV;
      1837. END
      1838.  
      1839. RTIME(RTIMESTAT[0]);
      1840. STOM$EXPIR = RTIMSECS[0] + DELAY;
      1841. IF SLAVECTR EQ 0 OR DRYUP
      1842. THEN
      1843. BEGIN
      1844. SLVACTIVE = FALSE;
      1845. STOM$EXPIR = MAXSECS;
      1846. END
      1847.  
      1848. RETURN;
      1849. END # SLAVERP #
      1850.  
      1851. TERM
      1852. PROC SLVRBP;
      1853.  
      1854. # TITLE SLVRBP - SLAVE REQUEST BLOCK PROCESSOR. #
      1855.  
      1856. BEGIN # SLVRBP #
      1857.  
      1858. #
      1859. ** SLVRBP - SLAVE REQUEST BLOCK PROCESSOR.
      1860. *
      1861. * *SLVRBP* CHECKS THE STATUS OF EACH REQUEST BLOCK FOR THE
      1862. * CURRENT *SSSLV* AND DETERMINES IF ANY PROCESSING BY *SSEXEC*
      1863. * IS REQUIRED.
      1864. *
      1865. * PROC SLVRBP
      1866. *
      1867. * ENTRY (PDATEV[0]) = CURRENT PACKED DATE AND TIME.
      1868. * P<MTOSREPBLK> = REPLY BLOCK PORTION OF THE *MTOS*
      1869. * FILE.
      1870. * P<STOMFILE> = *STOM* FILE REQUEST BLOCKS.
      1871. *
      1872. * EXIT THE REPLY BLOCK PORTION OF THE *MTOS* FILE IS
      1873. * UPDATED TO REFLECT ANY RESPONSE TO REQUESTS IN THE
      1874. * REQUEST BLOCKS (SEE THE COMPOSITE REQUEST/REPLY
      1875. * BLOCK STATUS DESCRIPTION IN *COMXMMF*.
      1876. #
      1877.  
      1878. #
      1879. **** PROC SLVRBP - XREF LIST BEGIN.
      1880. #
      1881.  
      1882. XREF
      1883. BEGIN
      1884. PROC SLVTDAM; # SLAVE *TDAM* REQUEST PROCESSOR #
      1885. END
      1886.  
      1887. #
      1888. **** PROC SLVRBP - XREF LIST END.
      1889. #
      1890.  
      1891. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      1892. *CALL,COMBFAS
      1893. *CALL,COMXIPR
      1894. *CALL,COMXMMF
      1895.  
      1896. ITEM I I; # LOOP COUNTER #
      1897. ITEM REJCNT I; # REJECT COUNTER #
      1898. CONTROL EJECT;
      1899.  
      1900. REJCNT = 0;
      1901. FASTFOR I = 1 STEP 1 UNTIL NUMRB
      1902. DO
      1903. BEGIN # PROCESS REQUEST BLOCKS #
      1904.  
      1905. IF SM$SRC[I] EQ S"AVAIL" ##
      1906. AND MSR$MRC[I] EQ S"FINISHED"
      1907. THEN
      1908.  
      1909. #
      1910. * MASTER REPLY CODE PROCCESSED BY SLAVE - MAKE REQUEST BLOCK
      1911. * AVAILABLE FOR NEW REQUESTS.
      1912. #
      1913.  
      1914. BEGIN
      1915. MSR$MRC[I] = S"AVAIL";
      1916. MSR$PDATE[I] = PDATEV[0];
      1917. TEST I; # PROCESS NEXT REQUEST #
      1918. END
      1919.  
      1920. IF SM$SRC[I] EQ S"CANCEL" ##
      1921. AND MSR$MRC[I] NQ S"FINISHED"
      1922. THEN
      1923.  
      1924. #
      1925. * SLAVE CANCELLED THIS REQUEST - ACKNOWLEDGE CANCELLATION.
      1926. #
      1927.  
      1928. BEGIN
      1929. MSR$MRC[I] = S"FINISHED";
      1930. MSR$REPLY[I] = S"CANCELLED";
      1931. MSR$PDATE[I] = PDATEV[0];
      1932. TEST I; # PROCESS NEXT REQUEST #
      1933. END
      1934.  
      1935. IF SM$SRC[I] EQ S"SUBMITTED" ##
      1936. AND MSR$MRC[I] EQ S"AVAIL"
      1937. THEN
      1938.  
      1939. #
      1940. * SLAVE ISSUED A NEW *TDAM* REQUEST - PROCESS THIS REQUEST.
      1941. #
      1942.  
      1943. BEGIN
      1944. SLVTDAM(I,REJCNT);
      1945. END
      1946.  
      1947. END # PROCESS REQUEST BLOCKS #
      1948.  
      1949. IF REJCNT EQ 0
      1950. THEN
      1951. BEGIN
      1952. MSH$REQCTL[SINDX] = SM$REQCTL[0];
      1953. END
      1954.  
      1955. END # SLVPRB #
      1956.  
      1957. TERM
      1958. PROC SLVTDAM((RB),REJCNT);
      1959.  
      1960. # TITLE SLVTDAM - SLAVE *TDAM* REQUEST PROCESSOR. #
      1961.  
      1962. BEGIN # SLVTDAM #
      1963.  
      1964. #
      1965. ** SLVTDAM - SLAVE *TDAM* REQUEST PROCESSOR.
      1966. *
      1967. * *SLVTDAM* DOES THE PRELIMINARY PROCESSING OF A REQUEST FROM AN
      1968. * *STOM* FILE REQUEST BLOCK. STAGE REQUESTS WHICH DUPLICATE
      1969. * THOSE ALREADY IN PROCESS (*HLRQ*) OR QUEUED (*RTRQ*) ARE
      1970. * UPDATED TO INDICATE SLAVE ORIGIN. NON-DUPLICATE STAGE
      1971. * AND OTHER REQUESTS ARE QUEUED IN THE *RTRQ* ACTIVE CHAIN.
      1972. *
      1973. * PROC SLVTDAM((RB),REJCNT)
      1974. *
      1975. * ENTRY (NXTRB) = THE NEXT REQUEST BLOCK FROM WHICH A STAGE
      1976. * REQUEST WILL BE ACCEPTED.
      1977. * (PDATEV[0]) = PACKED DATE AND TIME.
      1978. * P<MTOSREPBLK> = REPLY BLOCK PORTION OF THE *MTOS*
      1979. * FILE.
      1980. * P<STOMFILE> = *STOM* FILE REQUEST BLOCKS.
      1981. * (RB) = REQUEST BLOCK INDEX.
      1982. * (REJCNT) = REJECT COUNTER.
      1983. * (SINDX) = SLAVE INDEX.
      1984. *
      1985. * MESSAGES * INCORRECT TDAM REQUEST.*
      1986. *
      1987. * NOTES IF A STAGE REQUEST FROM REQUEST BLOCK *J* OF *SSSLV*
      1988. * *I* CANNOT BE ENTERED INTO THE *HLRQ* FOR PROCESSING
      1989. * BECAUSE EITHER THE THRESHOLD FOR *SSSLV* STAGE
      1990. * REQUESTS HAS BEEN REACHED OR BECAUSE THE *HLRQ* IS
      1991. * FULL, *NXTRB* WILL BE SET TO REFLECT THE VALUES OF
      1992. * *I* AND *J*. WHEN THIS OCCURS, ALL NORMAL PROCESSING
      1993. * OF THE *STOM* FILES CONTINUES, EXCEPT THAT ALL
      1994. * NONDUPLICATE STAGE REQUESTS ARE IGNORED UNTIL THE ONE
      1995. * FROM *SSSLV* *I*, REQUEST BLOCK *J*, CAN BE ACCEPTED.
      1996. * WHEN THIS STAGE REQUEST IS FINALLY ACCEPTED, A SECOND
      1997. * SCAN OF ALL *STOM* FILES IS MADE TO SEE IF A
      1998. * PREVIOUSLY IGNORED STAGE REQUEST CAN NOW BE ACCEPTED.
      1999. #
      2000.  
      2001. ITEM RB U; # REQUEST BLOCK INDEX #
      2002. ITEM REJCNT I; # REJECT COUNTER #
      2003.  
      2004. #
      2005. **** PROC SLVTDAM - XREF LIST BEGIN.
      2006. #
      2007.  
      2008. XREF
      2009. BEGIN
      2010. PROC ENTDAM; # ENTER *TDAM* REQUEST FOR
      2011.   PROCESSING #
      2012. PROC MSG; # ISSUE MESSAGE #
      2013. PROC SRCHDS; # SEARCH FOR DUPLICATE STAGE #
      2014. END
      2015.  
      2016. #
      2017. **** PROC SLVTDAM - XREF LIST END.
      2018. #
      2019.  
      2020. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      2021. *CALL,COMBFAS
      2022. *CALL,COMBTDM
      2023. *CALL,COMXCTF
      2024. *CALL,COMXIPR
      2025. *CALL,COMXMMF
      2026.  
      2027. ITEM I U; # INDEX #
      2028. ITEM NEWTDAM U; # ADDRESS OF ACCEPTED *TDAM*
      2029.   REQUEST #
      2030. ITEM STAT I;
      2031. ITEM THISRB U;
      2032.  
      2033. CONTROL EJECT;
      2034.  
      2035. P<TDAM> = LOC(SM$TDAM[RB]);
      2036. IF TDAMFC[0] LQ TDAMFCODE"NOREQ" ##
      2037. OR TDAMFC[0] EQ TDAMFCODE"DESTRLS" ##
      2038. OR TDAMFC[0] EQ TDAMFCODE"DESTAGE" ##
      2039. OR TDAMFC[0] GQ TDAMFCODE"FCEND"
      2040. THEN # ABANDON INCORRECT REQUESTS #
      2041. BEGIN
      2042. MSG(INVRQC,UDFL1);
      2043. MSR$MRC[RB] = S"FINISHED";
      2044. MSR$REPLY[RB] = S"ABANDONED";
      2045. MSR$PDATE[RB] = PDATEV[0];
      2046. MTOS$EXPIR = 0;
      2047. END
      2048.  
      2049. #
      2050. * PROCESS SLAVE *TDAM* REQUESTS.
      2051. #
      2052.  
      2053. THISRB = SINDX * NUMRB + RB;
      2054. IF THISRB EQ NXTRB
      2055. THEN
      2056. BEGIN
      2057. NXTRB = 0;
      2058. END
      2059.  
      2060. ENTDAM(P<TDAM>,NXTRB,NEWTDAM);
      2061.  
      2062. IF NEWTDAM NQ 0
      2063. THEN # REQUEST ACCEPTED #
      2064. BEGIN # PROCESS REQUEST ACCEPTED #
      2065. P<TDAM> = NEWTDAM;
      2066. IF TDAMFC[0] NQ TDAMFCODE"STAGE"
      2067. THEN # REPLY TO INTERLOCK REQUEST #
      2068. BEGIN
      2069. MSR$MRC[RB] = S"FINISHED";
      2070. MSR$REPLY[RB] = REPLY"OK";
      2071. MTOS$EXPIR = 0;
      2072. MSR$PDATE[RB] = PDATEV[0];
      2073. RETURN;
      2074. END
      2075.  
      2076. TDAMOSLV[0] = TRUE;
      2077.  
      2078. #
      2079. * REPLY TO STAGE REQUEST.
      2080. #
      2081.  
      2082. IF TDAMSSN[0] EQ 0
      2083. THEN # ESTABLISH A STAGING SEQUENCE
      2084.   NUMBER #
      2085. BEGIN
      2086. TDAMSSN[0] = NEXTSSN;
      2087. NEXTSSN = NEXTSSN + 1;
      2088. IF NEXTSSN GQ MAXSSN
      2089. THEN
      2090. BEGIN
      2091. NEXTSSN = 1;
      2092. END
      2093.  
      2094. END
      2095.  
      2096. MSR$SSN[RB] = TDAMSSN[0];
      2097. MSR$MRC[RB] = S"ACCEPTED";
      2098. END # PROCESS REQUEST ACCEPTED #
      2099.  
      2100. ELSE # REQUEST NOT ACCEPTED #
      2101. BEGIN
      2102. REJCNT = REJCNT + 1;
      2103.  
      2104. IF NXTRB NQ 0
      2105. THEN
      2106. BEGIN
      2107. RELOOP = RELOOP OR (THISRB LS NXTRB);
      2108. END
      2109.  
      2110. ELSE
      2111. BEGIN
      2112. NXTRB = THISRB;
      2113. END
      2114.  
      2115. RETURN;
      2116. END
      2117.  
      2118. END # SLVTDAM #
      2119.  
      2120. TERM
      2121. PROC STARTUP;
      2122.  
      2123. # TITLE STARTUP - HANDLES ALL *SSEXEC* INITIALIZATION. #
      2124. BEGIN # STARTUP #
      2125.  
      2126. #
      2127. ** STARTUP - HANDLES ALL *SSEXEC* INITIALIZATION.
      2128. *
      2129. * THIS ROUTINE PERFORMS ALL HARDWARE AND NON-HARDWARE INITIALIZING
      2130. * OF *SSEXEC*.
      2131. *
      2132. * PROC STARTUP.
      2133. *
      2134. * EXIT ALL INITIALIZATION HAS BEEN PERFORMED.
      2135. *
      2136. * NOTES THIS ROUTINE CALLS THE OVERLAY *INITLZR* TO
      2137. * PERFORM *SSEXEC* INITIALIZATION, AND
      2138. * THEN ISSUES AN *INITHW* *LLRQ* REQUEST TO
      2139. * TO INITIALIZE THE *M860* HARDWARE.
      2140. #
      2141.  
      2142. #
      2143. **** PROC STARTUP - XREF LIST BEGIN.
      2144. #
      2145.  
      2146. XREF
      2147. BEGIN
      2148. PROC KPROC; # *K* DISPLAY PROCESSOR #
      2149. PROC KREQ; # ISSUE K-DISPLAY REQUEST #
      2150. PROC SSOVL; # LOAD *MSAS* OVERLAYS #
      2151. PROC LLRQENQ; # *LLRQ* ENQUEUER #
      2152. PROC MSG; # ISSUE DAYFILE MESSAGE #
      2153. PROC RECALL; # SUSPEND PROCESSING #
      2154. END
      2155.  
      2156. #
      2157. **** PROC STARTUP - XREF LIST END.
      2158. #
      2159.  
      2160. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      2161. *CALL,COMBFAS
      2162. *CALL,COMBCMD
      2163. *CALL,COMBCPR
      2164. *CALL,COMBKDD
      2165. *CALL,COMBLRQ
      2166. *CALL,COMBOVL
      2167. *CALL,COMBUCR
      2168. *CALL,COMBUDT
      2169. *CALL,COMXCTF
      2170. *CALL,COMXJCA
      2171. *CALL,COMXMSC
      2172.  
      2173.  
      2174. ITEM I U; # INDEX #
      2175. ITEM LLRADR U; # *LLRQ* ENTRY ADDRESS #
      2176. ITEM NOCUON B; # SET IF ALL CU-S OFF #
      2177.  
      2178.  
      2179. #
      2180. * BUFFER FOR K-DISPLAY WORDS.
      2181. #
      2182.  
      2183. ARRAY KDISB [0:0] S(2);
      2184. BEGIN # K-DISPLAY WORDS #
      2185. ITEM KDIS$1 U(00,00,60); # K-DISPLAY WORD 1 #
      2186. ITEM KDIS$2 U(01,00,60); # K-DISPLAY WORD 2 #
      2187. END # K-DISPLAY WORDS #
      2188.  
      2189. #
      2190. * GENERAL MESSAGE BUFFER.
      2191. #
      2192.  
      2193. ARRAY MSGMB [0:0] S(5);
      2194. BEGIN # GENERAL #
      2195. ITEM MSG$LINE C(00,00,40); # MESSAGE LINE #
      2196. ITEM MSG$ZERO U(04,00,12) = [0]; # ZERO-BYTE TERMINATOR #
      2197. END # GENERAL #
      2198.  
      2199. CONTROL EJECT;
      2200.  
      2201. SSOVL(LINITLZR,0); # LOAD INITIZLIZATION OVERLAY #
      2202.  
      2203. IF FATALERR
      2204. THEN # FATAL ERROR WHILE INITIALIZING #
      2205. BEGIN # ABORT #
      2206. RETURN;
      2207. END # ABORT #
      2208.  
      2209. #
      2210. * SET THE INITIALIZATION FLAG TO TELL THE *UCP* REQUEST PROCESSORS
      2211. * THAT ALL M860 HARDWARE IS BEING INITIALIZED. WHEN THIS FLAG IS
      2212. * SET, *SSALTER* REQUESTS TO MODIFY THE UDT ARE NOT CONVERTED INTO
      2213. * INDIVIDUAL DRIVER HARDWARE REQUESTS.
      2214. #
      2215.  
      2216. INITIALIZE = TRUE; # INDICATE FULL INITIALIZATION #
      2217.  
      2218. #
      2219. * ALLOW *SSALTER* TO MODIFY THE UDT UNTIL A K-DISPLAY
      2220. * *GO* REPLY IS RECEIVED FROM THE OPERATOR.
      2221. #
      2222.  
      2223. P<KWORD> = LOC(KDIS$1[0]);
      2224. KW$WORD[0] = 0;
      2225. KW$RPGO[0] = TRUE; # ALLOW GO RESPONSE #
      2226. KW$DF[0] = TRUE; # ISSUE MESSAGE TO JOB DAYFILE #
      2227. KW$LINE1[0] = KM"KM12"; # ISSUE UDT ALTERATION MESSAGE #
      2228. KW$LINE3[0] = 0;
      2229. KREQ(P<KWORD>,KLINK); # ISSUE K-DISPLAY MESSAGE #
      2230. REPEAT WHILE NOT KW$COMP[0]
      2231. DO # PROCESS *SSALTER* REQUESTS #
      2232. BEGIN # PROCESS #
      2233. KPROC; # *K* DISPLAY MESSAGE #
      2234.  
      2235. RECALL(0);
      2236.  
      2237. IF RA$SSCINLK[0]
      2238. THEN # *UCP* BUFFER CONTAINS REQUEST #
      2239. BEGIN # CHECK REQUEST #
      2240. P<CPR> = RA$SSCAP[0] + 2;
      2241. IF CPR$RQT[0] NQ TYP"TYP4"
      2242. THEN # *LLRQ* ENTRY NOT NEEDED #
      2243. BEGIN # LOAD #
      2244. SSOVL(LNEWWORK,0); # CALL *UCP* PROCESSOR IN
      2245.   *NEWWORK* OVERLAY #
      2246. END # LOAD #
      2247.  
      2248. END # CHECK REQUEST #
      2249.  
      2250. P<KWORD> = LOC(KDIS$1[0]); # RESET TO CHECK IF COMPLETE #
      2251. END # PROCESS #
      2252.  
      2253. MSG(" ACTIVE.",LINE1); # DISPLAY *ACTIVE* LINE #
      2254.  
      2255. #
      2256. * CLEAN UP ALL M860 HARDWARE STATUSES IN THE UDT.
      2257. #
      2258.  
      2259. NOCUON = TRUE; # ASSUME ALL CU-S OFF #
      2260. SLOWFOR I = 1 STEP 1 UNTIL MAXCTN
      2261. DO # PRESET CONTROLLER ENTRIES #
      2262. BEGIN # PRESET #
      2263. IF UD$EXIST[I]
      2264. THEN # CLEAN UP THIS CONTROLLER #
      2265. BEGIN # CLEANUP #
      2266. IF UD$CUON[I]
      2267. THEN # AT LEAST ONE CU ON #
      2268. BEGIN # RESET #
      2269. NOCUON = FALSE;
      2270. END # RESET #
      2271.  
      2272. UD$CNUP[I] = TRUE; # SET CLEANUP #
      2273. LLRQENQ(LLRADR); # SET UP *LLRQ* ENTRY #
      2274. P<LLRQ> = LLRADR;
      2275. LLR$PRCNME[0] = REQTYP4"INITHW"; # INITIALIZE HARDWARE #
      2276. LLR$CU[0] = I; # SET CONTROLLER ORDINAL #
      2277. LLR$RQI[0] = REQNAME"RQIINT";
      2278. END # CLEANUP #
      2279.  
      2280. END # PRESET #
      2281.  
      2282. IF NOCUON # NO CU ON #
      2283. THEN # ALL CU-S OFF #
      2284. BEGIN # OFF #
      2285. MSG$LINE[0] = " ALL CONTROLLERS OFF.";
      2286. MSG(MSGMB,SYSUDF1);
      2287. MSG$LINE[0] = "$ALL CONTROLLERS OFF.";
      2288. MSG(MSGMB,LINE2);
      2289. END # OFF #
      2290.  
      2291. RETURN;
      2292. END # STARTUP #
      2293.  
      2294. TERM
      2295. PROC SWAPPER((EXPIRTIME));
      2296.  
      2297. # TITLE SWAPPER - REDUCE FIELD LENGTH AND GO INTO RECALL. #
      2298.  
      2299. BEGIN # SWAPPER #
      2300.  
      2301. #
      2302. ** SWAPPER - REDUCE FIELD LENGTH AND GO INTO RECALL.
      2303. *
      2304. * *SWAPPER* WRITES PART OF *SSEXEC*-S FIELD LENGTH
      2305. * TO DISK, REDUCES THE FIELD LENGTH, AND GOES INTO
      2306. * RECALL. *SSEXEC* IS REACTIVATED WHEN THE EXPIRATION
      2307. * TIME IS REACHED OR WHEN ANOTHER CRITERIA FOR SWAPIN
      2308. * IS MET. FIELD LENGTH IS THEN EXPANDED AND MEMORY IS
      2309. * RESTORED.
      2310. *
      2311. * PROC SWAPPER((EXPIRTIME))
      2312. *
      2313. * ENTRY (EXPIRTIME) = DELAY EXPIRATION TIME CALCULATED
      2314. * IN *RCLTEST*.
      2315. *
      2316. * EXIT PSEUDO-SWAPOUT/SWAPIN COMPLETE WITH *SSEXEC*
      2317. * REACTIVATED. IF A *READ* ERROR OCCURS AND
      2318. * MEMORY CANNOT BE RESTORED, THE *TERMINATE* FLAG
      2319. * IS SET AND CONTROL REGISTER R1 IS SET TO *RESTART*
      2320. * (DEFINED IN *COMXMSC). AN ENDRUN IS THEN DONE,
      2321. * CAUSING EXEC TO BE RELOADED FOR A NEW EXECUTION.
      2322. #
      2323.  
      2324. ITEM EXPIRTIME U; # DELAY EXPIRATION TIME #
      2325.  
      2326. #
      2327. **** PROC SWAPPER - XREF LIST BEGIN.
      2328. #
      2329.  
      2330. XREF
      2331. BEGIN
      2332. PROC ABORT; # ABORT PROCESSING #
      2333. PROC DOZER; # PUT *SSEXEC* INTO RECALL #
      2334. PROC MESSAGE; # INTERFACE TO *MESSAGE* MACRO #
      2335. PROC MSG; # ISSUE DAYFILE MESSAGE #
      2336. PROC MNGMEM; # CHANGE FIELD LENGTH #
      2337. PROC SSOVL; # LOAD *MSAS* OVERLAYS #
      2338. PROC READ; # READ A FILE #
      2339. PROC RECALL; # SUSPEND PROCESSING #
      2340. PROC REWIND; # REWIND FILE #
      2341. PROC WRITEF; # WRITE END-OF-FILE #
      2342. FUNC XCDD C(10); # CONVERT INTEGER TO DISPLAY #
      2343. PROC ZSETFET; # INITIALIZE A *FET* #
      2344. END
      2345.  
      2346. #
      2347. **** PROC SWAPPER - XREF LIST END.
      2348. #
      2349.  
      2350. DEF SWAPLFN #"MSSROLL"#; # SWAP-OUT FILE NAME #
      2351.  
      2352. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      2353. *CALL,COMBFAS
      2354. *CALL,COMBFET
      2355. *CALL,COMXACM
      2356. *CALL,COMXCTF
      2357. *CALL,COMXIPR
      2358. *CALL,COMXJCA
      2359. *CALL,COMXMSC
      2360.  
      2361. ITEM DC$FL C(10); # FIELD LENGTH IN DISPLAY CODE #
      2362. ITEM FIRST B = TRUE; # FIRST TIME FLAG #
      2363. ITEM FL$CHANGE U; # AMOUNT OF FIELD LENGTH CHANGE #
      2364. ITEM I U; # INDUCTION VARIABLE #
      2365. ITEM MNG$REQ U; # REQUEST FOR *MNGMEM* #
      2366. ITEM RCLFLAG B; # SET IF RECOVERY WAS DELAYED #
      2367. ITEM STAT U; # STATUS RETUSRNED BY *MNGMEM* #
      2368. ITEM SWAPFWA U; # FIRST WORD OF MEMORY TO BE #
      2369. # WRITTEN TO DISK #
      2370.  
      2371. ARRAY MSGLINE [0:0] S(4); # CONTAINS DAYFILE MESSAGE #
      2372. BEGIN
      2373. ITEM MSGITEM C(00,00,38); # CHARACTER STRING #
      2374. ITEM MSGZERO U(03,48,12)=[0]; # ZERO BYTE TERMINATOR #
      2375. END
      2376.  
      2377. ARRAY SWPFET [0:0] S(RFETL);; # *FET* FOR SWAP-OUT FILE #
      2378.  
      2379. CONTROL EJECT;
      2380.  
      2381. #
      2382. * COPY PART OF *SSEXEC* FIELD LENGTH TO DISK.
      2383. #
      2384.  
      2385. P<FETSET> = LOC(SWPFET[0]);
      2386. FE$RTN[0] = "SWAPPER.";
      2387. IF FIRST
      2388. THEN # INITIALIZE *FET* #
      2389. BEGIN
      2390. SWAPFWA = ((LOC(SSOVL) + PRULEN - 1)/PRULEN)*PRULEN;
      2391. FL$CHANGE = CUR$FL - SWAPFWA; # FIELD LENGTH CHANGE #
      2392. MNG$REQ = FL$CHANGE - UNU$FL;
      2393. ZSETFET(LOC(SWPFET[0]),SWAPLFN,SWAPFWA-1,FL$CHANGE+1,RFETL);
      2394. FET$OUT[0] = SWAPFWA;
      2395. FIRST = FALSE;
      2396. END
      2397.  
      2398. ELSE # UPDATE TO CURRENT FIELD LENGTH #
      2399. BEGIN
      2400. FET$LIM[0] = CUR$FL;
      2401. REWIND(SWPFET[0],RCL);
      2402. FET$OUT[0] = SWAPFWA;
      2403. FL$CHANGE = CUR$FL - SWAPFWA;
      2404. MNG$REQ = FL$CHANGE - UNU$FL;
      2405. END
      2406.  
      2407. MSGITEM[0] = " IDLE.";
      2408. MESSAGE(MSGLINE[0],LINE1);
      2409.  
      2410. #
      2411. * NOTE 1 - BEGINNING OF REDUCED FL CONDITION.
      2412. *
      2413. * ANY CHANGES TO CODE BETWEEN HERE AND NOTE 2 WILL
      2414. * AFFECT SSEXECS IDLE FIELD LENGTH. IF THIS CODE
      2415. * IS CHANGED SUCH THAT ADDITIONAL ROUTINES ARE
      2416. * REFERENCED WHILE SSEXEC IS IDLE, THE LIST OF
      2417. * LDSET STATEMENTS IN SSEXEC MUST BE AUGMENTED TO
      2418. * INCLUDE THE ADDITIONAL ROUTINES, AND THE BUILD
      2419. * PROCEDURE FOR SSEXEC MUST ALSO BE CHANGED TO
      2420. * INSURE THAT THE ADDITIONAL ROUTINES GET LOADED IN
      2421. * LOW CORE BELOW ROUTINE *ZSETFET*.
      2422. #
      2423.  
      2424. WRITEF(SWPFET[0],RCL); # COPY PART OF FIELD LENGTH #
      2425.  
      2426. #
      2427. * REDUCE FIELD LENGTH AND GO INTO RECALL.
      2428. #
      2429.  
      2430. MNGMEM(-MNG$REQ,STAT);
      2431. IF STAT EQ 0
      2432. THEN # FATAL ERROR CONDITION #
      2433. BEGIN
      2434. MESSAGE(FEMSG[0],UDFL1);
      2435. ABORT;
      2436. END
      2437.  
      2438. EXPIRTIME = EXPIRTIME - READFLTIME;
      2439. DOZER(EXPIRTIME);
      2440.  
      2441. #
      2442. * EXPAND FIELD LENGTH TO PREVIOUS SIZE.
      2443. #
      2444.  
      2445. RCLFLAG = FALSE;
      2446. FASTFOR I = 0 WHILE STAT EQ 0
      2447. DO
      2448. BEGIN # INCREASE FIELD LENGTH #
      2449.  
      2450. MNGMEM(MNG$REQ,STAT); # REQUEST INCREASE #
      2451.  
      2452. IF STAT EQ 0
      2453. THEN # INCREASE UNSUCCESSFUL #
      2454. BEGIN
      2455. MSGITEM[0] = "$SSEXEC SEEKING FL INCREASE.";
      2456. MESSAGE( MSGLINE[0],LINE1);
      2457. RECALL(0);
      2458. RCLFLAG = TRUE;
      2459. END
      2460.  
      2461. END # INCREASE FIELD LENGTH #
      2462.  
      2463. IF RCLFLAG
      2464. THEN # RECOVERY DELAYED BUT COMPLETE #
      2465. BEGIN
      2466. MSGITEM[0] = " SSEXEC ACTIVE.";
      2467. MESSAGE(MSGLINE[0],LINE1);
      2468. END
      2469.  
      2470. #
      2471. * RESTORE MEMORY.
      2472. #
      2473.  
      2474. P<FETSET> = LOC(SWPFET[0]);
      2475. REWIND(SWPFET[0],RCL);
      2476. FET$OUT[0] = SWAPFWA;
      2477. FET$IN[0] = SWAPFWA;
      2478. FET$EP[0] = TRUE;
      2479. READ(SWPFET[0],RCL);
      2480.  
      2481. #
      2482. * NOTE 2 - END OF REDUCED FL CONDITION.
      2483. #
      2484.  
      2485. IF FET$AT[0] NQ OK
      2486. THEN # UNABLE TO RESTORE MEMORY #
      2487. BEGIN
      2488. MSGITEM[0] = "$ERROR ON ROLLFILE - EXEC ABORTING.";
      2489. MESSAGE(MSGLINE[0],SYSUDF1);
      2490. ABORT;
      2491. END
      2492.  
      2493. MSGITEM[0] = " ACTIVE.";
      2494. MESSAGE(MSGLINE[0],LINE1);
      2495.  
      2496. RETURN;
      2497. END # SWAPPER #
      2498.  
      2499. TERM
      2500. PROC TELLSLV((SSN),(STAT));
      2501.  
      2502. # TITLE TELLSLV - TELL *SSSLV* A STAGE REQUEST HAS COMPLETED. #
      2503.  
      2504. BEGIN # TELLSLV #
      2505.  
      2506. #
      2507. ** TELLSLV - TELL *SSSLV* A STAGE REQUEST HAS COMPLETED.
      2508. *
      2509. * *TELLSLV* IS CALLED WHEN A STAGE REQUEST FROM AN *SSSLV*
      2510. * HAS COMPLETED. IT WILL FIND THE REQUEST BLOCKS, IF ANY,
      2511. * FOR THIS STAGE REQUEST AND ENTER THE COMPLETION STATUS
      2512. * INTO THE CORRESPONDING REPLY BLOCKS. THE *MTOS$EXPIR*
      2513. * FLAG IS CLEARED TO CAUSE THE *MTOS* FILE TO BE FLUSHED.
      2514. *
      2515. * PROC TELLSLV((SSN),(STAT))
      2516. *
      2517. * ENTRY (SSN) = THE STAGING SEQUENCE NUMBER OF THE COMPLETED
      2518. * STAGE REQUEST. THIS NUMBER WAS ENTERED
      2519. * INTO THE REQUEST BLOCK WHEN THE STAGE
      2520. * REQUEST WAS ACCEPTED FOR PROCESSING.
      2521. * (STAT) = STATUS OF THE COMPLETED STAGE REQUEST.
      2522. *
      2523. * EXIT THE APPROPRIATE REPLY BLOCKS IN THE
      2524. * *MTOS* FILE ARE UPDATED, AND THE
      2525. * *MTOS$EXPIR* FLAG IS CLEARED.
      2526. #
      2527.  
      2528. ITEM SSN U; # STAGING SEQUENCE NUMBER #
      2529. ITEM STAT U; # =0 IF *PFC* UPDATED #
      2530.  
      2531. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      2532. *CALL,COMBFAS
      2533. *CALL,COMXCTF
      2534. *CALL,COMXIPR
      2535. *CALL,COMXJCA
      2536. *CALL,COMXMMF
      2537.  
      2538.  
      2539. ITEM RB U; # INDEX TO A REQUEST BLOCK #
      2540. ITEM STATS S:REPLY; # STATUS OF STAGE REQUEST #
      2541. CONTROL EJECT;
      2542. STATS = REPLY"OK";
      2543. IF STAT NQ 0
      2544. THEN
      2545. BEGIN
      2546. STATS = REPLY"ABANDONED";
      2547. END
      2548.  
      2549. #
      2550. * SEARCH THE REPLY BLOCKS OF EACH SLAVE
      2551. * TO FIND A MATCHING *SSN* VALUE.
      2552. * A MATCH INDICATES THAT THE STAGE WAS
      2553. * DONE FOR THE CORRESPONDING SLAVE AND
      2554. * REQUEST BLOCK. PUT THE STAGING STATUS
      2555. * INTO THE REPLY BLOCK AND CAUSE THE
      2556. * *MTOS* FILE TO BE WRITTEN.
      2557. #
      2558.  
      2559. SLOWFOR SINDX = 1 STEP 1 UNTIL SLAVECTR
      2560. DO
      2561. BEGIN # CHECK ALL SLAVES #
      2562. P<MTOSREPBLK> = LOC(MTOSHEAD) + L$MTOSH + (SINDX-1)*NUMRB;
      2563.  
      2564. SLOWFOR RB = 1 STEP 1 UNTIL NUMRB
      2565. DO
      2566. BEGIN # CHECK REPLY BLOCKS FOR THIS SLAVE #
      2567. IF MSR$SSN[RB] EQ SSN
      2568. THEN # STAGE SEQUENCE NUMBER MATCH
      2569.   FOUND #
      2570. BEGIN
      2571. MSR$MRC[RB] = S"FINISHED";
      2572. MSR$REPLY[RB] = STATS;
      2573. MSR$PDATE[RB] = PDATEV[0];
      2574. MSR$SSN[RB] = 0;
      2575. MTOS$EXPIR = 0; # FORCE THE *MTOS* BUFFERS TO BE
      2576.   FLUSHED #
      2577. TEST SINDX;
      2578. END
      2579.  
      2580. END # CHECK REPLY BLOCKS FOR THIS SLAVE #
      2581.  
      2582. END # CHECK ALL SLAVES #
      2583.  
      2584. END # TELLSLV #
      2585.  
      2586. TERM
      2587. PROC TERMTST;
      2588.  
      2589. # TITLE TERMTST - TESTS THE TERMINATION CRITERIA. #
      2590.  
      2591. BEGIN # TERMTST #
      2592.  
      2593. #
      2594. ** TERMTST - TESTS THE TERMINATION CRITERIA.
      2595. *
      2596. * THIS PROCEDURE IS CALLED BY *MAINLP* IF THE *DRYUP*
      2597. * FLAG IS SET. IT DETERMINES WHETHER TERMINATION
      2598. * CRITERIA FOR *SSEXEC* HAVE BEEN MET.
      2599. *
      2600. * PROC TERMTST
      2601. *
      2602. * ENTRY *DRYUP* FLAG HAS BEEN SET.
      2603. *
      2604. * EXIT *TERMINATE* FLAG IS SET IF ALL THE REQUIRED
      2605. * CONDITIONS FOR TERMINATION EXIST.
      2606. #
      2607.  
      2608. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      2609. *CALL,COMBFAS
      2610. *CALL,COMBCHN
      2611. *CALL,COMBMAT
      2612. *CALL,COMXCTF
      2613. *CALL,COMXLTC
      2614.  
      2615. ITEM COUNT U; # CHAIN ENTRY COUNT #
      2616. ITEM I U; # INDUCTION VARIABLE #
      2617.  
      2618. CONTROL EJECT;
      2619.  
      2620. #
      2621. * CHECK FOR ANY CONNECTED *UCP*S.
      2622. #
      2623.  
      2624. FASTFOR I = 1 STEP 1 UNTIL LTCTCNT
      2625. DO # CHECK LONG TERM CONNECT TABLE #
      2626. BEGIN
      2627. IF LTC$WORD1[I] NQ 0 AND NOT INITIALIZE
      2628. THEN # CONNECTED *UCP* FOUND #
      2629. BEGIN
      2630. RETURN;
      2631. END
      2632.  
      2633. END
      2634.  
      2635. #
      2636. * CHECK REQUEST QUEUES FOR OUTSTANDING REQUESTS.
      2637. #
      2638.  
      2639. IF CHN$BOC[LCHN"RTD$ACT"] NQ 0 AND NOT INITIALIZE
      2640. THEN # *RTRQ* NOT EMPTY #
      2641. BEGIN
      2642. RETURN;
      2643. END
      2644.  
      2645.  
      2646. IF CHN$BOC[LCHN"HL$ACTV"] NQ 0
      2647. THEN # *HLRQ* ACTIVE CHAIN NOT EMPTY #
      2648. BEGIN
      2649. RETURN;
      2650. END
      2651.  
      2652. COUNT = 0;
      2653. P<LINKWRD> = LOC(CHNPTRS[LCHN"LL$FRSPC"]);
      2654.  
      2655. SLOWFOR I = 0 WHILE LINK$ADR[0] NQ 0
      2656. DO # COUNT FREE *LLRQ* ENTRIES #
      2657. BEGIN
      2658. COUNT = COUNT + 1;
      2659. P<LINKWRD> = LINK$ADR[0];
      2660. END
      2661.  
      2662. IF COUNT NQ MAT$COUNT[MAT$ENTRY"LLRQ"] ##
      2663. AND NOT INITIALIZE # NO *LLRQ* CLEANUP NEEDED #
      2664. THEN # ACTIVE *LLRQ* ENTRIES EXIST #
      2665. BEGIN
      2666. RETURN;
      2667. END
      2668.  
      2669. IF DRVRRECALL
      2670. THEN # ACTIVE CPU DRIVER #
      2671. BEGIN
      2672. RETURN;
      2673. END
      2674.  
      2675. TERMINATE = TRUE; # TERMINATION CRITERIA MET #
      2676. RETURN;
      2677. END # TERMTST #
      2678.  
      2679. TERM
      2680. PROC TRYTDAM;
      2681.  
      2682. # TITLE TRYTDAM - SERVICES THE *TDAM* BUFFER. #
      2683.  
      2684. BEGIN # TRYTDAM #
      2685.  
      2686. #
      2687. ** TRYTDAM - SERVICES THE *TDAM* BUFFER.
      2688. *
      2689. * THIS PROCEDURE TRANSFERS *TDAM* REQUESTS FROM THE
      2690. * *TDAM* BUFFER INTO THE *RTRQ* ACTIVE CHAIN. NO
      2691. * TRANSFER OCCURS IF THE *TDAM* BUFFER IS EMPTY, IF
      2692. * THE *RTRQ* FREE SPACE CHAIN IS EMPTY, OR IF THE
      2693. * *DRYUP* FLAG IS SET AND THE REQUEST IS A STAGE.
      2694. *
      2695. * PROC TRYTDAM
      2696. *
      2697. * ENTRY THERE IS A REQUEST IN THE *TDAM* BUFFER.
      2698. *
      2699. * EXIT *TDAM* REQUEST TRANSFERRED TO *RTRQ*,
      2700. * IF POSSIBLE.
      2701. #
      2702.  
      2703. #
      2704. **** PROC TRYTDAM - XREF LIST BEGIN.
      2705. #
      2706.  
      2707. XREF
      2708. BEGIN
      2709. PROC ENTDAM; # ENTER *TDAM* REQUEST FOR
      2710.   PROCESSING #
      2711. END
      2712.  
      2713. #
      2714. **** PROC TRYTDAM - XREF LIST END.
      2715. #
      2716.  
      2717. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      2718. *CALL,COMBFAS
      2719. *CALL,COMBTDM
      2720. *CALL,COMXCTF
      2721. *CALL,COMXJCA
      2722. *CALL,COMXMSC
      2723.  
      2724.  
      2725. ITEM TDAMIN U; # LOCATION OF ORIGINAL *TDAM*
      2726.   REQUEST #
      2727. ITEM TDAMOUT U; # LOCATION OF ACCEPTED *TDAM*
      2728.   REQUEST #
      2729. CONTROL EJECT;
      2730.  
      2731. #
      2732. * SERVICE THE *TDAM* BUFFER IF POSSIBLE.
      2733. #
      2734.  
      2735. TDAMIN = LOC(RA$TDAM[0]);
      2736. IF ((NOT DRYUP) AND (GLBSTFL)) ##
      2737. OR (TDAMFC[0] NQ TDAMFCODE"STAGE")
      2738. THEN
      2739. BEGIN # PROCESS REQUEST #
      2740.  
      2741. ENTDAM(TDAMIN,0,TDAMOUT); # SUBMIT *TDAM* REQUEST #
      2742.  
      2743. P<TDAM> = TDAMOUT;
      2744. IF TDAMOUT NQ 0 ##
      2745. AND TDAMFC[0] EQ TDAMFCODE"STAGE"
      2746. THEN
      2747. BEGIN
      2748. TDAMOMAST[0] = TRUE;
      2749. END
      2750.  
      2751. END # PROCESS REQUEST #
      2752.  
      2753. P<TDAM> = TDAMIN;
      2754.  
      2755. #
      2756. * INSURE CLEARING IS COMPLETE BEFORE NEW TDAM IS ENTRIED.
      2757. #
      2758.  
      2759. TDAMWORD[0] = 0;
      2760. RETURN;
      2761. END # TRYTDAM #
      2762.  
      2763. TERM
      2764. PROC WAKE$UP;
      2765.  
      2766. # TITLE WAKE$UP - WAKE UP DELAYED PROCESSES. #
      2767.  
      2768. BEGIN # WAKE$UP #
      2769.  
      2770. #
      2771. ** WAKE$UP - WAKE UP DELAYED PROCESSES.
      2772. *
      2773. * *WAKE$UP* REACTIVATES ANY DELAYED PROCESSES WHOSE WAKE-UP TIME
      2774. * HAS COME.
      2775. *
      2776. * PROC WAKE$UP
      2777. *
      2778. * ENTRY CALLED BY *MAINLP* WHEN *HLRQ* OR *LLRQ* DELAY CHAINS
      2779. * ARE POPULATED.
      2780. *
      2781. * EXIT ALL ENTRIES WHOSE WAKE-UP TIME HAS COME ARE ON THE
      2782. * APPROPRIATE (*HLRQ* OR *LLRQ*) READY CHAIN.
      2783. #
      2784.  
      2785. #
      2786. **** PROC WAKE$UP - XREF LIST BEGIN.
      2787. #
      2788.  
      2789. XREF
      2790. BEGIN
      2791. PROC ADD$LNK; # ADD ENTRY TO END OF CHAIN #
      2792. PROC DEL$LNK; # DELETE ENTRY FROM CHAIN #
      2793. PROC RTIME; # GET SYSTEM CLOCK READING #
      2794. END
      2795.  
      2796. #
      2797. **** PROC WAKE$UP - XREF LIST END.
      2798. #
      2799.  
      2800. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
      2801. *CALL,COMBFAS
      2802. *CALL,COMBCHN
      2803. *CALL,COMBLRQ
      2804. *CALL,COMXCTF
      2805. *CALL,COMXHLR
      2806. *CALL,COMXIPR
      2807. *CALL,COMXMSC
      2808.  
      2809. ITEM ENTADR U; # CURRENT ENTRY ADDRESS #
      2810. ITEM NEXTADDR U; # NEXT ENTRY ADDRESS #
      2811.  
      2812. CONTROL EJECT;
      2813.  
      2814. #
      2815. * INITIALIZE MINIMUM QUEUE DELAY INTERVAL.
      2816. #
      2817.  
      2818. RTIME(RTIMESTAT[0]);
      2819. MINQ$EXPIR = RTIMSECS[0] + MINQ$INTV;
      2820.  
      2821. #
      2822. * REACTIVATE ALL *HLRQ* ENTRIES WHOSE WAKE-UP TIME HAS COME.
      2823. #
      2824.  
      2825. ENTADR = CHN$BOC[LCHN"HL$DELAY"];
      2826. REPEAT WHILE ENTADR NQ 0
      2827. DO
      2828. BEGIN # SEARCH DELAY CHAIN #
      2829. P<HLRQ> = ENTADR;
      2830. NEXTADDR = HLR$LNK1[0];
      2831. IF RTIMSECS[0] GQ HLR$RTIME[0]
      2832. THEN # IF WAKE-UP TIME HAS COME #
      2833. BEGIN
      2834. DEL$LNK(ENTADR,LCHN"HL$DELAY",0);
      2835. ADD$LNK(ENTADR,LCHN"HL$READY",0);
      2836. END
      2837.  
      2838. ELSE
      2839. BEGIN
      2840. IF HLR$RTIME[0] LS MINQ$EXPIR
      2841. THEN # IF EARLIEST NON-EXPIRED WAKE-UP
      2842.   TIME #
      2843. BEGIN
      2844. MINQ$EXPIR = HLR$RTIME[0];
      2845. END
      2846.  
      2847. END
      2848.  
      2849. ENTADR = NEXTADDR;
      2850. END # SEARCH DELAY CHAIN #
      2851.  
      2852. #
      2853. * REACTIVATE ALL *LLRQ* ENTRIES WHOSE WAKE-UP TIME HAS COME.
      2854. #
      2855.  
      2856. ENTADR = CHN$BOC[LCHN"LL$DELAY"];
      2857. REPEAT WHILE ENTADR NQ 0
      2858. DO
      2859. BEGIN # SEARCH DELAY CHAIN #
      2860. P<LLRQ> = ENTADR;
      2861. NEXTADDR = LLR$LINK1[0];
      2862. IF RTIMSECS[0] GQ LLR$RTIME[0]
      2863. THEN # IF WAKE-UP TIME HAS COME #
      2864. BEGIN
      2865. DEL$LNK(ENTADR,LCHN"LL$DELAY",0);
      2866. ADD$LNK(ENTADR,LCHN"LL$READY",0);
      2867. END
      2868.  
      2869. ELSE
      2870. BEGIN
      2871. IF LLR$RTIME[0] LS MINQ$EXPIR
      2872. THEN # IF EARLIEST NON-EXPIRED WAKE-UP
      2873.   TIME #
      2874. BEGIN
      2875. MINQ$EXPIR = LLR$RTIME[0];
      2876. END
      2877.  
      2878. END
      2879.  
      2880. ENTADR = NEXTADDR;
      2881. END # SEARCH DELAY CHAIN #
      2882.  
      2883. #
      2884. * IF BOTH DELAY CHAINS ARE NOW EMPTY, SET *MINQ$EXPIR* TO ZERO.
      2885. #
      2886.  
      2887. IF CHN$BOC[LCHN"HL$DELAY"] EQ 0 AND CHN$BOC[LCHN"LL$DELAY"] EQ 0
      2888. THEN
      2889. BEGIN
      2890. MINQ$EXPIR = 0;
      2891. END
      2892.  
      2893. RETURN;
      2894.  
      2895. END # WAKE$UP #
      2896.  
      2897. TERM
cdc/nos2.source/opl871/sxmain.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator