User Tools

Site Tools


cdc:nos2.source:nam5871:xsacb

Table of Contents

XSACB

Table Of Contents

  • [00019] PROC XSACB
  • [00107] PROC HWLP
  • [00108] PROC NPPWL
  • [00109] PROC HWRAVAL
  • [00110] PROC KPUT
  • [00111] PROC MRELS
  • [00112] PROC OSCHAPP
  • [00113] PROC OVLCALL
  • [00114] PROC ABORT
  • [00115] PROC XTRACE
  • [00116] PROC HPWAITR

Source Code

XSACB.txt
  1. *DECK XSACB
  2. USETEXT NIPDEF
  3. USETEXT APPSTAT
  4. USETEXT AWLNTRY
  5. USETEXT FREETAB
  6. USETEXT MSGIDX
  7. USETEXT NWLHEAD
  8. USETEXT OVERLAY
  9. USETEXT PARAMS
  10. USETEXT ACB
  11. USETEXT KDIS
  12. USETEXT KHDRX
  13. USETEXT PT
  14. USETEXT AT
  15. USETEXT NBT
  16. USETEXT PWL
  17. USETEXT SWAPIN
  18. USETEXT SYSTIME
  19. PROC XSACB; # CHECK ACB STATE CHANGES #
  20.  
  21. STARTIMS;
  22. #
  23. *1DC XSACB
  24. *
  25. * 1. PROC NAME AUTHOR DATE
  26. * XSACB E. GEE 77/07/27
  27. *
  28. * 2. FUNCTIONAL DESCRIPTION.
  29. * COMPLETE PROCESSING OF NETWORK WORKLIST WHICH COULD NOT BE
  30. * FINISHED EARLIER BECAUSE
  31. * 1) APP SWAPPED OUT WAITING FOR NETON RESPONSE FROM CS
  32. * 2) APP SWAPPED OUT BY OPERATING SYSTEM
  33. * 3) APP EXECUTED A NETWAIT
  34. *
  35. * 3. METHOD USED.
  36. * SCAN THROUGH APP TABLE LOOKING FOR APPLICATION CTL BLKS
  37. * DETERMINE STATE OF EACH APPLICATION
  38. * EVERY ACB WILL BE IN ONE OF THESE EIGHT STATES.
  39. * 1. APP EXECUTED NETWAIT BUT WAS NOT SWAPPED OUT
  40. * 2. APP IN NORMAL STATE
  41. * 3. APP SWAPPED OUT BY NETWAIT
  42. * 5. APP SWAPPED OUT BY NETWAIT - SWAPIN ISSUED
  43. * 6. APP SWAPPED OUT BY NETON - SWAPIN ISSUED
  44. * 7. APP SWAPPED OUT BY OPERATING SYSTEM - SWAPIN ISSUED
  45. * 8. APP SWAPPED OUT BY OPERATING SYSTEM, BUT
  46. * THERE IS UPLINE BLOCKS FOR IT - SWAPIN ISSUED
  47. * CONTINUE PROCESSING DEPENDING ON STATE OF APPLICATION
  48. * 0. RESUME APP WORKLIST PROCESSING.
  49. * 1. CHECK IF NETWAIT TIME IS UP. IF SO, RESTART WORKLIST
  50. * PROCESSING
  51. * 2. DO NOTHING FOR THIS APPLICATION
  52. * 3. CHECK IF NETWAIT TIME IS UP. IF SO, SWAPIN APPLICATION
  53. * 4. RESTART WORKLIST PROCESSING
  54. * FOR STATES 5-7, NIP MUST CHECK IF SWAPIN HAS BEEN COMPLETED
  55. * AND IF SO, PROCESS SCP SWAPIN FUNCTION RETURN CODE
  56. * IF THERE IS A NEED TO MODIFY DATA AVAILABLE
  57. * WORD IN AIP, CALL HWRAVAL TO DO IT
  58. * IF HWRAVAL MODIFIES DATA AVAILABLE WORD OK,
  59. * CONTINUE PROCESSING FOR INDIVIDUAL STATE,
  60. * 5. RESTART WORKLIST PROCESSING
  61. * 6. COMPLETE NETON PROCESSING
  62. * 7. RESTART WORKLIST PROCESSING
  63. * 8. CONTINUE
  64. * CHECK IF APPLICATION NEEDS TO BE ABORTED AND PROCESS
  65. * ACCORDINGLY
  66. * CHECK IF APPLICATION HAS FAILED AND PROCESS ACCORDINGLY
  67. * CHECK IF SWAPINS WERE ISSUED FOR (NO ACB) APPLICATIONS AND
  68. * PROCESS ACCORDINGLY
  69. *
  70. * 4. ENTRY PARAMETERS. NONE
  71. *
  72. * 5. EXIT PARAMETERS. NONE
  73. *
  74. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  75. * APPSTAT DUMPFLG
  76. * MSGIDX NIPDEF PWL
  77. * OVERLAY PARAMS ACB
  78. * SWAPIN SYSTIME AT PT
  79. *
  80. * 7. ROUTINES CALLED.
  81. * HAPFAIL OVL PROCESS APPLICATION FAILURE
  82. * HPFL OVL REISSUE SCP FUNCTION LIST
  83. * HPNONSA OVL FINISH PROCESSING NETON OF APPLICATION
  84. * HWLP PROCESS NWL
  85. * HWRAVAL MODIFY DATA AVAILABLE WORD
  86. * MRELS RELEASE BUFFER
  87. * OSCHAPP SCHEDULE APPLICATION
  88. * OVLCALL LOAD AND EXECUTE OVERLAY
  89. * RDUMP DUMP NIP-S FL
  90. * XABTAPP OVL ABORT APPLICATION
  91. * XERRMSG OVL ISSUE DAYFILE MESSAGE
  92. * XSAPP OVL PROCESS SWAPIN OF (NO ACB) APPLICATION
  93. * XTRACE TRACES CALLS
  94. * NPPWL OVL PROCESS PRU WORKLIST
  95. *
  96. * 8. DAYFILE MESSAGES. NONE
  97. * * NIP/SCP ERROR RC = XXB,JOBID=XXXX*
  98. * THIS PROCEDURE IS CALLED BY XEXEC.
  99. *
  100.  #
  101. STOPIMS;
  102. #
  103.   EXTERNAL VARIABLES
  104. #
  105.  
  106. XREF BEGIN
  107. PROC HWLP; # PROCESS WORKLIST #
  108. PROC NPPWL;
  109. PROC HWRAVAL; # MODIFY DATA AVAILABLE WORD #
  110. PROC KPUT; # UPDATE NAM STATUS DISPLAY #
  111. PROC MRELS; # RELEASE BUFFER #
  112. PROC OSCHAPP; # SCHEDULE AN APPLICATION #
  113. PROC OVLCALL; # LOAD AND EXECUTE OVERLAY #
  114. PROC ABORT ;
  115. PROC XTRACE; # TRACE CALL #
  116. PROC HPWAITR; # CHECK MSG AVL ON ACB OR ACNBS #
  117. END
  118. #
  119.   INTERNAL VARIABLES
  120. #
  121. ITEM INDEX; # INDEX #
  122. ITEM APPSTATE; # STATE OF THIS APPLICATION #
  123. ITEM CURRPWL;
  124. ITEM NEXTPWL;
  125. ITEM RETCODE;
  126. ITEM SWPCHK=120;
  127.  
  128. SWITCH STATE ,STATE1,STATE2,STATE3,STATE4,STATE5,
  129. STATE6, STATE7, STATE8;
  130.  
  131. #**********************************************************************#
  132.  
  133. BEGIN
  134.  
  135. CONTROL IFEQ DEBUG,1 ;
  136. XTRACE("XSACB") ;
  137. CONTROL FI;
  138.  
  139. #
  140.   LOOP TO EXAMINE ALL ACBS
  141. #
  142.  
  143. FOR INDEX = 1 STEP 1 UNTIL ATHAN[0]
  144. DO
  145. BEGIN
  146. P<ACB> = ATACBA[INDEX] ;
  147. #
  148.   CHECK FOR MASTER REQUEST SLAVE TO ABORT FLAG IN ACB.
  149.   CHECK FOR CONDITIONAL ABORT FROM SAC/NCL SM.
  150. #
  151. IF P<ACB> NQ 0
  152. THEN
  153. BEGIN
  154. IF ABTAPPF EQ 0
  155. THEN
  156. BEGIN
  157. IF ACBMREQABT[0]
  158. THEN
  159. BEGIN # MASTER ALREADY REQUEST #
  160. ABTAPPF = XMSTSLV ; # THIS APPL TO ABORT #
  161. ACBMREQABT[0] = FALSE ;
  162. END
  163. ELSE
  164. BEGIN # CHECK FOR ABT CONDITIONS #
  165. IF ACBABTCB[0]
  166. THEN
  167. ABTAPPF = XCONCB ;
  168. ELSE
  169. BEGIN
  170. IF ACBABTSH[0]
  171. THEN
  172. ABTAPPF = XSHUTDN ;
  173. ELSE
  174. BEGIN
  175. IF ACBABTFC[0]
  176. THEN
  177. ABTAPPF = XFCINACT ;
  178. END
  179. END
  180. ACBFNTABTF[0] = 0 ;
  181. END # CHECK FOR ABT CONDITIONS #
  182. IF ABTAPPF NQ 0
  183. THEN
  184. BEGIN
  185. ABTADDR = P<ACB> ;
  186. OVLNAME = XABTAPPP;
  187. OVLCALL;
  188.  
  189. IF FAILADR NQ 0
  190. THEN
  191. BEGIN
  192. OVLNAME = HAPFAILP;
  193. OVLCALL;
  194. END
  195. TEST INDEX; # TERMINATE FROM LOOP #
  196. END
  197. END
  198. END
  199.  
  200. #
  201.   STEP 0 CHECK IF XSACB SHOULD LOOK AT SPECIAL APPLICATIONS ONLY
  202. #
  203. IF MSG$AN GR 0 # THIS IS A CALL TO XSACB #
  204. THEN # THAT CHECKS ONLY SOME #
  205. BEGIN # APPLICATIONS #
  206. IF NOT ATAMSG[INDEX] # NO MSG FOR THIS APPLICATION #
  207. THEN
  208. BEGIN
  209. TEST INDEX; # SKIP THE CHECK #
  210. END
  211. ELSE
  212. BEGIN
  213. ATAMSG[INDEX] = FALSE; # CLEAR THE FLAG #
  214. END
  215. END
  216. #
  217.   STEP 1 CHECK IF APPLICATION ACB
  218. #
  219. IF P<ACB> NQ 0
  220. AND ATNVFF[INDEX] # APPLICATION HAS FAILED #
  221. AND ATNVFA[INDEX] # NET/ON/A REJECTED BY NVF #
  222. THEN
  223. BEGIN # RELAESE THIS APPLICATION #
  224. PARAMS1 = INDEX ;
  225. OVLNAME = RELACBP ;
  226. OVLCALL ;
  227. TEST INDEX ;
  228. END # RELEASE THIS APPLICATION #
  229. IF P<ACB> NQ 0 # ACB EXISTS #
  230. AND HRL NQ 0 # NAM NOT IN MAX FL CONDITION #
  231. THEN
  232. BEGIN
  233. IF KDIS$RT
  234. AND ACBKNDX[0] NQ 0
  235. AND ACBKNDX[0] GQ KDAPPST[0]
  236. AND ACBKNDX[0] LQ KDAPPND[0]
  237. THEN # UPDATE APPLICATION STATUS IN STATUS DISPLAY #
  238. KPUT(KHDRNP[0],ACBKNDX[0]-KDAPPST[0],KPAPSTWD,ATASBV[INDEX]);
  239. #
  240.   STEP 2 DETERMINE STATE OF APPLICATION
  241. #
  242. ACBADDR = P<ACB>;
  243. IF ATASBW[INDEX]
  244. THEN # APP IS IN NETWAIT STATE BUT NOT SWPD OUT#
  245. APPSTATE = 1;
  246. ELSE
  247. IF ATASBI[INDEX]
  248. THEN # NIP WAITING FOR APP TO BE SWAPPED IN #
  249. BEGIN
  250. IF ATASBR[INDEX]
  251. THEN # APP SWPD OUT BY NETWAIT - SWAPIN ISSUED #
  252. APPSTATE = 5;
  253. ELSE
  254. IF ATASBS[INDEX]
  255. OR ATPSO[INDEX]
  256. THEN # APP SWAPPED OUT BY OPERATING SYSTEM #
  257. APPSTATE = 7;
  258. ELSE # APP SWAPPED OUT BY NETON #
  259. IF ATASBO[INDEX]
  260. THEN
  261. APPSTATE = 6; # APP SWAPPED OUT BY NETON #
  262. ELSE
  263. APPSTATE = 8; # APP SWAPPED OUT, INACT, DATA AVA #
  264. END
  265. ELSE
  266. IF ATASBR[INDEX]
  267. THEN # APP SWAPPED OUT BY NETWAIT #
  268. APPSTATE = 3;
  269. ELSE
  270. IF ATHRL0[INDEX]
  271. THEN # RESUME NWL PROCESSING AFTER MAX FL IS RELIEVED #
  272. APPSTATE = 4;
  273. ELSE # NORMAL STATE, WAIT FOR NWL TO PROCESS #
  274. APPSTATE = 2;
  275. #
  276.   STEP 3 PROCESS PCB DEPENDING ON APPLICATION STATE
  277. #
  278. IF APPSTATE LS 5
  279. THEN # DO NOT HAVE TO PROCESS SCP RETURN CODE #
  280. BEGIN
  281. #
  282.   ********** BEGINNING OF CASE STATEMENT *********
  283. #
  284. GOTO STATE[APPSTATE];
  285. STATE1: # CHECK IF NETWAIT TIME IS UP #
  286. IF RTSECS GQ ACBNTL[0]
  287. THEN # TIME IS UP - RESUME-PROCESSING #
  288. BEGIN
  289. ATASBW[INDEX] = FALSE;
  290. ATASBF[INDEX] = FALSE;# CLEAR FORCE NETWAIT FLAG #
  291. HWLP;
  292. END
  293. GOTO ENDPROC1;
  294. STATE2: # DO NOTHING #
  295. GOTO ENDPROC1;
  296. STATE3: # CHECK IF NETWAIT TIME IS UP #
  297. IF RTSECS GQ ACBNTL[0]
  298. THEN # TIME IS UP - SCHEDULE APPLICATION #
  299. BEGIN
  300. ATASBF[INDEX] = FALSE; # CLEAR FORCE-NETWAIT FLAG #
  301. OSCHAPP(ACBADDR);
  302. END
  303. GOTO ENDPROC1;
  304. STATE4: # RESUME NWL PROCESSING AFTER MAX FL #
  305. ATHRL0[0] = FALSE; # CLEAR MAX FL SUSPEND NWL FLAG #
  306. HWLP; # RESUME WORKLIST PROCESSING #
  307. GOTO ENDPROC1;
  308. ENDPROC1:
  309. IF ATU[INDEX]
  310. THEN # NEED TO UPDATE DATA AVAIL WORD IN AIP #
  311. BEGIN
  312. ATU[INDEX] = FALSE; # CLEAR UPDATE-DATA-AVAIL FLAG #
  313. HWRAVAL(P<ACB>,TRUE); # WRITE DATA AVAIL WORD TO AIP #
  314. IF NOT ATU[INDEX]
  315. THEN # DATA-AVAIL WORD HAS BEEN UPDATED #
  316. BEGIN
  317. HWLP; # COMPLETE PROCESSING NWL WORKLIST #
  318. END
  319. ELSE # APP STILL SWAPPED OUT #
  320. BEGIN
  321. IF NOT ATASBR[INDEX] AND NOT ATASBW[INDEX]
  322. THEN # APP NOT SWAPPED OUT DUE TO NETWAIT #
  323. BEGIN
  324. ATASBS[INDEX] = TRUE; # SET SWAPPED OUT BY OS FLAG #
  325. END
  326. END
  327. END
  328. #
  329.   ********** END OF CASE STATEMENT **********
  330. #
  331. END
  332. ELSE # MUST PROCESS RETURN CODE OF SWAPIN CALL #
  333. BEGIN
  334. IF ACBSCPCB[0] EQ 1
  335. THEN # SWAPIN CALL COMPLETED #
  336. BEGIN
  337. ATASBI[INDEX] = FALSE;
  338. IF ACBSCPRC[0] NQ 0
  339. THEN # PROCESS NONZERO RETURN CODE #
  340. BEGIN
  341. IF ACBSCPRC[0] EQ RCSWAPPEDOUT # UCP STILL SWAPPED OUT#
  342. OR ACBSCPRC[0] EQ RCSWAPDELAY # UCP NOT SWAPPED IN #
  343. THEN # APP WAS SWAPPED OUT AGAIN #
  344. OSCHAPP(ACBADDR); # SCHEDULE APPLICATION #
  345. ELSE
  346. BEGIN
  347. IF ACBSCPRC[0] EQ RCUCPGONE
  348. OR ACBSCPRC[0] EQ RCSTCBAD
  349. THEN # UCP NO LONGER IN SYSTEM #
  350. FAILADR = ACBADDR;
  351. ELSE # NIP GOT BAD RETURN CODE #
  352. BEGIN
  353. PARAMS1 = DFMSG07;
  354. PARAMS2 = ACBSCPRC[0];
  355. PARAMS3 = ACBJOBSQN[0];
  356. OVLNAME = XERRMSGP;
  357. OVLCALL;
  358. ABORT(0,0) ;
  359. END
  360. END
  361. END
  362. ELSE
  363. BEGIN
  364. ACBID[0] = ACBIDVALUE;# ACB MOVEABLE AGAIN #
  365. #
  366.   ********** BEGINNING OF CASE STATEMENT **********
  367. #
  368. IF ATU[INDEX]
  369. THEN
  370. BEGIN # NEED TO MODIFY DATA AVAILABLE #
  371. ATU[INDEX] = FALSE;
  372. HWRAVAL(P<ACB>, FALSE);
  373. END
  374. IF NOT ATASBI[INDEX]
  375. THEN
  376. BEGIN # NO MORE SWAP IN IN PROGRESS #
  377. GOTO STATE[APPSTATE];
  378.  
  379. STATE5: # APP SWAPPED OUT BY NETWAIT, RESUME OP #
  380. ATASBR[INDEX] = FALSE;
  381. HWLP;
  382. GOTO ENDPROC2;
  383.  
  384. STATE6: # APP SWAPPED OUT BY NETON, RESUME #
  385. ATASBO[INDEX] = FALSE;
  386. OVLNAME = HPNONSAP;
  387. OVLCALL;
  388. IF INDEX GR ATHAN[0]
  389. THEN # HAVE SHRUNK AT TABLE TO BELOW INDEX #
  390. BEGIN
  391. IF ABTAPPF NQ 0
  392. THEN # ABORT APPLICATION #
  393. BEGIN
  394. OVLNAME = XABTAPPP; # NAME OF OVERLAY TO LOAD #
  395. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  396. END
  397. IF FAILADR NQ 0
  398. THEN # PROCESS FAILED APPLICATION #
  399. BEGIN
  400. OVLNAME = HAPFAILP; # NAME OF OVERLAY TO LOAD #
  401. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  402. END
  403. TEST INDEX; # TERMINATE FROM LOOP #
  404. END
  405. GOTO ENDPROC2;
  406.  
  407. STATE7: # APP SWAPPED OUT BY OS, ACTIVE WL OR PWL #
  408. IF ATASBS[INDEX]
  409. THEN # APP SWAPPED OUT IN HOST WORKLIST PROC #
  410. BEGIN
  411. ATASBS[INDEX] = FALSE;
  412. IF ACBFLIST[0] EQ 0
  413. THEN
  414. HWLP; # RESUME WL PROCESSING #
  415. ELSE
  416. BEGIN # FL EXIST #
  417. OVLNAME = HPFLP;
  418. OVLCALL;
  419. END
  420. END
  421. GOTO ENDPROC2;
  422.  
  423. STATE8: # APP SWAPPED OUT BY OS, INACT, DATA AV #
  424. HWLP; # RESUME WORKLIST PROCESSING, IF ANY #
  425. END
  426. ENDPROC2:
  427. #
  428.   ********** END OF CASE STATEMENT **********
  429. #
  430. END
  431. END
  432. END
  433. #
  434.   PROCESS ACB PWL RING IF APP IS SWAPPED IN
  435. #
  436. IF NOT ATASBI[INDEX]
  437. THEN # APP IS STILL SWAPPED OUT #
  438. BEGIN
  439. IF ATPSO[INDEX]
  440. THEN # APP SWAPPED OUT IN PRU WORKLIST PROCESS #
  441. BEGIN
  442. ATPSO[INDEX] = FALSE; # CLEAR APP SWAPPED OUT FLAG #
  443. END
  444. #
  445.   PROCESS PWL RING FOR SWAPPED OUT APPLICATIONS
  446. #
  447. FOR INDEX = INDEX WHILE (ACBPWLFP[0] NQ 0) AND
  448. (NOT ATPSO[INDEX])
  449. DO
  450. BEGIN
  451. CURRPWL = ACBPWLFP[0]; # CURRENT PWL IN RING #
  452. P<PWLHDR> = CURRPWL;
  453. NEXTPWL = PWLNPWLFP[0]; # NEXT PWL IN RING #
  454. #
  455.   PROCESS PWL - HOLDS A SUPERVISORY MESSAGE FOR A PRU APP
  456. #
  457. NPPWL(CURRPWL,RETCODE); # PROCESS PWL FROM PIP #
  458. IF NOT ATPSO[INDEX]
  459. THEN # APP NOT SWAPPED OUT #
  460. BEGIN # DELINK CURRENT PWL FROM RING #
  461. IF (PWLID[0] NQ DRIDVALUE) AND # PWL QUEUED FOR APP #
  462. (PWLID[0] NQ POBIDVALUE) AND # PWL QUEUED DOWNLINE #
  463. (PWLID[0] NQ PWLRIDVALUE) # PWL REQUEUED TO ACB #
  464. THEN # OKAY TO RELEASE PWL #
  465. BEGIN
  466. MRELS(CURRPWL); # RELEASED PROCESSED PWL #
  467. END
  468. IF ACBPWLFP[0] EQ ACBPWLBP[0]
  469. THEN # ALL PWL-S IN RING PROCESSED #
  470. BEGIN
  471. ACBPWLFP[0] = 0; # CLEAR PWL RING FORWARD POINTER #
  472. ACBPWLBP[0] = 0; # CLEAR PWL RING BACKWARD POINTER #
  473. END
  474. ELSE # UPDATE PWL RING POINTERS #
  475. BEGIN
  476. ACBPWLFP[0] = NEXTPWL; # NEW FIRST ENTRY IN PWL RING #
  477. P<PWLHDR> = NEXTPWL;
  478. PWLNPWLBP[0] = LOC(ACBPWLBP[0]); # UPDATE BACKWARD PTR#
  479. END
  480. END
  481. END
  482. END
  483. #
  484.   STEP 4 CHECK IF APPLICATION FAILED OR NEEDS TO BE ABORTED
  485. #
  486. IF ABTAPPF NQ 0
  487. THEN # ABORT APPLICATION #
  488. BEGIN
  489. OVLNAME = XABTAPPP; # NAME OF OVERLAY TO LOAD #
  490. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  491. END
  492. IF FAILADR NQ 0
  493. THEN # PROCESS FAILED APPLICATION #
  494. BEGIN
  495. OVLNAME = HAPFAILP; # NAME OF OVERLAY TO LOAD #
  496. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  497. END
  498. END
  499. END # END OF FOR LOOP #
  500. #
  501.   STEP 5 CHECK IF ANY (NO ACB) APPLICATIONS SWAPPED IN
  502. #
  503. IF SWAPINFP NQ 0
  504. THEN # SWAP-IN WAS ISSUED ON (NO ACB) APP #
  505. BEGIN
  506. OVLNAME = XSAPPP; # NAME OF OVERLAY TO LOAD #
  507. OVLCALL; # LOAD AND EXECUTE OVERLAY #
  508. END
  509.  
  510. EXIT: RETURN;
  511. END
  512. TERM
cdc/nos2.source/nam5871/xsacb.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator