1    /*
     2     *  Copyright 2013 by Texas Instruments Incorporated.
     3     *
     4     */
     5    
     6    /*
     7     * Copyright (c) 2012, Texas Instruments Incorporated
     8     * All rights reserved.
     9     *
    10     * Redistribution and use in source and binary forms, with or without
    11     * modification, are permitted provided that the following conditions
    12     * are met:
    13     *
    14     * *  Redistributions of source code must retain the above copyright
    15     *    notice, this list of conditions and the following disclaimer.
    16     *
    17     * *  Redistributions in binary form must reproduce the above copyright
    18     *    notice, this list of conditions and the following disclaimer in the
    19     *    documentation and/or other materials provided with the distribution.
    20     *
    21     * *  Neither the name of Texas Instruments Incorporated nor the names of
    22     *    its contributors may be used to endorse or promote products derived
    23     *    from this software without specific prior written permission.
    24     *
    25     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    26     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    27     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    28     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    29     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    30     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    31     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    32     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    33     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    34     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    35     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    36     *
    37     */
    38    
    39    
    40    /*!
    41     *  ======== RMAN ========
    42     *  Resource Manager for shared C64x+ resources.
    43     */
    44    @Template("./RMAN.xdt")
    45    
    46    metaonly module RMAN {
    47    
    48        /*!
    49         *  ======== tableSize  ========
    50         * Total number of individual resource manager (IRESMAN implementation)
    51         * entries that will be registered with RMAN (including both static and
    52         * dynamic)
    53         */
    54        config UInt tableSize = 10;
    55    
    56        /*!
    57         *  ======== maxAlgs  ========
    58         * Maximum number of algorithm instances that will be using the RMAN
    59         * module.
    60         */
    61        config UInt maxAlgs = 32;
    62    
    63        /*!
    64         *  ======== useDSKT2 ========
    65         *  Flag indicating if DSKT2 should be used for memory allocation and
    66         *  for supporting algorithm yields.
    67         *
    68         *  Setting this flag to `false` will disable cooperative preemption support
    69         *  for algorithms in RMAN.
    70         */
    71        config Bool useDSKT2 = true;
    72    
    73        /*!
    74         *  ======== persistentAllocFxn ========
    75         *  Function for allocating persistent memory for RMAN's and other IRESMAN
    76         *  implementation's internal objects.
    77         *
    78         *  The signature of the persistent alloc function is:
    79         *      extern Bool persistentAllocFxn(IALG_MemRec * memTab, Int numRecs);
    80         *
    81         *  This is required to be supplied ONLY if {@link #useDSKT2} is set to
    82         *  `false`.
    83         */
    84        config String persistentAllocFxn = null;
    85    
    86        /*!
    87         *  ======== persistentFreeFxn ========
    88         *  Function for freeing persistent memory used by RMAN and other IRESMAN
    89         *  implementation's internal objects.
    90         *
    91         *  The signature of hte persistentFreeFxn is:
    92         *
    93         *      extern Void persistentFreeFxn(IALG_MemRec *memTab, Int numRecs);
    94         *
    95         *  This is required to be supplied ONLY if {@link #useDSKT2} is set to
    96         *  `false`.
    97         */
    98        config String persistentFreeFxn = null;
    99    
   100        /*!
   101         *  ======== ipcKeyBase ========
   102         *  For multi-process support only. This is the base value of MP objects
   103         *  used by RMAN.
   104         *  The MP objects created by RMAN will use keys starting at this
   105         *  value, and incrementing with each new object. There is currently
   106         *  only one RMAN lock. The default value of ipcKeyBase is the ascii
   107         *  code for "RMAN".
   108         *
   109         *  WARNING: This value should only be changed if it conflicts with
   110         *  another key in the system that cannot be changed. If this value
   111         *  is changed, all programs using RMAN that will be run simultaneously
   112         *  must have the ipcKeyBase configured to the new value.
   113         *  @_nodoc
   114         */
   115        config UInt ipcKeyBase = 0x524D414E;
   116    
   117        /*!
   118         *  ======== yieldSamePriority ========
   119         * Flag indicating if yields to same priority should happen or not
   120         *
   121         * This is required only if {@link #useDSKT2} is set to `true`.
   122         */
   123        config bool yieldSamePriority = false;
   124    
   125        /*!
   126         *  ======== semCreateFxn ========
   127         * Deprecated
   128         * Function to create semaphores used by various individual resource
   129         * manager(s) registered with RMAN.
   130         *
   131         *  Function signature is:
   132         *  @p(code)
   133         * Void * _semCreate(Int key, Int count);
   134         * @_nodoc
   135         */
   136        config String semCreateFxn = null;
   137    
   138        /*!
   139         *  ======== semDeleteFxn ========
   140         * Deprecated
   141         * Function to delete semaphores used by various individual resource
   142         * manager(s) registered with RMAN.
   143         *
   144         *  Function signature is:
   145         *  @p(code)
   146         *  Void _semDelete(Void * sem);
   147         * @_nodoc
   148         */
   149        config String semDeleteFxn = null;
   150    
   151        /*!
   152         *  ======== semPendFxn ========
   153         * Deprecated
   154         * Function to pend on semaphores used by various resource manager(s)
   155         * registered with RMAN.
   156         *
   157         *  Function signature is:
   158         *  @p(code)
   159         *  Int _semPend(Void * sem, unsigned int timeout);
   160         * @_nodoc
   161         */
   162        config String semPendFxn = null;
   163    
   164        /*!
   165         *  ======== semPostFxn ========
   166         * @Deprecated
   167         * Function to post on Semaphores used by various resource manager(s)
   168         * registered with RMAN.
   169         *
   170         *  Function signature is:
   171         *  @p(code)
   172         * Void _semPost(Void * sem);
   173         * @_nodoc
   174         */
   175        config String semPostFxn = null;
   176    
   177        /*!
   178         *  ======== lockFxn ========
   179         *  Deprecated
   180         *  Function for handling the release and lock of scratch groups required
   181         *  during yield to higher or same priority algorithm
   182         *  Void _acquireLock(Int scratchId);
   183         * @_nodoc
   184         */
   185        config String lockFxn = null;
   186    
   187        /*!
   188         *  ======== unlockFxn ========
   189         *  Deprecated
   190         *  Function for handling the release and lock of scratch groups required
   191         *  during yield to higher or same priority algorithm
   192         *  Void _releaseLock(Int scratchId);
   193         * @_nodoc
   194         */
   195        config String unlockFxn = null;
   196    
   197        /*!
   198         *  ======== setContext ========
   199         *  Deprecated
   200         *  Function for handling setting and obtaining the Yield context of a
   201         *  scratch group during yield to higher or same priority algorithm
   202         *  Void _setContext(Int scratchId, IRES_YieldContextHandle context);
   203         * @_nodoc
   204         */
   205        config String setContextFxn = null;
   206    
   207        /*!
   208         *  ======== getContext ========
   209         *  Deprecated
   210         *  Function for handling setting and obtaining the Yield context of a
   211         *  scratch group during yield to higher or same priority algorithm
   212         *  IRES_YieldContextHandle _getContext(Int scratchId);
   213         * @_nodoc
   214         */
   215        config String getContextFxn = null;
   216    
   217        /*!
   218         *  ======== yieldFxn ========
   219         *  Deprecated
   220         *  Function to call to yield to another task of the same priority.
   221         *  Required only if the yieldSamePriority flag is set to "true".
   222         * @_nodoc
   223         */
   224        config String yieldFxn = null;
   225    }
   226    /*
   227     *  @(#) ti.sdo.fc.rman; 2, 0, 0,3; 7-23-2013 14:12:52; /db/atree/library/trees/fc/fc-t12/src/ xlibrary
   228    
   229     */
   230