Type ASSEMBLE
Source Lines : 551
Fixes Applied : 1
Most Recent Version : Tuesday, December 12, 1978
Last Fix ID : [R09503DS]
Module
DMSSTG
Function
THE DMSSTG ROUTINE PROCESSES CMS CALLS TO DMSSTGST DMSSTGSB (STRINIT), DMSSTGAT, DMSSTGCL AND DMSSTGSV.
Attributes
NUCLEUS RESIDENT, RE-ENTRANT
Operation
IF A CMS ROUTINE CALLS THE STORAGE INITIALIZATION ROUTINE (STRINIT) IN DMSSTG, STRINIT RESETS THE FREE STORAGE EXTENTS AND EFFECTIVELY FREES ANY STORAGE THAT WAS PREVIOUSLY GETMAINED. IF A CMS ROUTINE CALLS DMSSTGCL IN DMSSTG, DMSSTGCL ISSUES STAE, SPIE, TTIMER, AND STAX CANCEL MACROES TO CANCEL ANY OUTSTANDING OS EXIT ROUTINES. IT ALSO CALLS DMSLGTA, DMSSLNAB, AND DMSFRET TO FREE ANY TXTLIB, MACLIB, OR LINK TABLES LEFT AROUND FROM PREVIOUS OS PROGRAMS. CONTROL IS THEN RETURNED TO THE USER. THE GETBLK ROUTINE IN DMSSTG SEARCHES THE FREE CHAIN FOR A BLOCK OF FREE STORAGE LARGE ENOUGH TO MEET THE CALLER'S NEEDS. WHEN IT FINDS ONE, IT EITHER RESETS THE BLOCK LENGTH OR, IF ALL THE BLOCK IS NEEDED, DELETES IT AND RETURNS CONTROL TO THE CALLER. IF A LARGE ENOUGH BLOCK CANNOT BE FOUND CONTROL IS RETURNED TO THE CALLER WITH AN ERROR CODE IN REGISTER 15. THE FREEBLK ROUTINE IN DMSSTG RETURNS A BLOCK OF STORAGE TO THE FREE CHAIN. IF THE ADDRESS PASSED IT IS BAD, THE FREEBLK ROUTINE ISSUES AN ABEND. IF THE BLOCK IT IS FREEING IS CONTIGUOUS TO ANY OTHER FREE BLOCK IN CORE, THE FREEBLK ROUTINE WILL COMBINE THE TWO BLOCKS. UPON SUCCESSFUL COMPLETION CONTROL IS RETURNED TO THE CALLER. PREVIOUS STORAGE ALLOCATION REQUESTS MAINTAIN A CHAIN OF POINTERS TO DISCONNECTED AREAS OF FREE CORE EACH LINK +00 IS FREPTR - POINTER TO NEXT LINK ZERO IF LAST IN CHAIN +04 IS FRELEN - LENGTH OF FREE AREA FRELST POINTS TO THE FIRST LINK IN THE CHAIN OF DISCONNECTED AREAS FSTFRE HOLDS THE ORIGINAL BEGINNING OF USER FREE STORAGE LENFRE HOLDS THE LENGTH OF THAT AREA NUCON LOCATION MAINHIGH HOLDS THE LOWER BOUND FOR EXTEND. NUCON LOCATION FREELOWE (LOWEXT) HOLDS THE UPPER BOUND FOR GETMAIN.
Calls to Other Routines
DMSSVT, DMSSAB, DMSFRE, DMSLGTA, DMSSLNAB