XilinxProcessorIPLib/drivers/hdcp22_rx_dp/src/xhdcp22_rx.c
void XHdcp22Rx_LogWr(XHdcp22_Rx *InstancePtr, u16 Evt, u16 Data)
{
	/* Verify arguments. */
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(Evt < XHDCP22_RX_LOG_EVT_INVALID);

	/* When logging a debug event check if verbose is set to true */
	if ((InstancePtr->Log.Verbose == FALSE) &&
			((Evt == XHDCP22_RX_LOG_EVT_DEBUG) ||
			 (Evt == XHDCP22_RX_LOG_EVT_INFO_MESSAGE))) {
		return;
	}

	/* Write data and event into log buffer */
	InstancePtr->Log.LogItems[InstancePtr->Log.Head].Data = Data;
	InstancePtr->Log.LogItems[InstancePtr->Log.Head].LogEvent = Evt;
	InstancePtr->Log.LogItems[InstancePtr->Log.Head].TimeStamp =
			XHdcp22Rx_LogGetTimeUSecs(InstancePtr);

	/* Update head pointer if reached to end of the buffer */
	if (InstancePtr->Log.Head == XHDCP22_RX_LOG_BUFFER_SIZE - 1) {
		/* Clear pointer */
		InstancePtr->Log.Head = 0;
	} else {
		/* Increment pointer */
		InstancePtr->Log.Head++;
	}

	/* Check tail pointer. When the two pointer are equal, then the buffer
	* is full.In this case then increment the tail pointer as well to
	* remove the oldest entry from the buffer.
	*/
	if (InstancePtr->Log.Tail == InstancePtr->Log.Head) {
		if (InstancePtr->Log.Tail == XHDCP22_RX_LOG_BUFFER_SIZE - 1) {
			InstancePtr->Log.Tail = 0;
		} else {
			InstancePtr->Log.Tail++;
		}
	}

	/* Update sticky error flag */
	if(Evt == XHDCP22_RX_LOG_EVT_ERROR)
	{
		InstancePtr->Info.ErrorFlagSticky |= (u32)Data;
	}
}
/*****************************************************************************/
/**
* This function writes HDCP22-RX log event into buffer. If the log event
* is of type error, the sticky error flag is set. The sticky error flag
* is used to keep history of error conditions.
*
* @param	InstancePtr is a pointer to the XHdcp22_Rx core instance.
* @param	Evt specifies an action to be carried out.
* @param	Data specifies the information that gets written into log
*			buffer.
*
* @return	None.
*
* @note		None.
******************************************************************************/
This function writes HDCP22-RX log event into buffer. If the log event
is of type error, the sticky error flag is set. The sticky error flag
is used to keep history of error conditions.
This function writes HDCP22 - RX log event into buffer . If the log event is of type error the sticky error flag is set . The sticky error flag is used to keep history of error conditions .
void XHdcp22Rx_LogWr(XHdcp22_Rx *InstancePtr, u16 Evt, u16 Data)
{
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(Evt < XHDCP22_RX_LOG_EVT_INVALID);
	if ((InstancePtr->Log.Verbose == FALSE) &&
			((Evt == XHDCP22_RX_LOG_EVT_DEBUG) ||
			 (Evt == XHDCP22_RX_LOG_EVT_INFO_MESSAGE))) {
		return;
	}
	InstancePtr->Log.LogItems[InstancePtr->Log.Head].Data = Data;
	InstancePtr->Log.LogItems[InstancePtr->Log.Head].LogEvent = Evt;
	InstancePtr->Log.LogItems[InstancePtr->Log.Head].TimeStamp =
			XHdcp22Rx_LogGetTimeUSecs(InstancePtr);
	if (InstancePtr->Log.Head == XHDCP22_RX_LOG_BUFFER_SIZE - 1) {
		InstancePtr->Log.Head = 0;
	} else {
		InstancePtr->Log.Head++;
	}
	if (InstancePtr->Log.Tail == InstancePtr->Log.Head) {
		if (InstancePtr->Log.Tail == XHDCP22_RX_LOG_BUFFER_SIZE - 1) {
			InstancePtr->Log.Tail = 0;
		} else {
			InstancePtr->Log.Tail++;
		}
	}
	if(Evt == XHDCP22_RX_LOG_EVT_ERROR)
	{
		InstancePtr->Info.ErrorFlagSticky |= (u32)Data;
	}
}
void XHdcp22Rx_LogWr ( XHdcp22_Rx * InstancePtr , u16 Evt , u16 Data ) { Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( Evt < XHDCP22_RX_LOG_EVT_INVALID ) ; if ( ( InstancePtr -> Log . Verbose == FALSE ) && ( ( Evt == XHDCP22_RX_LOG_EVT_DEBUG ) || ( Evt == XHDCP22_RX_LOG_EVT_INFO_MESSAGE ) ) ) { return ; } InstancePtr -> Log . LogItems [ InstancePtr -> Log . Head ] . Data = Data ; InstancePtr -> Log . LogItems [ InstancePtr -> Log . Head ] . LogEvent = Evt ; InstancePtr -> Log . LogItems [ InstancePtr -> Log . Head ] . TimeStamp = XHdcp22Rx_LogGetTimeUSecs ( InstancePtr ) ; if ( InstancePtr -> Log . Head == XHDCP22_RX_LOG_BUFFER_SIZE - 1 ) { InstancePtr -> Log . Head = 0 ; } else { InstancePtr -> Log . Head ++ ; } if ( InstancePtr -> Log . Tail == InstancePtr -> Log . Head ) { if ( InstancePtr -> Log . Tail == XHDCP22_RX_LOG_BUFFER_SIZE - 1 ) { InstancePtr -> Log . Tail = 0 ; } else { InstancePtr -> Log . Tail ++ ; } } if ( Evt == XHDCP22_RX_LOG_EVT_ERROR ) { InstancePtr -> Info . ErrorFlagSticky |= ( u32 ) Data ; } }
This function writes HDCP22-RX log event into buffer.
This function writes HDCP22 - RX log event into buffer .
/* Verify arguments. */ /* When logging a debug event check if verbose is set to true */ /* Write data and event into log buffer */ /* Update head pointer if reached to end of the buffer */ /* Clear pointer */ /* Increment pointer */ /* Check tail pointer. When the two pointer are equal, then the buffer
	* is full.In this case then increment the tail pointer as well to
	* remove the oldest entry from the buffer.
	*/ /* Update sticky error flag */