summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a7d74ca)
raw | patch | inline | side by side (parent: a7d74ca)
author | Ramsey Harris <ramsey@ti.com> | |
Fri, 22 Mar 2013 19:36:12 +0000 (12:36 -0700) | ||
committer | Ramsey Harris <ramsey@ti.com> | |
Fri, 22 Mar 2013 19:36:12 +0000 (12:36 -0700) |
Added MmServerMgr to manage the create/delete of service instances.
Added MmType to provide better integration for function publishing.
Worked up a simple example using MxServer and rpc_task.c for this
release. Will provide formal examples in next build. Added Mx on
host side to illustrate a better example.
Added MmType to provide better integration for function publishing.
Worked up a simple example using MxServer and rpc_task.c for this
release. Will provide formal examples in next build. Added Mx on
host side to illustrate a better example.
20 files changed:
diff --git a/ipc-bios.mak b/ipc-bios.mak
index a6fc8c2788edbdadc991f375b0fae03efbe7f0f8..121f65e39b80f54bcbcff996f9ba8409ae73031d 100644 (file)
--- a/ipc-bios.mak
+++ b/ipc-bios.mak
@ $(XDC) -P $(LIST)
libs:
- @ echo #
- @ echo # Making $@ ...
- @ $(XDC) -P $(LIST) .libraries
+ @echo "#"
+ @echo "# Making $@ ..."
+ $(XDC) .libraries -P $(LIST)
release:
@ echo building ipc packages ...
index d24dbd596fabca8e0d83f2928c47cb377f19f0c2..43ec32e532e7a12051bd52eb8058bc8456e8ccfe 100644 (file)
ping_rpmsg_SOURCES = ping_rpmsg.c
# list of sources for the 'mmrpc_test' binary
-mmrpc_test_SOURCES = mmrpc_test.c
+mmrpc_test_SOURCES = Mx.c mmrpc_test.c
# list of sources for the 'MessageQApp' binary
MessageQApp_omap54xx_smp_SOURCES = $(common_sources) MessageQApp.c
index f02026b7ecc4708e233d5ae0da57a7c2b1cb1938..2bdc1afc96e5463799947b3d501a2e8f96c6724c 100644 (file)
#include <stddef.h>
#include <stdint.h>
-#if defined (__cplusplus)
+#if defined(__cplusplus)
extern "C" {
#endif
-#if defined (__cplusplus)
+#if defined(__cplusplus)
}
#endif
#endif /* ti_ipc_mm_MmRpc__include */
index 8e20456f42c81a60c795148acaad0642ab372c43..a0551837837ffe671cb05733f04a4622908dd2f4 100644 (file)
* ======== MmServiceMgr.c ========
*/
+#include <string.h>
+
#include <xdc/std.h>
+#include <xdc/runtime/Memory.h>
+#include <xdc/runtime/System.h>
+
+#include <ti/grcm/RcmServer.h>
+#include <ti/ipc/MultiProc.h>
+#include <ti/ipc/mm/MmType.h>
+#include <ti/srvmgr/ServiceMgr.h>
+#include <ti/srvmgr/omaprpc/OmapRpc.h>
#include "MmServiceMgr.h"
+#define MmServiceMgr_PORT (59)
+
+typedef struct {
+ RcmServer_Params rcmParams;
+ Int aryLen;
+ OmapRpc_FuncSignature *sigAry;
+} MmServiceMgr_Client;
+
+static Int MmServiceMgr_ref = 0;
+
+/* temporary: needs to be removed */
+extern Int32 OmapRpc_GetSvrMgrHandle(Void *srvc, Int32 num, Int32 *params);
/*
- * ======== MmRpc_register ========
+ * ======== MmServiceMgr_init ========
*/
-Int MmRpc_register(Void)
+Int MmServiceMgr_init(Void)
{
+ if (MmServiceMgr_ref++ != 0) {
+ return(MmServiceMgr_S_SUCCESS); /* module already initialized */
+ }
+
+ RcmServer_init();
+// ServiceMgr_init();
+
+ return(MmServiceMgr_S_SUCCESS);
+}
+
+/*
+ * ======== MmServiceMgr_exit ========
+ */
+Void MmServiceMgr_exit(Void)
+{
+ if (--MmServiceMgr_ref != 0) {
+ return; /* module still in use */
+ }
+
+ RcmServer_exit();
+}
+
+/*
+ * ======== MmServiceMgr_register ========
+ */
+Int MmServiceMgr_register(const String name, RcmServer_Params *rcmParams,
+ MmType_FxnSigTab *fxnSigTab, MmServiceMgr_DelFxn delFxn)
+{
+#if 1
+ Int status = MmServiceMgr_S_SUCCESS;
+ OmapRpc_Handle handle;
+
+ handle = OmapRpc_createChannel(name, MultiProc_getId("HOST"),
+ MmServiceMgr_PORT, rcmParams, fxnSigTab, delFxn);
+
+ if (handle == NULL) {
+ status = MmServiceMgr_E_FAIL;
+ }
+
+ return(status);
+#else
Int status = MmServiceMgr_S_SUCCESS;
+ MmServiceMgr_Client *obj;
+ RcmServer_FxnDesc *fxnAry;
+ Int func;
+
+ System_printf("MmServiceMgr_register: -->\n");
+
+ obj = Memory_calloc(NULL, sizeof(MmServiceMgr_Client), 0, NULL);
+
+ if (obj == NULL) {
+ System_printf("MmServiceMgr_register: Error: out of memory\n");
+ status = MmServiceMgr_E_FAIL;
+ goto leave;
+ }
+
+ /* Temporary: make a local copy of server create params in order
+ * to add one more function to the function table. Will be removed.
+ */
+ memcpy(&obj->rcmParams, rcmParams, sizeof(RcmServer_Params));
+ obj->rcmParams.fxns.length = rcmParams->fxns.length + 1;
+
+ obj->rcmParams.fxns.elem = Memory_calloc(NULL, obj->rcmParams.fxns.length *
+ sizeof(RcmServer_FxnDesc), 0, NULL);
+
+ if (obj->rcmParams.fxns.elem == NULL) {
+ System_printf("MmServiceMgr_register: Error: out of memory\n");
+ status = MmServiceMgr_E_FAIL;
+ goto leave;
+ }
+
+ /* Temporary: make a local copy of signature array in order
+ * to add the "first function" signature. Will be removed.
+ */
+ obj->aryLen = aryLen + 1;
+
+ obj->sigAry = Memory_calloc(NULL, obj->aryLen *
+ sizeof(OmapRpc_FuncSignature), 0, NULL);
+
+ if (obj->sigAry == NULL) {
+ System_printf("MmServiceMgr_register: Error: out of memory\n");
+ status = MmServiceMgr_E_FAIL;
+ goto leave;
+ }
+
+ /* Temporary: insert the "first function" in slot 0, then copy
+ * in the caller's functions. Eventually, the create function will be
+ * removed.
+ */
+ obj->rcmParams.fxns.elem[0].name =
+ OmapRpc_Stringerize(OmapRpc_GetSvrMgrHandle);
+ obj->rcmParams.fxns.elem[0].addr.createFxn =
+ (RcmServer_MsgCreateFxn)OmapRpc_GetSvrMgrHandle;
+ strncpy(obj->sigAry[0].name, obj->rcmParams.fxns.elem[0].name,
+ OMAPRPC_MAX_CHANNEL_NAMELEN);
+ obj->sigAry[0].numParam = 0;
+
+ fxnAry = rcmParams->fxns.elem;
+
+ for (func = 0; func < rcmParams->fxns.length; func++) {
+ obj->rcmParams.fxns.elem[func+1].name = fxnAry[func].name;
+ obj->rcmParams.fxns.elem[func+1].addr.fxn = fxnAry[func].addr.fxn;
+
+ memcpy(&obj->sigAry[func+1], &sigAry[func],
+ sizeof(OmapRpc_FuncSignature));
+ }
+
+ if (!ServiceMgr_register(name, &obj->rcmParams)) {
+ System_printf("MmServiceMgr_register: Error: service register failed, "
+ "status=%d\n");
+ status = MmServiceMgr_E_FAIL;
+ goto leave;
+ }
+
+leave:
+ if (status < 0) {
+ if ((obj != NULL) && (obj->sigAry != NULL)) {
+ Memory_free(NULL, obj->sigAry,
+ obj->aryLen * sizeof(OmapRpc_FuncDeclaration));
+ }
+ if ((obj != NULL) && (obj->rcmParams.fxns.elem != NULL)) {
+ Memory_free(NULL, obj->rcmParams.fxns.elem,
+ obj->rcmParams.fxns.length * sizeof(RcmServer_FxnDesc));
+ }
+ if (obj != NULL) {
+ Memory_free(NULL, obj, sizeof(MmServiceMgr_Client));
+ }
+ }
+
+ System_printf("MmServiceMgr_register: <--, status=%d\n", status);
+ return(status);
+#endif
+}
+
+#if 0
+/*
+ * ======== MmServiceMgr_start ========
+ */
+Int MmServiceMgr_start(const String name, Int aryLen,
+ OmapRpc_FuncSignature *sigAry)
+{
+ extern Int OmapRpc_start(const String name, Int port, Int aryLen,
+ OmapRpc_FuncSignature *sigAry);
+
+ Int status = MmServiceMgr_S_SUCCESS;
+
+ OmapRpc_start(name, MmServiceMgr_PORT, aryLen, sigAry);
+
return(status);
}
+#endif
index df6bd2e65321d8fb4c2def046a9d2f3f079c4079..bd789286fdb62b80c34b7e5ebaacbb70d19aea56 100644 (file)
#ifndef ti_ipc_mm_MmServiceMgr__include
#define ti_ipc_mm_MmServiceMgr__include
+#include <ti/grcm/RcmServer.h>
+#include <ti/ipc/mm/MmType.h>
+#include <ti/srvmgr/omaprpc/OmapRpc.h>
+
#if defined (__cplusplus)
extern "C" {
#endif
*/
#define MmServiceMgr_E_FAIL (-1)
+typedef Void (*MmServiceMgr_DelFxn)(Void);
+
+
+/*!
+ * @brief Initialize the MmServiceMgr module
+ *
+ */
+Int MmServiceMgr_init(Void);
+
+/*!
+ * @brief Finalize the MmServiceMgr module
+ *
+ */
+Void MmServiceMgr_exit(Void);
+
/*!
* @brief Register a new service
*
*/
-Int MmServiceMgr_register(Void);
+Int MmServiceMgr_register(const String name, RcmServer_Params *params,
+ MmType_FxnSigTab *fxnSigTab, MmServiceMgr_DelFxn delFxn);
+
+/*!
+ * @brief Start the service manager listner task
+ *
+ */
+Int MmServiceMgr_start(const String name, Int aryLen,
+ OmapRpc_FuncSignature *sigAry);
#if defined (__cplusplus)
diff --git a/packages/ti/ipc/mm/MmType.h b/packages/ti/ipc/mm/MmType.h
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** ============================================================================
+ * @file MmType.h
+ *
+ * @brief Specific types to support the MmRpc and MmServiceMgr modules
+ *
+ * ============================================================================
+ */
+
+#ifndef ti_ipc_mm_MmType__include
+#define ti_ipc_mm_MmType__include
+
+#include <ti/grcm/RcmServer.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*!
+ * @brief Maximum function name length
+ */
+#define MmType_MAX_NAMELEN (64)
+
+/*!
+ * @brief Maximum number of parameters
+ */
+#define MmType_MAX_PARAMS (10)
+
+/*!
+ * @brief Compute number of elements in given array
+ *
+ * The given array must be the actual array buffer,
+ * not a pointer to it.
+ */
+#define MmType_NumElem(x) (sizeof(x)/sizeof(x[0]))
+
+/*!
+ * @brief Parameter Direction
+ *
+ * The parameter direction relative to the function
+ * it describes.
+ */
+typedef enum {
+ MmType_Dir_In = 0,
+ MmType_Dir_Out,
+ MmType_Dir_Bi,
+ MmType_Dir_MAX
+} MmType_Dir;
+
+/*!
+ * @brief Parameter Type
+ */
+typedef enum {
+ MmType_Param_VOID = 0,
+ MmType_Param_S08,
+ MmType_Param_U08,
+ MmType_Param_S16,
+ MmType_Param_U16,
+ MmType_Param_S32,
+ MmType_Param_U32,
+ MmType_Param_S64,
+ MmType_Param_U64,
+
+ MmType_Param_PTR = 0x80, /*!< OR'd with lower type to make a
+ pointer to the correct type */
+ MmType_Param_MAX
+} MmType_ParamType;
+
+#define MmType_PtrType(type) (type | MmType_Param_PTR)
+
+/*!
+ * @brief Parameter Signature
+ */
+typedef struct {
+ UInt32 direction; /*!< @see MmType_Dir */
+ UInt32 type; /*!< @see MmType_ParamType */
+ UInt32 count; /*!< basic sanity checking on array bounds */
+} MmType_ParamSig;
+
+/*!
+ * @brief Function Signature
+ *
+ * The first parameter (params[0]) is the return value.
+ */
+typedef struct {
+ Char name[MmType_MAX_NAMELEN];
+ UInt32 numParam;
+ MmType_ParamSig params[MmType_MAX_PARAMS + 1];
+} MmType_FxnSig;
+
+/*!
+ * @brief Function Signature Table
+ *
+ */
+typedef struct {
+ UInt count;
+ MmType_FxnSig * table;
+} MmType_FxnSigTab;
+
+/*!
+ * @brief Marshalled Parameter structure
+ *
+ */
+typedef struct {
+ SizeT size;
+ SizeT data;
+} MmType_Param;
+
+
+#if defined(__cplusplus)
+}
+#endif
+#endif /* ti_ipc_mm_MmType__include */
diff --git a/packages/ti/ipc/tests/Mx.c b/packages/ti/ipc/tests/Mx.c
--- /dev/null
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2013, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * ======== Mx.c ========
+ */
+#include <stdio.h>
+
+#include <ti/ipc/mm/MmRpc.h>
+
+#if defined(SYSLINK_BUILDOS_QNX)
+#include <ti/shmemallocator/SharedMemoryAllocatorUsr.h>
+#endif
+
+#include "Mx.h"
+
+/* hande used for remote communication */
+static MmRpc_Handle Mx_rpcIpu = NULL;
+
+/* static function indicies */
+#define Mx_Fxn_triple (0x80000000 | 1)
+#define Mx_Fxn_add (0x80000000 | 2)
+#define Mx_Fxn_compute (0x80000000 | 5)
+
+#define Mx_OFFSET(base, member) ((uint_t)(member) - (uint_t)(base))
+
+/*
+ * ======== Mx_initialize ========
+ */
+int Mx_initialize(void)
+{
+ int status;
+ MmRpc_Params args;
+
+ /* create remote server insance */
+ MmRpc_Params_init(&args);
+
+ status = MmRpc_create("rpc_example", &args, &Mx_rpcIpu);
+
+ if (status < 0) {
+ printf("mmrpc_test: Error: MmRpc_create failed\n");
+ status = -1;
+ }
+ else {
+ status = 0;
+ }
+
+ return(status);
+}
+
+/*
+ * ======== Mx_finalize ========
+ */
+void Mx_finalize(void)
+{
+ /* delete remote server instance */
+ if (Mx_rpcIpu != NULL) {
+ MmRpc_delete(&Mx_rpcIpu);
+ }
+}
+
+/*
+ * ======== Mx_triple ========
+ */
+int32_t Mx_triple(uint32_t a)
+{
+ MmRpc_FxnCtx *fxnCtx;
+ int32_t fxnRet;
+ char send_buf[512] = {0};
+ int status;
+
+ /* marshall function arguments into the send buffer */
+ fxnCtx = (MmRpc_FxnCtx *)send_buf;
+
+ fxnCtx->fxn_id = Mx_Fxn_triple;
+ fxnCtx->num_params = 1;
+ fxnCtx->params[0].type = MmRpc_ParamType_Scalar;
+ fxnCtx->params[0].param.scalar.size = sizeof(int);
+ fxnCtx->params[0].param.scalar.data = a;
+ fxnCtx->num_xlts = 0;
+ fxnCtx->xltAry = NULL;
+
+ /* invoke the remote function call */
+ status = MmRpc_call(Mx_rpcIpu, fxnCtx, &fxnRet);
+
+ if (status < 0) {
+ printf("mmrpc_test: Error: MmRpc_call failed\n");
+ fxnRet = -1;
+ }
+
+ return(fxnRet);
+}
+
+/*
+ * ======== Mx_add ========
+ */
+int32_t Mx_add(int32_t a, int32_t b)
+{
+ MmRpc_FxnCtx *fxnCtx;
+ int32_t fxnRet;
+ char send_buf[512] = {0};
+ int status;
+
+ /* marshall function arguments into the send buffer */
+ fxnCtx = (MmRpc_FxnCtx *)send_buf;
+
+ fxnCtx->fxn_id = Mx_Fxn_add;
+ fxnCtx->num_params = 2;
+ fxnCtx->params[0].type = MmRpc_ParamType_Scalar;
+ fxnCtx->params[0].param.scalar.size = sizeof(int);
+ fxnCtx->params[0].param.scalar.data = a;
+ fxnCtx->params[1].type = MmRpc_ParamType_Scalar;
+ fxnCtx->params[1].param.scalar.size = sizeof(int);
+ fxnCtx->params[1].param.scalar.data = b;
+ fxnCtx->num_xlts = 0;
+
+ /* invoke the remote function call */
+ status = MmRpc_call(Mx_rpcIpu, fxnCtx, &fxnRet);
+
+ if (status < 0) {
+ printf("mmrpc_test: Error: MmRpc_call failed\n");
+ fxnRet = -1;
+ }
+
+ return(fxnRet);
+}
+
+/*
+ * ======== Mx_compute ========
+ */
+int32_t Mx_compute(Mx_Compute *compute)
+{
+ MmRpc_FxnCtx *fxnCtx;
+ MmRpc_Xlt xltAry[2];
+ int32_t fxnRet;
+ char send_buf[512] = {0};
+ int status;
+
+ /* marshall function arguments into the send buffer */
+ fxnCtx = (MmRpc_FxnCtx *)send_buf;
+
+ fxnCtx->fxn_id = Mx_Fxn_compute;
+ fxnCtx->num_params = 1;
+ fxnCtx->params[0].type = MmRpc_ParamType_Ptr;
+ fxnCtx->params[0].param.ptr.size = sizeof(Mx_Compute);
+ fxnCtx->params[0].param.ptr.addr = (size_t)compute;
+#if defined(SYSLINK_BUILDOS_QNX)
+ fxnCtx->params[0].param.ptr.handle = NULL;
+#else
+// fxnCtx->params[0].param.ptr.handle = ...;
+#endif
+
+ fxnCtx->num_xlts = 2;
+ fxnCtx->xltAry = xltAry;
+
+ fxnCtx->xltAry[0].index = 0;
+ fxnCtx->xltAry[0].offset = MmRpc_OFFSET(compute, &compute->inBuf);
+ fxnCtx->xltAry[0].base = (size_t)(compute->inBuf);
+#if defined(SYSLINK_BUILDOS_QNX)
+ fxnCtx->xltAry[0].handle = NULL;
+#else
+// fxnCtx->xltAry[0].handle = ...;
+#endif
+
+ fxnCtx->xltAry[1].index = 0;
+ fxnCtx->xltAry[1].offset = MmRpc_OFFSET(compute, &compute->outBuf);
+ fxnCtx->xltAry[1].base = (size_t)(compute->outBuf);
+#if defined(SYSLINK_BUILDOS_QNX)
+ fxnCtx->xltAry[1].handle = NULL;
+#else
+// fxnCtx->xltAry[1].handle = ...;
+#endif
+
+ /* invoke the remote function call */
+ status = MmRpc_call(Mx_rpcIpu, fxnCtx, &fxnRet);
+
+ if (status < 0) {
+ printf("mmrpc_test: Error: MmRpc_call failed\n");
+ fxnRet = -1;
+ }
+
+ return(fxnRet);
+}
diff --git a/packages/ti/ipc/tests/Mx.h b/packages/ti/ipc/tests/Mx.h
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** ============================================================================
+ * @file Mx.h
+ *
+ * @brief Example of a host-side module which uses MmRpc to
+ * invoke functions on a remote processor.
+ *
+ * ============================================================================
+ */
+
+#ifndef Mx__include
+#define Mx__include
+
+#include <stddef.h>
+#include <stdint.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*!
+ * @brief Operation is successful
+ */
+#define Mx_S_SUCCESS (0)
+
+/*!
+ * @brief Operation failed
+ */
+#define Mx_E_FAIL (-1)
+
+/*!
+ * @brief Compute structure
+ */
+typedef struct {
+ uint32_t coef;
+ int key;
+ int size;
+ uint32_t * inBuf;
+ uint32_t * outBuf;
+} Mx_Compute;
+
+/*!
+ * @brief Initialize the module, must be called first
+ */
+int Mx_initialize(void);
+
+/*!
+ * @brief Finalize the module, must be called last
+ */
+void Mx_finalize(void);
+
+/*!
+ * @brief Sample function which multiplies argument by three
+ */
+int32_t Mx_triple(uint32_t a);
+
+/*!
+ * @brief Sample function which addes two arguments
+ */
+int32_t Mx_add(int32_t a, int32_t b);
+
+/*!
+ * @brief Sample function which has pointer parameter to
+ * a structure with two embedded pointers.
+ */
+int32_t Mx_compute(Mx_Compute *compute);
+
+
+#if defined(__cplusplus)
+}
+#endif
+#endif /* Mx__include */
diff --git a/packages/ti/ipc/tests/MxServer.c b/packages/ti/ipc/tests/MxServer.c
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2013, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * ======== MxServer.c ========
+ *
+ * Example implementation of the Mx module which runs on the host.
+ * The Mx module will invoke these function here using MmRpc.
+ */
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "MxServer.h"
+
+/*
+ * ======== MxServer_triple ========
+ */
+int32_t MxServer_triple(uint32_t a)
+{
+ int32_t result;
+
+ result = a * 3;
+
+ return(result);
+}
+
+/*
+ * ======== MxServer_add ========
+ */
+int32_t MxServer_add(int32_t a, int32_t b)
+{
+ int32_t result;
+
+ result = a + b;
+
+ return(result);
+}
+
+/*
+ * ======== MxServer_compute ========
+ */
+int32_t MxServer_compute(MxServer_Compute *compute)
+{
+ int i;
+
+ /* process inBuf into outBuf */
+ for (i = 0; i < compute->size; i++) {
+ compute->outBuf[i] = compute->coef | compute->inBuf[i];
+ }
+
+ /* write a cookie into the key */
+ compute->key = 0xA0A0;
+
+ return(0);
+}
diff --git a/packages/ti/ipc/tests/MxServer.h b/packages/ti/ipc/tests/MxServer.h
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** ============================================================================
+ * @file MxServer.h
+ *
+ * @brief Example of a slave-side module which implements the Mx
+ * module functions. The functions in MxServer are invoked
+ * remotely by the Mx module running on the host processor.
+ *
+ * ============================================================================
+ */
+
+#ifndef MxServer__include
+#define MxServer__include
+
+#include <stddef.h>
+#include <stdint.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*!
+ * @brief Operation is successful
+ */
+#define MxServer_S_SUCCESS (0)
+
+/*!
+ * @brief Operation failed
+ */
+#define MxServer_E_FAIL (-1)
+
+/*!
+ * @brief Compute structure
+ */
+typedef struct {
+ uint32_t coef;
+ int key;
+ int size;
+ uint32_t * inBuf;
+ uint32_t * outBuf;
+} MxServer_Compute;
+
+/*!
+ * @brief Sample function which multiplies argument by three
+ */
+int32_t MxServer_triple(uint32_t a);
+
+/*!
+ * @brief Sample function which addes two arguments
+ */
+int32_t MxServer_add(int32_t a, int32_t b);
+
+/*!
+ * @brief Sample function which has pointer parameter to
+ * a structure with two embedded pointers.
+ */
+int32_t MxServer_compute(MxServer_Compute *compute);
+
+
+#if defined(__cplusplus)
+}
+#endif
+#endif /* MxServer__include */
index d308f1d5b68adddc7af82ba73afe4e79f7bd7ab7..6fb7f183a476ec298b7161819538ff029e3f4b4c 100644 (file)
*/
#include <stdio.h>
-#include <ti/ipc/mm/MmRpc.h>
-
#if defined(SYSLINK_BUILDOS_QNX)
#include <ti/shmemallocator/SharedMemoryAllocatorUsr.h>
#endif
-/*
- * module 'Mx' functions
- */
-
-/* compute structure */
-typedef struct {
- uint32_t coef;
- int key;
- int size;
- uint32_t * inBuf;
- uint32_t * outBuf;
-} Mx_Compute;
-
-int Mx_initialize(void);
-void Mx_finalize(void);
-
-int32_t Mx_triple(uint32_t a);
-int32_t Mx_add(int32_t a, int32_t b);
-int32_t Mx_compute(Mx_Compute *compute);
-
-MmRpc_Handle Mx_rpcIpu = NULL;
-
-/* static function indicies */
-#define Mx_Fxn_triple (0x80000000 | 1)
-#define Mx_Fxn_add (0x80000000 | 2)
-#define Mx_Fxn_compute (0x80000000 | 5)
-
-#define Mx_OFFSET(base, member) ((uint_t)(member) - (uint_t)(base))
+#include "Mx.h"
/*
* ======== main ========
}
return(0);
}
-
-/*
- * ======== Mx_initialize ========
- */
-int Mx_initialize(void)
-{
- int status;
- MmRpc_Params args;
-
- /* create remote server insance */
- MmRpc_Params_init(&args);
-
- status = MmRpc_create("rpc_example", &args, &Mx_rpcIpu);
-
- if (status < 0) {
- printf("mmrpc_test: Error: MmRpc_create failed\n");
- status = -1;
- }
- else {
- status = 0;
- }
-
- return(status);
-}
-
-/*
- * ======== Mx_finalize ========
- */
-void Mx_finalize(void)
-{
- /* delete remote server instance */
- if (Mx_rpcIpu != NULL) {
- MmRpc_delete(&Mx_rpcIpu);
- }
-}
-
-/*
- * ======== Mx_triple ========
- */
-int32_t Mx_triple(uint32_t a)
-{
- MmRpc_FxnCtx *fxnCtx;
- int32_t fxnRet;
- char send_buf[512] = {0};
- int status;
-
- /* marshall function arguments into the send buffer */
- fxnCtx = (MmRpc_FxnCtx *)send_buf;
-
- fxnCtx->fxn_id = Mx_Fxn_triple;
- fxnCtx->num_params = 1;
- fxnCtx->params[0].type = MmRpc_ParamType_Scalar;
- fxnCtx->params[0].param.scalar.size = sizeof(int);
- fxnCtx->params[0].param.scalar.data = a;
- fxnCtx->num_xlts = 0;
- fxnCtx->xltAry = NULL;
-
- /* invoke the remote function call */
- status = MmRpc_call(Mx_rpcIpu, fxnCtx, &fxnRet);
-
- if (status < 0) {
- printf("mmrpc_test: Error: MmRpc_call failed\n");
- fxnRet = -1;
- }
-
- return(fxnRet);
-}
-
-/*
- * ======== Mx_add ========
- */
-int32_t Mx_add(int32_t a, int32_t b)
-{
- MmRpc_FxnCtx *fxnCtx;
- int32_t fxnRet;
- char send_buf[512] = {0};
- int status;
-
- /* marshall function arguments into the send buffer */
- fxnCtx = (MmRpc_FxnCtx *)send_buf;
-
- fxnCtx->fxn_id = Mx_Fxn_add;
- fxnCtx->num_params = 2;
- fxnCtx->params[0].type = MmRpc_ParamType_Scalar;
- fxnCtx->params[0].param.scalar.size = sizeof(int);
- fxnCtx->params[0].param.scalar.data = a;
- fxnCtx->params[1].type = MmRpc_ParamType_Scalar;
- fxnCtx->params[1].param.scalar.size = sizeof(int);
- fxnCtx->params[1].param.scalar.data = b;
- fxnCtx->num_xlts = 0;
-
- /* invoke the remote function call */
- status = MmRpc_call(Mx_rpcIpu, fxnCtx, &fxnRet);
-
- if (status < 0) {
- printf("mmrpc_test: Error: MmRpc_call failed\n");
- fxnRet = -1;
- }
-
- return(fxnRet);
-}
-
-/*
- * ======== Mx_compute ========
- */
-int32_t Mx_compute(Mx_Compute *compute)
-{
- MmRpc_FxnCtx *fxnCtx;
- MmRpc_Xlt xltAry[2];
- int32_t fxnRet;
- char send_buf[512] = {0};
- int status;
-
- /* marshall function arguments into the send buffer */
- fxnCtx = (MmRpc_FxnCtx *)send_buf;
-
- fxnCtx->fxn_id = Mx_Fxn_compute;
- fxnCtx->num_params = 1;
- fxnCtx->params[0].type = MmRpc_ParamType_Ptr;
- fxnCtx->params[0].param.ptr.size = sizeof(Mx_Compute);
- fxnCtx->params[0].param.ptr.addr = (size_t)compute;
-#if defined(SYSLINK_BUILDOS_QNX)
- fxnCtx->params[0].param.ptr.handle = NULL;
-#else
-// fxnCtx->params[0].param.ptr.handle = ...;
-#endif
-
- fxnCtx->num_xlts = 2;
- fxnCtx->xltAry = xltAry;
-
- fxnCtx->xltAry[0].index = 0;
- fxnCtx->xltAry[0].offset = MmRpc_OFFSET(compute, &compute->inBuf);
- fxnCtx->xltAry[0].base = (size_t)(compute->inBuf);
-#if defined(SYSLINK_BUILDOS_QNX)
- fxnCtx->xltAry[0].handle = NULL;
-#else
-// fxnCtx->xltAry[0].handle = ...;
-#endif
-
- fxnCtx->xltAry[1].index = 0;
- fxnCtx->xltAry[1].offset = MmRpc_OFFSET(compute, &compute->outBuf);
- fxnCtx->xltAry[1].base = (size_t)(compute->outBuf);
-#if defined(SYSLINK_BUILDOS_QNX)
- fxnCtx->xltAry[1].handle = NULL;
-#else
-// fxnCtx->xltAry[1].handle = ...;
-#endif
-
- /* invoke the remote function call */
- status = MmRpc_call(Mx_rpcIpu, fxnCtx, &fxnRet);
-
- if (status < 0) {
- printf("mmrpc_test: Error: MmRpc_call failed\n");
- fxnRet = -1;
- }
-
- return(fxnRet);
-}
index f70b9b983dc0a7bce25f984f2d9a8a8d81a10d99..51fea022a2a3865596b5b858189e2a04f50572e6 100644 (file)
Pkg.addExecutable(name + "/test_omx_ipu_omap5", targ, platform, {
cfgScript: "test_omx_ipu_omap5",
defs: "-D IPU -D OMAP5xxx"
- }).addObjects(["test_omx.c","ping_tasks.c","rpc_task.c"]);
+ }).addObjects(["test_omx.c","ping_tasks.c","rpc_task.c",
+ "MxServer.c"]);
}
}
}
index 8f82905cf22f49ae2f57842dbc6f8dc52e93691a..ad4c9cda142c28a4422827ed7925b0bedf4073b9 100644 (file)
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
/*
* ======== rpc_task.c ========
*
- * Example of setting up a 'RPC' service with the ServiceMgr, allowing clients
- * to instantiate the example RPC instance.
- *
+ * Example of how to integrate the MxServer module with the
+ * MmService manager.
*/
#include <xdc/std.h>
-#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>
-#include <xdc/runtime/Diags.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ti/ipc/MultiProc.h>
-#include <ti/sysbios/BIOS.h>
-#include <ti/sysbios/knl/Task.h>
-
-#include <ti/grcm/RcmTypes.h>
#include <ti/grcm/RcmServer.h>
-
-#include <ti/srvmgr/ServiceMgr.h>
-#include <ti/srvmgr/omaprpc/OmapRpc.h>
-#include <ti/srvmgr/rpmsg_omx.h>
-#include <ti/srvmgr/omx_packet.h>
-
+#include <ti/ipc/mm/MmType.h>
+#include <ti/ipc/mm/MmServiceMgr.h>
#include <ti/sysbios/hal/Cache.h>
-/* Turn on/off printf's */
-#define CHATTER 1
-
-#define RPC_MGR_PORT 59
+#include "MxServer.h"
-void start_rpc_task(); /* bootstrap function */
+/* turn on/off printf's */
+#define CHATTER 1
typedef struct {
Int a;
Int *array;
} FxnAddXArgs;
-#define H264_DECODER_NAME "H264_decoder"
-#define OMX_VIDEO_THREAD_PRIORITY 5
+#define SERVICE_NAME "rpc_example"
-typedef UInt32 OMX_HANDLETYPE;
-
-//static Int32 RPC_SKEL_Init(Void *, UInt32 size, UInt32 *data);
+/* MxServer skel function declarations */
static Int32 RPC_SKEL_Init2(UInt32 size, UInt32 *data);
-//static Int32 RPC_SKEL_SetParameter(UInt32 size, UInt32 *data);
-//static Int32 RPC_SKEL_GetParameter(UInt32 size, UInt32 *data);
-static Int32 fxnTriple(UInt32 size, UInt32 *data);
-static Int32 fxnAdd(UInt32 size, UInt32 *data);
+static Int32 MxServer_skel_triple(UInt32 size, UInt32 *data);
+static Int32 MxServer_skel_add(UInt32 size, UInt32 *data);
static Int32 fxnAdd3(UInt32 size, UInt32 *data);
static Int32 fxnAddX(UInt32 size, UInt32 *data);
-static Int32 fxnCompute(UInt32 size, UInt32 *data);
-
-#if 0
-/* RcmServer static function table */
-static RcmServer_FxnDesc RPCServerFxnAry[] = {
- {"RPC_SKEL_Init", NULL}, /* filled in dynamically */
- {"RPC_SKEL_SetParameter", RPC_SKEL_SetParameter},
- {"RPC_SKEL_GetParameter", RPC_SKEL_GetParameter},
- {"fxnTriple", fxnTriple },
+static Int32 MxServer_skel_compute(UInt32 size, UInt32 *data);
+
+/* MxServer skel function array */
+static RcmServer_FxnDesc mxSkelAry[] = {
+ { "RPC_SKEL_Init2", RPC_SKEL_Init2 },
+ { "MxServer_triple", MxServer_skel_triple },
+ { "MxServer_add", MxServer_skel_add },
+ { "fxnAdd3", fxnAdd3 },
+ { "fxnAddX", fxnAddX },
+ { "MxServer_compute", MxServer_skel_compute }
};
-#define RPCServerFxnAryLen (sizeof RPCServerFxnAry / sizeof RPCServerFxnAry[0])
-
-static const RcmServer_FxnDescAry RPCServer_fxnTab = {
- RPCServerFxnAryLen,
- RPCServerFxnAry
+/* MxServer skel function table */
+static const RcmServer_FxnDescAry rpc_fxnTab = {
+ (sizeof(mxSkelAry) / sizeof(mxSkelAry[0])),
+ mxSkelAry
};
-#endif
-#define RPC_SVR_NUM_FXNS 6
-OmapRpc_FuncDeclaration RPCServerFxns[RPC_SVR_NUM_FXNS] =
-{
- { RPC_SKEL_Init2,
- { "RPC_SKEL_Init2", 3,
- {
- {OmapRpc_Direction_Out, OmapRpc_Param_S32, 1}, // return
- {OmapRpc_Direction_In, OmapRpc_Param_U32, 1},
- {OmapRpc_Direction_In, OmapRpc_PtrType(OmapRpc_Param_U32), 1}
- }
+static MmType_FxnSig rpc_sigAry[] = {
+ { "RPC_SKEL_Init2", 3,
+ {
+ { MmType_Dir_Out, MmType_Param_S32, 1 }, /* return */
+ { MmType_Dir_In, MmType_Param_U32, 1 },
+ { MmType_Dir_In, MmType_PtrType(MmType_Param_U32), 1 }
}
},
- { fxnTriple,
- { "fxnTriple", 2,
- {
- {OmapRpc_Direction_Out, OmapRpc_Param_S32, 1}, // return
- {OmapRpc_Direction_In, OmapRpc_Param_U32, 1}
- }
+ { "MxServer_triple", 2,
+ {
+ { MmType_Dir_Out, MmType_Param_S32, 1 }, /* return */
+ { MmType_Dir_In, MmType_Param_U32, 1 }
}
},
- { fxnAdd,
- { "fxnAdd", 3,
- {
- {OmapRpc_Direction_Out, OmapRpc_Param_S32, 1}, // return
- {OmapRpc_Direction_In, OmapRpc_Param_S32, 1},
- {OmapRpc_Direction_In, OmapRpc_Param_S32, 1}
- }
+ { "MxServer_add", 3,
+ {
+ { MmType_Dir_Out, MmType_Param_S32, 1 }, /* return */
+ { MmType_Dir_In, MmType_Param_S32, 1 },
+ { MmType_Dir_In, MmType_Param_S32, 1 }
}
},
- { fxnAdd3,
- { "fxnAdd3", 2,
- {
- {OmapRpc_Direction_Out, OmapRpc_Param_S32, 1}, // return
- {OmapRpc_Direction_In, OmapRpc_PtrType(OmapRpc_Param_U32), 1}
- }
+ { "fxnAdd3", 2,
+ {
+ { MmType_Dir_Out, MmType_Param_S32, 1 }, /* return */
+ { MmType_Dir_In, MmType_PtrType(MmType_Param_U32), 1 }
}
},
- { fxnAddX,
- { "fxnAddX", 2,
- {
- {OmapRpc_Direction_Out, OmapRpc_Param_S32, 1}, // return
- {OmapRpc_Direction_In, OmapRpc_PtrType(OmapRpc_Param_U32), 1}
- }
+ { "fxnAddX", 2,
+ {
+ { MmType_Dir_Out, MmType_Param_S32, 1 }, /* return */
+ { MmType_Dir_In, MmType_PtrType(MmType_Param_U32), 1 }
}
},
- { fxnCompute,
- { "fxnCompute", 1,
- {
- {OmapRpc_Direction_Out, OmapRpc_Param_S32, 1}, // return
- {OmapRpc_Direction_In, OmapRpc_PtrType(OmapRpc_Param_VOID), 1}
- }
+ { "MxServer_compute", 1,
+ {
+ { MmType_Dir_Out, MmType_Param_S32, 1 }, /* return */
+ { MmType_Dir_In, MmType_PtrType(MmType_Param_VOID), 1 }
}
}
};
-#if 0
-static Int32 RPC_SKEL_SetParameter(UInt32 size, UInt32 *data)
-{
-#if CHATTER
- System_printf("RPC_SKEL_SetParameter: Called\n");
-#endif
-
- return(0);
-}
-#endif
+static MmType_FxnSigTab rpc_fxnSigTab = {
+ MmType_NumElem(rpc_sigAry), rpc_sigAry
+};
-#if 0
-static Int32 RPC_SKEL_GetParameter(UInt32 size, UInt32 *data)
-{
-#if CHATTER
- System_printf("RPC_SKEL_GetParameter: Called\n");
-#endif
+/* the server create parameters, must be in persistent memory */
+static RcmServer_Params rpc_Params;
- return(0);
-}
-#endif
-Void RPC_SKEL_SrvDelNotification()
+Void RPC_SKEL_SrvDelNotification(Void)
{
System_printf("RPC_SKEL_SrvDelNotification: Nothing to cleanup\n");
}
-#define CALLBACK_DATA "OMX_Callback"
-#define PAYLOAD_SIZE sizeof(CALLBACK_DATA)
-#define CALLBACK_DATA_SIZE (HDRSIZE + OMXPACKETSIZE + PAYLOAD_SIZE)
-
-#if 0
-static Int32 RPC_SKEL_Init(Void *srvc, UInt32 size, UInt32 *data)
-{
- char cComponentName[128] = {0};
- OMX_HANDLETYPE hComp;
- Char cb_data[HDRSIZE + OMXPACKETSIZE + PAYLOAD_SIZE] = {0};
-
- /*
- * Note: Currently, rpmsg_omx linux driver expects an omx_msg_hdr in front
- * of the omx_packet data, so we allow space for this:
- */
- struct omx_msg_hdr * hdr = (struct omx_msg_hdr *)cb_data;
- struct omx_packet * packet = (struct omx_packet *)hdr->data;
-
-
- //Marshalled:[>offset(cParameterName)|>pAppData|>offset(RcmServerName)|>pid|
- //>--cComponentName--|>--CallingCorercmServerName--|
- //<hComp]
-
- strcpy(cComponentName, (char *)data + sizeof(map_info_type));
-
-#if CHATTER
- System_printf("RPC_SKEL_GetHandle: Component Name received: %s\n",
- cComponentName);
-#endif
-
- /* Simulate sending an async OMX callback message, passing an omx_packet
- * structure.
- */
- packet->msg_id = 99; // Set to indicate callback instance, buffer id, etc.
- packet->fxn_idx = 5; // Set to indicate callback fxn
- packet->data_size = PAYLOAD_SIZE;
- strcpy((char *)packet->data, CALLBACK_DATA);
-
-#if CHATTER
- System_printf("RPC_SKEL_GetHandle: Sending callback message id: %d, "
- "fxn_id: %d, data: %s\n",
- packet->msg_id, packet->fxn_idx, packet->data);
-#endif
- ServiceMgr_send(srvc, cb_data, CALLBACK_DATA_SIZE);
-
- /* Call OMX_Get_Handle() and return handle for future calls. */
- //eCompReturn = OMX_GetHandle(&hComp, (OMX_STRING)&cComponentName[0], pAppData,&rpcCallBackInfo);
- hComp = 0x5C0FFEE5;
- data[0] = hComp;
-
-#if CHATTER
- System_printf("RPC_SKEL_GetHandle: returning hComp: 0x%x\n", hComp);
-#endif
-
- return(0);
-}
-#endif
-
static Int32 RPC_SKEL_Init2(UInt32 size, UInt32 *data)
{
- System_printf("RPC_SKEL_Init2: size = 0x%x data = 0x%x\n", size,
- (UInt32)data);
- return 0;
+ System_printf("RPC_SKEL_Init2: size=0x%x data=0x%x\n", size, data);
+ return(0);
}
/*
- * ======== fxnTriple ========
+ * ======== MxServer_skel_triple ========
*/
-Int32 fxnTriple(UInt32 size, UInt32 *data)
+Int32 MxServer_skel_triple(UInt32 size, UInt32 *data)
{
- struct OmapRpc_Parameter *payload = (struct OmapRpc_Parameter *)data;
- Int a;
+ MmType_Param *payload = (MmType_Param *)data;
+ UInt32 a;
Int32 result;
- a = (Int)payload[0].data;
- result = a * 3;
+ a = (UInt32)payload[0].data;
+ result = MxServer_triple(a);
#if CHATTER
System_printf("fxnTriple: a=%d, result=%d\n", a, result);
}
/*
- * ======== fxnAdd ========
+ * ======== MxServer_skel_add ========
*/
-Int32 fxnAdd(UInt32 size, UInt32 *data)
+Int32 MxServer_skel_add(UInt32 size, UInt32 *data)
{
- struct OmapRpc_Parameter *payload = (struct OmapRpc_Parameter *)data;
- Int a, b;
+ MmType_Param *payload = (MmType_Param *)data;
+ Int32 a, b;
Int32 result;
- a = (Int)payload[0].data;
- b = (Int)payload[1].data;
+ a = (Int32)payload[0].data;
+ b = (Int32)payload[1].data;
- result = a + b;
+ result = MxServer_add(a, b);
#if CHATTER
System_printf("fxnAdd: a=%d, b=%d, result=%d\n", a, b, result);
return(result);
}
-/*
- * ======== fxnCompute ========
- */
-Int32 fxnCompute(UInt32 size, UInt32 *data)
-{
- typedef struct {
- uint32_t coef;
- int key;
- int size;
- uint32_t * inBuf;
- uint32_t * outBuf;
- } Mx_Compute;
-
- struct OmapRpc_Parameter *payload;
- Mx_Compute *compute;
- Int32 result = 0;
- Int i;
-
- payload = (struct OmapRpc_Parameter *)data;
- compute = (Mx_Compute *)payload[0].data;
- Cache_inv(compute, sizeof(Mx_Compute), Cache_Type_ALL, TRUE);
-
-#if CHATTER
- System_printf("fxnCompute: compute=0x%x\n", compute);
- System_printf("fxnCompute: compute size=%d\n", (Int)payload[0].size);
- System_printf("fxnCompute: coef=0x%x\n", compute->coef);
- System_printf("fxnCompute: key=0x%x\n", compute->key);
- System_printf("fxnCompute: size=0x%x\n", compute->size);
- System_printf("fxnCompute: inBuf=0x%x\n", compute->inBuf);
- System_printf("fxnCompute: outBuf=0x%x\n", compute->outBuf);
-#endif
-
- Cache_inv(compute->inBuf, compute->size * sizeof(uint32_t),
- Cache_Type_ALL, TRUE);
- Cache_inv(compute->outBuf, compute->size * sizeof(uint32_t),
- Cache_Type_ALL, TRUE);
-
- for (i = 0; i < compute->size; i++) {
- compute->outBuf[i] = compute->coef | compute->inBuf[i];
- }
-
- Cache_wbInv(compute->outBuf, compute->size * sizeof(uint32_t),
- Cache_Type_ALL, TRUE);
-
- return(result);
-}
-
/*
* ======== fxnAdd3 ========
*/
Int32 fxnAdd3(UInt32 size, UInt32 *data)
{
- struct OmapRpc_Parameter *payload = (struct OmapRpc_Parameter *)data;
+ MmType_Param *payload = (MmType_Param *)data;
FxnAdd3Args *args;
Int a, b, c;
*/
Int32 fxnAddX(UInt32 size, UInt32 *data)
{
- struct OmapRpc_Parameter *payload = (struct OmapRpc_Parameter *)data;
+ MmType_Param *payload = (MmType_Param *)data;
FxnAddXArgs *args;
Int num, i, sum = 0;
Int *array;
}
/*
- * ======== start_rpc_task ========
+ * ======== MxServer_skel_compute ========
+ */
+Int32 MxServer_skel_compute(UInt32 size, UInt32 *data)
+{
+ MmType_Param *payload;
+ MxServer_Compute *compute;
+ Int32 result = 0;
+
+ payload = (MmType_Param *)data;
+ compute = (MxServer_Compute *)payload[0].data;
+
+#if CHATTER
+ System_printf("skel_compute: compute=0x%x\n", compute);
+ System_printf("skel_compute: compute size=%d\n", (Int)payload[0].size);
+ System_printf("skel_compute: coef=0x%x\n", compute->coef);
+ System_printf("skel_compute: key=0x%x\n", compute->key);
+ System_printf("skel_compute: size=0x%x\n", compute->size);
+ System_printf("skel_compute: inBuf=0x%x\n", compute->inBuf);
+ System_printf("skel_compute: outBuf=0x%x\n", compute->outBuf);
+#endif
+
+ Cache_inv(compute->inBuf, compute->size * sizeof(uint32_t),
+ Cache_Type_ALL, TRUE);
+ Cache_inv(compute->outBuf, compute->size * sizeof(uint32_t),
+ Cache_Type_ALL, TRUE);
+
+ /* invoke the implementation function */
+ result = MxServer_compute(compute);
+
+ Cache_wbInv(compute->outBuf, compute->size * sizeof(uint32_t),
+ Cache_Type_ALL, TRUE);
+
+ return(result);
+}
+
+/*
+ * ======== register_MxServer ========
+ *
+ * Bootstrap function, must be configured in BIOS.addUserStartupFunctions.
*/
-void start_rpc_task(void)
+void register_MxServer(void)
{
- /* Init service manager */
- System_printf("%s initializing OMAPRPC based service manager endpoint\n",
- MultiProc_getName(MultiProc_self()));
+ Int status = MmServiceMgr_S_SUCCESS;
+
+ System_printf("register_MxServer: -->\n");
+
+ /* must initialize these modules before using them */
+ RcmServer_init();
+ MmServiceMgr_init();
+
+ /* setup the server create params */
+ RcmServer_Params_init(&rpc_Params);
+ rpc_Params.priority = Thread_Priority_ABOVE_NORMAL;
+ rpc_Params.stackSize = 0x1000;
+ rpc_Params.fxns.length = rpc_fxnTab.length;
+ rpc_Params.fxns.elem = rpc_fxnTab.elem;
+
+ /* register an example service */
+ status = MmServiceMgr_register(SERVICE_NAME, &rpc_Params, &rpc_fxnSigTab,
+ RPC_SKEL_SrvDelNotification);
+
+ if (status < 0) {
+ System_printf("register_MxServer: MmServiceMgr_register failed, "
+ "status=%d\n", status);
+ status = -1;
+ goto leave;
+ }
- OmapRpc_createChannel("rpc_example", MultiProc_getId("HOST"),
- RPC_MGR_PORT, RPC_SVR_NUM_FXNS, RPCServerFxns,
- (OmapRpc_SrvDelNotifyFxn)RPC_SKEL_SrvDelNotification);
+leave:
+ System_printf("register_MxServer: <--, status=%d\n", status);
}
diff --git a/packages/ti/ipc/tests/test_omx_ipu_omap5.cfg b/packages/ti/ipc/tests/test_omx_ipu_omap5.cfg
index 9352f3ca56fc43902cca9b798b7046ddb53c43f9..411e1f6c2709e2e7cfe52719b93e51bddf2e17b0 100644 (file)
xdc.loadPackage('ti.ipc.ipcmgr');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
BIOS.addUserStartupFunction('&IpcMgr_rpmsgStartup');
-BIOS.addUserStartupFunction('&start_rpc_task');
+BIOS.addUserStartupFunction('®ister_MxServer');
var Task = xdc.useModule('ti.sysbios.knl.Task');
Task.defaultStackSize = 0x2000;
var Task = xdc.useModule('ti.sysbios.knl.Task');
Task.defaultStackSize = 12 * 0x400;
+
+xdc.loadPackage('ti.ipc.mm');
index d07ff3705932f353178cc1e57a1bdf0db7c39ec9..80fd114738de338dd469064de9e78f5af277466c 100644 (file)
return (found);
}
-Bool ServiceMgr_register(String name, RcmServer_Params *rcmServerParams)
+Bool ServiceMgr_register(String name, RcmServer_Params *rcmServerParams)
{
UInt i;
Bool found = FALSE;
index b646b204c4004fad05022d8745faf3f997a18781..4b2ff3f079f89eb0253ff28174341ccba475b87b 100644 (file)
*
* @sa RcmServer_create
*/
-Bool ServiceMgr_register(String name, RcmServer_Params *rcmServerParams);
+Bool ServiceMgr_register(String name, RcmServer_Params *rcmServerParams);
/*
* ======== ServiceMgr_send ========
index 342c733e5d0c53af901cf6e9cb675f8949d9a968..d1fd00a78f9d96b7735828b6bcf3a3e0ac060cea 100644 (file)
#include <string.h>
#include <stdlib.h>
+#include <ti/ipc/mm/MmType.h>
#include <ti/ipc/rpmsg/MessageQCopy.h>
#include <ti/ipc/rpmsg/NameMap.h>
#include <ti/srvmgr/ServiceMgr.h>
OmapRpc_FuncSignature *funcSigs;
} OmapRpc_Object;
-static Int32 OmapRpc_GetSvrMgrHandle(Void *srvc, Int32 num, Int32 *params)
+Int32 OmapRpc_GetSvrMgrHandle(Void *srvc, Int32 num, Int32 *params)
{
System_printf("OMAPRPC: Calling RCM Service Manager Create Function!\n");
return 0;
Semaphore_post(obj->exitSem);
}
-OmapRpc_Handle OmapRpc_createChannel(String channelName,
- UInt16 dstProc,
- UInt32 port,
- UInt32 numFuncs,
- OmapRpc_FuncDeclaration *fxns,
- OmapRpc_SrvDelNotifyFxn srvDelCBFunc)
+/*
+ * ======== OmapRpc_createChannel ========
+ */
+#if 0
+OmapRpc_Handle OmapRpc_createChannel(String channelName, UInt16 dstProc,
+ UInt32 port, UInt32 numFuncs, OmapRpc_FuncDeclaration *fxns,
+ OmapRpc_SrvDelNotifyFxn srvDelCBFunc)
+#else
+OmapRpc_Handle OmapRpc_createChannel(String channelName, UInt16 dstProc,
+ UInt32 port, RcmServer_Params *rcmParams, MmType_FxnSigTab *fxnSigTab,
+ OmapRpc_SrvDelNotifyFxn srvDelCBFunc)
+#endif
{
- Task_Params taskParams;
- UInt32 func;
+ Task_Params taskParams;
+ UInt32 func;
OmapRpc_Object *obj = Memory_alloc(NULL, sizeof(OmapRpc_Object), 0, NULL);
+
if (obj == NULL) {
System_printf("OMAPRPC: Failed to allocate memory for object!\n");
goto unload;
}
_memset(obj, 0, sizeof(OmapRpc_Object));
- obj->numFuncs = numFuncs+1;
+ obj->numFuncs = fxnSigTab->count + 1;
+#if 0
RcmServer_Params_init(&obj->rcmParams);
obj->rcmParams.priority = Thread_Priority_ABOVE_NORMAL;
obj->rcmParams.stackSize = 0x1000;
obj->rcmParams.fxns.length = obj->numFuncs;
- obj->rcmParams.fxns.elem = Memory_alloc(NULL, sizeof(RcmServer_FxnDesc)*obj->numFuncs, 0, NULL);
+ obj->rcmParams.fxns.elem = Memory_alloc(NULL,
+ sizeof(RcmServer_FxnDesc) * obj->numFuncs, 0, NULL);
+
+ if (obj->rcmParams.fxns.elem == NULL) {
+ System_printf("OMAPRPC: Failed to allocate RCM function list!\n");
+ goto unload;
+ }
+#else
+ memcpy(&obj->rcmParams, rcmParams, sizeof(RcmServer_Params));
+ obj->rcmParams.fxns.length = obj->numFuncs;
+ obj->rcmParams.fxns.elem = Memory_calloc(NULL, obj->numFuncs *
+ sizeof(RcmServer_FxnDesc), 0, NULL);
+
if (obj->rcmParams.fxns.elem == NULL) {
System_printf("OMAPRPC: Failed to allocate RCM function list!\n");
goto unload;
}
+#endif
+
// setup other variables...
obj->shutdown = FALSE;
obj->dstProc = dstProc;
strncpy(obj->channelName, channelName, OMAPRPC_MAX_CHANNEL_NAMELEN-1);
obj->channelName[OMAPRPC_MAX_CHANNEL_NAMELEN-1]='\0';
obj->srvDelCB = srvDelCBFunc;
- obj->funcSigs = Memory_alloc(NULL, sizeof(OmapRpc_FuncSignature)*obj->numFuncs, 0, NULL);
+ obj->funcSigs = Memory_alloc(NULL, obj->numFuncs *
+ sizeof(OmapRpc_FuncSignature), 0, NULL);
+
if (obj->funcSigs == NULL) {
System_printf("OMAPRPC: Failed to allocate signtures list!\n");
goto unload;
}
- // setup the RCM functions and Signatures
- for (func = 0; func < obj->numFuncs; func++)
- {
- if (func == 0)
- {
+
+ /* setup the RCM functions and Signatures */
+ for (func = 0; func < obj->numFuncs; func++) {
+ if (func == 0) {
// assign the "first function"
- obj->rcmParams.fxns.elem[func].name = OmapRpc_Stringerize(OmapRpc_GetSvrMgrHandle);
- obj->rcmParams.fxns.elem[func].addr.createFxn = (RcmServer_MsgCreateFxn)OmapRpc_GetSvrMgrHandle;
+ obj->rcmParams.fxns.elem[func].name =
+ OmapRpc_Stringerize(OmapRpc_GetSvrMgrHandle);
+ obj->rcmParams.fxns.elem[func].addr.createFxn =
+ (RcmServer_MsgCreateFxn)OmapRpc_GetSvrMgrHandle;
- strncpy(obj->funcSigs[func].name,
- obj->rcmParams.fxns.elem[0].name,
+ strncpy(obj->funcSigs[func].name, obj->rcmParams.fxns.elem[0].name,
OMAPRPC_MAX_CHANNEL_NAMELEN);
obj->funcSigs[func].numParam = 0;
}
- else
- {
+ else {
// assign the other functions
- obj->rcmParams.fxns.elem[func].name = fxns[func-1].signature.name;
- obj->rcmParams.fxns.elem[func].addr.fxn = (RcmServer_MsgFxn)fxns[func-1].function;
+// obj->rcmParams.fxns.elem[func].name = fxns[func-1].signature.name;
+ obj->rcmParams.fxns.elem[func].name =
+ rcmParams->fxns.elem[func-1].name;
+// obj->rcmParams.fxns.elem[func].addr.fxn =
+// (RcmServer_MsgFxn)fxns[func-1].function;
+ obj->rcmParams.fxns.elem[func].addr.fxn =
+ rcmParams->fxns.elem[func-1].addr.fxn;
// copy the signature
- memcpy(&obj->funcSigs[func],
- &fxns[func-1].signature,
- sizeof(OmapRpc_FuncSignature));
+// memcpy(&obj->funcSigs[func], &fxns[func-1].signature,
+// sizeof(OmapRpc_FuncSignature));
+ memcpy(&obj->funcSigs[func], &fxnSigTab->table[func - 1],
+ sizeof(MmType_FxnSig));
}
}
ServiceMgr_init();
+
if (ServiceMgr_register(channelName, &obj->rcmParams) == TRUE) {
System_printf("OMAPRPC: registered channel: %s\n", obj->channelName);
+
obj->msgq = MessageQCopy_create(obj->port, NULL, NULL,&obj->localEndPt);
+
if (obj->msgq == NULL) {
goto unload;
}
+
Task_Params_init(&taskParams);
taskParams.instance->name = channelName;
taskParams.priority = 1; /* Lowest priority thread */
taskParams.arg0 = (UArg)obj;
+
obj->exitSem = Semaphore_create(0, NULL, NULL);
+
if (obj->exitSem == NULL) {
goto unload;
}
+
obj->taskHandle = Task_create(omapRpcTask, &taskParams, NULL);
+
if (obj->taskHandle == NULL) {
goto unload;
}
}
else {
System_printf("OMAPRPC: FAILED to register channel: %s\n",
- obj->channelName);
+ obj->channelName);
}
+
System_printf("OMAPRPC: Returning Object %p\n", obj);
- return obj;
+ return(obj);
+
unload:
OmapRpc_deleteChannel(obj);
- return NULL;
+ return(NULL);
}
Int OmapRpc_deleteChannel(OmapRpc_Handle handle)
Memory_free(NULL, obj, sizeof(*obj));
return OmapRpc_S_SUCCESS;
}
+
+#if 0
+/*
+ * ======== OmapRpc_start ========
+ */
+Int OmapRpc_start(const String name, Int port, Int aryLen,
+ OmapRpc_FuncSignature *sigAry)
+{
+ Int status = OmapRpc_S_SUCCESS;
+ Task_Params taskParams;
+ OmapRpc_Object *obj;
+
+ /* create an instance */
+ obj = Memory_calloc(NULL, sizeof(OmapRpc_Object), 0, NULL);
+
+ if (obj == NULL) {
+ System_printf("OMAPRPC: Failed to allocate memory for object!\n");
+ status = OmapRpc_E_FAIL;
+ goto leave;
+ }
+
+ obj->numFuncs = aryLen + 1;
+ obj->shutdown = FALSE;
+ obj->dstProc = MultiProc_getId("HOST");
+ obj->port = port;
+ strncpy(obj->channelName, name, OMAPRPC_MAX_CHANNEL_NAMELEN-1);
+ obj->channelName[OMAPRPC_MAX_CHANNEL_NAMELEN-1]='\0';
+ obj->srvDelCB = srvDelCBFunc;
+ obj->funcSigs = Memory_alloc(NULL,
+ sizeof(OmapRpc_FuncSignature) * obj->numFuncs, 0, NULL);
+
+ if (obj->funcSigs == NULL) {
+ System_printf("OMAPRPC: Failed to allocate signtures list!\n");
+ goto unload;
+ }
+
+ /* setup the functions and signatures */
+ for (func = 0; func < obj->numFuncs; func++) {
+ if (func == 0) {
+ // assign the "first function"
+// strncpy(obj->funcSigs[func].name, obj->rcmParams.fxns.elem[0].name,
+// OMAPRPC_MAX_CHANNEL_NAMELEN);
+ strncpy(obj->funcSigs[func].name,
+ OmapRpc_Stringerize(OmapRpc_GetSvrMgrHandle),
+ OMAPRPC_MAX_CHANNEL_NAMELEN);
+ obj->funcSigs[func].numParam = 0;
+ }
+ else {
+ // copy the signature
+ memcpy(&obj->funcSigs[func], &fxns[func-1].signature,
+ sizeof(OmapRpc_FuncSignature));
+ }
+ }
+
+ obj->msgq = MessageQCopy_create(obj->port, NULL, NULL,&obj->localEndPt);
+
+ if (obj->msgq == NULL) {
+ goto unload;
+ }
+
+ Task_Params_init(&taskParams);
+ taskParams.instance->name = channelName;
+ taskParams.priority = 1; /* Lowest priority thread */
+ taskParams.arg0 = (UArg)obj;
+
+ obj->exitSem = Semaphore_create(0, NULL, NULL);
+
+ if (obj->exitSem == NULL) {
+ goto unload;
+ }
+
+ obj->taskHandle = Task_create(omapRpcTask, &taskParams, NULL);
+
+ if (obj->taskHandle == NULL) {
+ goto unload;
+ }
+
+ System_printf("OMAPRPC: Returning Object %p\n", obj);
+ return(obj);
+
+leave:
+ if (status < 0) {
+ OmapRpc_deleteChannel(obj);
+ }
+ return(status);
+}
+#endif
index 415c2fd79cee3d79ab318cb0bc36d5018fa5129c..b5b241d56a1d078ed26a0a200c126c7c9e393ca6 100644 (file)
#define ti_srvmgr_OmapRpc__include
#include <ti/grcm/RcmServer.h>
+#include <ti/ipc/mm/MmType.h>
#if defined (__cplusplus)
typedef struct OmapRpc_Object *OmapRpc_Handle;
typedef Void (*OmapRpc_SrvDelNotifyFxn)(Void);
-OmapRpc_Handle OmapRpc_createChannel(String channelName,
- UInt16 dstProc,
- UInt32 port,
- UInt32 numFuncs,
- OmapRpc_FuncDeclaration* fxns,
- OmapRpc_SrvDelNotifyFxn func);
+#if 0
+OmapRpc_Handle OmapRpc_createChannel(String channelName, UInt16 dstProc,
+ UInt32 port, UInt32 numFuncs, OmapRpc_FuncDeclaration* fxns,
+ OmapRpc_SrvDelNotifyFxn func);
+#else
+OmapRpc_Handle OmapRpc_createChannel(String channelName, UInt16 dstProc,
+ UInt32 port, RcmServer_Params *rcmParams, MmType_FxnSigTab *fxnSigTab,
+ OmapRpc_SrvDelNotifyFxn srvDelCBFunc);
+#endif
Int OmapRpc_deleteChannel(OmapRpc_Handle handle);
diff --git a/products.mak b/products.mak
index 3e330d5cfb390be837129ec16c5b88aedd8b54c7..5e74c17dbc841b744bfdf830e926e64cdfaa2bf5 100644 (file)
--- a/products.mak
+++ b/products.mak
# Set up required cross compiler path for IPC Linux configuration and build
TOOLCHAIN_LONGNAME ?=arm-none-linux-gnueabi
TOOLCHAIN_INSTALL_DIR ?= $(DEPOT)/_your_arm_code_gen_install_
-TOOLCHAIN_PREFIX= $(TOOLCHAIN_INSTALL_DIR)/bin/$(TOOLCHAIN_LONGNAME)-
+TOOLCHAIN_PREFIX = $(TOOLCHAIN_INSTALL_DIR)/bin/$(TOOLCHAIN_LONGNAME)-
+KERNEL_INSTALL_DIR =
# Linux platform to build (optional)
# Run './configure --help' for available PLATFORM options
index ab9ed8c84fd4c0edfb439b35aeb1c5ad4f03428e..200ae8937cbed41205cac412838164414cdb1d1c 100644 (file)
# source path
EXTRA_SRCVPATH = $(IPC_REPO)/packages/ti/ipc/tests
-SRCS = mmrpc_test.c
+SRCS = Mx.c mmrpc_test.c
EXCLUDE_OBJS =