User Tools

Site Tools


cdc:nos2.source:nam5871:hpruon

HPRUON

Table Of Contents

  • [00022] PRGM HPRUON
  • [00085] PROC LOCLLCB
  • [00086] PROC LOCNCNT
  • [00087] PROC MGETS
  • [00088] PROC MCLRIL
  • [00089] PROC MSETIL
  • [00090] PROC MRELS
  • [00091] PROC OVLCALL
  • [00092] PROC XTRACE

Source Code

HPRUON.txt
  1. *DECK HPRUON
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT ACNB
  5. USETEXT APPSTAT
  6. USETEXT AT
  7. USETEXT INPARUT
  8. USETEXT NBT
  9. USETEXT NCNB
  10. USETEXT ACNT
  11. USETEXT NCNT
  12. USETEXT LLCB
  13. USETEXT PARAMP
  14. USETEXT PRUBUFF
  15. USETEXT SYSTIME
  16. USETEXT OVERLAY
  17. USETEXT PARAMS
  18. USETEXT PCNB
  19. USETEXT PIT
  20. USETEXT PT
  21. USETEXT SUPMSG
  22. PRGM HPRUON; # PROCESS A PRU/ON/R FROM APPLICATION #
  23. STARTIMS;
  24. #
  25. *1DC HPRUON
  26. * 1. PROC NAME AUTHOR DATE
  27. * HPRUON J.C. LEE 80/04/01
  28. *
  29. * 2. FUNCTIONAL DESCRIPTION.
  30. * PROCESS A PRU/ON/R SUPERVISORY MESSAGE FROM AN APPLICATION.
  31. *
  32. * 3. METHOD USED.
  33. * VALIDATE PRU/ON/R SUPERVISORY MESSAGE,
  34. * GET EMPTY BUFFER FOR A PCNB,
  35. * FORMAT A PCNB FROM THE NCNB,
  36. * INITIALIZE CONNECTION TABLE ENTRY IN LLCB,
  37. * RELEASE THE NCNB,
  38. * UPDATE PCNB/NCNB POINTER OF ACNB,
  39. * LINK PCNB TO PCNB RING, UPDATE PQR POINTERS IN NBTE.
  40. *
  41. * 4. ENTRY PARAMETERS.
  42. * ACBADDR APPLICATION ACB ADDRESS
  43. * WLADDR WORKLIST ENTRY ADDRESS
  44. *
  45. * 5. EXIT PARAMETERS.
  46. * PARAMP1 0 IF COMPLETED, 1 IF NOT
  47. * PARAMP2 NEW PCNB ADDRESS
  48. *
  49. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  50. * ACB ACNB APPSTAT AT
  51. * NBT NCNB NIPDEF OVERLAY
  52. * PARAMS PCNB PT SUPMSG
  53. * INPARUT ACNT NCNT
  54. * LLCB PARAMP
  55. * PIT
  56. *
  57. * 7. ROUTINES AND OVERLAYS CALLED.
  58. * HLGLERR OVL SEND ERR/LGL SM TO APP
  59. * HPRUONX OVL SEND PRU/ON/N-A TO APPL
  60. * LOCLLCB LOCATE LLCB USING HN AND TN
  61. * LOCNCNT LOCATE NCNT ENTRY USING LLCB AND CN
  62. * MGETS GET AN EMPTY BUFFER
  63. * MRELS RELEASE BUFFER
  64. * OVLCALL LOAD AND EXECUTE AN OVERLAY
  65. * XTRACE TRACE CALLS
  66. *
  67. * 8. DAYFILE MESSAGES. NONE
  68. *
  69. * THIS PROGRAM IS A PRIMARY OVERLAY LOADED BY SUBROUTINE OVLCALL.
  70. * WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO LOCATION RJMAIN
  71. * TO RETURN TO THE CALLING PROGRAM.
  72. *
  73. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE PRIMARY
  74. *CALL OPSIZE
  75. *
  76. * THIS OVERLAY IS CALLED BY HPPUT.
  77. *
  78.  #
  79. STOPIMS;
  80. #
  81.   EXTERNAL VARIABLES
  82. #
  83. XREF
  84. BEGIN
  85. PROC LOCLLCB; # LOCATE LLCB #
  86. PROC LOCNCNT; # LOCATE NCNT #
  87. PROC MGETS; # GET AN EMPTY BUFFER #
  88. PROC MCLRIL ;
  89. PROC MSETIL ;
  90. PROC MRELS; # RELEASE BUFFER #
  91. PROC OVLCALL; # LOAD AND EXECUTE AN OVERLAY #
  92. PROC XTRACE; # TRACE CALLS #
  93. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  94. END
  95. #
  96.   INTERNAL VARIABLES
  97. #
  98. ITEM
  99. BUFADDR, # BUFFER ADDRESS #
  100. LLCBAD, # LLCB ADDRESS #
  101. NCNTEAD, # NCNT ENTRY ADDRESS #
  102. INDEX, # FRONT-END INDEX #
  103. ACNBADDR, # ACNB ADDRESS #
  104. PITIDX, # PIT ENTRY INDEX #
  105. PRUBS, # PRU BLOCK SIZE #
  106. PTR,
  107. NEXT,
  108. CURRENT,
  109. I,J,N,
  110. TWIN; # TWIN QCB ADDRESS #
  111.  
  112. BASED ARRAY PRUNIPWD S(1); # TEMPLATE FOR NIP WORD IN PIT #
  113. BEGIN
  114. ITEM PRUNIPMFB U(0,00,06); # MINIMUM NO OF PRU BUFS #
  115. ITEM PRUNIPMAB U(0,06,06); # MAXIMUM NO OF PRU BUFS #
  116. ITEM PRUNIPNCA U(0,12,12); # CURRENT NO OF BUFFERS ASSIGNED#
  117. ITEM PRUNIPNC U(0,24,12); # CURRENT NO OF PRU CONNECTIONS #
  118. ITEM PRUNIPFPB U(0,42,18); # ADR OF FIRST BUF IN FREE CHAIN#
  119. END
  120.  
  121. BASED ARRAY PRUPIPWD S(1); # TEMPLATE FOR PIP WORD IN PIT #
  122. BEGIN
  123. ITEM PRUPIPNFB U(0,00,12); # NO OF BUFS IN FREE CHAIN #
  124. ITEM PRUPIPNRA U(0,12,12); # NO OF BUS NEEDED BY PIP #
  125. ITEM PRUPIPRPB U(0,42,18); # ADDR OF BUF TO RELEASE #
  126. END
  127.  
  128. # ******************************************************************** #
  129. BEGIN
  130.  
  131. CONTROL IFEQ DEBUG,1;
  132. XTRACE("HPRON") ;
  133. CONTROL FI;
  134.  
  135. P<ACB> = ACBADDR; # APPLICATION ACB ADDRESS #
  136. P<SUPMSG> = WLADDR + AIPHSIZE + ABHSIZE; # ADDRESS OF PRU/ON/R #
  137. PARAMP1 = 1 ; # INITIAL ERROR STATE #
  138. PARAMS1 = RPRU"N" ;
  139. #
  140.   CHECK IF A VALID PRU/ON/R SUPERVISORY MESSAGE
  141. #
  142. IF ATPRU[ACBAN[0]]
  143. THEN # LEGAL PRU APPLICATION SEND PRU/ON/R #
  144. BEGIN
  145.  
  146. # SEARCH FOR ACNB #
  147. BEGIN
  148. P<ACNT> = ACBACNT[0];
  149. ACNBADDR = 0;
  150. IF PRUACN[0] LQ ACNTHCN[0] AND PRUACN[0] GQ ACNTMINACN[0]
  151. THEN
  152. ACNBADDR = ACNTACNB[PRUACN[0] + ACNTHSIZE - ACNTMINACN[0]];
  153. IF ACNBADDR EQ 0
  154. OR PRUACN[0] EQ 0
  155. THEN
  156. BEGIN
  157. PARAMS1 = RPRU"CNV" ;
  158. GOTO HEXIT;
  159. END
  160. END
  161.  
  162. P<ACNB> = ACNBADDR; # ACNB ADDRESS #
  163. TWIN = ACNBNCNB[0]; # NCNB ADDRESS #
  164.  
  165. P<NCNB> = TWIN; # NCNB ADDRESS #
  166. IF NCNBNBO[0] NQ 0
  167. THEN
  168. BEGIN # STILL OUTSTANDING BLOCK COUNT #
  169. PARAMS1 = RPRU"COB" ; # RC = 5 #
  170. GOTO HEXIT ;
  171. END
  172.  
  173. IF NCNBHN[0] EQ 0
  174. OR NCNBTN[0] EQ 0
  175. THEN
  176. BEGIN # PRU/ON/R ON INTRA A-A #
  177. PARAMS1 = RPRU"CNB" ; # REJECT WITH REASON CODE 4 #
  178. GOTO HEXIT ; # GOTO SEND PRU/ON/A #
  179. END
  180. LOCLLCB(NCNBHN[0],NCNBTN[0],LLCBAD);
  181. P<LLCB> = LLCBAD ;
  182. PITIDX = LLCBPITIDX[0]; # PIT ENTRY INDEX #
  183. LOCNCNT(LLCBAD,NCNBCN[0],NCNTEAD);
  184. P<NCNT> = NCNTEAD ;
  185. PRUBS = PRUUPS[0] ;
  186. IF PRUBS EQ 0
  187. THEN
  188. PRUBS = PRUDPS[0] ;
  189. IF PRUBS EQ 0 OR INPPRU[PRUBS] EQ 0
  190. THEN
  191. BEGIN
  192. PARAMS1 = RPRU"CNB" ;
  193. GOTO HEXIT ;
  194. END
  195. IF NCNBID[0] EQ NCNBIDVALUE AND # NCNB #
  196. NCNBDT[0] NQ DT$CONS
  197. THEN
  198. BEGIN
  199. P<PRUNIPWD> = LOC(PITW5[PITIDX])-1; # 1 PRU BUF NIP WORD #
  200. P<PRUPIPWD> = LOC(PITW8[PITIDX])-1; # 1 PRU BUF PIP WORD #
  201. PRUNIPNC[PRUBS] = PRUNIPNC[PRUBS] + 1; # INCR NO OF PRU CN#
  202. IF PRUNIPNCA[PRUBS] EQ 0
  203. THEN # NO PRU BUFS CURRENTLY ASSIGNED#
  204. BEGIN # ALLOCATE DYNAMIC PRU BUFFERS #
  205. MSETIL(0) ; # SET INTER LOCK BIT #
  206. FOR I = PRUBS STEP -1 UNTIL 1
  207. DO
  208. BEGIN # LOOP FOR EACH TYPE OF PRU #
  209. IF PRUNIPNCA[I] EQ 0
  210. THEN
  211. BEGIN # NEEDS BUUFFERS #
  212. NEXT = 0; # LAST BUF HAS ZERO POINTER #
  213. N = PRUNIPMFB[PRUBS]; # MIN NO OF BUFS TO ALLOCATE #
  214. FOR J = 1 STEP 1 UNTIL N
  215. DO
  216. BEGIN # FIND MERPRU[I] BUFFER #
  217. MGETS(PBHSIZE + I*PRUSIZE + I,CURRENT,TRUE);
  218. # ALLOCATE BUFFER FOR EACH SIZE #
  219. # FOR 1 PRU BUFFER SIZE = 102 #
  220. # FOR 2 PRU BUFFER SIZE = 204 #
  221. # FOR 3 PRU BUFFER SIZE = 306 #
  222.  
  223. P<PRUBUFF> = CURRENT ; # SET UP THE BUF HEADER #
  224. PRUBDLFP[0] = NEXT; # PTR TO NEXT BUF IN FREE CHN #
  225. NEXT = CURRENT ;
  226. PRUBID[0] = PRUBIDVALUE ;
  227. PRUBPBS[0] = I - 1 ; # BUFFER SIZE IN PRU - 1 #
  228. PRUBTBA[0] = MSECS[0] ;
  229. PRUBUP[0] = TRUE; # SET USER PROCESSING BIT #
  230. PRUBEP[0] = TRUE; # SET ERROR PROCESSING BIT #
  231. PRUBFETL[0] = 2 ;
  232. PTR = P<PRUBUFF> + PBHSIZE - 1 ;
  233. PRUBFIRST[0] = PTR ;
  234. PRUBIN[0] = PTR ;
  235. PRUBOUT[0] = PTR ;
  236. PRUBLIMIT[0] = P<PRUBUFF> + PRUBBS[0] ;
  237. END # FIND BUFFERS #
  238. PRUNIPFPB[I] = CURRENT; # ADDR OF 1ST BUF IN CHAIN #
  239. PRUNIPNCA[I] = N; # CUR NO OF PRU BUFS ASSIGNED #
  240. PRUPIPNRA[I] = N; # CUR NO OF PRU BUFS NEEDED #
  241. END # BUFFER NEEDED #
  242. END
  243. MCLRIL ;
  244. END # #
  245.  
  246. #
  247.   GET EMPTY BUFFER FOR A PCNB
  248. #
  249. MGETS(PCNBSIZE, BUFADDR, TRUE);
  250. P<PCNB> = BUFADDR; # PCNB ADDRESS #
  251. #
  252.   FORMAT A PCNB FROM THE NCNB
  253. #
  254. PCNBID[0] = LCNBIDVALUE ; # SET TO INTERMED IDVALUE #
  255. PCNBR0[0] = NCNBR0[0] ;
  256. PCNBR1[0] = NCNBR1[0] ;
  257. PCNBSTS[0]= NCNBSTS[0];
  258. PCNBNBTE[0] = NCNBNBTE[0] ;
  259. PCNBTNAM[0] = NCNBTNAM[0] ;
  260. PCNBPBS[0] = PRUBS ;
  261. PCNBACNB[0] = ACNBADDR; # ACNB ADDRESS #
  262. IF PRUFL1[0]
  263. THEN
  264. BEGIN # MSG FROM FILE TRANSFER APPLICATION #
  265. PCNBXFR[0] = PRUFL1[0] ;
  266. PCNBCWS[0] = PRUCWS[0] ;
  267. PCNBKVL[0] = PRUICKVAL[0] ;
  268. PCNBXDD[0] = PRUDD[0] ;
  269. END # MSG FROM FILE TRANSFER APPLICATION #
  270. #
  271.   UPDATE NCNT ENTRY FOR THIS NEW PCNB
  272. #
  273. NCNTNCNB[0] = BUFADDR ; # RESET PCNB ADDRESS IN NCNT #
  274. # BATCH STREAM STATE AND BLOCK HANDLE STATE WILL BE SET TO PRU WHEN #
  275. # SPECIAL OUTBOUND BUFFER (ID=PRUSPECID) GETS RELEASED IN XEXEC #
  276.  
  277. IF PRUUPS[0] NQ 0
  278. THEN
  279. PCNBREC[0] = TRUE ; # RECEIVING MODE #
  280.  
  281. IF NCNBDBSN[0] LS 7
  282. THEN
  283. NCNTNOB[0] = NCNBDBSN[0] + 1 ; # NEXT OUTPUT BSN #
  284. ELSE
  285. NCNTNOB[0] = 1 ;
  286. NCNTOIB[0] = 0 ;
  287. NCNTOOB[0] = 0 ;
  288. #
  289.   RELEASE NETWORK-SIDE NCNB
  290. #
  291. IF NCNBACKQ[0] NQ 0
  292. THEN # ACKNOWLEDGMENT QUEUE EXISTS #
  293. MRELS(NCNBACKQ[0]); # RELEASE ACK-Q #
  294.  
  295. MRELS(TWIN); # RELEASE NCNB #
  296. #
  297.   UPDATE NCNB/NCNT POINTER OF HOST-SIDE ACNB
  298. #
  299. P<ACNB> = ACNBADDR; # ACNB ADDRESS #
  300. ACNBNCNB[0] = BUFADDR; # SET TO PCNB ADDRESS #
  301. #
  302.   LINK PCNB TO PCNB RING.
  303.   UPDATE PQR POINTERS IN NBT
  304. #
  305. FOR INDEX = 0 STEP NBTFETNO UNTIL NBTMAXID
  306. DO
  307. BEGIN
  308. IF NBTIUF[INDEX] AND
  309. NBTHN[INDEX] EQ PCNBHN[0]
  310. THEN
  311. BEGIN
  312. PCNBPCFP[0] = LOC(NBTFIRST[INDEX]);
  313. # SET PCNB FORWARD POINTER #
  314.  
  315. IF NBTPCRF[INDEX] EQ 0
  316. THEN # NO EXISTING PCNB RING #
  317. BEGIN
  318. PCNBPCBP[0] = LOC(NBTFIRST[INDEX]);# SET BACK PTR #
  319. NBTPCRF[INDEX] = BUFADDR; # SET PQR HEAD PTR IN NBT#
  320. END
  321.  
  322. ELSE # PCNB-RING ALREADY EXISTS #
  323. BEGIN
  324. PCNBPCBP[0] = NBTPCRB[INDEX]; # SET PQR BACK PTR #
  325. P<PCNB> = NBTPCRB[INDEX];# PREVIOUS LAST MEMBER PQR#
  326. PCNBPCFP[0] = BUFADDR; # LINK NEW PCNB TO PQR #
  327. END
  328.  
  329. NBTPCRB[INDEX] = BUFADDR;# UPDATE PQR TAIL PTR IN HNT#
  330. #
  331.   INCREMENT COUNT OF ACTIVE PRU CONNECTIONS
  332. #
  333. LLCBNPC[0] = LLCBNPC[0] + 1 ;
  334. ACBNPRU[0] = ACBNPRU[0] + 1 ;
  335. PARAMP1 = 0 ; # SIGNAL FOR COMPLETION #
  336. PARAMP2 = BUFADDR ;
  337. END
  338. END
  339. END
  340. ELSE
  341. BEGIN
  342. PARAMS1 = RPRU"CNV" ;
  343. GOTO HEXIT ;
  344. END
  345. END
  346. ELSE
  347. BEGIN # ILLEGAL APPLICATION SEND PRU/ON/R #
  348. PARAMS1 = RPRU"CNS" ;# REASON IS 1 IN PRU/ON/A #
  349. GOTO HEXIT ;
  350. END # ILLEGAL APPLICATION SEND PRU/ON/R #
  351. HEXIT: BEGIN
  352. PARAMS2 = PRUACN[0]; # ADDRESS OF ACNB FOR CONNECTION#
  353. OVLNAME = HPRUONXP; # NAME OF OVERLAY TO LOAD #
  354. IF PARAMS1 NQ 0
  355. THEN # PRU/ON/A IS BEING RETURNED #
  356. BEGIN
  357. IF ACBERCNT[0] LS MAXLGERR
  358. THEN # OKAY TO GENERATE PRU/ON/A #
  359. BEGIN
  360. OVLCALL; # LAOD AND EXECUTE OVERLAY #
  361. END
  362. ELSE # REACHED MAX NO OF ERR SUP MSG #
  363. BEGIN
  364. IF ACBERCNT[0] EQ MAXLGERR
  365. THEN # REACHED MAX NO OF ERR SUP MSG #
  366. BEGIN
  367. PARAMS1 = RLG"IAL"; # ERR/LGL RC FOR TOO MANY ERRORS#
  368. OVLNAME = HLGLERRP; # NAME OF OVERLAY TO LOAD #
  369. OVLCALL; # LAOD AND EXECUTE OVERLAY #
  370. END
  371. END
  372. END
  373. ELSE # PRU/ON/N BEING RETURNED #
  374. BEGIN
  375. OVLCALL; # LAOD AND EXECUTE OVERLAY #
  376. END
  377. END
  378.  
  379. GOTO RJMAIN;
  380. END
  381. TERM
cdc/nos2.source/nam5871/hpruon.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator