Esempio n. 1
0
void PolicyServicesDomainCoreControl::setActiveCoreControl(UIntN participantIndex, UIntN domainIndex,
    const CoreControlStatus& coreControlStatus)
{
    throwIfNotWorkItemThread();
    getParticipantManager()->getParticipantPtr(participantIndex)->setActiveCoreControl(domainIndex,
        getPolicyIndex(), coreControlStatus);
}
Esempio n. 2
0
void PolicyServicesDomainActiveControl::setActiveControl(UIntN participantIndex, UIntN domainIndex,
    const Percentage& fanSpeed)
{
    throwIfNotWorkItemThread();
    getParticipantManager()->getParticipantPtr(participantIndex)->setActiveControl(domainIndex,
        getPolicyIndex(), fanSpeed);
}
ThermalRelationshipTable PolicyServicesPlatformConfigurationData::getThermalRelationshipTable(void)
{
    throwIfNotWorkItemThread();

    UInt32 dataLength = 0;
    DptfMemory binaryData;
    binaryData.allocate(Constants::DefaultBufferSize, true);

    try
    {
        getEsifServices()->primitiveExecuteGet(
            esif_primitive_type::GET_THERMAL_RELATIONSHIP_TABLE,
            ESIF_DATA_BINARY,
            binaryData,
            binaryData.getSize(),
            &dataLength);
    }
    catch (buffer_too_small e)
    {
        binaryData.deallocate();
        binaryData.allocate(e.getNeededBufferSize(), true);
        getEsifServices()->primitiveExecuteGet(
            esif_primitive_type::GET_THERMAL_RELATIONSHIP_TABLE,
            ESIF_DATA_BINARY,
            binaryData,
            binaryData.getSize(),
            &dataLength);
    }

    ThermalRelationshipTable trt(BinaryParse::passiveTrtObject(dataLength, binaryData));

    binaryData.deallocate();

    return trt;
}
Esempio n. 4
0
void ParticipantServices::primitiveExecuteSetAsTemperatureTenthK(esif_primitive_type primitive,
    Temperature temperature, UIntN domainIndex, UInt8 instance)
{
    throwIfNotWorkItemThread();
    m_esifServices->primitiveExecuteSetAsTemperatureTenthK(primitive, temperature,
        m_participantIndex, domainIndex, instance);
}
Temperature PolicyServicesDomainTemperature::getPowerShareTemperatureThreshold(
	UIntN participantIndex,
	UIntN domainIndex)
{
	throwIfNotWorkItemThread();
	return getParticipantManager()->getParticipantPtr(participantIndex)->getPowerShareTemperatureThreshold(domainIndex);
}
Esempio n. 6
0
void ParticipantServices::primitiveExecuteSetAsString(esif_primitive_type primitive, std::string stringValue, 
    UIntN domainIndex, UInt8 instance)  
{
    throwIfNotWorkItemThread();
    m_esifServices->primitiveExecuteSetAsString(primitive, stringValue,
        m_participantIndex, domainIndex, instance);
}
Esempio n. 7
0
void ParticipantServices::primitiveExecuteSetAsPower(esif_primitive_type primitive, Power power, UIntN domainIndex,
    UInt8 instance)
{
    throwIfNotWorkItemThread();
    m_esifServices->primitiveExecuteSetAsPower(primitive, power,
        m_participantIndex, domainIndex, instance);
}
void PolicyServicesDomainRfProfileControl::setRfProfileCenterFrequency(UIntN participantIndex, UIntN domainIndex,
    const Frequency& centerFrequency)
{
    throwIfNotWorkItemThread();
    getParticipantManager()->getParticipantPtr(participantIndex)->setRfProfileCenterFrequency(domainIndex,
        getPolicyIndex(), centerFrequency);
}
Esempio n. 9
0
void ParticipantServices::primitiveExecuteSet(esif_primitive_type primitive, esif_data_type esifDataType,
    void* bufferPtr, UInt32 bufferLength, UInt32 dataLength, UIntN domainIndex, UInt8 instance)
{
    throwIfNotWorkItemThread();
    m_esifServices->primitiveExecuteSet(primitive, esifDataType, bufferPtr, bufferLength, dataLength,
        m_participantIndex, domainIndex, instance);
}
Esempio n. 10
0
DptfBuffer ParticipantServices::primitiveExecuteGet(esif_primitive_type primitive, esif_data_type esifDataType,
    UIntN domainIndex, UInt8 instance)
{
    throwIfNotWorkItemThread();
    return m_esifServices->primitiveExecuteGet(primitive, esifDataType,
        m_participantIndex, domainIndex, instance);
}
UInt32 PolicyServicesPlatformConfigurationData::getLpmMode(void)
{
    throwIfNotWorkItemThread();

    return getEsifServices()->primitiveExecuteGetAsUInt32(
        esif_primitive_type::GET_CURRENT_LOW_POWER_MODE
        );
}
Esempio n. 12
0
UInt64 ParticipantServices::primitiveExecuteGetAsUInt64(
	esif_primitive_type primitive,
	UIntN domainIndex,
	UInt8 instance)
{
	throwIfNotWorkItemThread();
	return m_esifServices->primitiveExecuteGetAsUInt64(primitive, m_participantIndex, domainIndex, instance);
}
Esempio n. 13
0
void PolicyServicesMessageLogging::writeMessageDebug(const DptfMessage& message)
{
    throwIfNotWorkItemThread();

    ManagerMessage updatedMessage = ManagerMessage(getDptfManager(), message);
    updatedMessage.setPolicyIndex(getPolicyIndex());

    getEsifServices()->writeMessageDebug(updatedMessage);
}
Esempio n. 14
0
TimeSpan ParticipantServices::primitiveExecuteGetAsTimeInMilliseconds(
    esif_primitive_type primitive, 
    UIntN domainIndex /*= Constants::Esif::NoDomain*/, 
    UInt8 instance /*= Constants::Esif::NoInstance*/)
{
    throwIfNotWorkItemThread();
    return m_esifServices->primitiveExecuteGetAsTimeInMilliseconds(
        primitive, m_participantIndex, domainIndex, instance);
}
Esempio n. 15
0
void ParticipantServices::writeMessageDebug(const DptfMessage& message)
{
    throwIfNotWorkItemThread();

    ManagerMessage updatedMessage = ManagerMessage(m_dptfManager, message);
    updatedMessage.setParticipantIndex(m_participantIndex);

    m_esifServices->writeMessageDebug(updatedMessage);
}
Esempio n. 16
0
void ParticipantServices::setUserPreferredDisplayCacheValue(UIntN participantIndex, UIntN domainIndex, UIntN userPreferredIndex)
{
    throwIfNotWorkItemThread();

    auto participantScope = m_participant->getParticipantProperties().getAcpiInfo().getAcpiScope();
    auto domainType = m_participant->getDomainPropertiesSet().getDomainProperties(domainIndex).getDomainType();

    m_dptfManager->getUserPreferredCache()->setUserPreferredDisplayCacheValue(participantScope, domainType, userPreferredIndex);
}
Esempio n. 17
0
Bool ParticipantServices::isUserPreferredDisplayCacheValid(UIntN participantIndex, UIntN domainIndex)
{
    throwIfNotWorkItemThread();

    auto participantScope = m_participant->getParticipantProperties().getAcpiInfo().getAcpiScope();
    auto domainType = m_participant->getDomainPropertiesSet().getDomainProperties(domainIndex).getDomainType();

    return m_dptfManager->getUserPreferredCache()->isUserPreferredDisplayCacheValid(participantScope, domainType);
}
Esempio n. 18
0
void ParticipantServices::sendDptfEvent(ParticipantEvent::Type participantEvent, UIntN domainId, esif_data eventData)
{
	throwIfNotWorkItemThread();
	m_esifServices->sendDptfEvent(
		ParticipantEvent::ToFrameworkEvent(ParticipantEvent::DptfParticipantControlAction),
		m_participantIndex,
		domainId,
		eventData);
}
Esempio n. 19
0
void ParticipantServices::primitiveExecuteSetAsFrequency(
	esif_primitive_type primitive,
	Frequency frequency,
	UIntN domainIndex,
	UInt8 instance)
{
	throwIfNotWorkItemThread();
	m_esifServices->primitiveExecuteSetAsFrequency(primitive, frequency, m_participantIndex, domainIndex, instance);
}
Esempio n. 20
0
void ParticipantServices::primitiveExecuteSetAsPercentage(
	esif_primitive_type primitive,
	Percentage percentage,
	UIntN domainIndex,
	UInt8 instance)
{
	throwIfNotWorkItemThread();
	m_esifServices->primitiveExecuteSetAsPercentage(primitive, percentage, m_participantIndex, domainIndex, instance);
}
void PolicyServicesDomainTemperature::setVirtualTemperature(
	UIntN participantIndex,
	UIntN domainIndex,
	const Temperature& temperature)
{
	throwIfNotWorkItemThread();
	return getParticipantManager()
		->getParticipantPtr(participantIndex)
		->setVirtualTemperature(domainIndex, temperature);
}
void PolicyServicesPlatformPowerState::shutDown(const Temperature& currentTemperature,
        const Temperature& tripPointTemperature)
{
    throwIfNotWorkItemThread();

    esif_data_complex_shutdown shutdownData;
    shutdownData.temperature = currentTemperature;
    shutdownData.tripPointTemperature = tripPointTemperature;

    getEsifServices()->primitiveExecuteSet(SET_SYSTEM_SHUTDOWN, ESIF_DATA_STRUCTURE,
                                           &shutdownData, sizeof(esif_data_complex_shutdown), sizeof(esif_data_complex_shutdown));
}
LpmTable PolicyServicesPlatformConfigurationData::getLpmTable(void)
{
    throwIfNotWorkItemThread();

    UInt32 dataLength = 0;
    DptfMemory binaryData;
    binaryData.allocate(Constants::DefaultBufferSize, true);
    LpmTable lpmTable(LpmConfigurationVersion::vInvalid, vector<LpmEntry>());

    try
    {
        getEsifServices()->primitiveExecuteGet(
            esif_primitive_type::GET_LPM_TABLE,
            ESIF_DATA_BINARY,
            binaryData,
            binaryData.getSize(),
            &dataLength
            );

        lpmTable = BinaryParse::lpmTableObject(dataLength, binaryData);
    }
    catch (buffer_too_small e)
    {
        binaryData.deallocate();
        binaryData.allocate(e.getNeededBufferSize(), true);
        getEsifServices()->primitiveExecuteGet(
            esif_primitive_type::GET_LPM_TABLE,
            ESIF_DATA_BINARY,
            binaryData,
            binaryData.getSize(),
            &dataLength
            );

        lpmTable = BinaryParse::lpmTableObject(dataLength, binaryData);
    }
    catch (...)
    {
        // TODO: This is still under discussion so leaving the v0 part commented.

        // We assume version:v0 if we come here.
        //lpmTable = LpmTable(LpmConfigurationVersion::v0, vector<LpmEntry>());
        lpmTable = LpmTable(LpmConfigurationVersion::v1, vector<LpmEntry>());
    }

    binaryData.deallocate();
    return (lpmTable);
}
void PolicyServicesPlatformConfigurationData::clearPlatformSettings(
    PlatformSettingType::Type platformSettingType)  
{
    throwIfNotWorkItemThread();

    switch (platformSettingType)
    {
        case PlatformSettingType::ConfigTdp:
        {
            getEsifServices()->primitiveExecuteSet(esif_primitive_type::SET_SYSTEM_CONFIGTDP_CLEAR_LEVELS, 
                esif_data_type::ESIF_DATA_VOID, nullptr, 0, 0);
            break;
        }
        default:
        {
            throw dptf_exception("Invalid platform setting type referenced in call to clear platform settings.");
        }
    }
}
void PolicyServicesDomainTemperature::setTemperatureThresholds(UIntN participantIndex,
    UIntN domainIndex, const TemperatureThresholds& temperatureThresholds)
{
    throwIfNotWorkItemThread();

#ifdef ONLY_LOG_TEMPERATURE_THRESHOLDS
    // Added to help debug issue with missing temperature threshold events
    ManagerMessage message = ManagerMessage(getDptfManager(), FLF,
        "Policy is calling PolicyServicesDomainTemperature::setTemperatureThresholds().");
    message.addMessage("Aux0", temperatureThresholds.getAux0());
    message.addMessage("Aux1", temperatureThresholds.getAux1());
    message.setParticipantAndDomainIndex(participantIndex, domainIndex);
    message.setPolicyIndex(getPolicyIndex());
    getDptfManager()->getEsifServices()->writeMessageDebug(message, MessageCategory::TemperatureThresholds);
#endif

    getParticipantManager()->getParticipantPtr(participantIndex)->setTemperatureThresholds(
        domainIndex, getPolicyIndex(), temperatureThresholds);
}
void PolicyServicesPlatformConfigurationData::writePlatformSettingValue(
    PlatformSettingType::Type platformSettingType, UInt8 index, const std::string& stringValue)  
{
    throwIfNotWorkItemThread();

    switch (platformSettingType)
    {
        case PlatformSettingType::ConfigTdp:
        {
            getEsifServices()->primitiveExecuteSetAsString(esif_primitive_type::SET_SYSTEM_CONFIGTDP_LEVEL_NAME, 
                stringValue, Constants::Esif::NoParticipant, Constants::Esif::NoDomain, index);
            break;
        }
        default:
        {
            throw dptf_exception("Invalid platform setting type referenced in call to write platform setting value.");
        }
    }
}
Esempio n. 27
0
TimeSpan PolicyServicesDomainPlatformPowerStatus::getACPeakTimeWindow(UIntN participantIndex, UIntN domainIndex)
{
    throwIfNotWorkItemThread();
    auto participant = getParticipantManager()->getParticipantPtr(participantIndex);
    return participant->getACPeakTimeWindow(domainIndex);
}
Esempio n. 28
0
void ParticipantServices::unregisterEvent(ParticipantEvent::Type participantEvent)
{
    throwIfNotWorkItemThread();
    m_participant->unregisterEvent(participantEvent);
}
Esempio n. 29
0
Power PolicyServicesDomainPlatformPowerStatus::getPlatformBatterySteadyState(UIntN participantIndex, UIntN domainIndex)
{
    throwIfNotWorkItemThread();
    auto participant = getParticipantManager()->getParticipantPtr(participantIndex);
    return participant->getPlatformBatterySteadyState(domainIndex);
}
void PolicyServicesPlatformNotification::notifyPlatformPolicyReleaseControl()
{
    throwIfNotWorkItemThread();
    executeOsc(getPolicy()->getGuid(), OscActionReleaseControl);
}