38#ifdef SA_ENABLE_TRACE_FUNCTIONS
42#define siTraceFileID 'A'
71 SA_DBG2((
"Entering function:mpiRequirementsGet\n"));
72 SA_ASSERT((
NULL != config),
"config argument cannot be null");
74 memoryMap = memoryRequirement;
121 bit32 remainder = memSize & 127;
126 memSize += (128 - remainder);
148 SA_DBG2((
"mpiRequirementsGet: (inboundQueues) memoryMap->region[%d].elementSize = %d\n",
150 SA_DBG2((
"mpiRequirementsGet: (inboundQueues) memoryMap->region[%d].numElements = %d\n",
166 bit32 remainder = memSize & 127;
171 memSize += (128 - remainder);
193 SA_DBG2((
"mpiRequirementsGet: (outboundQueues) memoryMap->region[%d].elementSize = %d\n",
195 SA_DBG2((
"mpiRequirementsGet: (outboundQueues) memoryMap->region[%d].numElements = %d\n",
239 SA_DBG4((
"Entering function:mpiMsgFreeGet\n"));
241 SA_ASSERT(
NULL != messagePtr,
"messagePtr argument cannot be null");
247 SA_DBG1((
"mpiMsgFreeGet: Message Size (%d) is larger than Q element size (%d)\n",messageSize,circularQ->
elementSize));
280 SA_DBG3((
"mpiMsgFreeGet: msgHeader = %p Offset = 0x%x\n", (
void *)msgHeader, offset));
286 msgHeader->
Header = (1<<24);
299 SA_DBG4((
"Entering function:mpiMsgFreeGet\n"));
301 SA_ASSERT(
NULL != messagePtr,
"messagePtr argument cannot be null");
307 SA_DBG1((
"mpiMsgFreeGet: Message Size is not fit in\n"));
331 SA_DBG3((
"mpiMsgFreeGet: msgHeader = %p Offset = 0x%x\n", (
void *)msgHeader, offset));
337 msgHeader->
Header = (1<<24);
375 SA_DBG4((
"Entering function:mpiMsgProduce\n"));
376 SA_ASSERT(
NULL != circularQ,
"circularQ argument cannot be null");
377 SA_ASSERT(
NULL != messagePtr,
"messagePtr argument cannot be null");
388 SA_DBG6((
"mpiMsgProduce: msgHeader bc %d\n", bc));
393 SA_ASSERT(0 != bc,
"The message buffer is not in \"allocated\" state "
437 ret = mpiMsgPrepare(circularQ, messagePtr, category, opCode, responseQueue,
475#ifdef SA_FW_TEST_BUNCH_STARTS
476#define Need_agRootDefined 1
479#ifdef SA_ENABLE_TRACE_FUNCTIONS
481#define Need_agRootDefined 1
484#ifdef MPI_DEBUG_TRACE_ENABLE
485#define Need_agRootDefined 1
488#ifdef Need_agRootDefined
490#ifdef SA_FW_TEST_BUNCH_STARTS
495#undef Need_agRootDefined
498 SA_DBG4((
"Entering function:mpiMsgProduce\n"));
499 SA_ASSERT(
NULL != circularQ,
"circularQ argument cannot be null");
500 SA_ASSERT(
NULL != messagePtr,
"messagePtr argument cannot be null");
513 SA_DBG6((
"mpiMsgProduce: msgHeader bc %d\n", bc));
520 SA_ASSERT(0 != bc,
"The message buffer is not in \"allocated\" state (bc == 0)");
547#if defined(SALLSDK_DEBUG)
551#ifdef SA_ENABLE_TRACE_FUNCTIONS
564#ifdef SA_FW_TEST_BUNCH_STARTS
565 if(saRoot->BunchStarts_Enable)
567 if (circularQ->BunchStarts_QPending == 0)
570 circularQ->BunchStarts_QPendingTick = saRoot->
timeTick;
573 circularQ->BunchStarts_QPending++;
576 saRoot->BunchStarts_Pending++;
578 SA_DBG1((
"mpiMsgProduce: BunchStarts - Global Pending %d\n", saRoot->BunchStarts_Pending));
579 SA_DBG1((
"mpiMsgProduce: BunchStarts - QPending %d, Q-%d\n", circularQ->BunchStarts_QPending, circularQ->
qNumber));
585 saRoot->BunchStarts_Pending = 0;
586 circularQ->BunchStarts_QPending = 0;
599#ifdef SA_FW_TEST_BUNCH_STARTS
612 if (circularQ->BunchStarts_QPending &&
613 ((circularQ->BunchStarts_QPending >= saRoot->BunchStarts_Threshold) ||
614 ((saRoot->
timeTick - circularQ->BunchStarts_QPendingTick) >= saRoot->BunchStarts_TimeoutTicks))
619 SA_DBG1((
"mpiMsgProduceBunch:circularQ->qNumber(%d) != inq(%d)\n",circularQ->
qNumber, inq));
623 SA_DBG1((
"mpiMsgProduceBunch: Qpending=%d, TotPending=%d\n", circularQ->BunchStarts_QPending, saRoot->BunchStarts_Pending));
631 saRoot->BunchStarts_Pending -= circularQ->BunchStarts_QPending;
634 circularQ->BunchStarts_QPending = 0;
635 circularQ->BunchStarts_QPendingTick = saRoot->
timeTick;
671 SA_ASSERT(
NULL != circularQ,
"circularQ argument cannot be null");
672 SA_ASSERT(
NULL != messagePtr1,
"messagePtr1 argument cannot be null");
673 SA_ASSERT(
NULL != pCategory,
"pCategory argument cannot be null");
674 SA_ASSERT(
NULL != pOpCode,
"pOpCode argument cannot be null");
694 OSSA_READ_LE_32(circularQ->
agRoot, &msgHeader_tmp, msgHeader, 0);
696 SA_DBG4((
"mpiMsgConsume: process an IOMB, header=0x%x\n", msgHeader_tmp));
732#if defined(SALLSDK_DEBUG)
762#if defined(SALLSDK_DEBUG)
765 SA_DBG1((
"mpiMsgConsume: V bit not set, 0x%08X Q=%d \n", msgHeader_tmp, circularQ->
qNumber));
795 SA_DBG4((
"mpiMsgConsume: Outbound queue is empty.\n"));
825 SA_DBG4((
"Entering function:mpiMsgFreeSet\n"));
826 SA_ASSERT(
NULL != circularQ,
"circularQ argument cannot be null");
827 SA_ASSERT(
NULL != messagePtr1,
"messagePtr1 argument cannot be null");
844#if defined(SALLSDK_DEBUG)
872#if defined(SALLSDK_DEBUG)
888 if (saRoot->IBQnumber % denom == 0)
890 saRoot->IBQnumber = 0;
892 SA_DBG3((
"mpiRotateQnumber: IBQnumber %d\n", saRoot->IBQnumber));
897 if (saRoot->OBQnumber % denom == 0)
899 saRoot->OBQnumber = 0;
901 SA_DBG3((
"mpiRotateQnumber: OBQnumber %d\n", saRoot->OBQnumber));
903 ret = (saRoot->OBQnumber <<
SHIFT16) | saRoot->IBQnumber;
923 SA_DBG4((
"Entering function:mpiMsgProduceOQ\n"));
924 SA_ASSERT(
NULL != circularQ,
"circularQ argument cannot be null");
925 SA_ASSERT(
NULL != messagePtr,
"messagePtr argument cannot be null");
941 SA_DBG6((
"mpiMsgProduceOQ: msgHeader bc %d\n", bc));
946 SA_ASSERT(0 != bc,
"The message buffer is not in \"allocated\" state "
GLOBAL FORCEINLINE bit32 mpiMsgFreeSet(mpiOCQueue_t *circularQ, void *messagePtr1, bit8 bc)
GLOBAL FORCEINLINE bit32 mpiMsgProduce(mpiICQueue_t *circularQ, void *messagePtr, mpiMsgCategory_t category, bit16 opCode, bit8 responseQueue, bit8 hiPriority)
void mpiRequirementsGet(mpiConfig_t *config, mpiMemReq_t *memoryRequirement)
Retrieves the MPI layer resource requirements.
GLOBAL FORCEINLINE bit32 mpiMsgConsume(mpiOCQueue_t *circularQ, void **messagePtr1, mpiMsgCategory_t *pCategory, bit16 *pOpCode, bit8 *pBC)
GLOBAL FORCEINLINE bit32 mpiMsgFreeGet(mpiICQueue_t *circularQ, bit16 messageSize, void **messagePtr)
Retrieves a free message buffer from an inbound queue.
#define MPI_MAX_OUTBOUND_QUEUES
enum mpiMsgCategory_e mpiMsgCategory_t
#define MPI_DEBUG_TRACE_QNUM_ERROR
#define smTraceFuncEnter(L, I)
#define MPI_DEBUG_TRACE_OBQ
#define MPI_DEBUG_TRACE_IBQ
#define smTraceFuncExit(L, S, I)
#define OSSA_OFFSET_OF(STRUCT_TYPE, FEILD)
#define AGSA_CACHED_DMA_MEM
#define MAX_QUEUE_EACH_MEM
This file defines global types.
#define MSGU_HOST_SCRATCH_PAD_0
#define MPI_DEBUG_TRACE(queue, pici, ib, iomb, count)
#define OPC_OUB_SKIP_ENTRY
GLOBAL FORCEINLINE void ossaCacheInvalidate(agsaRoot_t *agRoot, void *osMemHandle, void *virtPtr, bit32 length)
GLOBAL FORCEINLINE bit32 ossaHwRegReadExt(agsaRoot_t *agRoot, bit32 busBaseNumber, bit32 regOffset)
#define ossaLogIomb(a, b, c, d, e)
GLOBAL FORCEINLINE void ossaCacheFlush(agsaRoot_t *agRoot, void *osMemHandle, void *virtPtr, bit32 length)
GLOBAL FORCEINLINE void ossaHwRegWriteExt(agsaRoot_t *agRoot, bit32 busBaseNumber, bit32 regOffset, bit32 regValue)
GLOBAL FORCEINLINE void ossaCachePreFlush(agsaRoot_t *agRoot, void *osMemHandle, void *virtPtr, bit32 length)
GLOBAL FORCEINLINE bit32 ossaHwRegRead(agsaRoot_t *agRoot, bit32 regOffset)
struct mpiMsgHeader_s mpiMsgHeader_t
data structure stores OS specific and LL specific context
MPI layer configuration parameters.
mpiInboundQueueDescriptor_t inboundQueues[MPI_MAX_INBOUND_QUEUES]
mpiOutboundQueueDescriptor_t outboundQueues[MPI_MAX_OUTBOUND_QUEUES]
mpiHostLLConfigDescriptor_t mainConfig
Circular Queue descriptor.
Describes MPI memory requirements.
mpiMem_t region[MPI_MAX_MEM_REGIONS]