diff --git a/src/rm.c b/src/rm.c
index 2f99160d23698914c46af4a60bbb1dec93d4cea9..db537518ce2d344eb0d32f5834fa493e4d124631 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
#include <ti/drv/rm/include/rm_servicesloc.h>\r
#include <ti/drv/rm/include/rm_nameserverloc.h>\r
#include <ti/drv/rm/include/rm_dtb_utilloc.h>\r
+#include <ti/drv/rm/include/rm_policyloc.h>\r
\r
/* RM LIBFDT includes */\r
#include <ti/drv/rm/src/libfdt/libfdt.h>\r
\r
/* Get memory for RM instance from local memory */\r
rmInst = Rm_osalMalloc (sizeof(Rm_Inst));\r
+ memset ((void *) rmInst, 0, sizeof(Rm_Inst));\r
/* Populate instance based on input parameters */\r
strcpy (&rmInst->name[0], initCfg->instName);\r
rmInst->instType = initCfg->instType;\r
rmInst->registeredWithDelegateOrServer = false;\r
- rmInst->policyDtb = NULL;\r
\r
/* Initialize the transport routing map linked list pointer to NULL. The linked list\r
* nodes will be created when the application registers transports */\r
* on the RM Server */\r
rmInst->nameServer = NULL;\r
\r
+ /* Initialize the pointer to the policy information */\r
+ rmInst->policyData = NULL;\r
+\r
/* Initialize the transaction queue elements. */\r
rmInst->transactionSeqNum = Rm_transactionInitSequenceNum();\r
rmInst->transactionQueue= NULL;\r
}\r
}\r
\r
- /* Instance startup policies are only used for Servers and Client Delegates */\r
- if (rmInst->instType != Rm_instType_CLIENT)\r
+ /* Open the instance's policy and store it. Instance policies are only used for Servers and \r
+ * Client Delegates */\r
+ if ((rmInst->instType != Rm_instType_CLIENT) && initCfg->policy)\r
{\r
- /* Open the instance's policy and store it */\r
- if (initCfg->startupPolicy)\r
- {\r
- rmInst->policyDtb = initCfg->startupPolicy;\r
- fdt_open_into(rmInst->policyDtb, rmInst->policyDtb, fdt_totalsize(rmInst->policyDtb)); \r
- }\r
-\r
- /* Store policy via policy APIs ... */\r
+ Rm_policyInit(rmInst, initCfg->policy);\r
}\r
\r
/* Return the RM Handle */\r