XilinxProcessorIPLib/drivers/aienginev2/src/locks/xaie_locks_aieml.c
AieRC _XAieMl_LockAcquire(XAie_DevInst *DevInst, const XAie_LockMod *LockMod,
		XAie_LocType Loc, XAie_Lock Lock, u32 TimeOut)
{
	u64 RegAddr;
	u32 RegOff;

	RegOff = LockMod->BaseAddr + (Lock.LockId * LockMod->LockIdOff) +
		(LockMod->RelAcqOff) + ((Lock.LockVal &
					XAIEML_LOCK_VALUE_MASK) <<
				XAIEML_LOCK_VALUE_SHIFT);

	RegAddr = _XAie_GetTileAddr(DevInst, Loc.Row, Loc.Col) + RegOff;

	if(XAie_MaskPoll(DevInst, RegAddr, XAIEML_LOCK_RESULT_MASK,
				(XAIEML_LOCK_RESULT_SUCCESS <<
				 XAIEML_LOCK_RESULT_LSB), TimeOut) != XAIE_OK) {

		return XAIE_LOCK_RESULT_FAILED;
	}

	return XAIE_OK;
}
/*****************************************************************************/
/**
*
* This API is used to acquire the specified lock and value. This API can be
* blocking or non-blocking based on the TimeOut value. If the TimeOut is 0us,
* the API behaves in a non-blocking fashion and returns immediately after the
* first lock acquire request. If TimeOut > 0, then the API is a blocking call
* and will issue lock acquire request until the acquire is successful or it
* times out, whichever occurs first.
*
* @param	DevInst: Device Instance
* @param	LockMod: Internal lock module data structure.
* @param	Loc: Location of AIE Tile
* @param	Lock: Lock data structure with LockId and LockValue.
* @param	TimeOut: Timeout value for which the acquire request needs to be
*		repeated. Value in usecs.
*
* @return	XAIE_OK if Lock Acquired, else XAIE_LOCK_RESULT_FAILED.
*
* @note 	Internal API for AIEML. This API should not be called directly.
*		It is invoked only using the function pointer part of the lock
*		module data structure.
*
******************************************************************************/
This API is used to acquire the specified lock and value. This API can be
blocking or non-blocking based on the TimeOut value. If the TimeOut is 0us,
the API behaves in a non-blocking fashion and returns immediately after the
first lock acquire request. If TimeOut > 0, then the API is a blocking call
and will issue lock acquire request until the acquire is successful or it
times out, whichever occurs first.
This API is used to acquire the specified lock and value . This API can be blocking or non - blocking based on the TimeOut value . If the TimeOut is 0us the API behaves in a non - blocking fashion and returns immediately after the first lock acquire request . If TimeOut > 0 then the API is a blocking call and will issue lock acquire request until the acquire is successful or it times out whichever occurs first .
AieRC _XAieMl_LockAcquire(XAie_DevInst *DevInst, const XAie_LockMod *LockMod,
		XAie_LocType Loc, XAie_Lock Lock, u32 TimeOut)
{
	u64 RegAddr;
	u32 RegOff;
	RegOff = LockMod->BaseAddr + (Lock.LockId * LockMod->LockIdOff) +
		(LockMod->RelAcqOff) + ((Lock.LockVal &
					XAIEML_LOCK_VALUE_MASK) <<
				XAIEML_LOCK_VALUE_SHIFT);
	RegAddr = _XAie_GetTileAddr(DevInst, Loc.Row, Loc.Col) + RegOff;
	if(XAie_MaskPoll(DevInst, RegAddr, XAIEML_LOCK_RESULT_MASK,
				(XAIEML_LOCK_RESULT_SUCCESS <<
				 XAIEML_LOCK_RESULT_LSB), TimeOut) != XAIE_OK) {
		return XAIE_LOCK_RESULT_FAILED;
	}
	return XAIE_OK;
}
AieRC _XAieMl_LockAcquire ( XAie_DevInst * DevInst , const XAie_LockMod * LockMod , XAie_LocType Loc , XAie_Lock Lock , u32 TimeOut ) { u64 RegAddr ; u32 RegOff ; RegOff = LockMod -> BaseAddr + ( Lock . LockId * LockMod -> LockIdOff ) + ( LockMod -> RelAcqOff ) + ( ( Lock . LockVal & XAIEML_LOCK_VALUE_MASK ) << XAIEML_LOCK_VALUE_SHIFT ) ; RegAddr = _XAie_GetTileAddr ( DevInst , Loc . Row , Loc . Col ) + RegOff ; if ( XAie_MaskPoll ( DevInst , RegAddr , XAIEML_LOCK_RESULT_MASK , ( XAIEML_LOCK_RESULT_SUCCESS << XAIEML_LOCK_RESULT_LSB ) , TimeOut ) != XAIE_OK ) { return XAIE_LOCK_RESULT_FAILED ; } return XAIE_OK ; }
This API is used to acquire the specified lock and value.
This API is used to acquire the specified lock and value .