Completed cleanup of test projects. Partitioned cdProcess to prepare for CD allocato...
authorJustin Sobota <jsobota@ti.com>
Mon, 8 Apr 2013 17:57:22 +0000 (13:57 -0400)
committerJustin Sobota <jsobota@ti.com>
Mon, 8 Apr 2013 17:57:22 +0000 (13:57 -0400)
include/rm_loc.h
rm.h
src/rm.c
src/rm_allocator.c
src/rm_policy.c
test/k2h/c66/bios/rm_shared_test.cfg
test/k2k/c66/bios/rm_shared_test.cfg
test/rm_mem_test.c
test/rm_shared_osal.c
test/rm_shared_test.c
test/rm_test.c

index 5382d6d8cfa6ca4f80ced74df76e17750193221b..06c224102c7752d399a17a9e37769ecd00621426 100644 (file)
@@ -100,11 +100,13 @@ typedef struct {
 
 /* Client Delegate-specific instance data */
 typedef struct {
-    /* Pointer to the static policy if provided */
-    void                   *staticPolicy;
+    /* Pointer to the cd policy if provided */
+    void                   *cdPolicy;
     /* Pointer to the root entry of the valid instance tree
-     * extracted from the static policy */
-    Rm_PolicyValidInstTree *staticValidInstTree;
+     * extracted from the cd policy */
+    Rm_PolicyValidInstTree *cdValidInstTree;
+    /* Pointer to the linked list of allocators */
+    Rm_Allocator           *allocators;    
 } Rm_ClientDelegateInstData;
 
 /* Client-specific instance data */
diff --git a/rm.h b/rm.h
index 0745d743ba389e16699f743e00cf6216d8922065..d8a1972df17e59a0a4c8d2bfbb7d43fb9b07f116 100644 (file)
--- a/rm.h
+++ b/rm.h
@@ -384,13 +384,23 @@ typedef struct {
  * @brief RM client delegate (CD) initialization configurations
  */
 typedef struct {
-    /** Pointer to a static policy used by the CD to allocate resources statically.
-     *  Static allocations can occur before the instance has been attached to a server
-     *  instance within the RM system.  This is useful for allocating resources
-     *  prior to main().  Resources allocated via the static policy will be verified
-     *  against the global policy once the CD connects with the server.  The static
-     *  policy must be in DTB format. */
-    void *staticPolicy;
+    /** Pointer to a client delegate policy used by the CD to allocate resources 
+     *  without contacting the server.  The cdPolicy will be used by the CD to
+     *  determine whether clients connected to the CD can be allocated resources
+     *  provided to the CD by the server. 
+     *
+     *  The cdPolicy will also act as a static policy until the transport to the
+     *  server has been established.  Static allocations can occur before the 
+     *  instance has been attached to a server instance within the RM system.  
+     *  This is useful for allocating resources prior to main().  Resources allocated
+     *  via the static policy will be verified against the global policy once the 
+     *  CD connects with the server.  The static policy must be in DTB format.  
+     *
+     *  To guarantee proper resource permission synchronization between the CD
+     *  and server the cdPolicy must either be an exact copy of the globalPolicy
+     *  or a exact replica of a subset of the globalPolicy provided to the server
+     *  at initialization. */
+    void *cdPolicy;
 } Rm_ClientDelegateCfg;
 
 /**
index 1cbc4b47653ae4ced6e787455519fb001a0cd430..d19ca1c34a2779e8a939af04eb3da74257df3342 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
@@ -345,10 +345,9 @@ static void transactionForwarder (Rm_Inst *rmInst, Rm_Transaction *transaction)
         }              
         transaction->hasBeenForwarded = RM_TRUE;
         /* Transaction not deleted.  Waiting for response from RM CD or Server */
-    }  
-    return;
+    }
 errorExit: 
-    /* Do not delete transaction on transport error.  Transport rrror transactions should be visible
+    /* Do not delete transaction on transport error.  Transport error transactions should be visible
      * from Rm_printInstanceStatus() */               
     return;
 }
@@ -362,15 +361,15 @@ errorExit:
  */
 static void staticAllocationHandler (Rm_Handle rmHandle, Rm_Transaction *transaction)
 {
-    Rm_Inst                *rmInst = (Rm_Inst *)rmHandle;
-    void                   *staticPolicy = rmPolicyGetPolicy(rmHandle);
-    Rm_PolicyCheckCfg       privCheckCfg;
-    int32_t                 result;
+    Rm_Inst           *rmInst = (Rm_Inst *)rmHandle;
+    void              *staticPolicy = rmPolicyGetPolicy(rmHandle);
+    Rm_PolicyCheckCfg  privCheckCfg;
+    int32_t            result;
     
     if (staticPolicy) {
         if ((transaction->type == Rm_service_RESOURCE_ALLOCATE_INIT) ||
             (transaction->type == Rm_service_RESOURCE_ALLOCATE_USE)) {
-            /* Check request against startup policy */
+            /* Check request against static policy */
             memset((void *)&privCheckCfg, 0, sizeof(Rm_PolicyCheckCfg));
     
             if (transaction->type == Rm_service_RESOURCE_ALLOCATE_INIT) {
@@ -425,7 +424,7 @@ static void allocationHandler (Rm_Inst *rmInst, Rm_Transaction *transaction)
     int32_t             retVal = transaction->state;
 
     if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
-        transactionForwarder(rmInst, transaction);   
+        /* Fill in allocation logic for CDs */  
     }
     else if ((rmInst->instType == Rm_instType_SERVER)||
              (rmInst->instType == Rm_instType_SHARED_SERVER)) {
@@ -503,7 +502,7 @@ static void freeHandler (Rm_Inst *rmInst, Rm_Transaction *transaction)
     int32_t             retVal = transaction->state;
     
     if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
-        transactionForwarder(rmInst, transaction);   
+        /* Fill in free logic for CDs */    
     }
     else if ((rmInst->instType == Rm_instType_SERVER) ||
              (rmInst->instType == Rm_instType_SHARED_SERVER)) {
@@ -599,48 +598,93 @@ static void clientProcess (Rm_Inst *rmInst, Rm_Transaction *transaction)
  *                  - Attempts to complete resource service requests
  *                    received from registered Clients
  */
-static void clientDelegateProcess (Rm_Inst *rmInst, Rm_Transaction *transaction)
+static void cdProcess (Rm_Inst *rmInst, Rm_Transaction *transaction)
 {        
     Rm_Transaction *transQ = rmInst->transactionQueue;    
 
     if (!rmInst->registeredWithDelegateOrServer) {
         if ((transaction->state == RM_SERVICE_PROCESSING) &&
-            (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS) == 0)) {           
+            (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS) == 0)) {
+            /* Attempt static allocation of requests originating from CD inst */
             staticAllocationHandler((Rm_Handle)rmInst, transaction);
         }
         /* Everything else left in transaction queue for forwarding once transport to
          * Server is registered */
     }
     else {
-        if ((transaction->state == RM_SERVICE_PROCESSING) ||
-            (transaction->state == RM_SERVICE_APPROVED_STATIC)) {        
-            if ((transaction->type == Rm_service_RESOURCE_MAP_TO_NAME) ||
-                (transaction->type == Rm_service_RESOURCE_GET_BY_NAME) ||
-                (transaction->type == Rm_service_RESOURCE_UNMAP_NAME)) {
+        if ((transaction->type == Rm_service_RESOURCE_MAP_TO_NAME) ||
+            (transaction->type == Rm_service_RESOURCE_GET_BY_NAME) ||
+            (transaction->type == Rm_service_RESOURCE_UNMAP_NAME)) {
+            if (transaction->state == RM_SERVICE_PROCESSING) {
                 /* Forward all NameServer requests. */
                 transactionForwarder(rmInst, transaction);
             }
-            else if (transaction->type == Rm_service_RESOURCE_FREE) {
-                freeHandler(rmInst, transaction);
+            else {
+                /* NameServer transaction validated.  Return result. */
+                if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {
+                    /* Transaction did not originate on this instance */
+                    transactionResponder(rmInst, transaction);
+                }
+                else {
+                    /* Transaction originated on this instance */
+                    serviceResponder(rmInst, transaction);
+                }
+            }
+        }        
+        else if ((transaction->type == Rm_service_RESOURCE_ALLOCATE_INIT) ||
+                 (transaction->type == Rm_service_RESOURCE_ALLOCATE_USE)) {
+            if ((transaction->state == RM_SERVICE_PROCESSING) ||
+                (transaction->state == RM_SERVICE_APPROVED_STATIC)) {   
+                transactionForwarder(rmInst, transaction);
             }
             else {
-                allocationHandler(rmInst, transaction);
-            }          
+                /* Transaction validated.  Return result. */
+                if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {
+                    /* Transaction did not originate on this instance */
+                    transactionResponder(rmInst, transaction);
+                }
+                else {
+                    /* Transaction originated on this instance */
+                    serviceResponder(rmInst, transaction);
+                }
+            }
         }
-        else {
-            /* Transaction validated.  Return result. */
-            if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {
-                /* Transaction did not originate on this instance */
-                transactionResponder(rmInst, transaction);
+        else if (transaction->type == Rm_service_RESOURCE_FREE) {     
+            if (transaction->state == RM_SERVICE_PROCESSING) {
+                freeHandler(rmInst, transaction);
+
+                if (transaction->state == RM_SERVICE_PROCESSING) {
+                    /* CD could not handle free.  Forward to Server */
+                    transactionForwarder(rmInst, transaction);
+                }
+                else {
+                    /* Free validated by CD.  Return result */
+                    if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {
+                        /* Transaction did not originate on this instance */
+                        transactionResponder(rmInst, transaction);
+                    }
+                    else {
+                        /* Transaction originated on this instance */
+                        serviceResponder(rmInst, transaction);
+                    }                    
+                }
             }
             else {
-                /* Transaction originated on this instance */
-                serviceResponder(rmInst, transaction);
+                /* Transaction validated.  Return result. */
+                if (strncmp(transaction->serviceSrcInstName, rmInst->instName, RM_NAME_MAX_CHARS)) {
+                    /* Transaction did not originate on this instance */
+                    transactionResponder(rmInst, transaction);
+                }
+                else {
+                    /* Transaction originated on this instance */
+                    serviceResponder(rmInst, transaction);
+                }
             }
         }
 
-        /* Forward any queued static requests (local and received from any registered
-         * Clients that weren't forwarded */
+        /* Attempt allocation of any queued static requests:
+         * RM_SERVICE_APPROVED_STATIC - Originated locally
+         * RM_SERVICE_PROCESSING - Received from any registered Clients */
         while(transQ) {
             if (((transQ->state == RM_SERVICE_PROCESSING) ||
                  (transQ->state == RM_SERVICE_APPROVED_STATIC)) &&
@@ -826,7 +870,7 @@ void rmProcessRouter (Rm_Inst *rmInst, Rm_Transaction *transaction)
         clientProcess(rmInst, transaction);
     }
     else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
-        clientDelegateProcess(rmInst, transaction);
+        cdProcess(rmInst, transaction);
     }
     else if ((rmInst->instType == Rm_instType_SERVER) ||
              (rmInst->instType == Rm_instType_SHARED_SERVER)) {
@@ -1092,23 +1136,25 @@ Rm_Handle Rm_init(const Rm_InitCfg *initCfg, int32_t *result)
         }
     }
     else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
-        if (initCfg->instCfg.clientCfg.staticPolicy) {
-            rmInst->u.cd.staticPolicy = initCfg->instCfg.cdCfg.staticPolicy;
-            rmInst->u.cd.staticValidInstTree = rmPolicyCreateValidInstTree((Rm_Handle)rmInst, addLinux, result);        
+        if (initCfg->instCfg.cdCfg.cdPolicy) {
+            rmInst->u.cd.cdPolicy = initCfg->instCfg.cdCfg.cdPolicy;
+            rmInst->u.cd.cdValidInstTree = rmPolicyCreateValidInstTree((Rm_Handle)rmInst, addLinux, result);        
             if (*result == RM_OK) {
                 *result = rmPolicyValidatePolicy((Rm_Handle)rmInst);
             }
 
             if (*result != RM_OK) {
-                if (rmInst->u.cd.staticValidInstTree) {
+                if (rmInst->u.cd.cdValidInstTree) {
                     rmPolicyFreeValidInstTree((Rm_Handle)rmInst);
                 }
                 goto errorExit;
             }
         }
+
+        rmInst->u.cd.allocators = NULL;
     }
     else if (rmInst->instType == Rm_instType_CLIENT) {
-        if (initCfg->instCfg.cdCfg.staticPolicy) { 
+        if (initCfg->instCfg.clientCfg.staticPolicy) { 
             rmInst->u.client.staticPolicy = initCfg->instCfg.clientCfg.staticPolicy;
             rmInst->u.client.staticValidInstTree = rmPolicyCreateValidInstTree((Rm_Handle)rmInst, addLinux, result);        
             if (*result == RM_OK) {
@@ -1191,6 +1237,11 @@ int32_t Rm_delete(Rm_Handle rmHandle, int ignorePendingServices)
         (rmInst->instType == Rm_instType_SHARED_SERVER)) {
         rmAllocatorDeleteResources(rmHandle);
         rmNameServerDelete(rmHandle);
+        rmInst->u.server.allocators = NULL;
+    }
+    else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
+        rmAllocatorDeleteResources(rmHandle);
+        rmInst->u.cd.allocators = NULL;
     }
 
     if (rmInst->instType != Rm_instType_SHARED_CLIENT) {
index 8892717d35f43fdaab68ff3144b1094a118f31d8..8e2d72c6aec9db24fb1191b7e2903f50fd271dcc 100644 (file)
@@ -128,6 +128,26 @@ static int32_t allocatorCreate(Rm_Handle rmHandle, const char *resourceName, Rm_
     return(RM_OK);
 }
 
+/* FUNCTION PURPOSE: Returns a pointer to the allocator list
+ ***********************************************************************
+ * DESCRIPTION: Returns a pointer to the instance's allocator list
+ *              based on the instance type
+ */
+static Rm_Allocator *allocatorGetAllocatorList(Rm_Handle rmHandle)
+{
+    Rm_Inst      *rmInst = (Rm_Inst *)rmHandle;
+    Rm_Allocator *list = NULL;
+
+    if ((rmInst->instType == Rm_instType_SERVER) ||
+        (rmInst->instType == Rm_instType_SHARED_SERVER)) {
+        list = rmInst->u.server.allocators;
+    }
+    else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
+        list = rmInst->u.cd.allocators;
+    }
+    return(list);
+}
+
 /* FUNCTION PURPOSE: Deletes a resource allocator
  ***********************************************************************
  * DESCRIPTION: Deletes a resource allocator based on the given
@@ -1367,7 +1387,7 @@ exitAllocInit:
 void rmAllocatorDeleteResources(Rm_Handle rmHandle)
 {
     Rm_Inst         *rmInst = (Rm_Inst *)rmHandle;
-    Rm_Allocator    *allocatorList = rmInst->u.server.allocators;
+    Rm_Allocator    *allocatorList = allocatorGetAllocatorList(rmHandle);
     Rm_Allocator    *nextAllocator;
     Rm_ResourceTree *resTree;
     Rm_ResourceNode *resNode;
@@ -1396,6 +1416,5 @@ void rmAllocatorDeleteResources(Rm_Handle rmHandle)
         Rm_osalFree((void *)allocatorList, sizeof(*allocatorList));
         allocatorList = nextAllocator;
     }
-    rmInst->u.server.allocators = NULL;
 }
 
index 396a08d7367776a1be0c509a8fe7863c831d5d21..3eba1b495e47a5cabca79aaa2e3e58ec5eb47e44 100644 (file)
@@ -88,7 +88,7 @@ static Rm_PolicyValidInstTree *policyGetValidInstTree(Rm_Handle rmHandle)
         tree = rmInst->u.server.globalValidInstTree;
     }
     else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
-        tree = rmInst->u.cd.staticValidInstTree;
+        tree = rmInst->u.cd.cdValidInstTree;
     }
     else if (rmInst->instType == Rm_instType_CLIENT) {
         tree = rmInst->u.client.staticValidInstTree;
@@ -512,7 +512,7 @@ void *rmPolicyGetPolicy(Rm_Handle rmHandle)
         policy = rmInst->u.server.globalPolicy;
     }
     else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
-        policy = rmInst->u.cd.staticPolicy;
+        policy = rmInst->u.cd.cdPolicy;
     }
     else if (rmInst->instType == Rm_instType_CLIENT) {
         policy = rmInst->u.client.staticPolicy;
@@ -991,7 +991,7 @@ void rmPolicyFreeValidInstTree(Rm_Handle rmHandle)
             rmInst->u.server.globalValidInstTree = NULL;
         }
         else if (rmInst->instType == Rm_instType_CLIENT_DELEGATE) {
-            rmInst->u.cd.staticValidInstTree = NULL;
+            rmInst->u.cd.cdValidInstTree = NULL;
         }
         else if (rmInst->instType == Rm_instType_CLIENT) {
             rmInst->u.client.staticValidInstTree = NULL;
index 828c74495a4d1caa3751c77c99fd0695402a8ce3..85a826f11d568ff240d8567b8f8d526fc2064fc6 100644 (file)
@@ -65,8 +65,8 @@ var BIOS        = xdc.useModule('ti.sysbios.BIOS');
 BIOS.heapSize   = 0x10000;
 var Task        = xdc.useModule('ti.sysbios.knl.Task');
 
-Program.sectMap[".rmTestSharedHandle"] = new Program.SectionSpec();
-Program.sectMap[".rmTestSharedHandle"] = "MSMCSRAM";
+Program.sectMap[".rmSharedHandleTest"] = new Program.SectionSpec();
+Program.sectMap[".rmSharedHandleTest"] = "MSMCSRAM";
 
 /* Read once when RM_SHARED_SERVER is initialized */
 Program.sectMap[".sharedGRL"] = new Program.SectionSpec();
index 745d27ecc1e6f80c3c374daffbfbf8f003eaa53e..bb11d721d607c99460085eedbba95f1afb3d88b8 100644 (file)
@@ -65,8 +65,8 @@ var BIOS        = xdc.useModule('ti.sysbios.BIOS');
 BIOS.heapSize   = 0x10000;
 var Task        = xdc.useModule('ti.sysbios.knl.Task');
 
-Program.sectMap[".rmTestSharedHandle"] = new Program.SectionSpec();
-Program.sectMap[".rmTestSharedHandle"] = "MSMCSRAM";
+Program.sectMap[".rmSharedHandleTest"] = new Program.SectionSpec();
+Program.sectMap[".rmSharedHandleTest"] = "MSMCSRAM";
 
 /* Read once when RM_SHARED_SERVER is initialized */
 Program.sectMap[".sharedGRL"] = new Program.SectionSpec();
index 601a62eabbb493dc6b494c448c61a91c158f2d62..615f9bd6c852d6d07b4104e0f83d5b25a7f23f65 100644 (file)
@@ -117,8 +117,10 @@ extern int deleteRmTrans(void);
  ********************** Global Variables ******************************
  **********************************************************************/
 
-/* DSP core number according to IPC */
+/* DSP core number according to DNUM */
 uint16_t            coreNum;
+/* Number of errors that occurred during the test */
+uint16_t            testErrors;
 
 /* Task to configure application transport code for RM */
 Task_Handle         rmStartupTskHandle;
@@ -170,6 +172,7 @@ volatile int8_t   isRmInitialized[128];
         char errorMsgToPrint[] = printMsg;                                       \
         System_printf("Error Core %d : %s : ", coreNum, rmInstName);             \
         System_printf("%s with error code : %d\n", errorMsgToPrint, resultVal);  \
+        testErrors++;                                                            \
         System_abort("Test Failure\n");                                          \
     }
 
@@ -197,10 +200,12 @@ volatile int8_t   isRmInitialized[128];
         if (mallocFreeBalance > 0) {                                                                \
             System_printf ("Core %d : - FAILED - %6d unfreed mallocs                       -\n",    \
                            coreNum, mallocFreeBalance);                                             \
+            testErrors++;                                                                           \
         }                                                                                           \
         else if (mallocFreeBalance < 0) {                                                           \
             System_printf ("Core %d : - FAILED - %6d more frees than mallocs               -\n",    \
                            coreNum, -mallocFreeBalance);                                            \
+            testErrors++;                                                                           \
         }                                                                                           \
         else {                                                                                      \
             System_printf ("Core %d : - PASSED                                                -\n", \
@@ -306,23 +311,29 @@ void rmCleanupTsk(UArg arg0, UArg arg1)
     ERROR_CHECK(RM_OK, rmResult, rmInstName, "Delete failed");
 
     System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
-    System_printf ("Core %d : ------------------ Example Completion--------------------\n", coreNum);                                                                \
-    System_printf ("Core %d : - API/Functionality     : malloc count   |   free count -\n", coreNum);                                                                \
+    System_printf ("Core %d : ------------------ Example Completion -------------------\n", coreNum);
+    System_printf ("Core %d : - API/Functionality     : malloc count   |   free count -\n", coreNum);
     System_printf ("Core %d : - Example Completion    :  %6d        |  %6d      -\n", coreNum,
                    rmMallocCounter, rmFreeCounter);
     finalMallocFree = rmMallocCounter - rmFreeCounter;
     if (finalMallocFree > 0) {
         System_printf ("Core %d : - FAILED - %6d unfreed mallocs                       -\n",
                        coreNum, finalMallocFree);
+        testErrors++;
     }
     else if (finalMallocFree < 0) {
         System_printf ("Core %d : - FAILED - %6d more frees than mallocs               -\n",
                        coreNum, -finalMallocFree);
+        testErrors++;
     }
     else {
         System_printf ("Core %d : - PASSED                                                -\n",
                        coreNum);
-    }
+    }    
+    if (testErrors) {
+        System_printf ("Core %d : -                                                       -\n", coreNum); 
+        System_printf ("Core %d : - Test Errors: %-32d         -\n", coreNum, testErrors);
+    }    
     System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
     System_printf ("\n");  
 
@@ -578,6 +589,7 @@ int32_t rmLocalPktSendRcv (Rm_AppTransportHandle appTransport, Rm_PacketHandle p
     /* Provide packet to remote instance for processing */
     if (status = Rm_receivePacket(transportHandle, rmPkt)) {
         System_printf("Error Core %d : Receiving RM packet : %d\n", coreNum, status);
+        testErrors++;
     }
 
     /* Free the packet */
@@ -749,7 +761,7 @@ void testCd(void)
 
 
     MEM_TEST_START_STORE();
-    rmInitCfg.instCfg.clientCfg.staticPolicy = (void *)rmStaticPolicy;
+    rmInitCfg.instCfg.cdCfg.cdPolicy = (void *)rmStaticPolicy;
     rmHandle = Rm_init(&rmInitCfg, &rmResult);
     ERROR_CHECK(RM_OK, rmResult, rmInstName, "Initialization failed");
     MEM_TEST_MID_STORE();
@@ -1035,10 +1047,12 @@ void main(Int argc, Char* argv[])
     isRmInitialized[0] = 0;
 
     coreNum = CSL_chipReadReg(CSL_CHIP_DNUM);
+    testErrors = 0;
 
     System_printf("Core %d: Starting IPC...\n", coreNum);
     status = Ipc_start();
     if (status < 0) {
+        testErrors++;
         System_abort("Ipc_start failed\n");
     }
 
@@ -1085,6 +1099,7 @@ void main(Int argc, Char* argv[])
     if (setupRmTransConfig(NUM_CORES, SYSINIT, rmStartupTsk) < 0)
     {
         System_printf ("Error core %d : Transport setup for RM error\n", coreNum);
+        testErrors++;
         return;
     }
 
index eb8988aab0ae8932833a0c7e5053754808a1452c..0b6326561f39fde0e222450f72bc274cd51f850f 100644 (file)
 #include <ti/csl/csl_cacheAux.h>
 #include <ti/csl/csl_xmcAux.h>
 
+/* RM Includes */
+#include <ti/drv/rm/rm_osal.h>
+
 /**********************************************************************
  ****************************** Defines *******************************
  **********************************************************************/
 
 /* Try to avoid conflict with GateMP in rm_shared_test.c */
-#define RM_HW_SEM     4
+#define RM_HW_SEM          4
+#define RM_MALLOC_FREE_SEM 5
 
 /**********************************************************************
  ************************** Global Variables **************************
  **********************************************************************/
-uint32_t rmMallocCounter = 0;
-uint32_t rmFreeCounter   = 0;
+/* Put memory tracking variables in MSMCSRAM to track all allocations
+ * using the Shared Server.  Define the variables so they don't cross
+ * any cache line boundaries. */
+#pragma DATA_SECTION (rmMallocCounter, ".rmSharedHandleTest");
+#pragma DATA_ALIGN (rmMallocCounter, 128)
+uint32_t rmMallocCounter[4] = {0,0,0,0};
+#pragma DATA_SECTION (rmFreeCounter, ".rmSharedHandleTest");
+#pragma DATA_ALIGN (rmFreeCounter, 128)
+uint32_t rmFreeCounter[4]   = {0,0,0,0};
 
 /**********************************************************************
  *************************** OSAL Functions **************************
@@ -87,8 +98,12 @@ void *Osal_rmMalloc (uint32_t num_bytes)
 {
        Error_Block     errorBlock;
 
+    while ((CSL_semAcquireDirect (RM_MALLOC_FREE_SEM)) == 0);
+    Osal_rmBeginMemAccess(rmMallocCounter, sizeof(rmMallocCounter));
     /* Increment the allocation counter. */
-    rmMallocCounter++;
+    rmMallocCounter[0]++;
+    Osal_rmEndMemAccess(rmMallocCounter, sizeof(rmMallocCounter));
+    CSL_semReleaseSemaphore (RM_MALLOC_FREE_SEM);
 
        /* Allocate memory. */
        return Memory_alloc(SharedRegion_getHeap(0), num_bytes, 0, &errorBlock);
@@ -101,8 +116,14 @@ void *Osal_rmMalloc (uint32_t num_bytes)
  */ 
 void Osal_rmFree (void *ptr, uint32_t size)
 {
+    while ((CSL_semAcquireDirect (RM_MALLOC_FREE_SEM)) == 0);
     /* Increment the free counter. */
-    rmFreeCounter++;
+    Osal_rmBeginMemAccess(rmFreeCounter, sizeof(rmFreeCounter));
+    rmFreeCounter[0]++;
+    Osal_rmEndMemAccess(rmFreeCounter, sizeof(rmFreeCounter));
+    CSL_semReleaseSemaphore (RM_MALLOC_FREE_SEM);
+
+    /* Free memory */
        Memory_free(SharedRegion_getHeap(0), ptr, size);
 }
 
index ba0c861c63d0f43486e699defcbca18df8cf2140..2645a7690954b9714d13c88934169c85a2704134 100644 (file)
 
 /* RM packet heap name */
 #define RM_PKT_HEAP_NAME             "rmHeapBuf"
-/* Name of GateMP used to synchronize the RM test tasks */
-#define RM_TASK_GATE_NAME            "rmGateMP"
+/* GateMP names used to synchronize the RM test tasks */
+#define RM_SERVER_GATE_NAME          "rmServerGate"
+#define RM_CLIENT_GATE_NAME          "rmClientGate"
 
 /* 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("Error Core %d : %s : ", coreNum, rmInstName);             \
         System_printf("%s with error code : %d\n", errorMsgToPrint, resultVal);  \
+        testErrors++;                                                            \
         System_abort("Test Failure\n");                                          \
     }
 
+#define POSITIVE_PASS_CHECK(title, core, instName, resName, resStart, resLen, align, state, check)  \
+    do {                                                                                            \
+        int32_t start = resStart;                                                                   \
+        int32_t alignment = align;                                                                  \
+        char    titleMsg[] = title;                                                                 \
+        System_printf ("Core %d : ---------------------------------------------------------\n",     \
+                       core);                                                                       \
+        System_printf ("Core %d : %s\n", core, titleMsg);                                           \
+        System_printf ("Core %d : - Instance Name: %-32s       -\n", core, instName);               \
+        System_printf ("Core %d : - Resource Name: %-32s       -\n", core, resName);                \
+        if (start == RM_RESOURCE_BASE_UNSPECIFIED) {                                                \
+            System_printf ("Core %d : - Start:         UNSPECIFIED                            -\n", \
+                           core);                                                                   \
+            System_printf ("Core %d : - Length:        %-16d                       -\n",            \
+                           core, resLen);                                                           \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - Start:         %-16d                       -\n",            \
+                           core, resStart);                                                         \
+            System_printf ("Core %d : - End:           %-16d                       -\n", core,      \
+                           (start + resLen - 1));                                                   \
+        }                                                                                           \
+        if (alignment == RM_RESOURCE_ALIGNMENT_UNSPECIFIED) {                                       \
+            System_printf ("Core %d : - Alignment:     UNSPECIFIED                            -\n", \
+                           core);                                                                   \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - Alignment:     %-16d                       -\n",            \
+                           core, alignment);                                                        \
+        }                                                                                           \
+        System_printf ("Core %d : -                                                       -\n",     \
+                       core);                                                                       \
+        if (state == check) {                                                                       \
+            System_printf ("Core %d : - PASSED                                                -\n", \
+                           core);                                                                   \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - FAILED - Denial: %-6d                               -\n",   \
+                           core, state);                                                            \
+            testErrors++;                                                                           \
+        }                                                                                           \
+        System_printf ("Core %d : ---------------------------------------------------------\n",     \
+                       core);                                                                       \
+        System_printf ("\n");                                                                       \
+    } while(0);
+
+#define NEGATIVE_PASS_CHECK(title, core, instName, resName, resStart, resLen, align, state, check)  \
+    do {                                                                                            \
+        int32_t start = resStart;                                                                   \
+        int32_t alignment = align;                                                                  \
+        char    titleMsg[] = title;                                                                 \
+        System_printf ("Core %d : ---------------------------------------------------------\n",     \
+                       core);                                                                       \
+        System_printf ("Core %d : %s\n", core, titleMsg);                                           \
+        System_printf ("Core %d : - Instance Name: %-32s       -\n", core, instName);               \
+        System_printf ("Core %d : - Resource Name: %-32s       -\n", core, resName);                \
+        if (start == RM_RESOURCE_BASE_UNSPECIFIED) {                                                \
+            System_printf ("Core %d : - Start:         UNSPECIFIED                            -\n", \
+                           core);                                                                   \
+            System_printf ("Core %d : - Length:        %-16d                       -\n",            \
+                           core, resLen);                                                           \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - Start:         %-16d                       -\n",            \
+                           core, resStart);                                                         \
+            System_printf ("Core %d : - End:           %-16d                       -\n", core,      \
+                           (start + resLen - 1));                                                   \
+        }                                                                                           \
+        if (alignment == RM_RESOURCE_ALIGNMENT_UNSPECIFIED) {                                       \
+            System_printf ("Core %d : - Alignment:     UNSPECIFIED                            -\n", \
+                           core);                                                                   \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - Alignment:     %-16d                       -\n",            \
+                           core, alignment);                                                        \
+        }                                                                                           \
+        System_printf ("Core %d : -                                                       -\n",     \
+                       core);                                                                       \
+        if (state != check) {                                                                       \
+            System_printf ("Core %d : - PASSED - Denial: %-6d                               -\n",   \
+                           core, state);                                                            \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - FAILED - Expected Denial                              -\n", \
+                           core);                                                                   \
+            testErrors++;                                                                           \
+        }                                                                                           \
+        System_printf ("Core %d : ---------------------------------------------------------\n",     \
+                       core);                                                                       \
+        System_printf ("\n");                                                                       \
+    } while(0);    
+
 /**********************************************************************
  ****************** RM Shared Test Data Structures ********************
  **********************************************************************/
@@ -109,6 +203,10 @@ typedef struct {
  ********************** Extern Variables ******************************
  **********************************************************************/
 
+/* Alloc and free OSAL variables */
+extern uint32_t rmMallocCounter[];
+extern uint32_t rmFreeCounter[];
+
 /* RM test Global Resource List (GRL) */
 extern const char rmGRL[];
 /* Example Linux DTB file provided to RM Server for automatic Linux Kernel resource extraction */
@@ -120,8 +218,10 @@ extern const char rmGlobalPolicy[];
  ********************** Global Variables ******************************
  **********************************************************************/
 
-/* DSP core number according to IPC */
+/* DSP core number according to DNUM */
 uint16_t            coreNum;
+/* Number of errors that occurred during the test */
+uint16_t            testErrors;
 
 /* Task to configure application transport code for RM */
 Task_Handle         rmStartupTskHandle;
@@ -130,10 +230,12 @@ 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;
+/* GateMPs used to synchronize tests between the two RM test tasks */
+GateMP_Handle       serverGate = NULL;
+GateMP_Handle       clientGate = NULL;
+/* GateMP keys */
+IArg                serverKey;
+IArg                clientKey;
 
 /* RM Shared Server instance name (must match with RM Global Resource List (GRL) and policies */
 char                rmServerName[RM_NAME_MAX_CHARS]        = "RM_Server";
@@ -143,7 +245,7 @@ char                rmSharedClient1Name[RM_NAME_MAX_CHARS] = "RM_Client_Delegate
 char                rmSharedClient2Name[RM_NAME_MAX_CHARS] = "RM_Client";
 
 /* RM shared server instance handle */
-#pragma DATA_SECTION (rmSharedHandle, ".rmTestSharedHandle");
+#pragma DATA_SECTION (rmSharedHandle, ".rmSharedHandleTest");
 #pragma DATA_ALIGN (rmSharedHandle, RM_TEST_MAX_CACHE_ALIGN)
 Test_SharedRmHandle rmSharedHandle = {NULL};
 
@@ -153,7 +255,7 @@ Rm_Handle rmSharedClient1Handle = NULL;
 Rm_Handle rmSharedClient2Handle = NULL;
 
 /* RM shared server instance service handle */
-Rm_ServiceHandle   *rmSharedServiceHandle        = NULL;
+Rm_ServiceHandle   *rmSharedServerServiceHandle        = NULL;
 Rm_ServiceHandle   *rmSharedClient1ServiceHandle = NULL;
 Rm_ServiceHandle   *rmSharedClient2ServiceHandle = NULL;
 
@@ -192,9 +294,10 @@ void setRmRequest(Rm_ServiceReqInfo *reqInfo, Rm_ServiceType type, const char *r
 void rmCleanupTsk(UArg arg0, UArg arg1)
 {
     int32_t result;
+    int32_t finalMallocFree;    
     
     /* Delete the RM test tasks */
-    System_printf("Core %d: Deleting RM startup task...\n", coreNum);
+    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 */
@@ -203,7 +306,7 @@ void rmCleanupTsk(UArg arg0, UArg arg1)
     
     if (coreNum == SYSINIT) {
         if (rmServerTskHandle) {
-            System_printf("Core %d: Deleting RM server task...\n", coreNum);
+            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;
@@ -211,7 +314,7 @@ void rmCleanupTsk(UArg arg0, UArg arg1)
     }
     else {
         if (rmClientTskHandle) {
-            System_printf("Core %d: Deleting RM client task...\n", coreNum);        
+            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;
@@ -220,11 +323,65 @@ void rmCleanupTsk(UArg arg0, UArg arg1)
 
     /* Cleanup all service ports, transport handles, RM instances, and IPC constructs */
     if (coreNum == SYSINIT) {
-        Rm_serviceCloseHandle(rmSharedServiceHandle);
+        result = Rm_serviceCloseHandle(rmSharedServerServiceHandle);
+        ERROR_CHECK(RM_OK, result, rmServerName, "Service handle close failed");
 
         result = Rm_delete(rmSharedHandle.sharedServerHandle, RM_TEST_TRUE);
-        ERROR_CHECK(RM_OK, result, rmServerName, "Instance deletion failed");       
+        ERROR_CHECK(RM_OK, result, rmServerName, "Instance delete failed");
+
+        /* Wait for remote core to verify it has deleted its Shared Clients */
+        clientKey = GateMP_enter(clientGate);
+
+        /* Only need to check for memory leaks from one Shared Server core since instance
+         * was shared amongst all test cores */
+        Osal_rmBeginMemAccess(rmMallocCounter, 128);
+        Osal_rmBeginMemAccess(rmFreeCounter, 128);
+
+        System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
+        System_printf ("Core %d : ------------------ Memory Leak Check --------------------\n", coreNum);
+        System_printf ("Core %d : -                       : malloc count   |   free count -\n", coreNum);
+        System_printf ("Core %d : - Example Completion    :  %6d        |  %6d      -\n", coreNum,
+                       rmMallocCounter[0], rmFreeCounter[0]);
+        finalMallocFree = rmMallocCounter[0] - rmFreeCounter[0]; 
+        if (finalMallocFree > 0) {
+            System_printf ("Core %d : - FAILED - %6d unfreed mallocs                       -\n",
+                           coreNum, finalMallocFree);
+            testErrors++;
+        }
+        else if (finalMallocFree < 0) {
+            System_printf ("Core %d : - FAILED - %6d more frees than mallocs               -\n",
+                           coreNum, -finalMallocFree);
+            testErrors++;
+        }
+        else {
+            System_printf ("Core %d : - PASSED                                                -\n",
+                           coreNum);
+        }
+        System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
+        System_printf ("\n");           
     }
+    else {
+        result = Rm_serviceCloseHandle(rmSharedClient1ServiceHandle);
+        ERROR_CHECK(RM_OK, result, rmSharedClient1Handle, "Service handle close failed");
+        result = Rm_serviceCloseHandle(rmSharedClient2ServiceHandle);
+        ERROR_CHECK(RM_OK, result, rmSharedClient2Handle, "Service handle close failed");
+        
+        result = Rm_delete(rmSharedClient1Handle, RM_TEST_TRUE);
+        ERROR_CHECK(RM_OK, result, rmSharedClient1Name, "Instance delete failed");
+        result = Rm_delete(rmSharedClient2Handle, RM_TEST_TRUE);
+        ERROR_CHECK(RM_OK, result, rmSharedClient2Name, "Instance delete failed");
+
+        /* Signal to Shared Server core that the Shared Clients have been deleted */
+        GateMP_leave(clientGate, clientKey);
+    }
+
+    System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
+    System_printf ("Core %d : ------------------ Example Completion -------------------\n", coreNum);
+    if (testErrors) {
+        System_printf ("Core %d : - Test Errors: %-32d         -\n", coreNum, testErrors);
+    }
+    System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
+    System_printf ("\n"); 
 
     BIOS_exit(0);
 }
@@ -235,263 +392,159 @@ void rmServerTsk(UArg arg0, UArg arg1)
     Rm_ServiceRespInfo responseInfo;
     Task_Params        taskParams;
 
-    Rm_instanceStatus(rmSharedHandle.sharedServerHandle);
-
     /* BEGIN testing UNSPECIFIED base and alignment requests on Server */               
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 1, 0, NULL, RM_TEST_TRUE, &responseInfo);       
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }    
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    POSITIVE_PASS_CHECK("---------- Use Allocation w/ UNSPECIFIED Base -----------", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);    
                
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 1, RM_RESOURCE_ALIGNMENT_UNSPECIFIED, NULL, RM_TEST_TRUE, &responseInfo);     
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);  
+    POSITIVE_PASS_CHECK("---- Use Allocation w/ UNSPECIFIED Base & Alignment -----", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        RM_RESOURCE_ALIGNMENT_UNSPECIFIED, responseInfo.serviceState, RM_SERVICE_APPROVED);      
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 1, 200, NULL, RM_TEST_TRUE, &responseInfo);     
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }      
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    POSITIVE_PASS_CHECK("---------- Use Allocation w/ UNSPECIFIED Base -----------", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);        
     /* 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, RM_TEST_TRUE, &responseInfo);     
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo); 
+    POSITIVE_PASS_CHECK("--------------- Create NameServer Object ----------------", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        requestInfo.resourceBase, responseInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     /* 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);
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    GateMP_leave(clientGate, clientKey);
+    serverKey = GateMP_enter(serverGate);
 
     /* 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, RM_TEST_TRUE, &responseInfo);     
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("FAILED : expected denial or error\n");
-    }    
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo); 
+    NEGATIVE_PASS_CHECK("------- Use Allocation of Resource Owned by Linux -------", 
+                        coreNum, rmServerName, resourceNameMemRegion,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);       
 
     /* 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, RM_TEST_TRUE, &responseInfo);       
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    } 
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    POSITIVE_PASS_CHECK("- Resource Node Expand/Contract Testing (Use Allocate) --", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);       
     
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAifRxCh, 
                  19, 31, 0, NULL, RM_TEST_TRUE, &responseInfo);      
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }        
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    POSITIVE_PASS_CHECK("- Resource Node Expand/Contract Testing (Use Allocate) --", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     
     /* Wait for Client and Client Delegate to do their allocations */
-    gateKey = GateMP_enter(gateHandle);
-    GateMP_leave(gateHandle, gateKey);       
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    GateMP_leave(clientGate, clientKey);
+    serverKey = GateMP_enter(serverGate);      
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, resourceNameAifRxCh, 
                  25, 3, 0, NULL, RM_TEST_TRUE, &responseInfo);      
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }      
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);  
+    POSITIVE_PASS_CHECK("----- Resource Node Expand/Contract Testing (Free) ------", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     
     setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, resourceNameAifRxCh, 
                  34, 3, 0, NULL, RM_TEST_TRUE, &responseInfo);      
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }      
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    POSITIVE_PASS_CHECK("----- Resource Node Expand/Contract Testing (Free) ------", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);      
  
     setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, resourceNameAifRxCh, 
                  28, 6, 0, NULL, RM_TEST_TRUE, &responseInfo);      
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }      
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);   
+    POSITIVE_PASS_CHECK("----- Resource Node Expand/Contract Testing (Free) ------", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAifRxCh, 
                  53, 2, 0, NULL, RM_TEST_TRUE, &responseInfo);      
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }  
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);  
+    POSITIVE_PASS_CHECK("----- Resource Node Expand/Contract Testing (Free) ------", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);  
     /* END testing expansion/contraction of resource nodes with the AIF RX CH resource */  
     
     /* Test exclusive rights to an allocated resource */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAifRxCh, 
                  2, 2, 0, NULL, RM_TEST_TRUE, &responseInfo);      
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED : denial or error : %d\n", responseInfo.serviceState);
-    }
-    else {
-        System_printf("FAILED : expected denial or error\n");
-    }      
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    NEGATIVE_PASS_CHECK("------ Use Allocation of Exclusively Owned Resource -----", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);       
 
     /* Wait for Client and Client Delegate to do their UNSPECIFIED allocates */
-    gateKey = GateMP_enter(gateHandle);
-    GateMP_leave(gateHandle, gateKey);
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    GateMP_leave(clientGate, clientKey);
+    serverKey = GateMP_enter(serverGate);
 
     /* 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 */
+     * should be approved but the instance should have only one owner instance in resource's owner list */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameGpQ, 
                  6543, 10, 0, NULL, RM_TEST_TRUE, &responseInfo);      
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);  
+    POSITIVE_PASS_CHECK("-- Init/Use Allocate of Resource from Same Inst (Init) --", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  6543, 10, 0, NULL, RM_TEST_TRUE, &responseInfo);      
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }        
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    POSITIVE_PASS_CHECK("--- Init/Use Allocate of Resource from Same Inst (Use) --", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     /* 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, RM_TEST_TRUE, &responseInfo);     
-    rmSharedServiceHandle->Rm_serviceHandler(rmSharedServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    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("FAILED : expected denial or error\n");
-    }              
+    rmSharedServerServiceHandle->Rm_serviceHandler(rmSharedServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
+    NEGATIVE_PASS_CHECK("- Init Allocation of Shared Linux and Client Resource  --", 
+                        coreNum, rmServerName, resourceNameInfraQ,
+                        805, 1, 0, responseInfo.serviceState, RM_SERVICE_APPROVED);    
 
-    System_printf("Core %d: Testing is complete\n", coreNum);
-
-    Rm_instanceStatus(rmSharedHandle.sharedServerHandle);
-    Rm_resourceStatus(rmSharedHandle.sharedServerHandle, RM_TEST_TRUE);   
+    /* Signal to ClientTsk that Server is ready for cleanup */
+    GateMP_leave(serverGate, serverKey);
     
     /* Create the RM cleanup task. */
-    System_printf("Core %d: Creating RM cleanup task...\n", coreNum);
+    System_printf("Core %d : Creating RM cleanup task...\n", coreNum);
     Task_Params_init (&taskParams);
     Task_create (rmCleanupTsk, &taskParams, NULL);
 }
@@ -502,22 +555,16 @@ void rmClientTsk(UArg arg0, UArg arg1)
     Rm_ServiceRespInfo responseInfo;    
     Task_Params        taskParams;
 
-    Rm_instanceStatus(rmSharedClient1Handle);
-    Rm_instanceStatus(rmSharedClient2Handle);
+    serverKey = GateMP_enter(serverGate);  
 
     /* Retrieve a resource via a NameServer name */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_GET_BY_NAME, NULL, 
                  0, 0, 0, nameServerNameFavQ, RM_TEST_TRUE, &responseInfo);     
     rmSharedClient1ServiceHandle->Rm_serviceHandler(rmSharedClient1ServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    System_printf("Core %d : %s get resource with name %s : ", coreNum,
-                                                               rmSharedClient1Name,
-                                                               nameServerNameFavQ);
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    } 
+    POSITIVE_PASS_CHECK("------- Retrieve Resource Via NameServer Object ---------", 
+                        coreNum, rmSharedClient1Name, responseInfo.resourceName,
+                        responseInfo.resourceBase, responseInfo.resourceLength, 
+                        0, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     /* Allocate the resource returned from the NameServer request */
     memset((void *)&requestInfo, 0, sizeof(Rm_ServiceReqInfo)); 
@@ -527,221 +574,136 @@ void rmClientTsk(UArg arg0, UArg arg1)
     requestInfo.resourceLength = responseInfo.resourceLength;
     requestInfo.resourceNsName = NULL;
     rmSharedClient2ServiceHandle->Rm_serviceHandler(rmSharedClient2ServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    System_printf("Core %d : %s init allocation of %s %d - %d : ", coreNum,
-                                                                   rmSharedClient2Name,
-                                                                   responseInfo.resourceName,
-                                                                   requestInfo.resourceBase, 
-                                                                   (requestInfo.resourceBase + requestInfo.resourceLength - 1));
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }    
+    POSITIVE_PASS_CHECK("-------- Init Allocate Using Retrieved Resource ---------", 
+                        coreNum, rmSharedClient2Name, responseInfo.resourceName,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     /* Free resource via a NameServer name */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, NULL, 
                  0, 0, 0, nameServerNameFavQ, RM_TEST_TRUE, &responseInfo);     
     rmSharedClient2ServiceHandle->Rm_serviceHandler(rmSharedClient2ServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    System_printf("Core %d : %s free resource with name %s : ", coreNum,
-                                                                rmSharedClient2Name,
-                                                                nameServerNameFavQ);
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }      
+    POSITIVE_PASS_CHECK("--- Free of Retrieved Resource Using NameServer Name ----", 
+                        coreNum, rmSharedClient2Name, nameServerNameFavQ,
+                        0, 1, 0, responseInfo.serviceState, RM_SERVICE_APPROVED);      
 
     /* Delete the NameServer name */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_UNMAP_NAME, NULL, 
                  0, 0, 0, nameServerNameFavQ, RM_TEST_TRUE, &responseInfo);     
     rmSharedClient2ServiceHandle->Rm_serviceHandler(rmSharedClient2ServiceHandle->rmHandle, &requestInfo, &responseInfo);     
-    System_printf("Core %d : %s delete name %s : ", coreNum,
-                                                    rmSharedClient2Name,
-                                                    nameServerNameFavQ);
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("--------------- Delete NameServer Object ----------------", 
+                        coreNum, rmSharedClient2Name, nameServerNameFavQ,
+                        0, 1, 0, responseInfo.serviceState, RM_SERVICE_APPROVED);      
 
-    GateMP_leave(gateHandle, gateKey);
-    gateKey = GateMP_enter(gateHandle);
+    GateMP_leave(clientGate, clientKey);
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    serverKey = GateMP_enter(serverGate);    
 
     /* 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, RM_TEST_TRUE, &responseInfo);     
     rmSharedClient2ServiceHandle->Rm_serviceHandler(rmSharedClient2ServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    System_printf("Core %d : %s use allocation of %s %d - %d : ", coreNum,
-                                                                  rmSharedClient2Name,
-                                                                  resourceNameAifRxCh,
-                                                                  requestInfo.resourceBase, 
-                                                                  (requestInfo.resourceBase + requestInfo.resourceLength - 1));
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("- Resource Node Expand/Contract Testing (Use Allocate) --", 
+                        coreNum, rmSharedClient2Name, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameAifRxCh, 
                  50, 7, 0, NULL, RM_TEST_TRUE, &responseInfo);        
     rmSharedClient1ServiceHandle->Rm_serviceHandler(rmSharedClient1ServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    System_printf("Core %d : %s init allocation of %s %d - %d : ", coreNum,
-                                                                   rmSharedClient1Name,
-                                                                   resourceNameAifRxCh,
-                                                                   requestInfo.resourceBase, 
-                                                                   (requestInfo.resourceBase + requestInfo.resourceLength - 1));
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }       
+    POSITIVE_PASS_CHECK("- Resource Node Expand/Contract Testing (Init Allocate) -", 
+                        coreNum, rmSharedClient1Name, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     /* END testing expansion/contraction of resource nodes with the AIF RX CH resource */
 
-    GateMP_leave(gateHandle, gateKey);    
-    gateKey = GateMP_enter(gateHandle);
+    GateMP_leave(clientGate, clientKey);
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    serverKey = GateMP_enter(serverGate);  
 
     /* BEGIN testing allocations with UNSPECIFIED base and alignment values */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAccumCh, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 5, 4, NULL, RM_TEST_TRUE, &responseInfo);        
     rmSharedClient1ServiceHandle->Rm_serviceHandler(rmSharedClient1ServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    System_printf("Core %d : %s use allocation of %s UNSPECIFIED base %d length %d alignment : ", coreNum,
-                                                                                                  rmSharedClient1Name,
-                                                                                                  resourceNameAccumCh,
-                                                                                                  requestInfo.resourceLength, 
-                                                                                                  requestInfo.resourceAlignment);
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }        
+    POSITIVE_PASS_CHECK("---------- Use Allocation w/ UNSPECIFIED Base -----------", 
+                        coreNum, rmSharedClient1Name, resourceNameAccumCh,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);    
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAccumCh, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 2, 1, NULL, RM_TEST_TRUE, &responseInfo);      
     rmSharedClient2ServiceHandle->Rm_serviceHandler(rmSharedClient2ServiceHandle->rmHandle, &requestInfo, &responseInfo); 
-    System_printf("Core %d : %s use allocation of %s UNSPECIFIED base %d length %d alignment : ", coreNum,
-                                                                                                  rmSharedClient2Name,
-                                                                                                  resourceNameAccumCh,
-                                                                                                  requestInfo.resourceLength, 
-                                                                                                  requestInfo.resourceAlignment);
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("---------- Use Allocation w/ UNSPECIFIED Base -----------", 
+                        coreNum, rmSharedClient2Name, resourceNameAccumCh,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAccumCh, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 2, RM_RESOURCE_ALIGNMENT_UNSPECIFIED, NULL, RM_TEST_TRUE, &responseInfo);     
     rmSharedClient2ServiceHandle->Rm_serviceHandler(rmSharedClient2ServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    System_printf("Core %d : %s use allocation of %s UNSPECIFIED base %d length UNSPECIFIED alignment : ", coreNum,
-                                                                                                           rmSharedClient2Name,
-                                                                                                           resourceNameAccumCh,
-                                                                                                           requestInfo.resourceLength);
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("---- Use Allocation w/ UNSPECIFIED Base & Alignment -----", 
+                        coreNum, rmSharedClient2Name, resourceNameAccumCh,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        RM_RESOURCE_ALIGNMENT_UNSPECIFIED, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     /* END testing allocations with UNSPECIFIED base and alignment values */    
 
     /* Allocate infrastructure queue shared between Linux kernel and Client */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameInfraQ, 
                  800, 1, 0, NULL, RM_TEST_TRUE, &responseInfo);     
     rmSharedClient2ServiceHandle->Rm_serviceHandler(rmSharedClient2ServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    System_printf("Core %d : %s init allocation of %s %d - %d : ", coreNum,
-                                                                   rmSharedClient2Name,
-                                                                   resourceNameInfraQ,
-                                                                   requestInfo.resourceBase, 
-                                                                   (requestInfo.resourceBase + requestInfo.resourceLength - 1));
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("-- Init Allocation of Shared Linux and Client Resource --", 
+                        coreNum, rmSharedClient2Name, resourceNameInfraQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);      
 
     /* BEGIN Allocating some resources 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, FALSE, &responseInfo);     
     rmSharedClient2ServiceHandle->Rm_serviceHandler(rmSharedClient2ServiceHandle->rmHandle, &requestInfo, &responseInfo);   
-    System_printf("Core %d : %s init allocation (without callback specified) of %s %d - %d : ", coreNum,
-                                                                                                rmSharedClient2Name,
-                                                                                                resourceNameGpQ,
-                                                                                                requestInfo.resourceBase, 
-                                                                                                (requestInfo.resourceBase + requestInfo.resourceLength - 1));
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }   
+    POSITIVE_PASS_CHECK("- Init Allocation (RM Blocked Until Resource Returned) --", 
+                        coreNum, rmSharedClient2Name, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);      
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  7005, 25, 0, NULL, FALSE, &responseInfo);     
     rmSharedClient1ServiceHandle->Rm_serviceHandler(rmSharedClient1ServiceHandle->rmHandle, &requestInfo, &responseInfo);   
-    System_printf("Core %d : %s use allocation (without callback specified) of %s %d - %d : ", coreNum,
-                                                                                               rmSharedClient1Name,
-                                                                                               resourceNameGpQ,
-                                                                                               requestInfo.resourceBase, 
-                                                                                               (requestInfo.resourceBase + requestInfo.resourceLength - 1));
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }
+    POSITIVE_PASS_CHECK("-- Use Allocation (RM Blocked Until Resource Returned) --", 
+                        coreNum, rmSharedClient1Name, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  7010, 5, 0, NULL, FALSE, &responseInfo);     
     rmSharedClient2ServiceHandle->Rm_serviceHandler(rmSharedClient2ServiceHandle->rmHandle, &requestInfo, &responseInfo);   
-    System_printf("Core %d : %s use allocation (without callback specified) of %s %d - %d : ", coreNum,
-                                                                                               rmSharedClient2Name,
-                                                                                               resourceNameGpQ,
-                                                                                               requestInfo.resourceBase, 
-                                                                                               (requestInfo.resourceBase + requestInfo.resourceLength - 1));
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }
+    POSITIVE_PASS_CHECK("-- Use Allocation (RM Blocked Until Resource Returned) --", 
+                        coreNum, rmSharedClient2Name, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
-    /* Init allocation of resource already owned by Client should return approved and the resource should
-     * only be shown as allocated once to the instance in the resource print out */
+    /* Init allocation of resource already owned by Client should return approved and there should only
+     * be one instance of Client in resource's owner list. */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameGpQ, 
                  7011, 1, 0, NULL, FALSE, &responseInfo);     
     rmSharedClient2ServiceHandle->Rm_serviceHandler(rmSharedClient2ServiceHandle->rmHandle, &requestInfo, &responseInfo);   
-    System_printf("Core %d : %s use allocation (without callback specified) of %s %d - %d : ", coreNum,
-                                                                                               rmSharedClient2Name,
-                                                                                               resourceNameGpQ,
-                                                                                               requestInfo.resourceBase, 
-                                                                                               (requestInfo.resourceBase + requestInfo.resourceLength - 1));
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }
+    POSITIVE_PASS_CHECK("----- Use Allocation of Owned Resource (RM Blocked) -----", 
+                        coreNum, rmSharedClient2Name, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     /* END Allocating some resources without providing a callback function.  RM should block and not return until the result
      * is returned by the server. */    
 
-    GateMP_leave(gateHandle, gateKey);  
-
-    System_printf("Core %d: Testing is complete\n", coreNum);
-
-    Rm_instanceStatus(rmSharedClient1Handle);
-    Rm_instanceStatus(rmSharedClient2Handle);
+    GateMP_leave(clientGate, clientKey);
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    /* Enter Server gate one last time to wait for Server to complete testing prior to entering cleanup */
+    serverKey = GateMP_enter(serverGate);  
     
     /* Create the RM cleanup task. */
-    System_printf("Core %d: Creating RM cleanup task...\n", coreNum);
+    System_printf("Core %d : Creating RM cleanup task...\n", coreNum);
     Task_Params_init (&taskParams);
     Task_create (rmCleanupTsk, &taskParams, NULL);
 }
@@ -754,12 +716,35 @@ void rmStartupTsk(UArg arg0, UArg arg1)
 
     if (coreNum == SYSINIT) {
         GateMP_Params_init(&gateParams);
-        gateParams.name = RM_TASK_GATE_NAME;
-        gateHandle = GateMP_create(&gateParams);
+        gateParams.name = RM_SERVER_GATE_NAME;
+        /* Disable local protection since only concerned with sync'ing cores */
+        gateParams.localProtect = GateMP_LocalProtect_NONE;
+        serverGate = GateMP_create(&gateParams);
+
+        serverKey = GateMP_enter(serverGate);  
+
+        do {
+            status = GateMP_open(RM_CLIENT_GATE_NAME, &clientGate);
+            /* 
+             *  Sleep for 1 clock tick to avoid inundating remote processor
+             *  with interrupts if open failed
+             */
+            if (status < 0) { 
+                Task_sleep(1);
+            }
+        } while (status < 0);        
     }
     else {
+        GateMP_Params_init(&gateParams);
+        gateParams.name = RM_CLIENT_GATE_NAME;
+        /* Disable local protection since only concerned with sync'ing cores */
+        gateParams.localProtect = GateMP_LocalProtect_NONE;
+        clientGate = GateMP_create(&gateParams);
+
+        clientKey = GateMP_enter(clientGate); 
+        
         do {
-            status = GateMP_open(RM_TASK_GATE_NAME, &gateHandle);
+            status = GateMP_open(RM_SERVER_GATE_NAME, &serverGate);
             /* 
              *  Sleep for 1 clock tick to avoid inundating remote processor
              *  with interrupts if open failed
@@ -768,19 +753,17 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        /* Take the gate right away to prepare for RM testing */
-        gateKey = GateMP_enter(gateHandle);
     }
  
     /* Create the RM test tasks. */
     if (coreNum == SYSINIT) {
-        System_printf("Core %d: Creating RM server task...\n", coreNum);
+        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 (coreNum) {
-        System_printf("Core %d: Creating RM client task...\n", coreNum);
+        System_printf("Core %d : Creating RM client task...\n", coreNum);
         Task_Params_init (&taskParams);
         taskParams.priority = 1;
         rmClientTskHandle = Task_create (rmClientTsk, &taskParams, NULL);
@@ -801,6 +784,7 @@ int main(Int argc, Char* argv[])
     System_printf ("RM Version : 0x%08x\nVersion String: %s\n", Rm_getVersion(), Rm_getVersionStr());
 
     coreNum = CSL_chipReadReg(CSL_CHIP_DNUM);
+    testErrors = 0;
     
     /* Initialize the heap in shared memory. Using IPC module to do that */ 
     System_printf("Core %d: Starting IPC...\n", coreNum);
@@ -825,7 +809,7 @@ int main(Int argc, Char* argv[])
         ERROR_CHECK(RM_OK, result, rmServerName, "Initialization failed");
 
         /* Open Server service handle */
-        rmSharedServiceHandle = Rm_serviceOpenHandle(rmSharedHandle.sharedServerHandle, &result);
+        rmSharedServerServiceHandle = Rm_serviceOpenHandle(rmSharedHandle.sharedServerHandle, &result);
         ERROR_CHECK(RM_OK, result, rmServerName, "Service handle open failed");
 
         Osal_rmEndMemAccess((void *)&rmSharedHandle, sizeof(Test_SharedRmHandle));
@@ -859,11 +843,11 @@ int main(Int argc, Char* argv[])
     }
 
     /* Create the RM startup task */
-    System_printf("Core %d: Creating RM startup task...\n", coreNum);
+    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", coreNum);
+    System_printf("Core %d : Starting BIOS...\n", coreNum);
     BIOS_start();
 
     return (0);    
index ede1061f63cfe3c49671e1c039d14841524fc266..e66c5c45a3545ee75ed94c7af48f926a0b19f7c9 100644 (file)
@@ -86,8 +86,9 @@
 
 /* RM packet heap name */
 #define RM_PKT_HEAP_NAME             "rmHeapBuf"
-/* Name of GateMP used to synchronize the RM test tasks */
-#define RM_TASK_GATE_NAME            "rmGateMP"
+/* GateMP names used to synchronize the RM test tasks */
+#define RM_SERVER_GATE_NAME          "rmServerGate"
+#define RM_CLIENT_GATE_NAME          "rmClientGate"
 
 /* Application's core 0 registered RM transport indices */
 #define SERVER_TO_CD_MAP_ENTRY       0
 #define ERROR_CHECK(checkVal, resultVal, rmInstName, printMsg)                   \
     if (resultVal != checkVal) {                                                 \
         char errorMsgToPrint[] = printMsg;                                       \
-        System_printf("Error Core %d : %s : ", coreNum, rmInstName);    \
+        System_printf("Error Core %d : %s : ", coreNum, rmInstName);             \
         System_printf("%s with error code : %d\n", errorMsgToPrint, resultVal);  \
+        testErrors++;                                                            \
         System_abort("Test Failure\n");                                          \
     }
 
+#define POSITIVE_PASS_CHECK(title, core, instName, resName, resStart, resLen, align, state, check)  \
+    do {                                                                                            \
+        int32_t start = resStart;                                                                   \
+        int32_t alignment = align;                                                                  \
+        char    titleMsg[] = title;                                                                 \
+        System_printf ("Core %d : ---------------------------------------------------------\n",     \
+                       core);                                                                       \
+        System_printf ("Core %d : %s\n", core, titleMsg);                                           \
+        System_printf ("Core %d : - Instance Name: %-32s       -\n", core, instName);               \
+        System_printf ("Core %d : - Resource Name: %-32s       -\n", core, resName);                \
+        if (start == RM_RESOURCE_BASE_UNSPECIFIED) {                                                \
+            System_printf ("Core %d : - Start:         UNSPECIFIED                            -\n", \
+                           core);                                                                   \
+            System_printf ("Core %d : - Length:        %-16d                       -\n",            \
+                           core, resLen);                                                           \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - Start:         %-16d                       -\n",            \
+                           core, resStart);                                                         \
+            System_printf ("Core %d : - End:           %-16d                       -\n", core,      \
+                           (start + resLen - 1));                                                   \
+        }                                                                                           \
+        if (alignment == RM_RESOURCE_ALIGNMENT_UNSPECIFIED) {                                       \
+            System_printf ("Core %d : - Alignment:     UNSPECIFIED                            -\n", \
+                           core);                                                                   \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - Alignment:     %-16d                       -\n",            \
+                           core, alignment);                                                        \
+        }                                                                                           \
+        System_printf ("Core %d : -                                                       -\n",     \
+                       core);                                                                       \
+        if (state == check) {                                                                       \
+            System_printf ("Core %d : - PASSED                                                -\n", \
+                           core);                                                                   \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - FAILED - Denial: %-6d                               -\n",   \
+                           core, state);                                                            \
+            testErrors++;                                                                           \
+        }                                                                                           \
+        System_printf ("Core %d : ---------------------------------------------------------\n",     \
+                       core);                                                                       \
+        System_printf ("\n");                                                                       \
+    } while(0);
+
+#define NEGATIVE_PASS_CHECK(title, core, instName, resName, resStart, resLen, align, state, check)  \
+    do {                                                                                            \
+        int32_t start = resStart;                                                                   \
+        int32_t alignment = align;                                                                  \
+        char    titleMsg[] = title;                                                                 \
+        System_printf ("Core %d : ---------------------------------------------------------\n",     \
+                       core);                                                                       \
+        System_printf ("Core %d : %s\n", core, titleMsg);                                           \
+        System_printf ("Core %d : - Instance Name: %-32s       -\n", core, instName);               \
+        System_printf ("Core %d : - Resource Name: %-32s       -\n", core, resName);                \
+        if (start == RM_RESOURCE_BASE_UNSPECIFIED) {                                                \
+            System_printf ("Core %d : - Start:         UNSPECIFIED                            -\n", \
+                           core);                                                                   \
+            System_printf ("Core %d : - Length:        %-16d                       -\n",            \
+                           core, resLen);                                                           \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - Start:         %-16d                       -\n",            \
+                           core, resStart);                                                         \
+            System_printf ("Core %d : - End:           %-16d                       -\n", core,      \
+                           (start + resLen - 1));                                                   \
+        }                                                                                           \
+        if (alignment == RM_RESOURCE_ALIGNMENT_UNSPECIFIED) {                                       \
+            System_printf ("Core %d : - Alignment:     UNSPECIFIED                            -\n", \
+                           core);                                                                   \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - Alignment:     %-16d                       -\n",            \
+                           core, alignment);                                                        \
+        }                                                                                           \
+        System_printf ("Core %d : -                                                       -\n",     \
+                       core);                                                                       \
+        if (state != check) {                                                                       \
+            System_printf ("Core %d : - PASSED - Denial: %-6d                               -\n",   \
+                           core, state);                                                            \
+        }                                                                                           \
+        else {                                                                                      \
+            System_printf ("Core %d : - FAILED - Expected Denial                              -\n", \
+                           core);                                                                   \
+            testErrors++;                                                                           \
+        }                                                                                           \
+        System_printf ("Core %d : ---------------------------------------------------------\n",     \
+                       core);                                                                       \
+        System_printf ("\n");                                                                       \
+    } while(0);    
+
 /**********************************************************************
  ********************** RM Test Data Structures ***********************
  **********************************************************************/
@@ -138,6 +232,10 @@ typedef struct {
  ********************** Extern Variables ******************************
  **********************************************************************/
 
+/* Alloc and free OSAL variables */
+extern uint32_t rmMallocCounter;
+extern uint32_t rmFreeCounter;
+
 /* RM test Global Resource List (GRL) */
 extern const char rmGRL[];
 /* Example Linux DTB file provided to RM Server for automatic Linux Kernel resource extraction */
@@ -151,8 +249,10 @@ extern const char rmStaticPolicy[];
  ********************** Global Variables ******************************
  **********************************************************************/
 
-/* DSP core number according to IPC */
+/* DSP core number according to DNUM */
 uint16_t            coreNum;
+/* Number of errors that occurred during the test */
+uint16_t            testErrors;
 
 /* Task to configure application transport code for RM */
 Task_Handle         rmStartupTskHandle;
@@ -163,10 +263,12 @@ 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;
+/* GateMPs used to synchronize tests between the two RM test tasks */
+GateMP_Handle       serverGate = NULL;
+GateMP_Handle       clientGate = NULL;
+/* GateMP keys */
+IArg                serverKey;
+IArg                clientKey;
 
 /* Handle for heap that RM packets will be allocated from */
 HeapBufMP_Handle    rmPktHeapHandle = NULL;
@@ -205,7 +307,6 @@ 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];
 
@@ -233,7 +334,8 @@ 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", coreNum);
+        System_printf("Error Core %d : MessageQ_alloc failed to allocate message: %d\n", coreNum);
+        testErrors++;
         *pktHandle = NULL;
         return(NULL);
     }
@@ -258,7 +360,8 @@ 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", coreNum);
+        System_printf("Error Core %d : MessageQ_free failed to free message: %d\n", coreNum, status);
+        testErrors++;
     }     
 }
 
@@ -275,8 +378,8 @@ 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", coreNum,
-                                                                                                 status);
+        System_printf("Error Core %d : MessageQ_put failed to send message: %d\n", coreNum, status);
+        testErrors++;
     }
     return (status);
 }
@@ -297,11 +400,9 @@ void transportReceive (uint32_t transportMapEntry)
     /* Process all available packets */
     for (i = 0; i < numPkts; i++) {
         status = (int32_t) MessageQ_get(receiveQ, &rmMsg, MessageQ_FOREVER);
-        if (status < 0) {
-            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", coreNum);
+            System_printf("Error Core %d : MessageQ_get failed, returning a NULL packet\n", coreNum);
+            testErrors++;
         }
 
         /* Extract the Rm_Packet from the RM msg */
@@ -310,7 +411,8 @@ 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", coreNum, status);
+            System_printf("Error Core %d : RM failed to process received packet: %d\n", coreNum, status);
+            testErrors++;
         }
 
         /* Free RM packet buffer and messageQ message */
@@ -374,9 +476,10 @@ void setRmRequest(Rm_ServiceReqInfo *reqInfo, Rm_ServiceType type, const char *r
 void rmCleanupTsk(UArg arg0, UArg arg1)
 {
     int32_t result;
+    int32_t finalMallocFree;    
     
     /* Delete the RM test tasks */
-    System_printf("Core %d: Deleting RM startup task...\n", coreNum);
+    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 */
@@ -385,7 +488,7 @@ void rmCleanupTsk(UArg arg0, UArg arg1)
     
     if (coreNum == SYSINIT) {
         if (rmServerTskHandle) {
-            System_printf("Core %d: Deleting RM server task...\n", coreNum);
+            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;
@@ -393,7 +496,7 @@ void rmCleanupTsk(UArg arg0, UArg arg1)
     }
     else {
         if (rmClientTskHandle) {
-            System_printf("Core %d: Deleting RM client task...\n", coreNum);        
+            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;
@@ -401,7 +504,7 @@ void rmCleanupTsk(UArg arg0, UArg arg1)
     }
     
     /* Delete the RM receive task */
-    System_printf("Core %d: Deleting RM receive task...\n", coreNum);
+    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 */
@@ -410,32 +513,64 @@ void rmCleanupTsk(UArg arg0, UArg arg1)
 
     /* Cleanup all service ports, transport handles, RM instances, and IPC constructs */
     if (coreNum == SYSINIT) {
-        Rm_serviceCloseHandle(rmServerServiceHandle);
+        result = Rm_serviceCloseHandle(rmServerServiceHandle);
+        ERROR_CHECK(RM_OK, result, rmServerName, "Service handle close failed");
 
-        Rm_transportUnregister(rmTransportMap[SERVER_TO_CD_MAP_ENTRY].transportHandle);
+        result = Rm_transportUnregister(rmTransportMap[SERVER_TO_CD_MAP_ENTRY].transportHandle);
+        ERROR_CHECK(RM_OK, result, rmServerName, "Unregister of CD transport failed");
 
-        result = Rm_delete(rmServerHandle, RM_TEST_TRUE);
-        if (result != RM_OK) {
-            System_printf("Core %d: RM server instance delete failed with error %d\n", coreNum, result);
-        }        
+        result = Rm_delete(rmServerHandle, RM_TEST_TRUE);  
+        ERROR_CHECK(RM_OK, result, rmServerName, "Instance delete failed");
     }
     else {
-        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_serviceCloseHandle(rmCdServiceHandle);
+        ERROR_CHECK(RM_OK, result, rmCdName, "Service handle close failed");
+        result = Rm_serviceCloseHandle(rmClientServiceHandle);
+        ERROR_CHECK(RM_OK, result, rmClientName, "Service handle close failed");
+
+        result = Rm_transportUnregister(rmTransportMap[CD_TO_SERVER_MAP_ENTRY].transportHandle);
+        ERROR_CHECK(RM_OK, result, rmCdName, "Unregister of Server transport failed");
+        result = Rm_transportUnregister(rmTransportMap[CD_TO_CLIENT_MAP_ENTRY].transportHandle);
+        ERROR_CHECK(RM_OK, result, rmCdName, "Unregister of Client transport failed");
+        result = Rm_transportUnregister(rmTransportMap[CLIENT_TO_CD_MAP_ENTRY].transportHandle);
+        ERROR_CHECK(RM_OK, result, rmClientName, "Unregister of CD transport failed");
 
         result = Rm_delete(rmCdHandle, RM_TEST_TRUE);
-        if (result != RM_OK) {
-            System_printf("Core %d: RM cd instance delete failed with error %d\n", coreNum, result);
-        }  
+        ERROR_CHECK(RM_OK, result, rmCdName, "Instance delete failed");  
         result = Rm_delete(rmClientHandle, RM_TEST_TRUE);
-        if (result != RM_OK) {
-            System_printf("Core %d: RM client instance delete failed with error %d\n", coreNum, result);
-        }          
+        ERROR_CHECK(RM_OK, result, rmClientName, "Instance delete failed");         
+    }
+
+    System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
+    System_printf ("Core %d : ------------------ Memory Leak Check --------------------\n", coreNum);
+    System_printf ("Core %d : -                       : malloc count   |   free count -\n", coreNum);
+    System_printf ("Core %d : - Example Completion    :  %6d        |  %6d      -\n", coreNum,
+                   rmMallocCounter, rmFreeCounter);
+    finalMallocFree = rmMallocCounter - rmFreeCounter; 
+    if (finalMallocFree > 0) {
+        System_printf ("Core %d : - FAILED - %6d unfreed mallocs                       -\n",
+                       coreNum, finalMallocFree);
+        testErrors++;
     }
+    else if (finalMallocFree < 0) {
+        System_printf ("Core %d : - FAILED - %6d more frees than mallocs               -\n",
+                       coreNum, -finalMallocFree);
+        testErrors++;
+    }
+    else {
+        System_printf ("Core %d : - PASSED                                                -\n",
+                       coreNum);
+    }
+    System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
+    System_printf ("\n");  
+
+    System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
+    System_printf ("Core %d : ------------------ Example Completion -------------------\n", coreNum);
+    if (testErrors) {
+        System_printf ("Core %d : - Test Errors: %-32d         -\n", coreNum, testErrors);
+    }
+    System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
+    System_printf ("\n"); 
 
     BIOS_exit(0);
 }
@@ -463,263 +598,159 @@ void rmServerTsk(UArg arg0, UArg arg1)
     Rm_ServiceRespInfo responseInfo;
     Task_Params        taskParams;
 
-    Rm_instanceStatus(rmServerHandle);
-
     /* BEGIN testing UNSPECIFIED base and alignment requests on Server */               
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 1, 0, NULL, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }    
+    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);                 
+    POSITIVE_PASS_CHECK("---------- Use Allocation w/ UNSPECIFIED Base -----------", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);    
                
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 1, RM_RESOURCE_ALIGNMENT_UNSPECIFIED, NULL, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("---- Use Allocation w/ UNSPECIFIED Base & Alignment -----", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        RM_RESOURCE_ALIGNMENT_UNSPECIFIED, responseInfo.serviceState, RM_SERVICE_APPROVED);      
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 1, 200, NULL, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }      
+    POSITIVE_PASS_CHECK("---------- Use Allocation w/ UNSPECIFIED Base -----------", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);        
     /* 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, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("--------------- Create NameServer Object ----------------", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        requestInfo.resourceBase, responseInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     /* 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);
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    GateMP_leave(clientGate, clientKey);
+    serverKey = GateMP_enter(serverGate);
 
     /* 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, RM_TEST_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("FAILED : expected denial or error\n");
-    }    
+    NEGATIVE_PASS_CHECK("------- Use Allocation of Resource Owned by Linux -------", 
+                        coreNum, rmServerName, resourceNameMemRegion,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);       
 
     /* 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, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    } 
+    POSITIVE_PASS_CHECK("- Resource Node Expand/Contract Testing (Use Allocate) --", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);       
     
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAifRxCh, 
                  19, 31, 0, NULL, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }        
+    rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo); 
+    POSITIVE_PASS_CHECK("- Resource Node Expand/Contract Testing (Use Allocate) --", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     
     /* Wait for Client and Client Delegate to do their allocations */
-    gateKey = GateMP_enter(gateHandle);
-    GateMP_leave(gateHandle, gateKey);       
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    GateMP_leave(clientGate, clientKey);
+    serverKey = GateMP_enter(serverGate);      
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, resourceNameAifRxCh, 
                  25, 3, 0, NULL, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }      
+    POSITIVE_PASS_CHECK("----- Resource Node Expand/Contract Testing (Free) ------", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     
     setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, resourceNameAifRxCh, 
                  34, 3, 0, NULL, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }      
+    POSITIVE_PASS_CHECK("----- Resource Node Expand/Contract Testing (Free) ------", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);      
  
     setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, resourceNameAifRxCh, 
                  28, 6, 0, NULL, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }      
+    POSITIVE_PASS_CHECK("----- Resource Node Expand/Contract Testing (Free) ------", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAifRxCh, 
                  53, 2, 0, NULL, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }  
+    POSITIVE_PASS_CHECK("----- Resource Node Expand/Contract Testing (Free) ------", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);  
     /* END testing expansion/contraction of resource nodes with the AIF RX CH resource */  
     
     /* Test exclusive rights to an allocated resource */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAifRxCh, 
                  2, 2, 0, NULL, RM_TEST_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("PASSED : denial or error : %d\n", responseInfo.serviceState);
-    }
-    else {
-        System_printf("FAILED : expected denial or error\n");
-    }      
+    NEGATIVE_PASS_CHECK("------ Use Allocation of Exclusively Owned Resource -----", 
+                        coreNum, rmServerName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);       
 
     /* Wait for Client and Client Delegate to do their UNSPECIFIED allocates */
-    gateKey = GateMP_enter(gateHandle);
-    GateMP_leave(gateHandle, gateKey);
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    GateMP_leave(clientGate, clientKey);
+    serverKey = GateMP_enter(serverGate);
 
     /* 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 */
+     * should be approved but the instance should have only one owner instance in resource's owner list */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameGpQ, 
                  6543, 10, 0, NULL, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("-- Init/Use Allocate of Resource from Same Inst (Init) --", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  6543, 10, 0, NULL, RM_TEST_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("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }        
+    POSITIVE_PASS_CHECK("--- Init/Use Allocate of Resource from Same Inst (Use) --", 
+                        coreNum, rmServerName, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     /* 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, RM_TEST_TRUE, &responseInfo);     
     rmServerServiceHandle->Rm_serviceHandler(rmServerServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    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("FAILED : expected denial or error\n");
-    }              
+    NEGATIVE_PASS_CHECK("- Init Allocation of Shared Linux and Client Resource  --", 
+                        coreNum, rmServerName, resourceNameInfraQ,
+                        805, 1, 0, responseInfo.serviceState, RM_SERVICE_APPROVED);    
 
-    System_printf("Core %d: Testing is complete\n", coreNum);
-
-    Rm_instanceStatus(rmServerHandle);
-    Rm_resourceStatus(rmServerHandle, RM_TEST_TRUE);   
+    /* Signal to ClientTsk that Server is ready for cleanup */
+    GateMP_leave(serverGate, serverKey);
     
     /* Create the RM cleanup task. */
-    System_printf("Core %d: Creating RM cleanup task...\n", coreNum);
+    System_printf("Core %d : Creating RM cleanup task...\n", coreNum);
     Task_Params_init (&taskParams);
     Task_create (rmCleanupTsk, &taskParams, NULL);
 }
@@ -731,25 +762,19 @@ void rmClientTsk(UArg arg0, UArg arg1)
     Task_Params        taskParams;
     uint32_t           i, j;
 
-    Rm_instanceStatus(rmCdHandle);
-    Rm_instanceStatus(rmClientHandle);
+    serverKey = GateMP_enter(serverGate);  
 
     /* Retrieve a resource via a NameServer name */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_GET_BY_NAME, NULL, 
                  0, 0, 0, nameServerNameFavQ, RM_TEST_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("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    } 
+    POSITIVE_PASS_CHECK("------- Retrieve Resource Via NameServer Object ---------", 
+                        coreNum, rmCdName, responseInfo.resourceName,
+                        responseInfo.resourceBase, responseInfo.resourceLength, 
+                        0, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     /* Allocate the resource returned from the NameServer request */
     memset((void *)&requestInfo, 0, sizeof(Rm_ServiceReqInfo)); 
@@ -760,240 +785,155 @@ void rmClientTsk(UArg arg0, UArg arg1)
     requestInfo.resourceNsName = NULL;
     requestInfo.callback.serviceCallback = serviceCallback;     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    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("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }    
+    } 
+    POSITIVE_PASS_CHECK("-------- Init Allocate Using Retrieved Resource ---------", 
+                        coreNum, rmClientName, responseInfo.resourceName,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     /* Free resource via a NameServer name */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_FREE, NULL, 
                  0, 0, 0, nameServerNameFavQ, RM_TEST_TRUE, &responseInfo);     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    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("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }      
+    POSITIVE_PASS_CHECK("--- Free of Retrieved Resource Using NameServer Name ----", 
+                        coreNum, rmClientName, nameServerNameFavQ,
+                        0, 1, 0, responseInfo.serviceState, RM_SERVICE_APPROVED);      
 
     /* Delete the NameServer name */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_UNMAP_NAME, NULL, 
                  0, 0, 0, nameServerNameFavQ, RM_TEST_TRUE, &responseInfo);     
-    rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);     
-    System_printf("Core %d : %s delete name %s : ", coreNum,
-                                                    rmClientName,
-                                                    nameServerNameFavQ);
+    rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
     if (responseInfo.serviceState == RM_SERVICE_PROCESSING) {
         waitForResponse(&responseInfo);
     }
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("--------------- Delete NameServer Object ----------------", 
+                        coreNum, rmClientName, nameServerNameFavQ,
+                        0, 1, 0, responseInfo.serviceState, RM_SERVICE_APPROVED);      
 
-    GateMP_leave(gateHandle, gateKey);
-    gateKey = GateMP_enter(gateHandle);
+    GateMP_leave(clientGate, clientKey);
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    serverKey = GateMP_enter(serverGate);    
 
     /* 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, RM_TEST_TRUE, &responseInfo);     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    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("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    }    
+    POSITIVE_PASS_CHECK("- Resource Node Expand/Contract Testing (Use Allocate) --", 
+                        coreNum, rmClientName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameAifRxCh, 
                  50, 7, 0, NULL, RM_TEST_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("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }       
+    }    
+    POSITIVE_PASS_CHECK("- Resource Node Expand/Contract Testing (Init Allocate) -", 
+                        coreNum, rmCdName, resourceNameAifRxCh,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     /* END testing expansion/contraction of resource nodes with the AIF RX CH resource */
 
-    GateMP_leave(gateHandle, gateKey);    
-    gateKey = GateMP_enter(gateHandle);
+    GateMP_leave(clientGate, clientKey);
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    serverKey = GateMP_enter(serverGate);  
+
 
     /* BEGIN testing allocations with UNSPECIFIED base and alignment values */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAccumCh, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 5, 4, NULL, RM_TEST_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("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }        
+    } 
+    POSITIVE_PASS_CHECK("---------- Use Allocation w/ UNSPECIFIED Base -----------", 
+                        coreNum, rmCdName, resourceNameAccumCh,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);    
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAccumCh, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 2, 1, NULL, RM_TEST_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("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("---------- Use Allocation w/ UNSPECIFIED Base -----------", 
+                        coreNum, rmClientName, resourceNameAccumCh,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameAccumCh, 
                  RM_RESOURCE_BASE_UNSPECIFIED, 2, RM_RESOURCE_ALIGNMENT_UNSPECIFIED, NULL, RM_TEST_TRUE, &responseInfo);     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    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("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("---- Use Allocation w/ UNSPECIFIED Base & Alignment -----", 
+                        coreNum, rmClientName, resourceNameAccumCh,
+                        RM_RESOURCE_BASE_UNSPECIFIED, requestInfo.resourceLength, 
+                        RM_RESOURCE_ALIGNMENT_UNSPECIFIED, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     /* END testing allocations with UNSPECIFIED base and alignment values */    
 
     /* Allocate infrastructure queue shared between Linux kernel and Client */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameInfraQ, 
                  800, 1, 0, NULL, RM_TEST_TRUE, &responseInfo);     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);
-    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("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }     
+    POSITIVE_PASS_CHECK("-- Init Allocation of Shared Linux and Client Resource --", 
+                        coreNum, rmClientName, resourceNameInfraQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);      
 
     /* BEGIN Allocating some resources 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, FALSE, &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_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }   
+    POSITIVE_PASS_CHECK("- Init Allocation (RM Blocked Until Resource Returned) --", 
+                        coreNum, rmClientName, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);      
 
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  7005, 25, 0, NULL, FALSE, &responseInfo);     
     rmCdServiceHandle->Rm_serviceHandler(rmCdServiceHandle->rmHandle, &requestInfo, &responseInfo);   
-    System_printf("Core %d : %s use allocation (without callback specified) of %s %d - %d : ", coreNum,
-                                                                                               rmCdName,
-                                                                                               resourceNameGpQ,
-                                                                                               requestInfo.resourceBase, 
-                                                                                               (requestInfo.resourceBase + requestInfo.resourceLength - 1));
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }
+    POSITIVE_PASS_CHECK("-- Use Allocation (RM Blocked Until Resource Returned) --", 
+                        coreNum, rmCdName, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
     
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_USE, resourceNameGpQ, 
                  7010, 5, 0, NULL, FALSE, &responseInfo);     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);   
-    System_printf("Core %d : %s use allocation (without callback specified) of %s %d - %d : ", coreNum,
-                                                                                               rmClientName,
-                                                                                               resourceNameGpQ,
-                                                                                               requestInfo.resourceBase, 
-                                                                                               (requestInfo.resourceBase + requestInfo.resourceLength - 1));
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }
+    POSITIVE_PASS_CHECK("-- Use Allocation (RM Blocked Until Resource Returned) --", 
+                        coreNum, rmClientName, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
 
-    /* Init allocation of resource already owned by Client should return approved and the resource should
-     * only be shown as allocated once to the instance in the resource print out */
+    /* Init allocation of resource already owned by Client should return approved and there should only
+     * be one instance of Client in resource's owner list. */
     setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameGpQ, 
                  7011, 1, 0, NULL, FALSE, &responseInfo);     
     rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo);   
-    System_printf("Core %d : %s use allocation (without callback specified) of %s %d - %d : ", coreNum,
-                                                                                               rmClientName,
-                                                                                               resourceNameGpQ,
-                                                                                               requestInfo.resourceBase, 
-                                                                                               (requestInfo.resourceBase + requestInfo.resourceLength - 1));
-    if (responseInfo.serviceState == RM_SERVICE_APPROVED) {
-        System_printf("PASSED\n");
-    }
-    else {
-        System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-    }
-    /* END Allocating some resources without providing a callback function.  RM should block and not return until the result
-     * is returned by the server. */    
-
-    GateMP_leave(gateHandle, gateKey);           
+    POSITIVE_PASS_CHECK("----- Use Allocation of Owned Resource (RM Blocked) -----", 
+                        coreNum, rmClientName, resourceNameGpQ,
+                        requestInfo.resourceBase, requestInfo.resourceLength, 
+                        requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED);     
+    /* END Allocating some resources without providing a callback function.  RM should block and not return
+     * until the result is returned by the server. */            
 
     /* 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. */
@@ -1003,17 +943,12 @@ void rmClientTsk(UArg arg0, UArg arg1)
             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);
-                        }  
+                        (staticResponseQueue[i].rmHandle == responseInfoQueue[j].rmHandle)) {                   
+                        POSITIVE_PASS_CHECK("------------- Static Allocation Validation --------------", 
+                                            coreNum, rmClientName, responseInfoQueue[j].resourceName,
+                                            responseInfoQueue[j].resourceBase, responseInfoQueue[j].resourceLength, 
+                                            0, responseInfoQueue[j].serviceState, 
+                                            RM_SERVICE_APPROVED); 
                         memset((void *)&staticResponseQueue[i], 0, sizeof(Rm_ServiceRespInfo));
                         memset((void *)&responseInfoQueue[j], 0, sizeof(Rm_ServiceRespInfo));
                         numStaticResponses--;                        
@@ -1022,16 +957,16 @@ void rmClientTsk(UArg arg0, UArg arg1)
                 }
             }
         }    
-    }   
-
-
-    System_printf("Core %d: Testing is complete\n", coreNum);
+    }  
 
-    Rm_instanceStatus(rmCdHandle);
-    Rm_instanceStatus(rmClientHandle);
+    GateMP_leave(clientGate, clientKey);
+    GateMP_leave(serverGate, serverKey);
+    clientKey = GateMP_enter(clientGate);
+    /* Enter Server gate one last time to wait for Server to complete testing prior to entering cleanup */
+    serverKey = GateMP_enter(serverGate);  
     
     /* Create the RM cleanup task. */
-    System_printf("Core %d: Creating RM cleanup task...\n", coreNum);
+    System_printf("Core %d : Creating RM cleanup task...\n", coreNum);
     Task_Params_init (&taskParams);
     Task_create (rmCleanupTsk, &taskParams, NULL);
 }
@@ -1056,8 +991,23 @@ void rmStartupTsk(UArg arg0, UArg arg1)
 
     if (coreNum == SYSINIT) {
         GateMP_Params_init(&gateParams);
-        gateParams.name = RM_TASK_GATE_NAME;
-        gateHandle = GateMP_create(&gateParams);
+        gateParams.name = RM_SERVER_GATE_NAME;
+        /* Disable local protection since only concerned with sync'ing cores */
+        gateParams.localProtect = GateMP_LocalProtect_NONE;
+        serverGate = GateMP_create(&gateParams);
+
+        serverKey = GateMP_enter(serverGate);  
+
+        do {
+            status = GateMP_open(RM_CLIENT_GATE_NAME, &clientGate);
+            /* 
+             *  Sleep for 1 clock tick to avoid inundating remote processor
+             *  with interrupts if open failed
+             */
+            if (status < 0) { 
+                Task_sleep(1);
+            }
+        } while (status < 0);        
         
         /* Create the heap that will be used to allocate RM messages. This
          * heap is a multi-processor heap.  It will be shared amongst
@@ -1069,9 +1019,10 @@ void rmStartupTsk(UArg arg0, UArg arg1)
         heapBufParams.blockSize      = sizeof(Rm_Packet);
         rmPktHeapHandle = HeapBufMP_create(&heapBufParams);
         if (rmPktHeapHandle == NULL) {
-            System_abort("HeapBufMP_create failed for RM packet heap\n" );
+            System_printf("Error Core %d : Failed to create RM packet heap\n", coreNum);
+            testErrors++;
         }
-        System_printf("Core %d: RM packet heap created\n", coreNum);
+        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);
@@ -1081,13 +1032,22 @@ void rmStartupTsk(UArg arg0, UArg arg1)
         heapBufParams.blockSize      = sizeof(MsgQ_RmPacket);
         msgQHeapHandle = HeapBufMP_create(&heapBufParams);
         if (msgQHeapHandle == NULL) {
-            System_abort("HeapBufMP_create failed MessageQ message heap\n" );
+            System_printf("Error Core %d : Failed to create HeapBufMP MessageQ heap\n", coreNum);
+            testErrors++;
         } 
-        System_printf("Core %d: IPC MessageQ message heap created\n", coreNum);
+        System_printf("Core %d : IPC MessageQ message heap created\n", coreNum);
     }
     else {
+        GateMP_Params_init(&gateParams);
+        gateParams.name = RM_CLIENT_GATE_NAME;
+        /* Disable local protection since only concerned with sync'ing cores */
+        gateParams.localProtect = GateMP_LocalProtect_NONE;
+        clientGate = GateMP_create(&gateParams);
+
+        clientKey = GateMP_enter(clientGate); 
+        
         do {
-            status = GateMP_open(RM_TASK_GATE_NAME, &gateHandle);
+            status = GateMP_open(RM_SERVER_GATE_NAME, &serverGate);
             /* 
              *  Sleep for 1 clock tick to avoid inundating remote processor
              *  with interrupts if open failed
@@ -1096,8 +1056,6 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        /* Take the gate right away to prepare for RM testing */
-        gateKey = GateMP_enter(gateHandle);
         
         /* Open the heaps created by the other processor. Loop until opened. */
         do {
@@ -1110,7 +1068,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        System_printf("Core %d: RM packet heap opened\n", coreNum);
+        System_printf("Core %d : RM packet heap opened\n", coreNum);
         
         do {
             status = HeapBufMP_open(MSGQ_HEAP_NAME, &msgQHeapHandle);
@@ -1122,7 +1080,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        System_printf("Core %d: IPC MessageQ message heap opened\n", coreNum);
+        System_printf("Core %d : IPC MessageQ message heap opened\n", coreNum);
     }
     
     /* Register the MessageQ heap with MessageQ */
@@ -1137,29 +1095,32 @@ void rmStartupTsk(UArg arg0, UArg arg1)
     if (coreNum == SYSINIT) {
         serverFromCdMsgQ = MessageQ_create(serverFromCdQueueName, NULL);
         if (serverFromCdMsgQ == NULL) {
-            System_abort("MessageQ_create failed for RM Server - Client Delegate queue\n" );
+            System_printf("Error Core %d : Failed to create Server's receive Q for CD\n", coreNum);
+            testErrors++;
         }
-        System_printf("Core %d: RM Server MessageQ created for receiving packets from RM CD\n", coreNum);
+        System_printf("Core %d : Created Server receive Q for CD\n", coreNum);
     }
     else {
         cdFromServerMsgQ = MessageQ_create(cdFromServerQueueName, NULL);
         if (cdFromServerMsgQ == NULL) {
-            System_abort("MessageQ_create failed for RM Client Delegate - Server queue\n" );
+            System_printf("Error Core %d : Failed to create CD's receive Q for Server\n", coreNum);
+            testErrors++;
         }
-        System_printf("Core %d: RM CD MessageQ created for receiving packets from RM Server\n", coreNum);
+        System_printf("Core %d : Created CD receive Q for 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("Error Core %d : Failed to create CD's receive Q for Client\n", coreNum);
+            testErrors++;
         } 
-        System_printf("Core %d: RM CD MessageQ created for receiving packets from RM Client\n", coreNum);
+        System_printf("Core %d : Created CD receive Q for Client\n", coreNum);        
         
         clientFromCdMsgQ = MessageQ_create(clientFromCdQueueName, NULL);
-        if (clientFromCdMsgQ == NULL) 
-        {
-            System_abort("MessageQ_create failed for RM Client - Client Delegate queue\n" );
+        if (clientFromCdMsgQ == NULL) {
+            System_printf("Error Core %d : Failed to create Client's receive Q for CD\n", coreNum);
+            testErrors++;
         }
-        System_printf("Core %d: RM Client MessageQ created for receiving packets from RM CD\n", coreNum);
+        System_printf("Core %d : Created Client receive Q for CD\n", coreNum);
     }
     
     /* Open the remote message queues. Also register the RM transports with each RM instance */
@@ -1175,7 +1136,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        System_printf("Core %d: RM CD MessageQ opened from RM Server\n", coreNum);
+        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;
@@ -1189,7 +1150,7 @@ 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", coreNum);
+        System_printf("Core %d : Registered RM Server <=> RM CD transport with RM Server instance\n", coreNum);
     }
     else {
         /* Open the Server messageQ from the Client Delegate */
@@ -1203,7 +1164,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        System_printf("Core %d: RM Server MessageQ opened from RM CD\n", coreNum);
+        System_printf("Core %d : RM Server MessageQ opened from RM CD\n", coreNum);
 
         /* Register the Server with the RM Client Delegate Instance */
         rmTransportCfg.rmHandle = rmCdHandle;
@@ -1217,7 +1178,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", coreNum);
+        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 {
@@ -1230,7 +1191,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", coreNum);
+        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;
@@ -1243,7 +1204,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", coreNum);
+        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 {
@@ -1256,7 +1217,7 @@ void rmStartupTsk(UArg arg0, UArg arg1)
                 Task_sleep(1);
             }
         } while (status < 0);
-        System_printf("Core %d: RM CD MessageQ opened from RM Client\n", coreNum);
+        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;
@@ -1270,26 +1231,26 @@ 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", coreNum);
+        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", coreNum);
+    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 (coreNum == SYSINIT) {
-        System_printf("Core %d: Creating RM server task...\n", coreNum);
+        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 (coreNum) {
-        System_printf("Core %d: Creating RM client task...\n", coreNum);
+        System_printf("Core %d : Creating RM client task...\n", coreNum);
         Task_Params_init (&taskParams);
         taskParams.priority = 1;
         rmClientTskHandle = Task_create (rmClientTsk, &taskParams, NULL);
@@ -1312,6 +1273,7 @@ int main(Int argc, Char* argv[])
     System_printf ("RM Version : 0x%08x\nVersion String: %s\n", Rm_getVersion(), Rm_getVersionStr());
 
     coreNum = CSL_chipReadReg(CSL_CHIP_DNUM);
+    testErrors = 0;
 
     /* Initialize the RM instances - RM must be initialized before anything else in the system
      * Core 0: 1 RM Instance  - RM Server
@@ -1336,7 +1298,7 @@ int main(Int argc, Char* argv[])
         /* Create the RM Client Delegate instance */
         rmInitCfg.instName = rmCdName;
         rmInitCfg.instType = Rm_instType_CLIENT_DELEGATE;
-        rmInitCfg.instCfg.cdCfg.staticPolicy = (void *)rmStaticPolicy;
+        rmInitCfg.instCfg.cdCfg.cdPolicy = (void *)rmStaticPolicy;
         rmCdHandle = Rm_init(&rmInitCfg, &result);
         ERROR_CHECK(RM_OK, result, rmCdName, "Initialization failed");
 
@@ -1364,98 +1326,71 @@ int main(Int argc, Char* argv[])
         /* Static allocation tests */
         setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameQosCluster, 
                      0, 1, 0, NULL, RM_TEST_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));
+        rmCdServiceHandle->Rm_serviceHandler(rmCdServiceHandle->rmHandle, &requestInfo, &responseInfo);               
+        POSITIVE_PASS_CHECK("---------------- Static Init Allocation -----------------", 
+                            coreNum, rmCdName, resourceNameQosCluster,
+                            requestInfo.resourceBase, requestInfo.resourceLength, 
+                            requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED_STATIC);     
         if (responseInfo.serviceState == RM_SERVICE_APPROVED_STATIC) {        
-            System_printf("PASSED\n");
-            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(Rm_ServiceRespInfo));
-        }
-        else {
-            System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
+            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(responseInfo));
         }        
         
         setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameQosCluster, 
                      2, 1, 0, NULL, RM_TEST_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));
+        POSITIVE_PASS_CHECK("---------------- Static Init Allocation -----------------", 
+                            coreNum, rmClientName, resourceNameQosCluster,
+                            requestInfo.resourceBase, requestInfo.resourceLength, 
+                            requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED_STATIC);     
         if (responseInfo.serviceState == RM_SERVICE_APPROVED_STATIC) {        
-            System_printf("PASSED\n");
-            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(Rm_ServiceRespInfo));
-        }
-        else {
-            System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-        }
+            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(responseInfo));
+        }           
 
         /* 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, RM_TEST_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("PASSED : denial or error : %d\n", responseInfo.serviceState);
-        }
-        else {
-            System_printf("FAILED : expected denial or error\n");
-        }
+        NEGATIVE_PASS_CHECK("---------------- Static Init Allocation -----------------", 
+                            coreNum, rmClientName, resourceNameQosCluster,
+                            requestInfo.resourceBase, requestInfo.resourceLength, 
+                            requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED_STATIC);          
 
         /* 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, RM_TEST_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));
+        POSITIVE_PASS_CHECK("---------------- Static Init Allocation -----------------", 
+                            coreNum, rmCdName, resourceNameAifQ,
+                            requestInfo.resourceBase, requestInfo.resourceLength, 
+                            requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED_STATIC);     
         if (responseInfo.serviceState == RM_SERVICE_APPROVED_STATIC) {        
-            System_printf("PASSED\n");
-            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(Rm_ServiceRespInfo));
-        }
-        else {
-            System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-        }
+            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(responseInfo));
+        }           
 
         setRmRequest(&requestInfo, Rm_service_RESOURCE_ALLOCATE_INIT, resourceNameAifQ, 
                      525, 1, 0, NULL, RM_TEST_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));
+        rmClientServiceHandle->Rm_serviceHandler(rmClientServiceHandle->rmHandle, &requestInfo, &responseInfo); 
+        POSITIVE_PASS_CHECK("---------------- Static Init Allocation -----------------", 
+                            coreNum, rmClientName, resourceNameAifQ,
+                            requestInfo.resourceBase, requestInfo.resourceLength, 
+                            requestInfo.resourceAlignment, responseInfo.serviceState, RM_SERVICE_APPROVED_STATIC);     
         if (responseInfo.serviceState == RM_SERVICE_APPROVED_STATIC) {        
-            System_printf("PASSED\n");
-            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(Rm_ServiceRespInfo));
-        }
-        else {
-            System_printf("FAILED : denial or error : %d\n", responseInfo.serviceState);
-        }    
+            memcpy((void *)&staticResponseQueue[numStaticResponses++], (void *)&responseInfo, sizeof(responseInfo));
+        }           
     }
 
-    System_printf("Core %d: Starting IPC...\n", coreNum);
+    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", coreNum);
+    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", coreNum);
+    System_printf("Core %d : Starting BIOS...\n", coreNum);
     BIOS_start();
 
     return (0);