class PowerState

Defined at line 63 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

PowerState encapsulates the current power level, power domain, and energy model for an individual

processor.

Instances of PowerState are not safe for concurrent use and must be protected by an external lock

associated with the owning processor.

Public Methods

PowerDomainSet UpdatePowerDomainSet (PowerDomainSet power_domain_set, uint32_t cpu_num)

Exchanges the given power domain set with the current power domain set, returning the previous

value. From the new power domain set, updates the specific power domain and related energy

models associated with processor that owns this PowerState.

Defined at line 21 of file ../../zircon/kernel/lib/power-management/power-state.cc

std::optional<PowerLevelUpdateRequest> RequestTransition (uint32_t cpu_num, uint8_t active_power_level)

Posts a request to transition the power domain associated with this power state to a given

active power level from the current energy model.

Ignored when no domain is set. Asserts that the requested power level is an active power level.

`cpu_num` is the CPU associated with this power state.

`level` is the desired power level.

Defined at line 52 of file ../../zircon/kernel/lib/power-management/power-state.cc

void PowerState ()

Defined at line 65 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

bool is_enabled ()

Returns true if the power domain is set.

Defined at line 68 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

const PowerDomainSet & power_domain_set ()

Local copy of the full set of power domains in the system.

Defined at line 71 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

PowerDomain * domain ()

Domain the PowerState is being modeled after. Returns nullptr is there is

no power domain configured for processor owning this power state.

Defined at line 75 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

PowerLevelController * fast_path_controller ()

The PowerLevelController associated with this PowerState and processor, IFF

it supports fast path invocation from scheduler context.

Defined at line 79 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

std::optional<uint32_t> domain_id ()

Returns the id of the domain this power state belongs to.

Defined at line 82 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

zx::result<> UpdateActivePowerLevel (uint8_t active_power_level)

Updates the active power level of this power state. Typically called in response to the power

level controller completing a power level transition request.

Defined at line 88 of file ../../zircon/kernel/lib/power-management/power-state.cc

bool is_serving ()

Returns whether the domain's controller is serving requests. Returns false if there is no

domain.

Defined at line 91 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

std::optional<uint8_t> active_power_level ()

Returns the active power level when device is not idle.

Defined at line 94 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

std::optional<uint8_t> desired_active_power_level ()

Returns the active power level the device is in the processo of transitioning to.

Defined at line 97 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

std::optional<uint8_t> max_idle_power_level ()

Returns the maximum (i.e. highest power, lowest latency) idle power level.

Defined at line 102 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

uint64_t active_power_coefficient_nw ()

Returns the power coefficient of the current active power level. Returns zero if there is no

active power level or no domain is set.

Defined at line 111 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

uint64_t max_idle_power_coefficient_nw ()

Returns the power coefficient of the maximum idle power level. Returns zero if there is no

idle power level or no domain is set.

Defined at line 120 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

std::optional<ControlInterface> max_idle_power_level_interface ()

Returns the control interface of the maximum idle power level. Returns nullopt if there is no

idle power level or no domain is set.

Defined at line 129 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

bool IsValidActivePowerLevel (uint8_t power_level)

Returns true if the given power level is valid active power level.

Defined at line 137 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

ProcessingRate max_processing_rate ()

Returns the processing rate of the fastest power level in this domain.

Defined at line 146 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

ProcessingRate active_processing_rate ()

Returns the processing rate of the current active power level. Returns zero if there is no

active power level or no domain is set.

Defined at line 155 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

ProcessingRate preceding_active_processing_rate ()

Returns the processing rate of the preceding active power level (i.e. the

lower bound of the current active power level). Returns zero if there is no

preceding active power level, no active power level is set, or no domain

is set.

Defined at line 166 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

Utilization normalized_utilization ()

Returns the current utilization of the processor.

Defined at line 177 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

Utilization total_normalized_utilization ()

Returns the total normalized utilization of the domain this processor belongs to.

Defined at line 180 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h

Utilization UpdateUtilization (Utilization utilization_delta)

Update the utilization of this processor and the total utilization of its domain.

Defined at line 208 of file ../../zircon/kernel/lib/power-management/include/lib/power-management/power-state.h