lib/sw_services/xilloader/src/xloader.c
static int XLoader_GetChildRelation(u32 ChildImgID, u32 ParentImgID, u32 *IsChild)
{
	int Status = XST_FAILURE;
	u32 TempParentImgID = ChildImgID;

	while (TRUE) {
		Status = XPm_Query((u32)XPM_QID_PLD_GET_PARENT, TempParentImgID, 0U, 0U,
				&TempParentImgID);
		if (Status != XST_SUCCESS) {
			Status = (int)XLOADER_ERR_PARENT_QUERY_RELATION_CHECK;
			goto END;
		}

		if (TempParentImgID == 0U) {
			*IsChild = (u32)FALSE;
			break;
		}

		if (TempParentImgID == ParentImgID) {
			*IsChild = (u32)TRUE;
			break;
		}
	}

	Status = XST_SUCCESS;

END:
	return Status;

}
/*****************************************************************************/
/**
 * @brief	This function checks if the given ImgID is a child of Parent ImgID
 *
 * @param	ChildImgID is the current ImgID whose relation is to be checked
 * @param	ParentImgID is the ImgID with which the hierarchical ImgIDs are
 * compared in order to get the correct parent-child relationship
 * @param	IsChild is the pointer to the Relation that has to be
 *		returned, TRUE if it is a Child, else FALSE
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function checks if the given ImgID is a child of Parent ImgID
@param       ChildImgID is the current ImgID whose relation is to be checked
@param       ParentImgID is the ImgID with which the hierarchical ImgIDs are
compared in order to get the correct parent-child relationship
@param       IsChild is the pointer to the Relation that has to be
returned, TRUE if it is a Child, else FALSE

@return      XST_SUCCESS on success and error code on failure
@brief This function checks if the given ImgID is a child of Parent ImgID @param ChildImgID is the current ImgID whose relation is to be checked @param ParentImgID is the ImgID with which the hierarchical ImgIDs are compared in order to get the correct parent - child relationship @param IsChild is the pointer to the Relation that has to be returned TRUE if it is a Child else FALSE @return XST_SUCCESS on success and error code on failure
static int XLoader_GetChildRelation(u32 ChildImgID, u32 ParentImgID, u32 *IsChild)
{
	int Status = XST_FAILURE;
	u32 TempParentImgID = ChildImgID;
	while (TRUE) {
		Status = XPm_Query((u32)XPM_QID_PLD_GET_PARENT, TempParentImgID, 0U, 0U,
				&TempParentImgID);
		if (Status != XST_SUCCESS) {
			Status = (int)XLOADER_ERR_PARENT_QUERY_RELATION_CHECK;
			goto END;
		}
		if (TempParentImgID == 0U) {
			*IsChild = (u32)FALSE;
			break;
		}
		if (TempParentImgID == ParentImgID) {
			*IsChild = (u32)TRUE;
			break;
		}
	}
	Status = XST_SUCCESS;
END:
	return Status;
}
static int XLoader_GetChildRelation ( u32 ChildImgID , u32 ParentImgID , u32 * IsChild ) { int Status = XST_FAILURE ; u32 TempParentImgID = ChildImgID ; while ( TRUE ) { Status = XPm_Query ( ( u32 ) XPM_QID_PLD_GET_PARENT , TempParentImgID , 0U , 0U , & TempParentImgID ) ; if ( Status != XST_SUCCESS ) { Status = ( int ) XLOADER_ERR_PARENT_QUERY_RELATION_CHECK ; goto END ; } if ( TempParentImgID == 0U ) { * IsChild = ( u32 ) FALSE ; break ; } if ( TempParentImgID == ParentImgID ) { * IsChild = ( u32 ) TRUE ; break ; } } Status = XST_SUCCESS ; END : return Status ; }
@brief       This function checks if the given ImgID is a child of Parent ImgID
 @param       ChildImgID is the current ImgID whose relation is to be checked
 @param       ParentImgID is the ImgID with which the hierarchical ImgIDs are
 compared in order to get the correct parent-child relationship
 @param       IsChild is the pointer to the Relation that has to be
              returned, TRUE if it is a Child, else FALSE
@brief This function checks if the given ImgID is a child of Parent ImgID @param ChildImgID is the current ImgID whose relation is to be checked @param ParentImgID is the ImgID with which the hierarchical ImgIDs are compared in order to get the correct parent - child relationship @param IsChild is the pointer to the Relation that has to be returned TRUE if it is a Child else FALSE