Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.92 KB | None | 0 0
  1. #define OMXRPC_STUB_TEMPLATE(pRpcHndl,pRpcMsg,retVal,cmdId,stubId,             \
  2.                              marshallApiParams,                                \
  3.                      unMarshallApiParams,nCmdStatus)                           \
  4. do {                                                                           \
  5.   RcmClient_Message *rcmMsg;                                                   \
  6.   Bool msgAllocDone = FALSE;                                                   \
  7.                                                                                \
  8.   DOMX_UTL_TRACE_FUNCTION_ASSERT ((TRUE ==                                     \
  9.                                    OmxRpc_module->localCoreRcmServer.initDone),\
  10.                                   "localCoreRcmServer init not done");         \
  11.   DOMX_UTL_TRACE_FUNCTION_ASSERT ((NULL != pRpcHndl), "rpcHandle is NULL");    \
  12.   DOMX_UTL_TRACE_FUNCTION_ASSERT                                               \
  13.     ((TRUE ==                                                                  \
  14.       OmxRpc_module->remoteCoreRcmClient[pRpcHndl->remoteCoreId].initDone),    \
  15.      "remoteCoreRcmClient init not done");                                     \
  16.                                                                                \
  17.   /* allocate a remote command message */                                      \
  18.   retVal = OmxRpc_rcmMsgAlloc ((RcmClient_Handle)pRpcHndl->client.handle,      \
  19.                                &rcmMsg,                                        \
  20.                                __FILE__,                                       \
  21.                                __LINE__);                                      \
  22.   if (OmxRpc_errorNone == retVal)                                              \
  23.   {                                                                            \
  24.     UInt32 fxnId;                                                              \
  25.                                                                                \
  26.     msgAllocDone = TRUE;                                                       \
  27.     pRpcMsg = (OmxRpc_msg * )(&rcmMsg->data);                                  \
  28.     /* Packing GetHandle messages */                                           \
  29.     /* Filling common part of the message */                                   \
  30.     OmxRpc_msgMarshallCommonStub (pRpcMsg,                                     \
  31.                                   pRpcHndl,                                    \
  32.                                   pRpcHndl->layer.stub.skelHandle,             \
  33.                                   cmdId);                                      \
  34.     omxrpc_msg_marshall_##stubId marshallApiParams;                            \
  35.     if ((OmxRpc_cmdCreateProxyLite == cmdId) ||                                \
  36.         (OmxRpc_cmdFreeHandle == cmdId))                                       \
  37.     {                                                                          \
  38.       fxnId =                                                                  \
  39.         OmxRpc_module->remoteCoreRcmClient[pRpcHndl->remoteCoreId].fxns.       \
  40.         cmd2fxnIdxMap[cmdId];                                                  \
  41.     }                                                                          \
  42.     else                                                                       \
  43.     {                                                                          \
  44.       fxnId = pRpcHndl->client.fxns.cmd2fxnIdxMap[cmdId];                      \
  45.     }                                                                          \
  46.     retVal = OmxRpc_rcmExec ((RcmClient_Handle)pRpcHndl->client.handle,        \
  47.                              rcmMsg,                                           \
  48.                              fxnId);                                           \
  49.     if (OmxRpc_errorNone == retVal)                                            \
  50.     {                                                                          \
  51.       OmxRpc_msgUnmarshallCommonStub(&pRpcMsg->common,nCmdStatus);             \
  52.       omxrpc_msg_unmarshall_##stubId##_response unMarshallApiParams;           \
  53.     }                                                                          \
  54.   } /* end of if (rcmMsgAlloc success) */                                      \
  55.   if (msgAllocDone)                                                            \
  56.   {                                                                            \
  57.     /* If msg was successfully executed free return the Rcm Msg to heap */     \
  58.     RcmClient_free ((RcmClient_Handle)pRpcHndl->client.handle,                 \
  59.                     rcmMsg);                                                   \
  60.   }                                                                            \
  61.                                                                                \
  62. } while (g_KillLoopInvariantWarning)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement