Framework Components Application Programming Interface (API)  fc-t15
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Macros | Data Structures | Typedefs | Variables
Resource Manager for IRES-based resources

Functions

IRES_Status RMAN_init (Void)
 Initialize the RMAN object with static information from the headers/configuration etc. This function has to return successfully before the other APIs are called.
IRES_Status RMAN_exit (Void)
 Delete the generic IRES RMAN and release memory back.
IRES_Status RMAN_register (IRESMAN_Fxns *resmanFxns, IRESMAN_Params *initArgs)
 Register the protocol/protocol revision and the device specific resource manager implementation with the Resource Registry of the RMAN.
IRES_Status RMAN_unregister (IRESMAN_Fxns *resmanFxns)
 Unregister the protocol and the corresponding resource manager implementation from the Resource Registry.
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 by using the IRES_Fxns implementation.
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_freeResources (IALG_Handle algHandle, IRES_Fxns *resFxns, Int scratchGroupId)
 Free resources held by the algorithm resource handle.
IRES_Status RMAN_freeAllocatedResources (Int requestId, IRES_ResourceDescriptor *resDesc, Int numResources, Int scratchGroupId)
 Free resources held by the algorithm resource handle.
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.
IRES_Status RMAN_activateAllResources (IALG_Handle algHandle, IRES_Fxns *resFxns, Int scratchGroupId)
 Activate all resources held by the algorithm.
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.
IRES_Status RMAN_deactivateAllResources (IALG_Handle algHandle, IRES_Fxns *resFxns, Int scratchGroupId)
 Deactivate all resources held by the algorithm.
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-tasking support This function is called by the algorithm at pre-determined points during its execution, to allow another algorithm of same, or higher prioirty to preempt its execution.

Macros

#define RMAN_MODNAME   "ti.sdo.fc.rman"
 Name to pass to Diags_setMask() to enable logging for RMAN functions. For example, Diags_setMask(RMAN_MODNAME"+EX1234567"); turns on all Log statements in this module. Diags_setMask() must be called after initialization to take effect.
#define RMAN_GTNAME   "ti.sdo.fc.rman"
 Name used to identify the GT module.
#define RMAN_PROTOCOLNAMESIZE   200
 Size of the Protocol Name in the Resource Registry Table.

Data Structures

struct  RMAN_Params
 The module configuration structure for RMAN. It is set at design time by the system integrator to register the specific Resource Managers(IRESMAN implementations). More...

Typedefs

typedef struct Sem_Obj * RMAN_SemHandle
 Declare abstract handle for Semaphore object.
typedef 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 execution to same/higher priority algorithms.
typedef struct RMAN_Params RMAN_Params
 The module configuration structure for RMAN. It is set at design time by the system integrator to register the specific Resource Managers(IRESMAN implementations).

Variables

__FAR__ RMAN_Params RMAN_PARAMS
 Initialization parameters for the generic Resource Manager.
__FAR__ IRESMAN_FxnsRMAN_TABLE []
 RMAN Table to hold IRESMAN registrations.
__FAR__ short RMAN_FREE_ENTRIES []
 Free Table to hold entries freed from RMAN Table.
__FAR__ short RMAN_numRegistryEntries
 Number of entries statically configured for the Resource Registry table. Set this variable to zero if no static configuration is required.
__FAR__ IRESMAN_Fxns ** RMAN_registryEntries
 To allow for static configuration of the Resource Registry table this can be set to a valid configuration table or to NULL. Set this variable to NULL if no static configuration is required.
__FAR__ IRESMAN_Params ** RMAN_registryResmanArgs
 Initialization arguments for the entries to be registered Set this variable to NULL if no static configuration is required.
__FAR__ unsigned int ** RMAN_iresVTable
 Table that holds the mapping from algorithms IALG_Fxns to IRES_Fxns.
__FAR__ unsigned int ti_sdo_fc_rman_RMAN_MAXALGS
 Maximum number of algorithm instances that will use RMAN.
UInt32 ti_sdo_fc_rman_RMAN_ipcKey
 Base key value ofr RMAN Linux IPC Objects.
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.

Detailed Description

IRES generic Resource Manager RMAN Definitions - Generic Resource Manager that manages resource allocation for algorithms that implement the IRES interface


Function Documentation

IRES_Status RMAN_init ( Void  )

Initialize the RMAN object with static information from the headers/configuration etc. This function has to return successfully before the other APIs are called.

Return values:
IRES_OKIRES RMAN created successfully
IRES_ENORESOURCEOne of the calls to the device specific Resource Manager failed
IRES_Status RMAN_exit ( Void  )

Delete the generic IRES RMAN and release memory back.

Return values:
IRES_OKIRES RMAN exited successfully
IRES_EFAILError closing device specific RESMAN
IRES_Status RMAN_register ( IRESMAN_Fxns resmanFxns,
IRESMAN_Params initArgs 
)

Register the protocol/protocol revision and the device specific resource manager implementation with the Resource Registry of the RMAN.

Parameters:
[in]resmanFxnsDevice-specific implementation of the RESMAN interfaces
[in]initArgsArguments to the initialization interface of the RESMAN interfaces
Return values:
IRES_OKRegistered successfully
IRES_EEXISTSProtocol already exists
IRES_ENORESOURCEDevice specific Resman failed to initialize Resource Manager failed
IRES_EFAILError closing device specific RESMAN
IRES_Status RMAN_unregister ( IRESMAN_Fxns resmanFxns)

Unregister the protocol and the corresponding resource manager implementation from the Resource Registry.

Parameters:
[in]resmanFxnsDevice-specific implementation of the RESMAN interfaces
Return values:
IRES_OKUnregistered successfully
IRES_ENOTFOUNDEntry not found in the RMAN Table
IRES_EFAILError closing device specific RESMAN
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 by using the IRES_Fxns implementation.

Parameters:
[in]algHandleHandle to the algorithm
[in]resFxnsHandle to the IRES implementation
[in]scratchGroupIdId of the scratch group in which resources are requested from -1 if persistent resources are requested. Note: If performing cooperative preemption, use the same scratchGroupId to request resources and to create algorithm. Failure to do so, will lead to unexpected behaviour.
Return values:
IRES_OKResources assigned successfully
IRES_EALGOne of the calls to the IRES interfaces of the algorithm failed
IRES_ENOMEMNot enough memory
IRES_ENOTFOUNDEntry not found
IRES_ENORESOURCEResources unavailable
IRES_EFAILError freeing handles etc
IRES_Status RMAN_allocateResources ( Int  requestId,
IRES_ResourceDescriptor resDesc,
Int  numResources,
Int  scratchGroupId 
)

Directly allocate IRES resources by client without implementing IRES_Fxns.

Parameters:
[in]requestIdUnique identifier used when requesting IRES resource allocation directly. Same identifier must be supplied when freeing allocated resources using RMAN_freeAllocatedResources
[in]resDescIRES_ResourceDescriptor containing attributes of the resoureces that are being requested.
[in]numResourcesNumber of request descriptors in the resDesc array used for requesting resources.
[in]scratchGroupIdId of the scratch group in which resources are requested from -1 if persistent resources are requested. Note: If performing cooperative preemption, use the same scratchGroupId to request resources and to create algorithm. Failure to do so, will lead to unexpected behaviour.
Return values:
IRES_OKResources assigned successfully
IRES_ENOMEMNot enough memory
IRES_ENOTFOUNDEntry not found
IRES_ENORESOURCEResources unavailable
IRES_EFAILError freeing handles etc
IRES_Status RMAN_freeResources ( IALG_Handle  algHandle,
IRES_Fxns resFxns,
Int  scratchGroupId 
)

Free resources held by the algorithm resource handle.

Parameters:
[in]algHandleHandle to the algorithm
[in]resFxnsHandle to the IRES implementation
[in]scratchGroupIdId of the scratch group in which resources were requested -1 if persistent resources are requested
Return values:
IRES_OKResources freed successfully
IRES_EALGOne of the calls to the IRES interfaces of the algorithm failed
IRES_ENOMEMNot enough memory
IRES_ENOTFOUNDEntry not found
IRES_ENORESOURCEError obtaining resource information
IRES_EFAILError freeing handles etc
IRES_ENOMEMOut of memory
IRES_Status RMAN_freeAllocatedResources ( Int  requestId,
IRES_ResourceDescriptor resDesc,
Int  numResources,
Int  scratchGroupId 
)

Free resources held by the algorithm resource handle.

Parameters:
[in]requestIdUnique identifier that has been previously used when requesting IRES resource allocation directly via RMAN_allocateResources Same identifier must be supplied when freeing allocated resources.
[in]resDescIRES_ResourceDescriptor containing attributes of the resoureces that have been used to obtain allocated resources.
[in]numResourcesNumber of request descriptors in the resDesc array used for requesting resources.
[in]scratchGroupIdId of the scratch group in which resources were requested -1 if persistent resources are requested
Return values:
IRES_OKResources freed successfully
IRES_ENOTFOUNDEntry not found
IRES_ENORESOURCEError obtaining resource information
IRES_EFAILError freeing handles etc
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.

Parameters:
[in]algHandleHandle to the algorithm
[in]resourceHandleHandle to the resource
[in]resFxnsHandle to the IRES implementation
[in]scratchGroupIdId of the scratch group in which resources are requested from
Return values:
IRES_OKResource activated successfully
IRES_Status RMAN_activateAllResources ( IALG_Handle  algHandle,
IRES_Fxns resFxns,
Int  scratchGroupId 
)

Activate all resources held by the algorithm.

Parameters:
[in]algHandleHandle to the algorithm
[in]resFxnsHandle to the IRES implementation
[in]scratchGroupIdId of the scratch group in which resources are requested from
Return values:
IRES_OKAll resources activated successfully
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.

Parameters:
[in]algHandleHandle to the algorithm
[in]resourceHandleHandle to the resource
[in]resFxnsHandle to the IRES implementation
[in]scratchGroupIdId of the scratch group in which resources are requested from
Return values:
IRES_OKResource deactivated successfully
IRES_Status RMAN_deactivateAllResources ( IALG_Handle  algHandle,
IRES_Fxns resFxns,
Int  scratchGroupId 
)

Deactivate all resources held by the algorithm.

Parameters:
[in]algHandleHandle to the algorithm
[in]resFxnsHandle to the IRES implementation
[in]scratchGroupIdId of the scratch group in which resources are requested from
Return values:
IRES_OKResources deactivated successfully
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-tasking support This function is called by the algorithm at pre-determined points during its execution, to allow another algorithm of same, or higher prioirty to preempt its execution.

Parameters:
[in]resourceEnum identifying type of resource (ALL, Scratch Memory, Scratch DMA, IRES Resource)
[in]algYieldContextHandle to the yield context that contains information supplied by the algorithm including the algorithm handle, the corresponding context save/restore fxns and arguments with which to call these fxns.
[in]yieldArgsFramework supplied yield arguments that are passed to the algorithm at the time of granting resource handles. These should be passed back unmodified to this function.

Macro Definition Documentation

#define RMAN_MODNAME   "ti.sdo.fc.rman"

Name to pass to Diags_setMask() to enable logging for RMAN functions. For example, Diags_setMask(RMAN_MODNAME"+EX1234567"); turns on all Log statements in this module. Diags_setMask() must be called after initialization to take effect.

#define RMAN_GTNAME   "ti.sdo.fc.rman"

Name used to identify the GT module.

#define RMAN_PROTOCOLNAMESIZE   200

Size of the Protocol Name in the Resource Registry Table.


Typedef Documentation

typedef struct Sem_Obj* RMAN_SemHandle

Declare abstract handle for Semaphore object.

typedef 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 execution to same/higher priority algorithms.

typedef struct RMAN_Params RMAN_Params

The module configuration structure for RMAN. It is set at design time by the system integrator to register the specific Resource Managers(IRESMAN implementations).

Remarks:
Typically, system integrators configure these settings using XDC config scripts. System integrators that use that method of configuration can ignore this structure definition. It's auto-generated during the config step by the XDC Tools.

Variable Documentation

__FAR__ RMAN_Params RMAN_PARAMS

Initialization parameters for the generic Resource Manager.

__FAR__ IRESMAN_Fxns* RMAN_TABLE[]

RMAN Table to hold IRESMAN registrations.

__FAR__ short RMAN_FREE_ENTRIES[]

Free Table to hold entries freed from RMAN Table.

__FAR__ short RMAN_numRegistryEntries

Number of entries statically configured for the Resource Registry table. Set this variable to zero if no static configuration is required.

__FAR__ IRESMAN_Fxns** RMAN_registryEntries

To allow for static configuration of the Resource Registry table this can be set to a valid configuration table or to NULL. Set this variable to NULL if no static configuration is required.

__FAR__ IRESMAN_Params** RMAN_registryResmanArgs

Initialization arguments for the entries to be registered Set this variable to NULL if no static configuration is required.

__FAR__ unsigned int** RMAN_iresVTable

Table that holds the mapping from algorithms IALG_Fxns to IRES_Fxns.

__FAR__ unsigned int ti_sdo_fc_rman_RMAN_MAXALGS

Maximum number of algorithm instances that will use RMAN.

UInt32 ti_sdo_fc_rman_RMAN_ipcKey

Base key value ofr RMAN Linux IPC Objects.

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.

Copyright 2013, Texas Instruments Incorporated