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