lib/sw_services/xilpm/src/versal/server/xpm_ipi.c
XStatus XPm_IpiReadStatus(u32 IpiMask)
{
	u32 Response[RESPONSE_ARG_CNT] = {0};
	XStatus Status = XST_FAILURE;

	/* Wait until current IPI interrupt is handled by target module */
	Status = XPlmi_IpiPollForAck(IpiMask, PM_IPI_TIMEOUT);
	if (XST_SUCCESS != Status) {
		PmDbg("%s: ERROR: Timeout expired\r\n", __func__);
		goto done;
	}

	Status = XPlmi_IpiRead(IpiMask, Response,
			       RESPONSE_ARG_CNT, XIPIPSU_BUF_TYPE_RESP);
	if (XST_SUCCESS != Status) {
		PmDbg("%s: ERROR: Reading from IPI Response buffer\r\n", __func__);
		goto done;
	}

	Status = (XStatus)Response[0];

done:
	return Status;
}
/****************************************************************************/
/**
 * @brief	Reads IPI Response after target module has handled interrupt
 *
 * @param	IpiMask		IPI interrupt mask of target
 *
 * @return	XST_SUCCESS if successful else XST_FAILURE or an error code
 *
 * @note   None
 *
 ****************************************************************************/
@brief       Reads IPI Response after target module has handled interrupt
@param       IpiMask         IPI interrupt mask of target

@return      XST_SUCCESS if successful else XST_FAILURE or an error code

@note   None
@brief Reads IPI Response after target module has handled interrupt @param IpiMask IPI interrupt mask of target @return XST_SUCCESS if successful else XST_FAILURE or an error code @note None
XStatus XPm_IpiReadStatus(u32 IpiMask)
{
	u32 Response[RESPONSE_ARG_CNT] = {0};
	XStatus Status = XST_FAILURE;
	Status = XPlmi_IpiPollForAck(IpiMask, PM_IPI_TIMEOUT);
	if (XST_SUCCESS != Status) {
		PmDbg("%s: ERROR: Timeout expired\r\n", __func__);
		goto done;
	}
	Status = XPlmi_IpiRead(IpiMask, Response,
			       RESPONSE_ARG_CNT, XIPIPSU_BUF_TYPE_RESP);
	if (XST_SUCCESS != Status) {
		PmDbg("%s: ERROR: Reading from IPI Response buffer\r\n", __func__);
		goto done;
	}
	Status = (XStatus)Response[0];
done:
	return Status;
}
XStatus XPm_IpiReadStatus ( u32 IpiMask ) { u32 Response [ RESPONSE_ARG_CNT ] = { 0 } ; XStatus Status = XST_FAILURE ; Status = XPlmi_IpiPollForAck ( IpiMask , PM_IPI_TIMEOUT ) ; if ( XST_SUCCESS != Status ) { PmDbg ( " \r \n " , __func__ ) ; goto done ; } Status = XPlmi_IpiRead ( IpiMask , Response , RESPONSE_ARG_CNT , XIPIPSU_BUF_TYPE_RESP ) ; if ( XST_SUCCESS != Status ) { PmDbg ( " \r \n " , __func__ ) ; goto done ; } Status = ( XStatus ) Response [ 0 ] ; done : return Status ; }
@brief       Reads IPI Response after target module has handled interrupt
 @param       IpiMask         IPI interrupt mask of target
@brief Reads IPI Response after target module has handled interrupt @param IpiMask IPI interrupt mask of target
/* Wait until current IPI interrupt is handled by target module */