rman.h

Go to the documentation of this file.
00001 /* 
00002  * Copyright (c) 2009, Texas Instruments Incorporated
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * *  Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  *
00012  * *  Redistributions in binary form must reproduce the above copyright
00013  *    notice, this list of conditions and the following disclaimer in the
00014  *    documentation and/or other materials provided with the distribution.
00015  *
00016  * *  Neither the name of Texas Instruments Incorporated nor the names of
00017  *    its contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00021  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00022  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00023  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00024  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00026  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00027  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00028  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00029  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00030  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00031  * 
00032  */
00050 #ifndef ti_sdo_fc_rman_RMAN_
00051 #define ti_sdo_fc_rman_RMAN_
00052 
00053 #define ti_sdo_fc_ires_NOPROTOCOLREV
00054 
00055 #ifdef __cplusplus
00056 extern "C" {
00057 #endif
00058 
00061 
00062 #include <ti/xdais/ires.h>
00063 #include <ti/sdo/fc/ires/iresman.h>
00064 
00068 #define RMAN_GTNAME  "ti.sdo.fc.rman"
00069 
00073 #define RMAN_PROTOCOLNAMESIZE 200
00074 
00078 typedef struct Sem_Obj * RMAN_SemHandle;
00079 
00080 
00091 typedef struct RMAN_Params {
00092 
00093     /*
00094      *  @brief      Number of registry entries in the RMAN table
00095      */
00096     short numRegistries;
00097 
00098     /*
00099      *  @brief      Memory allocation function for all RMAN memory requirements
00100      */
00101     IRESMAN_PersistentAllocFxn * allocFxn;
00102 
00103     /*
00104      *  @brief      Memory free function for all RMAN memory requirements
00105      */
00106     IRESMAN_PersistentFreeFxn * freeFxn;
00107 
00108     /*
00109      *  @brief      RMAN_yield if yielding is supported, else NULL. 
00110      */
00111     IRES_YieldFxn yieldFxn;  
00112 
00113     /*
00114      *  @brief      Flag indicating if yield to same priority is okay 
00115      */
00116     Bool yieldSamePriority;
00117 
00118 } RMAN_Params;
00119 
00126 typedef struct RMAN_YieldArgs {
00127 
00128     /*
00129      *  @brief      groupId of the resource  
00130      */
00131     Int groupId;
00132 
00133     /*
00134      *  @brief      Flag indicating if same-priority yields should occur. 
00135      */
00136     Bool yieldFlag;
00137 
00138 } RMAN_YieldArgs;
00139 
00140 
00141 /*
00142  *  @brief      Initialization parameters for the generic Resource Manager
00143  */
00144 extern __FAR__ RMAN_Params RMAN_PARAMS;
00145 
00146 /*
00147  *  @brief      RMAN Table to hold IRESMAN registrations
00148  */
00149 extern __FAR__ IRESMAN_Fxns * RMAN_TABLE[];
00150 
00151 /*
00152  *  @brief      Free Table to hold entries freed from RMAN Table
00153  */
00154 extern __FAR__ short RMAN_FREE_ENTRIES[];
00155 
00156 /*
00157  *  @brief      Number of entries statically configured for the Resource 
00158  *              Registry table. Set this variable to zero if no static 
00159  *              configuration is required
00160  */
00161 extern __FAR__ short RMAN_numRegistryEntries;
00162 
00163 /*
00164  *  @brief      To allow for static configuration of the Resource Registry 
00165  *              table this can be set to a valid configuration table or to NULL.
00166  *              Set this variable to NULL if no static configuration is required
00167  */
00168 extern __FAR__ IRESMAN_Fxns ** RMAN_registryEntries;
00169 
00170 /*
00171  *  @brief      Initialization arguments for the entries to be registered
00172  *              Set this variable to NULL if no static configuration is required
00173  */
00174 extern __FAR__ IRESMAN_Params ** RMAN_registryResmanArgs;
00175 
00176 
00186 IRES_Status RMAN_init(Void);
00187 
00188 
00195 IRES_Status RMAN_exit(Void);
00196 
00197 
00216 IRES_Status RMAN_register(IRESMAN_Fxns * resmanFxns, IRESMAN_Params * initArgs);
00217 
00218 
00231 IRES_Status RMAN_unregister(IRESMAN_Fxns * resmanFxns);
00232 
00262 IRES_Status RMAN_assignResources(IALG_Handle algHandle, IRES_Fxns * resFxns,
00263     Int scratchGroupId);
00264 
00265 
00285 IRES_Status RMAN_freeResources(IALG_Handle algHandle, IRES_Fxns * resFxns, Int
00286     scratchGroupId);
00287 
00300 IRES_Status RMAN_activateResource(IALG_Handle algHandle,
00301     IRES_Handle resourceHandle, IRES_Fxns * resFxns, Int scratchGroupId);
00302 
00312 IRES_Status RMAN_activateAllResources(IALG_Handle algHandle,
00313     IRES_Fxns * resFxns, Int scratchGroupId);
00314 
00327 IRES_Status RMAN_deactivateResource(IALG_Handle algHandle,
00328     IRES_Handle resourceHandle, IRES_Fxns * resFxns, Int scratchGroupId);
00329 
00340 IRES_Status RMAN_deactivateAllResources(IALG_Handle algHandle,
00341     IRES_Fxns * resFxns, Int scratchGroupId);
00342 
00343 
00363 void RMAN_yield(IRES_YieldResourceType resource,
00364     IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs);
00365 
00366  
00369 #ifdef __cplusplus
00370 }
00371 #endif /* extern "C" */
00372 
00373 #endif  /* RMAN_ */
00374 /*
00375  *  @(#) ti.sdo.fc.rman; 2, 0, 0,185; 11-8-2009 20:58:27; /db/atree/library/trees/fc/fc-l04x/src/
00376  */
00377 

Copyright 2009, Texas Instruments Incorporated