]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blobdiff - packages/ti/srvmgr/ServiceMgr.c
srvmgr: update copy of the whole taskParams structure
[ipc/ipcdev.git] / packages / ti / srvmgr / ServiceMgr.c
index 4f609b34092e6e440dbe3b597782c3b657cac1f3..08f2de9cd2e124177bf7fb3a5c1af560a1754a9c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2013, Texas Instruments Incorporated
+ * Copyright (c) 2011-2019, Texas Instruments Incorporated
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -48,8 +48,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include <ti/ipc/rpmsg/MessageQCopy.h>
-#include <ti/ipc/rpmsg/NameMap.h>
+#include <ti/ipc/rpmsg/RPMessage.h>
 #include "rpmsg_omx.h"
 #include "ServiceMgr.h"
 
@@ -146,13 +145,14 @@ Bool ServiceMgr_registerSrvTask(UInt16 reserved, Task_FuncPtr func,
         if (!serviceTasks[i].taken) {
             st = &serviceTasks[i];
             st->fxn = func;
-            strcpy(st->name, taskParams->instance->name);
+            strncpy(st->name, taskParams->instance->name, MAX_NAMELEN-1);
+            st->name[MAX_NAMELEN-1] = '\0';
 
             /* Deal with the Task_Params to avoid IInstance mismatch */
             params = &st->params;
             Task_Params_init(params);
-            memcpy((Void *)(&params->arg0), &taskParams->arg0,
-                        sizeof(*params) - sizeof(Void *));
+            memcpy((Void *)(params), taskParams,
+                        sizeof(*params));
             params->instance->name = st->name;
 
             st->reserved = reserved;
@@ -165,7 +165,7 @@ Bool ServiceMgr_registerSrvTask(UInt16 reserved, Task_FuncPtr func,
     return (found);
 }
 
-Bool ServiceMgr_register(String name, RcmServer_Params  *rcmServerParams)
+Bool ServiceMgr_register(String name, RcmServer_Params *rcmServerParams)
 {
     UInt              i;
     Bool              found = FALSE;
@@ -207,10 +207,9 @@ Void ServiceMgr_send(Service_Handle srvc, Ptr data, UInt16 len)
     /* Set special rpmsg_omx header so Linux side can strip it off: */
     hdr->type    = OMX_RAW_MSG;
     hdr->len     = len;
-    hdr->flags   = 0;
 
     /* Send it off (and no response expected): */
-    MessageQCopy_send(dstProc, remote, local, data, HDRSIZE+len);
+    RPMessage_send(dstProc, remote, local, data, HDRSIZE+len);
 }
 
 Bool ServiceMgr_registerDisconnectFxn(Service_Handle srvc, Ptr data,