summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 495bef3)
raw | patch | inline | side by side (parent: 495bef3)
author | G Anthony <a0783926@ti.com> | |
Wed, 27 Mar 2013 23:21:45 +0000 (16:21 -0700) | ||
committer | G Anthony <a0783926@ti.com> | |
Mon, 1 Apr 2013 21:15:24 +0000 (14:15 -0700) |
MessageQCopy is really an API which uses the RPMSG protocol to send and
receive fixed size payloads.
To avoid confusion with MessageQ, which can work over various transports,
MessageQCopy is renamed RPMessage.
This API is used directly by the TransportRpmsg MessageQ copy transport,
and the gRCM module.
Signed-off-by: G Anthony <a0783926@ti.com>
receive fixed size payloads.
To avoid confusion with MessageQ, which can work over various transports,
MessageQCopy is renamed RPMessage.
This API is used directly by the TransportRpmsg MessageQ copy transport,
and the gRCM module.
Signed-off-by: G Anthony <a0783926@ti.com>
21 files changed:
index 5ceef3e1e9fbef12364e2479961a5e8e15aeb44e..96ca2afaaa652f569ed891972bf09812b0a3c22e 100644 (file)
var Memory = xdc.useModule('xdc.runtime.Memory');
Memory.defaultHeapSize = 0x20000;
-/* Modules used in the virtqueue/MessageQCopy/ServiceMgr libraries: */
+/* Modules used in the virtqueue/RPMessage/ServiceMgr libraries: */
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
diff --git a/packages/ti/configs/omap54xx/IpcCommon.cfg.xs b/packages/ti/configs/omap54xx/IpcCommon.cfg.xs
index afbc64fd43a5c951bfdbba2aeedf85045dc4d025..7cc8564a9fb2214c5e912c6010fceec5bbc06876 100644 (file)
var Memory = xdc.useModule('xdc.runtime.Memory');
Memory.defaultHeapSize = 0x20000;
-/* Modules used in the virtqueue/MessageQCopy/ServiceMgr libraries: */
+/* Modules used in the virtqueue/RPMessage/ServiceMgr libraries: */
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
index 6ed7b5108ecbcfee143bd087de7ad0000221ddb1..168030b010824fa451008eed0e1d99f3e1e72022 100644 (file)
#include <xdc/runtime/knl/Thread.h>
#include <xdc/runtime/System.h>
-#define MSGBUFFERSIZE 512 // Make global and move to MessageQCopy.h
+#define MSGBUFFERSIZE 512 // Make global and move to RPMessage.h
#if defined(RCM_ti_ipc)
#include <ti/sdo/utils/List.h>
#include "RcmTypes.h"
#include "RcmServer.h"
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
#include <ti/srvmgr/rpmsg_omx.h>
#endif
typedef struct { // function table element
String name;
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
union {
RcmServer_MsgFxn fxn;
RcmServer_MsgCreateFxn createFxn;
typedef struct RcmServer_Object_tag {
GateThread_Struct gate; // instance gate
Ptr run; // run semaphore for the server
-#if USE_MESSAGEQCOPY
- MessageQCopy_Handle serverQue; // inbound message queue
+#if USE_RPMESSAGE
+ RPMessage_Handle serverQue; // inbound message queue
UInt32 localAddr; // inbound message queue address
UInt32 replyAddr; // Reply address (same per inst.)
UInt32 dstProc; // Reply processor.
{
Error_Block eb;
List_Params listP;
-#if USE_MESSAGEQCOPY == 0
+#if USE_RPMESSAGE == 0
MessageQ_Params mqParams;
#endif
Thread_Params threadP;
}
/* create the message queue for inbound messages */
-#if USE_MESSAGEQCOPY
- obj->serverQue = MessageQCopy_create(MessageQCopy_ASSIGN_ANY, NULL, NULL,
+#if USE_RPMESSAGE
+ obj->serverQue = RPMessage_create(RPMessage_ASSIGN_ANY, NULL, NULL,
&obj->localAddr);
#ifdef BIOS_ONLY_TEST
obj->dstProc = MultiProc_self();
List_Handle listH;
List_Handle msgQueH;
RcmClient_Packet *packet;
-#if USE_MESSAGEQCOPY == 0
+#if USE_RPMESSAGE == 0
MessageQ_Msg msgqMsg;
#endif
SemThread_Handle semThreadH;
obj->shutdown = TRUE;
if (obj->serverThread != NULL) {
-#if USE_MESSAGEQCOPY
- MessageQCopy_unblock(obj->serverQue);
+#if USE_RPMESSAGE
+ RPMessage_unblock(obj->serverQue);
#else
MessageQ_unblock(obj->serverQue);
#endif
(IArg)job->jobId, (IArg)packet);
RcmServer_setStatusCode_I(packet, RcmServer_Status_Unprocessed);
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
packet->hdr.type = OMX_RAW_MSG;
packet->hdr.len = PACKET_DATA_SIZE + packet->message.dataSize;
- rval = MessageQCopy_send(obj->dstProc, obj->replyAddr,
+ rval = RPMessage_send(obj->dstProc, obj->replyAddr,
obj->localAddr, (Ptr)&packet->hdr,
PACKET_HDR_SIZE + packet->message.dataSize);
#else
(IArg)packet->msgId, (IArg)packet);
RcmServer_setStatusCode_I(packet, RcmServer_Status_Unprocessed);
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
packet->hdr.type = OMX_RAW_MSG;
packet->hdr.len = PACKET_DATA_SIZE + packet->message.dataSize;
- rval = MessageQCopy_send(obj->dstProc, obj->replyAddr,
+ rval = RPMessage_send(obj->dstProc, obj->replyAddr,
obj->localAddr, (Ptr)&packet->hdr,
PACKET_HDR_SIZE + packet->message.dataSize);
#else
}
if (NULL != obj->serverQue) {
-#if USE_MESSAGEQCOPY
- MessageQCopy_delete(&obj->serverQue);
+#if USE_RPMESSAGE
+ RPMessage_delete(&obj->serverQue);
#else
MessageQ_delete(&obj->serverQue);
#endif
Int RcmServer_execMsg_I(RcmServer_Object *obj, RcmClient_Message *msg)
{
RcmServer_MsgFxn fxn;
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
RcmServer_MsgCreateFxn createFxn = NULL;
#endif
Int status;
System_printf("RcmServer_execMsg_I: Calling fxnIdx: %d\n",
(msg->fxnIdx & 0x0000FFFF));
#endif
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
if (createFxn) {
msg->result = (*createFxn)(obj, msg->dataSize, msg->data);
}
UInt32 fxnIdx;
RcmServer_MsgFxn fxn;
RcmClient_Message *rcmMsg;
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
RcmServer_MsgCreateFxn createFxn = NULL;
#endif
-#if USE_MESSAGEQCOPY == 0
+#if USE_RPMESSAGE == 0
MessageQ_Msg msgqMsg;
#endif
UInt16 messageType;
/* decode the message */
rcmMsg = &packet->message;
-#if USE_MESSAGEQCOPY == 0
+#if USE_RPMESSAGE == 0
msgqMsg = &packet->msgqHeader;
#endif
Log_print1(Diags_INFO, FXNN": message desc=0x%x", (IArg)packet->desc);
RcmServer_setStatusCode_I(packet, RcmServer_Status_SUCCESS);
}
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
#if 0
System_printf("RcmServer_process_P: Sending reply from: %d to: %d\n",
obj->localAddr, obj->replyAddr);
packet->hdr.type = OMX_RAW_MSG;
packet->hdr.len = PACKET_DATA_SIZE + packet->message.dataSize;
- status = MessageQCopy_send(obj->dstProc, obj->replyAddr,
+ status = RPMessage_send(obj->dstProc, obj->replyAddr,
obj->localAddr, (Ptr)&packet->hdr,
PACKET_HDR_SIZE + packet->message.dataSize);
#else
/* if all went well, free the message */
if ((status >= 0) && (rcmMsg->result >= 0)) {
-#if USE_MESSAGEQCOPY == 0
+#if USE_RPMESSAGE == 0
status = MessageQ_free(msgqMsg);
#endif
if (status < 0) {
}
/* send error message back to client */
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
packet->hdr.type = OMX_RAW_MSG;
packet->hdr.len = PACKET_DATA_SIZE + packet->message.dataSize;
- status = MessageQCopy_send(obj->dstProc, obj->replyAddr,
+ status = RPMessage_send(obj->dstProc, obj->replyAddr,
obj->localAddr, (Ptr)&packet->hdr,
PACKET_HDR_SIZE + packet->message.dataSize);
#else
Error_init(&eb);
}
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
packet->hdr.type = OMX_RAW_MSG;
packet->hdr.len = PACKET_DATA_SIZE + packet->message.dataSize;
- status = MessageQCopy_send(obj->dstProc, obj->replyAddr,
+ status = RPMessage_send(obj->dstProc, obj->replyAddr,
obj->localAddr, (Ptr)&packet->hdr,
PACKET_HDR_SIZE + packet->message.dataSize);
#else
}
/* invoke the function with a null context */
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
if (createFxn) {
(*createFxn)(obj, 0, NULL);
}
rcmMsg->result = 0;
}
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
packet->hdr.type = OMX_RAW_MSG;
packet->hdr.len = PACKET_DATA_SIZE + packet->message.dataSize;
- status = MessageQCopy_send(obj->dstProc, obj->replyAddr,
+ status = RPMessage_send(obj->dstProc, obj->replyAddr,
obj->localAddr, (Ptr)&packet->hdr,
PACKET_HDR_SIZE + packet->message.dataSize);
#else
rcmMsg->result = 0;
}
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
packet->hdr.type = OMX_RAW_MSG;
packet->hdr.len = PACKET_DATA_SIZE + packet->message.dataSize;
- status = MessageQCopy_send(obj->dstProc, obj->replyAddr,
+ status = RPMessage_send(obj->dstProc, obj->replyAddr,
obj->localAddr, (Ptr)&packet->hdr,
PACKET_HDR_SIZE + packet->message.dataSize);
#else
rcmMsg->result = 0;
}
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
packet->hdr.type = OMX_RAW_MSG;
packet->hdr.len = PACKET_DATA_SIZE + packet->message.dataSize;
- status = MessageQCopy_send(obj->dstProc, obj->replyAddr,
+ status = RPMessage_send(obj->dstProc, obj->replyAddr,
obj->localAddr, (Ptr)&packet->hdr,
PACKET_HDR_SIZE + packet->message.dataSize);
#else
List_Handle msgQueH;
RcmClient_Packet *packet;
RcmServer_JobStream *job;
-#if USE_MESSAGEQCOPY == 0
+#if USE_RPMESSAGE == 0
MessageQ_Msg msgqMsg;
#endif
Int rval;
RcmServer_setStatusCode_I(packet, RcmServer_Status_Unprocessed);
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
packet->hdr.type = OMX_RAW_MSG;
packet->hdr.len = PACKET_DATA_SIZE + packet->message.dataSize;
- rval = MessageQCopy_send(obj->dstProc, obj->replyAddr,
+ rval = RPMessage_send(obj->dstProc, obj->replyAddr,
obj->localAddr, (Ptr)&packet->hdr,
PACKET_HDR_SIZE + packet->message.dataSize);
#else
{
Error_Block eb;
RcmClient_Packet *packet;
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
Char recvBuf[MSGBUFFERSIZE];
UInt16 len;
#else
RcmServer_Object *obj = (RcmServer_Object *)arg;
Int dataSize;
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
packet = (RcmClient_Packet *)&recvBuf[0];
#endif
/* block until message arrives */
do {
-#if USE_MESSAGEQCOPY
- rval = MessageQCopy_recv(obj->serverQue, (Ptr)&packet->hdr, &len,
- &obj->replyAddr, MessageQCopy_FOREVER);
+#if USE_RPMESSAGE
+ rval = RPMessage_recv(obj->serverQue, (Ptr)&packet->hdr, &len,
+ &obj->replyAddr, RPMessage_FOREVER);
#if 0
System_printf("RcmServer_serverThrFxn_P: Received msg of len %d "
"from: %d\n",
Assert_isTrue((packet->hdr.type == OMX_RAW_MSG) ||
(packet->hdr.type == OMX_DISC_REQ) , NULL);
- if ((rval < 0) && (rval != MessageQCopy_E_UNBLOCKED)) {
+ if ((rval < 0) && (rval != RPMessage_E_UNBLOCKED)) {
#else
rval = MessageQ_get(obj->serverQue, &msgqMsg, MessageQ_FOREVER);
if ((rval < 0) && (rval != MessageQ_E_UNBLOCKED)) {
Log_error1(FXNN": ipc error 0x%x", (IArg)rval);
/* keep running and hope for the best */
}
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
} while (FALSE);
#else
} while ((msgqMsg == NULL) && !obj->shutdown);
#endif
/* if shutdown, exit this thread */
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
if (obj->shutdown || packet->hdr.type == OMX_DISC_REQ) {
running = FALSE;
Log_print1(Diags_INFO,
}
#endif
-#if USE_MESSAGEQCOPY == 0
+#if USE_RPMESSAGE == 0
packet = (RcmClient_Packet *)msgqMsg;
#endif
packet->message.result = rval;
/* return the message to the client */
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
#if 0
System_printf("RcmServer_serverThrFxn_P: "
"Sending response from: %d to: %d\n",
packet->message.dataSize;
dataSize = PACKET_HDR_SIZE + packet->message.dataSize;
}
- rval = MessageQCopy_send(obj->dstProc, obj->replyAddr,
+ rval = RPMessage_send(obj->dstProc, obj->replyAddr,
obj->localAddr, (Ptr)&packet->hdr, dataSize);
#else
rval = MessageQ_put(MessageQ_getReplyQueue(msgqMsg), msgqMsg);
}
packet->message.result = rval;
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
packet->hdr.type = OMX_RAW_MSG;
packet->hdr.len = PACKET_DATA_SIZE + packet->message.dataSize;
- rval = MessageQCopy_send(
+ rval = RPMessage_send(
(obj->server)->dstProc,
(obj->server)->replyAddr,
(obj->server)->localAddr, (Ptr)&packet->hdr,
index 845af611e4eaec32ae19fd657b1854bbe290968c..10dafea9d8ea600fec8bf23db918ff53cd3de5d2 100644 (file)
#include <xdc/runtime/knl/GateThread.h>
#include <xdc/runtime/knl/Thread.h>
-/* For USE_MESSAGEQCOPY setting */
+/* For USE_RPMESSAGE setting */
#include <ti/grcm/RcmTypes.h>
typedef Int32 (*RcmServer_MsgFxn)(UInt32, UInt32 *);
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
/* This is a special function which gets the RcmServer handle as first parameter
* so that OMX_GetHandle() or other creation functions can store the RcmServer
* handle in their own context. This is needed to allow functions to send
*
* The server will ultimately branch to this address.
*/
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
union {
RcmServer_MsgFxn fxn;
RcmServer_MsgCreateFxn createFxn;
typedef struct {
GateThread_Struct _f1;
Ptr _f2;
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
Ptr _f3a;
UInt32 _f3b;
UInt32 _f3c;
);
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
/*
* ======== RcmServer_getLocalAddress ========
*/
index bd342780a20db3826ba245124b6878614e61f007..876d3862f1d8daa0a5cd15efea0e256f7d8b3cc4 100644 (file)
#define ti_grcm_RcmTypes_h
/*
- * Force use of the MessageQCopy instead of MessageQ API for SysLink 3 IPC.
+ * Force use of the RPMessage instead of MessageQ API for SysLink 3 IPC.
* This is temporary to get a protoype working.
- * Ideally, MessageQCopy should not be needed.
+ * Ideally, RPMessage should not be needed.
*/
-#define USE_MESSAGEQCOPY 1
+#define USE_RPMESSAGE 1
-#if USE_MESSAGEQCOPY
-#include <ti/ipc/rpmsg/MessageQCopy.h>
+#if USE_RPMESSAGE
+#include <ti/ipc/rpmsg/RPMessage.h>
#else
#include <ti/ipc/MessageQ.h>
#endif
/* the packet structure (actual message send to server) */
-#if USE_MESSAGEQCOPY
+#if USE_RPMESSAGE
/* Need to deal with this structure, as Linux side rpmsg_omx driver needs it: */
struct rpmsg_omx_hdr {
UInt32 type;
#define PACKET_DATA_SIZE (PACKET_HDR_SIZE - sizeof(struct rpmsg_omx_hdr))
/* To test on BIOS side only, uncomment and rebuild anything that
- * calls MessageQCopy()
+ * calls RPMessage()
*/
//#define BIOS_ONLY_TEST
index f34a2e3fffd97c4095e2f568a02b1654fbfebac0..59290add0d7c1802a95415dda6f5c3c3c4088716 100644 (file)
#include <ti/ipc/MultiProc.h>
#include <ti/ipc/namesrv/NameServerRemoteRpmsg.h>
#include <ti/ipc/transports/TransportRpmsgSetup.h>
-#include <ti/ipc/rpmsg/_MessageQCopy.h>
+#include <ti/ipc/rpmsg/_RPMessage.h>
/*
* ======== IpcMgr_rpmsgStartup ========
Void IpcMgr_rpmsgStartup()
{
Assert_isTrue(MultiProc_self() != MultiProc_getId("HOST"), NULL);
- MessageQCopy_init(MultiProc_getId("HOST"));
+ RPMessage_init(MultiProc_getId("HOST"));
}
/*
* ======== IpcMgr_ipcStartup ========
* Initialize MessageQ Transport stack built over RPMSG.
- * This ends up calling MessageQCopy_init().
+ * This ends up calling RPMessage_init().
*
* Use for stacks built on MessageQ/TransportRpmsg only.
*/
diff --git a/packages/ti/ipc/namesrv/NameServerRemoteRpmsg.c b/packages/ti/ipc/namesrv/NameServerRemoteRpmsg.c
index f0fe4024a38b3da8b9684d5e84926ec9140148c5..b0f08e59c93e598ed22f89b1e4f626875ccd4045 100644 (file)
#include <ti/sdo/utils/INameServerRemote.h>
#include <ti/ipc/MultiProc.h>
#include <ti/ipc/namesrv/_NameServerRemoteRpmsg.h>
-#include <ti/ipc/rpmsg/MessageQCopy.h>
+#include <ti/ipc/rpmsg/RPMessage.h>
#include "package/internal/NameServerRemoteRpmsg.xdc.h"
Log_print3(Diags_INFO, FXNN": Requesting from procId %d, %s:%s...\n",
obj->remoteProcId, (IArg)msg.instanceName, (IArg)msg.name);
- MessageQCopy_send(obj->remoteProcId, NameServerRemoteRpmsg_module->nsPort,
+ RPMessage_send(obj->remoteProcId, NameServerRemoteRpmsg_module->nsPort,
RPMSG_MESSAGEQ_PORT, (Ptr)&msg, sizeof(msg));
/* Now pend for response */
msg->request = NameServerRemoteRpmsg_RESPONSE;
/* send response message to remote processor */
- MessageQCopy_send(dstProc, NameServerRemoteRpmsg_module->nsPort,
+ RPMessage_send(dstProc, NameServerRemoteRpmsg_module->nsPort,
RPMSG_MESSAGEQ_PORT, (Ptr)msg, sizeof(NameServerRemote_Msg));
}
else {
index 7bc4f9e0259a24d95555bf29a17fd5381ea29cc6..c15a22349984d212e7d05ee80f200514b6aaa07b 100644 (file)
#include <xdc/runtime/System.h>
#include <ti/ipc/MultiProc.h>
-#include <ti/ipc/rpmsg/MessageQCopy.h>
+#include <ti/ipc/rpmsg/RPMessage.h>
#define RPMSG_NAME_SIZE 32
nsMsg.addr = port;
nsMsg.flags = flags;
- s = MessageQCopy_send(MultiProc_getId("HOST"), 53, port, &nsMsg,
+ s = RPMessage_send(MultiProc_getId("HOST"), 53, port, &nsMsg,
sizeof(nsMsg));
if (s < 0) {
- System_abort("Fatal ERROR in NameMap sendMessage: MessageQCopy_send()"
+ System_abort("Fatal ERROR in NameMap sendMessage: RPMessage_send()"
" failed! Aborting...\n");
}
}
similarity index 85%
rename from packages/ti/ipc/rpmsg/MessageQCopy.c
rename to packages/ti/ipc/rpmsg/RPMessage.c
index 492ee1e0f0c8078328bfd330b350c613bb648316..bc6b91f63b270805fcba2055831a047d39f1b765 100644 (file)
rename from packages/ti/ipc/rpmsg/MessageQCopy.c
rename to packages/ti/ipc/rpmsg/RPMessage.c
index 492ee1e0f0c8078328bfd330b350c613bb648316..bc6b91f63b270805fcba2055831a047d39f1b765 100644 (file)
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** ============================================================================
- * @file MessageQCopy.c
+ * @file RPMessage.c
*
* @brief A simple copy-based MessageQ, to work with Linux virtio_rp_msg.
*
*/
/* this define must precede inclusion of any xdc header file */
-#define Registry_CURDESC ti_ipc_rpmsg_MessageQCopy__Desc
-#define MODULE_NAME "ti.ipc.rpmsg.MessageQCopy"
+#define Registry_CURDESC ti_ipc_rpmsg_RPMessage__Desc
+#define MODULE_NAME "ti.ipc.rpmsg.RPMessage"
#include <xdc/std.h>
#include <string.h>
#include <ti/sdo/utils/List.h>
#include <ti/ipc/MultiProc.h>
-#include <ti/ipc/rpmsg/MessageQCopy.h>
+#include <ti/ipc/rpmsg/RPMessage.h>
#include "_VirtQueue.h"
#define MAXHEAPSIZE (MAXMESSAGEBUFFERS * MSGBUFFERSIZE)
#define HEAPALIGNMENT 8
-/* The MessageQCopy Object */
-typedef struct MessageQCopy_Object {
+/* The RPMessage Object */
+typedef struct RPMessage_Object {
UInt32 queueId; /* Unique id (procId | queueIndex) */
Semaphore_Handle semHandle; /* I/O Completion */
- MessageQCopy_callback cb; /* MessageQCopy Callback */
+ RPMessage_callback cb; /* RPMessage Callback */
UArg arg; /* Callback argument */
List_Handle queue; /* Queue of pending messages */
Bool unblocked; /* Use with signal to unblock _receive() */
-} MessageQCopy_Object;
+} RPMessage_Object;
/* Module_State */
-typedef struct MessageQCopy_Module {
+typedef struct RPMessage_Module {
/* Instance gate: */
GateAll_Handle gateH;
/* Array of messageQObjects in the system: */
- struct MessageQCopy_Object *msgqObjects[MAXMESSAGEQOBJECTS];
+ struct RPMessage_Object *msgqObjects[MAXMESSAGEQOBJECTS];
/* Heap from which to allocate free messages for copying: */
HeapBuf_Handle heap;
-} MessageQCopy_Module;
+} RPMessage_Module;
/* Message Header: Must match mp_msg_hdr in virtio_rp_msg.h on Linux side. */
-typedef struct MessageQCopy_MsgHeader {
+typedef struct RPMessage_MsgHeader {
Bits32 srcAddr; /* source endpoint addr */
Bits32 dstAddr; /* destination endpoint addr */
Bits32 reserved; /* reserved */
Bits16 dataLen; /* data length */
Bits16 flags; /* bitmask of different flags */
UInt8 payload[]; /* Data payload */
-} MessageQCopy_MsgHeader;
+} RPMessage_MsgHeader;
-typedef MessageQCopy_MsgHeader *MessageQCopy_Msg;
+typedef RPMessage_MsgHeader *RPMessage_Msg;
/* Element to hold payload copied onto receiver's queue. */
typedef struct Queue_elem {
} Queue_elem;
/* Combine transport related objects into a struct for future migration: */
-typedef struct MessageQCopy_Transport {
+typedef struct RPMessage_Transport {
Swi_Handle swiHandle;
VirtQueue_Handle virtQueue_toHost;
VirtQueue_Handle virtQueue_fromHost;
Semaphore_Handle semHandle_toHost;
-} MessageQCopy_Transport;
+} RPMessage_Transport;
/* module diags mask */
Registry_Desc Registry_CURDESC;
-static MessageQCopy_Module module;
-static MessageQCopy_Transport transport;
+static RPMessage_Module module;
+static RPMessage_Transport transport;
/* We create a fixed size heap over this memory for copying received msgs */
#pragma DATA_ALIGN (recv_buffers, HEAPALIGNMENT)
static Int curInit = 0;
/*
- * ======== MessageQCopy_swiFxn ========
+ * ======== RPMessage_swiFxn ========
*/
-#define FXNN "MessageQCopy_swiFxn"
-static Void MessageQCopy_swiFxn(UArg arg0, UArg arg1)
+#define FXNN "RPMessage_swiFxn"
+static Void RPMessage_swiFxn(UArg arg0, UArg arg1)
{
Int16 token;
- MessageQCopy_Msg msg;
+ RPMessage_Msg msg;
UInt16 dstProc = MultiProc_self();
Bool usedBufAdded = FALSE;
int len;
(IArg)msg->srcAddr, (IArg)msg->dstAddr, (IArg)msg->dataLen);
/* Pass to destination queue (on this proc), or callback: */
- MessageQCopy_send(dstProc, msg->dstAddr, msg->srcAddr,
+ RPMessage_send(dstProc, msg->dstAddr, msg->srcAddr,
(Ptr)msg->payload, msg->dataLen);
VirtQueue_addUsedBuf(transport.virtQueue_fromHost, token,
#undef FXNN
/* =============================================================================
- * MessageQCopy Functions:
+ * RPMessage Functions:
* =============================================================================
*/
*
*
*/
-#define FXNN "MessageQCopy_init"
-Void MessageQCopy_init(UInt16 remoteProcId)
+#define FXNN "RPMessage_init"
+Void RPMessage_init(UInt16 remoteProcId)
{
GateAll_Params gatePrms;
HeapBuf_Params prms;
prms.align = HEAPALIGNMENT;
module.heap = HeapBuf_create(&prms, NULL);
if (module.heap == 0) {
- System_abort("MessageQCopy_init: HeapBuf_create returned 0\n");
+ System_abort("RPMessage_init: HeapBuf_create returned 0\n");
}
transport.semHandle_toHost = Semaphore_create(0, NULL, NULL);
VirtQueue_startup(remoteProcId, isHost);
/* construct the Swi to process incoming messages: */
- transport.swiHandle = Swi_create(MessageQCopy_swiFxn, NULL, NULL);
+ transport.swiHandle = Swi_create(RPMessage_swiFxn, NULL, NULL);
exit:
Log_print0(Diags_EXIT, "<-- "FXNN);
/*
* ======== MessasgeQCopy_finalize ========
*/
-#define FXNN "MessageQCopy_finalize"
-Void MessageQCopy_finalize()
+#define FXNN "RPMessage_finalize"
+Void RPMessage_finalize()
{
Log_print0(Diags_ENTRY, "--> "FXNN);
#undef FXNN
/*
- * ======== MessageQCopy_create ========
+ * ======== RPMessage_create ========
*/
-#define FXNN "MessageQCopy_create"
-MessageQCopy_Handle MessageQCopy_create(UInt32 reserved,
- MessageQCopy_callback cb,
+#define FXNN "RPMessage_create"
+RPMessage_Handle RPMessage_create(UInt32 reserved,
+ RPMessage_callback cb,
UArg arg,
UInt32 * endpoint)
{
- MessageQCopy_Object *obj = NULL;
+ RPMessage_Object *obj = NULL;
Bool found = FALSE;
Int i;
UInt16 queueIndex = 0;
key = GateAll_enter(module.gateH);
- if (reserved == MessageQCopy_ASSIGN_ANY) {
+ if (reserved == RPMessage_ASSIGN_ANY) {
/* Search the array for a free slot above reserved: */
- for (i = MessageQCopy_MAX_RESERVED_ENDPOINT + 1;
+ for (i = RPMessage_MAX_RESERVED_ENDPOINT + 1;
(i < MAXMESSAGEQOBJECTS) && (found == FALSE) ; i++) {
if (module.msgqObjects[i] == NULL) {
queueIndex = i;
}
}
}
- else if ((queueIndex = reserved) <= MessageQCopy_MAX_RESERVED_ENDPOINT) {
+ else if ((queueIndex = reserved) <= RPMessage_MAX_RESERVED_ENDPOINT) {
if (module.msgqObjects[queueIndex] == NULL) {
found = TRUE;
}
}
if (found) {
- obj = Memory_alloc(NULL, sizeof(MessageQCopy_Object), 0, NULL);
+ obj = Memory_alloc(NULL, sizeof(RPMessage_Object), 0, NULL);
if (obj != NULL) {
if (cb) {
/* Store callback and it's arg instead of semaphore: */
obj->queueId = queueIndex;
module.msgqObjects[queueIndex] = obj;
- /* See MessageQCopy_unblock() */
+ /* See RPMessage_unblock() */
obj->unblocked = FALSE;
*endpoint = queueIndex;
#undef FXNN
/*
- * ======== MessageQCopy_delete ========
+ * ======== RPMessage_delete ========
*/
-#define FXNN "MessageQCopy_delete"
-Int MessageQCopy_delete(MessageQCopy_Handle *handlePtr)
+#define FXNN "RPMessage_delete"
+Int RPMessage_delete(RPMessage_Handle *handlePtr)
{
- Int status = MessageQCopy_S_SUCCESS;
- MessageQCopy_Object *obj;
+ Int status = RPMessage_S_SUCCESS;
+ RPMessage_Object *obj;
Queue_elem *payload;
IArg key;
Assert_isTrue((curInit > 0) , NULL);
- if (handlePtr && (obj = (MessageQCopy_Object *)(*handlePtr))) {
+ if (handlePtr && (obj = (RPMessage_Object *)(*handlePtr))) {
if (obj->cb) {
obj->cb = NULL;
(IArg)obj->queueId);
/* Now free the obj */
- Memory_free(NULL, obj, sizeof(MessageQCopy_Object));
+ Memory_free(NULL, obj, sizeof(RPMessage_Object));
*handlePtr = NULL;
}
#undef FXNN
/*
- * ======== MessageQCopy_recv ========
+ * ======== RPMessage_recv ========
*/
-#define FXNN "MessageQCopy_recv"
-Int MessageQCopy_recv(MessageQCopy_Handle handle, Ptr data, UInt16 *len,
+#define FXNN "RPMessage_recv"
+Int RPMessage_recv(RPMessage_Handle handle, Ptr data, UInt16 *len,
UInt32 *rplyEndpt, UInt timeout)
{
- Int status = MessageQCopy_S_SUCCESS;
- MessageQCopy_Object *obj = (MessageQCopy_Object *)handle;
+ Int status = RPMessage_S_SUCCESS;
+ RPMessage_Object *obj = (RPMessage_Object *)handle;
Bool semStatus;
Queue_elem *payload;
semStatus = Semaphore_pend(obj->semHandle, timeout);
if (semStatus == FALSE) {
- status = MessageQCopy_E_TIMEOUT;
+ status = RPMessage_E_TIMEOUT;
Log_print0(Diags_STATUS, FXNN": Sem pend timeout!");
}
else if (obj->unblocked) {
- status = MessageQCopy_E_UNBLOCKED;
+ status = RPMessage_E_UNBLOCKED;
}
else {
payload = (Queue_elem *)List_get(obj->queue);
Assert_isTrue((!payload), NULL);
}
- if (status == MessageQCopy_S_SUCCESS) {
+ if (status == RPMessage_S_SUCCESS) {
/* Now, copy payload to client and free our internal msg */
memcpy(data, payload->data, payload->len);
*len = payload->len;
#undef FXNN
/*
- * ======== MessageQCopy_send ========
+ * ======== RPMessage_send ========
*/
-#define FXNN "MessageQCopy_send"
-Int MessageQCopy_send(UInt16 dstProc,
+#define FXNN "RPMessage_send"
+Int RPMessage_send(UInt16 dstProc,
UInt32 dstEndpt,
UInt32 srcEndpt,
Ptr data,
UInt16 len)
{
- Int status = MessageQCopy_S_SUCCESS;
- MessageQCopy_Object *obj;
+ Int status = RPMessage_S_SUCCESS;
+ RPMessage_Object *obj;
Int16 token = 0;
- MessageQCopy_Msg msg;
+ RPMessage_Msg msg;
Queue_elem *payload;
UInt size;
IArg key;
VirtQueue_kick(transport.virtQueue_toHost);
}
else {
- status = MessageQCopy_E_FAIL;
+ status = RPMessage_E_FAIL;
Log_print0(Diags_STATUS, FXNN": getAvailBuf failed!");
}
}
else {
/* Put on a Message queue on this processor: */
- /* Protect from MessageQCopy_delete */
+ /* Protect from RPMessage_delete */
key = GateAll_enter(module.gateH);
obj = module.msgqObjects[dstEndpt];
GateAll_leave(module.gateH, key);
if (obj == NULL) {
Log_print1(Diags_STATUS, FXNN": no object for endpoint: %d",
(IArg)dstEndpt);
- status = MessageQCopy_E_NOENDPT;
+ status = RPMessage_E_NOENDPT;
return status;
}
Semaphore_post(obj->semHandle);
}
else {
- status = MessageQCopy_E_MEMORY;
+ status = RPMessage_E_MEMORY;
Log_print0(Diags_STATUS, FXNN": HeapBuf_alloc failed!");
}
}
#undef FXNN
/*
- * ======== MessageQCopy_unblock ========
+ * ======== RPMessage_unblock ========
*/
-#define FXNN "MessageQCopy_unblock"
-Void MessageQCopy_unblock(MessageQCopy_Handle handle)
+#define FXNN "RPMessage_unblock"
+Void RPMessage_unblock(RPMessage_Handle handle)
{
- MessageQCopy_Object *obj = (MessageQCopy_Object *)handle;
+ RPMessage_Object *obj = (RPMessage_Object *)handle;
Log_print1(Diags_ENTRY, "--> "FXNN": (handle=0x%x)", (IArg)handle);
similarity index 67%
rename from packages/ti/ipc/rpmsg/MessageQCopy.h
rename to packages/ti/ipc/rpmsg/RPMessage.h
index 786462c564c0d81f2954f68daa990a96969b4404..660aed01121e54520a14043e6e8a706e36bcbd35 100644 (file)
rename from packages/ti/ipc/rpmsg/MessageQCopy.h
rename to packages/ti/ipc/rpmsg/RPMessage.h
index 786462c564c0d81f2954f68daa990a96969b4404..660aed01121e54520a14043e6e8a706e36bcbd35 100644 (file)
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** ============================================================================
- * @file MessageQCopy.h
+ * @file RPMessage.h
*
* @brief A simple copy-based MessageQ, to work with Linux virtio_rp_msg.
*
- * The following are key features of the MessageQCopy module:
+ * The following are key features of the RPMessage module:
* - Multiple writers, single reader.
* - Timeouts are allowed when receiving messages.
* - Supports processor copy transfers only.
* Message queues are identified by a system-wide unique 32 bit queueID,
* which encodes the (MultiProc) 16 bit core ID and a local 16 bit index ID.
*
- * The MessageQCopy header should be included in an application as follows:
+ * The RPMessage header should be included in an application as follows:
* @code
- * #include <ti/ipc/rpmsg/MessageQCopy.h>
+ * #include <ti/ipc/rpmsg/RPMessage.h>
* @endcode
*
* Questions:
* ============================================================================
*/
-#ifndef ti_ipc_MessageQCopy__include
-#define ti_ipc_MessageQCopy__include
+#ifndef ti_ipc_RPMessage__include
+#define ti_ipc_RPMessage__include
#if defined (__cplusplus)
extern "C" {
/*!
* @brief Used as the timeout value to specify wait forever
*/
-#define MessageQCopy_FOREVER ~(0)
+#define RPMessage_FOREVER ~(0)
/*!
- * @def MessageQCopy_S_SUCCESS
+ * @def RPMessage_S_SUCCESS
* @brief Operation is successful.
*/
-#define MessageQCopy_S_SUCCESS 0
+#define RPMessage_S_SUCCESS 0
/*!
- * @def MessageQCopy_E_FAIL
+ * @def RPMessage_E_FAIL
* @brief Operation is not successful.
*/
-#define MessageQCopy_E_FAIL -1
+#define RPMessage_E_FAIL -1
/*!
- * @def MessageQCopy_E_MEMORY
+ * @def RPMessage_E_MEMORY
* @brief Operation resulted in memory failure.
*/
-#define MessageQCopy_E_MEMORY -3
+#define RPMessage_E_MEMORY -3
/*!
- * @def MessageQCopy_E_TIMEOUT
+ * @def RPMessage_E_TIMEOUT
* @brief Operation timed out.
*/
-#define MessageQCopy_E_TIMEOUT -6
+#define RPMessage_E_TIMEOUT -6
/*!
- * @def MessageQCopy_E_NOENDPT
+ * @def RPMessage_E_NOENDPT
* @brief No endpoint for a message.
*/
-#define MessageQCopy_E_NOENDPT -7
+#define RPMessage_E_NOENDPT -7
/*!
* @def MessageQ_E_UNBLOCKED
- * @brief MessageQCopy was unblocked
+ * @brief RPMessage was unblocked
*/
-#define MessageQCopy_E_UNBLOCKED -19
+#define RPMessage_E_UNBLOCKED -19
/*!
- * @def MessageQCopy_MAX_RESERVED_ENDPOINT
+ * @def RPMessage_MAX_RESERVED_ENDPOINT
* @brief Maximum Value for System Reserved Endpoints.
*/
-#define MessageQCopy_MAX_RESERVED_ENDPOINT 100
+#define RPMessage_MAX_RESERVED_ENDPOINT 100
/*!
- * @def MessageQCopy_MAX_RESERVED_ENDPOINT
+ * @def RPMessage_MAX_RESERVED_ENDPOINT
* @brief Maximum Value for System Reserved Endpoints.
*/
-#define MessageQCopy_ASSIGN_ANY 0xFFFFFFFF
+#define RPMessage_ASSIGN_ANY 0xFFFFFFFF
/*!
- * @brief MessageQCopy_Handle type
+ * @brief RPMessage_Handle type
*/
-typedef struct MessageQCopy_Object *MessageQCopy_Handle;
+typedef struct RPMessage_Object *RPMessage_Handle;
-typedef Void (*MessageQCopy_callback)(MessageQCopy_Handle, UArg, Ptr,
+typedef Void (*RPMessage_callback)(RPMessage_Handle, UArg, Ptr,
UInt16, UInt32);
/* =============================================================================
- * MessageQCopy Functions:
+ * RPMessage Functions:
* =============================================================================
*/
/*!
- * @brief Create a MessageQCopy instance for receiving, with callback.
+ * @brief Create a RPMessage instance for receiving, with callback.
*
- * This is an extension of MessageQCopy_create(), with the option of passing
+ * This is an extension of RPMessage_create(), with the option of passing
* a callback function and its argument to be called when a message is
* received.
*
- * @param[in] reserved If value is MessageQCopy_ASSIGN_ANY, then
+ * @param[in] reserved If value is RPMessage_ASSIGN_ANY, then
* any Endpoint can be assigned; otherwise, value is
* a reserved Endpoint ID, which must be less than
- * or equal to MessageQCopy_MAX_RESERVED_ENDPOINT.
+ * or equal to RPMessage_MAX_RESERVED_ENDPOINT.
* @param[in] callback If non-NULL, on received data, this callback is
* called instead of posting the internal semaphore.
* @param[in] arg Argument for the callback.
* @param[out] endpoint Endpoint ID for this side of the connection.
*
*
- * @return MessageQCopy Handle, or NULL if:
+ * @return RPMessage Handle, or NULL if:
* - reserved endpoint already taken;
* - could not allocate object
*/
-MessageQCopy_Handle MessageQCopy_create(UInt32 reserved,
- MessageQCopy_callback callback,
+RPMessage_Handle RPMessage_create(UInt32 reserved,
+ RPMessage_callback callback,
UArg arg,
UInt32 * endpoint);
/*!
* until the semaphore is signaled or a timeout occurs.
* The semaphore is signaled, when Message_send is called to deliver a message
* to this endpoint. If a timeout occurs, len is set to zero and the status is
- * #MessageQCopy_E_TIMEOUT. If a timeout of zero is specified, the function
+ * #RPMessage_E_TIMEOUT. If a timeout of zero is specified, the function
* returns immediately and if no message is available, the len is set to zero
- * and the status is #MessageQCopy_E_TIMEOUT.
- * The #MessageQCopy_E_UNBLOCKED status is returned, if MessageQ_unblock is called
- * on the MessageQCopy handle.
+ * and the status is #RPMessage_E_TIMEOUT.
+ * The #RPMessage_E_UNBLOCKED status is returned, if MessageQ_unblock is called
+ * on the RPMessage handle.
* If a message is successfully retrieved, the message
- * data is copied into the data pointer, and a #MessageQCopy_S_SUCCESS
+ * data is copied into the data pointer, and a #RPMessage_S_SUCCESS
* status is returned.
*
- * @param[in] handle MessageQCopy handle
+ * @param[in] handle RPMessage handle
* @param[out] data Pointer to the client's data buffer.
* @param[out] len Amount of data received.
* @param[out] rplyEndpt Endpoint of source (for replies).
* @param[in] timeout Maximum duration to wait for a message in
* microseconds.
*
- * @return MessageQCopy status:
- * - #MessageQCopy_S_SUCCESS: Message successfully returned
- * - #MessageQCopy_E_TIMEOUT: MessageQCopy_recv timed out
- * - #MessageQCopy_E_UNBLOCKED: MessageQ_get was unblocked
- * - #MessageQCopy_E_FAIL: A general failure has occurred
+ * @return RPMessage status:
+ * - #RPMessage_S_SUCCESS: Message successfully returned
+ * - #RPMessage_E_TIMEOUT: RPMessage_recv timed out
+ * - #RPMessage_E_UNBLOCKED: MessageQ_get was unblocked
+ * - #RPMessage_E_FAIL: A general failure has occurred
*
- * @sa MessageQCopy_send MessageQCopy_unblock
+ * @sa RPMessage_send RPMessage_unblock
*/
-Int MessageQCopy_recv(MessageQCopy_Handle handle, Ptr data, UInt16 *len,
+Int RPMessage_recv(RPMessage_Handle handle, Ptr data, UInt16 *len,
UInt32 *rplyEndpt, UInt timeout);
/*!
* messageQ.
*
* If the message is placed onto a local Message queue, the queue's
- * #MessageQCopy_Params::semaphore signal function is called.
+ * #RPMessage_Params::semaphore signal function is called.
*
* @param[in] dstProc Destination ProcId.
* @param[in] dstEndpt Destination Endpoint.
* @param[in] len Amount of data to be copied, including Msg header.
*
* @return Status of the call.
- * - #MessageQCopy_S_SUCCESS denotes success.
- * - #MessageQCopy_E_FAIL denotes failure.
+ * - #RPMessage_S_SUCCESS denotes success.
+ * - #RPMessage_E_FAIL denotes failure.
* The send was not successful.
*/
-Int MessageQCopy_send(UInt16 dstProc,
+Int RPMessage_send(UInt16 dstProc,
UInt32 dstEndpt,
UInt32 srcEndpt,
Ptr data,
UInt16 len);
/*!
- * @brief Delete a created MessageQCopy instance.
+ * @brief Delete a created RPMessage instance.
*
* This function deletes a created message queue instance. If the
* message queue is non-empty, any messages remaining in the queue
*
* @param[in,out] handlePtr Pointer to handle to delete.
*
- * @return MessageQCopy status:
- * - #MessageQCopy_E_FAIL: delete failed
- * - #MessageQCopy_S_SUCCESS: delete successful, *handlePtr = NULL.
+ * @return RPMessage status:
+ * - #RPMessage_E_FAIL: delete failed
+ * - #RPMessage_S_SUCCESS: delete successful, *handlePtr = NULL.
*/
-Int MessageQCopy_delete(MessageQCopy_Handle *handlePtr);
+Int RPMessage_delete(RPMessage_Handle *handlePtr);
/*!
* @brief Unblocks a MessageQ
*
- * Unblocks a reader thread that is blocked on a MessageQCopy_recv. The
- * MessageQCopy_recv call will return with status #MessageQ_E_UNBLOCKED
- * indicating that it returned due to a MessageQCopy_unblock rather than by
+ * Unblocks a reader thread that is blocked on a RPMessage_recv. The
+ * RPMessage_recv call will return with status #MessageQ_E_UNBLOCKED
+ * indicating that it returned due to a RPMessage_unblock rather than by
* a timeout or receiving a message.
*
* Restrictions:
* - A queue may not be used after it has been unblocked.
* - MessageQ_unblock may only be called on a local queue.
*
- * @param[in] handle MessageQCopy handle
+ * @param[in] handle RPMessage handle
*
- * @sa MessageQCopy_recv
+ * @sa RPMessage_recv
*/
-Void MessageQCopy_unblock(MessageQCopy_Handle handle);
+Void RPMessage_unblock(RPMessage_Handle handle);
#if defined (__cplusplus)
}
#endif /* defined (__cplusplus) */
-#endif /* ti_ipc_MessageQCopy__include */
+#endif /* ti_ipc_RPMessage__include */
similarity index 84%
rename from packages/ti/ipc/rpmsg/_MessageQCopy.h
rename to packages/ti/ipc/rpmsg/_RPMessage.h
index 86bcda50db2157e921e0d9f8a2931b50169875fa..7b98e2960f9882fcd079189f5d9084a2c02d011b 100644 (file)
rename from packages/ti/ipc/rpmsg/_MessageQCopy.h
rename to packages/ti/ipc/rpmsg/_RPMessage.h
index 86bcda50db2157e921e0d9f8a2931b50169875fa..7b98e2960f9882fcd079189f5d9084a2c02d011b 100644 (file)
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** ============================================================================
- * @file _MessageQCopy.h
+ * @file _RPMessage.h
*
- * @brief Private header for MessageQCopy_init()/finalize().
+ * @brief Private header for RPMessage_init()/finalize().
*
* ============================================================================
*/
-#ifndef ti_ipc__MessageQCopy__include
-#define ti_ipc__MessageQCopy__include
+#ifndef ti_ipc__RPMessage__include
+#define ti_ipc__RPMessage__include
#if defined (__cplusplus)
extern "C" {
#endif
/*!
- * @brief Initialize MessageQCopy Module
+ * @brief Initialize RPMessage Module
*
* Note: Multiple clients must serialize calls to this function.
*
* @param[in] remoteProcId MultiProc ID of the peer.
*/
-Void MessageQCopy_init(UInt16 remoteProcId);
+Void RPMessage_init(UInt16 remoteProcId);
/*!
- * @brief Tear down MessageQCopy Module
+ * @brief Tear down RPMessage Module
*
*/
-Void MessageQCopy_finalize();
+Void RPMessage_finalize();
#if defined (__cplusplus)
}
#endif /* defined (__cplusplus) */
-#endif /* ti_ipc__MessageQCopy__include */
+#endif /* ti_ipc__RPMessage__include */
index 130205b3edb40643c22a2b056892fceb13fb4b1c..0f4c3c76cf6969f0fc07555c0fe3f1017ed89c56 100644 (file)
Pkg.attrs.exportSrc = true;
-Pkg.otherFiles = ["package.bld", "Rpmsg.h", "virtio_ring.h", "_MessageQCopy.h",
- "_VirtQueue.h", "MessageQCopy.h", "NameMap.h"];
+Pkg.otherFiles = ["package.bld", "Rpmsg.h", "virtio_ring.h", "_RPMessage.h",
+ "_VirtQueue.h", "RPMessage.h", "NameMap.h"];
-var SRCS = ["MessageQCopy.c", "NameMap.c"];
+var SRCS = ["RPMessage.c", "NameMap.c"];
/* remove this output directory during a clean */
Pkg.generatedFiles.$add("lib/");
index b173241681b23c5942ef1ccf6279b28d58d4f3bc..6e979dedaf71699b3af8f3f8ea5e06c32fda7e8c 100644 (file)
#include <stdlib.h>
#include <ti/ipc/rpmsg/NameMap.h>
-#include <ti/ipc/rpmsg/MessageQCopy.h>
+#include <ti/ipc/rpmsg/RPMessage.h>
static UInt16 dstProc;
-static MessageQCopy_Handle handle = NULL;
+static RPMessage_Handle handle = NULL;
static UInt32 myEndpoint = 0;
static UInt32 counter = 0;
/* Send me a zero length data payload to tear down the MesssageQCopy object: */
-static Void pingCallbackFxn(MessageQCopy_Handle h, UArg arg, Ptr data,
+static Void pingCallbackFxn(RPMessage_Handle h, UArg arg, Ptr data,
UInt16 len, UInt32 src)
{
const Char *reply = "Pong!";
counter++, data, src, len);
/* Send data back to remote endpoint: */
- MessageQCopy_send(dstProc, src, myEndpoint, (Ptr)reply, replyLen);
+ RPMessage_send(dstProc, src, myEndpoint, (Ptr)reply, replyLen);
}
Void pingTaskFxn(UArg arg0, UArg arg1)
System_printf("ping_task at port %d: Entered...\n", arg0);
/* Create the messageQ for receiving, and register callback: */
- handle = MessageQCopy_create(arg0, pingCallbackFxn, NULL, &myEndpoint);
+ handle = RPMessage_create(arg0, pingCallbackFxn, NULL, &myEndpoint);
if (!handle) {
- System_abort("MessageQCopy_createEx failed\n");
+ System_abort("RPMessage_createEx failed\n");
}
/* Announce we are here: */
NameMap_register("rpmsg-proto", "rpmsg-proto", arg0);
- /* Note: we don't get a chance to teardown with MessageQCopy_destroy() */
+ /* Note: we don't get a chance to teardown with RPMessage_destroy() */
}
Int main(Int argc, char* argv[])
index d184a52fb9d6dfede348670d27ab24a664f940b1..84063faaf19b7637734a25b7dd1d050511ab3f4b 100644 (file)
Program.global.tsk1 = Task.create('&pingTaskFxn', params);
Task.deleteTerminatedTasks = true;
- /* This calls MessageQCopy_init() once before BIOS_start(): */
+ /* This calls RPMessage_init() once before BIOS_start(): */
xdc.loadPackage('ti.ipc.ipcmgr');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
BIOS.addUserStartupFunction('&IpcMgr_rpmsgStartup');
index 0cc605124a1d0ca96fed39c859814e08e5bd21fe..2aa801f560c9cb6c391804748a2840c621c24914 100644 (file)
#include <string.h>
#include <stdlib.h>
-#include <ti/ipc/rpmsg/MessageQCopy.h>
+#include <ti/ipc/rpmsg/RPMessage.h>
#include <ti/ipc/rpmsg/NameMap.h>
#define APP_NUM_ITERATIONS 100000
Void copyTaskFxn(UArg arg0, UArg arg1)
{
- MessageQCopy_Handle handle;
+ RPMessage_Handle handle;
Char buffer[128];
UInt32 myEndpoint = 0;
UInt32 remoteEndpoint;
dstProc = MultiProc_getId("HOST");
/* Create the messageQ for receiving (and get our endpoint for sending). */
- handle = MessageQCopy_create(arg0, NULL, NULL, &myEndpoint);
+ handle = RPMessage_create(arg0, NULL, NULL, &myEndpoint);
NameMap_register("rpmsg-client-sample", "sample-desc", arg0);
for (i = 0; i < APP_NUM_ITERATIONS; i++) {
/* Await a character message: */
- MessageQCopy_recv(handle, (Ptr)buffer, &len, &remoteEndpoint,
- MessageQCopy_FOREVER);
+ RPMessage_recv(handle, (Ptr)buffer, &len, &remoteEndpoint,
+ RPMessage_FOREVER);
buffer[len] = '\0';
System_printf("copyTask %d: Received data: %s, len:%d\n", i + 1,
buffer, len);
/* Send data back to remote endpoint: */
- MessageQCopy_send(dstProc, remoteEndpoint, myEndpoint, (Ptr)buffer, len);
+ RPMessage_send(dstProc, remoteEndpoint, myEndpoint, (Ptr)buffer, len);
}
/* Teardown our side: */
- MessageQCopy_delete(&handle);
+ RPMessage_delete(&handle);
}
void start_ping_tasks()
index 5fc5a121ead4ea059c622b9d27822ed45087f829..16fd2799dc4144f2f722098f12d78a014edcaf37 100644 (file)
*
* Codes: E = ENTRY, X = EXIT, L = LIFECYCLE, F = INFO, S = STATUS
*/
- Diags_setMask("ti.ipc.rpmsg.MessageQCopy=EXLFS");
+ Diags_setMask("ti.ipc.rpmsg.RPMessage=EXLFS");
/* Setup the table of services, so clients can create and connect to
* new service instances:
diff --git a/packages/ti/ipc/tests/test_omx_ipu_omap5.cfg b/packages/ti/ipc/tests/test_omx_ipu_omap5.cfg
index 411e1f6c2709e2e7cfe52719b93e51bddf2e17b0..ef2a02280b96aab2a0a425c85145ce899307bb4a 100644 (file)
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* This calls MessageQCopy_init() once before BIOS_start(): */
+/* This calls RPMessage_init() once before BIOS_start(): */
xdc.loadPackage('ti.ipc.ipcmgr');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
BIOS.addUserStartupFunction('&IpcMgr_rpmsgStartup');
diff --git a/packages/ti/ipc/transports/TransportRpmsg.c b/packages/ti/ipc/transports/TransportRpmsg.c
index ea3a5fcf2a65782c98ff1f8eb2a8bb40e6225434..c20b62ad68c85ab7df6051408f964d4c6c625998 100644 (file)
#include <ti/ipc/rpmsg/Rpmsg.h>
#include <ti/ipc/rpmsg/NameMap.h>
-#include <ti/ipc/rpmsg/_MessageQCopy.h>
-#include <ti/ipc/rpmsg/MessageQCopy.h>
+#include <ti/ipc/rpmsg/_RPMessage.h>
+#include <ti/ipc/rpmsg/RPMessage.h>
#include <ti/ipc/namesrv/_NameServerRemoteRpmsg.h>
/* Name of the rpmsg socket on host: */
#define RPMSG_SOCKET_NAME "rpmsg-proto"
-static Void transportCallbackFxn(MessageQCopy_Handle msgq, UArg arg, Ptr data,
+static Void transportCallbackFxn(RPMessage_Handle msgq, UArg arg, Ptr data,
UInt16 dataLen, UInt32 srcAddr);
/*
/* This MessageQ Transport over RPMSG only talks to the "HOST" for now: */
Assert_isTrue(remoteProcId == MultiProc_getId("HOST"), NULL);
- MessageQCopy_init(remoteProcId);
+ RPMessage_init(remoteProcId);
/* set object fields */
obj->priority = params->priority;
NameMap_register(RPMSG_SOCKET_NAME, RPMSG_SOCKET_NAME, RPMSG_MESSAGEQ_PORT);
/* Associate incomming messages with this transport's callback fxn: */
- obj->msgqHandle = MessageQCopy_create(RPMSG_MESSAGEQ_PORT,
+ obj->msgqHandle = RPMessage_create(RPMSG_MESSAGEQ_PORT,
transportCallbackFxn,
(UArg)obj,
&myEndpoint);
break;
}
- MessageQCopy_finalize();
+ RPMessage_finalize();
#undef FXNN
}
Log_print3(Diags_INFO, FXNN": sending msg from: %d, to: %d, dataLen: %d",
(IArg)RPMSG_MESSAGEQ_PORT, (IArg)dstAddr, (IArg)msgSize);
- status = MessageQCopy_send(obj->remoteProcId, dstAddr, RPMSG_MESSAGEQ_PORT,
+ status = RPMessage_send(obj->remoteProcId, dstAddr, RPMSG_MESSAGEQ_PORT,
msg, msgSize);
/* free the app's message */
MessageQ_free(msg);
}
- return (status == MessageQCopy_S_SUCCESS? TRUE: FALSE);
+ return (status == RPMessage_S_SUCCESS? TRUE: FALSE);
}
#undef FXNN
*
*/
#define FXNN "transportCallbackFxn"
-static Void transportCallbackFxn(MessageQCopy_Handle msgq, UArg arg, Ptr data,
+static Void transportCallbackFxn(RPMessage_Handle msgq, UArg arg, Ptr data,
UInt16 dataLen, UInt32 srcAddr)
{
UInt32 queueId;
diff --git a/packages/ti/ipc/transports/TransportRpmsg.xdc b/packages/ti/ipc/transports/TransportRpmsg.xdc
index f09655aa891adbe61c4ce44eda4effede0656cd8..0aa020221d0b5c180125d3ac1658a4e6b4a83525 100644 (file)
struct Instance_State {
UInt16 priority; /* priority to register */
UInt16 remoteProcId; /* dst proc id */
- Ptr msgqHandle; /* MessageQCopy Handle */
+ Ptr msgqHandle; /* RPMessage Handle */
}
}
index 80fd114738de338dd469064de9e78f5af277466c..b81f276791eb508d0e3fcd1c9c82d3b55651bca6 100644 (file)
#include <string.h>
#include <stdlib.h>
-#include <ti/ipc/rpmsg/MessageQCopy.h>
+#include <ti/ipc/rpmsg/RPMessage.h>
#include <ti/ipc/rpmsg/NameMap.h>
#include "rpmsg_omx.h"
#include "ServiceMgr.h"
hdr->len = len;
/* 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,
index 13cf9ea2d1cf2df404e78be56893364bf5d3eaeb..d8f84e729a1d41b9d140a1471726afb1b360e53d 100644 (file)
#include <ti/ipc/MultiProc.h>
-#include <ti/ipc/rpmsg/MessageQCopy.h>
+#include <ti/ipc/rpmsg/RPMessage.h>
#include <ti/ipc/rpmsg/NameMap.h>
#include <ti/srvmgr/rpmsg_omx.h>
#include <ti/srvmgr/ServiceMgr.h>
Void OmxSrvMgr_taskFxn(UArg arg0, UArg arg1)
{
- MessageQCopy_Handle msgq;
+ RPMessage_Handle msgq;
UInt32 local;
UInt32 remote;
Char msg[HDRSIZE + sizeof(struct omx_connect_req)];
dstProc = MultiProc_getId("HOST");
#endif
- msgq = MessageQCopy_create(OMX_MGR_PORT, NULL, NULL, &local);
+ msgq = RPMessage_create(OMX_MGR_PORT, NULL, NULL, &local);
System_printf("OmxSrvMgr: started on port: %d\n", OMX_MGR_PORT);
#endif
while (1) {
- MessageQCopy_recv(msgq, (Ptr)msg, &len, &remote, MessageQCopy_FOREVER);
+ RPMessage_recv(msgq, (Ptr)msg, &len, &remote, RPMessage_FOREVER);
System_printf("OmxSrvMgr: received msg type: %d from addr: %d\n",
hdr->type, remote);
switch (hdr->type) {
System_printf("OmxSrvMgr: Replying with msg type: %d to addr: %d "
" from: %d\n",
hdr->type, remote, local);
- MessageQCopy_send(dstProc, remote, local, msg, len);
+ RPMessage_send(dstProc, remote, local, msg, len);
}
}