Bug fixes after cleanup of policy module
authorJustin Sobota <jsobota@ti.com>
Thu, 24 Jan 2013 17:04:57 +0000 (12:04 -0500)
committerJustin Sobota <jsobota@ti.com>
Thu, 24 Jan 2013 17:04:57 +0000 (12:04 -0500)
src/rm.c
src/rm_nameserver.c
src/rm_policy.c
test/rm_test.c

index 273c1759364e535d3fc4f21255661f245c03af74..b7ba1871b7bac342e4dd8cb9e887524482357b0d 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
@@ -1926,7 +1926,6 @@ Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result)
     Rm_Inst *rmInst;\r
     void    *globalResourceDtb = NULL;\r
     void    *linuxResourceDtb = NULL;\r
-    void    *policyDtb = NULL;\r
 \r
     *result = RM_INIT_OK;\r
     \r
@@ -1950,20 +1949,19 @@ Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result)
     rmInst->transactionQueue= NULL;\r
 \r
     if ((rmInst->instType != Rm_instType_CLIENT) && initCfg->policy) {\r
-        policyDtb = initCfg->policy;\r
-        fdt_open_into(policyDtb, policyDtb, fdt_totalsize(policyDtb)); \r
+        rmInst->policy = initCfg->policy;\r
+        fdt_open_into(rmInst->policy, rmInst->policy, fdt_totalsize(rmInst->policy)); \r
 \r
         /* Create valid instance list from policy.  Must be done prior to parsing\r
          * GRL so that Linux resources can be reserved correctly */\r
-        rmInst->validInstances = Rm_policyCreateValidInstTree(policyDtb, result);\r
+        rmInst->validInstances = Rm_policyCreateValidInstTree(rmInst->policy, result);\r
         /* Validate policy assignment strings */\r
-        *result = Rm_policyValidatePolicy(rmInst, policyDtb);\r
-        rmInst->policy = policyDtb;\r
+        *result = Rm_policyValidatePolicy(rmInst->policy, rmInst->validInstances);\r
     }\r
 \r
     /* RM Server specific actions */\r
     if (rmInst->instType == Rm_instType_SERVER) {\r
-        Rm_nameServerInit();\r
+        rmInst->nameServer = Rm_nameServerInit();\r
 \r
         if (initCfg->globalResourceList) {\r
             globalResourceDtb = initCfg->globalResourceList;\r
@@ -1978,7 +1976,7 @@ Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result)
     }\r
 \r
     if ((rmInst->instType != Rm_instType_CLIENT) && initCfg->policy) {\r
-        *result = Rm_policyValidatePolicyResourceNames(rmInst, policyDtb);\r
+        *result = Rm_policyValidatePolicyResourceNames(rmInst->policy, (void *)rmInst->allocators);\r
     }    \r
 \r
     return ((Rm_Handle) rmInst);\r
index 14f4469c47de906f71838b01ddef8130f780b6cf..6857af3fa241689b5f2c5cc27922c7d4a9893f4f 100644 (file)
@@ -122,7 +122,7 @@ int32_t Rm_nameServerFindObject(Rm_NameServerObjCfg *objCfg)
     
     if (matchingNode = RB_FIND(_Rm_NameServerTree, objCfg->nameServerTree, &findNode)) {
         /* Found in NameServer */
-        strcpy(objCfg->nodeCfg.resourceName, matchingNode->resourceName);
+        objCfg->nodeCfg.resourceName = matchingNode->resourceName;
         objCfg->nodeCfg.resourceBase = matchingNode->resourceBase;
         objCfg->nodeCfg.resourceLength = matchingNode->resourceLength;
 
index 9b3022b0949181730c379423650f24b2e970d562..5839baf056dca953a77b04eb6a90d0b8c07be7c4 100644 (file)
@@ -714,7 +714,7 @@ int32_t Rm_policyGetResourceOffset(void *policyDtb, char *resourceName)
     return(nodeOffset);
 }
 
-int32_t Rm_policyValidatePolicyResourceNames(void *allocatorList, void *policyDtb)
+int32_t Rm_policyValidatePolicyResourceNames(void *policyDtb, void *allocatorList)
 {
     Rm_Allocator *allocator = (Rm_Allocator *)allocatorList;
     int32_t              nodeOffset;
index 3d058478b993c756fe2be8ac9e83a082b8665fd1..cc89fcb4915d074e6df2724670d96c7776802672 100644 (file)
@@ -496,12 +496,12 @@ void testRmTsk(UArg arg0, UArg arg1)
      * RM instances */
     if (MultiProc_self() == 0)
     {
-        rmServerServicePort = Rm_getServicePort(rmServerHandle);
+        rmServerServicePort = Rm_serviceGetPort(rmServerHandle);
     }
     else if (MultiProc_self() == 1)
     {
-        rmClientDelegateServicePort = Rm_getServicePort(rmClientDelegateHandle);
-        rmClientServicePort = Rm_getServicePort(rmClientHandle);
+        rmClientDelegateServicePort = Rm_serviceGetPort(rmClientDelegateHandle);
+        rmClientServicePort = Rm_serviceGetPort(rmClientHandle);
     }
 
     memset((void *)&requestInfo, 0, sizeof(Rm_ServiceReqInfo));
@@ -539,9 +539,6 @@ void testRmTsk(UArg arg0, UArg arg1)
                                                                                       responseInfo.resourceLength);            
         }   
 
-        Rm_printResourceStatus(rmServerHandle);
-
-
         /* Issue the service request create a new NameServer object via the service port */                
         requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;
         requestInfo.resourceName = resourceName;
@@ -559,9 +556,7 @@ void testRmTsk(UArg arg0, UArg arg1)
                                                                                       responseInfo.resourceName, 
                                                                                       responseInfo.resourceBase,
                                                                                       responseInfo.resourceLength);            
-        }   
-
-        Rm_printResourceStatus(rmServerHandle);        
+        }         
 
         /* Issue the service request create a new NameServer object via the service port */                
         requestInfo.type = Rm_service_RESOURCE_ALLOCATE_USE;