XilinxProcessorIPLib/drivers/aienginev2/src/io_backend/ext/xaie_baremetal.c
static AieRC _XAie_BaremetalIO_NpiMaskPoll(void *IOInst, u64 RegOff, u32 Mask,
		u32 Value, u32 TimeOutUs)
{
	AieRC Ret = XAIE_ERR;
	u32 Count, MinTimeOutUs, RegVal;

	/*
	 * Any value less than 200 us becomes noticable overhead. This is based
	 * on some profiling, and it may vary between platforms.
	 */
	MinTimeOutUs = 200;
	Count = ((u64)TimeOutUs + MinTimeOutUs - 1) / MinTimeOutUs;

	while (Count > 0U) {
		_XAie_BaremetalIO_NpiRead32(IOInst, RegOff, &RegVal);
		if((RegVal & Mask) == Value) {
			return XAIE_OK;
		}
		usleep(MinTimeOutUs);
		Count--;
	}

	/* Check for the break from timed-out loop */
	_XAie_BaremetalIO_NpiRead32(IOInst, RegOff, &RegVal);
	if((RegVal & Mask) == Value) {
		Ret = XAIE_OK;
	}

	return Ret;
}
/*****************************************************************************/
/**
*
* This is the memory IO function to mask poll a NPI address for a value.
*
* @param	IOInst: IO instance pointer
* @param	RegOff: Register offset to read from.
* @param	Mask: Mask to be applied to Data.
* @param	Value: 32-bit value to poll for
* @param	TimeOutUs: Timeout in micro seconds.
*
* @return	XAIE_OK or XAIE_ERR.
*
* @note		Internal only.
*
*******************************************************************************/
This is the memory IO function to mask poll a NPI address for a value.
This is the memory IO function to mask poll a NPI address for a value .
static AieRC _XAie_BaremetalIO_NpiMaskPoll(void *IOInst, u64 RegOff, u32 Mask,
		u32 Value, u32 TimeOutUs)
{
	AieRC Ret = XAIE_ERR;
	u32 Count, MinTimeOutUs, RegVal;
	MinTimeOutUs = 200;
	Count = ((u64)TimeOutUs + MinTimeOutUs - 1) / MinTimeOutUs;
	while (Count > 0U) {
		_XAie_BaremetalIO_NpiRead32(IOInst, RegOff, &RegVal);
		if((RegVal & Mask) == Value) {
			return XAIE_OK;
		}
		usleep(MinTimeOutUs);
		Count--;
	}
	_XAie_BaremetalIO_NpiRead32(IOInst, RegOff, &RegVal);
	if((RegVal & Mask) == Value) {
		Ret = XAIE_OK;
	}
	return Ret;
}
static AieRC _XAie_BaremetalIO_NpiMaskPoll ( void * IOInst , u64 RegOff , u32 Mask , u32 Value , u32 TimeOutUs ) { AieRC Ret = XAIE_ERR ; u32 Count , MinTimeOutUs , RegVal ; MinTimeOutUs = 200 ; Count = ( ( u64 ) TimeOutUs + MinTimeOutUs - 1 ) / MinTimeOutUs ; while ( Count > 0U ) { _XAie_BaremetalIO_NpiRead32 ( IOInst , RegOff , & RegVal ) ; if ( ( RegVal & Mask ) == Value ) { return XAIE_OK ; } usleep ( MinTimeOutUs ) ; Count -- ; } _XAie_BaremetalIO_NpiRead32 ( IOInst , RegOff , & RegVal ) ; if ( ( RegVal & Mask ) == Value ) { Ret = XAIE_OK ; } return Ret ; }
This is the memory IO function to mask poll a NPI address for a value.
This is the memory IO function to mask poll a NPI address for a value .
/*
	 * Any value less than 200 us becomes noticable overhead. This is based
	 * on some profiling, and it may vary between platforms.
	 */ /* Check for the break from timed-out loop */