User Tools

Site Tools


cdc:nos2.source:nam5871:exxflmg

EXXFLMG

Table Of Contents

Source Code

EXXFLMG.txt
  1. *DECK EXXFLMG
  2. PROC XFLMGR;
  3. BEGIN # XFLMGR #
  4. *IF DEF,IMS
  5. #
  6. **
  7. *
  8. * 1. PROC NAME AUTHOR DATE
  9. * XFLMGR M. D. PICKARD 76/12/07
  10. *
  11. * 2. FUNCTIONAL DESCRIPTION
  12. * XFLMGR WILL MANAGE THE EXCESS FIELD LENGTH FOR THE TSB
  13. * MANAGER. THE TSBIT SIZE IS REDUCED IF POSSIBLE.
  14. *
  15. * 3. METHOD USED
  16. * THE PROCEDURE IS USED IN CONJUCTION WITH THE SUPERVISION
  17. * EXECUTIVE ( EXEC) MAIN-LOOP. WHENEVER THE CONTROL POINT
  18. * IS IN AN IDLE CONDITION, THE EXEC MAIN-LOOP (EXMAIN) WILL
  19. * CALL XFLMGR TO CHECK IF THERE CAN BE A REDUCTION IN THE
  20. * FL OF THE CONTROL POINT. XFLMGR DOES THIS BY CALLING
  21. * SQUEEZE TO MOVE VARIABLE POSITION TSB"S TO LOW CORE
  22. * ADDRESSES, AND RETURNING ANY EXCESS FIELD LENGTH. EXCESS
  23. * FIELD LENGTH IS DETERMINE BY THE SIZE OF THE HIGHEST
  24. * ADDRESS FREE TSB.
  25. * IF THE LENGTH OF THE TSBIT IS LARGER THAN TSBITL, THEN AS
  26. * LONG AS THERE ARE CONSECUTIVE FREE ENTRIES AT THE END OF
  27. * THE TSBIT, THE SIZE OF THE TSBIT WILL BE REDUCED. XFLMGR WILL
  28. * NOT REDUCE THE SIZE OF THE TSBIT SO THAT THE NUMBER OF FREE
  29. * TSBN"S GOES DOWN TO ( TSBITL / 2).
  30. *
  31. * 4. ENTRY PARAMETERS
  32. * BIGFREE (TSBM GLOBAL) BIGGEST FREE TSB SIZE
  33. * CTSBLWA (TSBM GLOBAL) CURRENT TSB AREA LAST WORD ADDRESS
  34. * PTSBLWA (TSBM GLOBAL) PRIMARY TSB AREA LAST WORD ADDRESS
  35. * TSBFWA (TSBM GLOBAL ) TSB AREA FIRST WORD ADDRESS
  36. *
  37. * 5. EXIT PARAMETERS
  38. * CTSBLWA - THESE TSBM GLOBAL PARAMETER
  39. * BIGFREE - MIGHT CHANGE IS THE TSB AREA
  40. * PTSBLWA - IS CHANGED BY CALLING SQUEEZE
  41. * TSBFWA - OR MEMREQ
  42. *
  43. * 6. COMDECKS CALLED
  44. * TSBDEFS TSB MANAGER SYMPLL DEFS
  45. * TSBBASE TSB MANAGER BASED ARRAY DEFINITIONS
  46. * TSBDATA TSB MANAGER DATA AREA DEFINITIONS
  47. *
  48. * 7. ROUTINES CALLED
  49. * SQUEEZE CONSOLIDATE MOVEABLE TSB"S
  50. * MEMREQ REQUEST CHANGE IN FIELD LENGTH
  51. * FIRSTF SET FFFWA TO CURRENT FIRST FREE TSB ADDR.
  52. * GETBIG GETS SIZE OF BIGGEST FREE TSB
  53. *
  54. * 8. DAYFILE MESSAGES
  55. * NONE.
  56. *
  57. #
  58. *ENDIF
  59. CONTROL NOLIST; # STOPS LIST TSBDEFS, TSBBASE, TSBDATA #
  60. *CALL CYBERDEFS
  61. *CALL TSBDEFS
  62. *CALL TSBBASE
  63. *CALL TSBDATA
  64. CONTROL LIST;
  65. XREF
  66. BEGIN
  67. PROC FIRSTF;
  68. PROC GETBIG;
  69. PROC GETTSB;
  70. PROC GIVETSB;
  71. PROC MEMREQ;
  72. PROC MOVEI;
  73. PROC SQUEEZE;
  74. END
  75. ITEM
  76. FWA U, # USED FOR TSBIT TSBN IF TSBIT IS SHRUNK #
  77. HIBUSY U, # USED TO CONTAIN HIGHEST BUSY TSBN #
  78. IDENT U, # USED TO CONTAIN TSBIT TSBN #
  79. TEMP U; # TEMPORARY UNSIGNED INTEGER #
  80.  
  81. # SEE IF TSBIT SIZE CAN BE REDUCED #
  82.  
  83. HIBUSY = 0; # INITIALIZE HIGHEST BUSY TSBN #
  84. FOR TEMP = 1 STEP 1 UNTIL LENGTH[0] - 1 DO
  85. BEGIN # FIND THE HIGHEST BUSY TSBN #
  86. IF TBUSY[TEMP]
  87. THEN # THIS ONE IS NOW THE HIGHEST BUSY TSBN #
  88. HIBUSY = TEMP;
  89. END
  90. IF ( HIBUSY + 1 ) GR TSBITL
  91. THEN # CANT REDUCE TO TSBITL #
  92. TEMP = HIBUSY + 2; # USE NXT FREE (PLUS HDR) AS REDUCE-TO #
  93. # SIZE#
  94. ELSE # USE TSBITL AS REDUCE-TO SIZE #
  95. TEMP = TSBITL;
  96. IF ( NUMFREE[0] - ( LENGTH[0] - TEMP )) LS ( TSBITL /2 )
  97. THEN # CANT LET NUMFREE GO BELOW TSBITL/2 #
  98. TEMP = TEMP + ( TSBITL / 2 ); # INCREASE REDUCE-TO SIZE #
  99. IF TEMP LQ ( LENGTH[0] - TSBITL )
  100. THEN # WE WILL REDUCE THE TSBIT SIZE #
  101. BEGIN
  102. NUMFREE[0] = NUMFREE[0] - ( LENGTH[0] - TEMP ); # NEW NUMFREE #
  103. FWDPTR[TEMP-1] = 0; # SET NEW END OF CHAIN POINTER #
  104. IDENT = 1; # TSBIT TSBN #
  105. GETTSB(TEMP+TSBHDRL,IDENT,FWA); # GET A SMALLER TSB #
  106. TTSBFWA[IDENT] = FWA; # SET TSBIT TSB ADDRESS IN TSBIT #
  107. MOVEI(TEMP,LOC(TSBIT),FWA+TSBHDRL); # MOVE TSBIT #
  108. GIVETSB(LOC(TSBIT) - TSBHDRL); # GIVE BACK OLD TSB #
  109. P<TSBIT> = FWA + TSBHDRL; # RESET TSBIT BASED ARRAY POINTER #
  110. LENGTH[0] = TEMP; # NEW LENGTH OF TSBIT #
  111. P<BTSBHDR> = TTSBFWA[1];
  112. BNOTMOV[0] = FALSE; # MAKE TSBIT MOVEABLE #
  113. END
  114. IF ( BIGFREE NQ 0 ) AND ( PTSBLWA LS CTSBLWA )
  115. THEN # FREE SPACE AVAIL, CURR. FL NOT A PRIM. #
  116. BEGIN # FL, MAY BE EXCESS FL #
  117. SQUEEZE(0,TEMP); # SQUEEZE MOVEABLE TSB"S #
  118. IF TEMP NQ CTSBLWA
  119. THEN # LAST FREE TSB IS NOT AT VERY END #
  120. BEGIN # SEE IF THERE IS ANY TO RELEASE #
  121. P<BTSBHDR> = TEMP; # SET A HDR. FORMAT ON THE LAST FREE TSB #
  122. IF BTSBL[0] GQ MRU
  123. THEN # THERE IS ENOUGH TO RELEASE #
  124. BEGIN
  125. IF ( CTSBLWA - BTSBL[0] ) LS PTSBLWA
  126. THEN # CANT RELEASE IT ALL #
  127. TEMP = ( CTSBLWA - PTSBLWA ) / MRU; # JUST THIS MUCH #
  128. ELSE
  129. TEMP = BTSBL[0] / MRU; # RELEASE AS MANY MRU"S AS POSS. #
  130. BTSBL[0] = (BTSBL[0] - (TEMP * MRU)); # NEW LENGTH OF TSB #
  131. IF BTSBL[0] NQ 0
  132. THEN # BUILD ZERO LENGTH FREE TSB AT END #
  133. BEGIN
  134. P<FTSBHDR> = LOC(BTSBHDR) + BTSBL[0];
  135. FBUSY[0] = FALSE; # SET NOT BUSY #
  136. FNOTMOV[0] = FALSE; # SET MOVEABLE #
  137. FHDRRSV[0] = 0; # CLEAR RESERVE AREA #
  138. FIDENT[0] = 0; # CLEAR IDENT FIELD #
  139. FPTSBL[0] = BTSBL[0]; # PREVIOUS TSB LENGTH #
  140. FTSBL[0] = 0; # ZERO LENGTH #
  141. END
  142. MEMREQ(-TEMP); # REDUCE THE FL AS CALCULATED #
  143. END
  144. END
  145. FIRSTF; # RE-ESTABLISH FIRST FREE TSB FWA (FFFWA) #
  146. GETBIG ; #RE-ESTABLISH BIGGEST FREE TSB #
  147. END
  148. RETURN;
  149. END TERM # XFLMGR #
cdc/nos2.source/nam5871/exxflmg.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator