-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
High
-
MCAL
-
MCAL-28234
-
-
MCUSW_J7_11.01.00
-
In file ipc_api.c, the function RPMessage_enqueMsg() handles incoming messages. In this function announcements are put into a queue (IpcUtils_Qput()) by the call to RPMessage_processAnnounceMsg. After this is handled the configured callback function is called.
After this, the message are copied to new buffers and inserted into a queue IpcUtils_Qput().The application callback function is called again.
//------------------------------------------{}RPMessage_enqueMsg(){}---------------------------------------------------//
#ifdef IPC_EXCLUDE_CTRL_TASKS
if (msg->dstAddr == IPC_CTRL_ENDPOINT_ID)
{
/* This message is for the ctrl endpoint */
RPMessage_Announcement amsg = (RPMessage_Announcement)msg->payload;
if (amsg->ctrl.type == CNTRLMSG_ANNOUNCE)
{
#if DEBUG_PRINT
SystemP_printf("RPMessage_enqueMsg ...CNTRLMSG_ANNOUNCE\n");
#endif
status = RPMessage_processAnnounceMsg(
(RPMessage_Announcement*)amsg, msg->srcProcId);
if(status != IPC_SOK)
}
if ((status == IPC_SOK) && (NULL != gIpcObject.initPrms.newMsgFxn))
{
gIpcObject.initPrms.newMsgFxn(msg->srcAddr, msg->dstAddr, msg->srcProcId);
}
}
#endif /* IPC_EXCLUDE_CTRL_TASKS */
if (NULL != obj)
{
key = pOsalPrms->lockHIsrGate(module.gateSwi);
if (NULL != obj->recv_buffer)
{
memcpy(obj->recv_buffer, (void *)msg->payload, msg->dataLen);
obj->recv_buffer = NULL;
obj->payload.len = msg->dataLen;
obj->payload.src = msg->srcAddr;
obj->payload.procId = msg->srcProcId;
pOsalPrms->unLockHIsrGate(module.gateSwi, key);
if (NULL != gIpcObject.initPrms.newMsgFxn)
{ gIpcObject.initPrms.newMsgFxn(msg->srcAddr, msg->dstAddr, msg->srcProcId); }if (NULL != pOsalPrms->unlockMutex)
{ pOsalPrms->unlockMutex(obj->semHandle); }}
else
{
if( obj->endPt != msg->dstAddr)
{ SystemP_printf("WARNING: %d != %d\n", obj->endPt, msg->dstAddr); }
/* Allocate a buffer to copy the payload: */
size = msg->dataLen + sizeof(RPMessage_MsgElem);
/* HeapBuf_alloc() is non-blocking, so needs protection: HIsrGate has already been taken*/
payload = (RPMessage_MsgElem *)IpcUtils_HeapAlloc(&obj->heap, size, 0);
if (payload != NULL)
{
memcpy(payload->data, msg->payload, msg->dataLen);
payload->len = msg->dataLen;
payload->src = msg->srcAddr;
payload->procId = msg->srcProcId;
IpcUtils_Qput(&obj->queue, &payload->elem);
pOsalPrms->unLockHIsrGate(module.gateSwi, key);
if (NULL != gIpcObject.initPrms.newMsgFxn)
{
gIpcObject.initPrms.newMsgFxn(msg->srcAddr, msg->dstAddr, msg->srcProcId);
}
if (NULL != pOsalPrms->unlockMutex)
{ pOsalPrms->unlockMutex(obj->semHandle); }
}
else
}
}
//------------------------------------------{}RPMessage_enqueMsg(){}---------------------------------------------------//
The function RPMessage_enqueMsg first calls RPMessage_processAnnounceMsg (which enqueues the message inside it), then after returning from RPMessage_processAnnounceMsg it enqueues the message again, but in a different queue.
First queue is completely ignored , second queue is being created and used.