Expand description
System power device contract (/devices/power, kind b'P').
The device performs hardware power actions only. It does not coordinate an OS shutdown: the lifecycle subsystem stops tasks and commits storage first, then calls this device as its final step. Hosts restrict the node to privileged users through VFS permissions.
| Number | Command | Direction | Input | Output | Effect |
|---|---|---|---|---|---|
0x00 | GET_CAPABILITIES | Read | () | u8 | Bit set of Capabilities. |
0x01 | POWER_OFF | Write | u8 | () | Halt or power off; input: exit status. |
0x02 | RESTART | Write | u8 | () | Reset or restart; input: exit status. |
0x03 | SLEEP | Write | () | () | Enter a low-power state it resumes from. |
The exit status is meaningful only to hosted targets (process exit code).
An unsupported action fails with Unsupported; a successful
action may never return. Payloads are plain bytes.
Structsยง
- Capabilities
- Bit set of power actions a target really performs.
- GET_
CAPABILITIES - POWER_
OFF - RESTART
- SLEEP