XilinxProcessorIPLib/drivers/axidma/examples/xaxidma_example_sg_poll.c
static int CheckData(void)
{
	u8 *RxPacket;
	int Index = 0;
	u8 Value;


	RxPacket = (u8 *) RX_BUFFER_BASE;
	Value = TEST_START_VALUE;

	/* Invalidate the DestBuffer before receiving the data, in case the
	 * Data Cache is enabled
	 */
	Xil_DCacheInvalidateRange((UINTPTR)RxPacket, MAX_PKT_LEN);

	for(Index = 0; Index < MAX_PKT_LEN; Index++) {
		if (RxPacket[Index] != Value) {
			xil_printf("Data error %d: %x/%x\r\n",
			    Index, (unsigned int)RxPacket[Index],
			    (unsigned int)Value);

			return XST_FAILURE;
		}
		Value = (Value + 1) & 0xFF;
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/*
*
* This function checks data buffer after the DMA transfer is finished.
*
* @param	None
*
* @return	- XST_SUCCESS if validation is successful
*		- XST_FAILURE if validation is failure.
*
* @note		None.
*
******************************************************************************/
This function checks data buffer after the DMA transfer is finished.
This function checks data buffer after the DMA transfer is finished .
static int CheckData(void)
{
	u8 *RxPacket;
	int Index = 0;
	u8 Value;
	RxPacket = (u8 *) RX_BUFFER_BASE;
	Value = TEST_START_VALUE;
	Xil_DCacheInvalidateRange((UINTPTR)RxPacket, MAX_PKT_LEN);
	for(Index = 0; Index < MAX_PKT_LEN; Index++) {
		if (RxPacket[Index] != Value) {
			xil_printf("Data error %d: %x/%x\r\n",
			    Index, (unsigned int)RxPacket[Index],
			    (unsigned int)Value);
			return XST_FAILURE;
		}
		Value = (Value + 1) & 0xFF;
	}
	return XST_SUCCESS;
}
static int CheckData ( void ) { u8 * RxPacket ; int Index = 0 ; u8 Value ; RxPacket = ( u8 * ) RX_BUFFER_BASE ; Value = TEST_START_VALUE ; Xil_DCacheInvalidateRange ( ( UINTPTR ) RxPacket , MAX_PKT_LEN ) ; for ( Index = 0 ; Index < MAX_PKT_LEN ; Index ++ ) { if ( RxPacket [ Index ] != Value ) { xil_printf ( " \r \n " , Index , ( unsigned int ) RxPacket [ Index ] , ( unsigned int ) Value ) ; return XST_FAILURE ; } Value = ( Value + 1 ) & 0xFF ; } return XST_SUCCESS ; }
This function checks data buffer after the DMA transfer is finished.
This function checks data buffer after the DMA transfer is finished .
/* Invalidate the DestBuffer before receiving the data, in case the
	 * Data Cache is enabled
	 */