Cleaned up test code to show clear PASS/FAIL
authorJustin Sobota <jsobota@ti.com>
Mon, 4 Mar 2013 21:12:13 +0000 (16:12 -0500)
committerJustin Sobota <jsobota@ti.com>
Mon, 4 Mar 2013 21:12:13 +0000 (16:12 -0500)
include/rm_loc.h
include/rm_servicesloc.h [new file with mode: 0644]
rm.h
rm_osal.h
rm_services.h
src/rm.c
src/rm_services.c
test/rm_osal.c
test/rm_test.c

index 41caccd564ef171771edcb82fb4924a592a68cc8..a2776685e63707c36e5b21c1b049f66bf5d0d9dc 100644 (file)
@@ -146,7 +146,10 @@ typedef struct {
     /* Service transaction sequence number tracker */
     uint32_t          transactionSeqNum;
     /* Service transaction linked list queue */
-    Rm_Transaction   *transactionQueue;  
+    Rm_Transaction   *transactionQueue; 
+    /* Local gate key provided through OSAL when RM needs to block due to
+     * a service request that requires a blocking operation to complete */
+    void             *localGateKey;
     /* Instance-type specific constructs */
     union {
         /* Server-specific instance data */
diff --git a/include/rm_servicesloc.h b/include/rm_servicesloc.h
new file mode 100644 (file)
index 0000000..2b47d66
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ *  file  rm_servicesloc.h
+ *
+ *  Private data structures of Resource Manager service interface.
+ *
+ *  ============================================================================
+ *      (C) Copyright 2012-2013, Texas Instruments, Inc.
+ * 
+ *  Redistribution and use in source and binary forms, with or without 
+ *  modification, are permitted provided that the following conditions 
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright 
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the 
+ *    documentation and/or other materials provided with the   
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  \par
+*/
+
+#ifndef RM_SERVICESLOC_H_
+#define RM_SERVICESLOC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* RM external includes */
+#include <ti/drv/rm/rm.h>
+
+void rmServiceInternalCallback(Rm_Handle rmHandle);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RM_SERVICESLOC_H_ */
+
diff --git a/rm.h b/rm.h
index e63b4a677bfa2f4d64846866df738f64095bc1b3..5bfe91fb83c36f1cf40ec49737f26091f96970b7 100644 (file)
--- a/rm.h
+++ b/rm.h
@@ -269,57 +269,54 @@ extern "C" {
 #define RM_ERROR_INVALID_SERVER_CONFIGURATION      RM_ERROR_BASE-22
 /** Service request type not recognized */
 #define RM_ERROR_INVALID_SERVICE_TYPE              RM_ERROR_BASE-23
-/** Service request did not contain callback function.  Callback function must always be provided
- *  with service request since blocking or non-blocking operations cannot be promised. */
-#define RM_ERROR_CALLBACK_NOT_PROVIDED             RM_ERROR_BASE-24
 /** rmAllocPkt transport callout returned NULL for rmPkt */
-#define RM_ERROR_TRANSPORT_ALLOC_PKT_ERROR         RM_ERROR_BASE-25
+#define RM_ERROR_TRANSPORT_ALLOC_PKT_ERROR         RM_ERROR_BASE-24
 /** rmSendPkt transport callout returned error when attempting to send the rmPkt */
-#define RM_ERROR_TRANSPORT_SEND_ERROR              RM_ERROR_BASE-26
+#define RM_ERROR_TRANSPORT_SEND_ERROR              RM_ERROR_BASE-25
 /** A RM service transaction could not be created for the service request */
-#define RM_ERROR_SERVICE_TRANS_NOT_CREATED         RM_ERROR_BASE-27
+#define RM_ERROR_SERVICE_TRANS_NOT_CREATED         RM_ERROR_BASE-26
 /** RM service transaction could not be found in instance's transaction queue */
-#define RM_ERROR_SERVICE_TRANS_DOES_NOT_EXIST      RM_ERROR_BASE-28
+#define RM_ERROR_SERVICE_TRANS_DOES_NOT_EXIST      RM_ERROR_BASE-27
 /** NameServer does not exist in instance, cannot satisfy NameServer service request */
-#define RM_ERROR_NAMESERVER_DOES_NOT_EXIST         RM_ERROR_BASE-29
+#define RM_ERROR_NAMESERVER_DOES_NOT_EXIST         RM_ERROR_BASE-28
 /** Service request to add a name to the NameServer failed */
-#define RM_ERROR_NAMESERVER_NAME_ADD_FAILED        RM_ERROR_BASE-30
+#define RM_ERROR_NAMESERVER_NAME_ADD_FAILED        RM_ERROR_BASE-29
 /** Could not find name specified in service request in NameServer */
-#define RM_ERROR_NAMESERVER_NAME_DOES_NOT_EXIST    RM_ERROR_BASE-31
+#define RM_ERROR_NAMESERVER_NAME_DOES_NOT_EXIST    RM_ERROR_BASE-30
 /** Service request made on Client or CD when no transport established and no static policy registered */
-#define RM_ERROR_REQ_FAILED_NO_STATIC_POLICY       RM_ERROR_BASE-32
+#define RM_ERROR_REQ_FAILED_NO_STATIC_POLICY       RM_ERROR_BASE-31
 /** RM transport handle has not been registered with the RM instance */
-#define RM_ERROR_TRANSPORT_HANDLE_DOES_NOT_EXIST   RM_ERROR_BASE-33
+#define RM_ERROR_TRANSPORT_HANDLE_DOES_NOT_EXIST   RM_ERROR_BASE-32
 /** RM received a packet with an unknown RM packet type */
-#define RM_ERROR_RECEIVED_INVALID_PACKET_TYPE      RM_ERROR_BASE-34
+#define RM_ERROR_RECEIVED_INVALID_PACKET_TYPE      RM_ERROR_BASE-33
 /** RM response packet does not match any requests sent from instance */
-#define RM_ERROR_PKT_RESP_DOES_NOT_MATCH_ANY_REQ   RM_ERROR_BASE-35
+#define RM_ERROR_PKT_RESP_DOES_NOT_MATCH_ANY_REQ   RM_ERROR_BASE-34
 /** Server attempted to connect to another server or a CD attempted to connect to another CD or
  *  Client attempted to connect to another client */
-#define RM_ERROR_INVALID_REMOTE_INST_TYPE          RM_ERROR_BASE-36
+#define RM_ERROR_INVALID_REMOTE_INST_TYPE          RM_ERROR_BASE-35
 /** RM client attempted to register with more than one Server or CD or a CD attempted to register 
  *  with more than one Server */
-#define RM_ERROR_ALREADY_REGD_SERVER_OR_CD         RM_ERROR_BASE-37
+#define RM_ERROR_ALREADY_REGD_SERVER_OR_CD         RM_ERROR_BASE-36
 /** Service has both a NameServer name and a base, length, or alignment specified */
-#define RM_ERROR_NS_NAME_AND_RES_VAL_CONFLICT      RM_ERROR_BASE-38
+#define RM_ERROR_NS_NAME_AND_RES_VAL_CONFLICT      RM_ERROR_BASE-37
 /** Instance type not recognized */
-#define RM_ERROR_INVALID_INST_TYPE                 RM_ERROR_BASE-39
+#define RM_ERROR_INVALID_INST_TYPE                 RM_ERROR_BASE-38
 /** 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-40
+#define RM_ERROR_GRL_LINUX_ALIAS_BUT_NO_DTB        RM_ERROR_BASE-39
 /** RM attempted to allocate a transport packet but the rmAllocPkt callout was not registered */
-#define RM_ERROR_TRANSPORT_ALLOC_PKT_NOT_REGD      RM_ERROR_BASE-41
+#define RM_ERROR_TRANSPORT_ALLOC_PKT_NOT_REGD      RM_ERROR_BASE-40
 /** RM attempted to send a packet but the rmSendPkt callout was not registered */
-#define RM_ERROR_TRANSPORT_SEND_NOT_REGD           RM_ERROR_BASE-42
+#define RM_ERROR_TRANSPORT_SEND_NOT_REGD           RM_ERROR_BASE-41
 /** RM attempted to send a response packet but the transport to the remote instance that sent
  *  the request packet is not registered */
-#define RM_ERROR_TRANSPORT_REMOTE_HNDL_NOT_REGD    RM_ERROR_BASE-43
+#define RM_ERROR_TRANSPORT_REMOTE_HNDL_NOT_REGD    RM_ERROR_BASE-42
 /** RM instance cannot be deleted with transports still registered */
-#define RM_ERROR_CANT_DELETE_WITH_REGD_TRANSPORT   RM_ERROR_BASE-44
+#define RM_ERROR_CANT_DELETE_WITH_REGD_TRANSPORT   RM_ERROR_BASE-43
 /** RM instance cannot be deleted with open service handle */
-#define RM_ERROR_CANT_DELETE_WITH_OPEN_SERV_HNDL   RM_ERROR_BASE-45
+#define RM_ERROR_CANT_DELETE_WITH_OPEN_SERV_HNDL   RM_ERROR_BASE-44
 /** RM instance cannot be deleted when there are transactions pending and the 
  *  ignorePendingServices parameter is set to false */
-#define RM_ERROR_CANT_DELETE_PENDING_TRANSACTIONS  RM_ERROR_BASE-46
+#define RM_ERROR_CANT_DELETE_PENDING_TRANSACTIONS  RM_ERROR_BASE-45
 
 /** 
  * @brief Maximum number of characters allowed for RM instance, resource, and
index dec997e6c37ba9bd4cff6bed4fcc2a29d0a7e685..b9167e537ed521dd5a3ee8829ffe01cb09242ae9 100644 (file)
--- a/rm_osal.h
+++ b/rm_osal.h
  ************************* Extern Declarations ************************
  **********************************************************************/
 
-extern void* Osal_rmMalloc (uint32_t num_bytes);
-extern void Osal_rmFree (void *ptr, uint32_t size);
-extern void Osal_rmLog (char *fmt, ... );
+extern void *Osal_rmMalloc (uint32_t num_bytes);
+extern void  Osal_rmFree (void *ptr, uint32_t size);
+extern void *Osal_rmLocalGateEnter (void);
+extern void  Osal_rmLocalGateLeave (void *localGateKey);
+extern void  Osal_rmLog (char *fmt, ... );
 
 /**
  * @brief   The macro is used by RM to allocate memory of specified
@@ -118,6 +120,11 @@ extern void Osal_rmLog (char *fmt, ... );
  */
 #define Rm_osalFree               Osal_rmFree
 
+
+#define Rm_osalLocalGateEnter     Osal_rmLocalGateEnter
+
+#define Rm_osalLocalGateLeave     Osal_rmLocalGateLeave
+
 /**
  * @brief   The macro is used by RM to log various 
  *          messages. 
index 142ea9a350a145821e05b5dbdbd2c3aafeec3a3b..67c1670391fa2ca1a2ae1a2eda505fbefd80fac3 100644 (file)
@@ -80,22 +80,27 @@ typedef enum {
  *        request results back to the application components
  */
 typedef struct {
+    /** RM instance handle from which the service request that spawned this 
+     *  result originated.  Used by application to sort responses, received
+     *  via callback function, from RM instances located on the same core. */
+    Rm_Handle rmHandle;
     /** 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;
+    int32_t   serviceState;
     /** 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;
+     *  resource request. <br> <br> The service ID will never have a value of
+     *  zero. */
+    uint32_t  serviceId;
     /** Affected resource name */
-    char resourceName[RM_NAME_MAX_CHARS];
+    char      resourceName[RM_NAME_MAX_CHARS];
     /** The resource base value allocated, freed, or mapped to NameServer name. */
-    int32_t resourceBase;
+    int32_t   resourceBase;
     /** The resource length starting at base allocated, freed, or mapped to
      *  NameServer name. */
-    uint32_t resourceLength;
+    uint32_t  resourceLength;
 } Rm_ServiceRespInfo;
 
 /** 
@@ -113,23 +118,23 @@ typedef struct {
  */
 typedef struct {
     /** The type of service requested */
-    Rm_ServiceType type;
+    Rm_ServiceType      type;
     /** 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 */
-    const char *resourceName;
+    const char         *resourceName;
 /** 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 base value of the resource affected by the service request.
      *  #RM_RESOURCE_BASE_UNSPECIFIED can be substituted. */
-    int32_t resourceBase;
+    int32_t             resourceBase;
     /** The resource length, starting from #resourceBase affected by the
      *  service request. */
-    uint32_t resourceLength;
+    uint32_t            resourceLength;
 /** 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"
@@ -142,15 +147,15 @@ typedef struct {
     /** 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;
+    int32_t             resourceAlignment;
     /** 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. */
-    const char *resourceNsName;
+    const char         *resourceNsName;
     /** 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_ServiceCallback  callback;
 } Rm_ServiceReqInfo;
 
 /** 
@@ -158,7 +163,7 @@ typedef struct {
  *        services
  */
 typedef struct {
-    /** RM instance handle for which the service handle was allocated from. */
+    /** RM instance handle from which the service handle was allocated from. */
     void *rmHandle;
     /**
      *  @b Description
index a158df8b9fe3cbf8a45f4c5f56d0bc92f4c9655f..bb6e697a7709aa6fc3f1f1a0191d759de4e77df2 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
@@ -55,6 +55,7 @@
 #include <ti/drv/rm/include/rm_allocatorloc.h>
 #include <ti/drv/rm/include/rm_transportloc.h>
 #include <ti/drv/rm/include/rm_nameserverloc.h>
+#include <ti/drv/rm/include/rm_servicesloc.h>
 
 /* RM LIBFDT includes */
 #include <ti/drv/rm/util/libfdt/libfdt.h>
@@ -209,6 +210,7 @@ static void serviceResponder (Rm_Inst *rmInst, Rm_Transaction *transaction)
 {
     Rm_ServiceRespInfo serviceResponse;
 
+    serviceResponse.rmHandle = (Rm_Handle)rmInst;
     /* The responseTransaction will contain the resultant state details of
      * the requestTransaction's service request */
     serviceResponse.serviceState = transaction->state;
@@ -228,11 +230,16 @@ static void serviceResponder (Rm_Inst *rmInst, Rm_Transaction *transaction)
         serviceResponse.resourceLength = transaction->resourceInfo.length;
     }
 
-    /* Issue the callback to the requesting component with the response information */
-    transaction->callback.serviceCallback(&serviceResponse);
-
-    /* Delete the transaction from the transaction queue */
-    rmTransactionQueueDelete(rmInst, transaction->localId);
+    if (transaction->callback.serviceCallback) {
+        /* Issue the callback to the requesting component with the response information */
+        transaction->callback.serviceCallback(&serviceResponse);
+        /* Delete the transaction from the transaction queue */
+        rmTransactionQueueDelete(rmInst, transaction->localId);
+    }
+    else {
+        rmServiceInternalCallback((Rm_Handle)rmInst);
+    }
+    
     return;
 }
 
@@ -299,52 +306,45 @@ static void transactionForwarder (Rm_Inst *rmInst, Rm_Transaction *transaction)
     Rm_Packet       *rmPkt = NULL;    
     Rm_PacketHandle  pktHandle = NULL;
 
-    /* Forward request if callback function has been plugged (request came from service handle)
-     * or remoteOriginatingId is populated (request came from another instance over transport) */
-    if (transaction->callback.serviceCallback || transaction->remoteOriginatingId) {
-        if (rmInst->instType == Rm_instType_CLIENT) {
-            dstTransport = rmTransportFindRemoteInstType(rmInst->transports, Rm_instType_CLIENT_DELEGATE);
+    if (rmInst->instType == Rm_instType_CLIENT) {
+        dstTransport = rmTransportFindRemoteInstType(rmInst->transports, Rm_instType_CLIENT_DELEGATE);
 
-            if (!dstTransport) {
-                dstTransport = rmTransportFindRemoteInstType(rmInst->transports, Rm_instType_SERVER);
-            }
-        } 
-        else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
+        if (!dstTransport) {
             dstTransport = rmTransportFindRemoteInstType(rmInst->transports, Rm_instType_SERVER);
         }
+    } 
+    else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
+        dstTransport = rmTransportFindRemoteInstType(rmInst->transports, Rm_instType_SERVER);
+    }
 
-        /* Just queue transaction if transport hasn't been registered.  Do not return error */
-        if (dstTransport) {            
-            rmPkt = dstTransport->callouts.rmAllocPkt(dstTransport->appTransportHandle, 
-                                                      sizeof(Rm_Packet), &pktHandle);
-            if (!rmPkt || !pktHandle) {
-                transaction->state = RM_ERROR_TRANSPORT_ALLOC_PKT_ERROR;
-                goto errorExit;
-            }
+    /* Just queue transaction if transport hasn't been registered.  Do not return error */
+    if (dstTransport) {            
+        rmPkt = dstTransport->callouts.rmAllocPkt(dstTransport->appTransportHandle, 
+                                                  sizeof(Rm_Packet), &pktHandle);
+        if (!rmPkt || !pktHandle) {
+            transaction->state = RM_ERROR_TRANSPORT_ALLOC_PKT_ERROR;
+            goto errorExit;
+        }
 
-            switch (transaction->type) {
-                case Rm_service_RESOURCE_ALLOCATE_INIT:
-                case Rm_service_RESOURCE_ALLOCATE_USE:
-                case Rm_service_RESOURCE_FREE:
-                case Rm_service_RESOURCE_GET_BY_NAME:
-                    createResourceReqPkt(rmPkt, rmInst->instName, transaction);
-                    break;
-                case Rm_service_RESOURCE_MAP_TO_NAME:
-                case Rm_service_RESOURCE_UNMAP_NAME:
-                    createNsRequestPkt(rmPkt, rmInst->instName, transaction);
-                    break;
-            }
-      
-            if (dstTransport->callouts.rmSendPkt(dstTransport->appTransportHandle, pktHandle) < RM_OK) {
-                transaction->state = RM_ERROR_TRANSPORT_SEND_ERROR;
-                goto errorExit;
-            }              
-            transaction->hasBeenForwarded = true;
-            /* Transaction not deleted.  Waiting for response from RM CD or Server */
+        switch (transaction->type) {
+            case Rm_service_RESOURCE_ALLOCATE_INIT:
+            case Rm_service_RESOURCE_ALLOCATE_USE:
+            case Rm_service_RESOURCE_FREE:
+            case Rm_service_RESOURCE_GET_BY_NAME:
+                createResourceReqPkt(rmPkt, rmInst->instName, transaction);
+                break;
+            case Rm_service_RESOURCE_MAP_TO_NAME:
+            case Rm_service_RESOURCE_UNMAP_NAME:
+                createNsRequestPkt(rmPkt, rmInst->instName, transaction);
+                break;
         }
-    }
-    else {
-        transaction->state = RM_ERROR_CALLBACK_NOT_PROVIDED;
+  
+        if (dstTransport->callouts.rmSendPkt(dstTransport->appTransportHandle, pktHandle) < RM_OK) {
+            transaction->state = RM_ERROR_TRANSPORT_SEND_ERROR;
+            goto errorExit;
+        }              
+        transaction->hasBeenForwarded = true;
+        /* Transaction not deleted.  Waiting for response from RM CD or Server */
     }        
 errorExit: 
     return;
@@ -850,9 +850,17 @@ void Rm_printResourceStatus(Rm_Handle rmServerHandle)
 
             treeRoot = allocator->allocatorRootEntry;
 
-            RB_FOREACH(treeNode, _Rm_AllocatorResourceTree, treeRoot) {               
-                Rm_osalLog("          %10d - %10d ", treeNode->base, 
-                                                     treeNode->base + treeNode->length -1);
+            RB_FOREACH(treeNode, _Rm_AllocatorResourceTree, treeRoot) {
+                if ((treeNode->base >= 65536) ||
+                    ((treeNode->base + treeNode->length - 1) >= 65536)) {
+                    /* Print in hex if number is very large */
+                    Rm_osalLog("          0x%08x - 0x%08x ", treeNode->base, 
+                                                             treeNode->base + treeNode->length - 1);
+                }
+                else {
+                    Rm_osalLog("          %10d - %10d ", treeNode->base, 
+                                                         treeNode->base + treeNode->length - 1);
+                }
                 
                 if (treeNode->allocationCount == 0) {
                     Rm_osalLog("FREE\n");
@@ -885,14 +893,15 @@ void Rm_printInstanceStatus(Rm_Handle rmHandle)
     Rm_Transaction *transactionQ = rmInst->transactionQueue;
 
     Rm_osalLog("Instance name: %s\n", rmInst->instName);
+    Rm_osalLog("Handle: 0x%08x\n", rmHandle);    
     if (rmInst->instType == Rm_instType_SERVER) {
-        Rm_osalLog("Type: Server\n");
+        Rm_osalLog("Type:   Server\n");
     }
     else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
-        Rm_osalLog("Type: Client Delegate\n");
+        Rm_osalLog("Type:   Client Delegate\n");
     }
     else {
-        Rm_osalLog("Type: Client\n");
+        Rm_osalLog("Type:   Client\n");
     }
 
     if (transportList) {
index ab09e705bb497571f9d4609959aeb90ae6ea28d5..3a2b7844394db33987a22179fc9a0f1a43aabc98 100644 (file)
@@ -43,6 +43,7 @@
 #include <string.h>
 
 /* RM external API includes */
+#include <ti/drv/rm/rm.h>
 #include <ti/drv/rm/rm_services.h>
 
 /* RM internal API includes */
 /* RM OSAL layer */
 #include <rm_osal.h>
 
+/**********************************************************************
+ ********************** Internal Functions ****************************
+ **********************************************************************/
+
+void rmServiceInternalCallback(Rm_Handle rmHandle)
+{
+    Rm_Inst *rmInst = (Rm_Inst *)rmHandle;
+
+    /* Unblock so the serviceHandler can provide the response to the application */
+    Rm_osalLocalGateLeave(rmInst->localGateKey);
+}
+
 /**********************************************************************
  ********************** Application visible APIs **********************
  **********************************************************************/
@@ -102,6 +115,13 @@ void Rm_serviceHandler (void *rmHandle, const Rm_ServiceReqInfo *serviceRequest,
         rmProcessRouter(rmInst, transaction);
             
         memset((void *)serviceResponse, 0, sizeof(Rm_ServiceRespInfo));
+
+        if ((transaction->state == RM_SERVICE_PROCESSING) && (transaction->callback.serviceCallback == NULL)) {
+            /* Block until response is received.  Response will be received in transaction. */
+            rmInst->localGateKey = Rm_osalLocalGateEnter();
+        }
+
+        serviceResponse->rmHandle = rmHandle;
         serviceResponse->serviceState = transaction->state;
         if ((serviceResponse->serviceState == RM_SERVICE_PROCESSING) ||
             (serviceResponse->serviceState == RM_SERVICE_APPROVED_STATIC)) {
@@ -144,7 +164,7 @@ Rm_ServiceHandle *Rm_serviceOpenHandle(Rm_Handle rmHandle, int32_t *result)
     *result = RM_OK;
 
     if (rmInst->serviceHandle == NULL) {
-        newServiceHandle = Rm_osalMalloc (sizeof(Rm_ServiceHandle));
+        newServiceHandle = Rm_osalMalloc(sizeof(Rm_ServiceHandle));
         if (newServiceHandle) {
             newServiceHandle->rmHandle = rmHandle;
             newServiceHandle->Rm_serviceHandler = Rm_serviceHandler;
index 3f77372d346b683c105cce1a58d7008176efce91..4b8c65f3c9dfe0aaf6f52ae51e97bdd7bf115d25 100644 (file)
@@ -87,6 +87,22 @@ void Osal_rmFree (void *ptr, uint32_t size)
        Memory_free(NULL, ptr, size);
 }
 
+void Osal_rmLocalGateInit (void)
+{
+
+}
+
+void *Osal_rmLocalGateEnter (void)
+{
+
+    return (NULL);
+}
+
+void  Osal_rmLocalGateLeave (void *localGateKey)
+{
+
+}
+
 /* FUNCTION PURPOSE: Prints a variable list
  ***********************************************************************
  * DESCRIPTION: The function is used to print a string to the console
index a07aaceff285ade0f888a740bd5d04f230c4abaf..00cf52acfc4138c166dd60e9e4650c4a2e72c460 100644 (file)
 /* Maximum number of registered RM transports */
 #define MAX_MAPPING_ENTRIES          3
 
+/* Size of RM static allocation response queue.  Must be greater than number of APPROVED
+ * static allocations */
+#define MAX_STATIC_ALLOCATION_RESPS  5 
+
 /* Size of RM service response queue */
 #define MAX_QUEUED_SERVICE_RESPONSES 10
 
+/* Error checking macro */
+#define ERROR_CHECK(checkVal, resultVal, rmInstName, printMsg)                   \
+    if (resultVal != checkVal) {                                                 \
+        char errorMsgToPrint[] = printMsg;                                       \
+        System_printf("Error Core %d : %s : ", coreNum, rmInstName);    \
+        System_printf("%s with error code : %d\n", errorMsgToPrint, resultVal);  \
+        System_abort("Test Failure\n");                                          \
+    }
+
 /**********************************************************************
  ********************** RM Test Data Structures ***********************
  **********************************************************************/
@@ -131,36 +144,65 @@ extern const char rmStaticPolicy[];
  ********************** Global Variables ******************************
  **********************************************************************/
 
+/* DSP core number according to IPC */
+uint16_t            coreNum;
+
+/* Task to configure application transport code for RM */
 Task_Handle         rmStartupTskHandle;
+/* High priority task for receiving RM packets */
 Task_Handle         rmReceiveTskHandle;
+/* RM server test task */
 Task_Handle         rmServerTskHandle;
+/* RM client delegate and client test task */
 Task_Handle         rmClientTskHandle;
 
+/* GateMP used to synchronize tests between the two RM test tasks */
 GateMP_Handle       gateHandle = NULL;
+/* GateMP key */
 IArg                gateKey;
 
+/* Handle for heap that RM packets will be allocated from */
 HeapBufMP_Handle    rmPktHeapHandle = NULL;
 
+/* MessageQ used by RM CD to send packets to RM Server */
 char                serverFromCdQueueName[30] = "RM_Server_From_CD_Queue";
+/* MessageQ used by RM Server to send packets to RM CD */
 char                cdFromServerQueueName[30] = "RM_CD_From_Server_Queue";
+/* MessageQ used by RM Client to send packets to RM CD */
 char                cdFromClientQueueName[30] = "RM_CD_From_Client_Queue";
+/* MessageQ used by RM CD to send packets to RM Client */
 char                clientFromCdQueueName[30] = "RM_Client_From_CD_Queue";
 
-char                rmServerName[RM_NAME_MAX_CHARS]         = "RM_Server";
-char                rmClientDelegateName[RM_NAME_MAX_CHARS] = "RM_Client_Delegate";
-char                rmClientName[RM_NAME_MAX_CHARS]         = "RM_Client";
+/* RM Server instance name (must match with RM Global Resource List (GRL) and policies */
+char                rmServerName[RM_NAME_MAX_CHARS] = "RM_Server";
+/* RM CD instance name (must match with RM Global Resource List (GRL) and policies */
+char                rmCdName[RM_NAME_MAX_CHARS]     = "RM_Client_Delegate";
+/* RM Client instance name (must match with RM Global Resource List (GRL) and policies */
+char                rmClientName[RM_NAME_MAX_CHARS] = "RM_Client";
 
-Rm_Handle           rmServerHandle         = NULL;
-Rm_Handle           rmClientDelegateHandle = NULL;
-Rm_Handle           rmClientHandle         = NULL;
+/* RM instance handles */
+Rm_Handle           rmServerHandle = NULL;
+Rm_Handle           rmCdHandle     = NULL;
+Rm_Handle           rmClientHandle = NULL;
 
-Rm_ServiceHandle   *rmServerServiceHandle         = NULL;
-Rm_ServiceHandle   *rmClientDelegateServiceHandle = NULL;
-Rm_ServiceHandle   *rmClientServiceHandle         = NULL;
+/* RM instance service handles */
+Rm_ServiceHandle   *rmServerServiceHandle = NULL;
+Rm_ServiceHandle   *rmCdServiceHandle     = NULL;
+Rm_ServiceHandle   *rmClientServiceHandle = NULL;
 
+/* Transport map stores the RM transport handle to IPC MessageQ queue mapping */
 Transport_MapEntry  rmTransportMap[MAX_MAPPING_ENTRIES];
+
+/* Static allocation response queue */
+Rm_ServiceRespInfo  staticResponseQueue[MAX_STATIC_ALLOCATION_RESPS];
+/* Static allocation response queue index */
+uint32_t            numStaticResponses;
+
+
+/* RM response info queue used to store service responses received via the callback function */
 Rm_ServiceRespInfo  responseInfoQueue[MAX_QUEUED_SERVICE_RESPONSES];
 
+/* RM resource names (must match resource node names in GRL and policies */
 char                resourceNameMemRegion[RM_NAME_MAX_CHARS]  = "memory-regions";
 char                resourceNameAccumCh[RM_NAME_MAX_CHARS]    = "accumulator-ch";
 char                resourceNameGpQ[RM_NAME_MAX_CHARS]        = "gp-queue";
@@ -169,29 +211,13 @@ char                resourceNameQosCluster[RM_NAME_MAX_CHARS] = "qos-cluster";
 char                resourceNameAifRxCh[RM_NAME_MAX_CHARS]    = "aif-rx-ch";
 char                resourceNameInfraQ[RM_NAME_MAX_CHARS]     = "infra-queue";
 
+/* Test RM NameServer name */
 char                nameServerNameFavQ[RM_NAME_MAX_CHARS]     = "My_Favorite_Queue";
 
 /**********************************************************************
- ************************** Cache Functions ***************************
+ *************************** Test Functions ***************************
  **********************************************************************/
 
-/**
- *  @b Description
- *  @n
- *      The function is used to indicate that a block of memory is
- *      about to be accessed. If the memory block is cached then this
- *      indicates that the application would need to ensure that the
- *      cache is updated with the data from the actual memory.
- *
- *  @param[in]  ptr
- *       Address of memory block
- *
- *  @param[in]  size
- *       Size of memory block
- *
- *  @retval
- *      Not Applicable
- */
 void beginMemAccess (void *ptr, uint32_t size)
 {
     uint32_t key;
@@ -210,23 +236,6 @@ void beginMemAccess (void *ptr, uint32_t size)
     Hwi_restore(key);
 }
 
-/**
- *  @b Description
- *  @n
- *      The function is used to indicate that the block of memory has
- *      finished being accessed. If the memory block is cached then the
- *      application would need to ensure that the contents of the cache
- *      are updated immediately to the actual memory.
- *
- *  @param[in]  ptr
- *       Address of memory block
- *
- *  @param[in]  size
- *       Size of memory block
- *
- *  @retval
- *      Not Applicable
- */
 void endMemAccess (void *ptr, uint32_t size)
 {
     uint32_t key;
@@ -243,9 +252,6 @@ void endMemAccess (void *ptr, uint32_t size)
     Hwi_restore(key);
 }
 
-/**********************************************************************
- *********** RM Application Transport APIs (utilizing IPC) ************
- **********************************************************************/
 Rm_Packet *transportAlloc(Rm_AppTransportHandle appTransport, uint32_t pktSize, Rm_PacketHandle *pktHandle)
 {
     Rm_Packet     *rmPkt = NULL;
@@ -254,7 +260,7 @@ Rm_Packet *transportAlloc(Rm_AppTransportHandle appTransport, uint32_t pktSize,
     /* Allocate a messageQ message for containing the RM packet */
     rmMsg = (MsgQ_RmPacket *)MessageQ_alloc(MSGQ_HEAP_ID, sizeof(MsgQ_RmPacket));
     if (rmMsg == NULL) {
-        System_printf("Core %d: MessageQ_alloc failed in TransportSend\n", MultiProc_self());
+        System_printf("Core %d: MessageQ_alloc failed in TransportSend\n", coreNum);
         *pktHandle = NULL;
         return(NULL);
     }
@@ -279,7 +285,7 @@ void transportFree (MessageQ_Msg rmMsgQMsg, Rm_Packet *pkt)
 
     status = MessageQ_free(rmMsgQMsg);
     if (status < 0) { 
-        System_printf("Core %d: MessageQ_free had a failure/error in transportFree\n", MultiProc_self());
+        System_printf("Core %d: MessageQ_free had a failure/error in transportFree\n", coreNum);
     }     
 }
 
@@ -296,7 +302,7 @@ int32_t transportSend (Rm_AppTransportHandle appTransport, Rm_PacketHandle pktHa
     status = MessageQ_put(remoteQueueId, (MessageQ_Msg)rmMsg);
     if (status < 0) {
         transportFree((MessageQ_Msg)rmMsg, rmMsg->rmPkt);
-        System_printf("Core %d: MessageQ_put had a failure/error in TransportSend: error: %d\n", MultiProc_self(),
+        System_printf("Core %d: MessageQ_put had a failure/error in TransportSend: error: %d\n", coreNum,
                                                                                                  status);
     }
     return (status);
@@ -322,7 +328,7 @@ void transportReceive (uint32_t transportMapEntry)
             System_abort("This should not happen since timeout is forever\n");
         }
         if (rmMsg == NULL) {
-            System_printf("Core %d: MessageQ_get failed returning a null packet in TransportReceive\n", MultiProc_self());
+            System_printf("Core %d: MessageQ_get failed returning a null packet in TransportReceive\n", coreNum);
         }
 
         /* Extract the Rm_Packet from the RM msg */
@@ -331,7 +337,7 @@ void transportReceive (uint32_t transportMapEntry)
 
         /* Provide packet to RM for processing */
         if (status = Rm_receivePacket(rmTransportMap[transportMapEntry].transportHandle, rmPkt)) {
-            System_printf("Core %d: RM encountered error processing received packet: %d\n", MultiProc_self(), status);
+            System_printf("Core %d: RM encountered error processing received packet: %d\n", coreNum, status);
         }
 
         /* Free RM packet buffer and messageQ message */
@@ -339,15 +345,12 @@ void transportReceive (uint32_t transportMapEntry)
     }
 }
 
-/**********************************************************************
- ******** RM Service Callback Function (for blocking services) ********
- **********************************************************************/
 void serviceCallback(Rm_ServiceRespInfo *serviceResponse)
 {
     uint32_t qIndex = 0;
     
     /* Populate next free entry in the responseInfoQueue */
-    while (responseInfoQueue[qIndex].serviceId) {
+    while (responseInfoQueue[qIndex].serviceId != 0) {
         qIndex++;
         if (qIndex == MAX_QUEUED_SERVICE_RESPONSES) {
             qIndex = 0;
@@ -358,13 +361,14 @@ void serviceCallback(Rm_ServiceRespInfo *serviceResponse)
     memcpy((void *)&responseInfoQueue[qIndex], (void *)serviceResponse, sizeof(Rm_ServiceRespInfo));
 }
 
-bool blockForResponse(Rm_ServiceRespInfo *respInfo)
+bool waitForResponse(Rm_ServiceRespInfo *respInfo)
 {
     uint32_t qIndex = 0;
 
     if (respInfo->serviceState == RM_SERVICE_PROCESSING) {
         /* Scan responseInfoQueue for the response received via the callback function */
-        while(responseInfoQueue[qIndex].serviceId != respInfo->serviceId) {
+        while((responseInfoQueue[qIndex].serviceId != respInfo->serviceId) ||
+              (responseInfoQueue[qIndex].rmHandle != respInfo->rmHandle)) {
             qIndex++;
             if (qIndex == MAX_QUEUED_SERVICE_RESPONSES) {
                 qIndex = 0;
@@ -375,33 +379,42 @@ bool blockForResponse(Rm_ServiceRespInfo *respInfo)
 
         memcpy((void *)respInfo, (void *)&responseInfoQueue[qIndex], sizeof(Rm_ServiceRespInfo));
         memset((void *)&responseInfoQueue[qIndex], 0, sizeof(Rm_ServiceRespInfo));
-
-        if ((respInfo->serviceState != RM_SERVICE_APPROVED) &&
-            (respInfo->serviceState != RM_SERVICE_APPROVED_STATIC)) {
-            System_printf("Core %d: Service request encountered error or denial: %d\n", MultiProc_self(),
-                                                                                        respInfo->serviceState);
-            return(FALSE);
-        }
     }
     return(TRUE);
 }
 
+void setRmRequest(Rm_ServiceReqInfo *reqInfo, Rm_ServiceType type, const char *resName, int32_t resBase,
+                  uint32_t resLen, int32_t resAlign, const char *nsName, bool setCallback, Rm_ServiceRespInfo *respInfo)
+{                                                                                
+    memset((void *)reqInfo, 0, sizeof(Rm_ServiceReqInfo));                                        
+    reqInfo->type = type;                                                                           
+    reqInfo->resourceName = resName;                                                                
+    reqInfo->resourceBase = resBase;                                                                
+    reqInfo->resourceLength = resLen;                                                               
+    reqInfo->resourceAlignment = resAlign;                                                          
+    reqInfo->resourceNsName = nsName;
+    if (setCallback) {
+        reqInfo->callback.serviceCallback = serviceCallback;  
+    }
+    memset((void *)respInfo, 0, sizeof(Rm_ServiceRespInfo));                                     
+}
+
 void rmCleanupTsk(UArg arg0, UArg arg1)
 {
     int32_t result;
     
     /* Delete the RM test tasks */
-    if (MultiProc_self() == 0) {
+    if (coreNum == 0) {
         if (rmServerTskHandle) {
-            System_printf("Core %d: Deleting RM server task...\n", MultiProc_self());
+            System_printf("Core %d: Deleting RM server task...\n", coreNum);
             Task_delete(&rmServerTskHandle);
             /* Set the task handle to be NULL so that the delete only occurs once */
             rmServerTskHandle = NULL;
         }
     }
-    else if (MultiProc_self() == 1) {
+    else if (coreNum == 1) {
         if (rmClientTskHandle) {
-            System_printf("Core %d: Deleting RM client task...\n", MultiProc_self());        
+            System_printf("Core %d: Deleting RM client task...\n", coreNum);        
             Task_delete(&rmClientTskHandle);
             /* Set the task handle to be NULL so that the delete only occurs once */
             rmClientTskHandle = NULL;
@@ -409,7 +422,7 @@ void rmCleanupTsk(UArg arg0, UArg arg1)
     }
     
     /* Delete the RM receive task */
-    System_printf("Core %d: Deleting RM receive task...\n", MultiProc_self());
+    System_printf("Core %d: Deleting RM receive task...\n", coreNum);
     if (rmReceiveTskHandle) {
         Task_delete(&rmReceiveTskHandle);
         /* Set the task handle to be NULL so that the delete only occurs once */
@@ -417,44 +430,45 @@ void rmCleanupTsk(UArg arg0, UArg arg1)
     }
 
     /* Cleanup all service ports, transport handles, RM instances, and IPC constructs */
-    if (MultiProc_self() == 0) {
+    if (coreNum == 0) {
         Rm_serviceCloseHandle(rmServerServiceHandle);
 
         Rm_transportUnregister(rmTransportMap[SERVER_TO_CD_MAP_ENTRY].transportHandle);
 
         result = Rm_delete(rmServerHandle, true);
         if (result != RM_OK) {
-            System_printf("Core %d: RM server instance delete failed with error %d\n", MultiProc_self(), result);
+            System_printf("Core %d: RM server instance delete failed with error %d\n", coreNum, result);
         }        
     }
-    else if (MultiProc_self() == 1) {
-        Rm_serviceCloseHandle(rmClientDelegateServiceHandle);
+    else if (coreNum == 1) {
+        Rm_serviceCloseHandle(rmCdServiceHandle);
         Rm_serviceCloseHandle(rmClientServiceHandle);
 
         Rm_transportUnregister(rmTransportMap[CD_TO_SERVER_MAP_ENTRY].transportHandle);
         Rm_transportUnregister(rmTransportMap[CD_TO_CLIENT_MAP_ENTRY].transportHandle);
         Rm_transportUnregister(rmTransportMap[CLIENT_TO_CD_MAP_ENTRY].transportHandle);
 
-        result = Rm_delete(rmClientDelegateHandle, true);
+        result = Rm_delete(rmCdHandle, true);
         if (result != RM_OK) {
-            System_printf("Core %d: RM cd instance delete failed with error %d\n", MultiProc_self(), result);
+            System_printf("Core %d: RM cd instance delete failed with error %d\n", coreNum, result);
         }  
         result = Rm_delete(rmClientHandle, true);
         if (result != RM_OK) {
-            System_printf("Core %d: RM client instance delete failed with error %d\n", MultiProc_self(), result);
+            System_printf("Core %d: RM client instance delete failed with error %d\n", coreNum, result);
         }          
     }
 
     BIOS_exit(0);
 }
 
+/* Receive task has priority of 2 so that it pre-empts the RM instance test tasks */
 void rmReceiveTsk(UArg arg0, UArg arg1)
 {
     while(1) {
-        if (MultiProc_self() == 0) {
+        if (coreNum == 0) {
             transportReceive(SERVER_TO_CD_MAP_ENTRY);
         }
-        else if (MultiProc_self() == 1) {
+        else if (coreNum == 1) {
             transportReceive(CD_TO_SERVER_MAP_ENTRY);
             transportReceive(CD_TO_CLIENT_MAP_ENTRY);
             transportReceive(CLIENT_TO_CD_MAP_ENTRY);
@@ -469,355 +483,272 @@ void rmServerTsk(UArg arg0, UArg arg1)
     Rm_ServiceReqInfo  requestInfo;
     Rm_ServiceRespInfo responseInfo;
     Task_Params        taskParams;
-    int32_t            result;
        
     /* Delete the RM startup task */
-    System_printf("Core %d: Deleting RM startup task...\n", MultiProc_self());
+    System_printf("Core %d: Deleting RM startup task...\n", coreNum);
     if (rmStartupTskHandle) {
         Task_delete(&rmStartupTskHandle);
         /* Set the task handle to be NULL so that the delete only occurs once */
         rmStartupTskHandle = NULL;
     }
 
-    /* Open service ports on Server instance to test service requests from the different
-     * RM instances */
-    rmServerServiceHandle = Rm_serviceOpenHandle(rmServerHandle, &result);
-
     Rm_printInstanceStatus(rmServerHandle);
 
-    memset((void *)&requestInfo, 0, sizeof(Rm_ServiceReqInfo));
-    memset((void *)&responseInfo, 0, sizeof(Rm_ServiceRespInfo));
-
-    /* Issue the service request create a new NameServer object via the service port */                
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameGpQ;
-    requestInfo.resourceBase = RM_RESOURCE_BASE_UNSPECIFIED;
-    requestInfo.resourceLength = 1;
-    requestInfo.resourceAlignment = 0;
-    
-    System_printf("Core %d: %s Allocating resource...\n", MultiProc_self(), rmServerName);
+    /* BEGIN testing UNSPECIFIED base and alignment requests on Server */               
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
+                 RM_RESOURCE_BASE_UNSPECIFIED, 1, 0, NULL, TRUE, &responseInfo);       
     rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    System_printf("Core %d : %s use allocation of %s UNSPECIFIED base %d length %d alignment : ", coreNum,
+                                                                                                  rmServerName,
+                                                                                                  resourceNameGpQ,
+                                                                                                  requestInfo.resourceLength, 
+                                                                                                  requestInfo.resourceAlignment);
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s allocated resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                  rmServerName,
-                                                                                  responseInfo.resourceName, 
-                                                                                  responseInfo.resourceBase,
-                                                                                  responseInfo.resourceLength);            
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }            
-
-    /* Issue the service request create a new NameServer object via the service port */                
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameGpQ;
-    requestInfo.resourceBase = RM_RESOURCE_BASE_UNSPECIFIED;
-    requestInfo.resourceLength = 1;
-    requestInfo.resourceAlignment = RM_RESOURCE_ALIGNMENT_UNSPECIFIED;
-    
-    System_printf("Core %d: %s Allocating resource...\n", MultiProc_self(), rmServerName);
-    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }    
+               
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
+                 RM_RESOURCE_BASE_UNSPECIFIED, 1, RM_RESOURCE_ALIGNMENT_UNSPECIFIED, NULL, TRUE, &responseInfo);     
+    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);  
+    System_printf("Core %d : %s use allocation of %s UNSPECIFIED base %d length UNSPECIFIED alignment : ", coreNum,
+                                                                                                           rmServerName,
+                                                                                                           resourceNameGpQ,
+                                                                                                           requestInfo.resourceLength);
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s allocated resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                  rmServerName,
-                                                                                  responseInfo.resourceName, 
-                                                                                  responseInfo.resourceBase,
-                                                                                  responseInfo.resourceLength);
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }             
-
-    /* Issue the service request create a new NameServer object via the service port */                
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameGpQ;
-    requestInfo.resourceBase = RM_RESOURCE_BASE_UNSPECIFIED;
-    requestInfo.resourceLength = 1;
-    requestInfo.resourceAlignment = 200;
-    
-    System_printf("Core %d: %s Allocating resource...\n", MultiProc_self(), rmServerName);
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }     
+
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
+                 RM_RESOURCE_BASE_UNSPECIFIED, 1, 200, NULL, TRUE, &responseInfo);     
     rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    System_printf("Core %d : %s use allocation of %s UNSPECIFIED base %d length %d alignment : ", coreNum,
+                                                                                                  rmServerName,
+                                                                                                  resourceNameGpQ,
+                                                                                                  requestInfo.resourceLength,
+                                                                                                  requestInfo.resourceAlignment);
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s allocated resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                  rmServerName,
-                                                                                  responseInfo.resourceName, 
-                                                                                  responseInfo.resourceBase,
-                                                                                  responseInfo.resourceLength); 
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }            
-
-//    Rm_printResourceStatus(rmServerHandle);
-
-
-    /* Issue the service request create a new NameServer object via the service port */                
-    requestInfo.type = Rm_service_RESOURCE_MAP_TO_NAME;
-    requestInfo.resourceName = resourceNameGpQ;
-    requestInfo.resourceBase = 1002;
-    requestInfo.resourceLength = 1;
-    requestInfo.resourceNsName = nameServerNameFavQ;
-    
-    System_printf("Core %d: %s creating NameServer object...\n", MultiProc_self(), rmServerName);
-    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }      
+    /* END testing UNSPECIFIED base and alignment requests on Server */      
+
+    /* Create new NameServer object */                
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_MAP_TO_NAME, resourceNameGpQ, 
+                 1002, 1, 0, nameServerNameFavQ, TRUE, &responseInfo);     
+    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo); 
+    System_printf("Core %d : %s create name %s tied to %s %d - %d : ", coreNum,
+                                                                       rmServerName,
+                                                                       nameServerNameFavQ,
+                                                                       responseInfo.resourceName,
+                                                                       requestInfo.resourceBase, 
+                                                                       (requestInfo.resourceBase + requestInfo.resourceLength - 1));                                                                       
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s created NameServer object: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                         rmServerName,
-                                                                                         nameServerNameFavQ, 
-                                                                                         requestInfo.resourceBase,
-                                                                                         requestInfo.resourceLength);
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }             
-
-    /* Wait for Client Delegate and Client to retrieve resource via the name and allocate it */
-    gateKey = GateMP_enter(gateHandle);
-    GateMP_leave(gateHandle, gateKey);
-
-//    Rm_printResourceStatus(rmServerHandle);
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }     
 
-    /* Wait for Client to free resource via the NameServer and delete the NameServer object. */
+    /* Wait for CD and Client retrieve resource via name, allocate the resource, free resource via name, and 
+     * delete the NameServer object. */
     gateKey = GateMP_enter(gateHandle);
     GateMP_leave(gateHandle, gateKey);
 
-//    Rm_printResourceStatus(rmServerHandle);
-
-    /* Try to allocate the memory region taken by the Linux Kernel */
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameMemRegion;
-    requestInfo.resourceBase = 12;
-    requestInfo.resourceLength = 1;
-    
-    System_printf("Core %d: %s Trying to reserve memory region taken by Linux...\n", MultiProc_self(), rmServerName);
-    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s allocated resource (SHOULD NOT HAPPEN): %s base: %d length: %d\n", MultiProc_self(),
-                                                                                                      rmServerName,
-                                                                                                      requestInfo.resourceName, 
-                                                                                                      requestInfo.resourceBase,
-                                                                                                      requestInfo.resourceLength);
+    /* Try to allocate the memory region taken by the Linux Kernel and not specified as shared */
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameMemRegion, 
+                 12, 1, 0, NULL, TRUE, &responseInfo);     
+    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo); 
+    System_printf("Core %d : %s use allocation of %s %d - %d : ", coreNum,
+                                                                  rmServerName,
+                                                                  resourceNameMemRegion,
+                                                                  requestInfo.resourceBase, 
+                                                                  (requestInfo.resourceBase + requestInfo.resourceLength - 1));
+    if (responseInfo.serviceState != RM_SERVICE_APPROVED) {        
+        System_printf("PASSED : denial or error : %d\n", responseInfo.serviceState);
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }            
-
-    /* Allocate some resources for testing tree interaction with multiple allocations from different instances */
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameAifRxCh;
-    requestInfo.resourceBase = 14;
-    requestInfo.resourceLength = 5;
-    
-    System_printf("Core %d: %s Allocating resource...\n", MultiProc_self(), rmServerName);
+        System_printf("FAILED\n");
+    }    
+
+    /* BEGIN testing expansion/contraction of resource nodes with the AIF RX CH resource */
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAifRxCh, 
+                 14, 5, 0, NULL, TRUE, &responseInfo);       
     rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    System_printf("Core %d : %s use allocation of %s %d - %d : ", coreNum,
+                                                                  rmServerName,
+                                                                  resourceNameAifRxCh,
+                                                                  requestInfo.resourceBase, 
+                                                                  (requestInfo.resourceBase + requestInfo.resourceLength - 1));
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s allocated resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                  rmServerName,
-                                                                                  requestInfo.resourceName, 
-                                                                                  requestInfo.resourceBase,
-                                                                                  requestInfo.resourceLength);  
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }            
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameAifRxCh;
-    requestInfo.resourceBase = 19;
-    requestInfo.resourceLength = 31;
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    } 
     
-    System_printf("Core %d: %s Allocating resource...\n", MultiProc_self(), rmServerName);
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAifRxCh, 
+                 19, 31, 0, NULL, TRUE, &responseInfo);      
     rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    System_printf("Core %d : %s use allocation of %s %d - %d : ", coreNum,
+                                                                  rmServerName,
+                                                                  resourceNameAifRxCh,
+                                                                  requestInfo.resourceBase, 
+                                                                  (requestInfo.resourceBase + requestInfo.resourceLength - 1));
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s allocated resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                  rmServerName,
-                                                                                  requestInfo.resourceName, 
-                                                                                  requestInfo.resourceBase,
-                                                                                  requestInfo.resourceLength);
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }             
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }        
     
-    /* Wait for Client and Client Delegate to do their allocates */
+    /* Wait for Client and Client Delegate to do their allocations */
     gateKey = GateMP_enter(gateHandle);
-    GateMP_leave(gateHandle, gateKey);
-
-//    Rm_printResourceStatus(rmServerHandle);        
-
-    /* Free resources to show tree handling of different frees */
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_FREE;
-    requestInfo.resourceName = resourceNameAifRxCh;
-    requestInfo.resourceBase = 25;
-    requestInfo.resourceLength = 3;
-    
-    System_printf("Core %d: %s freeing resource...\n", MultiProc_self(), rmServerName);
-    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    GateMP_leave(gateHandle, gateKey);       
+
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, resourceNameAifRxCh, 
+                 25, 3, 0, NULL, TRUE, &responseInfo);      
+    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);  
+    System_printf("Core %d : %s free of %s %d - %d : ", coreNum,
+                                                        rmServerName,
+                                                        resourceNameAifRxCh,
+                                                        requestInfo.resourceBase, 
+                                                        (requestInfo.resourceBase + requestInfo.resourceLength - 1));
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s freed resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                              rmServerName,
-                                                                              requestInfo.resourceName, 
-                                                                              requestInfo.resourceBase,
-                                                                              requestInfo.resourceLength); 
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }             
-    
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_FREE;
-    requestInfo.resourceName = resourceNameAifRxCh;
-    requestInfo.resourceBase = 34;
-    requestInfo.resourceLength = 3;
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }      
     
-    System_printf("Core %d: %s freeing resource...\n", MultiProc_self(), rmServerName);
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, resourceNameAifRxCh, 
+                 34, 3, 0, NULL, TRUE, &responseInfo);      
     rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    System_printf("Core %d : %s free of %s %d - %d : ", coreNum,
+                                                        rmServerName,
+                                                        resourceNameAifRxCh,
+                                                        requestInfo.resourceBase, 
+                                                        (requestInfo.resourceBase + requestInfo.resourceLength - 1));
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s freed resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                              rmServerName,
-                                                                              requestInfo.resourceName, 
-                                                                              requestInfo.resourceBase,
-                                                                              requestInfo.resourceLength);
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }                     
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }      
  
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_FREE;
-    requestInfo.resourceName = resourceNameAifRxCh;
-    requestInfo.resourceBase = 28;
-    requestInfo.resourceLength = 6;
-    
-    System_printf("Core %d: %s freeing resource...\n", MultiProc_self(), rmServerName);
-    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, resourceNameAifRxCh, 
+                 28, 6, 0, NULL, TRUE, &responseInfo);      
+    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);   
+    System_printf("Core %d : %s free of %s %d - %d : ", coreNum,
+                                                        rmServerName,
+                                                        resourceNameAifRxCh,
+                                                        requestInfo.resourceBase, 
+                                                        (requestInfo.resourceBase + requestInfo.resourceLength - 1));
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s freed resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                              rmServerName,
-                                                                              requestInfo.resourceName, 
-                                                                              requestInfo.resourceBase,
-                                                                              requestInfo.resourceLength);
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }              
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }      
 
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameAifRxCh;
-    requestInfo.resourceBase = 53;
-    requestInfo.resourceLength = 2;
-    
-    System_printf("Core %d: %s freeing resource...\n", MultiProc_self(), rmServerName);
-    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAifRxCh, 
+                 53, 2, 0, NULL, TRUE, &responseInfo);      
+    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);  
+    System_printf("Core %d : %s use allocation of %s %d - %d : ", coreNum,
+                                                                  rmServerName,
+                                                                  resourceNameAifRxCh,
+                                                                  requestInfo.resourceBase, 
+                                                                  (requestInfo.resourceBase + requestInfo.resourceLength - 1));
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s allocate resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                 rmServerName,
-                                                                                 requestInfo.resourceName, 
-                                                                                 requestInfo.resourceBase,
-                                                                                 requestInfo.resourceLength);
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }             
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameAifRxCh;
-    requestInfo.resourceBase = 2;
-    requestInfo.resourceLength = 2;
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }  
+    /* END testing expansion/contraction of resource nodes with the AIF RX CH resource */  
     
-    System_printf("Core %d: %s freeing resource...\n", MultiProc_self(), rmServerName);
+    /* Test execlusive rights to an allocated resource */
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAifRxCh, 
+                 2, 2, 0, NULL, TRUE, &responseInfo);      
     rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s allocate resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                 rmServerName,
-                                                                                 requestInfo.resourceName, 
-                                                                                 requestInfo.resourceBase,
-                                                                                 requestInfo.resourceLength);
+    System_printf("Core %d : %s use allocation of %s %d - %d : ", coreNum,
+                                                                  rmServerName,
+                                                                  resourceNameAifRxCh,
+                                                                  requestInfo.resourceBase, 
+                                                                  (requestInfo.resourceBase + requestInfo.resourceLength - 1));
+    if (responseInfo.serviceState != RM_SERVICE_APPROVED) {
+        System_printf("PASSED : denial or error : %d\n", responseInfo.serviceState);
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }             
-    
-//     Rm_printResourceStatus(rmServerHandle); 
+        System_printf("FAILED\n");
+    }      
 
     /* Wait for Client and Client Delegate to do their UNSPECIFIED allocates */
     gateKey = GateMP_enter(gateHandle);
     GateMP_leave(gateHandle, gateKey);
 
-//      Rm_printResourceStatus(rmServerHandle);
-
     /* Test allocation of a resource twice from the same instance with init and use privileges.  Both
      * should be approved but the instance should only be mentioned once in the resource's owner list */
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_INIT;
-    requestInfo.resourceName = resourceNameGpQ;
-    requestInfo.resourceBase = 6543;
-    requestInfo.resourceLength = 10;
-    
-    System_printf("Core %d: %s Allocating resource for init...\n", MultiProc_self(), rmServerName);
-    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameGpQ, 
+                 6543, 10, 0, NULL, TRUE, &responseInfo);      
+    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);  
+    System_printf("Core %d : %s init allocation of %s %d - %d : ", coreNum,
+                                                                   rmServerName,
+                                                                   resourceNameGpQ,
+                                                                   requestInfo.resourceBase, 
+                                                                   (requestInfo.resourceBase + requestInfo.resourceLength - 1));
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s allocate resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                 rmServerName,
-                                                                                 requestInfo.resourceName, 
-                                                                                 requestInfo.resourceBase,
-                                                                                 requestInfo.resourceLength); 
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }      
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameGpQ;
-    requestInfo.resourceBase = 6543;
-    requestInfo.resourceLength = 10;
-    
-    System_printf("Core %d: %s Allocating same resource for use...\n", MultiProc_self(), rmServerName);
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }     
+
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
+                 6543, 10, 0, NULL, TRUE, &responseInfo);      
     rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    System_printf("Core %d : %s use allocation of %s %d - %d : ", coreNum,
+                                                                  rmServerName,
+                                                                  resourceNameGpQ,
+                                                                  requestInfo.resourceBase, 
+                                                                  (requestInfo.resourceBase + requestInfo.resourceLength - 1));
     if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s allocate resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                 rmServerName,
-                                                                                 requestInfo.resourceName, 
-                                                                                 requestInfo.resourceBase,
-                                                                                 requestInfo.resourceLength);
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
     }        
 
-//     Rm_printResourceStatus(rmServerHandle);
-
-    /* Attempt to allocate an infrastructure queue taken by the Linux kernel and shared with
-     * Rm_Client */
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_INIT;
-    requestInfo.resourceName = resourceNameInfraQ;
-    requestInfo.resourceBase = 805;
-    requestInfo.resourceLength = 1;
-    
-    System_printf("Core %d: %s Attempting to allocate infrastructure queue taken by Linux...\n", MultiProc_self(), rmServerName);
+    /* Allocate infrastructure queue taken by Linux kernel and shared with Rm_Client.  Expect error or denial. */
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameInfraQ, 
+                 805, 1, 0, NULL, TRUE, &responseInfo);     
     rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("Core %d: %s allocate resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                 rmServerName,
-                                                                                 requestInfo.resourceName, 
-                                                                                 requestInfo.resourceBase,
-                                                                                 requestInfo.resourceLength);  
+    System_printf("Core %d : %s init allocation of %s %d - %d : ", coreNum,
+                                                                   rmServerName,
+                                                                   resourceNameInfraQ,
+                                                                   requestInfo.resourceBase, 
+                                                                   (requestInfo.resourceBase + requestInfo.resourceLength - 1));
+    if (responseInfo.serviceState != RM_SERVICE_APPROVED) {        
+        System_printf("PASSED : denial or error : %d\n", responseInfo.serviceState);
     }
     else {
-        System_printf("Core %d: Service failed with error: %d\n", MultiProc_self(), responseInfo.serviceState);
-    }          
+        System_printf("FAILED\n");
+    }              
 
-    Rm_printResourceStatus(rmServerHandle);           
+    System_printf("Core %d: Testing is complete\n", coreNum);
 
-    System_printf("Core %d: Testing is complete\n", MultiProc_self());
+    Rm_printInstanceStatus(rmServerHandle);
+    Rm_printResourceStatus(rmServerHandle);   
     
     /* Create the RM cleanup task. */
-    System_printf("Core %d: Creating RM cleanup task...\n", MultiProc_self());
+    System_printf("Core %d: Creating RM cleanup task...\n", coreNum);
     Task_Params_init (&taskParams);
     Task_create (rmCleanupTsk, &taskParams, NULL);
 }
@@ -827,305 +758,271 @@ void rmClientTsk(UArg arg0, UArg arg1)
     Rm_ServiceReqInfo  requestInfo;
     Rm_ServiceRespInfo responseInfo;    
     Task_Params        taskParams;
+    uint32_t           i, j;
        
     /* Delete the RM startup task */
-    System_printf("Core %d: Deleting RM startup task...\n", MultiProc_self());
+    System_printf("Core %d: Deleting RM startup task...\n", coreNum);
     if (rmStartupTskHandle) {
        Task_delete(&rmStartupTskHandle);
        /* Set the task handle to be NULL so that the delete only occurs once */
        rmStartupTskHandle = NULL;
     }
 
-    /* CD and Client serviceHandles were allocated in main() for static allocations.
-     * just reuse */
-    Rm_printInstanceStatus(rmClientDelegateHandle);
+    Rm_printInstanceStatus(rmCdHandle);
     Rm_printInstanceStatus(rmClientHandle);
 
-    memset((void *)&requestInfo, 0, sizeof(Rm_ServiceReqInfo));
-    memset((void *)&responseInfo, 0, sizeof(Rm_ServiceRespInfo));
-   
-    /* Issue the service request for the resources tied to the name via the service port */                
-    requestInfo.type = Rm_service_RESOURCE_GET_BY_NAME;
-    requestInfo.resourceNsName = nameServerNameFavQ;
-    requestInfo.callback.serviceCallback = serviceCallback;
-    
-    System_printf("Core %d: %s getting resources tied to NameServer object...\n", MultiProc_self(), 
-                                                                                  rmClientDelegateName);
-    rmClientDelegateServiceHandle->Rm_serviceHandler(rmClientDelegateServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if ((responseInfo.serviceState == RM_SERVICE_APPROVED) ||
-        (responseInfo.serviceState == RM_SERVICE_PROCESSING)) {        
-        if (blockForResponse(&responseInfo)) {
-            System_printf("Core %d: %s got Name: %s base: %d length: %d\n", MultiProc_self(),
-                                                                            rmClientDelegateName, 
-                                                                            nameServerNameFavQ, 
-                                                                            responseInfo.resourceBase,
-                                                                            responseInfo.resourceLength);
-        }
+    /* Retrieve a resource via a NameServer name */
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_GET_BY_NAME, NULL, 
+                 0, 0, 0, nameServerNameFavQ, TRUE, &responseInfo);     
+    rmCdServiceHandle->Rm_serviceHandler(rmCdServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    System_printf("Core %d : %s get resource with name %s : ", coreNum,
+                                                               rmCdName,
+                                                               nameServerNameFavQ);
+    if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
+        waitForResponse(&responseInfo);
+    }
+    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                            responseInfo.serviceState);
-    }            
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    } 
 
-    /* Allocate the resources via the service port from the Client */
+    /* Allocate the resource returned from the NameServer request */
+    memset((void *)&requestInfo, 0, sizeof(Rm_ServiceReqInfo)); 
     requestInfo.type = Rm_service_RESOURCE_ALLOCATE_INIT;
     requestInfo.resourceName = responseInfo.resourceName;
     requestInfo.resourceBase = responseInfo.resourceBase;
     requestInfo.resourceLength = responseInfo.resourceLength;
     requestInfo.resourceNsName = NULL;
-    requestInfo.callback.serviceCallback = serviceCallback;
-    
-    System_printf("Core %d: %s allocating resources...\n", MultiProc_self(), rmClientName);
+    requestInfo.callback.serviceCallback = serviceCallback;     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if ((responseInfo.serviceState == RM_SERVICE_APPROVED) ||
-        (responseInfo.serviceState == RM_SERVICE_PROCESSING)) {        
-        if (blockForResponse(&responseInfo)) {
-            System_printf("Core %d: %s allocated resources: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                       rmClientName, 
-                                                                                       nameServerNameFavQ, 
-                                                                                       responseInfo.resourceBase,
-                                                                                       responseInfo.resourceLength);
-        }
+    System_printf("Core %d : %s init allocation of %s %d - %d : ", coreNum,
+                                                                   rmClientName,
+                                                                   responseInfo.resourceName,
+                                                                   requestInfo.resourceBase, 
+                                                                   (requestInfo.resourceBase + requestInfo.resourceLength - 1));
+    if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
+        waitForResponse(&responseInfo);
+    }
+    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                            responseInfo.serviceState);
-    }            
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }    
 
-    GateMP_leave(gateHandle, gateKey);
-    gateKey = GateMP_enter(gateHandle);
-
-    /* Free the named resource using the name via the service port from the Client */
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));
-    requestInfo.type = Rm_service_RESOURCE_FREE;
-    requestInfo.resourceNsName = nameServerNameFavQ;
-    requestInfo.callback.serviceCallback = serviceCallback;
-    
-    System_printf("Core %d: %s freeing resource via name...\n", MultiProc_self(), rmClientName);
+    /* Free resource via a NameServer name */
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, NULL, 
+                 0, 0, 0, nameServerNameFavQ, TRUE, &responseInfo);     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if ((responseInfo.serviceState == RM_SERVICE_APPROVED) ||
-        (responseInfo.serviceState == RM_SERVICE_PROCESSING)) {        
-        if (blockForResponse(&responseInfo)) {
-            System_printf("Core %d: %s freed resource with name: %s\n", MultiProc_self(),
-                                                                        rmClientName, 
-                                                                        nameServerNameFavQ);
-        }
+    System_printf("Core %d : %s free resource with name %s : ", coreNum,
+                                                                rmClientName,
+                                                                nameServerNameFavQ);
+    if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
+        waitForResponse(&responseInfo);
+    }
+    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                            responseInfo.serviceState);
-    }            
-
-    /* Delete the name object from the NameServer */
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));
-    requestInfo.type = Rm_service_RESOURCE_UNMAP_NAME;
-    requestInfo.resourceNsName = nameServerNameFavQ;
-    requestInfo.callback.serviceCallback = serviceCallback;
-    
-    System_printf("Core %d: %s Deleting NameServer object: %s...\n", MultiProc_self(), 
-                                                                     rmClientName,
-                                                                     nameServerNameFavQ);
-    rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if ((responseInfo.serviceState == RM_SERVICE_APPROVED) ||
-        (responseInfo.serviceState == RM_SERVICE_PROCESSING)) {        
-        if (blockForResponse(&responseInfo)) {
-            System_printf("Core %d: %s deleted NameServer object: %s\n", MultiProc_self(),
-                                                                         rmClientName, 
-                                                                         nameServerNameFavQ);
-        }
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }      
+
+    /* Delete the NameServer name */
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_UNMAP_NAME, NULL, 
+                 0, 0, 0, nameServerNameFavQ, TRUE, &responseInfo);     
+    rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);     
+    System_printf("Core %d : %s delete name %s : ", coreNum,
+                                                    rmClientName,
+                                                    nameServerNameFavQ);
+    if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
+        waitForResponse(&responseInfo);
+    }
+    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                            responseInfo.serviceState);
-    }            
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }     
 
     GateMP_leave(gateHandle, gateKey);
     gateKey = GateMP_enter(gateHandle);
 
-    /* Allocate some resources for testing tree interaction with multiple allocations from different instances */
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameAifRxCh;
-    requestInfo.resourceBase = 0;
-    requestInfo.resourceLength = 6;
-    requestInfo.callback.serviceCallback = serviceCallback;
-    
-    System_printf("Core %d: %s Allocating resource...\n", MultiProc_self(), rmClientName);
+    /* BEGIN testing expansion/contraction of resource nodes with the AIF RX CH resource */
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAifRxCh, 
+                 0, 6, 0, NULL, TRUE, &responseInfo);     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if ((responseInfo.serviceState == RM_SERVICE_APPROVED) ||
-        (responseInfo.serviceState == RM_SERVICE_PROCESSING)) {        
-        if (blockForResponse(&responseInfo)) {
-            System_printf("Core %d: %s allocated resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                      rmClientName,
-                                                                                      requestInfo.resourceName, 
-                                                                                      requestInfo.resourceBase,
-                                                                                      requestInfo.resourceLength);            
-        }  
+    System_printf("Core %d : %s use allocation of %s %d - %d : ", coreNum,
+                                                                  rmClientName,
+                                                                  resourceNameAifRxCh,
+                                                                  requestInfo.resourceBase, 
+                                                                  (requestInfo.resourceBase + requestInfo.resourceLength - 1));
+    if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
+        waitForResponse(&responseInfo);
+    }
+    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                            responseInfo.serviceState);
-    }            
-    
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_INIT;
-    requestInfo.resourceName = resourceNameAifRxCh;
-    requestInfo.resourceBase = 50;
-    requestInfo.resourceLength = 7;
-    requestInfo.callback.serviceCallback = serviceCallback;
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }     
     
-    System_printf("Core %d: %s Allocating resource...\n", MultiProc_self(), rmClientDelegateName);
-    rmClientDelegateServiceHandle->Rm_serviceHandler(rmClientDelegateServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if ((responseInfo.serviceState == RM_SERVICE_APPROVED) ||
-        (responseInfo.serviceState == RM_SERVICE_PROCESSING)) {        
-        if (blockForResponse(&responseInfo)) {
-            System_printf("Core %d: %s allocated resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                      rmClientDelegateName,
-                                                                                      requestInfo.resourceName, 
-                                                                                      requestInfo.resourceBase,
-                                                                                      requestInfo.resourceLength);            
-        }  
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameAifRxCh, 
+                 50, 7, 0, NULL, TRUE, &responseInfo);        
+    rmCdServiceHandle->Rm_serviceHandler(rmCdServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    System_printf("Core %d : %s init allocation of %s %d - %d : ", coreNum,
+                                                                   rmCdName,
+                                                                   resourceNameAifRxCh,
+                                                                   requestInfo.resourceBase, 
+                                                                   (requestInfo.resourceBase + requestInfo.resourceLength - 1));
+    if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
+        waitForResponse(&responseInfo);
+    }
+    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                            responseInfo.serviceState);
-    }            
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }       
+    /* END testing expansion/contraction of resource nodes with the AIF RX CH resource */
 
     GateMP_leave(gateHandle, gateKey);    
     gateKey = GateMP_enter(gateHandle);
 
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameAccumCh;
-    requestInfo.resourceBase = RM_RESOURCE_BASE_UNSPECIFIED;
-    requestInfo.resourceLength = 5;
-    requestInfo.resourceAlignment = 4;
-    requestInfo.callback.serviceCallback = serviceCallback;
-    
-    System_printf("Core %d: %s Allocating resource...\n", MultiProc_self(), rmClientDelegateName);
-    rmClientDelegateServiceHandle->Rm_serviceHandler(rmClientDelegateServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if ((responseInfo.serviceState == RM_SERVICE_APPROVED) ||
-        (responseInfo.serviceState == RM_SERVICE_PROCESSING)) {        
-        if (blockForResponse(&responseInfo)) {
-            System_printf("Core %d: %s allocated resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                      rmClientDelegateName,
-                                                                                      responseInfo.resourceName, 
-                                                                                      responseInfo.resourceBase,
-                                                                                      responseInfo.resourceLength);            
-        }    
+    /* BEGIN testing allocations with UNSPECIFIED base and alignment values */
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAccumCh, 
+                 RM_RESOURCE_BASE_UNSPECIFIED, 5, 4, NULL, TRUE, &responseInfo);        
+    rmCdServiceHandle->Rm_serviceHandler(rmCdServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    System_printf("Core %d : %s use allocation of %s UNSPECIFIED base %d length %d alignment : ", coreNum,
+                                                                                                  rmCdName,
+                                                                                                  resourceNameAccumCh,
+                                                                                                  requestInfo.resourceLength, 
+                                                                                                  requestInfo.resourceAlignment);
+    if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
+        waitForResponse(&responseInfo);
+    }
+    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                            responseInfo.serviceState);
-    }            
-
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameAccumCh;
-    requestInfo.resourceBase = RM_RESOURCE_BASE_UNSPECIFIED;
-    requestInfo.resourceLength = 2;
-    requestInfo.resourceAlignment = 1;
-    requestInfo.callback.serviceCallback = serviceCallback;
-    
-    System_printf("Core %d: %s Allocating resource...\n", MultiProc_self(), rmClientName);
-    rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if ((responseInfo.serviceState == RM_SERVICE_APPROVED) ||
-        (responseInfo.serviceState == RM_SERVICE_PROCESSING)) {        
-        if (blockForResponse(&responseInfo)) {
-            System_printf("Core %d: %s allocated resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                      rmClientName,
-                                                                                      responseInfo.resourceName, 
-                                                                                      responseInfo.resourceBase,
-                                                                                      responseInfo.resourceLength);            
-        } 
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }        
+
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAccumCh, 
+                 RM_RESOURCE_BASE_UNSPECIFIED, 2, 1, NULL, TRUE, &responseInfo);      
+    rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo); 
+    System_printf("Core %d : %s use allocation of %s UNSPECIFIED base %d length %d alignment : ", coreNum,
+                                                                                                  rmClientName,
+                                                                                                  resourceNameAccumCh,
+                                                                                                  requestInfo.resourceLength, 
+                                                                                                  requestInfo.resourceAlignment);
+    if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
+        waitForResponse(&responseInfo);
+    }
+    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                            responseInfo.serviceState);
-    }            
-
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
-    requestInfo.resourceName = resourceNameAccumCh;
-    requestInfo.resourceBase = RM_RESOURCE_BASE_UNSPECIFIED;
-    requestInfo.resourceLength = 2;
-    requestInfo.resourceAlignment = RM_RESOURCE_ALIGNMENT_UNSPECIFIED;
-    requestInfo.callback.serviceCallback = serviceCallback;
-    
-    System_printf("Core %d: %s Allocating resource...\n", MultiProc_self(), rmClientName);
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }     
+
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAccumCh, 
+                 RM_RESOURCE_BASE_UNSPECIFIED, 2, RM_RESOURCE_ALIGNMENT_UNSPECIFIED, NULL, TRUE, &responseInfo);     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if ((responseInfo.serviceState == RM_SERVICE_APPROVED) ||
-        (responseInfo.serviceState == RM_SERVICE_PROCESSING)) {        
-        if (blockForResponse(&responseInfo)) {
-            System_printf("Core %d: %s allocated resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                      rmClientName,
-                                                                                      responseInfo.resourceName, 
-                                                                                      responseInfo.resourceBase,
-                                                                                      responseInfo.resourceLength);            
-        }  
+    System_printf("Core %d : %s use allocation of %s UNSPECIFIED base %d length UNSPECIFIED alignment : ", coreNum,
+                                                                                                           rmClientName,
+                                                                                                           resourceNameAccumCh,
+                                                                                                           requestInfo.resourceLength);
+    if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
+        waitForResponse(&responseInfo);
+    }
+    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                            responseInfo.serviceState);
-    }            
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }     
+    /* END testing allocations with UNSPECIFIED base and alignment values */    
 
-    /* Attempt to allocate an infrastructure queue taken by the Linux kernel and shared with
-     * Rm_Client */
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_INIT;
-    requestInfo.resourceName = resourceNameInfraQ;
-    requestInfo.resourceBase = 800;
-    requestInfo.resourceLength = 1;
-    requestInfo.callback.serviceCallback = serviceCallback;
-    
-    System_printf("Core %d: %s Attempting to allocate infrastructure queue taken by Linux...\n", MultiProc_self(), rmClientName);
+    /* Allocate infrastructure queue shared between Linux kernel and Client */
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameInfraQ, 
+                 800, 1, 0, NULL, TRUE, &responseInfo);     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if ((responseInfo.serviceState == RM_SERVICE_APPROVED) ||
-        (responseInfo.serviceState == RM_SERVICE_PROCESSING)) {        
-        if (blockForResponse(&responseInfo)) {
-            System_printf("Core %d: %s allocate resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                     rmClientName,
-                                                                                     requestInfo.resourceName, 
-                                                                                     requestInfo.resourceBase,
-                                                                                     requestInfo.resourceLength);            
-        }   
+    System_printf("Core %d : %s init allocation of %s %d - %d : ", coreNum,
+                                                                   rmClientName,
+                                                                   resourceNameInfraQ,
+                                                                   requestInfo.resourceBase, 
+                                                                   (requestInfo.resourceBase + requestInfo.resourceLength - 1));
+    if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
+        waitForResponse(&responseInfo);
+    }
+    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                            responseInfo.serviceState);
-    }   
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }     
 
-    /* Attempt to request a service from an instance that requires a blocking operation to satisfy
-     * the request without providing a callback function. */
-    memset((void *) &requestInfo, 0, sizeof(Rm_ServiceReqInfo));        
-    requestInfo.type = Rm_service_RESOURCE_ALLOCATE_INIT;
-    requestInfo.resourceName = resourceNameGpQ;
-    requestInfo.resourceBase = 7000;
-    requestInfo.resourceLength = 1;
-    
-    System_printf("Core %d: %s Attempting service request without callback function...\n", MultiProc_self(), rmClientName);
-    rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    if ((responseInfo.serviceState == RM_SERVICE_APPROVED) ||
-        (responseInfo.serviceState == RM_SERVICE_PROCESSING)) {        
-        if (blockForResponse(&responseInfo)) {
-            System_printf("Core %d: %s allocate resource: %s base: %d length: %d\n", MultiProc_self(),
-                                                                                     rmClientName,
-                                                                                     requestInfo.resourceName, 
-                                                                                     requestInfo.resourceBase,
-                                                                                     requestInfo.resourceLength);            
-        }   
+    /* Allocate a resource without providing a callback function.  RM should block and not return until the result
+     * is returned by the server. */
+    setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameGpQ, 
+                 7000, 1, 0, NULL, TRUE, &responseInfo);     
+    rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);   
+    System_printf("Core %d : %s init allocation (without callback specified) of %s %d - %d : ", coreNum,
+                                                                                                rmClientName,
+                                                                                                resourceNameGpQ,
+                                                                                                requestInfo.resourceBase, 
+                                                                                                (requestInfo.resourceBase + requestInfo.resourceLength - 1));
+    if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
+        waitForResponse(&responseInfo);
+    }
+    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
+        System_printf("PASSED\n");
     }
     else {
-        System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                            responseInfo.serviceState);
-    }          
+        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+    }      
 
     GateMP_leave(gateHandle, gateKey);           
 
-    System_printf("Core %d: Testing is complete\n", MultiProc_self());
+    /* Verify static allocations were validated.  Validation responses should have been received after the
+     * first service requests were made on the Client and CD post transport path registration. */
+    while (numStaticResponses > 0) {
+        /* Loop until all static request validations have been received */
+        for (i = 0; i < MAX_STATIC_ALLOCATION_RESPS; i++) {
+            if (staticResponseQueue[i].serviceId != 0) {
+                for (j = 0; j < MAX_QUEUED_SERVICE_RESPONSES; j++) {
+                    if ((staticResponseQueue[i].serviceId == responseInfoQueue[j].serviceId) &&
+                        (staticResponseQueue[i].rmHandle == responseInfoQueue[j].rmHandle)) {
+                        System_printf("Core %d : static allocation validation of %s %d - %d : ", coreNum,
+                                                                                                 responseInfoQueue[j].resourceName,
+                                                                                                 responseInfoQueue[j].resourceBase, 
+                                                                                                 (responseInfoQueue[j].resourceBase + responseInfoQueue[j].resourceLength - 1));        
+                        if (responseInfoQueue[j].serviceState == RM_SERVICE_APPROVED) {
+                            System_printf("PASSED\n");
+                        }
+                        else {
+                            System_printf("FAILED : denial or error : %d\n", responseInfoQueue[j].serviceState);
+                        }  
+                        memset((void *)&staticResponseQueue[i], 0, sizeof(Rm_ServiceRespInfo));
+                        memset((void *)&responseInfoQueue[j], 0, sizeof(Rm_ServiceRespInfo));
+                        numStaticResponses--;                        
+                        break;
+                    }
+                }
+            }
+        }    
+    }   
+
+
+    System_printf("Core %d: Testing is complete\n", coreNum);
+
+    Rm_printInstanceStatus(rmCdHandle);
+    Rm_printInstanceStatus(rmClientHandle);
     
     /* Create the RM cleanup task. */
-    System_printf("Core %d: Creating RM cleanup task...\n", MultiProc_self());
+    System_printf("Core %d: Creating RM cleanup task...\n", coreNum);
     Task_Params_init (&taskParams);
     Task_create (rmCleanupTsk, &taskParams, NULL);
 }
@@ -1148,7 +1045,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
         rmTransportMap[i].transportHandle = NULL;
     }
 
-    if (MultiProc_self() == 0) {
+    if (coreNum == 0) {
         GateMP_Params_init(&gateParams);
         gateParams.name = RM_TASK_GATE_NAME;
         gateHandle = GateMP_create(&gateParams);
@@ -1165,7 +1062,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
         if (rmPktHeapHandle == NULL) {
             System_abort("HeapBufMP_create failed for RM packet heap\n" );
         }
-        System_printf("Core %d: RM packet heap created\n", MultiProc_self());
+        System_printf("Core %d: RM packet heap created\n", coreNum);
 
         /* Create the heap that will be used to allocate messageQ messages. */     
         HeapBufMP_Params_init(&heapBufParams);
@@ -1177,7 +1074,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
         if (msgQHeapHandle == NULL) {
             System_abort("HeapBufMP_create failed MessageQ message heap\n" );
         } 
-        System_printf("Core %d: IPC MessageQ message heap created\n", MultiProc_self());
+        System_printf("Core %d: IPC MessageQ message heap created\n", coreNum);
     }
     else {
         do {
@@ -1204,7 +1101,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        System_printf("Core %d: RM packet heap opened\n", MultiProc_self());
+        System_printf("Core %d: RM packet heap opened\n", coreNum);
         
         do {
             status = HeapBufMP_open(MSGQ_HEAP_NAME, &msgQHeapHandle);
@@ -1216,7 +1113,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        System_printf("Core %d: IPC MessageQ message heap opened\n", MultiProc_self());
+        System_printf("Core %d: IPC MessageQ message heap opened\n", coreNum);
     }
     
     /* Register the MessageQ heap with MessageQ */
@@ -1228,36 +1125,36 @@ void rmStartupTsk(UArg arg0, UArg arg1)
      * 1 queues on RM Server
      * 2 queues on RM Client Delegate
      * 1 queues on RM Client */
-    if (MultiProc_self() == 0) {
+    if (coreNum == 0) {
         serverFromCdMsgQ = MessageQ_create(serverFromCdQueueName, NULL);
         if (serverFromCdMsgQ == NULL) {
             System_abort("MessageQ_create failed for RM Server - Client Delegate queue\n" );
         }
-        System_printf("Core %d: RM Server MessageQ created for receiving packets from RM CD\n", MultiProc_self());
+        System_printf("Core %d: RM Server MessageQ created for receiving packets from RM CD\n", coreNum);
     }
-    else if (MultiProc_self() == 1) {
+    else if (coreNum == 1) {
         cdFromServerMsgQ = MessageQ_create(cdFromServerQueueName, NULL);
         if (cdFromServerMsgQ == NULL) {
             System_abort("MessageQ_create failed for RM Client Delegate - Server queue\n" );
         }
-        System_printf("Core %d: RM CD MessageQ created for receiving packets from RM Server\n", MultiProc_self());
+        System_printf("Core %d: RM CD MessageQ created for receiving packets from RM Server\n", coreNum);
         
         cdFromClientMsgQ = MessageQ_create(cdFromClientQueueName, NULL);
         if (cdFromClientMsgQ == NULL) {
             System_abort("MessageQ_create failed for RM Client Delegate - Client queue\n" );
         } 
-        System_printf("Core %d: RM CD MessageQ created for receiving packets from RM Client\n", MultiProc_self());
+        System_printf("Core %d: RM CD MessageQ created for receiving packets from RM Client\n", coreNum);
         
         clientFromCdMsgQ = MessageQ_create(clientFromCdQueueName, NULL);
         if (clientFromCdMsgQ == NULL) 
         {
             System_abort("MessageQ_create failed for RM Client - Client Delegate queue\n" );
         }
-        System_printf("Core %d: RM Client MessageQ created for receiving packets from RM CD\n", MultiProc_self());
+        System_printf("Core %d: RM Client MessageQ created for receiving packets from RM CD\n", coreNum);
     }
     
     /* Open the remote message queues. Also register the RM transports with each RM instance */
-    if (MultiProc_self() == 0) {
+    if (coreNum == 0) {
         /* Open the Client Delegate messageQ from the Server */
         do {
             status = MessageQ_open(cdFromServerQueueName, &serverToCdQId); 
@@ -1269,13 +1166,13 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        System_printf("Core %d: RM CD MessageQ opened from RM Server\n", MultiProc_self());
+        System_printf("Core %d: RM CD MessageQ opened from RM Server\n", coreNum);
 
         /* Register the Client Delegate with the RM Server Instance */
         rmTransportCfg.rmHandle = rmServerHandle;
         rmTransportCfg.appTransportHandle = (Rm_AppTransportHandle) serverToCdQId;
         rmTransportCfg.remoteInstType = Rm_instType_CLIENT_DELEGATE;
-        rmTransportCfg.remoteInstName = &rmClientDelegateName[0];
+        rmTransportCfg.remoteInstName = &rmCdName[0];
         rmTransportCfg.transportCallouts.rmAllocPkt = transportAlloc;
         rmTransportCfg.transportCallouts.rmSendPkt = transportSend;
         serverCdHandle = Rm_transportRegister(&rmTransportCfg, &result);
@@ -1283,9 +1180,9 @@ void rmStartupTsk(UArg arg0, UArg arg1)
         /* Store the mapping information in the transport map */
         rmTransportMap[SERVER_TO_CD_MAP_ENTRY].transportHandle = serverCdHandle;
         rmTransportMap[SERVER_TO_CD_MAP_ENTRY].receiveMsgQ = serverFromCdMsgQ;
-        System_printf("Core %d: Registered RM Server <=> RM CD transport with RM Server instance\n", MultiProc_self());
+        System_printf("Core %d: Registered RM Server <=> RM CD transport with RM Server instance\n", coreNum);
     }
-    else if (MultiProc_self() == 1) {
+    else if (coreNum == 1) {
         /* Open the Server messageQ from the Client Delegate */
         do {
             status = MessageQ_open(serverFromCdQueueName, &cdToServerQId); 
@@ -1297,10 +1194,10 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        System_printf("Core %d: RM Server MessageQ opened from RM CD\n", MultiProc_self());
+        System_printf("Core %d: RM Server MessageQ opened from RM CD\n", coreNum);
 
         /* Register the Server with the RM Client Delegate Instance */
-        rmTransportCfg.rmHandle = rmClientDelegateHandle;
+        rmTransportCfg.rmHandle = rmCdHandle;
         rmTransportCfg.appTransportHandle = (Rm_AppTransportHandle) cdToServerQId;
         rmTransportCfg.remoteInstType = Rm_instType_SERVER;
         rmTransportCfg.remoteInstName = &rmServerName[0];
@@ -1311,7 +1208,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
         /* Store the mapping information in the transport map */
         rmTransportMap[CD_TO_SERVER_MAP_ENTRY].transportHandle = cdServerHandle;
         rmTransportMap[CD_TO_SERVER_MAP_ENTRY].receiveMsgQ = cdFromServerMsgQ;
-        System_printf("Core %d: Registered RM CD <=> RM Server transport with RM CD instance\n", MultiProc_self());
+        System_printf("Core %d: Registered RM CD <=> RM Server transport with RM CD instance\n", coreNum);
         
         /* Open the Client messageQ from the Client Delegate */
         do {
@@ -1324,7 +1221,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        System_printf("Core %d: RM Client MessageQ opened from RM CD\n", MultiProc_self());
+        System_printf("Core %d: RM Client MessageQ opened from RM CD\n", coreNum);
 
         /* Register the Client with the RM Client Delegate Instance */
         rmTransportCfg.appTransportHandle = (Rm_AppTransportHandle) cdToClientQId;
@@ -1337,7 +1234,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
         /* Store the mapping information in the transport map */
         rmTransportMap[CD_TO_CLIENT_MAP_ENTRY].transportHandle = cdClientHandle;
         rmTransportMap[CD_TO_CLIENT_MAP_ENTRY].receiveMsgQ = cdFromClientMsgQ;
-        System_printf("Core %d: Registered RM CD <=> RM Client transport with RM CD instance\n", MultiProc_self());
+        System_printf("Core %d: Registered RM CD <=> RM Client transport with RM CD instance\n", coreNum);
 
         /* Open the Client Delegate messageQ from the Client */        
         do {
@@ -1350,13 +1247,13 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        System_printf("Core %d: RM CD MessageQ opened from RM Client\n", MultiProc_self());
+        System_printf("Core %d: RM CD MessageQ opened from RM Client\n", coreNum);
 
         /* Register the Client Delegate with the RM Client Instance */
         rmTransportCfg.rmHandle = rmClientHandle;
         rmTransportCfg.appTransportHandle = (Rm_AppTransportHandle) clientToCdQId;
         rmTransportCfg.remoteInstType = Rm_instType_CLIENT_DELEGATE;
-        rmTransportCfg.remoteInstName = &rmClientDelegateName[0];
+        rmTransportCfg.remoteInstName = &rmCdName[0];
         rmTransportCfg.transportCallouts.rmAllocPkt = transportAlloc;
         rmTransportCfg.transportCallouts.rmSendPkt = transportSend;
         clientCdHandle = Rm_transportRegister(&rmTransportCfg, &result);
@@ -1364,27 +1261,27 @@ void rmStartupTsk(UArg arg0, UArg arg1)
         /* Store the mapping information in the transport map */
         rmTransportMap[CLIENT_TO_CD_MAP_ENTRY].transportHandle = clientCdHandle;
         rmTransportMap[CLIENT_TO_CD_MAP_ENTRY].receiveMsgQ = clientFromCdMsgQ;
-        System_printf("Core %d: Registered RM Client <=> RM CD transport with RM Client instance\n", MultiProc_self());
+        System_printf("Core %d: Registered RM Client <=> RM CD transport with RM Client instance\n", coreNum);
     }
 
     /* Create the RM receive task.  Assign higher priority than the test tasks so that
      * when they spin waiting for messages from other RM instances the receive task is
      * executed. */
-    System_printf("Core %d: Creating RM receive task...\n", MultiProc_self());
+    System_printf("Core %d: Creating RM receive task...\n", coreNum);
     Task_Params_init (&taskParams);
     taskParams.priority = 2;
     rmReceiveTskHandle = Task_create (rmReceiveTsk, &taskParams, NULL);
     
     
     /* Create the RM test tasks. */
-    if (MultiProc_self() == 0) {
-        System_printf("Core %d: Creating RM server task...\n", MultiProc_self());
+    if (coreNum == 0) {
+        System_printf("Core %d: Creating RM server task...\n", coreNum);
         Task_Params_init (&taskParams);
         taskParams.priority = 1;
         rmServerTskHandle = Task_create (rmServerTsk, &taskParams, NULL);
     }
-    else if (MultiProc_self()) {
-        System_printf("Core %d: Creating RM client task...\n", MultiProc_self());
+    else if (coreNum) {
+        System_printf("Core %d: Creating RM client task...\n", coreNum);
         Task_Params_init (&taskParams);
         taskParams.priority = 1;
         rmClientTskHandle = Task_create (rmClientTsk, &taskParams, NULL);
@@ -1395,7 +1292,7 @@ int main(Int argc, Char* argv[])
 {
     Rm_InitCfg         rmInitCfg;
     Task_Params        taskParams; 
-    Int                status;
+    int                status;
     Rm_ServiceReqInfo  requestInfo;
     Rm_ServiceRespInfo responseInfo;
     int32_t            result;
@@ -1406,168 +1303,151 @@ int main(Int argc, Char* argv[])
 
     System_printf ("RM Version : 0x%08x\nVersion String: %s\n", Rm_getVersion(), Rm_getVersionStr());
 
+    coreNum = MultiProc_self();
+
     /* Initialize the RM instances - RM must be initialized before anything else in the system
      * Core 0: 1 RM Instance  - RM Server
      * Core 1: 2 RM Instances - RM Client Delegate
      *                          RM Client
      */
-    if (MultiProc_self()== 0) {
+    if (coreNum == 0) {
         /* Create the Server instance */
-        rmInitCfg.instName = &rmServerName[0];
+        rmInitCfg.instName = rmServerName;
         rmInitCfg.instType = Rm_instType_SERVER;
         rmInitCfg.instCfg.serverCfg.globalResourceList = (void *)rmGrl;
         rmInitCfg.instCfg.serverCfg.linuxDtb = (void *)rmLinuxDtb;
         rmInitCfg.instCfg.serverCfg.globalPolicy = (void *)rmGlobalPolicy;
         rmServerHandle = Rm_init(&rmInitCfg, &result);
-        System_printf("Core %d: RM Server instance created. Result = %d\n", MultiProc_self(), result);
+        ERROR_CHECK(RM_OK, result, rmServerName, "Initialization failed");
 
-        Rm_printResourceStatus(rmServerHandle);
+        /* Open Server service handle */
+        rmServerServiceHandle = Rm_serviceOpenHandle(rmServerHandle, &result);
+        ERROR_CHECK(RM_OK, result, rmServerName, "Service handle open failed");
     }
-    else if (MultiProc_self()== 1) {
+    else if (coreNum == 1) {
         /* Create the RM Client Delegate instance */
-        rmInitCfg.instName = &rmClientDelegateName[0];
+        rmInitCfg.instName = rmCdName;
         rmInitCfg.instType = Rm_instType_CLIENT_DELEGATE;
         rmInitCfg.instCfg.cdCfg.staticPolicy = (void *)rmStaticPolicy;
-        rmClientDelegateHandle = Rm_init(&rmInitCfg, &result);
-        System_printf("Core %d: RM Client Delegate instance created. Result = %d\n", MultiProc_self(), result);
+        rmCdHandle = Rm_init(&rmInitCfg, &result);
+        ERROR_CHECK(RM_OK, result, rmCdName, "Initialization failed");
+
+        /* Open CD service handle */
+        rmCdServiceHandle = Rm_serviceOpenHandle(rmCdHandle, &result);
+        ERROR_CHECK(RM_OK, result, rmCdName, "Service handle open failed");
 
         /* Create the RM Client instance */
         rmInitCfg.instName = &rmClientName[0];
         rmInitCfg.instType = Rm_instType_CLIENT;      
         rmInitCfg.instCfg.clientCfg.staticPolicy = (void *)rmStaticPolicy;
         rmClientHandle = Rm_init(&rmInitCfg, &result);
-        System_printf("Core %d: RM Client instance created. Result = %d\n", MultiProc_self(), result);
-
-        /* Open service handles on the CD and Client to test static allocations */
-        rmClientDelegateServiceHandle = Rm_serviceOpenHandle(rmClientDelegateHandle, &result);
-        rmClientServiceHandle = Rm_serviceOpenHandle(rmClientHandle, &result);   
-
-        /* Static allocations */
-        memset((void *)&requestInfo, 0, sizeof(Rm_ServiceReqInfo));
-        memset((void *)&responseInfo, 0, sizeof(Rm_ServiceRespInfo));
-        requestInfo.type = Rm_service_RESOURCE_ALLOCATE_INIT;
-        requestInfo.resourceName = resourceNameQosCluster;
-        requestInfo.resourceBase = 0;
-        requestInfo.resourceLength = 1;
-        requestInfo.callback.serviceCallback = serviceCallback;
-        
-        System_printf("Core %d: %s allocating static resource...\n", MultiProc_self(), rmClientDelegateName);
-        rmClientDelegateServiceHandle->Rm_serviceHandler(rmClientDelegateServiceHandle->rmHandle, &requestInfo, &responseInfo);
+        ERROR_CHECK(RM_OK, result, rmClientName, "Initialization failed");
+
+        /* Open Client service handle */
+        rmClientServiceHandle = Rm_serviceOpenHandle(rmClientHandle, &result);
+        ERROR_CHECK(RM_OK, result, rmClientName, "Service handle open failed");
+
+        /* Initialize the static allocation response queue */
+        for (numStaticResponses = 0; numStaticResponses < MAX_STATIC_ALLOCATION_RESPS; numStaticResponses++) {
+            memset((void *)&staticResponseQueue[numStaticResponses], 0, sizeof(Rm_ServiceRespInfo));
+        }
+        numStaticResponses = 0;
+
+        /* Static allocation tests */
+        setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameQosCluster, 
+                     0, 1, 0, NULL, TRUE, &responseInfo);
+        rmCdServiceHandle->Rm_serviceHandler(rmCdServiceHandle->rmHandle, &requestInfo, &responseInfo);
+        System_printf("Core %d : %s static init allocation of %s %d - %d : ", coreNum,
+                                                                              rmCdName,
+                                                                              resourceNameQosCluster,
+                                                                              requestInfo.resourceBase, 
+                                                                              (requestInfo.resourceBase + requestInfo.resourceLength - 1));
         if (responseInfo.serviceState == RM_SERVICE_APPROVED_STATIC) {        
-            System_printf("Core %d: %s got %s: base: %d length: %d\n", MultiProc_self(),
-                                                                       rmClientDelegateName, 
-                                                                       resourceNameQosCluster, 
-                                                                       responseInfo.resourceBase,
-                                                                       responseInfo.resourceLength);
+            System_printf("PASSED\n");
+            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(Rm_ServiceRespInfo));
         }
         else {
-            System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                                responseInfo.serviceState);
-        }            
-        
-        memset((void *)&requestInfo, 0, sizeof(Rm_ServiceReqInfo));
-        memset((void *)&responseInfo, 0, sizeof(Rm_ServiceRespInfo));
-        requestInfo.type = Rm_service_RESOURCE_ALLOCATE_INIT;
-        requestInfo.resourceName = resourceNameQosCluster;
-        requestInfo.resourceBase = 2;
-        requestInfo.resourceLength = 1;
-        requestInfo.callback.serviceCallback = serviceCallback;
+            System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+        }        
         
-        System_printf("Core %d: %s allocating static resource...\n", MultiProc_self(), rmClientName);
+        setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameQosCluster, 
+                     2, 1, 0, NULL, TRUE, &responseInfo);        
         rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
+        System_printf("Core %d : %s static init allocation of %s %d - %d : ", coreNum,
+                                                                              rmClientName,
+                                                                              resourceNameQosCluster,
+                                                                              requestInfo.resourceBase, 
+                                                                              (requestInfo.resourceBase + requestInfo.resourceLength - 1));
         if (responseInfo.serviceState == RM_SERVICE_APPROVED_STATIC) {        
-            System_printf("Core %d: %s got %s: base: %d length: %d\n", MultiProc_self(),
-                                                                       rmClientName, 
-                                                                       resourceNameQosCluster, 
-                                                                       responseInfo.resourceBase,
-                                                                       responseInfo.resourceLength);
+            System_printf("PASSED\n");
+            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(Rm_ServiceRespInfo));
         }
         else {
-            System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                                responseInfo.serviceState);
-        }            
-
-        /* Next request should return error */
-        memset((void *)&requestInfo, 0, sizeof(Rm_ServiceReqInfo));
-        memset((void *)&responseInfo, 0, sizeof(Rm_ServiceRespInfo));
-        requestInfo.type = Rm_service_RESOURCE_ALLOCATE_INIT;
-        requestInfo.resourceName = resourceNameQosCluster;
-        requestInfo.resourceBase = 1;
-        requestInfo.resourceLength = 1;
-        requestInfo.callback.serviceCallback = serviceCallback;
-        
-        System_printf("Core %d: %s allocating static resource...\n", MultiProc_self(), rmClientName);
+            System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+        }
+
+        /* Request resource from Client that can only be allocated to CD according to static policy */
+        setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameQosCluster, 
+                     1, 1, 0, NULL, TRUE, &responseInfo);        
         rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-        if (responseInfo.serviceState == RM_SERVICE_APPROVED_STATIC) {
-            System_printf("Core %d: %s got %s: base: %d length: %d\n", MultiProc_self(),
-                                                                       rmClientName, 
-                                                                       resourceNameQosCluster, 
-                                                                       responseInfo.resourceBase,
-                                                                       responseInfo.resourceLength); 
+        System_printf("Core %d : %s static init allocation of %s %d - %d : ", coreNum,
+                                                                              rmClientName,
+                                                                              resourceNameQosCluster,
+                                                                              requestInfo.resourceBase, 
+                                                                              (requestInfo.resourceBase + requestInfo.resourceLength - 1));
+        if (responseInfo.serviceState != RM_SERVICE_APPROVED_STATIC) {        
+            System_printf("PASSED : denial or error : %d\n", responseInfo.serviceState);
         }
         else {
-            System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                                responseInfo.serviceState);
+            System_printf("FAILED\n");
         }
 
-        /* Allocated shared resource to both CD and Client using static policy */
-        memset((void *)&requestInfo, 0, sizeof(Rm_ServiceReqInfo));
-        memset((void *)&responseInfo, 0, sizeof(Rm_ServiceRespInfo));
-        requestInfo.type = Rm_service_RESOURCE_ALLOCATE_INIT;
-        requestInfo.resourceName = resourceNameAifQ;
-        requestInfo.resourceBase = 525;
-        requestInfo.resourceLength = 1;
-        requestInfo.callback.serviceCallback = serviceCallback;
-        
-        System_printf("Core %d: %s allocating static resource...\n", MultiProc_self(), rmClientDelegateName);
-        rmClientDelegateServiceHandle->Rm_serviceHandler(rmClientDelegateServiceHandle->rmHandle, &requestInfo, &responseInfo);
-        if (responseInfo.serviceState == RM_SERVICE_APPROVED_STATIC) {
-            System_printf("Core %d: %s got %s: base: %d length: %d\n", MultiProc_self(),
-                                                                       rmClientDelegateName, 
-                                                                       resourceNameAifQ, 
-                                                                       responseInfo.resourceBase,
-                                                                       responseInfo.resourceLength);
+        /* Request resource from both Client and CD that is shared according to static policy */
+        setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameAifQ, 
+                     525, 1, 0, NULL, TRUE, &responseInfo);        
+        rmCdServiceHandle->Rm_serviceHandler(rmCdServiceHandle->rmHandle, &requestInfo, &responseInfo);
+        System_printf("Core %d : %s static init allocation of %s %d - %d : ", coreNum,
+                                                                              rmCdName,
+                                                                              resourceNameAifQ,
+                                                                              requestInfo.resourceBase, 
+                                                                              (requestInfo.resourceBase + requestInfo.resourceLength - 1));
+        if (responseInfo.serviceState == RM_SERVICE_APPROVED_STATIC) {        
+            System_printf("PASSED\n");
+            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(Rm_ServiceRespInfo));
         }
         else {
-            System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                                responseInfo.serviceState);
+            System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
         }
-        
-        memset((void *)&requestInfo, 0, sizeof(Rm_ServiceReqInfo));
-        memset((void *)&responseInfo, 0, sizeof(Rm_ServiceRespInfo));
-        requestInfo.type = Rm_service_RESOURCE_ALLOCATE_INIT;
-        requestInfo.resourceName = resourceNameAifQ;
-        requestInfo.resourceBase = 525;
-        requestInfo.resourceLength = 1;
-        requestInfo.callback.serviceCallback = serviceCallback;
-        
-        System_printf("Core %d: %s allocating static resource...\n", MultiProc_self(), rmClientName);
+
+        setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameAifQ, 
+                     525, 1, 0, NULL, TRUE, &responseInfo);        
         rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
+        System_printf("Core %d : %s static init allocation of %s %d - %d : ", coreNum,
+                                                                              rmClientName,
+                                                                              resourceNameAifQ,
+                                                                              requestInfo.resourceBase, 
+                                                                              (requestInfo.resourceBase + requestInfo.resourceLength - 1));
         if (responseInfo.serviceState == RM_SERVICE_APPROVED_STATIC) {        
-            System_printf("Core %d: %s got %s: base: %d length: %d\n", MultiProc_self(),
-                                                                       rmClientName, 
-                                                                       resourceNameAifQ, 
-                                                                       responseInfo.resourceBase,
-                                                                       responseInfo.resourceLength);  
+            System_printf("PASSED\n");
+            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(Rm_ServiceRespInfo));
         }
         else {
-            System_printf("Core %d: Static allocation failed with error: %d\n", MultiProc_self(), 
-                                                                                responseInfo.serviceState);
-        }      
+            System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+        }    
     }
 
-    System_printf("Core %d: Starting IPC...\n", MultiProc_self());
+    System_printf("Core %d: Starting IPC...\n", coreNum);
     status = Ipc_start();
     if (status < 0) {
         System_abort("Ipc_start failed\n");
     }
 
     /* Create the RM startup task */
-    System_printf("Core %d: Creating RM startup task...\n", MultiProc_self());
+    System_printf("Core %d: Creating RM startup task...\n", coreNum);
     Task_Params_init (&taskParams);
     rmStartupTskHandle = Task_create (rmStartupTsk, &taskParams, NULL);
 
-    System_printf("Core %d: Starting BIOS...\n", MultiProc_self());
+    System_printf("Core %d: Starting BIOS...\n", coreNum);
     BIOS_start();
 
     return (0);