Framework Components Application Programming Interface (API)  fc-v07
rman.h
Go to the documentation of this file.
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  */
50 #ifndef ti_sdo_fc_rman__RMAN_
51 #define ti_sdo_fc_rman__RMAN_
52 
53 #define ti_sdo_fc_ires_NOPROTOCOLREV
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
61 
62 #include <ti/xdais/ires.h>
63 #include <ti/sdo/fc/ires/iresman.h>
64 
73 #define RMAN_MODNAME "ti.sdo.fc.rman"
74 
78 #define RMAN_GTNAME "ti.sdo.fc.rman"
79 
83 #define RMAN_PROTOCOLNAMESIZE 200
84 
88 typedef struct Sem_Obj * RMAN_SemHandle;
89 
96  (Int scratchId, Bool yieldFlag);
97 
108 typedef struct RMAN_Params {
109 
114 
119 
124 
130 
135 
136 } RMAN_Params;
137 
141 extern __FAR__ RMAN_Params RMAN_PARAMS;
142 
146 extern __FAR__ IRESMAN_Fxns * RMAN_TABLE[];
147 
151 extern __FAR__ short RMAN_FREE_ENTRIES[];
152 
158 extern __FAR__ short RMAN_numRegistryEntries;
159 
165 extern __FAR__ IRESMAN_Fxns ** RMAN_registryEntries;
166 
171 extern __FAR__ IRESMAN_Params ** RMAN_registryResmanArgs;
172 
177 extern __FAR__ unsigned int ** RMAN_iresVTable;
178 
182 extern __FAR__ unsigned int ti_sdo_fc_rman_RMAN_MAXALGS;
183 
187 extern UInt32 ti_sdo_fc_rman_RMAN_ipcKey;
188 
194 
204 IRES_Status RMAN_init(Void);
205 
206 
213 IRES_Status RMAN_exit(Void);
214 
215 
232 IRES_Status RMAN_register(IRESMAN_Fxns * resmanFxns, IRESMAN_Params * initArgs);
233 
234 
246 
271  Int scratchGroupId);
272 
273 
304 IRES_Status RMAN_allocateResources(Int requestId,
305  IRES_ResourceDescriptor * resDesc, Int numResources, Int scratchGroupId);
306 
307 
326 IRES_Status RMAN_freeResources(IALG_Handle algHandle, IRES_Fxns * resFxns, Int
327  scratchGroupId);
328 
354  IRES_ResourceDescriptor *resDesc, Int numResources, Int scratchGroupId);
355 
369  IRES_Handle resourceHandle, IRES_Fxns * resFxns, Int scratchGroupId);
370 
381  IRES_Fxns * resFxns, Int scratchGroupId);
382 
396  IRES_Handle resourceHandle, IRES_Fxns * resFxns, Int scratchGroupId);
397 
409  IRES_Fxns * resFxns, Int scratchGroupId);
410 
411 
431 void RMAN_yield(IRES_YieldResourceType resource,
432  IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs);
433 
434 
437 #ifdef __cplusplus
438 }
439 #endif /* extern "C" */
440 
441 #endif
IRES_Status
IRES_Status defines the standard error and success codes returned by IRES APIs.
Definition: ires_common.h:57
Void(* IRES_YieldFxn)(IRES_YieldResourceType resourceType, IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs)
The 'yield function' pointer and 'yield arguments' are supplied to an algorithm during its IRES inter...
Definition: ires.h:159
Configuration Parameters required by the Resource Manager implementation. These can be extended by in...
Definition: iresman.h:82
void RMAN_yield(IRES_YieldResourceType resource, IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs)
Yield function specifically for use when DSKT2 based algorithms need cooperative preemption and multi...
IRES_YieldArgs(* ti_sdo_fc_rman_RMAN_YieldArgsFxn)(Int scratchId, Bool yieldFlag)
Type declaration for the "yield fxn" which is required if if RMAN has been configured to yield execut...
Definition: rman.h:96
Definition: iresman.h:99
UInt32 ti_sdo_fc_rman_RMAN_ipcKey
Base key value ofr RMAN Linux IPC Objects.
Algorithm instance object definition.
Definition: ialg.h:159
__FAR__ RMAN_Params RMAN_PARAMS
Initialization parameters for the generic Resource Manager.
__FAR__ IRESMAN_Params ** RMAN_registryResmanArgs
Initialization arguments for the entries to be registered Set this variable to NULL if no static conf...
The module configuration structure for RMAN. It is set at design time by the system integrator to reg...
Definition: rman.h:108
IRES_Status RMAN_freeAllocatedResources(Int requestId, IRES_ResourceDescriptor *resDesc, Int numResources, Int scratchGroupId)
Free resources held by the algorithm resource handle.
Bool( IRESMAN_PersistentAllocFxn)(IALG_MemRec *memTab, Int numRecs)
Memory allocation function for all of ResMan and other IRES protocol's memory requirements.
Definition: iresman.h:68
IRES_Status RMAN_freeResources(IALG_Handle algHandle, IRES_Fxns *resFxns, Int scratchGroupId)
Free resources held by the algorithm resource handle.
IRES_Obj holds the private state associated with each logical resource.
Definition: ires_common.h:176
IRES Interface Definitions - Allows algorithms to request and receive handles representing private lo...
IRESMAN_PersistentAllocFxn * allocFxn
Memory allocation function for all RMAN memory requirements.
Definition: rman.h:118
__FAR__ IRESMAN_Fxns ** RMAN_registryEntries
To allow for static configuration of the Resource Registry table this can be set to a valid configura...
ti_sdo_fc_rman_RMAN_YieldArgsFxn ti_sdo_fc_rman_RMAN_setYieldArgs
Function to set yield arguments to pass to yield function set in RMAN_PARAMS.
IRES_Status RMAN_register(IRESMAN_Fxns *resmanFxns, IRESMAN_Params *initArgs)
Register the protocol/protocol revision and the device specific resource manager implementation with ...
__FAR__ IRESMAN_Fxns * RMAN_TABLE[]
RMAN Table to hold IRESMAN registrations.
Void( IRESMAN_PersistentFreeFxn)(IALG_MemRec *memTab, Int numRecs)
Memory free functions for all of ResMan and other IRES protocol's memory requirements.
Definition: iresman.h:74
Bool yieldSamePriority
Flag indicating if yield to same priority is okay.
Definition: rman.h:134
__FAR__ unsigned int ** RMAN_iresVTable
Table that holds the mapping from algorithms IALG_Fxns to IRES_Fxns.
Descriptor to Logical Resource.
Definition: ires_common.h:122
IRESMAN_PersistentFreeFxn * freeFxn
Memory free function for all RMAN memory requirements.
Definition: rman.h:123
__FAR__ unsigned int ti_sdo_fc_rman_RMAN_MAXALGS
Maximum number of algorithm instances that will use RMAN.
IRES_Status RMAN_unregister(IRESMAN_Fxns *resmanFxns)
Unregister the protocol and the corresponding resource manager implementation from the Resource Regis...
These fxns are used to query/grant the resources requested by the algorithm at initialization time...
Definition: ires.h:168
IRES_Status RMAN_assignResources(IALG_Handle algHandle, IRES_Fxns *resFxns, Int scratchGroupId)
Assign resources to the algorithm indicated by algHandle. The resource requirements can be determined...
IRES_Status RMAN_init(Void)
Initialize the RMAN object with static information from the headers/configuration etc...
Specifies the algorithm specific handles and context save & restore function pointers and arguments t...
Definition: ires.h:84
Device specific Resource Manager Interface Definitions IRESMAN - Interface that needs to be implement...
Void * IRES_YieldArgs
Definition: ires.h:140
IRES_Status RMAN_activateResource(IALG_Handle algHandle, IRES_Handle resourceHandle, IRES_Fxns *resFxns, Int scratchGroupId)
Activate resource identified by the resourceHandle held by the algorithm.
__FAR__ short RMAN_FREE_ENTRIES[]
Free Table to hold entries freed from RMAN Table.
IRES_YieldFxn yieldFxn
Yield function used to yield to same/higher priority algorithms. If yielding is supported set to vali...
Definition: rman.h:129
IRES_Status RMAN_deactivateAllResources(IALG_Handle algHandle, IRES_Fxns *resFxns, Int scratchGroupId)
Deactivate all resources held by the algorithm.
short numRegistries
Number of registry entries in the RMAN table.
Definition: rman.h:113
__FAR__ short RMAN_numRegistryEntries
Number of entries statically configured for the Resource Registry table. Set this variable to zero if...
IRES_Status RMAN_deactivateResource(IALG_Handle algHandle, IRES_Handle resourceHandle, IRES_Fxns *resFxns, Int scratchGroupId)
Deactivate resource identified by the resourceHandle held by the algorithm.
struct Sem_Obj * RMAN_SemHandle
Declare abstract handle for Semaphore object.
Definition: rman.h:88
IRES_Status RMAN_activateAllResources(IALG_Handle algHandle, IRES_Fxns *resFxns, Int scratchGroupId)
Activate all resources held by the algorithm.
IRES_Status RMAN_allocateResources(Int requestId, IRES_ResourceDescriptor *resDesc, Int numResources, Int scratchGroupId)
Directly allocate IRES resources by client without implementing IRES_Fxns.
IRES_Status RMAN_exit(Void)
Delete the generic IRES RMAN and release memory back.
struct RMAN_Params RMAN_Params
The module configuration structure for RMAN. It is set at design time by the system integrator to reg...
IRES_YieldResourceType
Definition: ires.h:60
Copyright 2016, Texas Instruments Incorporated