Data Structures | Modules | Defines | Typedefs | Enumerations | Functions
Resource Manager API

Data Structures

struct  Rm_ServerCfg
 RM server (includes shared server) initialization configurations. More...
struct  Rm_ClientDelegateCfg
 RM client delegate (CD) initialization configurations. More...
struct  Rm_ClientCfg
 RM client initialization configurations. More...
struct  Rm_SharedClientCfg
 RM shared client initialization configurations. More...
struct  Rm_InitCfg
 RM instance initialization structure. More...

Modules

 RM Transport API
 RM Services API
 RM OS Abstraction Layer API

Defines

#define RM_OK   0
#define RM_SERVICE_PROCESSING   1
#define RM_SERVICE_PENDING_SERVER_RESPONSE   2
#define RM_SERVICE_APPROVED   3
#define RM_SERVICE_APPROVED_STATIC   4
#define RM_SERVICE_DENIED_BASE   64
#define RM_SERVICE_DENIED_RES_DOES_NOT_EXIST   RM_SERVICE_DENIED_BASE+1
#define RM_SERVICE_DENIED_RES_RANGE_DOES_NOT_EXIST   RM_SERVICE_DENIED_BASE+2
#define RM_SERVICE_DENIED_RES_NOT_ALLOCD_TO_INST   RM_SERVICE_DENIED_BASE+3
#define RM_SERVICE_DENIED_RES_ALREADY_FREE   RM_SERVICE_DENIED_BASE+4
#define RM_SERVICE_DENIED_PARTIAL_ALLOCATION   RM_SERVICE_DENIED_BASE+5
#define RM_SERVICE_DENIED_PARTIAL_FREE   RM_SERVICE_DENIED_BASE+6
#define RM_SERVICE_DENIED_RES_ALLOC_REQS_NOT_MET   RM_SERVICE_DENIED_BASE+7
#define RM_SERVICE_DENIED_NAME_EXISTS_IN_NS   RM_SERVICE_DENIED_BASE+8
#define RM_SERVICE_DENIED_INST_NAME_NOT_VALID   RM_SERVICE_DENIED_BASE+9
#define RM_SERVICE_DENIED_INIT_PERM_NOT_GIVEN   RM_SERVICE_DENIED_BASE+10
#define RM_SERVICE_DENIED_USE_PERM_NOT_GIVEN   RM_SERVICE_DENIED_BASE+11
#define RM_SERVICE_DENIED_EXCLUSIVE_RES_ALLOCD   RM_SERVICE_DENIED_BASE+12
#define RM_SERVICE_DENIED_ALLOCD_TO_EXCLUSIVE_INST   RM_SERVICE_DENIED_BASE+13
#define RM_SERVICE_DENIED_INVALID_STATIC_REQUEST   RM_SERVICE_DENIED_BASE+14
#define RM_SERVICE_DENIED_BY_STATIC_POLICY   RM_SERVICE_DENIED_BASE+15
#define RM_SERVICE_DENIED_RM_INSTANCE_LOCKED   RM_SERVICE_DENIED_BASE+16
#define RM_SERVICE_DENIED_RES_NOT_SHARED_LINUX   RM_SERVICE_DENIED_BASE+17
#define RM_SERVICE_DENIED_PARTIAL_STATUS   RM_SERVICE_DENIED_BASE+18
#define RM_WARNING_CD_INSTANCE_NOT_STABLE   (-1024)
#define RM_ERROR_LIBFDT_START   (-1)
#define RM_ERROR_LIBFDT_END   (-13)
#define RM_ERROR_BASE   (-64)
#define RM_ERROR_INVALID_INST_NAME   RM_ERROR_BASE-1
#define RM_ERROR_NO_VALID_INST_IN_POLICY   RM_ERROR_BASE-2
#define RM_ERROR_PERM_STR_INST_NOT_VALID   RM_ERROR_BASE-3
#define RM_ERROR_UNKNOWN_RESOURCE_IN_POLICY   RM_ERROR_BASE-4
#define RM_ERROR_PERM_STR_TOO_MANY_INST_GROUPS   RM_ERROR_BASE-5
#define RM_ERROR_PERM_STR_TOO_MANY_ASSIGN_CHARS   RM_ERROR_BASE-6
#define RM_ERROR_PERM_STR_INVALID_CHAR   RM_ERROR_BASE-7
#define RM_ERROR_PERM_CHAR_WITHOUT_ASSIGN_CHAR   RM_ERROR_BASE-8
#define RM_ERROR_INVALID_PERMS_CHAR_ON_RIGHT   RM_ERROR_BASE-9
#define RM_ERROR_UNKNOWN_POLICY_RESOURCE_PROPERTY   RM_ERROR_BASE-10
#define RM_ERROR_VALID_INST_NAME_TOO_LONG   RM_ERROR_BASE-11
#define RM_ERROR_INST_NAME_IN_ASSIGNMENT_TOO_LONG   RM_ERROR_BASE-12
#define RM_ERROR_GRL_NS_ASSIGNMENT_NAME_TOO_LONG   RM_ERROR_BASE-13
#define RM_ERROR_GRL_INVALID_LINUX_ALIAS_FORMAT   RM_ERROR_BASE-14
#define RM_ERROR_SERVICE_HANDLE_MEM_ALLOC_FAILED   RM_ERROR_BASE-15
#define RM_ERROR_SERVICE_HANDLE_ALREADY_CLOSED   RM_ERROR_BASE-16
#define RM_ERROR_GRL_UNKNOWN_RESOURCE_PROPERTY   RM_ERROR_BASE-17
#define RM_ERROR_RES_ALLOCATOR_DOES_NOT_EXIST   RM_ERROR_BASE-18
#define RM_ERROR_GRL_RES_SPECIFIED_MORE_THAN_ONCE   RM_ERROR_BASE-19
#define RM_ERROR_DATA_NOT_FOUND_AT_LINUX_ALIAS   RM_ERROR_BASE-20
#define RM_ERROR_INVALID_SERVER_CONFIGURATION   RM_ERROR_BASE-21
#define RM_ERROR_INVALID_SERVICE_TYPE   RM_ERROR_BASE-22
#define RM_ERROR_TRANSPORT_ALLOC_PKT_ERROR   RM_ERROR_BASE-23
#define RM_ERROR_TRANSPORT_SEND_ERROR   RM_ERROR_BASE-24
#define RM_ERROR_SERVICE_TRANS_NOT_CREATED   RM_ERROR_BASE-25
#define RM_ERROR_SERVICE_TRANS_DOES_NOT_EXIST   RM_ERROR_BASE-26
#define RM_ERROR_NAMESERVER_DOES_NOT_EXIST   RM_ERROR_BASE-27
#define RM_ERROR_NAMESERVER_NAME_ADD_FAILED   RM_ERROR_BASE-28
#define RM_ERROR_NAMESERVER_NAME_DOES_NOT_EXIST   RM_ERROR_BASE-29
#define RM_ERROR_REQ_FAILED_NO_STATIC_POLICY   RM_ERROR_BASE-30
#define RM_ERROR_TRANSPORT_HANDLE_DOES_NOT_EXIST   RM_ERROR_BASE-31
#define RM_ERROR_RECEIVED_INVALID_PACKET_TYPE   RM_ERROR_BASE-32
#define RM_ERROR_PKT_RESP_DOES_NOT_MATCH_ANY_REQ   RM_ERROR_BASE-33
#define RM_ERROR_INVALID_REMOTE_INST_TYPE   RM_ERROR_BASE-34
#define RM_ERROR_ALREADY_REGD_SERVER_OR_CD   RM_ERROR_BASE-35
#define RM_ERROR_INVALID_INST_TYPE   RM_ERROR_BASE-36
#define RM_ERROR_TRANSPORT_ALLOC_PKT_NOT_REGD   RM_ERROR_BASE-37
#define RM_ERROR_TRANSPORT_SEND_NOT_REGD   RM_ERROR_BASE-38
#define RM_ERROR_CANT_DELETE_WITH_REGD_TRANSPORT   RM_ERROR_BASE-39
#define RM_ERROR_CANT_DELETE_WITH_OPEN_SERV_HNDL   RM_ERROR_BASE-40
#define RM_ERROR_CANT_DELETE_PENDING_TRANSACTIONS   RM_ERROR_BASE-41
#define RM_ERROR_INVALID_RES_STATUS_INSTANCE   RM_ERROR_BASE-42
#define RM_ERROR_SHARED_INSTANCE_UNFINISHED_REQ   RM_ERROR_BASE-43
#define RM_ERROR_SHARED_INSTANCE_CANNOT_REG_TRANS   RM_ERROR_BASE-44
#define RM_ERROR_INVALID_SHARED_SERVER_HANDLE   RM_ERROR_BASE-45
#define RM_ERROR_TRANS_REQ_TO_SERVER_NOT_CREATED   RM_ERROR_BASE-46
#define RM_ERROR_INSTANCE_HAS_NO_POLICY   RM_ERROR_BASE-47
#define RM_ERROR_INVALID_CD_CONFIGURATION   RM_ERROR_BASE-48
#define RM_ERROR_LOST_RESOURCES_ON_CD   RM_ERROR_BASE-49
#define RM_ERROR_PKT_AND_SERVICE_SRC_NOT_AVAIL   RM_ERROR_BASE-50
#define RM_ERROR_SRC_NAME_BUF_INVALID_SIZE   RM_ERROR_BASE-51
#define RM_NAME_MAX_CHARS   (32)
 Maximum number of characters allowed for RM instance, resource, and NameServer names.

Typedefs

typedef void * Rm_Handle
 RM instance handle. The RM handle is used to register transports between RM instances and request resource services from the RM instance.

Enumerations

enum  Rm_InstType {
  Rm_instType_SERVER = 0, Rm_instType_CLIENT_DELEGATE, Rm_instType_CLIENT, Rm_instType_SHARED_SERVER,
  Rm_instType_SHARED_CLIENT, Rm_instType_LAST
}
 RM instance types. More...

Functions

int32_t Rm_resourceStatus (Rm_Handle rmHandle, int printResources)
void Rm_instanceStatus (Rm_Handle rmHandle)
Rm_Handle Rm_init (const Rm_InitCfg *initCfg, int32_t *result)
int32_t Rm_delete (Rm_Handle rmHandle, int ignorePendingServices)
uint32_t Rm_getVersion (void)
const char * Rm_getVersionStr (void)

Define Documentation

RM client attempted to register with more than one Server or CD or a CD attempted to register with more than one Server

#define RM_ERROR_BASE   (-64)

RM error base

RM instance cannot be deleted when there are transactions pending and the ignorePendingServices parameter is set to false

RM instance cannot be deleted with open service handle

RM instance cannot be deleted with transports still registered

No data was found at the GRL resource node's specified Linux alias path

Linux alias assignment in global resource list is invalid

NameServer name in global resource list nameServer assignment is greater than RM_NAME_MAX_CHARS

A resource node is specified more than once in the Global Resource List (GRL)

Global Resource List (GRL) resource node contains an unknown property

Instance name in permissions assignment is greater than RM_NAME_MAX_CHARS

Service request required a policy check but instance was not initialized with a policy

RM Client Delegate was not provided a policy at initialization

Instance name provided is NULL or greater than RM_NAME_MAX_CHARS

Instance type not recognized

Permissions string contains a permission character on opposite side of already made assignment Ex: assignments = <12 1>, "iux = (RM_Client_Delegate) x";

Server attempted to connect to another server or a CD attempted to connect to another CD or Client attempted to connect to another client

Only the Server instance can be used to return resource status via the Rm_resourceStatus API

RM server was not provided a Global Resource List (GRL) and global policy at initialization

Service request type not recognized

RM Shared Client handle was provided an invalid Shared Server handle. The shared server handle was either NULL or was not an instance of type Rm_instType_SHARED_SERVER

#define RM_ERROR_LIBFDT_END   (-13)

End of libfdt.h error codes

#define RM_ERROR_LIBFDT_START   (-1)

Start of libfdt.h error codes

RM CD freed local resources which allowed a free request of local request to be sent to the Server. The Server free failed so the CD tried to realloc the local resources that were originally freed. The re-allocate operation failed causing a resource loss on the CD

NameServer does not exist in instance, cannot satisfy NameServer service request

Service request to add a name to the NameServer failed

Could not find name specified in service request in NameServer

List of "valid-instances" not found in global or static policy

Permissions string contains a permission character without the assignment operator Ex: assignments = <12 1>, "iux (RM_Client_Delegate)";

Instance specified in permissions string does not match any instances specified in the "valid-instances" list

Permissions string contains invalid character

Permissions string has more than assignment. Ex: assignments = <12 1>, "iux = (RM_Client_Delegate) = i";

Permissions string has more than instance group specified. Ex: assignments = <12 1>, "iux = (RM_Client_Delegate) iu = (RM_Client)";

The service source inst name and RM packet source instance names are not available for the given type of RM packet

RM response packet does not match any requests sent from instance

RM received a packet with an unknown RM packet type

Service request made on Client or CD when no transport established and no static policy registered

Could not find an allocator for the specified resource

The RM instance service handle has already been closed

Error allocating memory for the service handle

RM service transaction could not be found in instance's transaction queue

A RM service transaction could not be created for the service request

RM Shared Server and Client instances cannot register transports

RM Shared Server and Client instances should always return a finished request since the instance has access to the resource structures no matter what core the service is requested from

The provided character buffer that will contain the service source inst name or pkt source inst name is not of size RM_NAME_MAX_CHARS

A RM Client failed to create a new transaction to request data from the Server in order to potentially process a transaction on a Client Delegate

rmAllocPkt transport callout returned NULL for rmPkt

RM attempted to allocate a transport packet but the rmAllocPkt callout was not registered

RM transport handle has not been registered with the RM instance

rmSendPkt transport callout returned error when attempting to send the rmPkt

RM attempted to send a packet but the rmSendPkt callout was not registered

Policy resource node contains an unknown property

Resource specified in global policy does not have an allocator

Instance name provided in "valid-instances" list is greater than RM_NAME_MAX_CHARS

#define RM_OK   0

RM successful return code

#define RM_SERVICE_APPROVED   3

RM has approved requested service

RM has approved requested service based on static policy. Request will be validated against global policy once all transports have been registered

Allocate request resource range allocated to an instance assigned exclusive privileges in policy

#define RM_SERVICE_DENIED_BASE   64

RM service request denial reasons base

Static allocate request denied by static policy

Allocate request resource range marked as exclusive in policy has already been allocated

Init allocate request resource range not given init privileges in policy

Service request instance not in policy "valid-instances" list

Static allocate request was not an allocate-use or allocate-init request

NameServer add request name string already exists in NameServer

Allocate request resource range partially allocated (Handling of partial allocations not yet implemented)

Free request resource range partially free (Handling of partial frees not yet implemented)

Status request resource range partially found (Handling of partial status requests not yet implemented)

Requirements of allocate request could not be satisfied (occurs for UNSPECIFIED base and/or alignment requests

Free request resource range already free

Request resource not found in policy or allocators

Free request resource range not allocated to service's source inst

Allocate request denied because the resource is already reserved by Linux and "Shared Linux" privileges are not assigned to the requesting instance

Request resource range within not found within resource's allocator

RM instance locked from further services since a static allocation failed validation against global policy. RM instance cannot be unlocked. Please make sure static policy and global policy are in sync

Use allocate request resource range not given use privileges in policy

RM CD has placed on the request on hold pending a Server response

#define RM_SERVICE_PROCESSING   1

RM processing requested service

#define RM_WARNING_CD_INSTANCE_NOT_STABLE   (-1024)

RM Client Delegate instance is not stable. RM system operation cannot be guarateed if a CD instance is used. At the time please manage resources using Server and Client instances - tracked by SDOCM00100797


Enumeration Type Documentation

RM instance types.

Enumerator:
Rm_instType_SERVER 

RM Server

Rm_instType_CLIENT_DELEGATE 

RM Client Delegate

Rm_instType_CLIENT 

RM Client

Rm_instType_SHARED_SERVER 

RM Shared Server - Server instance stored in shared memory that allows multiple DSP cores to request services without the need to configure and register transports. Allows requests to be fulfilled from any DSP core without blocking

Rm_instType_SHARED_CLIENT 

RM Shared Client - Piggybacks on the Shared Server instance to handle service requests from resource and policy data structures in shared memory

Rm_instType_LAST 

DO NOT USE: Last type


Function Documentation

int32_t Rm_delete ( Rm_Handle  rmHandle,
int  ignorePendingServices 
)

Description
This function deletes the specified RM instance. All memory associated with the instance will be freed.

Parameters:
[in]rmHandleInstance handle.
[in]ignorePendingServicesNon-zero - The instance will be deleted despite any services pending
0 - The instance will not be deleted due to at least one service pending.
Return values:
Success- RM_OK
Failure- RM_ERROR_CANT_DELETE_WITH_OPEN_SERV_HNDL
Failure- RM_ERROR_CANT_DELETE_WITH_REGD_TRANSPORT
Failure- RM_ERROR_CANT_DELETE_PENDING_TRANSACTIONS
uint32_t Rm_getVersion ( void  )

Description
The function is used to get the version information of RM.

Return values:
VersionInformation.
const char* Rm_getVersionStr ( void  )

Description
The function is used to get the version string for RM.

Return values:
VersionString.
Rm_Handle Rm_init ( const Rm_InitCfg initCfg,
int32_t *  result 
)

Description
This function initializes a RM instance. There are no restrictions on the amount of times this function can be called. Each call will result in a new RM instance. However, a network of RM instances can have only one RM Server. If an application has multiple RM Servers the resources managed by each server must be mutually exclusive. Additionally if an application has multiple RM shared servers the resources they manage must be mutually exclusive as well

If any errors are encountered during the initialization process the Rm_Handle returned will be NULL.

Parameters:
[in]initCfgPointer to the instance initialization structure.
[out]resultPointer to a signed int used to return any errors encountered during the instance initialization process.
Return values:
Success- Rm_Handle for instance and result = RM_OK
Failure- NULL Rm_Handle and result < RM_OK
void Rm_instanceStatus ( Rm_Handle  rmHandle)

Description
This function prints the current status of a RM instance. The following instance properties will be printed: a) instance name & type b) The instance's registered transports c) All service transactions queued in the instance transaction queue and their states

Parameters:
[in]rmHandleInstance handle.
int32_t Rm_resourceStatus ( Rm_Handle  rmHandle,
int  printResources 
)

Description
This function prints and returns the status for all resources managed by the RM instance network. The allocate/free status as well as ownership status will be printed for every resource. Also, the NameServer name entries will be displayed.

This function will return error if a Client handle is provided since Clients do not track any resource data structures

Parameters:
[in]rmHandleInstance handle.
[in]printResourcesNon-zero - Resource ownership details will be printed for all tracked resources 0 - Resource ownership details will not be printed. Only the number of allocated resource ranges will be returned.
Return values:
Success- Total number of allocated resource nodes owners. Effectively returns the number of resource ranges still allocated.
Failure- RM_ERROR_INVALID_RES_STATUS_INSTANCE

Copyright 2014, Texas Instruments Incorporated