Small API cleanup more doxygenination
authorJustin Sobota <jsobota@ti.com>
Tue, 5 Feb 2013 23:21:21 +0000 (18:21 -0500)
committerJustin Sobota <jsobota@ti.com>
Tue, 5 Feb 2013 23:21:21 +0000 (18:21 -0500)
16 files changed:
include/rm_loc.h
rm.h
rm_services.h
src/rm.c
src/rm_policy.c
src/rm_services.c
test/Module.xs
test/dts_files/global-resources.dtb [moved from device/tci6614-global-resources.dtb with 100% similarity]
test/dts_files/global-resources.dts [moved from device/tci6614-global-resources.dts with 95% similarity]
test/dts_files/linux-evm.dtb [moved from device/tci6614-linux-evm.dtb with 100% similarity]
test/dts_files/linux-evm.dts [moved from device/tci6614-linux-evm.dts with 100% similarity]
test/dts_files/server-policy.dtb [moved from device/tci6614-server-policy.dtb with 100% similarity]
test/dts_files/server-policy.dts [moved from device/tci6614-server-policy.dts with 100% similarity]
test/dts_files/static-policy.dtb [moved from device/tci6614-static-policy.dtb with 100% similarity]
test/dts_files/static-policy.dts [moved from device/tci6614-static-policy.dts with 100% similarity]
test/rm_test.c

index 8ae409064e6eb7a22404c02d1c05601efc4c613e..870b7bea5134762574ce3151337eb7d426de055f 100644 (file)
@@ -163,10 +163,7 @@ typedef struct {
 Rm_Transaction *rmTransactionQueueAdd(Rm_Inst *rmInst);
 Rm_Transaction *rmTransactionQueueFind(Rm_Inst *rmInst, uint32_t transactionId);
 int32_t rmTransactionQueueDelete(Rm_Inst *rmInst, uint32_t transactionId);
-uint32_t rmTransactionGetSequenceNum(Rm_Inst *rmInst);
 Rm_Allocator *rmAllocatorFind(Rm_Allocator *allocatorList, char *resourceName);
-void rmTransactionResponder (Rm_Inst *rmInst, Rm_Transaction *transaction);
-void rmTransactionForwarder (Rm_Inst *rmInst, Rm_Transaction *transaction);
 void rmTransactionProcessor (Rm_Inst *rmInst, Rm_Transaction *transaction);
 
 #ifdef __cplusplus
diff --git a/rm.h b/rm.h
index 87d6920500b5210e501fc402993c282fe62a380e..4e277c7519178dc2b418fca9fef3d2d8b9c946b2 100644 (file)
--- a/rm.h
+++ b/rm.h
@@ -56,7 +56,7 @@ extern "C" {
  *
  *   @section intro  Introduction
  *
- *   The Resource Manager low level driver (RM LLD) is designed to provide initialization and permissions checking
+ *   The Resource Manager 
  *  
  */
  
@@ -68,11 +68,11 @@ extern "C" {
 /** @} */
 
 /**
-@defgroup RM_TRANSPORT_API  RM Transport-Layer API
+@defgroup RM_TRANSPORT_API  RM Transport API
 @ingroup RM_API
 */
 /**
-@defgroup RM_SERVICES_API  RM Registered Component Services API
+@defgroup RM_SERVICES_API  RM Services API
 @ingroup RM_API
 */
 /**
@@ -85,7 +85,7 @@ extern "C" {
 @{
 */
 
-/** RM return and Error Codes */
+/* RM return and error codes */
 /** RM successful return code */
 #define RM_OK                                      0
 /** RM processing requested service */
@@ -135,12 +135,12 @@ extern "C" {
  *  are in sync */
 #define RM_SERVICE_DENIED_RM_INSTANCE_LOCKED       RM_SERVICE_DENIED_BASE+16
 
-/** See libfdt.h for error codes -1 through -13 */
+/** Start of libfdt.h error codes */
 #define RM_ERROR_LIBFDT_START                      (-1)
-/** See libfdt.h for error codes -1 through -13 */
+/** End of libfdt.h error codes */
 #define RM_ERROR_LIBFDT_END                        (-13)
 
-/** RM Error Base */       
+/** RM error base */       
 #define RM_ERROR_BASE                              (-64)
 /** Instance name provided is NULL or greater than RM_NAME_MAX_CHARS */
 #define RM_ERROR_INVALID_INST_NAME                 RM_ERROR_BASE-1
@@ -230,7 +230,7 @@ extern "C" {
 #define RM_ERROR_NS_NAME_AND_RES_VAL_CONFLICT      RM_ERROR_BASE-39
 /** Instance type not recognized */
 #define RM_ERROR_INVALID_INST_TYPE                 RM_ERROR_BASE-40
-/** Linux DTB alias properties specified in GRL but not Linux DTB provided during server instance init */
+/** Linux DTB alias properties specified in GRL but no Linux DTB provided during server instance init */
 #define RM_ERROR_GRL_LINUX_ALIAS_BUT_NO_DTB        RM_ERROR_BASE-41
 
 /** 
@@ -240,14 +240,14 @@ extern "C" {
 #define RM_NAME_MAX_CHARS (32)
 
 /** 
- * @brief RM Handle provided to application.  The RM Handle is used by the
- *        application to distinquish between different RM instances running on
- *        the same core.
+ * @brief RM instance handle.  The RM handle is used to register transports
+ *        between RM instances and request resource services from the RM
+ *        instance.
  */
 typedef void *Rm_Handle;
 
 /** 
- * @brief RM Instance types
+ * @brief RM instance types
  */
 typedef enum {
     /** RM Server */
@@ -260,51 +260,48 @@ typedef enum {
     Rm_instType_LAST
 } Rm_InstType;
 
+/**
+ * @brief RM server initialization configurations
+ */
 typedef struct {
-    /** [Server Parameter] Pointer to the device-wide resource list.  The list
-     *  contains all resources available on the device available for 
-     *  allocation.  Servers running on ARM-Linux cores provide a subset
-     *  of the global device list for allocation.  The subset is formed from
-     *  the global resources leftover after the Linux DTB is parsed for 
-     *  resources reserved by Linux.  
-     *  
-     *  Note: This parameter will be ignored when the instance type is either 
-     *  Client Delegate or Client */
+    /** Pointer to the device global resource list (GRL).  The GRL contains 
+     *  all resources on the device that will be managed by RM.  The GRL
+     *  must be in DTB format. */
     void *globalResourceList;
-    /** [Server Parameter When Running on ARM Linux] Pointer to the Linux DTB.  
-     *  The Linux DTB will be parsed for all tracked resources reserved for use
-     *  by Linux.
-     *  
-     *  Note: This parameter will be ignored when the instance type is either 
-     *  Client Delegate or Client */
+    /** Pointer to the Linux DTB if the RM server is running on ARM Linux.
+     *  The Linux DTB will be parsed for all managed resources reserved for use
+     *  by Linux.  Parsing will be based on "linux-dtb-alias" resource
+     *  properties found in the GRL.  The Linux DTB must be in DTB format.  */
     void *linuxDtb;    
-    /** [Server Paramter] Pointer to the allocation
-     *  policy.  RM Servers should be initialized with the global policy 
-     *  listing for all RM instances within the system.  RM Client Delegates 
-     *  can be initialized with their local policy, must be a subset of the 
-     *  global policy provided to the Client Delegate's Server.
-     *
-     *  Note: The core charged with the task of initializing the BIOS and IPC
-     *        components must run an RM Client Delegate with an initial policy
-     *        that allocates a system timer to BIOS and a HW semaphore to IPC
-     *  
-     *  Note: This parameter will be ignored when the instance type is a 
-     *        Client 
-     */
+    /** Pointer to the global policy defining the allocation policies for
+     *  RM instances within the system.  The global policy must be in DTB
+     *  format. */
     void *globalPolicy;    
 } Rm_ServerCfg;
 
+/**
+ * @brief RM client delegate (CD) initialization configurations
+ */
 typedef struct {
-    /** static policy used for pre-main allocation of resources.  Resources given
-     *  in the static will be verified against the global policy once the RM
-     *  system is fully initialized */
+    /** Pointer to a static policy used by the CD to allocate resources statically.
+     *  Static allocations can occur before the instance has been attached to a server
+     *  instance within the RM system.  This is useful for allocating resources
+     *  prior to main().  Resources allocated via the static policy will be verified
+     *  against the global policy once the CD connects with the server.  The static
+     *  policy must be in DTB format. */
     void *staticPolicy;
 } Rm_ClientDelegateCfg;
 
+/**
+ * @brief RM client initialization configurations
+ */
 typedef struct {
-    /** static policy used for pre-main allocation of resources.  Resources given
-     *  in the static will be verified against the global policy once the RM
-     *  system is fully initialized */
+    /** Pointer to a static policy used by the client to allocate resources statically.
+     *  Static allocations can occur before the instance has been attached to a server
+     *  or CD instance within the RM system.  This is useful for allocating resources
+     *  prior to main().  Resources allocated via the static policy will be verified
+     *  against the global policy once the client connects with the server (directly or
+     *  indirectly through a CD).  The static policy must be in DTB format. */
     void *staticPolicy;
 } Rm_ClientCfg;
 
@@ -312,31 +309,93 @@ typedef struct {
  * @brief RM instance initialization structure
  */
 typedef struct {
-    /** Pointer to RM instance name character array.  The name of the RM instance must
-     *  be reflected exactly in the initial RM policies provided to the RM
-     *  tree's Servers and Client Delegates.  The RM instance name is
-     *  used by the policy to map which instances are allowed defined 
-     *  privileges */
+    /** Pointer to a character array containing the instance name.  The name of the 
+     *  RM instance can be no greater than #RM_NAME_MAX_CHARS.  The instance name
+     *  must match an instance name defined in the "valid-instances" lists contained
+     *  in the global and static policy DTS files.  Resources and privileges to the
+     *  resources will be based on the name assigned to the RM instance*/
     char *instName;
-    /** RM instance type.  Defines whether the RM instance will be initialized
-     *  as a RM Server, Client Delegate, or Client */
+    /** The type of RM instance that will be created. */
     Rm_InstType instType;
+    /** Instance-type specific configurations */
     union {
+        /** #Rm_ServerCfg */
         Rm_ServerCfg serverCfg;
+        /** #Rm_ClientDelegateCfg */
         Rm_ClientDelegateCfg cdCfg;
+        /** #Rm_ClientCfg */
         Rm_ClientCfg clientCfg;
     } instCfg;
 } Rm_InitCfg;
 
-/** 
-@} 
-*/
+/**
+ *  @b Description
+ *  @n  
+ *      This function prints 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 only prints resources when provided the server handle
+ *      since the server stores all the resource and NameServer
+ *      data structures.
+ *
+ *  @param[in]  rmServerHandle
+ *      Server instance handle.
+ */
+void Rm_printResourceStatus(Rm_Handle rmServerHandle);
 
-void Rm_printResourceStatus(Rm_Handle *rmHandle);
+/**
+ *  @b Description
+ *  @n  
+ *      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.
+ *
+ *      If any errors are encountered during the initialization process
+ *      the Rm_Handle returned will be NULL.
+ *
+ *  @param[in]  initCfg
+ *      Pointer to the instance initialization structure.
+ *
+ *  @param[out] result
+ *      Pointer to a signed int used to return any errors encountered during
+ *      the instance initialization process.
+ *
+ *  @retval
+ *      Success - Rm_Handle for instance and result = #RM_OK
+ *  @retval
+ *      Failure - NULL Rm_Handle and result < #RM_OK
+ */
 Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result);
+
+/**
+ *  @b Description
+ *  @n  
+ *      The function is used to get the version information of RM.
+ *
+ *  @retval
+ *      Version Information.
+ */
 uint32_t Rm_getVersion (void);
+
+/**
+ *  @b Description
+ *  @n  
+ *      The function is used to get the version string for RM.
+ *
+ *  @retval
+ *      Version String.
+ */
 const char* Rm_getVersionStr (void);
 
+/** 
+@} 
+*/
+
 #ifdef __cplusplus
 }
 #endif
index 4969f7445e9d4e363d854fc151e7c01eae0e664b..1437be30e38fe3ff5de30dfab3c84a858862c5e2 100644 (file)
@@ -65,109 +65,121 @@ typedef enum {
     Rm_service_RESOURCE_ALLOCATE_USE,
     /** RM resource free service */
     Rm_service_RESOURCE_FREE,
-    /** RM resource mapping to name service */
+    /** RM NameServer map resource to name service */
     Rm_service_RESOURCE_MAP_TO_NAME,
-    /** RM resource get by name service */
+    /** RM NameServer get resource by name service */
     Rm_service_RESOURCE_GET_BY_NAME,
-    /** RM resource name unmapping service */
+    /** RM NameServer unmap resource from name service */
     Rm_service_RESOURCE_UNMAP_NAME,
     /** DO NOT USE: Last type */
     Rm_service_LAST
 } Rm_ServiceType;
 
 /** 
- * @brief RM service response information provided by RM back to the 
- *        requesting component
+ * @brief RM service response information used by RM to provide service
+ *        request results back to the application components
  */
 typedef struct {
-    /** State of the service request.
-     *  Non-negative result: RM has taken an action based on the request
-     *  Negative result: RM has encountered an error handling the request */
+    /** Service request state.  The state can be an approval, denial, or error.
+     *  The latter codes start at #RM_OK, #RM_SERVICE_DENIED_BASE, and 
+     *  #RM_ERROR_BASE, respectively. */
     int32_t serviceState;
-    /** A service ID will be returned to the component if the requested service cannot
-     *  be completed immediately.  The service ID can be used by the component to identify
-     *  service responses received via the component callback function.  A service ID will not
-     *  be returned if the service request is satisfied immediately */
+    /** The service ID is returned to the application in order to match service
+     *  responses received at a later time via the provided callback function
+     *  because RM required a blocking operation in order to satisfy the
+     *  resource request. */
     uint32_t serviceId;
-    /** The name of the resource affected by the service request */
+    /** Affected resource name */
     char resourceName[RM_NAME_MAX_CHARS];
-    /** The base value of the returned resource.  In the case of a block resource allocation 
-     *  response this field will contain the base value of the block. */
+    /** The resource base value allocated, freed, or mapped to NameServer name. */
     int32_t resourceBase;
-    /** The number of resources starting from resourceBase allocated in block requests */
+    /** The resource length starting at base allocated, freed, or mapped to
+     *  NameServer name. */
     uint32_t resourceLength;
 } Rm_ServiceRespInfo;
 
 /** 
- * @brief RM service callback function structure
+ * @brief RM service callback function
  */
 typedef struct {
-    /** Component callback function.  RM will call this function when the 
-     *  resource service request is completed. The callback function supplied
-     *  for this parameter must match this function pointer prototype. */
+    /** Component callback function.  RM calls this function when a blocking 
+     *  resource service request is complete. The callback function supplied
+     *  for this parameter must match the function pointer prototype. */
     void (*serviceCallback) (Rm_ServiceRespInfo *serviceResponse);
 } Rm_ServiceCallback;
 
 /** 
- * @brief RM service request information provided by the requesting component
+ * @brief RM service request information
  */
 typedef struct {
-    /** The type of RM service requested */
+    /** The type of service requested */
     Rm_ServiceType type;
-    /** Pointer to the name of the resource requested.  The 
-     *  name provided by the component must match the resource node names
-     *  provided in the global resource table and allocation policies */
+    /** Pointer to an array containing the resource name affected by
+     *  the request.  The resource name must match a resource node name
+     *  defined in the GRL and global/static policy.  The request will be
+     *  denied if the resource name does not match any resource node names
+     *  in the policy */
     char *resourceName;
-/** An allocate service can be requested with an unspecified resource base. 
- *  If this occurs the RM Client Delegate or Server will assign the next available
- *  resource or set of resources based on the allocation type. */
+/** Informs RM to find the next available resource block of length
+ *  resourceLength and alignment resourceAlignment for allocation.  This
+ *  parameter is only valid for resource allocate service types. */
 #define RM_RESOURCE_BASE_UNSPECIFIED (-1)  
-    /** The resource base value. */
+    /** The base value of the resource affected by the service request.
+     *  #RM_RESOURCE_BASE_UNSPECIFIED can be substituted. */
     int32_t resourceBase;
-    /** The number of the specified resource to be allocated starting from 
-     *  resourceBase.  Will be greater than one only for block allocate
-     *  and free service requests. */
+    /** The resource length, starting from #resourceBase affected by the
+     *  service request. */
     uint32_t resourceLength;
-/** An allocate service can be requested with an unspecified resource alignment.
- *  WARNING: Only applicapable if resourceBase is unspecified
- *
- *  If the alignment is unspecified the RM Client Delegate or Server will allocate
- *  the resources from a default alignment as specified in the global policy. */
+/** Informs RM to find the next available resource block with length
+ *  resourceLength and the alignment specified in 
+ *  a) The resource node in the policy if it has the "allocation-alignment"
+ *     property defined.
+ *  b) The default alignment of 1 if no alignment is specified in the policy
+ *     for the resource.
+ *  This value is only valid if resourceBase is set to 
+ *  #RM_RESOURCE_BASE_UNSPECIFIED */
 #define RM_RESOURCE_ALIGNMENT_UNSPECIFIED (-1)      
-    /** Resource alignment in block allocation requests */
+    /** Alignment of the resource affected by the service request.  Only valid
+     *  if resourceBase is set to #RM_RESOURCE_BASE_UNSPECIFIED.
+     *  #RM_RESOURCE_ALIGNMENT_UNSPECIFIED can be substituted. */
     int32_t resourceAlignment;
-    /** The name server name associated with the resource.  Used only for 
-     *  allocate and free by name service requests */
+    /** The NameServer name associated, or to be associated, with a resource. 
+     *  If the service type is #Rm_service_RESOURCE_GET_BY_NAME and the
+     *  #resourceBase and #resourceLength fields are not NULL a error will
+     *  occur. */
     char *resourceNsName;
-    /** Component specified callback function used by RM to inform components
-     *  of service requst results */
+    /** Callback function used by RM to provide responses back to application
+     *  components after a service request resulted in a blocking operation. */
     Rm_ServiceCallback callback;
 } Rm_ServiceReqInfo;
 
 /** 
- * @brief RM Service Handle provided to software components and applications that 
- *        request RM services for the resources they wish to use
+ * @brief RM service handle provided to application components for requesting
+ *        services
  */
 typedef struct {
-    /** RM instance handle for which the service handle was registered */
+    /** RM instance handle for which the service handle was allocated from. */
     void *rmHandle;
     /**
      *  @b Description
      *  @n  
-     *      Callout function used by components to request a resource service 
-     *      from a RM instance
+     *      Processes service requests from application components.  Responses
+     *      are returned immediately if the service request could be satisfied 
+     *      without blocking.  If the service request requires a blocking operation,
+     *      such as forwarding the service request to another instance for
+     *      validation, the response will be received via the Rm_ServerCallback
      *
      *   @param[in] rmHandle
-     *      RM instance handle specifying the RM instance that should handle the
-     *      service request
+     *      RM instance handle specifies the instance that handles the service
+     *      request.  The request's result, if policy checks are involved, will be
+     *      based on the permissions assigned to the rmHandle's instance name within
+     *      global/static policy.
      *  
      *  @param[in]  serviceRequest
-     *      Service request structure that provides details of the service requested from
-     *      the RM instance tied to this component
+     *      Pointer to the service request structure
      *
-     *  @param[in]  serviceResponse
-     *      Service response structure that provides details of RM's response to the
-     *      service request
+     *  @param[out]  serviceResponse
+     *      Pointer to a service response structure.
      */
     void (*Rm_serviceHandler)(void *rmHandle, Rm_ServiceReqInfo *serviceRequest,
                               Rm_ServiceRespInfo *serviceResponse);
@@ -178,17 +190,22 @@ typedef struct {
  *  @n  
  *      This function returns a RM service handle to the application to 
  *      provide services to software components (LLDs, BIOS, etc) that want to use RM
- *      for resource management.
+ *      for resource management. Only one service handle can be opened from
+ *      each RM instance.
  *
  *  @param[in]  rmHandle
- *      RM instance handle.  Used to return a Rm_ServicePort from an RM
- *      instance.
+ *      RM instance handle from which the service handle will be opened
+ *
+ *  @param[out] result
+ *      Pointer to a signed int used to return any errors encountered during
+ *      the instance initialization process.
  *
  *  @retval
- *      Success - RM Service Handle.  Used by an application or component to
- *                request a service from RM.
+ *      Success - Rm_ServiceHandle and result = #RM_OK
+ *  @retval
+ *      Failure - NULL Rm_ServiceHandle and result = #RM_ERROR_SERVICE_HANDLE_MEM_ALLOC_FAILED
  *  @retval
- *      Failure - NULL
+ *      Failure - NULL Rm_ServiceHandle and result = #RM_ERROR_SERVICE_HANDLE_ALREADY_OPENED
  */
 Rm_ServiceHandle *Rm_serviceOpenHandle(Rm_Handle rmHandle, int32_t *result);
 
@@ -199,6 +216,11 @@ Rm_ServiceHandle *Rm_serviceOpenHandle(Rm_Handle rmHandle, int32_t *result);
  *
  *  @param[in]  rmServiceHandle
  *      RM instance service handle to be closed.
+ *
+ *  @retval
+ *      Success - #RM_OK
+ *  @retval
+ *      Failure - #RM_ERROR_SERVICE_HANDLE_ALREADY_CLOSED
  */
 int32_t Rm_serviceCloseHandle(Rm_ServiceHandle *rmServiceHandle);
 
index 2ebbb3f39cf791580999e0f894654fbe15dd89a8..7e30a2eba5522a8433bc97157c7c1b799aece496 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
 const char  rmVersionStr[] = RM_VERSION_STR ":" __DATE__  ":" __TIME__;\r
 \r
 /**********************************************************************\r
- ********************** Internal Functions ****************************\r
+ ************************ Local Functions *****************************\r
  **********************************************************************/\r
 \r
-Rm_Transaction *rmTransactionQueueAdd(Rm_Inst *rmInst)\r
-{\r
-    Rm_Transaction *transactionQueue = rmInst->transactionQueue;\r
-    Rm_Transaction *newTransaction   = NULL;\r
-\r
-    newTransaction = Rm_osalMalloc(sizeof(Rm_Transaction));\r
-    if (newTransaction) {\r
-        memset((void *)newTransaction, 0, sizeof(Rm_Transaction));\r
-\r
-        newTransaction->localId = rmTransactionGetSequenceNum(rmInst);\r
-        newTransaction->nextTransaction = NULL;  \r
-        if (transactionQueue) {\r
-            while (transactionQueue->nextTransaction) {\r
-                transactionQueue = transactionQueue->nextTransaction;\r
-            }\r
-            transactionQueue->nextTransaction = newTransaction;\r
-        }\r
-        else {\r
-            rmInst->transactionQueue = newTransaction;\r
-        }\r
-    }\r
-    return (newTransaction);\r
-}\r
-\r
-Rm_Transaction *rmTransactionQueueFind(Rm_Inst *rmInst, uint32_t transactionId)\r
-{\r
-    Rm_Transaction *transaction = rmInst->transactionQueue;\r
-\r
-    while (transaction) {\r
-        if (transaction->localId == transactionId) {\r
-            break;             \r
-        }\r
-        transaction = transaction->nextTransaction;\r
-    }\r
-\r
-    return (transaction);\r
-}\r
-\r
-int32_t rmTransactionQueueDelete(Rm_Inst *rmInst, uint32_t transactionId)\r
-{\r
-    Rm_Transaction *transaction     = rmInst->transactionQueue;\r
-    Rm_Transaction *prevTransaction = NULL;\r
-    int32_t         retVal          = RM_OK;\r
-\r
-    while (transaction) {\r
-        if (transaction->localId == transactionId) {\r
-            break;             \r
-        }\r
-\r
-        prevTransaction = transaction;\r
-        transaction = transaction->nextTransaction;\r
-    }\r
-\r
-    if (transaction) {\r
-        if (prevTransaction == NULL) {\r
-            /* Transaction at start of queue. Map second transaction to start of queue \r
-             * as long as more than one transactions. */\r
-            rmInst->transactionQueue = transaction->nextTransaction;\r
-        }\r
-        else {\r
-            /* Transaction in middle or end of queue. */\r
-            prevTransaction->nextTransaction = transaction->nextTransaction;\r
-        }\r
-        Rm_osalFree((void *)transaction, sizeof(Rm_Transaction));\r
-    }\r
-    else {\r
-        retVal = RM_ERROR_SERVICE_TRANS_DOES_NOT_EXIST;\r
-    }    \r
-    return (retVal);\r
-}\r
-\r
-uint32_t rmTransactionInitSequenceNum(void)\r
+/* FUNCTION PURPOSE: Initializes a RM inst's transaction sequence number\r
+ ***********************************************************************\r
+ * DESCRIPTION: The RM instance transaction sequence number can never\r
+ *              have a value of 0 to avoid conflicts with transactions\r
+ *              that have a remoteOriginatingId of 0 (transaction ID\r
+ *              will be used as the remoteOriginatingId for\r
+ *              transactions that are responses to requests).\r
+ */\r
+uint32_t transactionInitSequenceNum(void)\r
 {\r
-    /* Sequence number can never have value of 0.  Avoids conflicts\r
-     * with non-response transactions that have remoteOriginatingId of 0 */\r
     return (1);\r
 }\r
 \r
-uint32_t rmTransactionGetSequenceNum(Rm_Inst *rmInst)\r
+/* FUNCTION PURPOSE: Provides a sequence number for new transactions\r
+ ***********************************************************************\r
+ * DESCRIPTION: Returns a sequence number for a new transaction\r
+ *              specific to a RM instance.  Handles rollover of\r
+ *              sequence number.\r
+ */\r
+uint32_t transactionGetSequenceNum(Rm_Inst *rmInst)\r
 {\r
     uint32_t sequenceNum = 0;\r
 \r
     if (rmInst->transactionSeqNum + 1 < rmInst->transactionSeqNum) {\r
-        /* Overflow */\r
+        /* Rollover */\r
         sequenceNum = rmInst->transactionSeqNum;\r
-        rmInst->transactionSeqNum = rmTransactionInitSequenceNum();\r
+        rmInst->transactionSeqNum = transactionInitSequenceNum();\r
     }\r
     else {\r
         sequenceNum = rmInst->transactionSeqNum++;\r
@@ -170,7 +111,13 @@ uint32_t rmTransactionGetSequenceNum(Rm_Inst *rmInst)
     return (sequenceNum);\r
 }\r
 \r
-Rm_Allocator *rmAllocatorAdd(Rm_Inst *rmInst, const char *resourceName)\r
+/* FUNCTION PURPOSE: Creates a resource allocator\r
+ ***********************************************************************\r
+ * DESCRIPTION: Returns a newly Created and initialized resource\r
+ *              The allocator is also stored in the RM instance\r
+ *              allocator list.            \r
+ */\r
+Rm_Allocator *allocatorAdd(Rm_Inst *rmInst, const char *resourceName)\r
 {\r
     Rm_Allocator *allocators   = rmInst->allocators;\r
     Rm_Allocator *newAllocator = NULL;\r
@@ -197,19 +144,13 @@ Rm_Allocator *rmAllocatorAdd(Rm_Inst *rmInst, const char *resourceName)
     return (newAllocator);\r
 }\r
 \r
-Rm_Allocator *rmAllocatorFind(Rm_Allocator *allocatorList, char *resourceName)\r
-{\r
-    while (allocatorList) {\r
-        if (strncmp(allocatorList->resourceName, resourceName, RM_NAME_MAX_CHARS) == 0) {\r
-            break;             \r
-        }\r
-        allocatorList = allocatorList->nextAllocator;\r
-    }\r
-\r
-    return (allocatorList);\r
-}\r
-\r
-int32_t rmAllocatorDelete(Rm_Inst *rmInst, char *resourceName)\r
+/* FUNCTION PURPOSE: Deletes a resource allocator\r
+ ***********************************************************************\r
+ * DESCRIPTION: Deletes a resource allocator based on the given\r
+ *              resource name.  The resource allocator will be\r
+ *              removed from the RM instance allocator list.\r
+ */\r
+int32_t allocatorDelete(Rm_Inst *rmInst, char *resourceName)\r
 {\r
     Rm_Allocator *allocator = rmInst->allocators;\r
     Rm_Allocator *prevAllocator = NULL;\r
@@ -238,7 +179,12 @@ int32_t rmAllocatorDelete(Rm_Inst *rmInst, char *resourceName)
     return (retVal);\r
 }\r
 \r
-void rmAddOwner(Rm_ResourceNode *node, void *serviceInstNode)\r
+/* FUNCTION PURPOSE: Adds an owner to an allocator resource\r
+ ***********************************************************************\r
+ * DESCRIPTION: Adds a RM instance node to a resource node's\r
+ *              list of owners.\r
+ */\r
+void addOwner(Rm_ResourceNode *node, void *serviceInstNode)\r
 {\r
     Rm_Owner *ownerList = node->ownerList;\r
     Rm_Owner *newOwner = NULL;\r
@@ -265,7 +211,13 @@ void rmAddOwner(Rm_ResourceNode *node, void *serviceInstNode)
     }\r
 }\r
 \r
-bool rmIsOwnedBy(Rm_ResourceNode *node, void *serviceInstNode)\r
+/* FUNCTION PURPOSE: Checks a resource node's ownership\r
+ ***********************************************************************\r
+ * DESCRIPTION: Returns TRUE if the provided instance node is\r
+ *              in the list of resource node owners.  Otherwise,\r
+ *              returns FALSE.\r
+ */\r
+bool isOwnedBy(Rm_ResourceNode *node, void *serviceInstNode)\r
 {\r
     Rm_Owner *owner = node->ownerList;\r
 \r
@@ -278,7 +230,12 @@ bool rmIsOwnedBy(Rm_ResourceNode *node, void *serviceInstNode)
     return(false);\r
 }\r
 \r
-bool rmCompareResourceNodeOwners(Rm_ResourceNode *node1, Rm_ResourceNode *node2)\r
+/* FUNCTION PURPOSE: Compares two resource node's owners\r
+ ***********************************************************************\r
+ * DESCRIPTION: Returns TRUE if the owners of two resource nodes \r
+ *              are equivalent.  Otherwise, returns FALSE.\r
+ */\r
+bool compareResourceNodeOwners(Rm_ResourceNode *node1, Rm_ResourceNode *node2)\r
 {\r
     Rm_Owner *node1Owners = node1->ownerList;\r
     Rm_Owner *node2Owners = node2->ownerList;\r
@@ -311,7 +268,12 @@ bool rmCompareResourceNodeOwners(Rm_ResourceNode *node1, Rm_ResourceNode *node2)
     return(true);\r
 }\r
 \r
-void rmDeleteOwner(Rm_ResourceNode *node, void *serviceInstNode)\r
+/* FUNCTION PURPOSE: Deletes an owner from an allocator resource\r
+ ***********************************************************************\r
+ * DESCRIPTION: Removes a RM instance node from a resource node's\r
+ *              list of owners.\r
+ */\r
+void deleteOwner(Rm_ResourceNode *node, void *serviceInstNode)\r
 {\r
     Rm_Owner *owner = node->ownerList;\r
     Rm_Owner *prevOwner = NULL;\r
@@ -336,7 +298,13 @@ void rmDeleteOwner(Rm_ResourceNode *node, void *serviceInstNode)
     Rm_osalFree((void *)owner, sizeof(Rm_Owner));\r
 }\r
 \r
-void rmCopyOwners(Rm_ResourceNode *dstNode, Rm_ResourceNode *srcNode)\r
+/* FUNCTION PURPOSE: Copies the owners of a resource node\r
+ ***********************************************************************\r
+ * DESCRIPTION: Creates a list of resource owners for the destination\r
+ *              resource node that is equivalent to the the \r
+ *              source resource node's owners\r
+ */\r
+void copyOwners(Rm_ResourceNode *dstNode, Rm_ResourceNode *srcNode)\r
 {\r
     Rm_Owner *srcOwnerList = srcNode->ownerList;\r
     Rm_Owner *dstNewOwner;\r
@@ -360,7 +328,12 @@ void rmCopyOwners(Rm_ResourceNode *dstNode, Rm_ResourceNode *srcNode)
     }\r
 }\r
 \r
-void rmClearOwners(Rm_ResourceNode *node)\r
+/* FUNCTION PURPOSE: Clears a resource node's owners\r
+ ***********************************************************************\r
+ * DESCRIPTION: Deletes all owners from the owners list of a \r
+ *              resource node.\r
+ */\r
+void clearOwners(Rm_ResourceNode *node)\r
 {\r
     Rm_Owner *owner = node->ownerList;\r
     Rm_Owner *nextOwner;\r
@@ -373,14 +346,20 @@ void rmClearOwners(Rm_ResourceNode *node)
     }\r
 }\r
 \r
-int32_t rmCreateTreeAllocator(Rm_Inst *rmInst, const char *resourceName, Rm_ResourceRange *range)\r
+/* FUNCTION PURPOSE: Creates a new resource tree\r
+ ***********************************************************************\r
+ * DESCRIPTION: Creates a new resource tree using the provided\r
+ *              resource name and value range.  The name and value\r
+ *              typically originate from the GRL.\r
+ */\r
+int32_t createResourceTree(Rm_Inst *rmInst, const char *resourceName, Rm_ResourceRange *range)\r
 {\r
     Rm_Allocator    *allocator = NULL;\r
     Rm_ResourceTree *treeRootEntry = NULL;\r
     Rm_ResourceNode *treeNode = NULL;\r
     Rm_ResourceNode *collidingNode = NULL;\r
 \r
-    allocator = rmAllocatorAdd(rmInst, resourceName);\r
+    allocator = allocatorAdd(rmInst, resourceName);\r
     treeRootEntry = Rm_osalMalloc(sizeof(Rm_ResourceTree));\r
     RB_INIT(treeRootEntry);\r
 \r
@@ -398,7 +377,7 @@ int32_t rmCreateTreeAllocator(Rm_Inst *rmInst, const char *resourceName, Rm_Reso
                 rmResourceNodeFree(treeNode);\r
                }\r
             Rm_osalFree((void *)treeRootEntry, sizeof(Rm_ResourceTree));\r
-            rmAllocatorDelete(rmInst, allocator->resourceName);\r
+            allocatorDelete(rmInst, allocator->resourceName);\r
             return (RM_ERROR_GRL_RES_SPECIFIED_MORE_THAN_ONCE);\r
         }\r
         range = range->nextRange;\r
@@ -408,13 +387,17 @@ int32_t rmCreateTreeAllocator(Rm_Inst *rmInst, const char *resourceName, Rm_Reso
     return(RM_OK);\r
 }\r
 \r
-/* Called when an allocate request is made but the base is unspecified.  RM must preallocate\r
- * resources which then must be checked against the RM policy for the instance.  If the\r
- * policy does not agree another resource(s) must be preallocated and tested against the \r
- * policy.  Policy will provide initialize the preallocate with the base that it allows\r
- * for the rm instance for the specified resource. */\r
-int32_t rmTreePreAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourcePolicy,\r
-                          Rm_AllocatorOpInfo *opInfo)\r
+/* FUNCTION PURPOSE: Preallocates a resource\r
+ ***********************************************************************\r
+ * DESCRIPTION: Called when an allocate request is made but the base \r
+ *              is unspecified.  The preallocation algorithm looks at \r
+ *              available resources as well as policy permissions to \r
+ *              determine a resource range that satisfies the request.\r
+ *              If a valid range is found it will be returned for the \r
+ *              treeAllocate algorithm to handle.\r
+ */\r
+int32_t treePreAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourcePolicy,\r
+                        Rm_AllocatorOpInfo *opInfo)\r
 {\r
     Rm_ResourceNode    findNode;\r
     Rm_ResourceNode   *matchingNode = NULL;\r
@@ -518,8 +501,19 @@ int32_t rmTreePreAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t reso
     return(retVal); \r
 }\r
 \r
-int32_t rmTreeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourcePolicy,\r
-                       Rm_AllocatorOpInfo *opInfo)\r
+/* FUNCTION PURPOSE: Allocates a resource\r
+ ***********************************************************************\r
+ * DESCRIPTION: Will attempt to allocate the resource with specified\r
+ *              base and length from the resource's allocator.  The\r
+ *              allocation algorithm will verify the allocation against\r
+ *              the policy permissions for the instance requesting the\r
+ *              allocation.  If the policy allows the allocation the \r
+ *              algorithm will allocate the resource then combine any\r
+ *              resource nodes that may have become equivalent (in terms\r
+ *              of ownership) after the allocation.\r
+ */\r
+int32_t treeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourcePolicy,\r
+                     Rm_AllocatorOpInfo *opInfo)\r
 {\r
     Rm_ResourceNode     findNode;\r
     Rm_ResourceNode    *matchingNode = NULL;\r
@@ -605,13 +599,13 @@ int32_t rmTreeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourc
                     leftNode = RB_PREV(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                     rightNode = RB_NEXT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                     RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
-                    rmAddOwner(matchingNode, opInfo->serviceSrcInstNode);\r
+                    addOwner(matchingNode, opInfo->serviceSrcInstNode);\r
 \r
-                    if (leftNode && rmCompareResourceNodeOwners(leftNode, matchingNode)) {\r
+                    if (leftNode && compareResourceNodeOwners(leftNode, matchingNode)) {\r
                         RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, leftNode);\r
                         combineLeft = true;\r
                     }\r
-                    if (rightNode && rmCompareResourceNodeOwners(rightNode, matchingNode)) {\r
+                    if (rightNode && compareResourceNodeOwners(rightNode, matchingNode)) {\r
                         RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, rightNode);\r
                         combineRight = true;\r
                     }\r
@@ -621,9 +615,9 @@ int32_t rmTreeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourc
                         matchingNode->base = leftNode->base;\r
                         matchingNode->length = leftNode->length + matchingNode->length + rightNode->length;\r
 \r
-                        rmClearOwners(leftNode);\r
+                        clearOwners(leftNode);\r
                         rmResourceNodeFree(leftNode);\r
-                        rmClearOwners(rightNode);\r
+                        clearOwners(rightNode);\r
                         rmResourceNodeFree(rightNode);                        \r
                     }\r
                     else if (combineLeft) {\r
@@ -631,7 +625,7 @@ int32_t rmTreeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourc
                         matchingNode->base = leftNode->base;\r
                         matchingNode->length += leftNode->length;\r
 \r
-                        rmClearOwners(leftNode);\r
+                        clearOwners(leftNode);\r
                         rmResourceNodeFree(leftNode);\r
                         RB_INSERT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, rightNode);                        \r
                     }\r
@@ -639,7 +633,7 @@ int32_t rmTreeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourc
                         /* Combine right and matching nodes.  Reinsert left. */\r
                         matchingNode->length += rightNode->length;\r
 \r
-                        rmClearOwners(rightNode);\r
+                        clearOwners(rightNode);\r
                         rmResourceNodeFree(rightNode);\r
                         RB_INSERT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, leftNode);\r
                     }\r
@@ -661,13 +655,13 @@ int32_t rmTreeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourc
                      */ \r
                     RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                     leftNode = rmResourceNodeNew(matchingNode->base, findNode.base - matchingNode->base);\r
-                    rmCopyOwners(leftNode, matchingNode);\r
+                    copyOwners(leftNode, matchingNode);\r
                     rightNode = rmResourceNodeNew(findNode.base + findNode.length, matchingEnd - findEnd);\r
-                    rmCopyOwners(rightNode, matchingNode);\r
+                    copyOwners(rightNode, matchingNode);\r
 \r
                     matchingNode->base = findNode.base;                                    \r
                     matchingNode->length = findNode.length;\r
-                    rmAddOwner(matchingNode, opInfo->serviceSrcInstNode);\r
+                    addOwner(matchingNode, opInfo->serviceSrcInstNode);\r
 \r
                     /* Insert all the nodes */\r
                     RB_INSERT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
@@ -685,16 +679,16 @@ int32_t rmTreeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourc
                         leftNode = RB_PREV(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                         RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                         /* Add allocating instance to owner list for compare with leftNode */\r
-                        rmAddOwner(matchingNode, opInfo->serviceSrcInstNode);\r
+                        addOwner(matchingNode, opInfo->serviceSrcInstNode);\r
                         \r
-                        if (leftNode && rmCompareResourceNodeOwners(leftNode, matchingNode)) {\r
+                        if (leftNode && compareResourceNodeOwners(leftNode, matchingNode)) {\r
                             RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, leftNode);\r
                             /* Combine leftNode and findNode */\r
                             leftNode->length += findNode.length;\r
                         }\r
                         else {\r
                             leftNode = rmResourceNodeNew(findNode.base, findNode.length);\r
-                            rmCopyOwners(leftNode, matchingNode);\r
+                            copyOwners(leftNode, matchingNode);\r
                         }\r
 \r
                         /* Account for leftNode in matchingNode */\r
@@ -713,9 +707,9 @@ int32_t rmTreeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourc
                         rightNode = RB_NEXT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                         RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                         /* Add allocating instance to owner list for compare with rightNode */\r
-                        rmAddOwner(matchingNode, opInfo->serviceSrcInstNode);\r
+                        addOwner(matchingNode, opInfo->serviceSrcInstNode);\r
                         \r
-                        if (rightNode && rmCompareResourceNodeOwners(rightNode, matchingNode)) {\r
+                        if (rightNode && compareResourceNodeOwners(rightNode, matchingNode)) {\r
                             RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, rightNode);\r
                             /* Combine rightNode and findNode */\r
                             rightNode->base = findNode.base;\r
@@ -723,7 +717,7 @@ int32_t rmTreeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourc
                         }\r
                         else {\r
                             rightNode = rmResourceNodeNew(findNode.base, findNode.length);\r
-                            rmCopyOwners(rightNode, matchingNode);\r
+                            copyOwners(rightNode, matchingNode);\r
                         }\r
 \r
                         /* Account for rightNode in matchingNode */\r
@@ -732,7 +726,7 @@ int32_t rmTreeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourc
                         RB_INSERT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, rightNode);\r
                     }\r
                     /* Remove allocating instance from leftover matchingNode */\r
-                    rmDeleteOwner(matchingNode, opInfo->serviceSrcInstNode);\r
+                    deleteOwner(matchingNode, opInfo->serviceSrcInstNode);\r
                     RB_INSERT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                 }\r
                 retVal = RM_SERVICE_APPROVED;\r
@@ -749,7 +743,19 @@ int32_t rmTreeAllocate(Rm_Inst *rmInst, Rm_Allocator *allocator, int32_t resourc
     return(retVal);        \r
 }\r
 \r
-int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)\r
+/* FUNCTION PURPOSE: Frees a resource\r
+ ***********************************************************************\r
+ * DESCRIPTION: Will attempt to free the resource with specified\r
+ *              base and length from the resource's allocator.  The\r
+ *              free algorithm will verify the free request parameters\r
+ *              match an allocated range for the resource and that the\r
+ *              range is owned by the instance requesting the free. If\r
+ *              the free is validated the algorithm will free the \r
+ *              resource then combine any resource nodes that may have\r
+ *              become equivalent (in terms of ownership) after the\r
+ *              allocation.\r
+ */\r
+int32_t treeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)\r
 {\r
     Rm_ResourceNode  findNode;\r
     Rm_ResourceNode *matchingNode = NULL;\r
@@ -772,7 +778,7 @@ int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
         \r
         if ((findNode.base >= matchingNode->base) && (findEnd <= matchingEnd)) {  \r
             if (matchingNode->allocationCount) {\r
-                if (rmIsOwnedBy(matchingNode, opInfo->serviceSrcInstNode)) {\r
+                if (isOwnedBy(matchingNode, opInfo->serviceSrcInstNode)) {\r
                     if ((findNode.base == matchingNode->base) && (findEnd == matchingEnd))\r
                     {\r
                         /* Case 1: Free range equals allocated matched node exactly. Attempt to combine \r
@@ -784,13 +790,13 @@ int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
                         leftNode = RB_PREV(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                         rightNode = RB_NEXT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                         RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
-                        rmDeleteOwner(matchingNode, opInfo->serviceSrcInstNode);\r
+                        deleteOwner(matchingNode, opInfo->serviceSrcInstNode);\r
 \r
-                        if (leftNode && rmCompareResourceNodeOwners(leftNode, matchingNode)) {\r
+                        if (leftNode && compareResourceNodeOwners(leftNode, matchingNode)) {\r
                             RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, leftNode);\r
                             combineLeft = true;\r
                         }\r
-                        if (rightNode && rmCompareResourceNodeOwners(rightNode, matchingNode)) {\r
+                        if (rightNode && compareResourceNodeOwners(rightNode, matchingNode)) {\r
                             RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, rightNode);\r
                             combineRight = true;\r
                         }\r
@@ -800,9 +806,9 @@ int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
                             matchingNode->base = leftNode->base;\r
                             matchingNode->length = leftNode->length + matchingNode->length + rightNode->length;\r
 \r
-                            rmClearOwners(leftNode);\r
+                            clearOwners(leftNode);\r
                             rmResourceNodeFree(leftNode);\r
-                            rmClearOwners(rightNode);\r
+                            clearOwners(rightNode);\r
                             rmResourceNodeFree(rightNode);                        \r
                         }\r
                         else if (combineLeft) {\r
@@ -810,7 +816,7 @@ int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
                             matchingNode->base = leftNode->base;\r
                             matchingNode->length += leftNode->length;\r
 \r
-                            rmClearOwners(leftNode);\r
+                            clearOwners(leftNode);\r
                             rmResourceNodeFree(leftNode);\r
                             RB_INSERT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, rightNode);                        \r
                         }\r
@@ -818,7 +824,7 @@ int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
                             /* Combine right and matching nodes.  Reinsert left. */\r
                             matchingNode->length += rightNode->length;\r
 \r
-                            rmClearOwners(rightNode);\r
+                            clearOwners(rightNode);\r
                             rmResourceNodeFree(rightNode);\r
                             RB_INSERT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, leftNode);\r
                         }\r
@@ -842,16 +848,16 @@ int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
                          * proper accounting of allocations in validInstance list\r
                          */ \r
                         RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
-                        rmDeleteOwner(matchingNode, opInfo->serviceSrcInstNode);\r
+                        deleteOwner(matchingNode, opInfo->serviceSrcInstNode);\r
                         \r
                         leftNode = rmResourceNodeNew(matchingNode->base, findNode.base - matchingNode->base);\r
-                        rmCopyOwners(leftNode, matchingNode);\r
-                        rmAddOwner(leftNode, opInfo->serviceSrcInstNode);\r
+                        copyOwners(leftNode, matchingNode);\r
+                        addOwner(leftNode, opInfo->serviceSrcInstNode);\r
                         RB_INSERT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, leftNode);\r
                         \r
                         rightNode = rmResourceNodeNew(findNode.base + findNode.length, matchingEnd - findEnd);\r
-                        rmCopyOwners(rightNode, matchingNode);\r
-                        rmAddOwner(rightNode, opInfo->serviceSrcInstNode);\r
+                        copyOwners(rightNode, matchingNode);\r
+                        addOwner(rightNode, opInfo->serviceSrcInstNode);\r
                         RB_INSERT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, rightNode);\r
 \r
                         matchingNode->base = findNode.base;                                    \r
@@ -870,16 +876,16 @@ int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
                             leftNode = RB_PREV(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                             RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                             /* Remove freeing instance from owner list for compare with leftNode */\r
-                            rmDeleteOwner(matchingNode, opInfo->serviceSrcInstNode);\r
+                            deleteOwner(matchingNode, opInfo->serviceSrcInstNode);\r
                             \r
-                            if (leftNode && rmCompareResourceNodeOwners(leftNode, matchingNode)) {\r
+                            if (leftNode && compareResourceNodeOwners(leftNode, matchingNode)) {\r
                                 RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, leftNode);\r
                                 /* Combine leftNode and findNode */\r
                                 leftNode->length += findNode.length;\r
                             }\r
                             else {\r
                                 leftNode = rmResourceNodeNew(findNode.base, findNode.length);\r
-                                rmCopyOwners(leftNode, matchingNode);\r
+                                copyOwners(leftNode, matchingNode);\r
                             }\r
 \r
                             /* Remove leftNode range from matchingNode */\r
@@ -898,9 +904,9 @@ int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
                             rightNode = RB_NEXT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                             RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode); \r
                             /* Remove freeing instance from owner list for compare with rightNode */\r
-                            rmDeleteOwner(matchingNode, opInfo->serviceSrcInstNode);\r
+                            deleteOwner(matchingNode, opInfo->serviceSrcInstNode);\r
                             \r
-                            if (rightNode && rmCompareResourceNodeOwners(rightNode, matchingNode)) {\r
+                            if (rightNode && compareResourceNodeOwners(rightNode, matchingNode)) {\r
                                 RB_REMOVE(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, rightNode);\r
                                 /* Combine rightNode and findNode */\r
                                 rightNode->base = findNode.base;\r
@@ -908,7 +914,7 @@ int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
                             }\r
                             else {\r
                                 rightNode = rmResourceNodeNew(findNode.base, findNode.length);\r
-                                rmCopyOwners(rightNode, matchingNode);\r
+                                copyOwners(rightNode, matchingNode);\r
                             }\r
 \r
                             /* Remove rightNode range from matchingNode */\r
@@ -917,7 +923,7 @@ int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
                         }\r
 \r
                         /* Add freeing instance back into matchingNode allocations */\r
-                        rmAddOwner(matchingNode, opInfo->serviceSrcInstNode);\r
+                        addOwner(matchingNode, opInfo->serviceSrcInstNode);\r
                         RB_INSERT(_Rm_AllocatorResourceTree, allocator->allocatorRootEntry, matchingNode);\r
                     }\r
 \r
@@ -941,7 +947,134 @@ int32_t rmTreeFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
     return(retVal);  \r
 }\r
 \r
-int32_t rmAllocatorOperation(Rm_Inst *rmInst, Rm_AllocatorOpInfo *opInfo)\r
+/* FUNCTION PURPOSE: Issues a service response to application\r
+ ***********************************************************************\r
+ * DESCRIPTION: Provides a service response back to the application\r
+ *              using the service callback function provided to\r
+ *              the RM instance at the time of the service request.\r
+ */\r
+void serviceResponder (Rm_Inst *rmInst, Rm_Transaction *transaction)\r
+{\r
+    Rm_ServiceRespInfo serviceResponse;\r
+\r
+    /* The responseTransaction will contain the resultant state details of\r
+     * the requestTransaction's service request */\r
+    serviceResponse.serviceState = transaction->state;\r
+    /* Pass back the ID that was provided to the component when it requested\r
+     * the service */\r
+    serviceResponse.serviceId = transaction->localId;\r
+\r
+    /* Service was approved and service was an allocate request.  The resource\r
+     * data is passed back to the component */\r
+    if ((serviceResponse.serviceState == RM_SERVICE_APPROVED) &&\r
+        ((transaction->type == Rm_service_RESOURCE_ALLOCATE_INIT) ||\r
+         (transaction->type == Rm_service_RESOURCE_ALLOCATE_USE) ||\r
+         (transaction->type == Rm_service_RESOURCE_GET_BY_NAME)))\r
+    {\r
+        strncpy(serviceResponse.resourceName, transaction->resourceInfo.name, RM_NAME_MAX_CHARS);\r
+        serviceResponse.resourceBase = transaction->resourceInfo.base;\r
+        serviceResponse.resourceLength = transaction->resourceInfo.length;\r
+    }\r
+\r
+    /* Issue the callback to the requesting component with the response information */\r
+    transaction->callback.serviceCallback(&serviceResponse);\r
+\r
+    /* Delete the transaction from the transaction queue */\r
+    rmTransactionQueueDelete(rmInst, transaction->localId);\r
+    return;\r
+}\r
+\r
+/* FUNCTION PURPOSE: Sends RM response packets\r
+ ***********************************************************************\r
+ * DESCRIPTION: Sends RM response packets to RM instance's that sent\r
+ *              RM request packets to the RM instance.  The response\r
+ *              is sent via the RM transport API which is plugged\r
+ *              with an application created transport path.\r
+ */\r
+void transactionResponder (Rm_Inst *rmInst, Rm_Transaction *transaction)\r
+{\r
+    Rm_Transport    *dstTransport = NULL;\r
+    Rm_PacketHandle  pktHandle = NULL;\r
+\r
+    dstTransport = rmTransportFindRemoteName((Rm_Transport *) rmInst->transports, transaction->pktSrcInstName);\r
+\r
+    switch (transaction->type) {\r
+        case Rm_service_RESOURCE_ALLOCATE_INIT:\r
+        case Rm_service_RESOURCE_ALLOCATE_USE:\r
+        case Rm_service_RESOURCE_FREE:\r
+        case Rm_service_RESOURCE_GET_BY_NAME:\r
+            pktHandle = rmTransportCreateResourceResponsePkt(rmInst, dstTransport->appTransportHandle, \r
+                                                             transaction);\r
+            break;\r
+        case Rm_service_RESOURCE_MAP_TO_NAME:\r
+        case Rm_service_RESOURCE_UNMAP_NAME:\r
+            pktHandle = rmTransportCreateNsResponsePkt(rmInst, dstTransport->appTransportHandle,\r
+                                                       transaction);\r
+            break;\r
+    }\r
+\r
+    if (pktHandle) {\r
+        if (rmInst->transportCallouts.rmSendPkt(dstTransport->appTransportHandle, pktHandle) < RM_OK) {\r
+            transaction->state = RM_ERROR_TRANSPORT_SEND_ERROR;\r
+        }\r
+    }\r
+    rmTransactionQueueDelete(rmInst, transaction->localId);\r
+}\r
+\r
+/* FUNCTION PURPOSE: Sends RM request packets\r
+ ***********************************************************************\r
+ * DESCRIPTION: Sends RM request packets to RM instance's that are\r
+ *              capable of forwarding or validating service requests.\r
+ *              The request is sent via the RM transport API which is\r
+ *              plugged with an application created transport path.\r
+ */\r
+void transactionForwarder (Rm_Inst *rmInst, Rm_Transaction *transaction)\r
+{\r
+    Rm_Transport    *dstTransport = NULL;\r
+    Rm_PacketHandle  pktHandle = NULL;\r
+\r
+    if (rmInst->registeredWithDelegateOrServer) {\r
+        if (rmInst->instType == Rm_instType_CLIENT) {\r
+            dstTransport = rmTransportFindRemoteInstType((Rm_Transport *) rmInst->transports, Rm_instType_CLIENT_DELEGATE);\r
+\r
+            if (!dstTransport) {\r
+                dstTransport = rmTransportFindRemoteInstType((Rm_Transport *) rmInst->transports, Rm_instType_SERVER);\r
+            }\r
+        } \r
+        else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {\r
+            dstTransport = rmTransportFindRemoteInstType((Rm_Transport *) rmInst->transports, Rm_instType_SERVER);\r
+        }\r
+\r
+        switch (transaction->type) {\r
+            case Rm_service_RESOURCE_ALLOCATE_INIT:\r
+            case Rm_service_RESOURCE_ALLOCATE_USE:\r
+            case Rm_service_RESOURCE_FREE:\r
+            case Rm_service_RESOURCE_GET_BY_NAME:\r
+                pktHandle = rmTransportCreateResourceReqPkt(rmInst, dstTransport->appTransportHandle, transaction);\r
+                break;\r
+            case Rm_service_RESOURCE_MAP_TO_NAME:\r
+            case Rm_service_RESOURCE_UNMAP_NAME:\r
+                pktHandle = rmTransportCreateNsRequestPkt(rmInst, dstTransport->appTransportHandle, transaction);\r
+                break;\r
+        }\r
+\r
+        if (pktHandle) {\r
+            if (rmInst->transportCallouts.rmSendPkt(dstTransport->appTransportHandle, pktHandle) < RM_OK) {\r
+                transaction->state = RM_ERROR_TRANSPORT_SEND_ERROR;\r
+            }\r
+        }\r
+\r
+        transaction->hasBeenForwarded = true;\r
+        /* Transaction not deleted.  Waiting for response from RM CD or Server */\r
+    }\r
+}\r
+\r
+/* FUNCTION PURPOSE: Issues an allocator operation\r
+ ***********************************************************************\r
+ * DESCRIPTION: Issues an allocator preallocate, allocate, or free\r
+ *              for an RM resource.\r
+ */\r
+int32_t allocatorOperation(Rm_Inst *rmInst, Rm_AllocatorOpInfo *opInfo)\r
 {\r
     Rm_Allocator *allocator = NULL;\r
     int32_t       resourceOffsetInPolicy;\r
@@ -952,13 +1085,13 @@ int32_t rmAllocatorOperation(Rm_Inst *rmInst, Rm_AllocatorOpInfo *opInfo)
     \r
     if ((resourceOffsetInPolicy > 0) && allocator) {\r
         if (opInfo->operation == Rm_allocatorOp_PRE_ALLOCATE) {\r
-            retVal = rmTreePreAllocate(rmInst, allocator, resourceOffsetInPolicy, opInfo);\r
+            retVal = treePreAllocate(rmInst, allocator, resourceOffsetInPolicy, opInfo);\r
         }               \r
         else if (opInfo->operation == Rm_allocatorOp_ALLOCATE) {\r
-            retVal = rmTreeAllocate(rmInst, allocator, resourceOffsetInPolicy, opInfo);\r
+            retVal = treeAllocate(rmInst, allocator, resourceOffsetInPolicy, opInfo);\r
         }\r
         else if (opInfo->operation == Rm_allocatorOp_FREE) {\r
-            retVal = rmTreeFree(allocator, opInfo);\r
+            retVal = treeFree(allocator, opInfo);\r
         }         \r
     }\r
     else {\r
@@ -968,8 +1101,18 @@ int32_t rmAllocatorOperation(Rm_Inst *rmInst, Rm_AllocatorOpInfo *opInfo)
     return(retVal);\r
 }\r
 \r
-void rmAllocationHandler (Rm_Inst *rmInst, Rm_Transaction *transaction, void *validInstNode,\r
-                          uint32_t allocType)\r
+/* FUNCTION PURPOSE: Arbitrates allocation service requests\r
+ ***********************************************************************\r
+ * DESCRIPTION: Issues a set of allocator operations in order to\r
+ *              handle a received allocation request.  Allocation\r
+ *              requests are always forwarded to the Server on Client\r
+ *              CD instances.  If a request is made with a NameServer\r
+ *              name the resource base and length parameters are\r
+ *              retrieved from the NameServer prior to the allocation\r
+ *              attempt.\r
+ */\r
+void allocationHandler (Rm_Inst *rmInst, Rm_Transaction *transaction, void *validInstNode,\r
+                        uint32_t allocType)\r
 {\r
     Rm_AllocatorOpInfo  opInfo;\r
     Rm_NameServerObjCfg nameServerObjCfg;\r
@@ -980,7 +1123,7 @@ void rmAllocationHandler (Rm_Inst *rmInst, Rm_Transaction *transaction, void *va
     if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {\r
         /* Forward all allocation requests to Server if transport is up.  Otherwise, just queue. */\r
         if (rmInst->registeredWithDelegateOrServer) {\r
-            rmTransactionForwarder(rmInst, transaction);   \r
+            transactionForwarder(rmInst, transaction);   \r
         }  \r
     }\r
     else if (rmInst->instType == Rm_instType_SERVER) {\r
@@ -1010,12 +1153,12 @@ void rmAllocationHandler (Rm_Inst *rmInst, Rm_Transaction *transaction, void *va
         if (retVal == RM_SERVICE_PROCESSING) {      \r
             if (transaction->resourceInfo.base == RM_RESOURCE_BASE_UNSPECIFIED) {\r
                 opInfo.operation = Rm_allocatorOp_PRE_ALLOCATE;\r
-                retVal = rmAllocatorOperation(rmInst, &opInfo);\r
+                retVal = allocatorOperation(rmInst, &opInfo);\r
             }\r
         \r
             if (retVal == RM_SERVICE_PROCESSING) {\r
                 opInfo.operation = Rm_allocatorOp_ALLOCATE;\r
-                retVal = rmAllocatorOperation(rmInst, &opInfo);\r
+                retVal = allocatorOperation(rmInst, &opInfo);\r
             }      \r
         }\r
         \r
@@ -1024,13 +1167,23 @@ void rmAllocationHandler (Rm_Inst *rmInst, Rm_Transaction *transaction, void *va
         if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {\r
             /* Source of allocation was not the server instance, provide the transaction\r
              * to the transaction responder */\r
-            rmTransactionResponder(rmInst, transaction);\r
+            transactionResponder(rmInst, transaction);\r
         }\r
         /* Otherwise let the return stack return the transaction to the serviceHandler */                   \r
     }   \r
 }\r
 \r
-void rmFreeHandler (Rm_Inst *rmInst, Rm_Transaction *transaction, void *validInstNode)\r
+/* FUNCTION PURPOSE: Arbitrates free service requests\r
+ ***********************************************************************\r
+ * DESCRIPTION: Issues a set of allocator operations in order to\r
+ *              handle a received free request.  Free\r
+ *              requests are always forwarded to the Server on Client\r
+ *              CD instances.  If a request is made with a NameServer\r
+ *              name the resource base and length parameters are\r
+ *              retrieved from the NameServer prior to the free\r
+ *              attempt.\r
+ */\r
+void freeHandler (Rm_Inst *rmInst, Rm_Transaction *transaction, void *validInstNode)\r
 {\r
     Rm_AllocatorOpInfo  opInfo; \r
     Rm_NameServerObjCfg nameServerObjCfg;    \r
@@ -1041,7 +1194,7 @@ void rmFreeHandler (Rm_Inst *rmInst, Rm_Transaction *transaction, void *validIns
     if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {\r
         /* Forward all free requests to Server if transport is up.  Otherwise, just queue. */\r
         if (rmInst->registeredWithDelegateOrServer) {\r
-            rmTransactionForwarder(rmInst, transaction);   \r
+            transactionForwarder(rmInst, transaction);   \r
         }\r
     }\r
     else if (rmInst->instType == Rm_instType_SERVER) {\r
@@ -1069,7 +1222,7 @@ void rmFreeHandler (Rm_Inst *rmInst, Rm_Transaction *transaction, void *validIns
         \r
         if(retVal == RM_SERVICE_PROCESSING) {        \r
             opInfo.operation = Rm_allocatorOp_FREE;\r
-            retVal = rmAllocatorOperation(rmInst, &opInfo);\r
+            retVal = allocatorOperation(rmInst, &opInfo);\r
         }       \r
 \r
         transaction->state = retVal;\r
@@ -1077,335 +1230,64 @@ void rmFreeHandler (Rm_Inst *rmInst, Rm_Transaction *transaction, void *validIns
         if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {\r
             /* Source of allocation was not the server instance, provide the transaction\r
              * to the transaction responder */\r
-            rmTransactionResponder(rmInst, transaction);\r
+            transactionResponder(rmInst, transaction);\r
         }\r
         /* Otherwise let the return stack return the transaction to the serviceHandler */        \r
     }   \r
 }\r
 \r
-/* This function is executed when a RM instance receives a response to one of its requests\r
- * and the information in the request must be provided to the original requesting component */\r
-void rmServiceResponder (Rm_Inst *rmInst, Rm_Transaction *transaction)\r
+/* FUNCTION PURPOSE: Reserves a Linux resource\r
+ ***********************************************************************\r
+ * DESCRIPTION: Reserves resources for Linux using the base and length\r
+ *              values retrieved from the Linux DTB via the\r
+ *              "linux-dtb-alias" properties within the GRL.\r
+ */\r
+int32_t reserveLinuxResource(Rm_Inst *rmInst, Rm_LinuxAlias *linuxAlias, \r
+                             Rm_LinuxValueRange *linuxValues, Rm_AllocatorOpInfo *opInfo)\r
 {\r
-    Rm_ServiceRespInfo serviceResponse;\r
+    int32_t  retVal = RM_OK;\r
+    bool     baseFound = false;\r
+    bool     lengthFound = false;\r
+    uint32_t valueIndex = 0;\r
 \r
-    /* The responseTransaction will contain the resultant state details of\r
-     * the requestTransaction's service request */\r
-    serviceResponse.serviceState = transaction->state;\r
-    /* Pass back the ID that was provided to the component when it requested\r
-     * the service */\r
-    serviceResponse.serviceId = transaction->localId;\r
+    while ((linuxValues) && (!baseFound || !lengthFound)) {\r
+        if (linuxAlias->baseOffset == valueIndex) {\r
+            opInfo->resourceInfo->base = linuxValues->value;\r
+            baseFound = true;\r
 \r
-    /* Service was approved and service was an allocate request.  The resource\r
-     * data is passed back to the component */\r
-    if ((serviceResponse.serviceState == RM_SERVICE_APPROVED) &&\r
-        ((transaction->type == Rm_service_RESOURCE_ALLOCATE_INIT) ||\r
-         (transaction->type == Rm_service_RESOURCE_ALLOCATE_USE) ||\r
-         (transaction->type == Rm_service_RESOURCE_GET_BY_NAME)))\r
-    {\r
-        strncpy(serviceResponse.resourceName, transaction->resourceInfo.name, RM_NAME_MAX_CHARS);\r
-        serviceResponse.resourceBase = transaction->resourceInfo.base;\r
-        serviceResponse.resourceLength = transaction->resourceInfo.length;\r
-    }\r
+            if (linuxAlias->lengthOffset == RM_DTB_LINUX_ALIAS_OFFSET_NOT_SET) {\r
+                opInfo->resourceInfo->length = 1;\r
+                lengthFound = true;\r
+            }\r
+        }\r
+        else if (linuxAlias->lengthOffset == valueIndex) {\r
+            opInfo->resourceInfo->length = linuxValues->value;\r
+            lengthFound = true;\r
+        }\r
 \r
-    /* Issue the callback to the requesting component with the response information */\r
-    transaction->callback.serviceCallback(&serviceResponse);\r
+        linuxValues = (Rm_LinuxValueRange *)linuxValues->nextValue;\r
+        valueIndex++;\r
+    }\r
 \r
-    /* Delete the transaction from the transaction queue */\r
-    rmTransactionQueueDelete(rmInst, transaction->localId);\r
-    return;\r
+    if (!baseFound || !lengthFound) {\r
+        retVal = RM_ERROR_DATA_NOT_FOUND_AT_LINUX_ALIAS;\r
+    }\r
+    else {\r
+        /* Allocate resource to Linux */\r
+        retVal = allocatorOperation(rmInst, opInfo);\r
+    }\r
+    return (retVal);\r
 }\r
 \r
-/* Function used to send RM response transactions to lower level agents */\r
-void rmTransactionResponder (Rm_Inst *rmInst, Rm_Transaction *transaction)\r
-{\r
-    Rm_Transport    *dstTransport = NULL;\r
-    Rm_PacketHandle  pktHandle = NULL;\r
-\r
-    dstTransport = rmTransportFindRemoteName((Rm_Transport *) rmInst->transports, transaction->pktSrcInstName);\r
-\r
-    switch (transaction->type) {\r
-        case Rm_service_RESOURCE_ALLOCATE_INIT:\r
-        case Rm_service_RESOURCE_ALLOCATE_USE:\r
-        case Rm_service_RESOURCE_FREE:\r
-        case Rm_service_RESOURCE_GET_BY_NAME:\r
-            pktHandle = rmTransportCreateResourceResponsePkt(rmInst, dstTransport->appTransportHandle, \r
-                                                             transaction);\r
-            break;\r
-        case Rm_service_RESOURCE_MAP_TO_NAME:\r
-        case Rm_service_RESOURCE_UNMAP_NAME:\r
-            pktHandle = rmTransportCreateNsResponsePkt(rmInst, dstTransport->appTransportHandle,\r
-                                                       transaction);\r
-            break;\r
-    }\r
-\r
-    if (pktHandle) {\r
-        if (rmInst->transportCallouts.rmSendPkt(dstTransport->appTransportHandle, pktHandle) < RM_OK) {\r
-            transaction->state = RM_ERROR_TRANSPORT_SEND_ERROR;\r
-        }\r
-    }\r
-    rmTransactionQueueDelete(rmInst, transaction->localId);\r
-}\r
-\r
-/* Function used to forward RM transactions to higher level agents */\r
-void rmTransactionForwarder (Rm_Inst *rmInst, Rm_Transaction *transaction)\r
-{\r
-    Rm_Transport    *dstTransport = NULL;\r
-    Rm_PacketHandle  pktHandle = NULL;\r
-\r
-    if (rmInst->registeredWithDelegateOrServer) {\r
-        if (rmInst->instType == Rm_instType_CLIENT) {\r
-            dstTransport = rmTransportFindRemoteInstType((Rm_Transport *) rmInst->transports, Rm_instType_CLIENT_DELEGATE);\r
-\r
-            if (!dstTransport) {\r
-                dstTransport = rmTransportFindRemoteInstType((Rm_Transport *) rmInst->transports, Rm_instType_SERVER);\r
-            }\r
-        } \r
-        else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {\r
-            dstTransport = rmTransportFindRemoteInstType((Rm_Transport *) rmInst->transports, Rm_instType_SERVER);\r
-        }\r
-\r
-        switch (transaction->type) {\r
-            case Rm_service_RESOURCE_ALLOCATE_INIT:\r
-            case Rm_service_RESOURCE_ALLOCATE_USE:\r
-            case Rm_service_RESOURCE_FREE:\r
-            case Rm_service_RESOURCE_GET_BY_NAME:\r
-                pktHandle = rmTransportCreateResourceReqPkt(rmInst, dstTransport->appTransportHandle, transaction);\r
-                break;\r
-            case Rm_service_RESOURCE_MAP_TO_NAME:\r
-            case Rm_service_RESOURCE_UNMAP_NAME:\r
-                pktHandle = rmTransportCreateNsRequestPkt(rmInst, dstTransport->appTransportHandle, transaction);\r
-                break;\r
-        }\r
-\r
-        if (pktHandle) {\r
-            if (rmInst->transportCallouts.rmSendPkt(dstTransport->appTransportHandle, pktHandle) < RM_OK) {\r
-                transaction->state = RM_ERROR_TRANSPORT_SEND_ERROR;\r
-            }\r
-        }\r
-\r
-        transaction->hasBeenForwarded = true;\r
-        /* Transaction not deleted.  Waiting for response from RM CD or Server */\r
-    }\r
-}\r
-\r
-void rmTransactionProcessor (Rm_Inst *rmInst, Rm_Transaction *transaction)\r
-{\r
-    void                *validInstNode;\r
-    Rm_PolicyCheckCfg    privCheckCfg;\r
-    Rm_NameServerObjCfg  nameServerObjCfg;      \r
-    uint32_t             allocType = 0;    \r
-\r
-    /* Handle static transactions originating on this instance.  Any other static transactions will be\r
-     * stored in transaction queue until all transports are up. */\r
-    if (((rmInst->instType == Rm_instType_CLIENT) || (rmInst->instType == Rm_instType_CLIENT_DELEGATE)) &&\r
-        (!rmInst->registeredWithDelegateOrServer) && \r
-        (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS) == 0)) {\r
-        if (rmInst->staticInfo.staticPolicy) {\r
-            if ((transaction->type == Rm_service_RESOURCE_ALLOCATE_INIT) ||\r
-                (transaction->type == Rm_service_RESOURCE_ALLOCATE_USE)) {\r
-                /* Check request against startup policy */\r
-                memset((void *)&privCheckCfg, 0, sizeof(Rm_PolicyCheckCfg));\r
-\r
-                if (transaction->type == Rm_service_RESOURCE_ALLOCATE_INIT) {\r
-                    privCheckCfg.type = Rm_policyCheck_INIT;\r
-                }\r
-                else {\r
-                    privCheckCfg.type = Rm_policyCheck_USE;\r
-                }\r
-                privCheckCfg.policyDtb = rmInst->staticInfo.staticPolicy;\r
-                privCheckCfg.validInstNode = rmPolicyGetValidInstNode(rmInst->staticInfo.staticValidInstTree, \r
-                                                                      rmInst->instName);\r
-                privCheckCfg.resourceOffset = rmPolicyGetResourceOffset(rmInst->staticInfo.staticPolicy,\r
-                                                                        transaction->resourceInfo.name);\r
-                privCheckCfg.resourceBase = transaction->resourceInfo.base;\r
-                privCheckCfg.resourceLength = transaction->resourceInfo.length;\r
-\r
-                if (rmPolicyCheckPrivilege(&privCheckCfg, &transaction->state)) {\r
-                    transaction->state = RM_SERVICE_APPROVED_STATIC;\r
-                }\r
-                else if (transaction->state == RM_SERVICE_PROCESSING) {\r
-                    /* Privilege check returned false without error */\r
-                    transaction->state = RM_SERVICE_DENIED_BY_STATIC_POLICY;\r
-                }\r
-            }\r
-            else {\r
-                transaction->state = RM_SERVICE_DENIED_INVALID_STATIC_REQUEST;\r
-            }\r
-        }\r
-        else {\r
-            transaction->state = RM_ERROR_REQ_FAILED_NO_STATIC_POLICY;\r
-        }        \r
-    }\r
-    else {\r
-        /* Handle auto-forwarded transactions.  These transactions include:\r
-         * - All request transactions received on Clients are forwarded to the Client Delegate\r
-         * - NameServer requests received on the Client Delegate are forwarded to the Server */\r
-        if ((rmInst->instType == Rm_instType_CLIENT) ||\r
-            ((rmInst->instType == Rm_instType_CLIENT_DELEGATE) &&\r
-             ((transaction->type == Rm_service_RESOURCE_MAP_TO_NAME) ||\r
-              (transaction->type == Rm_service_RESOURCE_GET_BY_NAME) ||\r
-              (transaction->type == Rm_service_RESOURCE_UNMAP_NAME)))) {\r
-              \r
-            if ((transaction->state != RM_SERVICE_PROCESSING) &&\r
-                (transaction->state != RM_SERVICE_APPROVED_STATIC)) {\r
-                if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {\r
-                    /* Transaction did not originate on this instance */\r
-                    rmTransactionResponder(rmInst, transaction);\r
-                }\r
-                else {\r
-                    /* Transaction originated on this instance */\r
-                    rmServiceResponder(rmInst, transaction);\r
-                }\r
-            }\r
-            else {\r
-                /* Forward request if transport is up.  Otherwise, just queue. */\r
-                if (rmInst->registeredWithDelegateOrServer) {\r
-                    rmTransactionForwarder(rmInst, transaction);   \r
-                } \r
-            }\r
-        }\r
-        else {\r
-            /* Validate service's originating instance name */\r
-            if (rmInst->instType == Rm_instType_SERVER) {\r
-                validInstNode = rmPolicyGetValidInstNode(rmInst->validInstances, transaction->serviceSrcInstName);\r
-                if (validInstNode == NULL) {\r
-                    transaction->state = RM_SERVICE_DENIED_INST_NAME_NOT_VALID;\r
-\r
-                    /* Send result via responder if transaction did not originate from this instance */\r
-                    if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {\r
-                        rmTransactionResponder(rmInst, transaction);\r
-                    }\r
-                }\r
-            }\r
-\r
-            switch (transaction->type) {\r
-                case Rm_service_RESOURCE_ALLOCATE_INIT:\r
-                case Rm_service_RESOURCE_ALLOCATE_USE:\r
-                case Rm_service_RESOURCE_FREE:               \r
-                    if ((transaction->state != RM_SERVICE_PROCESSING) &&\r
-                        (transaction->state != RM_SERVICE_APPROVED_STATIC)) {\r
-                        /* Transaction complete */\r
-                        if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {\r
-                            /* Transaction result not destined for this instance */\r
-                            rmTransactionResponder(rmInst, transaction);\r
-                        }\r
-                        else {\r
-                            /* Transaction result destined for this instance */\r
-                            rmServiceResponder(rmInst, transaction);      \r
-                        }\r
-                    }\r
-                    else {\r
-                        /* Complete allocation/free request */\r
-                        if (transaction->type == Rm_service_RESOURCE_FREE) {\r
-                            rmFreeHandler(rmInst, transaction, validInstNode);\r
-                        }\r
-                        else {\r
-                            switch (transaction->type) {\r
-                                case Rm_service_RESOURCE_ALLOCATE_INIT:\r
-                                    RM_policy_SET_PERM(allocType, RM_POLICY_PERM_INIT_SHIFT, 1);\r
-                                    break;\r
-                                case Rm_service_RESOURCE_ALLOCATE_USE:\r
-                                    RM_policy_SET_PERM(allocType, RM_POLICY_PERM_USE_SHIFT, 1);    \r
-                                    break;\r
-                            }\r
-                            rmAllocationHandler(rmInst, transaction, validInstNode, allocType);\r
-                        }\r
-                    }\r
-                    break;\r
-                case Rm_service_RESOURCE_MAP_TO_NAME:\r
-                case Rm_service_RESOURCE_GET_BY_NAME:\r
-                case Rm_service_RESOURCE_UNMAP_NAME:                \r
-                    /* NameServer resides on server */\r
-                    memset((void *)&nameServerObjCfg, 0, sizeof(Rm_NameServerObjCfg));\r
-                    if (rmInst->nameServer) {\r
-                        nameServerObjCfg.nameServerTree = rmInst->nameServer;\r
-                        nameServerObjCfg.nodeCfg.objName = transaction->resourceInfo.nameServerName;\r
-                        if (transaction->type == Rm_service_RESOURCE_MAP_TO_NAME) {\r
-                            nameServerObjCfg.nodeCfg.resourceName = transaction->resourceInfo.name;\r
-                            nameServerObjCfg.nodeCfg.resourceBase= transaction->resourceInfo.base;\r
-                            nameServerObjCfg.nodeCfg.resourceLength = transaction->resourceInfo.length;\r
-                            transaction->state = rmNameServerAddObject(&nameServerObjCfg);\r
-                        }\r
-                        else if (transaction->type == Rm_service_RESOURCE_GET_BY_NAME) {\r
-                            if ((transaction->state = rmNameServerFindObject(&nameServerObjCfg)) ==\r
-                                RM_SERVICE_PROCESSING) {\r
-                                strncpy(transaction->resourceInfo.name, nameServerObjCfg.nodeCfg.resourceName, RM_NAME_MAX_CHARS);\r
-                                transaction->resourceInfo.base = nameServerObjCfg.nodeCfg.resourceBase;\r
-                                transaction->resourceInfo.length = nameServerObjCfg.nodeCfg.resourceLength;\r
-                                transaction->state = RM_SERVICE_APPROVED;\r
-                            } \r
-                        }\r
-                        else if (transaction->type == Rm_service_RESOURCE_UNMAP_NAME) {\r
-                            transaction->state = rmNameServerDeleteObject(&nameServerObjCfg);\r
-                        }\r
-                    }\r
-                    else {\r
-                        transaction->state = RM_ERROR_NAMESERVER_DOES_NOT_EXIST;\r
-                    }\r
-\r
-                    /* Send result via responder if transaction did not originate from this instance */\r
-                    if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {\r
-                        rmTransactionResponder(rmInst, transaction);\r
-                    }\r
-                    break;\r
-            }\r
-        }\r
-    }\r
-\r
-    /* Forward any queued requests that weren't forwarded yet */\r
-    if (rmInst->registeredWithDelegateOrServer) {\r
-        transaction = rmInst->transactionQueue;\r
-        while(transaction) {\r
-            if (((transaction->state == RM_SERVICE_PROCESSING) ||\r
-                 (transaction->state == RM_SERVICE_APPROVED_STATIC)) &&\r
-                !transaction->hasBeenForwarded) {\r
-                rmTransactionForwarder(rmInst, transaction);\r
-            }\r
-            transaction = transaction->nextTransaction;\r
-        }\r
-    }\r
-}\r
-\r
-int32_t rmReserveLinuxResource(Rm_Inst *rmInst, Rm_LinuxAlias *linuxAlias, \r
-                               Rm_LinuxValueRange *linuxValues, Rm_AllocatorOpInfo *opInfo)\r
-{\r
-    int32_t  retVal = RM_OK;\r
-    bool     baseFound = false;\r
-    bool     lengthFound = false;\r
-    uint32_t valueIndex = 0;\r
-\r
-    while ((linuxValues) && (!baseFound || !lengthFound)) {\r
-        if (linuxAlias->baseOffset == valueIndex) {\r
-            opInfo->resourceInfo->base = linuxValues->value;\r
-            baseFound = true;\r
-\r
-            if (linuxAlias->lengthOffset == RM_DTB_LINUX_ALIAS_OFFSET_NOT_SET) {\r
-                opInfo->resourceInfo->length = 1;\r
-                lengthFound = true;\r
-            }\r
-        }\r
-        else if (linuxAlias->lengthOffset == valueIndex) {\r
-            opInfo->resourceInfo->length = linuxValues->value;\r
-            lengthFound = true;\r
-        }\r
-\r
-        linuxValues = (Rm_LinuxValueRange *)linuxValues->nextValue;\r
-        valueIndex++;\r
-    }\r
-\r
-    if (!baseFound || !lengthFound) {\r
-        retVal = RM_ERROR_DATA_NOT_FOUND_AT_LINUX_ALIAS;\r
-    }\r
-    else {\r
-        /* Allocate resource to Linux */\r
-        retVal = rmAllocatorOperation(rmInst, opInfo);\r
-    }\r
-    return (retVal);\r
-}\r
-\r
-int32_t rmFindAndReserveLinuxResource(Rm_Inst *rmInst, const char *resourceName, void *linuxDtb, \r
-                                      Rm_LinuxAlias *linuxAlias)\r
+/* FUNCTION PURPOSE: Finds and reserves Linux resources\r
+ ***********************************************************************\r
+ * DESCRIPTION: Parses the Linux DTB for resources consumed by the\r
+ *              Linux kernel.  If the resource is found via the\r
+ *              "linux-dtb-alias" property defined in the GRL it is \r
+ *              reserved.\r
+ */\r
+int32_t findAndReserveLinuxResource(Rm_Inst *rmInst, const char *resourceName, void *linuxDtb, \r
+                                    Rm_LinuxAlias *linuxAlias)\r
 {\r
     Rm_AllocatorOpInfo  opInfo;\r
     Rm_ResourceInfo     resourceInfo;\r
@@ -1475,7 +1357,7 @@ int32_t rmFindAndReserveLinuxResource(Rm_Inst *rmInst, const char *resourceName,
                         /* Found resource at end of alias path */\r
                         pathOffset += (strlen(linuxAlias->path + pathOffset) + 1);\r
                         linuxValueRange = rmDtbUtilLinuxExtractValues(propertyData, propertyLen);\r
-                        retVal = rmReserveLinuxResource(rmInst, linuxAlias, \r
+                        retVal = reserveLinuxResource(rmInst, linuxAlias, \r
                                                          linuxValueRange, &opInfo);\r
                         rmDtbUtilLinuxFreeValues(linuxValueRange);\r
                     }\r
@@ -1492,13 +1374,22 @@ int32_t rmFindAndReserveLinuxResource(Rm_Inst *rmInst, const char *resourceName,
         if (retVal < RM_OK) {\r
             break;\r
         }\r
-        linuxAlias = (Rm_LinuxAlias *) linuxAlias->nextLinuxAlias;\r
+        linuxAlias = linuxAlias->nextLinuxAlias;\r
     }\r
     return (retVal);\r
 }\r
 \r
-int32_t rmCreateAndInitAllocator(Rm_Inst *rmInst, const char *resourceName, \r
-                                 Rm_ResourceProperties *resourceProperties, void *linuxDtb)\r
+/* FUNCTION PURPOSE: Creates and initializes a resource allocator\r
+ ***********************************************************************\r
+ * DESCRIPTION: Creates a resource allocator for the provided\r
+ *              resource name and resource properties retrieved\r
+ *              from the GRL.  Resources will be reserved for \r
+ *              the Linux kernel if the Linux DTB is provided\r
+ *              and there are "linux-dtb-alias" properties\r
+ *              specified in the GRL.\r
+ */\r
+int32_t createAndInitAllocator(Rm_Inst *rmInst, const char *resourceName, \r
+                               Rm_ResourceProperties *resourceProperties, void *linuxDtb)\r
 {\r
     Rm_ResourceRange    *range = NULL;\r
     Rm_ResourceRange    *rangeBasePtr = NULL;\r
@@ -1508,153 +1399,473 @@ int32_t rmCreateAndInitAllocator(Rm_Inst *rmInst, const char *resourceName,
     Rm_NameServerObjCfg  nameServerObjCfg;      \r
     int32_t              retVal = RM_OK;\r
 \r
-    if (resourceProperties->rangeData && (resourceProperties->rangeLen > 0)) {\r
-        range = rangeBasePtr = rmDtbUtilResExtractRange(resourceProperties->rangeData, \r
-                                                        resourceProperties->rangeLen);\r
-        \r
-        if ((retVal = rmCreateTreeAllocator(rmInst, resourceName, range)) >= RM_OK) {\r
-            if (resourceProperties->linuxAliasData && resourceProperties->linuxAliasLen) {\r
-                if (linuxDtb) {\r
-                    linuxAlias = rmDtbUtilResExtractLinuxAlias(resourceProperties->linuxAliasData,\r
-                                                               resourceProperties->linuxAliasLen, &retVal);\r
-                    if (linuxAlias) {\r
-                        retVal = rmFindAndReserveLinuxResource(rmInst, resourceName, linuxDtb, linuxAlias);            \r
-                    }\r
+    if (resourceProperties->rangeData && (resourceProperties->rangeLen > 0)) {\r
+        range = rangeBasePtr = rmDtbUtilResExtractRange(resourceProperties->rangeData, \r
+                                                        resourceProperties->rangeLen);\r
+        \r
+        if ((retVal = createResourceTree(rmInst, resourceName, range)) >= RM_OK) {\r
+            if (resourceProperties->linuxAliasData && resourceProperties->linuxAliasLen) {\r
+                if (linuxDtb) {\r
+                    linuxAlias = rmDtbUtilResExtractLinuxAlias(resourceProperties->linuxAliasData,\r
+                                                               resourceProperties->linuxAliasLen, &retVal);\r
+                    if (linuxAlias) {\r
+                        retVal = findAndReserveLinuxResource(rmInst, resourceName, linuxDtb, linuxAlias);            \r
+                    }\r
+                }\r
+                else {\r
+                    retVal = RM_ERROR_GRL_LINUX_ALIAS_BUT_NO_DTB;\r
+                }\r
+            }\r
+        }\r
+    }\r
+    \r
+    if (retVal >= RM_OK) {\r
+        if (resourceProperties->nsAssignData && resourceProperties->nsAssignLen) {\r
+            nsAssignments = rmDtbUtilResExtractNsAssignment(resourceProperties->nsAssignData, \r
+                                                            resourceProperties->nsAssignLen, &retVal);\r
+            if (nsAssignments) {\r
+                nsAssignmentBasePtr = nsAssignments;\r
+                while (nsAssignments) {\r
+                    memset((void *)&nameServerObjCfg, 0, sizeof(Rm_NameServerObjCfg));\r
+                    nameServerObjCfg.nameServerTree = rmInst->nameServer;\r
+                    nameServerObjCfg.nodeCfg.objName = nsAssignments->nsName;\r
+                    nameServerObjCfg.nodeCfg.resourceName = (char *)resourceName;\r
+                    nameServerObjCfg.nodeCfg.resourceBase= nsAssignments->resourceBase;\r
+                    nameServerObjCfg.nodeCfg.resourceLength = nsAssignments->resourceLength;                \r
+                    rmNameServerAddObject(&nameServerObjCfg);\r
+                    nsAssignments = nsAssignments->nextNsAssignment;\r
+                }\r
+                rmDtbUtilResFreeNsAssignmentList(nsAssignmentBasePtr);\r
+            }\r
+        }\r
+    }\r
+\r
+    rmDtbUtilResFreeRange(rangeBasePtr);\r
+    if (linuxAlias) {\r
+        rmDtbUtilResFreeLinuxAlias(linuxAlias);\r
+    }\r
+    return(retVal);\r
+}\r
+\r
+/* FUNCTION PURPOSE: Recursively parses GRL resource properties\r
+ ***********************************************************************\r
+ * DESCRIPTION: Recursively parses and stores GRL resource node \r
+ *              properties using the LIBFDT APIs\r
+ */\r
+int32_t parseResourceProperty(void *globalResourceDtb, int32_t offset, Rm_ResourceProperties *propertyInfo)\r
+{\r
+       int32_t              propertyLen;\r
+       const char          *propertyName;\r
+       const void          *propertyData;\r
+    Rm_ResourcePropType  propertyType;\r
+    int32_t              retVal = RM_OK;\r
+\r
+       propertyData = fdt_getprop_by_offset(globalResourceDtb, offset, &propertyName, &propertyLen);\r
+    propertyType = rmDtbUtilResGetPropertyType(propertyName);\r
+    if (propertyType == Rm_resourcePropType_RESOURCE_RANGE) {\r
+        propertyInfo->rangeData = propertyData;\r
+        propertyInfo->rangeLen = propertyLen;\r
+    }\r
+    else if (propertyType == Rm_resourcePropType_NSASSIGNMENT) {\r
+        propertyInfo->nsAssignData = propertyData;\r
+        propertyInfo->nsAssignLen = propertyLen;\r
+    }\r
+    else if (propertyType == Rm_resourcePropType_RESOURCE_LINUX_ALIAS) {\r
+        propertyInfo->linuxAliasData = propertyData;\r
+        propertyInfo->linuxAliasLen = propertyLen;\r
+    }        \r
+    else {\r
+        retVal = RM_ERROR_GRL_UNKNOWN_RESOURCE_PROPERTY;\r
+    }\r
+\r
+    if (retVal == RM_OK) {\r
+        offset = fdt_next_property_offset(globalResourceDtb, offset);\r
+       if (offset >= 0) {\r
+           retVal = parseResourceProperty(globalResourceDtb, offset, propertyInfo);\r
+       }\r
+        else if (offset != -FDT_ERR_NOTFOUND) {\r
+            /* Error returned by LIBFDT */\r
+            retVal = offset;\r
+        }\r
+    }\r
+    return (retVal);\r
+}\r
+\r
+/* FUNCTION PURPOSE: Recursively parses GRL resource nodes\r
+ ***********************************************************************\r
+ * DESCRIPTION: Recursively parses GRL resource nodes looking for\r
+ *              resource properties to create the resource allocators.\r
+ *              The LIBFDT APIs are used to parse the GRL.\r
+ */\r
+int32_t parseResourceNode(Rm_Inst *rmInst, void *globalResourceDtb, int32_t nodeOffset, int32_t depth,\r
+                          void *linuxDtb)\r
+{\r
+       const char            *resourceName = fdt_get_name(globalResourceDtb, nodeOffset, NULL);\r
+    Rm_ResourceProperties  resourceProperties;\r
+       int32_t                retVal = RM_OK;\r
+       int32_t                offset;\r
+\r
+    memset((void *)&resourceProperties, 0, sizeof(Rm_ResourceProperties));\r
+    /* Get properties of resource node */\r
+       offset = fdt_first_property_offset(globalResourceDtb, nodeOffset);\r
+       if (offset >= RM_DTB_UTIL_STARTING_NODE_OFFSET) {\r
+               retVal =  parseResourceProperty(globalResourceDtb, offset, &resourceProperties);\r
+        if (retVal < -FDT_ERR_NOTFOUND) {\r
+            return (retVal);\r
+        }\r
+        if (retVal = createAndInitAllocator(rmInst, resourceName, &resourceProperties, linuxDtb) < RM_OK) {\r
+            return (retVal);\r
+        }\r
+       }\r
+    else if (offset != -FDT_ERR_NOTFOUND) {\r
+               /* Error returned by LIBFDT */\r
+        return (offset);\r
+    }\r
+    \r
+       offset = fdt_next_node(globalResourceDtb, nodeOffset, &depth);\r
+    if ((offset >= RM_DTB_UTIL_STARTING_NODE_OFFSET) && (depth >= RM_DTB_UTIL_STARTING_DEPTH)) {\r
+        retVal = parseResourceNode(rmInst, globalResourceDtb, offset, depth, linuxDtb);\r
+        if (retVal < -FDT_ERR_NOTFOUND) {\r
+            return (retVal);\r
+        }\r
+    }\r
+    else if (offset != -FDT_ERR_NOTFOUND) {\r
+        /* Error returned by LIBFDT */\r
+        return (offset);\r
+    }\r
+    return (retVal);\r
+}\r
+\r
+/* FUNCTION PURPOSE: Initializes server allocators\r
+ ***********************************************************************\r
+ * DESCRIPTION: Creates and initializes a server instance's\r
+ *              resource allocators using the GRL and, if\r
+ *              provided, Linux DTB.\r
+ */\r
+int32_t initializeAllocators(Rm_Inst *rmInst, void *globalResourceDtb, void *linuxDtb)\r
+{\r
+    int32_t nodeOffset = RM_DTB_UTIL_STARTING_NODE_OFFSET;\r
+    int32_t startDepth = RM_DTB_UTIL_STARTING_DEPTH;\r
+    int32_t result = RM_OK;\r
+\r
+    /* Recursively parse the Global Resource List, creating an allocator for\r
+     * each resource as specified in the node */\r
+    result = parseResourceNode(rmInst, globalResourceDtb, nodeOffset, startDepth, linuxDtb);\r
+\r
+    return(result);\r
+}\r
+\r
+/**********************************************************************\r
+ ********************** Internal Functions ****************************\r
+ **********************************************************************/\r
+\r
+/* FUNCTION PURPOSE: Adds a transaction\r
+ ***********************************************************************\r
+ * DESCRIPTION: Returns a pointer to a newly created transaction.\r
+ *              The transaction is created based on a new service\r
+ *              request received via the service API or the\r
+ *              transport API (service forwarded from another instance)\r
+ */\r
+Rm_Transaction *rmTransactionQueueAdd(Rm_Inst *rmInst)\r
+{\r
+    Rm_Transaction *transactionQueue = rmInst->transactionQueue;\r
+    Rm_Transaction *newTransaction   = NULL;\r
+\r
+    newTransaction = Rm_osalMalloc(sizeof(Rm_Transaction));\r
+    if (newTransaction) {\r
+        memset((void *)newTransaction, 0, sizeof(Rm_Transaction));\r
+\r
+        newTransaction->localId = transactionGetSequenceNum(rmInst);\r
+        newTransaction->nextTransaction = NULL;  \r
+        if (transactionQueue) {\r
+            while (transactionQueue->nextTransaction) {\r
+                transactionQueue = transactionQueue->nextTransaction;\r
+            }\r
+            transactionQueue->nextTransaction = newTransaction;\r
+        }\r
+        else {\r
+            rmInst->transactionQueue = newTransaction;\r
+        }\r
+    }\r
+    return (newTransaction);\r
+}\r
+\r
+/* FUNCTION PURPOSE: Finds a transaction\r
+ ***********************************************************************\r
+ * DESCRIPTION: Returns a pointer to a transaction resident\r
+ *              in the transaction queue that matches the provided\r
+ *              transaction ID.\r
+ */\r
+Rm_Transaction *rmTransactionQueueFind(Rm_Inst *rmInst, uint32_t transactionId)\r
+{\r
+    Rm_Transaction *transaction = rmInst->transactionQueue;\r
+\r
+    while (transaction) {\r
+        if (transaction->localId == transactionId) {\r
+            break;             \r
+        }\r
+        transaction = transaction->nextTransaction;\r
+    }\r
+\r
+    return (transaction);\r
+}\r
+\r
+/* FUNCTION PURPOSE: Deletes a transaction\r
+ ***********************************************************************\r
+ * DESCRIPTION: Deletes the transaction with the provided transaction\r
+ *              ID from the instance's transaction queue.\r
+ */\r
+int32_t rmTransactionQueueDelete(Rm_Inst *rmInst, uint32_t transactionId)\r
+{\r
+    Rm_Transaction *transaction     = rmInst->transactionQueue;\r
+    Rm_Transaction *prevTransaction = NULL;\r
+    int32_t         retVal          = RM_OK;\r
+\r
+    while (transaction) {\r
+        if (transaction->localId == transactionId) {\r
+            break;             \r
+        }\r
+\r
+        prevTransaction = transaction;\r
+        transaction = transaction->nextTransaction;\r
+    }\r
+\r
+    if (transaction) {\r
+        if (prevTransaction == NULL) {\r
+            /* Transaction at start of queue. Map second transaction to start of queue \r
+             * as long as more than one transactions. */\r
+            rmInst->transactionQueue = transaction->nextTransaction;\r
+        }\r
+        else {\r
+            /* Transaction in middle or end of queue. */\r
+            prevTransaction->nextTransaction = transaction->nextTransaction;\r
+        }\r
+        Rm_osalFree((void *)transaction, sizeof(Rm_Transaction));\r
+    }\r
+    else {\r
+        retVal = RM_ERROR_SERVICE_TRANS_DOES_NOT_EXIST;\r
+    }    \r
+    return (retVal);\r
+}\r
+\r
+/* FUNCTION PURPOSE: Finds an allocator\r
+ ***********************************************************************\r
+ * DESCRIPTION: Returns a pointer to an allocator that matches the \r
+ *              provided resource name.\r
+ */\r
+Rm_Allocator *rmAllocatorFind(Rm_Allocator *allocatorList, char *resourceName)\r
+{\r
+    while (allocatorList) {\r
+        if (strncmp(allocatorList->resourceName, resourceName, RM_NAME_MAX_CHARS) == 0) {\r
+            break;             \r
+        }\r
+        allocatorList = allocatorList->nextAllocator;\r
+    }\r
+\r
+    return (allocatorList);\r
+}\r
+\r
+/* FUNCTION PURPOSE: Processes a transaction\r
+ ***********************************************************************\r
+ * DESCRIPTION: Processes transactions created from services\r
+ *              received via the service handle or the transport.\r
+ *              Transactions will be routed within the RM system\r
+ *              based on the RM instance type and the type of\r
+ *              the transaction.\r
+ */\r
+void rmTransactionProcessor (Rm_Inst *rmInst, Rm_Transaction *transaction)\r
+{\r
+    void                *validInstNode;\r
+    Rm_PolicyCheckCfg    privCheckCfg;\r
+    Rm_NameServerObjCfg  nameServerObjCfg;      \r
+    uint32_t             allocType = 0;    \r
+\r
+    /* Handle static transactions originating on this instance.  Any other static transactions will be\r
+     * stored in transaction queue until all transports are up. */\r
+    if (((rmInst->instType == Rm_instType_CLIENT) || (rmInst->instType == Rm_instType_CLIENT_DELEGATE)) &&\r
+        (!rmInst->registeredWithDelegateOrServer) && \r
+        (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS) == 0)) {\r
+        if (rmInst->staticInfo.staticPolicy) {\r
+            if ((transaction->type == Rm_service_RESOURCE_ALLOCATE_INIT) ||\r
+                (transaction->type == Rm_service_RESOURCE_ALLOCATE_USE)) {\r
+                /* Check request against startup policy */\r
+                memset((void *)&privCheckCfg, 0, sizeof(Rm_PolicyCheckCfg));\r
+\r
+                if (transaction->type == Rm_service_RESOURCE_ALLOCATE_INIT) {\r
+                    privCheckCfg.type = Rm_policyCheck_INIT;\r
                 }\r
                 else {\r
-                    retVal = RM_ERROR_GRL_LINUX_ALIAS_BUT_NO_DTB;\r
+                    privCheckCfg.type = Rm_policyCheck_USE;\r
                 }\r
+                privCheckCfg.policyDtb = rmInst->staticInfo.staticPolicy;\r
+                privCheckCfg.validInstNode = rmPolicyGetValidInstNode(rmInst->staticInfo.staticValidInstTree, \r
+                                                                      rmInst->instName);\r
+                privCheckCfg.resourceOffset = rmPolicyGetResourceOffset(rmInst->staticInfo.staticPolicy,\r
+                                                                        transaction->resourceInfo.name);\r
+                privCheckCfg.resourceBase = transaction->resourceInfo.base;\r
+                privCheckCfg.resourceLength = transaction->resourceInfo.length;\r
+\r
+                if (rmPolicyCheckPrivilege(&privCheckCfg, &transaction->state)) {\r
+                    transaction->state = RM_SERVICE_APPROVED_STATIC;\r
+                }\r
+                else if (transaction->state == RM_SERVICE_PROCESSING) {\r
+                    /* Privilege check returned false without error */\r
+                    transaction->state = RM_SERVICE_DENIED_BY_STATIC_POLICY;\r
+                }\r
+            }\r
+            else {\r
+                transaction->state = RM_SERVICE_DENIED_INVALID_STATIC_REQUEST;\r
             }\r
         }\r
+        else {\r
+            transaction->state = RM_ERROR_REQ_FAILED_NO_STATIC_POLICY;\r
+        }        \r
     }\r
-    \r
-    if (retVal >= RM_OK) {\r
-        if (resourceProperties->nsAssignData && resourceProperties->nsAssignLen) {\r
-            nsAssignments = rmDtbUtilResExtractNsAssignment(resourceProperties->nsAssignData, \r
-                                                            resourceProperties->nsAssignLen, &retVal);\r
-            if (nsAssignments) {\r
-                nsAssignmentBasePtr = nsAssignments;\r
-                while (nsAssignments) {\r
-                    memset((void *)&nameServerObjCfg, 0, sizeof(Rm_NameServerObjCfg));\r
-                    nameServerObjCfg.nameServerTree = rmInst->nameServer;\r
-                    nameServerObjCfg.nodeCfg.objName = nsAssignments->nsName;\r
-                    nameServerObjCfg.nodeCfg.resourceName = (char *)resourceName;\r
-                    nameServerObjCfg.nodeCfg.resourceBase= nsAssignments->resourceBase;\r
-                    nameServerObjCfg.nodeCfg.resourceLength = nsAssignments->resourceLength;                \r
-                    rmNameServerAddObject(&nameServerObjCfg);\r
-                    nsAssignments = nsAssignments->nextNsAssignment;\r
+    else {\r
+        /* Handle auto-forwarded transactions.  These transactions include:\r
+         * - All request transactions received on Clients are forwarded to the Client Delegate\r
+         * - NameServer requests received on the Client Delegate are forwarded to the Server */\r
+        if ((rmInst->instType == Rm_instType_CLIENT) ||\r
+            ((rmInst->instType == Rm_instType_CLIENT_DELEGATE) &&\r
+             ((transaction->type == Rm_service_RESOURCE_MAP_TO_NAME) ||\r
+              (transaction->type == Rm_service_RESOURCE_GET_BY_NAME) ||\r
+              (transaction->type == Rm_service_RESOURCE_UNMAP_NAME)))) {\r
+              \r
+            if ((transaction->state != RM_SERVICE_PROCESSING) &&\r
+                (transaction->state != RM_SERVICE_APPROVED_STATIC)) {\r
+                if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {\r
+                    /* Transaction did not originate on this instance */\r
+                    transactionResponder(rmInst, transaction);\r
                 }\r
-                rmDtbUtilResFreeNsAssignmentList(nsAssignmentBasePtr);\r
+                else {\r
+                    /* Transaction originated on this instance */\r
+                    serviceResponder(rmInst, transaction);\r
+                }\r
+            }\r
+            else {\r
+                /* Forward request if transport is up.  Otherwise, just queue. */\r
+                if (rmInst->registeredWithDelegateOrServer) {\r
+                    transactionForwarder(rmInst, transaction);   \r
+                } \r
             }\r
         }\r
-    }\r
-\r
-    rmDtbUtilResFreeRange(rangeBasePtr);\r
-    if (linuxAlias) {\r
-        rmDtbUtilResFreeLinuxAlias(linuxAlias);\r
-    }\r
-    return(retVal);\r
-}\r
+        else {\r
+            /* Validate service's originating instance name */\r
+            if (rmInst->instType == Rm_instType_SERVER) {\r
+                validInstNode = rmPolicyGetValidInstNode(rmInst->validInstances, transaction->serviceSrcInstName);\r
+                if (validInstNode == NULL) {\r
+                    transaction->state = RM_SERVICE_DENIED_INST_NAME_NOT_VALID;\r
 \r
-int32_t rmParseResourceProperty(void *globalResourceDtb, int32_t offset, Rm_ResourceProperties *propertyInfo)\r
-{\r
-       int32_t              propertyLen;\r
-       const char          *propertyName;\r
-       const void          *propertyData;\r
-    Rm_ResourcePropType  propertyType;\r
-    int32_t              retVal = RM_OK;\r
+                    /* Send result via responder if transaction did not originate from this instance */\r
+                    if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {\r
+                        transactionResponder(rmInst, transaction);\r
+                    }\r
+                }\r
+            }\r
 \r
-       propertyData = fdt_getprop_by_offset(globalResourceDtb, offset, &propertyName, &propertyLen);\r
-    propertyType = rmDtbUtilResGetPropertyType(propertyName);\r
-    if (propertyType == Rm_resourcePropType_RESOURCE_RANGE) {\r
-        propertyInfo->rangeData = propertyData;\r
-        propertyInfo->rangeLen = propertyLen;\r
-    }\r
-    else if (propertyType == Rm_resourcePropType_NSASSIGNMENT) {\r
-        propertyInfo->nsAssignData = propertyData;\r
-        propertyInfo->nsAssignLen = propertyLen;\r
-    }\r
-    else if (propertyType == Rm_resourcePropType_RESOURCE_LINUX_ALIAS) {\r
-        propertyInfo->linuxAliasData = propertyData;\r
-        propertyInfo->linuxAliasLen = propertyLen;\r
-    }        \r
-    else {\r
-        retVal = RM_ERROR_GRL_UNKNOWN_RESOURCE_PROPERTY;\r
-    }\r
+            switch (transaction->type) {\r
+                case Rm_service_RESOURCE_ALLOCATE_INIT:\r
+                case Rm_service_RESOURCE_ALLOCATE_USE:\r
+                case Rm_service_RESOURCE_FREE:               \r
+                    if ((transaction->state != RM_SERVICE_PROCESSING) &&\r
+                        (transaction->state != RM_SERVICE_APPROVED_STATIC)) {\r
+                        /* Transaction complete */\r
+                        if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {\r
+                            /* Transaction result not destined for this instance */\r
+                            transactionResponder(rmInst, transaction);\r
+                        }\r
+                        else {\r
+                            /* Transaction result destined for this instance */\r
+                            serviceResponder(rmInst, transaction);      \r
+                        }\r
+                    }\r
+                    else {\r
+                        /* Complete allocation/free request */\r
+                        if (transaction->type == Rm_service_RESOURCE_FREE) {\r
+                            freeHandler(rmInst, transaction, validInstNode);\r
+                        }\r
+                        else {\r
+                            switch (transaction->type) {\r
+                                case Rm_service_RESOURCE_ALLOCATE_INIT:\r
+                                    RM_policy_SET_PERM(allocType, RM_POLICY_PERM_INIT_SHIFT, 1);\r
+                                    break;\r
+                                case Rm_service_RESOURCE_ALLOCATE_USE:\r
+                                    RM_policy_SET_PERM(allocType, RM_POLICY_PERM_USE_SHIFT, 1);    \r
+                                    break;\r
+                            }\r
+                            allocationHandler(rmInst, transaction, validInstNode, allocType);\r
+                        }\r
+                    }\r
+                    break;\r
+                case Rm_service_RESOURCE_MAP_TO_NAME:\r
+                case Rm_service_RESOURCE_GET_BY_NAME:\r
+                case Rm_service_RESOURCE_UNMAP_NAME:                \r
+                    /* NameServer resides on server */\r
+                    memset((void *)&nameServerObjCfg, 0, sizeof(Rm_NameServerObjCfg));\r
+                    if (rmInst->nameServer) {\r
+                        nameServerObjCfg.nameServerTree = rmInst->nameServer;\r
+                        nameServerObjCfg.nodeCfg.objName = transaction->resourceInfo.nameServerName;\r
+                        if (transaction->type == Rm_service_RESOURCE_MAP_TO_NAME) {\r
+                            nameServerObjCfg.nodeCfg.resourceName = transaction->resourceInfo.name;\r
+                            nameServerObjCfg.nodeCfg.resourceBase= transaction->resourceInfo.base;\r
+                            nameServerObjCfg.nodeCfg.resourceLength = transaction->resourceInfo.length;\r
+                            transaction->state = rmNameServerAddObject(&nameServerObjCfg);\r
+                        }\r
+                        else if (transaction->type == Rm_service_RESOURCE_GET_BY_NAME) {\r
+                            if ((transaction->state = rmNameServerFindObject(&nameServerObjCfg)) ==\r
+                                RM_SERVICE_PROCESSING) {\r
+                                strncpy(transaction->resourceInfo.name, nameServerObjCfg.nodeCfg.resourceName, RM_NAME_MAX_CHARS);\r
+                                transaction->resourceInfo.base = nameServerObjCfg.nodeCfg.resourceBase;\r
+                                transaction->resourceInfo.length = nameServerObjCfg.nodeCfg.resourceLength;\r
+                                transaction->state = RM_SERVICE_APPROVED;\r
+                            } \r
+                        }\r
+                        else if (transaction->type == Rm_service_RESOURCE_UNMAP_NAME) {\r
+                            transaction->state = rmNameServerDeleteObject(&nameServerObjCfg);\r
+                        }\r
+                    }\r
+                    else {\r
+                        transaction->state = RM_ERROR_NAMESERVER_DOES_NOT_EXIST;\r
+                    }\r
 \r
-    if (retVal == RM_OK) {\r
-        offset = fdt_next_property_offset(globalResourceDtb, offset);\r
-       if (offset >= 0) {\r
-           retVal = rmParseResourceProperty(globalResourceDtb, offset, propertyInfo);\r
-       }\r
-        else if (offset != -FDT_ERR_NOTFOUND) {\r
-            /* Error returned by LIBFDT */\r
-            retVal = offset;\r
+                    /* Send result via responder if transaction did not originate from this instance */\r
+                    if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {\r
+                        transactionResponder(rmInst, transaction);\r
+                    }\r
+                    break;\r
+            }\r
         }\r
     }\r
-    return (retVal);\r
-}\r
 \r
-int32_t rmParseResourceNode(Rm_Inst *rmInst, void *globalResourceDtb, int32_t nodeOffset, int32_t depth,\r
-                            void *linuxDtb)\r
-{\r
-       const char            *resourceName = fdt_get_name(globalResourceDtb, nodeOffset, NULL);\r
-    Rm_ResourceProperties  resourceProperties;\r
-       int32_t                retVal = RM_OK;\r
-       int32_t                offset;\r
-\r
-    memset((void *)&resourceProperties, 0, sizeof(Rm_ResourceProperties));\r
-    /* Get properties of resource node */\r
-       offset = fdt_first_property_offset(globalResourceDtb, nodeOffset);\r
-       if (offset >= RM_DTB_UTIL_STARTING_NODE_OFFSET) {\r
-               retVal =  rmParseResourceProperty(globalResourceDtb, offset, &resourceProperties);\r
-        if (retVal < -FDT_ERR_NOTFOUND) {\r
-            return (retVal);\r
-        }\r
-        if (retVal = rmCreateAndInitAllocator(rmInst, resourceName, &resourceProperties, linuxDtb) < RM_OK) {\r
-            return (retVal);\r
-        }\r
-       }\r
-    else if (offset != -FDT_ERR_NOTFOUND) {\r
-               /* Error returned by LIBFDT */\r
-        return (offset);\r
-    }\r
-    \r
-       offset = fdt_next_node(globalResourceDtb, nodeOffset, &depth);\r
-    if ((offset >= RM_DTB_UTIL_STARTING_NODE_OFFSET) && (depth >= RM_DTB_UTIL_STARTING_DEPTH)) {\r
-        retVal = rmParseResourceNode(rmInst, globalResourceDtb, offset, depth, linuxDtb);\r
-        if (retVal < -FDT_ERR_NOTFOUND) {\r
-            return (retVal);\r
+    /* Forward any queued requests that weren't forwarded yet */\r
+    if (rmInst->registeredWithDelegateOrServer) {\r
+        transaction = rmInst->transactionQueue;\r
+        while(transaction) {\r
+            if (((transaction->state == RM_SERVICE_PROCESSING) ||\r
+                 (transaction->state == RM_SERVICE_APPROVED_STATIC)) &&\r
+                !transaction->hasBeenForwarded) {\r
+                transactionForwarder(rmInst, transaction);\r
+            }\r
+            transaction = transaction->nextTransaction;\r
         }\r
     }\r
-    else if (offset != -FDT_ERR_NOTFOUND) {\r
-        /* Error returned by LIBFDT */\r
-        return (offset);\r
-    }\r
-    return (retVal);\r
-}\r
-\r
-int32_t rmInitializeAllocators(Rm_Inst *rmInst, void *globalResourceDtb, void *linuxDtb)\r
-{\r
-    int32_t nodeOffset = RM_DTB_UTIL_STARTING_NODE_OFFSET;\r
-    int32_t startDepth = RM_DTB_UTIL_STARTING_DEPTH;\r
-    int32_t result = RM_OK;\r
-\r
-    /* Recursively parse the Global Resource List, creating an allocator for\r
-     * each resource as specified in the node */\r
-    result = rmParseResourceNode(rmInst, globalResourceDtb, nodeOffset, startDepth, linuxDtb);\r
-\r
-    return(result);\r
 }\r
      \r
 /**********************************************************************\r
  ********************** Application visible APIs **********************\r
  **********************************************************************/\r
 \r
-/* Server Only */\r
-void Rm_printResourceStatus(Rm_Handle *rmHandle)\r
+/* FUNCTION PURPOSE: Display status of managed resources\r
+ ***********************************************************************\r
+ * DESCRIPTION: Prints the status (allocate/free status, as well as\r
+ *              owners) for all resources managed by the RM \r
+ *              instance network.  Also, prints the NameServer name\r
+ *              entries.  This function is only available on server\r
+ *              instances.\r
+ */\r
+void Rm_printResourceStatus(Rm_Handle rmServerHandle)\r
 {\r
-    Rm_Inst         *rmInst = (Rm_Inst *) rmHandle;\r
+    Rm_Inst         *rmInst = (Rm_Inst *)rmServerHandle;\r
     Rm_Allocator    *allocator = rmInst->allocators;\r
     Rm_Owner        *owners;\r
     Rm_ResourceTree *treeRoot;\r
@@ -1689,27 +1900,11 @@ void Rm_printResourceStatus(Rm_Handle *rmHandle)
     }\r
 }\r
 \r
-/**\r
- *  @b Description\r
- *  @n  \r
- *      This function initializes a RM instance.\r
- * \r
- *      IMPORTANT: Rm_init must be called prior to any other component startup\r
- *                 APIs (BIOS_start, Ipc_start, etc).\r
- *\r
- *  @param[in]  *initCfg\r
- *      Pointer to structure containing the initialization information for\r
- *      this RM instance.\r
- *\r
- *  @param[in]  *result\r
- *      Pointer to a uint32_t that will contain the result of the RM \r
- *      intialization and handle creation.  Any errors encountered will be \r
- *      returned via this pointer.\r
- *\r
- *  @retval\r
- *      Success - non-zero Rm_Handle returned.\r
- *  @retval\r
- *      Failure - NULL Rm_handle returned.\r
+/* FUNCTION PURPOSE: RM instance creation and initialization\r
+ ***********************************************************************\r
+ * DESCRIPTION: Returns a new RM instance created and initialized\r
+ *              using the parameters provided via the initCfg\r
+ *              structure.\r
  */\r
 Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result)\r
 {\r
@@ -1735,7 +1930,7 @@ Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result)
     memset ((void *) rmInst, 0, sizeof(Rm_Inst));\r
     rmInst->isLocked = false;\r
     rmInst->registeredWithDelegateOrServer = false;\r
-    rmInst->transactionSeqNum = rmTransactionInitSequenceNum();\r
+    rmInst->transactionSeqNum = transactionInitSequenceNum();\r
 \r
     rmInst->instType = initCfg->instType;    \r
     strncpy (rmInst->instName, initCfg->instName, RM_NAME_MAX_CHARS);\r
@@ -1744,6 +1939,7 @@ Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result)
         if (!initCfg->instCfg.serverCfg.globalResourceList ||\r
             !initCfg->instCfg.serverCfg.globalPolicy) {\r
             *result = RM_ERROR_INVALID_SERVER_CONFIGURATION;\r
+            Rm_osalFree((void *)rmInst, sizeof(Rm_Inst));\r
             return(NULL);\r
         }\r
 \r
@@ -1767,10 +1963,11 @@ Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result)
         globalResourceDtb = initCfg->instCfg.serverCfg.globalResourceList;\r
         fdt_open_into(globalResourceDtb, globalResourceDtb, fdt_totalsize(globalResourceDtb));\r
 \r
-        rmInitializeAllocators(rmInst, globalResourceDtb, linuxResourceDtb);  \r
-\r
-        if ((*result = rmPolicyValidatePolicyResourceNames(rmInst->policy, (void *)rmInst->allocators)) !=\r
-            RM_OK) {\r
+        if ((*result = initializeAllocators(rmInst, globalResourceDtb, linuxResourceDtb)) == RM_OK) {  \r
+            *result = rmPolicyValidatePolicyResourceNames(rmInst->policy, (void *)rmInst->allocators);\r
+        }\r
+        if (*result < RM_OK) {\r
+            Rm_osalFree((void *)rmInst, sizeof(Rm_Inst));\r
             return(NULL);\r
         }\r
     }\r
@@ -1803,26 +2000,16 @@ Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result)
     return ((Rm_Handle) rmInst);\r
 }\r
 \r
-/**\r
- *  @b Description\r
- *  @n  \r
- *      The function is used to get the version information of the RM.\r
- *\r
- *  @retval\r
- *      Version Information.\r
+/* FUNCTION PURPOSE: Returns RM version information\r
+ ***********************************************************************\r
  */\r
 uint32_t Rm_getVersion (void)\r
 {\r
     return RM_VERSION_ID;\r
 }\r
 \r
-/**\r
- *  @b Description\r
- *  @n  \r
- *      The function is used to get the version string for the RM.\r
- *\r
- *  @retval\r
- *      Version String.\r
+/* FUNCTION PURPOSE: Returns RM version string\r
+ ***********************************************************************\r
  */\r
 const char* Rm_getVersionStr (void)\r
 {\r
index b09a3cf94ee8ca3702bfc736c192046465eaa425..1a4503e6542245a9915ea659601dfa6c288dbe92 100644 (file)
@@ -495,8 +495,8 @@ bool rmPolicyCheckPrivilege(Rm_PolicyCheckCfg *privilegeCfg, int32_t *result)
 {
     int32_t              propertyOffset;
     const char          *propertyName;
-       int32_t              propertyLen;
-       const void          *propertyData;
+    int32_t              propertyLen;
+    const void          *propertyData;
     Rm_PolicyAssignment *assignment = NULL;
     Rm_PolicyAssignment *assignmentStart = NULL;
     Rm_PolicyPermission *permission = NULL;
@@ -586,8 +586,8 @@ uint32_t rmPolicyGetResourceBase(void *policyDtb, Rm_PolicyValidInstNode *validI
 {
     int32_t              propertyOffset;
     const char          *propertyName;
-       int32_t              propertyLen;
-       const void          *propertyData;
+    int32_t              propertyLen;
+    const void          *propertyData;
     Rm_PolicyAssignment *assignment = NULL;
     Rm_PolicyAssignment *assignmentStart = NULL;
     Rm_PolicyPermission *permission = NULL;
@@ -647,8 +647,8 @@ uint32_t rmPolicyGetResourceAlignment(void *policyDtb, int32_t resourceOffset)
 {
     int32_t            propertyOffset;
     const char        *propertyName;
-       int32_t            propertyLen;
-       const void        *propertyData;
+    int32_t            propertyLen;
+    const void        *propertyData;
     Rm_ResourceValue  *alignmentList;
     uint32_t           resourceAlignment = 0;
 
@@ -724,8 +724,8 @@ int32_t rmPolicyValidatePolicy(void *policyDtb, Rm_PolicyValidInstTree *validIns
     int32_t              propertyOffset;
     int32_t              depth;
     const char          *propertyName;
-       int32_t              propertyLen;
-       const void          *propertyData;
+    int32_t              propertyLen;
+    const void          *propertyData;
     Rm_PolicyPropType    propertyType;
     Rm_PolicyAssignment *assignmentList;
     int32_t              result;
@@ -765,8 +765,8 @@ Rm_PolicyValidInstTree *rmPolicyCreateValidInstTree(void *policyDtb, bool addLin
 {
     int32_t                 validInstOffset;
     const char             *validInstName = NULL;
-       int32_t                 validInstLen;
-       const void             *validInstData = NULL;
+    int32_t                 validInstLen;
+    const void             *validInstData = NULL;
     Rm_PolicyPropType       propertyType;
     Rm_PolicyValidInst     *validInstList = NULL;
     Rm_PolicyValidInstTree *rootEntry = NULL;
index 460028f09bfb710c39c0dd22a723ee1b2f6e187a..a438a39e05864466627fb672aa2c0da75d74b968 100644 (file)
  ********************** Application visible APIs **********************
  **********************************************************************/
 
+/* FUNCTION PURPOSE: Handles application component service requests
+ ***********************************************************************
+ * DESCRIPTION: Receives service requests from application components
+ *              and routes them to the transaction processor.  If
+ *              the service can be handled immediately the response
+ *              will be provided in the service response.  If the
+ *              service requires a blocking operation the handler
+ *              will provide a service ID back to the application.
+ *              The response will be sent at a later time via the
+ *              application supplied callback function.
+ */
 void Rm_serviceHandler (void *rmHandle, Rm_ServiceReqInfo *serviceRequest,
                         Rm_ServiceRespInfo *serviceResponse)
 {
@@ -123,6 +134,11 @@ void Rm_serviceHandler (void *rmHandle, Rm_ServiceReqInfo *serviceRequest,
     return;
 }
 
+/* FUNCTION PURPOSE: Opens the RM instance service handle
+ ***********************************************************************
+ * DESCRIPTION: Returns the service handle for an RM instance.  Only
+ *              one service handle can be opened per instance.
+ */
 Rm_ServiceHandle *Rm_serviceOpenHandle(Rm_Handle rmHandle, int32_t *result)
 {
     Rm_Inst          *rmInst = (Rm_Inst *)rmHandle;
@@ -147,6 +163,10 @@ Rm_ServiceHandle *Rm_serviceOpenHandle(Rm_Handle rmHandle, int32_t *result)
     return (newServiceHandle);
 }
 
+/* FUNCTION PURPOSE: Closes the RM instance service handle
+ ***********************************************************************
+ * DESCRIPTION: Closes the service handle for an RM instance.
+ */
 int32_t Rm_serviceCloseHandle(Rm_ServiceHandle *rmServiceHandle)
 {
     Rm_Inst *rmInst = (Rm_Inst *)rmServiceHandle->rmHandle;
index a780898aa17506f8ac2c7a7eb83ca0081ce17329..730e798527a213d1e12f6e687034a1b9548ae87d 100644 (file)
@@ -45,4 +45,14 @@ function modBuild()
     var testFiles = libUtility.listAllFiles (".txt", "test", true);
     for (var k = 0 ; k < testFiles.length; k++)
         Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];
+
+    /* Add the .dts to the package */
+    var testFiles = libUtility.listAllFiles (".dts", "test/dts_files", true);
+    for (var k = 0 ; k < testFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];    
+
+    /* Add the .dtb to the package */
+    var testFiles = libUtility.listAllFiles (".dtb", "test/dts_files", true);
+    for (var k = 0 ; k < testFiles.length; k++)
+        Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];           
 }
similarity index 95%
rename from device/tci6614-global-resources.dts
rename to test/dts_files/global-resources.dts
index 8bc0addd3c6490d65c33c86f7403178706f2e8b8..043fe3d2b6bcbbcf81a7a3b13c5571fdde387ecc 100644 (file)
@@ -2,12 +2,6 @@
 
 / {
     /* Device Resource Definitions */
-
-       /* TODO: where do following get defined in the linux DTB
-                        #define ARM_LINUX_CPPI_QMSS_TX_CH_NUM           12
-                        #define ARM_LINUX_CPPI_QMSS_RX_CH_NUM           12
-                        #define ARM_LINUX_CPPI_QMSS_FLOW                12
-       */
        
     qmss {
         ns-assignment = "Arm_Descriptors", <0 4096>;
index 74e9383432010631bda44fe003f5df43b42f6261..f2c0ab6ea0f1f4c14fdf257eb30f9ad822594c34 100644 (file)
@@ -1331,9 +1331,9 @@ Int main(Int argc, Char* argv[])
     if (MultiProc_self()== 0) {
         initSyncObj();
         
-        globalResourceFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\device\\tci6614-global-resources.dtb", "rb");
-        linuxDtbFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\device\\tci6614-linux-evm.dtb", "rb");
-        globalPolicyFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\device\\tci6614-server-policy.dtb", "rb");
+        globalResourceFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\test\\dts_files\\global-resources.dtb", "rb");
+        linuxDtbFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\test\\dts_files\\linux-evm.dtb", "rb");
+        globalPolicyFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\test\\dts_files\\server-policy.dtb", "rb");
 
         fseek(globalResourceFp, 0, SEEK_END);
         globalResourceFileSize = ftell(globalResourceFp);
@@ -1370,7 +1370,7 @@ Int main(Int argc, Char* argv[])
         Rm_printResourceStatus(rmServerHandle);
     }
     else if (MultiProc_self()== 1) {
-        staticPolicyFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\device\\tci6614-static-policy.dtb", "rb");
+        staticPolicyFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\test\\dts_files\\static-policy.dtb", "rb");
 
         fseek(staticPolicyFp, 0, SEEK_END);
         staticPolicyFileSize = ftell(staticPolicyFp);