XilinxProcessorIPLib/drivers/aiengine/src/lib/xaielib.c
XAieLib_MemInst *XAieLib_MemAttach(u64 Vaddr, u64 Paddr, u64 Size, u64 MemHandle)
{
#ifdef __AIESIM__
	return 0;
#elif defined __AIEBAREMTL__
	XAieLib_MemInst *XAieLib_MemInstPtr;

	XAieLib_MemInstPtr = malloc(sizeof(*XAieLib_MemInstPtr));
	if (!XAieLib_MemInstPtr)
		return NULL;
	/* In baremetal, the handle doesn't exist */
	XAieLib_MemInstPtr->Vaddr = Vaddr;
	XAieLib_MemInstPtr->Paddr = Paddr;
	XAieLib_MemInstPtr->Size = Size;

	return XAieLib_MemInstPtr;
#else
	return (XAieLib_MemInst *)XAieIO_MemAttach(Vaddr, Paddr, Size, MemHandle);
#endif
}
/*****************************************************************************/
/**
*
* This is the memory function to attach the external memory to device
*
* @param	Vaddr: Vaddr of the memory
* @param	Paddr: Paddr of the memory
* @param	Size: Size of the memory
* @param	MemHandle: Handle of the memory. For linux, dmabuf fd
*
* @return	Pointer to the attached memory instance.
*
* @note		Some arguments are not required for some backend platforms.
* This is determined by platform implementation.
*
*******************************************************************************/
This is the memory function to attach the external memory to device
This is the memory function to attach the external memory to device
XAieLib_MemInst *XAieLib_MemAttach(u64 Vaddr, u64 Paddr, u64 Size, u64 MemHandle)
{
#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 = Vaddr;
	XAieLib_MemInstPtr->Paddr = Paddr;
	XAieLib_MemInstPtr->Size = Size;
	return XAieLib_MemInstPtr;
#else
	return (XAieLib_MemInst *)XAieIO_MemAttach(Vaddr, Paddr, Size, MemHandle);
#endif
}
XAieLib_MemInst * XAieLib_MemAttach ( u64 Vaddr , u64 Paddr , u64 Size , u64 MemHandle ) { #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 = Vaddr ; XAieLib_MemInstPtr -> Paddr = Paddr ; XAieLib_MemInstPtr -> Size = Size ; return XAieLib_MemInstPtr ; #else return ( XAieLib_MemInst * ) XAieIO_MemAttach ( Vaddr , Paddr , Size , MemHandle ) ; #endif }
This is the memory function to attach the external memory to device
This is the memory function to attach the external memory to device
/* In baremetal, the handle doesn't exist */