User Tools

Site Tools


cdc:nos2.source:nam5871:relacb

RELACB

Table Of Contents

  • [00016] PRGM RELACB
  • [00076] PROC MREDUCE
  • [00077] PROC MRELS
  • [00078] PROC OMSG
  • [00079] PROC ABORT
  • [00080] PROC XTRACE
  • [00081] PROC BLDKWL

Source Code

RELACB.txt
  1. *DECK RELACB
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT ACNT
  5. USETEXT APPSTAT
  6. USETEXT AT
  7. USETEXT DUMPFLG
  8. USETEXT DRHDR
  9. USETEXT FREETAB
  10. USETEXT PARAMS
  11. USETEXT PT
  12. USETEXT PWL
  13. USETEXT STATTAB
  14. USETEXT KDIS
  15. USETEXT KSTTAB
  16. PRGM RELACB; # RELEASE APPLICATION ACB AND ACNT #
  17.  
  18. STARTIMS;
  19. #
  20. *1DC RELACB
  21. *
  22. * 1. PROC NAME AUTHOR DATE
  23. * RELACB N. NICHOLAS 08/26/80
  24. *
  25. * 2. FUNCTIONAL DESCRIPTION.
  26. *
  27. * THIS ROUTINE IS RESPONSIBLE FOR RELEASING THE
  28. * ACB FROM THE APPLICATION TABLE (AT).
  29. *
  30. * 3. METHOD USED.
  31. *
  32. * RELEASE WORKLISTS,DATA RING, ACB,ACNT AND CLEAR THE
  33. * ENTRY IN THE APPLICATION TABLE (AT)
  34. *
  35. * 4. ENTRY PARAMETERS.
  36. *
  37. * PARAMS1 = AN OF ACB TO BE RELEASED.
  38. *
  39. * 5. EXIT PARAMETERS.
  40. *
  41. *
  42. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  43. *
  44. * ACB ACNT AT APPSTAT DRHDR
  45. * NIPDEF OSSIZE
  46. * PARAMS PT STATTAB
  47. * KDIS
  48. *
  49. * 7. ROUTINES AND OVERLAYS CALLED.
  50. *
  51. * MRELS RELEASE BUFFER SPACE
  52. * OMSG ISSUE DAYFILE MESSAGE
  53. * XTRACE TRACES CALLS
  54. * KDEL DELETE A LINE FROM THE STATUS DISPLAY
  55. * MREDUCE REDUCE BUFFER SIZE
  56. *
  57. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION.
  58. *
  59. * *NIP/RELACB - BAD AN*
  60. *
  61. * THIS PROGRAM IS A SECONDARY OVERLAY LOADED BY SUBROUTINE
  62. * OVLCALL. WHEN EXECUTION IS COMPLETED, A JUMP IS MADE TO
  63. * LOCATION RJMAIN TO RETURN TO THE CALLING PROGRAM.
  64. *
  65. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE SECONDARY
  66. *CALL OSSIZE
  67. *
  68. * THIS OVERLAY IS CALLED BY HPNOFFN, HCSTTP, AND HPNON.
  69. *
  70.  #
  71. STOPIMS;
  72. #
  73.   EXTERNAL VARIABLES
  74. #
  75. XREF BEGIN
  76. PROC MREDUCE; # REDUCE MEMORY BUFFER CELLS #
  77. PROC MRELS; # RELEASE BUFFER SPACE #
  78. PROC OMSG; # ISSUE DAYFILE MESSAGE #
  79. PROC ABORT ; # ABORT WITH INTERNAL ERROR #
  80. PROC XTRACE; # TRACE CALL #
  81. PROC BLDKWL; # FORMAT KWL TO DELETE APP ENTRY FROM ST #
  82. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  83. END
  84. #
  85.   INTERNAL VARIABLES
  86. #
  87. ITEM CURR I; # ADDRESS OF CURRENT ACB #
  88. ITEM HANFOUND B; # FLAG-HIGHEST APPLIC. NO. FOUND #
  89. ITEM INDX I; # INDEX INTO ( A T ) #
  90. ITEM NEXT I; # ADDRESS OF NEXT ACB #
  91. ITEM NEWSIZE I; # REQUESTED BUFFER SIZE #
  92. #
  93.  DAYFILE MSG TO ISSUE IF AN IS BAD
  94. #
  95. CONTROL IFEQ DEBUG,1;
  96. ARRAY ERRMSG P(3);
  97. BEGIN
  98. ITEM BADMSG C(0,0,20) = ["NIP/SRELACB - BAD AN"];
  99. ITEM ENDMSG U(2,0,WL) = [0];
  100. END
  101. CONTROL FI;
  102.  
  103. #**********************************************************************#
  104. BEGIN
  105. CONTROL IFEQ DEBUG,1 ;
  106. XTRACE("RLACB") ;
  107. CONTROL FI;
  108.  
  109. P<ACB> = ATACBA[PARAMS1]; # APPL CONTROL BLOCK POINTER #
  110.  
  111. CONTROL IFEQ DEBUG,1;
  112. IF PARAMS1 GR ATHAN[0] OR
  113. P<ACB> EQ 0
  114. THEN #SHOULD NEVER OCCUR #
  115. BEGIN
  116. OMSG(ERRMSG,0); # ISSUE ERROR DAYFILE MESSAGE #
  117. ABORT(0,0) ; # ABORT NIP #
  118. END
  119. CONTROL FI;
  120.  
  121. IF ACBWLFWA[0] NQ 0
  122. THEN # THERE IS A NWL TO RELEASE #
  123. BEGIN
  124. P<DRHDRWD> = ACBWLFWA[0]; # FWAO OF NWL #
  125. BLKBS[0] = ACBWLLWA[0] - P<DRHDRWD> + 1; # NWL BLOCK SIZE #
  126. MRELS(P<DRHDRWD>);
  127. END
  128.  
  129. IF ACBFLIST[0] NQ 0
  130. THEN # THERE IS A FUNCTION LIST #
  131. MRELS(ACBFLIST[0]) ; # RELEASE IT #
  132.  
  133. IF ACBPWLFP[0] NQ 0
  134. THEN # THERE IS A PWL #
  135. BEGIN # RELEASE THE PWL #
  136. CURR = ACBPWLFP[0] ; # CURRENT ENTRY TO BE RELEASED #
  137. FOR CURR = CURR WHILE CURR NQ 0
  138. AND CURR NQ LOC(ACBPWLFP[0])
  139. DO
  140. BEGIN # LOOP THROUGH THE RING #
  141. P<PWLHDR> = CURR ;
  142. CURR = PWLNPWLFP[0] ;
  143. MRELS(P<PWLHDR>) ;
  144. END
  145. END # RELEASE THE PWL #
  146.  
  147.  
  148. # RELEASE DATA RING AND CLEAR AT ENTRY #
  149.  
  150. P<DRHDRWD> = 0;
  151. CURR = ACBDRFP[0]; # FIRST ENTRY IN DATA RING #
  152. FOR CURR = CURR WHILE CURR NQ 0
  153. AND CURR NQ LOC(ACBDRFP[0])
  154. DO
  155. BEGIN
  156. NEXT = NEXTPTR[CURR]; # NEXT ENTRY IN DATA RING #
  157. MRELS(CURR);
  158. CURR = NEXT;
  159. END
  160. #
  161.   RELEASE APPLICATIONS ACNT TABLE.
  162. #
  163. P<ACNT> = ACBACNT[0];
  164.  
  165. MRELS(P<ACNT>);
  166. #
  167.   CLEAR APPLICATIONS ENTRY IN THE ( A T ).
  168. #
  169. ATENTRYW[PARAMS1] = 0 ; # FREE UP AT ENTRY #
  170. IF ATHAN[0] EQ PARAMS1
  171. THEN # UPDATE HIGHEST APPLICATION NUMBER #
  172. BEGIN
  173. HANFOUND = FALSE; # INITIALIZE FLAG-HIGHEST AN FOUND #
  174. FOR INDX = ATHAN[0]-1 STEP -1 WHILE NOT HANFOUND DO
  175. BEGIN
  176. IF ATACBA[INDX] NQ 0
  177. THEN
  178. BEGIN
  179. HANFOUND = TRUE; # SET FLAG-HIGHEST AN FOUND #
  180. ATHAN[0] = INDX; # UPDATE HIGHEST APPLIC NO. FOUND #
  181. END
  182. END
  183. END
  184.  
  185. IF KDST[0]
  186. THEN # STATUS DISPLAY ON, DELETE APP ENTRY FROM ST #
  187. BLDKWL(KST"APP",ACBKNDX[0],0,KDELIDVALUE);
  188.  
  189. ATNFE[0] = ATNFE[0] + 1; # INCREMENT NO. OF FREE ENTRIES #
  190. MRELS(P<ACB>); # RELEASE ACB #
  191. CONTROL IFEQ STAT,1 ;
  192. ST$ACBX = ST$ACBX + 1 ;
  193. CONTROL FI ;
  194. #
  195.   CHECK IF FREE ( A T ) BUFFERS CAN BE RETURNED
  196. #
  197. IF ATBS[0] GR ATSIZE
  198. THEN # CURRENT BS GREATER THAN INITIAL #
  199. IF ATNFE[0] GQ MINATFE
  200. THEN # REQUIREMENT FOR MIN FREE ENT MET #
  201. IF (( ATBS[0] - ATHSIZE ) - ATHAN[0] ) GQ ATESIZE
  202. THEN # LAST ATESIZE ENTRIES ARE FREE #
  203. BEGIN
  204. NEWSIZE = ATBS[0] - ATESIZE; # NEW BUFFER SIZE #
  205. MREDUCE(P<AT>,NEWSIZE); # SHRINK ( A T ) #
  206. ATNFE[0] = ATNFE[0] - ATESIZE; # UPDATE NO. FREE ENT #
  207. END
  208. CONTROL IFEQ STAT,1; # STATISTICS ON #
  209. ST$ACBX = ST$ACBX + 1; # INCREMENT *ACB-S RELEASED* #
  210. CONTROL FI;
  211.  
  212. GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
  213. END
  214. TERM
cdc/nos2.source/nam5871/relacb.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator