XilinxProcessorIPLib/drivers/aienginev2/src/locks/xaie_locks_aieml.c
AieRC _XAieMl_LockRelease(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) +
		((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;
}
/************************** Function Definitions *****************************/
/*****************************************************************************/
/**
*
* This API is used to release the specified lock with or without 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 release request. If TimeOut > 0, then the
* API is a blocking call and will issue lock release request until the release
* 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 release request needs to be
*		repeated. Value in usecs.
*
* @return	XAIE_OK if Lock Release, 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.
*
******************************************************************************/
Function Definitions
This API is used to release the specified lock with or without 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 release request. If TimeOut > 0, then the
API is a blocking call and will issue lock release request until the release
is successful or it times out, whichever occurs first.
Function Definitions This API is used to release the specified lock with or without 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 release request . If TimeOut > 0 then the API is a blocking call and will issue lock release request until the release is successful or it times out whichever occurs first .
AieRC _XAieMl_LockRelease(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) +
		((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_LockRelease ( 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 ) + ( ( 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 ; }
Function Definitions
This API is used to release the specified lock with or without value.
Function Definitions This API is used to release the specified lock with or without value .