本文整理汇总了C++中IPC_TRACE函数的典型用法代码示例。如果您正苦于以下问题:C++ IPC_TRACE函数的具体用法?C++ IPC_TRACE怎么用?C++ IPC_TRACE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IPC_TRACE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IPC_SendBuffer
IPC_ReturnCode_T IPC_SendBuffer(IPC_Buffer Buffer, IPC_Priority_T Priority)
{
IPC_Buffer_T *BufferPtr = IPC_BufferToPtr(Buffer);
IPC_TRACE(IPC_Channel_Buffer, "IPC_SendBuffer",
"Buffer %d (%08X), Priority %d", BufferPtr->BufferId, Buffer,
Priority, 0);
if (BufferPtr == 0) {
IPC_TRACE(IPC_Channel_Error, "IPC_SendBuffer",
"Invalid Buffer %08X", Buffer, 0, 0, 0);
return IPC_ERROR;
}
BufferPtr->TimeStampSend = TIMER_GetValue();
BufferPtr->StatusCode = IPC_BUFFER_STATUS_SENT;
IPC_PoolAddBytesSent(BufferPtr->Pool,
BufferPtr->DataSize + BufferPtr->HeaderSize);
#ifdef IPC_BUFFER_STATS
/* Debug output - turned off by default for performance */
if (BufferPtr->BufferId == 0 && 0 == LISR_Active)
IPC_PoolDumpStats(BufferPtr->Pool);
#endif
IPC_SmSendBuffer(Buffer);
return IPC_OK;
}
示例2: IPC_SmFifoRead
/* Only called by the SM HISR, so no critical reigon */
static IPC_Buffer IPC_SmFifoRead(IPC_Fifo Fifo)
{
IPC_Buffer Buffer;
IPC_U32 ReadIndex;
ReadIndex = Fifo->ReadIndex;
IPC_TRACE(IPC_Channel_Debug, "IPC_SmFifoRead",
"Fifo %08X, %d entries, read: %d, Write %d", Fifo,
IPC_FIFOCOUNT(Fifo), ReadIndex, Fifo->WriteIndex);
if (ReadIndex == Fifo->WriteIndex) {
IPC_TRACE(IPC_Channel_Sm, "IPC_SmFifoRead", "Fifo %08X, Empty",
Fifo, 0, 0, 0);
return (IPC_Buffer) 0;
}
Buffer = Fifo->Buffer[ReadIndex];
Fifo->ReadIndex = IPC_FIFOINCREMENT(ReadIndex);
IPC_TRACE(IPC_Channel_Sm, "IPC_SmFifoRead",
"Fifo %08X, Read %08X, %d entries", Fifo, Buffer,
IPC_FIFOCOUNT(Fifo), 0);
return Buffer;
}
示例3: IPC_PoolDumpStats
void IPC_PoolDumpStats(IPC_BufferPool Pool)
{
IPC_BufferPool_T *PoolPtr = IPC_PoolToPtr(Pool);
if (!PoolPtr) {
IPC_TRACE(IPC_Channel_General, "IPC_Stats", "Pool %08X Invalid",
Pool, 0, 0, 0);
return;
};
IPC_TRACE(IPC_Channel_General, "IPC_Stats",
"Pool %08X: UserP %08X, BufSize %d, BufCount %d", Pool,
PoolPtr->UserParameter, PoolPtr->MaxDataSize,
PoolPtr->MaxBuffers);
IPC_TRACE(IPC_Channel_General, " ",
"Alloc %d, Fail %d, FcStart %d, FcStop %d",
PoolPtr->Allocations, PoolPtr->AllocationFailures,
PoolPtr->FlowStartCalls, PoolPtr->FlowStopCalls);
IPC_TRACE(IPC_Channel_General, " ",
"Sent %d, FreeBufs %d, LowWaterMark %d, FcState %d",
PoolPtr->BytesSent, PoolPtr->FreeBuffers,
PoolPtr->LowWaterMark, PoolPtr->FlowControlState);
}
示例4: IPC_FreeBuffer
void IPC_FreeBuffer(IPC_Buffer Buffer)
{
IPC_Buffer_T *BufferPtr = IPC_BufferToPtr(Buffer);
IPC_CPU_ID_T OwningCpu;
if (BufferPtr == 0) {
IPC_TRACE(IPC_Channel_Error, "IPC_FreeBuffer",
"Invalid Buffer %08X", Buffer, 0, 0, 0);
return;
}
if (BufferPtr->StatusCode == IPC_BUFFER_STATUS_FREE) {
IPC_TRACE(IPC_Channel_Error, "IPC_FreeBuffer",
"Repeated Free Buffer %08X", Buffer, 0, 0, 0);
return;
}
OwningCpu = IPC_PoolOwningCpu(BufferPtr->Pool);
BufferPtr->TimeStampFree = TIMER_GetValue();
BufferPtr->StatusCode = IPC_BUFFER_STATUS_FREE;
if (OwningCpu == IPC_SM_CURRENT_CPU) {
IPC_TRACE(IPC_Channel_Buffer, "IPC_FreeBuffer",
"Buffer %08X, ID %d Same CPU ", Buffer,
BufferPtr->BufferId, 0, 0);
IPC_BufferReturn(Buffer, BufferPtr->Pool);
} else {
IPC_TRACE(IPC_Channel_Buffer, "IPC_FreeBuffer",
"Buffer %08X, ID %d Other CPU", Buffer,
BufferPtr->BufferId, 0, 0);
IPC_SmFreeBuffer(Buffer, OwningCpu);
}
}
示例5: IPC_BufferToPtr
void *IPC_BufferHeaderRemove(IPC_Buffer Buffer, IPC_U32 HeaderSize)
{
IPC_Buffer_T *BufferPtr = IPC_BufferToPtr(Buffer);
if (BufferPtr == 0) {
IPC_TRACE(IPC_Channel_Error, "IPC_BufferHeaderRemove",
"Invalid Buffer %d", Buffer, 0, 0, 0);
return 0;
}
if (HeaderSize > BufferPtr->HeaderSize) {
IPC_TRACE(IPC_Channel_Error, "IPC_BufferHeaderRemove",
"Buffer %08X, HeaderSize %d too big", Buffer,
HeaderSize, 0, 0);
return 0;
} else {
IPC_TRACE(IPC_Channel_Data, "IPC_BufferHeaderRemove",
"Buffer %08X, HeaderSize %d", Buffer, HeaderSize, 0,
0);
BufferPtr->HeaderSize -= HeaderSize;
return IPC_SmAddress(BufferPtr->DataOffset -
BufferPtr->HeaderSize);
}
}
示例6: IPC_DecrementBufferDataPointer
void IPC_DecrementBufferDataPointer(IPC_Buffer Buffer, IPC_U32 offset)
{
IPC_Buffer_T *BufferPtr = IPC_BufferToPtr(Buffer);
IPC_SmPtr DataOffset = 0;
if (BufferPtr == 0) {
IPC_TRACE(IPC_Channel_Error, "IPC_MoveBufferDataPointer ",
"Invalid Buffer %d", Buffer, 0, 0, 0);
return;
}
DataOffset = BufferPtr->DataOffset - offset;
IPC_TRACE(IPC_Channel_Data, "IPC_MoveBufferDataPointer ",
"Buffer %08X, Ptr %08X", Buffer, DataOffset, 0, 0);
if (DataOffset <
(BufferPtr->DataBufferStart) + IPC_BufferHeaderSizeGet(Buffer)) {
IPC_TRACE(IPC_Channel_Error, "IPC_MoveBufferDataPointer ",
"Invalid Pointer %08X", BufferPtr->DataOffset, 0, 0,
0);
return;
}
BufferPtr->DataOffset = DataOffset;
BufferPtr->DataSize += offset;
BufferPtr->HeaderSize -= offset;
}
示例7: IPC_BufferSetDataSize
IPC_U32 IPC_BufferSetDataSize(IPC_Buffer Buffer, IPC_U32 Length)
{
IPC_Buffer_T *BufferPtr = IPC_BufferToPtr(Buffer);
IPC_U32 MaxDataSize;
if (BufferPtr == 0) {
IPC_TRACE(IPC_Channel_Error, "IPC_BufferSetDataSize",
"Invalid Buffer %d", Buffer, 0, 0, 0);
return 0;
}
MaxDataSize = IPC_PoolMaxDataSize(BufferPtr->Pool);
if (Length > MaxDataSize) {
IPC_TRACE(IPC_Channel_Error, "IPC_BufferSetDataSize",
"Buffer %08X, Length %d too big", Buffer, Length, 0,
0);
return 0;
} else {
IPC_TRACE(IPC_Channel_Data, "IPC_BufferSetDataSize",
"Buffer %08X, Length %d", Buffer, Length, 0, 0);
BufferPtr->DataSize = Length;
return Length;
}
}
示例8: IPC_SmPoolAlloc
IPC_SmPtr IPC_SmPoolAlloc(IPC_U32 PoolOverhead,
IPC_U32 HeaderSize,
IPC_U32 DataSize,
IPC_U32 BufferCount)
{
IPC_SmPtr Pool;
if (SmLocalControl.SmControl->
CurrentBuffers[IPC_CPU_ID_INDEX(IPC_SM_CURRENT_CPU)] +
BufferCount >= IPC_SM_MAX_BUFFERS) {
IPC_TRACE(IPC_Channel_Error, "IPC_SmPoolAlloc",
"Too Many Buffers", 0, 0, 0, 0);
return 0;
}
Pool = IPC_SmAlloc(PoolOverhead
+ (IPC_BufferOverhead() + HeaderSize +
DataSize) * BufferCount);
if (Pool == 0) {
IPC_TRACE(IPC_Channel_Error, "IPC_SmPoolAlloc",
"Failed to Allocate Sm", 0, 0, 0, 0);
return 0;
}
SmLocalControl.SmControl->
CurrentBuffers[IPC_CPU_ID_INDEX(IPC_SM_CURRENT_CPU)] += BufferCount;
IPC_SmAddPool(Pool);
return Pool;
}
示例9: IPC_SmFifoWrite
void IPC_SmFifoWrite(IPC_Fifo Fifo, IPC_Buffer Message)
{
CRITICAL_REIGON_SETUP IPC_U32 OriginalWritePointer;
IPC_TRACE(IPC_Channel_Sm, "IPC_SmFifoWrite", "Fifo %08X, Buffer %08X",
Fifo, Message, 0, 0);
IPC_TRACE(IPC_Channel_Debug, "IPC_SmFifoWrite",
"Fifo %08X, %d entries, read: %d, Write %d", Fifo,
IPC_FIFOCOUNT(Fifo), Fifo->ReadIndex, Fifo->WriteIndex);
CRITICAL_REIGON_ENTER OriginalWritePointer = Fifo->WriteIndex;
Fifo->Buffer[OriginalWritePointer] = Message;
Fifo->WriteIndex = IPC_FIFOINCREMENT(OriginalWritePointer);
Fifo->WriteCount++;
if (IPC_FIFOCOUNT(Fifo) > Fifo->HighWaterMark)
Fifo->HighWaterMark = IPC_FIFOCOUNT(Fifo);
CRITICAL_REIGON_LEAVE if (OriginalWritePointer == 0) {
IPC_TRACE(IPC_Channel_Debug, "IPC_SmFifoWrite",
"Fifo %08X, Count %d, HighWaterMark %d", Fifo,
Fifo->WriteCount, Fifo->HighWaterMark, 0);
}
if (Fifo->ReadIndex == OriginalWritePointer) {
/* Remote end is not currently reading FIFO */
IPC_TRACE(IPC_Channel_Sm, "IPC_SmFifoWrite",
"Interrupting other Cpu", 0, 0, 0, 0);
RAISE_INTERRUPT;
}
}
示例10: IPC_SmAlloc
IPC_SmPtr IPC_SmAlloc(IPC_U32 Size)
{
IPC_CPU_ID_T Cpu = IPC_SM_CURRENT_CPU;
volatile IPC_U32 *ApAllocated =
&SmLocalControl.SmControl->Allocated[IPC_CPU_ID_INDEX(IPC_AP_CPU)];
volatile IPC_U32 *CpAllocated =
&SmLocalControl.SmControl->Allocated[IPC_CPU_ID_INDEX(IPC_CP_CPU)];
IPC_SmPtr Allocated;
if ((*CpAllocated - *ApAllocated) < Size) {
IPC_TRACE(IPC_Channel_Error, "IPC_SmAlloc", "Not Enough Space",
0, 0, 0, 0);
return 0;
} else {
switch (Cpu) {
case IPC_AP_CPU:
{
/* Allocate from the bottom up for AP */
Allocated = *ApAllocated;
*ApAllocated += Size;
}
break;
case IPC_CP_CPU:
{
/* Allocate from the top down for CP */
*CpAllocated -= Size;
Allocated = *CpAllocated;
}
break;
default:
{
IPC_TRACE(IPC_Channel_Error, "IPC_SmAlloc",
"Unknown CPU %d", Cpu, 0, 0, 0);
return 0;
}
}
if (*CpAllocated < *ApAllocated) {
IPC_TRACE(IPC_Channel_Error, "IPC_SmAlloc",
"Memory overallocated", 0, 0, 0, 0);
return 0;
}
IPC_TRACE(IPC_Channel_Sm, "IPC_SmAlloc",
"%d Bytes Allocated at %08X", Size, Allocated, 0, 0);
return Allocated;
}
}
示例11: IPC_BufferDataSize
IPC_U32 IPC_BufferDataSize(IPC_Buffer Buffer)
{
IPC_Buffer_T *BufferPtr = IPC_BufferToPtr(Buffer);
if (BufferPtr == 0) {
IPC_TRACE(IPC_Channel_Error, "IPC_BufferDataSize",
"Invalid Buffer %d", Buffer, 0, 0, 0);
return 0;
}
IPC_TRACE(IPC_Channel_Data, "IPC_BufferDataSize",
"Buffer %08X, Size %d", Buffer, BufferPtr->DataSize, 0, 0);
return BufferPtr->DataSize;
}
示例12: IPC_BufferToPtr
void *IPC_BufferFillByLinkList(IPC_Buffer Buffer,
IPC_LinkList_T *LinkListPtr,
IPC_U32 LinkListLength)
{
IPC_Buffer_T *BufferPtr;
IPC_U32 MaxDataSize;
IPC_U32 SourceLength;
IPC_U32 i;
unsigned char *p;
unsigned char *q;
SourceLength = 0;
for (i = 0; i < LinkListLength; i++)
SourceLength += LinkListPtr[i].size;
if (SourceLength == 0)
return NULL;
BufferPtr = IPC_BufferToPtr(Buffer);
if (BufferPtr == 0) {
IPC_TRACE(IPC_Channel_Error, "IPC_BufferFillByLinkList",
"Invalid Buffer %d", Buffer, 0, 0, 0);
return NULL;
}
MaxDataSize = IPC_PoolMaxDataSize(BufferPtr->Pool);
if (MaxDataSize < SourceLength) {
IPC_TRACE(IPC_Channel_Error, "IPC_BufferFillByLinkList",
"Buffer %08X, Length %d too big", Buffer,
SourceLength, 0, 0);
return NULL;
}
IPC_TRACE(IPC_Channel_Data, "IPC_BufferFillByLinkList",
"Buffer %08X, LinkListPtr %08X, Length %d", Buffer,
LinkListPtr, SourceLength, 0);
BufferPtr->DataSize = SourceLength;
p = q = IPC_SmAddress(BufferPtr->DataOffset);
for (i = 0; i < LinkListLength; i++) {
memcpy(p, LinkListPtr[i].byte_array, LinkListPtr[i].size);
p += LinkListPtr[i].size;
}
return (void *)q;
}
示例13: IPC_SmSendBuffer
void IPC_SmSendBuffer(IPC_Buffer Buffer)
{
IPC_EndpointId_T DestinationEpId;
IPC_Endpoint DestinationEpPtr;
IPC_CPU_ID_T DestinationCpu;
DestinationEpId = IPC_BufferDestinationEndpointId(Buffer);
#ifdef IPC_DEBUG
if (DestinationEpId == IPC_EP_None) {
IPC_TRACE(IPC_Channel_Error,
"IPC_SmSendBuffer",
"Invalid Destination Endpoint %08X for Buffer %08X",
DestinationEpId, Buffer, 0, 0);
return;
}
#endif
#ifdef FUSE_IPC_CRASH_SUPPORT
if (g_bCpCrashed == IPC_TRUE) {
IPC_TRACE(IPC_Channel_Error,
"IPC_SmSendBuffer",
"Trying to send after CP has crashed for Buffer %08X",
Buffer, 0, 0, 0);
return;
}
#endif
DestinationEpPtr = IPC_SmEndpointInfo(DestinationEpId);
DestinationCpu = DestinationEpPtr->Cpu;
IPC_TRACE(IPC_Channel_Sm,
"IPC_SmSendBuffer",
"DestinationCpu %02X, Buffer %08X",
DestinationCpu, Buffer, 0, 0);
if (DestinationCpu == IPC_SM_CURRENT_CPU) {
(*DestinationEpPtr->DeliveryFunction) (Buffer);
} else {
IPC_Fifo SendFifo =
&SmLocalControl.SmControl->
Fifos[IPC_CPU_ID_INDEX(DestinationCpu)].SendFifo;
IPC_SmFifoWrite(SendFifo, Buffer);
}
}
示例14: IPC_BufferHeaderSizeGet
IPC_U32 IPC_BufferHeaderSizeGet(IPC_Buffer Buffer)
{
IPC_Buffer_T *BufferPtr = IPC_BufferToPtr(Buffer);
IPC_U32 HeaderSize;
if (BufferPtr == 0) {
IPC_TRACE(IPC_Channel_Error, "IPC_BufferHeaderSizeGet",
"Invalid Buffer %d", Buffer, 0, 0, 0);
return 0;
}
HeaderSize = BufferPtr->HeaderSize;
IPC_TRACE(IPC_Channel_Data, "IPC_BufferHeaderSizeGet",
"Buffer %08X, HeaderSize %d", Buffer, HeaderSize, 0, 0);
return HeaderSize;
}
示例15: IPC_BufferReturnToPool
void IPC_BufferReturnToPool(IPC_Buffer Buffer, IPC_BufferPool Pool)
{
IPC_BufferPool_T *PoolPtr = IPC_PoolToPtr(Pool);
IPC_U32 BufferCount;
IPC_Boolean FlowControlCallNeeded = IPC_FALSE;
CRITICAL_REIGON_SETUP
IPC_TRACE(IPC_Channel_Buffer, "IPC_BufferReturnToPool",
"Buffer %d (%08X), now %d in pool", IPC_BufferId(Buffer),
Buffer, PoolPtr->FreeBuffers + 1, 0);
CRITICAL_REIGON_ENTER(PoolPtr->Lock);
BufferCount = ++PoolPtr->FreeBuffers;
#ifdef IPC_DEBUG
IPC_QRemove(IPC_BufferQueue(Buffer));
#endif
IPC_QAddBack(IPC_BufferQueue(Buffer),
IPC_POOLFreeQ(IPC_SmOffset(PoolPtr)));
/* Flow Control Check */
if (BufferCount == PoolPtr->FlowStartLimit)
CHECK_FLOW_STATE(PoolPtr, IPC_FLOW_START, FlowControlCallNeeded)
CRITICAL_REIGON_LEAVE(PoolPtr->Lock);
if (FlowControlCallNeeded)
IPC_ReportFlowControlEvent(PoolPtr, IPC_FLOW_START);
/* Last ditch check - should never happen */
if (PoolPtr->FlowControlState == IPC_FLOW_STOP
&& !PoolPtr->FlowControlCallPending
&& PoolPtr->FlowStartLimit < BufferCount) {
IPC_TRACE(IPC_Channel_FlowControl, "IPC_BufferReturnToPool",
"Retry Flow Start", 0, 0, 0, 0);
IPC_ReportFlowControlEvent(PoolPtr, IPC_FLOW_START);
}
/* For IPC_AllocateBufferWait () */
if ((BufferCount == 1) && (PoolPtr->EmptyEvent))
IPC_EVENT_SET(PoolPtr->EmptyEvent);
}