*DECK EXTINIT
PROC TSBINIT;
BEGIN # TSBINIT #
*IF DEF,IMS
#
**
*
* 1. PROC NAME AUTHOR DATE
* TSBINIT M. D. PICKARD 77/01/03
*
* 2. FUNCTIONAL DESCRIPTION
* TSBINIT WILL PERFORM THE INITIALIZATION OF THE DYNAMIC
* MEMORY FOR THIS CONTROL POINT SO THAT THE TSB MANAGER
* CAN MANAGE THIS AREA.
*
* 3. METHOD USED
* THE EXISTANCE OF A 54 TABLE IS ESTABLISHED. ENOUGH FIELD
* LENGTH FOR ANY OVERLAY AND THE TSB AREA IS REQUESTED. THE
* INITIAL TSB AREA IS SET UP TO CONTAIN THE INITIAL TSB
* INFORMATION TABLE (TSBIT) AND A FREE TSB.
*
* 4. ENTRY PARAMETERS
* HHA FROM LOADER 54 TABLE, HIGHEST HIGH ADDRESS
*
* 5. EXIT PARAMETERS
* NONE.
*
* 6. COMDECKS CALLED
* TSBDEFS TSB MANAGER SYMPL DEFS
* TSBBASE TSB MANAGER BASED ARRAY DEFINITIONS
* TSBDATA TSB MANAGER DATA AREA DEFINITIONS
*
* 7. ROUTINES CALLED
* ABORT ABORT THE CONTROL POINT, GOES TO EXIT
* MEMORY REQUESTS MEMORY FROM OPERATING SYSTEM
* MESSAGE ISSUE DAYFILE MESSAGES
*
* 8. DAYFILE MESSAGES
* "54 TABLE NOT PRESENT" INFORMATIVE MESSAGE
*
#
*ENDIF
CONTROL NOLIST; # STOP LISTING OF TSBM COMMON DECKS #
*CALL CYBERDEFS
*CALL TSBDEFS
*CALL TSBBASE
*CALL TSBDATA
CONTROL LIST;
XREF
BEGIN
PROC ABORT;
PROC MESSAGE;
PROC MEMORY;
PROC ZERO ;
END
DEF LDADDR # O"100" #; # LOAD ADDRESS #
DEF LOCAL # 3 #; # SEND MESSAGE TO LOCAL DAYFILE #
DEF ITSBSIZ # ( 2 * TSBITL ) #; # INITIAL TSB AREA SIZE #
ITEM
I U, # INDUCTION VARIABLE #
TEMP U, # TEMPORARY UNSIGNED INTEGER #
TYPE C(WC) = "CM "; # TYPE OF MEMORY REQUEST #
BASED
BEGIN
ARRAY LDR54 P(5); # LOADER 54 TABLE FORMAT #
ITEM
LDRTYPE U (0,0,12), # LOADER TABLE TYPE FIELD #
LDRHHA U (4,ZL,AL); # LOADER HIGHEST HIGH ADDRESS #
END
ARRAY ERR54 P(3); # 54 TABLE ERROR MESSAGE #
ITEM
ERR54MSG C (0,0,20) = [ "54 TABLE NOT PRESENT" ],
ERR54Z U (2,0,WL) = [ 0 ];
ARRAY STATIS P(1); # STATUS WORD PASSED TO MEMORY #
ITEM
REQFL U (0,0,HWL), # REQUEST FIELD LENGTH #
REQZERO U (0,HWL,HWL); # LOWER HALF OF STATUS WORD #
P<LDR54> = LDADDR; # FORMAT 54 TABLE #
IF LDRTYPE[0] NQ O"5400"
THEN # NOT 54 TABLE, TSBM INITIALIZATION NOT #
BEGIN # SET FOR ANYTHING BUT 54 TABLE #
MESSAGE(ERR54,LOCAL);# ISSUE LOCAL DAYFILE MESSAGE #
ABORT; # ***** ABORT THE PROGRAM ***** #
END
REQZERO[0] = 0; # CLEAR PART OF STATUS WORD #
REQFL[0] = LDRHHA[0] + ITSBSIZ + 9; # GET ENOUGH FOR ALL OVERLAYS#
# AND THE INITIAL TSB AREA #
# AND A LITTLE EXTRA FOR MOVE#
# MACRO #
MEMORY(TYPE,STATIS); # REQUEST THAT MUCH MEMORY #
CTSBLWA = REQFL[0] - 9; # SET CURRENT TSB AREA LWA #
PTSBLWA = CTSBLWA; # SET PRIMARY TSB LAST WORD ADDRESS #
TSBFWA = LDRHHA[0]; # SET TSB AREA FIRST WORD ADDRESS #
P<TSBS> = TSBFWA; # FORMAT TSB AREA FOR WORD ACCESS #
#
BUILD TSBIT IN FIRST TSB
#
P<BTSBHDR> = TSBFWA; # BUILD BUSY TSB FOR TSBIT AT TSBFWA #
BBUSY[0] =TRUE; # BUSY TSB #
BNOTMOV[0] = FALSE; # SET MOVEABLE BLOCK #
BHDRRSV[0] = 0; # CLEAR RESERVED AREA #
BIDENT[0] = 1; # 1 IS ALWAYS TSBIT TSBN #
BPTSBL[0] = 0; # NOTHING PREVIOUS TO THIS TSB #
BTSBL[0] = TSBITL + TSBHDRL; # SIZE OF TSB #
P<TSBIT> = TSBFWA + TSBHDRL; # FORMAT TSBIT A USER AREA FWA #
TSBITRSV[0] = 0; # CLEAR TSBIT HEADER RESERVED #
LOWFREE[0] = 2; # SET INITIAL LOWEST FREE TSBIT ENTRY #
LENGTH[0] = TSBITL; # SET INITIAL LENGTH OF TSBIT #
NUMFREE[0] = TSBITL - 2; # NUMBER OF AVAILABLE ENTRIES #
FOR I = LOWFREE[0] STEP 1 UNTIL ( LENGTH[0] - 1 ) DO
BEGIN # SET UP INITIAL TSBIT ENTRIES #
TRSVD[I] = 0; # CLEAR RESERVED AREA #
TBUSY[I] = FALSE; # FREE TSBIT ENTRY #
TTSBFWA[I] = 0; # CLEAR TSB ADDRESS #
FWDPTR[I] = I + 1; # SET FORWARD POINTER #
END
FWDPTR[LENGTH[0] - 1] = 0; # SET END OF FREE CHAIN #
TBUSY[1] = TRUE; # SET TSBIT IDENT AS BUSY #
TRSVD[1] = 0; # CLEAR THE RESERVED AREA #
TTSBFWA[1] = TSBFWA; # SET ADDRESS OF TSBIT TSB #
FWDPTR[1] = 0; # CLEAR THE FORWARD POINTER #
#
BUILD FREE TSB WITH THE REST AND BUILD ZERO LENGTH TSB
AT CTSBLWA
#
P<FTSBHDR> = TSBFWA + BTSBL[0]; # PUT FREE FORMAT ON NEXT TSB #
FBUSY[0] = FALSE; # FREE TSB #
FNOTMOV[0] = FALSE; # ALL FREE TSB"S ARE MOVEABLE #
FHDRRSV[0] = 0; # CLEAR RESERVED AREA #
FIDENT[0] = 0; # CLEAR IDENT FIELD #
FPTSBL[0] = BTSBL[0]; # PREVIOUS TSB SIZE #
FTSBL[0] = CTSBLWA - LOC(FTSBHDR); # SIZE OF THIS TSB #
TEMP = ( LOC(FTSBHDR) + TSBHDRL ) - TSBFWA; # TSB WORD INDEX #
ZERO( LOC(TSBAREA[TEMP]) ,FTSBL[0]-TSBHDRL ); #CLEAR AREA #
BIGFREE = FTSBL[0]; # SET INITIAL BIGGEST FREE TSB #
FFFWA = LOC(FTSBHDR); # SET INITIAL FIRST FREE FIRST WORD ADDR. #
P<BTSBHDR> = CTSBLWA; # BUILD FREE TSB OF ZERO LENGTH AT CTSBLWA#
BBUSY[0] = FALSE; # FREE TSB #
BNOTMOV[0] = FALSE; # MOVEABLE #
BHDRRSV[0] = 0; # CLEAR RESERVED AREA #
BIDENT[0] = 0; # CLEAR IDENT FIELD #
BPTSBL[0] = FTSBL[0]; # SET SIZE OF PREVIOUS TSB #
BTSBL[0] = 0; # SET ZERO LENGTH #
RETURN;
END TERM # TSBINIT #