lib/sw_apps/zynqmp_pmufw/src/pm_slave.c
s32 PmSlaveSetConfig(PmSlave* const slave, const u32 policy, const u32 perms)
{
	s32 status = XST_SUCCESS;
	u32 masterIpiMasks = perms;
	u32 caps = slave->slvFsm->states[slave->slvFsm->statesCnt - 1U];

	if (0U != (policy & PM_SLAVE_FLAG_IS_SHAREABLE)) {
		slave->flags |= PM_SLAVE_FLAG_IS_SHAREABLE;
	}

	/* Extract and process one by one master from the encoded perms */
	while (0U != masterIpiMasks) {
		PmMaster* master = PmMasterGetNextFromIpiMask(&masterIpiMasks);
		PmRequirement* req;

		if (NULL == master) {
			status = XST_FAILURE;
			goto done;
		}

		req = PmRequirementAdd(master, slave);
		if (NULL == req) {
			status = XST_FAILURE;
			goto done;
		}
		req->currReq = (u8)caps;
	}

done:
	return status;
}
/**
 * PmSlaveSetConfig() - Set the configuration for the slave
 * @slave       Slave to configure
 * @policy      Usage policy for the slave to configure
 * @perms       Permissions to use the slave (ORed IPI masks of permissible
 *              masters)
 * @return      XST_SUCCESS if configuration is set, XST_FAILURE otherwise
 *
 * @note        For each master whose IPI is encoded in the 'perms', the
 *              requirements structure is automatically allocated and added in
 *              master's/slave's lists of requirements.
 */
Set the configuration for the slave
@slave       Slave to configure
@policy      Usage policy for the slave to configure
@perms       Permissions to use the slave (ORed IPI masks of permissible
masters)
@return      XST_SUCCESS if configuration is set, XST_FAILURE otherwise

@note        For each master whose IPI is encoded in the 'perms', the
requirements structure is automatically allocated and added in
master's/slave's lists of requirements.
Set the configuration for the slave @slave Slave to configure @policy Usage policy for the slave to configure @perms Permissions to use the slave ( ORed IPI masks of permissible masters ) @return XST_SUCCESS if configuration is set XST_FAILURE otherwise @note For each master whose IPI is encoded in the ' perms ' the requirements structure is automatically allocated and added in master ' s / slave ' s lists of requirements .
s32 PmSlaveSetConfig(PmSlave* const slave, const u32 policy, const u32 perms)
{
	s32 status = XST_SUCCESS;
	u32 masterIpiMasks = perms;
	u32 caps = slave->slvFsm->states[slave->slvFsm->statesCnt - 1U];
	if (0U != (policy & PM_SLAVE_FLAG_IS_SHAREABLE)) {
		slave->flags |= PM_SLAVE_FLAG_IS_SHAREABLE;
	}
	while (0U != masterIpiMasks) {
		PmMaster* master = PmMasterGetNextFromIpiMask(&masterIpiMasks);
		PmRequirement* req;
		if (NULL == master) {
			status = XST_FAILURE;
			goto done;
		}
		req = PmRequirementAdd(master, slave);
		if (NULL == req) {
			status = XST_FAILURE;
			goto done;
		}
		req->currReq = (u8)caps;
	}
done:
	return status;
}
s32 PmSlaveSetConfig ( PmSlave * const slave , const u32 policy , const u32 perms ) { s32 status = XST_SUCCESS ; u32 masterIpiMasks = perms ; u32 caps = slave -> slvFsm -> states [ slave -> slvFsm -> statesCnt - 1U ] ; if ( 0U != ( policy & PM_SLAVE_FLAG_IS_SHAREABLE ) ) { slave -> flags |= PM_SLAVE_FLAG_IS_SHAREABLE ; } while ( 0U != masterIpiMasks ) { PmMaster * master = PmMasterGetNextFromIpiMask ( & masterIpiMasks ) ; PmRequirement * req ; if ( NULL == master ) { status = XST_FAILURE ; goto done ; } req = PmRequirementAdd ( master , slave ) ; if ( NULL == req ) { status = XST_FAILURE ; goto done ; } req -> currReq = ( u8 ) caps ; } done : return status ; }
PmSlaveSetConfig() - Set the configuration for the slave
 @slave       Slave to configure
 @policy      Usage policy for the slave to configure
 @perms       Permissions to use the slave (ORed IPI masks of permissible
              masters)
 @return      XST_SUCCESS if configuration is set, XST_FAILURE otherwise
PmSlaveSetConfig () - Set the configuration for the slave @slave Slave to configure @policy Usage policy for the slave to configure @perms Permissions to use the slave ( ORed IPI masks of permissible masters ) @return XST_SUCCESS if configuration is set XST_FAILURE otherwise
/* Extract and process one by one master from the encoded perms */