/* Allocate a buffer of the DMA program buffer from the pool. */
static void * XDmaPs_BufPool_Allocate(XDmaPs_ProgBuf *Pool)
/* Allocate a buffer of the DMA program buffer from the pool. */
static void * XDmaPs_BufPool_Allocate(XDmaPs_ProgBuf *Pool)
{
	int Index;
	Xil_AssertNonvoid(Pool != NULL);
	for (Index = 0; Index < XDMAPS_MAX_CHAN_BUFS; Index++) {
		if (!Pool[Index].Allocated) {
			Pool[Index].Allocated = 1;
			return Pool[Index].Buf;
		}
	}
	return NULL;
}