Table of Contents

DMSSMN Abstract

Statistics

Type ASSEMBLE
Source Lines : 620
Fixes Applied : 4
Most Recent Version : Tuesday, December 12, 1978
Last Fix ID : [R14218DS]

Synopsis

Module

       DMSSMN

Function

       THE DMSSMN ROUTINE PROCESSES OS FREEMAIN AND GETMAIN
       MACROS, AND CMS CALLS TO DMSSMNSB (STRINIT).

Attributes

       NUCLEUS RESIDENT, RE-ENTRANT

Operation

    IF  AN OS  GETMAIN  OR FREEMAIN  IS  ISSUED  WITH AN  R
    OPERAND, CONTROL  IS PASSED VIA  AN SVC10 TO  THE SVC10
    ENTRY POINT  IN DMSSMN.   DMSSMN ROUNDS  THE AMOUNT  OF
    STORAGE SPECIFIED UP TO A  DOUBLEWORD AND DETERMINES IF
    A GETMAIN  OR FREEMAIN  WAS ISSUED.   IF A  GETMAIN WAS
    ISSUED, THE GETBLK ROUTINE IN DMSSMN IS CALLED TO GET A
    FREE STORAGE  BLOCK.  CONTROL IS  THEN RETURNED  TO THE
    USER WITH THE  ADDRESS OF THE FREE  STORAGE IN REGISTER
    ONE.  IF A FREEMAIN WAS  ISSUED, THE FREEBLK ROUTINE IN
    DMSSMN  IS CALLED  TO RELEASE  A BLOCK  OF STORAGE  AND
    CONTROL IS RETURNED TO THE USER.

    IF  AN  OS GETMAIN  IS  ISSUED  WITHOUT AN  R  OPERAND,
    CONTROL IS  PASSED VIA     AN  SVC4 TO  THE SVC4  ENTRY
    POINT  IN DMSSMN.   IF THE  GETMAIN  WAS NOT  VARIABLE,
    DMSSMN ROUNDS  UP THE AMOUNT  OF STORAGE  SPECIFIED AND
    CALLS  THE  GETBLK ROUTINE  IN  DMSSMN  TO GET  A  FREE
    STORAGE BLOCK.   CONTROL IS THEN  RETURNED TO  THE USER
    WITH THE ADDRESS OF THE FREE BLOCK.  IF THE GETMAIN WAS
    CONDITIONAL AND  THERE WAS AN  ERROR, AN ERROR  CODE IS
    PASSED BACK TO THE USER.   IF THE GETMAIN WAS VARIABLE,
    DMSSMN PROCEEDS  AS ABOVE EXCEPT  THAT IT  SEARCHES THE
    FREE CHAIN TO  DETERMINE HOW MUCH STORAGE  IS AVAILABLE
    BEFORE CALLING THE GETBLK ROUTINE.

    IF  AN OS  FREEMAIN  IS ISSUED  WITHOUT  AN R  OPERAND,
    CONTROL IS PASSED  VIA AN SVC5 TO THE  SVC5 ENTRY POINT
    IN DMSSMN.  DMSSMN ROUNDS THE AMOUNT  TO BE FREED UP TO
    A DOUBLEWORD AND CALLS THE  FREEBLK ROUTINE TO FREE THE
    SPECIFIED STORAGE.  CONTROL IS THEN RETURNED TO USER.

    IF  A CMS  ROUTINE  CALLS  THE STORAGE INITIALIZATION
        ROUTINE (STRINIT) IN DMSSMN, STRINIT
    RESETS THE  FREE STORAGE EXTENTS AND  EFFECTIVELY FREES
    ANY  STORAGE THAT  WAS  PREVIOUSLY  GETMAINED.  IF  ANY
    ERRORS  ARE ENCOUNTERED  IN  RESETTING  THE EXTENTS  AN
    ABEND IS ISSUED,  OTHERWISE CONTROL IS RETURNED  TO THE
    USER.

    THE GETBLK  ROUTINE IN DMSSMN  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 AND  THE GETMAIN IS
    UNCONDITIONAL, AN  ABEND IS ISSUED.   IF A LARGE ENOUGH
    BLOCK CANNOT BE FOUND AND  THE GETMAIN WAS CONDITIONAL,
    CONTROL IS RETURNED TO THE CALLER WITH AN ERROR CODE IN
    REGISTER 15.

    THE  FREEBLK  ROUTINE  IN DMSSMN  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