XilinxProcessorIPLib/drivers/aiengine/src/lib/xaielib.c
XAieLib_MemInst *XAieLib_MemAllocate(u64 Size, u32 Attr)
{
#ifdef __AIESIM__
	return 0;
#elif defined __AIEBAREMTL__
	XAieLib_MemInst *XAieLib_MemInstPtr;

	XAieLib_MemInstPtr = malloc(sizeof(*XAieLib_MemInstPtr));
	if (!XAieLib_MemInstPtr)
		return NULL;
	XAieLib_MemInstPtr->Vaddr = (u64)malloc(Size);
	XAieLib_MemInstPtr->Paddr = XAieLib_MemInstPtr->Vaddr;
	XAieLib_MemInstPtr->Size = Size;
	/*
	 * 'Attr' is not handled at the moment. So it's always cached, and
	 * the sync or accessor function takes care of it.
	 */

	return XAieLib_MemInstPtr;
#else
	return (XAieLib_MemInst *)XAieIO_MemAllocate(Size, Attr);
#endif
}
/*****************************************************************************/
/**
*
* This is the memory function to allocate a memory
*
* @param	Size: Size of the memory
* @param	Attr: Any of XAIELIB_MEM_ATTR_*
*
* @return	Pointer to the allocated IO memory instance.
*
* @note		None.
*
*******************************************************************************/
This is the memory function to allocate a memory
This is the memory function to allocate a memory
XAieLib_MemInst *XAieLib_MemAllocate(u64 Size, u32 Attr)
{
#ifdef __AIESIM__
	return 0;
#elif defined __AIEBAREMTL__
	XAieLib_MemInst *XAieLib_MemInstPtr;
	XAieLib_MemInstPtr = malloc(sizeof(*XAieLib_MemInstPtr));
	if (!XAieLib_MemInstPtr)
		return NULL;
	XAieLib_MemInstPtr->Vaddr = (u64)malloc(Size);
	XAieLib_MemInstPtr->Paddr = XAieLib_MemInstPtr->Vaddr;
	XAieLib_MemInstPtr->Size = Size;
	return XAieLib_MemInstPtr;
#else
	return (XAieLib_MemInst *)XAieIO_MemAllocate(Size, Attr);
#endif
}
XAieLib_MemInst * XAieLib_MemAllocate ( u64 Size , u32 Attr ) { #ifdef __AIESIM__ return 0 ; #elif defined __AIEBAREMTL__ XAieLib_MemInst * XAieLib_MemInstPtr ; XAieLib_MemInstPtr = malloc ( sizeof ( * XAieLib_MemInstPtr ) ) ; if ( ! XAieLib_MemInstPtr ) return NULL ; XAieLib_MemInstPtr -> Vaddr = ( u64 ) malloc ( Size ) ; XAieLib_MemInstPtr -> Paddr = XAieLib_MemInstPtr -> Vaddr ; XAieLib_MemInstPtr -> Size = Size ; return XAieLib_MemInstPtr ; #else return ( XAieLib_MemInst * ) XAieIO_MemAllocate ( Size , Attr ) ; #endif }
This is the memory function to allocate a memory
This is the memory function to allocate a memory
/*
	 * 'Attr' is not handled at the moment. So it's always cached, and
	 * the sync or accessor function takes care of it.
	 */