XilinxProcessorIPLib/drivers/hdcp22_tx_dp/src/xhdcp22_tx.c
void XHdcp22Tx_LogWr(XHdcp22_Tx *InstancePtr, XHdcp22_Tx_LogEvt Evt, u16 Data)
{
	/* Verify arguments. */
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(Evt < (XHDCP22_TX_LOG_INVALID));

	if (InstancePtr->Log.Verbose == FALSE && Evt == XHDCP22_TX_LOG_EVT_DBG) {
		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 =
                            XHdcp22Tx_LogGetTimeUSecs(InstancePtr);

	/* Update head pointer if reached to end of the buffer */
	if (InstancePtr->Log.Head == XHDCP22_TX_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_TX_LOG_BUFFER_SIZE - 1) {
			InstancePtr->Log.Tail = 0;
		} else {
			InstancePtr->Log.Tail++;
		}
	}
}
/*****************************************************************************/
/**
*
* This function writes HDCP TX logs into buffer.
*
* @param  InstancePtr is a pointer to the XHdcp22_Tx core instance.
* @param  Evt specifies an action to be carried out. Please refer
*         #XHdcp22_Tx_LogEvt enum in xhdcp22_tx.h.
* @param  Data specifies the information that gets written into log
*         buffer.
*
* @return None.
*
* @note   None.
*
******************************************************************************/
This function writes HDCP TX logs into buffer.
This function writes HDCP TX logs into buffer .
void XHdcp22Tx_LogWr(XHdcp22_Tx *InstancePtr, XHdcp22_Tx_LogEvt Evt, u16 Data)
{
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(Evt < (XHDCP22_TX_LOG_INVALID));
	if (InstancePtr->Log.Verbose == FALSE && Evt == XHDCP22_TX_LOG_EVT_DBG) {
		return;
	}
	InstancePtr->Log.LogItems[InstancePtr->Log.Head].Data = Data;
	InstancePtr->Log.LogItems[InstancePtr->Log.Head].LogEvent = Evt;
	InstancePtr->Log.LogItems[InstancePtr->Log.Head].TimeStamp =
                            XHdcp22Tx_LogGetTimeUSecs(InstancePtr);
	if (InstancePtr->Log.Head == XHDCP22_TX_LOG_BUFFER_SIZE - 1) {
		InstancePtr->Log.Head = 0;
	} else {
		InstancePtr->Log.Head++;
	}
	if (InstancePtr->Log.Tail == InstancePtr->Log.Head) {
		if (InstancePtr->Log.Tail == XHDCP22_TX_LOG_BUFFER_SIZE - 1) {
			InstancePtr->Log.Tail = 0;
		} else {
			InstancePtr->Log.Tail++;
		}
	}
}
void XHdcp22Tx_LogWr ( XHdcp22_Tx * InstancePtr , XHdcp22_Tx_LogEvt Evt , u16 Data ) { Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( Evt < ( XHDCP22_TX_LOG_INVALID ) ) ; if ( InstancePtr -> Log . Verbose == FALSE && Evt == XHDCP22_TX_LOG_EVT_DBG ) { return ; } InstancePtr -> Log . LogItems [ InstancePtr -> Log . Head ] . Data = Data ; InstancePtr -> Log . LogItems [ InstancePtr -> Log . Head ] . LogEvent = Evt ; InstancePtr -> Log . LogItems [ InstancePtr -> Log . Head ] . TimeStamp = XHdcp22Tx_LogGetTimeUSecs ( InstancePtr ) ; if ( InstancePtr -> Log . Head == XHDCP22_TX_LOG_BUFFER_SIZE - 1 ) { InstancePtr -> Log . Head = 0 ; } else { InstancePtr -> Log . Head ++ ; } if ( InstancePtr -> Log . Tail == InstancePtr -> Log . Head ) { if ( InstancePtr -> Log . Tail == XHDCP22_TX_LOG_BUFFER_SIZE - 1 ) { InstancePtr -> Log . Tail = 0 ; } else { InstancePtr -> Log . Tail ++ ; } } }
This function writes HDCP TX logs into buffer.
This function writes HDCP TX logs into buffer .
/* Verify arguments. */ /* 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.
	 */