*DECK EXXFLMG
PROC XFLMGR;
BEGIN # XFLMGR #
*IF DEF,IMS
#
**
*
* 1. PROC NAME AUTHOR DATE
* XFLMGR M. D. PICKARD 76/12/07
*
* 2. FUNCTIONAL DESCRIPTION
* XFLMGR WILL MANAGE THE EXCESS FIELD LENGTH FOR THE TSB
* MANAGER. THE TSBIT SIZE IS REDUCED IF POSSIBLE.
*
* 3. METHOD USED
* THE PROCEDURE IS USED IN CONJUCTION WITH THE SUPERVISION
* EXECUTIVE ( EXEC) MAIN-LOOP. WHENEVER THE CONTROL POINT
* IS IN AN IDLE CONDITION, THE EXEC MAIN-LOOP (EXMAIN) WILL
* CALL XFLMGR TO CHECK IF THERE CAN BE A REDUCTION IN THE
* FL OF THE CONTROL POINT. XFLMGR DOES THIS BY CALLING
* SQUEEZE TO MOVE VARIABLE POSITION TSB"S TO LOW CORE
* ADDRESSES, AND RETURNING ANY EXCESS FIELD LENGTH. EXCESS
* FIELD LENGTH IS DETERMINE BY THE SIZE OF THE HIGHEST
* ADDRESS FREE TSB.
* IF THE LENGTH OF THE TSBIT IS LARGER THAN TSBITL, THEN AS
* LONG AS THERE ARE CONSECUTIVE FREE ENTRIES AT THE END OF
* THE TSBIT, THE SIZE OF THE TSBIT WILL BE REDUCED. XFLMGR WILL
* NOT REDUCE THE SIZE OF THE TSBIT SO THAT THE NUMBER OF FREE
* TSBN"S GOES DOWN TO ( TSBITL / 2).
*
* 4. ENTRY PARAMETERS
* BIGFREE (TSBM GLOBAL) BIGGEST FREE TSB SIZE
* CTSBLWA (TSBM GLOBAL) CURRENT TSB AREA LAST WORD ADDRESS
* PTSBLWA (TSBM GLOBAL) PRIMARY TSB AREA LAST WORD ADDRESS
* TSBFWA (TSBM GLOBAL ) TSB AREA FIRST WORD ADDRESS
*
* 5. EXIT PARAMETERS
* CTSBLWA - THESE TSBM GLOBAL PARAMETER
* BIGFREE - MIGHT CHANGE IS THE TSB AREA
* PTSBLWA - IS CHANGED BY CALLING SQUEEZE
* TSBFWA - OR MEMREQ
*
* 6. COMDECKS CALLED
* TSBDEFS TSB MANAGER SYMPLL DEFS
* TSBBASE TSB MANAGER BASED ARRAY DEFINITIONS
* TSBDATA TSB MANAGER DATA AREA DEFINITIONS
*
* 7. ROUTINES CALLED
* SQUEEZE CONSOLIDATE MOVEABLE TSB"S
* MEMREQ REQUEST CHANGE IN FIELD LENGTH
* FIRSTF SET FFFWA TO CURRENT FIRST FREE TSB ADDR.
* GETBIG GETS SIZE OF BIGGEST FREE TSB
*
* 8. DAYFILE MESSAGES
* NONE.
*
#
*ENDIF
CONTROL NOLIST; # STOPS LIST TSBDEFS, TSBBASE, TSBDATA #
*CALL CYBERDEFS
*CALL TSBDEFS
*CALL TSBBASE
*CALL TSBDATA
CONTROL LIST;
XREF
BEGIN
PROC FIRSTF;
PROC GETBIG;
PROC GETTSB;
PROC GIVETSB;
PROC MEMREQ;
PROC MOVEI;
PROC SQUEEZE;
END
ITEM
FWA U, # USED FOR TSBIT TSBN IF TSBIT IS SHRUNK #
HIBUSY U, # USED TO CONTAIN HIGHEST BUSY TSBN #
IDENT U, # USED TO CONTAIN TSBIT TSBN #
TEMP U; # TEMPORARY UNSIGNED INTEGER #
# SEE IF TSBIT SIZE CAN BE REDUCED #
HIBUSY = 0; # INITIALIZE HIGHEST BUSY TSBN #
FOR TEMP = 1 STEP 1 UNTIL LENGTH[0] - 1 DO
BEGIN # FIND THE HIGHEST BUSY TSBN #
IF TBUSY[TEMP]
THEN # THIS ONE IS NOW THE HIGHEST BUSY TSBN #
HIBUSY = TEMP;
END
IF ( HIBUSY + 1 ) GR TSBITL
THEN # CANT REDUCE TO TSBITL #
TEMP = HIBUSY + 2; # USE NXT FREE (PLUS HDR) AS REDUCE-TO #
# SIZE#
ELSE # USE TSBITL AS REDUCE-TO SIZE #
TEMP = TSBITL;
IF ( NUMFREE[0] - ( LENGTH[0] - TEMP )) LS ( TSBITL /2 )
THEN # CANT LET NUMFREE GO BELOW TSBITL/2 #
TEMP = TEMP + ( TSBITL / 2 ); # INCREASE REDUCE-TO SIZE #
IF TEMP LQ ( LENGTH[0] - TSBITL )
THEN # WE WILL REDUCE THE TSBIT SIZE #
BEGIN
NUMFREE[0] = NUMFREE[0] - ( LENGTH[0] - TEMP ); # NEW NUMFREE #
FWDPTR[TEMP-1] = 0; # SET NEW END OF CHAIN POINTER #
IDENT = 1; # TSBIT TSBN #
GETTSB(TEMP+TSBHDRL,IDENT,FWA); # GET A SMALLER TSB #
TTSBFWA[IDENT] = FWA; # SET TSBIT TSB ADDRESS IN TSBIT #
MOVEI(TEMP,LOC(TSBIT),FWA+TSBHDRL); # MOVE TSBIT #
GIVETSB(LOC(TSBIT) - TSBHDRL); # GIVE BACK OLD TSB #
P<TSBIT> = FWA + TSBHDRL; # RESET TSBIT BASED ARRAY POINTER #
LENGTH[0] = TEMP; # NEW LENGTH OF TSBIT #
P<BTSBHDR> = TTSBFWA[1];
BNOTMOV[0] = FALSE; # MAKE TSBIT MOVEABLE #
END
IF ( BIGFREE NQ 0 ) AND ( PTSBLWA LS CTSBLWA )
THEN # FREE SPACE AVAIL, CURR. FL NOT A PRIM. #
BEGIN # FL, MAY BE EXCESS FL #
SQUEEZE(0,TEMP); # SQUEEZE MOVEABLE TSB"S #
IF TEMP NQ CTSBLWA
THEN # LAST FREE TSB IS NOT AT VERY END #
BEGIN # SEE IF THERE IS ANY TO RELEASE #
P<BTSBHDR> = TEMP; # SET A HDR. FORMAT ON THE LAST FREE TSB #
IF BTSBL[0] GQ MRU
THEN # THERE IS ENOUGH TO RELEASE #
BEGIN
IF ( CTSBLWA - BTSBL[0] ) LS PTSBLWA
THEN # CANT RELEASE IT ALL #
TEMP = ( CTSBLWA - PTSBLWA ) / MRU; # JUST THIS MUCH #
ELSE
TEMP = BTSBL[0] / MRU; # RELEASE AS MANY MRU"S AS POSS. #
BTSBL[0] = (BTSBL[0] - (TEMP * MRU)); # NEW LENGTH OF TSB #
IF BTSBL[0] NQ 0
THEN # BUILD ZERO LENGTH FREE TSB AT END #
BEGIN
P<FTSBHDR> = LOC(BTSBHDR) + BTSBL[0];
FBUSY[0] = FALSE; # SET NOT BUSY #
FNOTMOV[0] = FALSE; # SET MOVEABLE #
FHDRRSV[0] = 0; # CLEAR RESERVE AREA #
FIDENT[0] = 0; # CLEAR IDENT FIELD #
FPTSBL[0] = BTSBL[0]; # PREVIOUS TSB LENGTH #
FTSBL[0] = 0; # ZERO LENGTH #
END
MEMREQ(-TEMP); # REDUCE THE FL AS CALCULATED #
END
END
FIRSTF; # RE-ESTABLISH FIRST FREE TSB FWA (FFFWA) #
GETBIG ; #RE-ESTABLISH BIGGEST FREE TSB #
END
RETURN;
END TERM # XFLMGR #