lib/sw_services/xilplmi/src/xplmi_event_logging.c
static int XPlmi_RetrieveBufferData(const XPlmi_CircularBuffer * Buffer,
	u64 DestAddr)
{
	int Status = XST_FAILURE;
	u64 CurrentAddr;
	u32 Len;
	u8 LogLevel = DebugLog->LogLevel;

	DebugLog->LogLevel = 0U;
	if (Buffer->IsBufferFull == (u32)TRUE) {
		Len = (u32)(Buffer->Len - Buffer->Offset);
		CurrentAddr = (Buffer->StartAddr + (u64)Buffer->Offset);
	}
	else {
		Len = Buffer->Len;
		CurrentAddr = Buffer->StartAddr;
	}
	Status = XPlmi_MemCpy64(DestAddr, CurrentAddr, Len);
	if (Status != XST_SUCCESS) {
		goto END;
	}

	if (Buffer->IsBufferFull == (u32)TRUE) {
		DestAddr += Len;
		Len = Buffer->Offset;
		Status = XPlmi_MemCpy64(DestAddr, Buffer->StartAddr, Len);
	}

END:
	DebugLog->LogLevel = LogLevel;
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function retrieves buffer data to the destination location.
 *
 * @param 	Buffer Circular buffer structure to which the data should be written
 * @param 	DestAddr to which the buffer data is to be copied
 *
 * @return	None
 *
 *****************************************************************************/
@brief       This function retrieves buffer data to the destination location.
@param       Buffer Circular buffer structure to which the data should be written
@param       DestAddr to which the buffer data is to be copied

@return      None
@brief This function retrieves buffer data to the destination location . @param Buffer Circular buffer structure to which the data should be written @param DestAddr to which the buffer data is to be copied @return None
static int XPlmi_RetrieveBufferData(const XPlmi_CircularBuffer * Buffer,
	u64 DestAddr)
{
	int Status = XST_FAILURE;
	u64 CurrentAddr;
	u32 Len;
	u8 LogLevel = DebugLog->LogLevel;
	DebugLog->LogLevel = 0U;
	if (Buffer->IsBufferFull == (u32)TRUE) {
		Len = (u32)(Buffer->Len - Buffer->Offset);
		CurrentAddr = (Buffer->StartAddr + (u64)Buffer->Offset);
	}
	else {
		Len = Buffer->Len;
		CurrentAddr = Buffer->StartAddr;
	}
	Status = XPlmi_MemCpy64(DestAddr, CurrentAddr, Len);
	if (Status != XST_SUCCESS) {
		goto END;
	}
	if (Buffer->IsBufferFull == (u32)TRUE) {
		DestAddr += Len;
		Len = Buffer->Offset;
		Status = XPlmi_MemCpy64(DestAddr, Buffer->StartAddr, Len);
	}
END:
	DebugLog->LogLevel = LogLevel;
	return Status;
}
static int XPlmi_RetrieveBufferData ( const XPlmi_CircularBuffer * Buffer , u64 DestAddr ) { int Status = XST_FAILURE ; u64 CurrentAddr ; u32 Len ; u8 LogLevel = DebugLog -> LogLevel ; DebugLog -> LogLevel = 0U ; if ( Buffer -> IsBufferFull == ( u32 ) TRUE ) { Len = ( u32 ) ( Buffer -> Len - Buffer -> Offset ) ; CurrentAddr = ( Buffer -> StartAddr + ( u64 ) Buffer -> Offset ) ; } else { Len = Buffer -> Len ; CurrentAddr = Buffer -> StartAddr ; } Status = XPlmi_MemCpy64 ( DestAddr , CurrentAddr , Len ) ; if ( Status != XST_SUCCESS ) { goto END ; } if ( Buffer -> IsBufferFull == ( u32 ) TRUE ) { DestAddr += Len ; Len = Buffer -> Offset ; Status = XPlmi_MemCpy64 ( DestAddr , Buffer -> StartAddr , Len ) ; } END : DebugLog -> LogLevel = LogLevel ; return Status ; }
@brief       This function retrieves buffer data to the destination location.
@brief This function retrieves buffer data to the destination location .