TODO(https://fxbug.dev/42108078)
#include <zircon/syscalls.h> zx_status_t zx_system_powerctl(zx_handle_t resource, uint32_t cmd, const zx_system_powerctl_arg_t* arg);
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.
arg is an optional pointer to a struct which provides further information about the command to be executed.
Sets all processor cores as active.
arg type: n/a
Set only the primary CPU as active.
arg type: n/a
Only defined for x86-64, but is no longer supported.
Returns ZX_ERR_NOT_SUPPORTED.
Only defined for x86-64.
Set CPU to power level 1.
arg type: zx_system_powerctl_arg_t with only the x86_power_limit union element considered valid.
struct { uint32_t power_limit; // PL1 value in milliwatts uint32_t time_window; // PL1 time window in microseconds uint8_t clamp; // PL1 clamping enable uint8_t enable; // PL1 enable uint8_t padding2[2]; } x86_power_limit;
Restart the system, control should go through any relevant firmware and bootloaders.
arg type: n/a
Restart the system, but stop in the bootloader instead of loading the operating system.
arg type: n/a
Restart the system, but load the recovery operating system instead of the primary OS.
arg type: n/a
Turn the system off.
arg type: n/a
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.
arg type: n/a
Returns ZX_ERR_BAD_STATE if the kernel has not previously signaled a desire to reboot.
resource must have resource kind ZX_RSRC_KIND_SYSTEM with base ZX_RSRC_SYSTEM_POWER_BASE.
ZX_OK
Returns ZX_ERR_INVALID_ARGS when an unrecognized cmd value is supplied.