pub enum AdminRequest {
PowerFullyOn {
responder: AdminPowerFullyOnResponder,
},
Reboot {
reason: RebootReason,
responder: AdminRebootResponder,
},
RebootToBootloader {
responder: AdminRebootToBootloaderResponder,
},
RebootToRecovery {
responder: AdminRebootToRecoveryResponder,
},
Poweroff {
responder: AdminPoweroffResponder,
},
Mexec {
kernel_zbi: Vmo,
data_zbi: Vmo,
responder: AdminMexecResponder,
},
SuspendToRam {
responder: AdminSuspendToRamResponder,
},
}
Expand description
Provides methods to request that the system be transitioned into a supported power state.
Note (see https://fxbug.dev/42136295):
These methods do not return until after the state transition has been completed. In most cases
(e.g. Reboot), a successful transition means that the caller does not actually observe the
completion because the system will be rebooted before the call is completed. The implication is
that using a synchronous FIDL client with these methods will result in a blocked thread for the
duration of the call, or even for the remainder of the component’s life (in the case of Reboot).
Therefore, if a synchronous FIDL client is to be used with this protocol then care should be
taken to avoid handling any shutdown-induced callbacks on the same thread that was used to
initiate the transition. Example callbacks include [fuchsia.process.lifecycle/Lifecycle.Stop
]
and [fuchsia.hardware.power.statecontrol/RebootMethodsWatcher.OnReboot
].
Alternatively, the caller could choose to use an asynchronous FIDL client with this protocol to
avoid blocking their calling thread.
Variants§
PowerFullyOn
Asks the device to enter a fully on state.
Fields
responder: AdminPowerFullyOnResponder
Reboot
Asks the device to reboot.
RebootToBootloader
Asks the device to reboot into the bootloader.
Fields
responder: AdminRebootToBootloaderResponder
RebootToRecovery
Asks the device to reboot into the recovery partition.
Fields
responder: AdminRebootToRecoveryResponder
Poweroff
Asks all devices to enter a powered off state.
Fields
responder: AdminPoweroffResponder
Mexec
Performs a kernel mexec.
It is expected that the ZBI items specified by
zx_system_mexec_payload_get()
have not yet been appended to the
provided data ZBI.
SuspendToRam
Asks the device to enter the suspend to RAM (S3) power state. Currently only supported on x64. If a system state transition is already in progress then ZX_ERR_ALREADY_EXISTS is returned. If the device fails to reach the suspend power state then ZX_ERR_INTERNAL is returned. If the device successfully suspends, ZX_OK is returned when the device resumes.
Fields
responder: AdminSuspendToRamResponder
Implementations§
Source§impl AdminRequest
impl AdminRequest
pub fn into_power_fully_on(self) -> Option<AdminPowerFullyOnResponder>
pub fn into_reboot(self) -> Option<(RebootReason, AdminRebootResponder)>
pub fn into_reboot_to_bootloader( self, ) -> Option<AdminRebootToBootloaderResponder>
pub fn into_reboot_to_recovery(self) -> Option<AdminRebootToRecoveryResponder>
pub fn into_poweroff(self) -> Option<AdminPoweroffResponder>
pub fn into_mexec(self) -> Option<(Vmo, Vmo, AdminMexecResponder)>
pub fn into_suspend_to_ram(self) -> Option<AdminSuspendToRamResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL