XilinxProcessorIPLib/drivers/llfifo/src/xllfifo.c
int XLlFifo_iWrite_Aligned(XLlFifo *InstancePtr, void *BufPtr,
			      unsigned WordCount)
{
	unsigned WordsRemaining = WordCount;
	u32 *BufPtrIdx = (u32 *)BufPtr;

	xdbg_printf(XDBG_DEBUG_FIFO_TX,
		    "XLlFifo_iWrite_Aligned: Inst: %p; Buff: %p; Count: %d\n",
		    InstancePtr, BufPtr, WordCount);
	Xil_AssertNonvoid(InstancePtr);
	Xil_AssertNonvoid(BufPtr);
	/* assert buffer is 32 bit aligned */
	Xil_AssertNonvoid(((UINTPTR)BufPtr & 0x3) == 0x0);

	xdbg_printf(XDBG_DEBUG_FIFO_TX,
		    "XLlFifo_iWrite_Aligned: WordsRemaining: %d\n",
		    WordsRemaining);
	while (WordsRemaining) {
		XLlFifo_TxPutWord(InstancePtr, *BufPtrIdx);
		BufPtrIdx++;
		WordsRemaining--;
	}

	xdbg_printf(XDBG_DEBUG_FIFO_TX,
		    "XLlFifo_iWrite_Aligned: returning SUCCESS\n");
	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* XLlFifo_iWrite_Aligned writes, <i>WordCount</i>, words to the FIFO referenced by
* <i>InstancePtr</i> from the block of memory, referenced by <i>BufPtr</i>.
*
* XLlFifo_iWrite_Aligned assumes that <i>BufPtr</i> is already aligned according
* to the following hardware limitations:
*    ppc        - aligned on 32 bit boundaries to avoid performance penalties
*                 from unaligned exception handling.
*    microblaze - aligned on 32 bit boundaries as microblaze does not handle
*                 unaligned transfers.
*
* Care must be taken to ensure that the number of words written with one or
* more calls to XLlFifo_iWrite_Aligned() matches the number of bytes (rounded up
* to the nearest whole 32 bit word) given in the next call to
* XLlFifo_iTxSetLen().
*
* @param    InstancePtr references the FIFO on which to operate.
*
* @param    BufPtr specifies the memory address to place the data read.
*
* @param    WordCount specifies the number of 32 bit words to read.
*
* @return   XLlFifo_iWrite_Aligned always returns XST_SUCCESS. Error handling is
*           otherwise handled through hardware exceptions and interrupts.
*
* @note
*
* C Signature: int XLlFifo_iWrite_Aligned(XLlFifo *InstancePtr,
*                      void *BufPtr, unsigned WordCount);
*
******************************************************************************/
XLlFifo_iWrite_Aligned writes, WordCount, words to the FIFO referenced by
InstancePtr from the block of memory, referenced by BufPtr.

XLlFifo_iWrite_Aligned assumes that BufPtr is already aligned according
to the following hardware limitations:
ppc        - aligned on 32 bit boundaries to avoid performance penalties
from unaligned exception handling.
microblaze - aligned on 32 bit boundaries as microblaze does not handle
unaligned transfers.

Care must be taken to ensure that the number of words written with one or
more calls to XLlFifo_iWrite_Aligned() matches the number of bytes (rounded up
to the nearest whole 32 bit word) given in the next call to
XLlFifo_iTxSetLen().
XLlFifo_iWrite_Aligned writes WordCount words to the FIFO referenced by InstancePtr from the block of memory referenced by BufPtr . XLlFifo_iWrite_Aligned assumes that BufPtr is already aligned according to the following hardware limitations : ppc - aligned on 32 bit boundaries to avoid performance penalties from unaligned exception handling . microblaze - aligned on 32 bit boundaries as microblaze does not handle unaligned transfers . Care must be taken to ensure that the number of words written with one or more calls to XLlFifo_iWrite_Aligned () matches the number of bytes ( rounded up to the nearest whole 32 bit word ) given in the next call to XLlFifo_iTxSetLen () .
int XLlFifo_iWrite_Aligned(XLlFifo *InstancePtr, void *BufPtr,
			      unsigned WordCount)
{
	unsigned WordsRemaining = WordCount;
	u32 *BufPtrIdx = (u32 *)BufPtr;
	xdbg_printf(XDBG_DEBUG_FIFO_TX,
		    "XLlFifo_iWrite_Aligned: Inst: %p; Buff: %p; Count: %d\n",
		    InstancePtr, BufPtr, WordCount);
	Xil_AssertNonvoid(InstancePtr);
	Xil_AssertNonvoid(BufPtr);
	Xil_AssertNonvoid(((UINTPTR)BufPtr & 0x3) == 0x0);
	xdbg_printf(XDBG_DEBUG_FIFO_TX,
		    "XLlFifo_iWrite_Aligned: WordsRemaining: %d\n",
		    WordsRemaining);
	while (WordsRemaining) {
		XLlFifo_TxPutWord(InstancePtr, *BufPtrIdx);
		BufPtrIdx++;
		WordsRemaining--;
	}
	xdbg_printf(XDBG_DEBUG_FIFO_TX,
		    "XLlFifo_iWrite_Aligned: returning SUCCESS\n");
	return XST_SUCCESS;
}
int XLlFifo_iWrite_Aligned ( XLlFifo * InstancePtr , void * BufPtr , unsigned WordCount ) { unsigned WordsRemaining = WordCount ; u32 * BufPtrIdx = ( u32 * ) BufPtr ; xdbg_printf ( XDBG_DEBUG_FIFO_TX , " \n " , InstancePtr , BufPtr , WordCount ) ; Xil_AssertNonvoid ( InstancePtr ) ; Xil_AssertNonvoid ( BufPtr ) ; Xil_AssertNonvoid ( ( ( UINTPTR ) BufPtr & 0x3 ) == 0x0 ) ; xdbg_printf ( XDBG_DEBUG_FIFO_TX , " \n " , WordsRemaining ) ; while ( WordsRemaining ) { XLlFifo_TxPutWord ( InstancePtr , * BufPtrIdx ) ; BufPtrIdx ++ ; WordsRemaining -- ; } xdbg_printf ( XDBG_DEBUG_FIFO_TX , " \n " ) ; return XST_SUCCESS ; }
XLlFifo_iWrite_Aligned writes, <i>WordCount</i>, words to the FIFO referenced by
<i>InstancePtr</i> from the block of memory, referenced by <i>BufPtr</i>.
XLlFifo_iWrite_Aligned writes <i > WordCount< / i > words to the FIFO referenced by <i > InstancePtr< / i > from the block of memory referenced by <i > BufPtr< / i > .
/* assert buffer is 32 bit aligned */