class IdlePowerThread
Defined at line 33 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
Platform Independent Per-CPU Idle/Power Thread
Manages the idle, suspend, and offline functions of a CPU. This thread is scheduled whenever
there is no eligible work in the run queues of a CPU or a power state management operation is
requested for the CPU. The idle/power thread provides the platform-independent run loop for
handling these functions and delegates to the platform-specific subsystems for the relevant
operations.
Public Methods
void IdlePowerThread ()
Defined at line 35 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
void ~IdlePowerThread ()
Defined at line 36 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
void IdlePowerThread (const IdlePowerThread & )
Defined at line 38 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
IdlePowerThread & operator= (const IdlePowerThread & )
Defined at line 39 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
void IdlePowerThread (IdlePowerThread && )
Defined at line 40 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
IdlePowerThread & operator= (IdlePowerThread && )
Defined at line 41 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
bool pending_power_work ()
Returns true if the power thread should be scheduled instead of eligible work because it needs
to perform a transition or power management function.
Defined at line 56 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
TransitionResult TransitionActiveToOffline (zx_instant_mono_t timeout_at)
Requests to transition from Active to Offline.
Returns:
- {ZX_OK, Active} if the transition was successful.
- {ZX_OK, Offline} if the current state was already Offline.
- {ZX_ERR_BAD_STATE, current state} if the current state was not Active or Offline.
- {ZX_ERR_TIMED_OUT, Active} if the current state was Active and transition timeout expired.
Defined at line 76 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
TransitionResult TransitionOfflineToActive (zx_instant_mono_t timeout_at)
Requests to transition from Offline to Active.
Returns:
- {ZX_OK, Offline} if the transition was successful.
- {ZX_OK, Active} if the current state was already Active.
- {ZX_ERR_BAD_STATE, current state} if the current state was not Active or Offline.
- {ZX_ERR_TIMED_OUT, Offline} if the current state was Offline and transition timeout
expired.
Defined at line 90 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
Thread & thread ()
Accessors to the underlying Thread instance.
Defined at line 115 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
const Thread & thread ()
Defined at line 116 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
bool system_suspended ()
Accessor to the global system suspend state.
Defined at line 119 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
uint64_t pending_wake_events ()
Defined at line 122 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
zx_instant_boot_t TransitionAllActiveToSuspend (zx_instant_boot_t resume_at)
Attempts to transition all active CPUs from Active to Suspend until the specified resume time.
CPUs that are Offline before suspend will remain Offline after resume until explicitly
transitioned to Active.
Returns: The boot-time at which the suspend operation is formally considered to have started.
This value can be used in conjunction with timestamps recorded in wake events to decide whether
a wake vector became signaled before suspend had formally started, or not.
Defined at line 321 of file ../../zircon/kernel/kernel/idle_power_thread.cc
int Run (void * arg)
Implements the run loop executed by the CPU's idle/power thread.
Defined at line 135 of file ../../zircon/kernel/kernel/idle_power_thread.cc
void InitHook (uint level)
Defined at line 566 of file ../../zircon/kernel/kernel/idle_power_thread.cc
void FlushAndHalt ()
Called by mp_unplug_current_cpu() to complete last steps of taking the CPU offline.
Defined at line 125 of file ../../zircon/kernel/kernel/idle_power_thread.cc
Enumerations
enum State
| Name | Value |
|---|---|
| Active | 0 |
| Wakeup | 1 |
| Offline | 2 |
| Suspend | 3 |
The current or target high-level operational state of the CPU. The depth and type of
idle/suspend states depends inputs from other subsystems, such as timer and run queues and
system power targets.
TODO(https://fxbug.dev/42086705): Rationalize this state with mp active / online states.
Defined at line 47 of file ../../zircon/kernel/include/kernel/idle_power_thread.h
Records
Friends
class WakeEvent
class Scheduler
class percpu