Summary
TODO(https://fxbug.dev/42108078)
Declaration
#include <zircon/syscalls.h>
zx_status_t zx_system_powerctl(zx_handle_t resource, uint32_t cmd);
Description
zx_system_powerctl changes the power state of the system based on the value of
cmd. Zircon may not be able to put the system in a given power state,
depending on its level of support for the architecture being used.
COMMANDS
ZX_SYSTEM_POWERCTL_REBOOT
Restart the system, control should go through any relevant firmware and bootloaders.
ZX_SYSTEM_POWERCTL_REBOOT_BOOTLOADER
Restart the system, but stop in the bootloader instead of loading the operating system.
ZX_SYSTEM_POWERCTL_REBOOT_RECOVERY
Restart the system, but load the recovery operating system instead of the primary OS.
ZX_SYSTEM_POWERCTL_SHUTDOWN
Turn the system off.
ZX_SYSTEM_POWERCTL_ACK_KERNEL_INITIATED_REBOOT
Used by userspace when it is ready for a reboot in response to a previous signal from the kernel that the kernel wanted to reboot the system.
Returns ZX_ERR_BAD_STATE if the kernel has not previously signaled a desire
to reboot.
Rights
resource must have resource kind ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_POWER_BASE.
Return value
ZX_OK
Errors
Returns ZX_ERR_INVALID_ARGS when an unrecognized cmd value is supplied.
See also
TODO(https://fxbug.dev/42108078)