]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/rm-lld.git/blob - rm.h
03cdd3f6b0d90407b92e6c421ad45f25c5716947
[keystone-rtos/rm-lld.git] / rm.h
1 /**
2  *   @file  rm.h
3  *
4  *   @brief   
5  *      This is the Resource Manager include file.
6  *
7  *  \par
8  *  ============================================================================
9  *  @n   (C) Copyright 2012-2013, Texas Instruments, Inc.
10  * 
11  *  Redistribution and use in source and binary forms, with or without 
12  *  modification, are permitted provided that the following conditions 
13  *  are met:
14  *
15  *    Redistributions of source code must retain the above copyright 
16  *    notice, this list of conditions and the following disclaimer.
17  *
18  *    Redistributions in binary form must reproduce the above copyright
19  *    notice, this list of conditions and the following disclaimer in the 
20  *    documentation and/or other materials provided with the   
21  *    distribution.
22  *
23  *    Neither the name of Texas Instruments Incorporated nor the names of
24  *    its contributors may be used to endorse or promote products derived
25  *    from this software without specific prior written permission.
26  *
27  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
28  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
29  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
31  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
32  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
33  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
36  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
37  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38  *
39  *  \par
40 */
42 #ifndef RM_H_
43 #define RM_H_
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
49 /* Standard includes */
50 #include <stdint.h>
52 /**  @mainpage Resource Manager
53  *
54  *   @section intro  Introduction
55  *
56  *   The Resource Manager (RM) is designed to provide an easy to use, extensible
57  *   uinified resource management solution on TI devices.  RM can be integrated by 
58  *   a system application to provide resource management services to the system 
59  *   temporally (pre-main/post-main) and spatially (system subcomponents, task,
60  *   cores).
61  *
62  *   The RM architecture is instance based.  All RM resource management services 
63  *   must originate from a RM instance.  Resource permissions are assigned by a 
64  *   system integrator using RM instance names provided during the initialization
65  *   of each RM instance in use.  There are three types of RM instances, all of
66  *   which can be used by the system to request resource management services:
67  *    - Server - Manages all resource data structures including the resource
68  *               allocators, the permissions policies, and a simple NameServer.
69  *               There can only be one Server per RM ecosystem.  If two Servers
70  *               are initialized within a system they must manage mutually
71  *               exclusive sets of device resources.  There is no limit to the 
72  *               number of Client and Client Delegate instances that can connect
73  *               to the Server
74  *    - Client - Used by system components to request resource services.  There is
75  *               no limit to the number of Clients a system can have.  Client
76  *               names must be unique since resource permissions are assigned based
77  *               on RM instance names.  Clients can connect to at most one Server
78  *               or Client Delegate, but not both at the same time.
79  *    - Client Delegate (CD) - At the moment the CD is not different from the
80  *                             Client.  However, in the future the CD will be able
81  *                             to act as a proxy for the Server.  The CD will be
82  *                             able to satisfy some service requests from Clients,
83  *                             offloading some processing from the Server.  This 
84  *                             feature will be helpful in situations where a
85  *                             slower data path exists between the Server and
86  *                             CD/Client instances.  There is no limit to the number
87  *                             of Clients that can connect to a CD.  The CD can
88  *                             connect to at most one Server.
89  *
90  *   RM instances communicate via a generic transport interface.  The RM transport
91  *   interface expects the application to configure and manage the transport data paths
92  *   between RM instances.  This allows RM to easily extend to different device 
93  *   configurations and different devices entirely.
94  *
95  *   RM utilizes the BDS-licensed, open source, Flattened Device Tree format to 
96  *   specify what resources are managed by RM as well as the RM instance permissions
97  *   for managed resources.  The Global Resource List or GRL defines all device 
98  *   resources and their ranges that will be tracked by the RM Server.  Addition or 
99  *   subtraction of resources from RM requires one modify only the GRL.  RM source code
100  *   changes are not required to add or subtract resources from RM's umbrella of 
101  *   management.  RM Policies specify resource permissions for the RM instances.  There
102  *   are two types of Policies:
103  *    - Global Policy - Provided to the Server at initialization and defines the 
104  *                      resource permissions for all RM instances in the system.
105  *                      All service requests will be validated against the Global
106  *                      Policy on the Server.  If the RM instance is found to not
107  *                      hold the privileges for the request a denial of the service
108  *                      will be issued back to the requesting instance.
109  *    - Static Policy - Optionally provided to Client and CD instances at
110  *                      initialization.  Allows these instances to statically 
111  *                      allocate resources.  This feature is typically used
112  *                      for RM instances that must allocate resources prior
113  *                      to the transport connection to the Server being established.
114  *                      Resources allocated via any Static Policies will
115  *                      be validated against the Global Policy once the transport 
116  *                      to the Server has been fully established.  If a Static
117  *                      Policy request fails validation with the Global Policy the
118  *                      RM instance that issued the static request will be placed
119  *                      into a locked state.  The locked state prevents any further
120  *                      service requests from the instance.
121  *
122  *   Combined, the GRL and Policy Device Tree implementations allow RM to easily extend 
123  *   to new resources without the need to recompile the RM source code.
124  *
125  *   RM instances currently provides the following resource services:
126  *    - Allocate (initialize) - Allocate a resource for initialization
127  *    - Allocate (usage)      - Allocate a resource for use
128  *    - Free                  - Free an allocated resource (The free must originate
129  *                              from the RM instance that allocated the resource
130  *    - Map resource to name  - Map a specified resource to a NameServer name
131  *    - Unmap named resource  - Unmap a resource from an existing NameServer name
132  *    - Get resource by name  - Returns a resource based on a provided NameServer name
133  */
134  
135 /* Define RM_API as a master group in Doxygen format and add all RM API 
136    definitions to this group. */
137 /** @defgroup RM_API Resource Manager API
138  *  @{
139  */
140 /** @} */
142 /**
143 @defgroup RM_TRANSPORT_API  RM Transport API
144 @ingroup RM_API
145 */
146 /**
147 @defgroup RM_SERVICES_API  RM Services API
148 @ingroup RM_API
149 */
150 /**
151 @defgroup RM_OSAL_API RM OS Abstraction Layer API
152 @ingroup RM_API
153 */
155 /**
156 @addtogroup RM_API
157 @{
158 */
160 /* RM return and error codes */
161 /** RM successful return code */
162 #define RM_OK                                      0
163 /** RM processing requested service */
164 #define RM_SERVICE_PROCESSING                      1
165 /** RM has approved requested service */
166 #define RM_SERVICE_APPROVED                        2
167 /** RM has approved requested service based on static policy.  Request will be validated 
168  *  against global policy once all transports have been registered */
169 #define RM_SERVICE_APPROVED_STATIC                 3
171 /** RM service request denial reasons base */
172 #define RM_SERVICE_DENIED_BASE                     64
173 /** Request resource not found in policy or allocators */
174 #define RM_SERVICE_DENIED_RES_DOES_NOT_EXIST       RM_SERVICE_DENIED_BASE+1
175 /** Request resource range within not found within resource's allocator */
176 #define RM_SERVICE_DENIED_RES_RANGE_DOES_NOT_EXIST RM_SERVICE_DENIED_BASE+2
177 /** Free request resource range not allocated to service's source inst */
178 #define RM_SERVICE_DENIED_RES_NOT_ALLOCD_TO_INST   RM_SERVICE_DENIED_BASE+3
179 /** Free request resource range already free */
180 #define RM_SERVICE_DENIED_RES_ALREADY_FREE         RM_SERVICE_DENIED_BASE+4
181 /** Allocate request resource range partially allocated (Handling of partial allocations
182  *  not yet implemented) */
183 #define RM_SERVICE_DENIED_PARTIAL_ALLOCATION       RM_SERVICE_DENIED_BASE+5
184 /** Free request resource range partially free (Handling of partial frees not yet implemented) */
185 #define RM_SERVICE_DENIED_PARTIAL_FREE             RM_SERVICE_DENIED_BASE+6
186 /** Requirements of allocate request could not be satisfied (occurs for UNSPECIFIED base 
187  *  and/or alignment requests */
188 #define RM_SERVICE_DENIED_RES_ALLOC_REQS_NOT_MET   RM_SERVICE_DENIED_BASE+7
189 /** NameServer add request name string already exists in NameServer */
190 #define RM_SERVICE_DENIED_NAME_EXISTS_IN_NS        RM_SERVICE_DENIED_BASE+8
191 /** Service request instance not in policy "valid-instances" list */
192 #define RM_SERVICE_DENIED_INST_NAME_NOT_VALID      RM_SERVICE_DENIED_BASE+9
193 /** Init allocate request resource range not given init privileges in policy */
194 #define RM_SERVICE_DENIED_INIT_PERM_NOT_GIVEN      RM_SERVICE_DENIED_BASE+10
195 /** Use allocate request resource range not given use privileges in policy */
196 #define RM_SERVICE_DENIED_USE_PERM_NOT_GIVEN       RM_SERVICE_DENIED_BASE+11
197 /** Allocate request resource range marked as exclusive in policy has already been allocated */
198 #define RM_SERVICE_DENIED_EXCLUSIVE_RES_ALLOCD     RM_SERVICE_DENIED_BASE+12
199 /** Allocate request resource range allocated to an instance assigned exclusive privileges in policy */
200 #define RM_SERVICE_DENIED_ALLOCD_TO_EXCLUSIVE_INST RM_SERVICE_DENIED_BASE+13
201 /** Static allocate request was not an allocate-use or allocate-init request */
202 #define RM_SERVICE_DENIED_INVALID_STATIC_REQUEST   RM_SERVICE_DENIED_BASE+14
203 /** Static allocate request denied by static policy */
204 #define RM_SERVICE_DENIED_BY_STATIC_POLICY         RM_SERVICE_DENIED_BASE+15
205 /** RM instance locked from further services since a static allocation failed validation against 
206  *  global policy.  RM instance cannot be unlocked.  Please make sure static policy and global policy 
207  *  are in sync */
208 #define RM_SERVICE_DENIED_RM_INSTANCE_LOCKED       RM_SERVICE_DENIED_BASE+16
210 /** Start of libfdt.h error codes */
211 #define RM_ERROR_LIBFDT_START                      (-1)
212 /** End of libfdt.h error codes */
213 #define RM_ERROR_LIBFDT_END                        (-13)
215 /** RM error base */       
216 #define RM_ERROR_BASE                              (-64)
217 /** Instance name provided is NULL or greater than RM_NAME_MAX_CHARS */
218 #define RM_ERROR_INVALID_INST_NAME                 RM_ERROR_BASE-1
219 /** List of "valid-instances" not found in global or static policy */
220 #define RM_ERROR_NO_VALID_INST_IN_POLICY           RM_ERROR_BASE-2
221 /** Instance specified in permissions string does not match any instances specified in the
222  *  "valid-instances" list */
223 #define RM_ERROR_PERM_STR_INST_NOT_VALID           RM_ERROR_BASE-3
224 /** Resource specified in global policy does not have an allocator */
225 #define RM_ERROR_UNKNOWN_RESOURCE_IN_POLICY        RM_ERROR_BASE-4
226 /** Permissions string has more than instance group specified.
227  *  Ex: assignments = <12 1>, "iux = (RM_Client_Delegate) iu = (RM_Client)"; */
228 #define RM_ERROR_PERM_STR_TOO_MANY_INST_GROUPS     RM_ERROR_BASE-5
229 /** Permissions string has more than assignment.
230  *  Ex: assignments = <12 1>, "iux = (RM_Client_Delegate) = i"; */
231 #define RM_ERROR_PERM_STR_TOO_MANY_ASSIGN_CHARS    RM_ERROR_BASE-6
232 /** Permissions string contains invalid character */
233 #define RM_ERROR_PERM_STR_INVALID_CHAR             RM_ERROR_BASE-7
234 /** Permissions string contains a permission character without the assignment operator
235  *  Ex: assignments = <12 1>, "iux (RM_Client_Delegate)"; */
236 #define RM_ERROR_PERM_CHAR_WITHOUT_ASSIGN_CHAR     RM_ERROR_BASE-8
237 /** Permissions string contains a permission character on opposite side of already made assignment
238  *  Ex: assignments = <12 1>, "iux = (RM_Client_Delegate) x"; */
239 #define RM_ERROR_INVALID_PERMS_CHAR_ON_RIGHT       RM_ERROR_BASE-9
240 /** Policy resource node contains an unknown property */
241 #define RM_ERROR_UNKNOWN_POLICY_RESOURCE_PROPERTY  RM_ERROR_BASE-10
242 /** Instance name provided in "valid-instances" list is greater than RM_NAME_MAX_CHARS */
243 #define RM_ERROR_VALID_INST_NAME_TOO_LONG          RM_ERROR_BASE-11
244 /** Instance name in permissions assignment is greater than RM_NAME_MAX_CHARS */
245 #define RM_ERROR_INST_NAME_IN_ASSIGNMENT_TOO_LONG  RM_ERROR_BASE-12
246 /** NameServer name in global resource list nameServer assignment is greater than RM_NAME_MAX_CHARS */
247 #define RM_ERROR_GRL_NS_ASSIGNMENT_NAME_TOO_LONG   RM_ERROR_BASE-13
248 /** Linux alias assignment in global resource list is invalid */
249 #define RM_ERROR_GRL_INVALID_LINUX_ALIAS_FORMAT    RM_ERROR_BASE-14
250 /** Error allocating memory for the service handle */
251 #define RM_ERROR_SERVICE_HANDLE_MEM_ALLOC_FAILED   RM_ERROR_BASE-15
252 /** The RM instance service handle has already been opened */
253 #define RM_ERROR_SERVICE_HANDLE_ALREADY_OPENED     RM_ERROR_BASE-16
254 /** The RM instance service handle has already been closed */
255 #define RM_ERROR_SERVICE_HANDLE_ALREADY_CLOSED     RM_ERROR_BASE-17
256 /** Global Resource List (GRL) resource node contains an unknown property */
257 #define RM_ERROR_GRL_UNKNOWN_RESOURCE_PROPERTY     RM_ERROR_BASE-18
258 /** Could not find an allocator for the specified resource */
259 #define RM_ERROR_RES_ALLOCATOR_DOES_NOT_EXIST      RM_ERROR_BASE-19
260 /** A resource node is specified more than once in the Global Resource List (GRL) */
261 #define RM_ERROR_GRL_RES_SPECIFIED_MORE_THAN_ONCE  RM_ERROR_BASE-20
262 /** No data was found at the GRL resource node's specified Linux alias path */
263 #define RM_ERROR_DATA_NOT_FOUND_AT_LINUX_ALIAS     RM_ERROR_BASE-21
264 /** RM server was not provided a Global Resource List (GRL) and global policy at initialization */
265 #define RM_ERROR_INVALID_SERVER_CONFIGURATION      RM_ERROR_BASE-22
266 /** Service request type not recognized */
267 #define RM_ERROR_INVALID_SERVICE_TYPE              RM_ERROR_BASE-23
268 /** Service request did not contain callback function.  Callback function must always be provided
269  *  with service request since blocking or non-blocking operations cannot be promised. */
270 #define RM_ERROR_CALLBACK_NOT_PROVIDED             RM_ERROR_BASE-24
271 /** rmAllocPkt transport callout returned NULL for rmPkt */
272 #define RM_ERROR_TRANSPORT_ALLOC_PKT_ERROR         RM_ERROR_BASE-25
273 /** rmSendPkt transport callout returned error when attempting to send the rmPkt */
274 #define RM_ERROR_TRANSPORT_SEND_ERROR              RM_ERROR_BASE-26
275 /** A RM service transaction could not be created for the service request */
276 #define RM_ERROR_SERVICE_TRANS_NOT_CREATED         RM_ERROR_BASE-27
277 /** RM service transaction could not be found in instance's transaction queue */
278 #define RM_ERROR_SERVICE_TRANS_DOES_NOT_EXIST      RM_ERROR_BASE-28
279 /** NameServer does not exist in instance, cannot satisfy NameServer service request */
280 #define RM_ERROR_NAMESERVER_DOES_NOT_EXIST         RM_ERROR_BASE-29
281 /** Service request to add a name to the NameServer failed */
282 #define RM_ERROR_NAMESERVER_NAME_ADD_FAILED        RM_ERROR_BASE-30
283 /** Could not find name specified in service request in NameServer */
284 #define RM_ERROR_NAMESERVER_NAME_DOES_NOT_EXIST    RM_ERROR_BASE-31
285 /** Service request made on Client or CD when no transport established and no static policy registered */
286 #define RM_ERROR_REQ_FAILED_NO_STATIC_POLICY       RM_ERROR_BASE-32
287 /** RM transport handle has not been registered with the RM instance */
288 #define RM_ERROR_TRANSPORT_HANDLE_DOES_NOT_EXIST   RM_ERROR_BASE-33
289 /** RM received a packet with an unknown RM packet type */
290 #define RM_ERROR_RECEIVED_INVALID_PACKET_TYPE      RM_ERROR_BASE-34
291 /** RM response packet does not match any requests sent from instance */
292 #define RM_ERROR_PKT_RESP_DOES_NOT_MATCH_ANY_REQ   RM_ERROR_BASE-35
293 /** Server attempted to connect to another server or a CD attempted to connect to another CD or
294  *  Client attempted to connect to another client */
295 #define RM_ERROR_INVALID_REMOTE_INST_TYPE          RM_ERROR_BASE-36
296 /** RM client attempted to register with more than one Server or CD or a CD attempted to register 
297  *  with more than one Server */
298 #define RM_ERROR_ALREADY_REGD_SERVER_OR_CD         RM_ERROR_BASE-37
299 /** Transport registration callout function pointers specified as valid but were NULL */
300 #define RM_ERROR_NULL_CALLOUTS_WHEN_VALID          RM_ERROR_BASE-38
301 /** Service has both a NameServer name and a base, length, or alignment specified */
302 #define RM_ERROR_NS_NAME_AND_RES_VAL_CONFLICT      RM_ERROR_BASE-39
303 /** Instance type not recognized */
304 #define RM_ERROR_INVALID_INST_TYPE                 RM_ERROR_BASE-40
305 /** Linux DTB alias properties specified in GRL but no Linux DTB provided during server instance init */
306 #define RM_ERROR_GRL_LINUX_ALIAS_BUT_NO_DTB        RM_ERROR_BASE-41
307 /** RM attempted to allocate a transport packet but the rmAllocPkt callout was not registered */
308 #define RM_ERROR_TRANSPORT_ALLOC_PKT_NOT_REGD      RM_ERROR_BASE-42
309 /** RM attempted to send a packet but the rmSendPkt callout was not registered */
310 #define RM_ERROR_TRANSPORT_SEND_NOT_REGD           RM_ERROR_BASE-43
312 /** 
313  * @brief Maximum number of characters allowed for RM instance, resource, and
314  *        NameServer names.
315  */
316 #define RM_NAME_MAX_CHARS (32)
318 /** 
319  * @brief RM instance handle.  The RM handle is used to register transports
320  *        between RM instances and request resource services from the RM
321  *        instance.
322  */
323 typedef void *Rm_Handle;
325 /** 
326  * @brief RM instance types
327  */
328 typedef enum {
329     /** RM Server */
330     Rm_instType_SERVER = 0,
331     /** RM Client Delegate */
332     Rm_instType_CLIENT_DELEGATE,
333     /** RM Client */
334     Rm_instType_CLIENT,
335     /** DO NOT USE: Last type */
336     Rm_instType_LAST
337 } Rm_InstType;
339 /**
340  * @brief RM server initialization configurations
341  */
342 typedef struct {
343     /** Pointer to the device global resource list (GRL).  The GRL contains 
344      *  all resources on the device that will be managed by RM.  The GRL
345      *  must be in DTB format. */
346     void *globalResourceList;
347     /** Pointer to the Linux DTB if the RM server is running on ARM Linux.
348      *  The Linux DTB will be parsed for all managed resources reserved for use
349      *  by Linux.  Parsing will be based on "linux-dtb-alias" resource
350      *  properties found in the GRL.  The Linux DTB must be in DTB format.  */
351     void *linuxDtb;    
352     /** Pointer to the global policy defining the allocation policies for
353      *  RM instances within the system.  The global policy must be in DTB
354      *  format. */
355     void *globalPolicy;    
356 } Rm_ServerCfg;
358 /**
359  * @brief RM client delegate (CD) initialization configurations
360  */
361 typedef struct {
362     /** Pointer to a static policy used by the CD to allocate resources statically.
363      *  Static allocations can occur before the instance has been attached to a server
364      *  instance within the RM system.  This is useful for allocating resources
365      *  prior to main().  Resources allocated via the static policy will be verified
366      *  against the global policy once the CD connects with the server.  The static
367      *  policy must be in DTB format. */
368     void *staticPolicy;
369 } Rm_ClientDelegateCfg;
371 /**
372  * @brief RM client initialization configurations
373  */
374 typedef struct {
375     /** Pointer to a static policy used by the client to allocate resources statically.
376      *  Static allocations can occur before the instance has been attached to a server
377      *  or CD instance within the RM system.  This is useful for allocating resources
378      *  prior to main().  Resources allocated via the static policy will be verified
379      *  against the global policy once the client connects with the server (directly or
380      *  indirectly through a CD).  The static policy must be in DTB format. */
381     void *staticPolicy;
382 } Rm_ClientCfg;
384 /** 
385  * @brief RM instance initialization structure
386  */
387 typedef struct {
388     /** Pointer to a character array containing the instance name.  The name of the 
389      *  RM instance can be no greater than #RM_NAME_MAX_CHARS.  The instance name
390      *  must match an instance name defined in the "valid-instances" lists contained
391      *  in the global and static policy DTS files.  Resources and privileges to the
392      *  resources will be based on the name assigned to the RM instance*/
393     char *instName;
394     /** The type of RM instance that will be created. */
395     Rm_InstType instType;
396     /** Instance-type specific configurations */
397     union {
398         /** #Rm_ServerCfg */
399         Rm_ServerCfg serverCfg;
400         /** #Rm_ClientDelegateCfg */
401         Rm_ClientDelegateCfg cdCfg;
402         /** #Rm_ClientCfg */
403         Rm_ClientCfg clientCfg;
404     } instCfg;
405 } Rm_InitCfg;
407 /**
408  *  @b Description
409  *  @n  
410  *      This function prints the status for all resources managed by the
411  *      RM instance network.  The allocate/free status as well as ownership
412  *      status will be printed for every resource.  Also, the NameServer name
413  *      entries will be displayed.
414  *
415  *      This function only prints resources when provided the server handle
416  *      since the server stores all the resource and NameServer
417  *      data structures.
418  *
419  *  @param[in]  rmServerHandle
420  *      Server instance handle.
421  */
422 void Rm_printResourceStatus(Rm_Handle rmServerHandle);
424 /**
425  *  @b Description
426  *  @n  
427  *      This function prints the current status of a RM instance.  The
428  *      following instance properties will be printed:
429  *      a) instance name & type
430  *      b) The instance's registered transports 
431  *      c) All service transactions queued in the instance transaction
432  *         queue and their states
433  *
434  *  @param[in]  rmHandle
435  *      Instance handle.
436  */
437 void Rm_printInstanceStatus(Rm_Handle rmHandle);
439 /**
440  *  @b Description
441  *  @n  
442  *      This function initializes a RM instance.  There are no restrictions
443  *      on the amount of times this function can be called.  Each call will
444  *      result in a new RM instance.  However, a network of RM instances
445  *      can have only one RM Server.  If an application has multiple RM
446  *      Servers the resources managed by each server must be mutually
447  *      exclusive.
448  *
449  *      If any errors are encountered during the initialization process
450  *      the Rm_Handle returned will be NULL.
451  *
452  *  @param[in]  initCfg
453  *      Pointer to the instance initialization structure.
454  *
455  *  @param[out] result
456  *      Pointer to a signed int used to return any errors encountered during
457  *      the instance initialization process.
458  *
459  *  @retval
460  *      Success - Rm_Handle for instance and result = #RM_OK
461  *  @retval
462  *      Failure - NULL Rm_Handle and result < #RM_OK
463  */
464 Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result);
466 /**
467  *  @b Description
468  *  @n  
469  *      The function is used to get the version information of RM.
470  *
471  *  @retval
472  *      Version Information.
473  */
474 uint32_t Rm_getVersion (void);
476 /**
477  *  @b Description
478  *  @n  
479  *      The function is used to get the version string for RM.
480  *
481  *  @retval
482  *      Version String.
483  */
484 const char* Rm_getVersionStr (void);
486 /** 
487 @} 
488 */
490 #ifdef __cplusplus
492 #endif
494 #endif /* RM_H_ */