lib/sw_services/xilplmi/src/xplmi_generic.c
static int XPlmi_MaskPoll64(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	u64 Addr = ((u64)Cmd->Payload[0U] << 32U) | Cmd->Payload[1U];
	u32 Mask = Cmd->Payload[2U];
	u32 ExpectedValue = Cmd->Payload[3U];
	u32 TimeOutInUs = Cmd->Payload[4U];
	u32 Flags = 0U;

	XPlmi_Printf(DEBUG_DETAILED,
		"%s, Addr: 0x%0x%08x,  Mask 0x%0x, ExpVal: 0x%0x, Timeout: %u\n\r",
		__func__, (u32)(Addr >> 32U), (u32)Addr, Mask, ExpectedValue, TimeOutInUs);

	Status = XPlmi_UtilPoll64(Addr, Mask, ExpectedValue, TimeOutInUs);
	if (Status != XST_SUCCESS) {
		Status = XPLMI_ERR_MASKPOLL64;
	}

	/* If command length is 6, flags are included */
	if ((Cmd->Len == XPLMI_MASKPOLL64_LEN_EXT) && (Status != XST_SUCCESS)) {
		Flags = Cmd->Payload[5U] & XPLMI_MASKPOLL_FLAGS_MASK;
		if (Flags == XPLMI_MASKPOLL_FLAGS_SUCCESS) {
			/* Ignore the error */
			Status = XST_SUCCESS;
		} else if (Flags == XPLMI_MASKPOLL_FLAGS_DEFERRED_ERR) {
			/* Defer the error till the end of CDO processing */
			Status = XST_SUCCESS;
			Cmd->DeferredError = (u8)TRUE;
		} else {
			/* Return mask_poll status */
		}
	}

	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function provides 64 bit mask poll command execution.
 *  		Command payload parameters are
 *		- High Address
 *		- Low Address
 *		- Mask
 *		- Expected Value
 *		- Timeout in us
 *		- Deferred Error flag - Optional
 *			0 - Return error in case of failure,
 *			1 - Ignore error, return success always
 *			2 - Defer error till the end of partition load
 *
 * @param	Cmd is pointer to the command structure
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function provides 64 bit mask poll command execution.

@param       Cmd is pointer to the command structure

@return      XST_SUCCESS on success and error code on failure
@brief This function provides 64 bit mask poll command execution . @param Cmd is pointer to the command structure @return XST_SUCCESS on success and error code on failure
static int XPlmi_MaskPoll64(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	u64 Addr = ((u64)Cmd->Payload[0U] << 32U) | Cmd->Payload[1U];
	u32 Mask = Cmd->Payload[2U];
	u32 ExpectedValue = Cmd->Payload[3U];
	u32 TimeOutInUs = Cmd->Payload[4U];
	u32 Flags = 0U;
	XPlmi_Printf(DEBUG_DETAILED,
		"%s, Addr: 0x%0x%08x,  Mask 0x%0x, ExpVal: 0x%0x, Timeout: %u\n\r",
		__func__, (u32)(Addr >> 32U), (u32)Addr, Mask, ExpectedValue, TimeOutInUs);
	Status = XPlmi_UtilPoll64(Addr, Mask, ExpectedValue, TimeOutInUs);
	if (Status != XST_SUCCESS) {
		Status = XPLMI_ERR_MASKPOLL64;
	}
	if ((Cmd->Len == XPLMI_MASKPOLL64_LEN_EXT) && (Status != XST_SUCCESS)) {
		Flags = Cmd->Payload[5U] & XPLMI_MASKPOLL_FLAGS_MASK;
		if (Flags == XPLMI_MASKPOLL_FLAGS_SUCCESS) {
			Status = XST_SUCCESS;
		} else if (Flags == XPLMI_MASKPOLL_FLAGS_DEFERRED_ERR) {
			Status = XST_SUCCESS;
			Cmd->DeferredError = (u8)TRUE;
		} else {
		}
	}
	return Status;
}
static int XPlmi_MaskPoll64 ( XPlmi_Cmd * Cmd ) { int Status = XST_FAILURE ; u64 Addr = ( ( u64 ) Cmd -> Payload [ 0U ] << 32U ) | Cmd -> Payload [ 1U ] ; u32 Mask = Cmd -> Payload [ 2U ] ; u32 ExpectedValue = Cmd -> Payload [ 3U ] ; u32 TimeOutInUs = Cmd -> Payload [ 4U ] ; u32 Flags = 0U ; XPlmi_Printf ( DEBUG_DETAILED , " \n \r " , __func__ , ( u32 ) ( Addr >> 32U ) , ( u32 ) Addr , Mask , ExpectedValue , TimeOutInUs ) ; Status = XPlmi_UtilPoll64 ( Addr , Mask , ExpectedValue , TimeOutInUs ) ; if ( Status != XST_SUCCESS ) { Status = XPLMI_ERR_MASKPOLL64 ; } if ( ( Cmd -> Len == XPLMI_MASKPOLL64_LEN_EXT ) && ( Status != XST_SUCCESS ) ) { Flags = Cmd -> Payload [ 5U ] & XPLMI_MASKPOLL_FLAGS_MASK ; if ( Flags == XPLMI_MASKPOLL_FLAGS_SUCCESS ) { Status = XST_SUCCESS ; } else if ( Flags == XPLMI_MASKPOLL_FLAGS_DEFERRED_ERR ) { Status = XST_SUCCESS ; Cmd -> DeferredError = ( u8 ) TRUE ; } else { } } return Status ; }
@brief       This function provides 64 bit mask poll command execution.
@brief This function provides 64 bit mask poll command execution .
/* If command length is 6, flags are included */ /* Ignore the error */ /* Defer the error till the end of CDO processing */ /* Return mask_poll status */