blob: 26e375b99c0a85c82e70b873a2edba1d21a0f099 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This API is deprecated. Use https://cs.corp.google.com/fuchsia/fuchsia-mirror/sdk/fidl/fuchsia.hardware.power.statecontrol/admin.fidl
// instead.Bug:fxbug.dev/42257
library fuchsia.device.manager;
using zx;
/// All available suspend flags
const uint32 SUSPEND_FLAG_REBOOT = 0xdcdc0100;
const uint32 SUSPEND_FLAG_REBOOT_BOOTLOADER = 0xdcdc0101;
const uint32 SUSPEND_FLAG_REBOOT_RECOVERY = 0xdcdc0102;
const uint32 SUSPEND_FLAG_POWEROFF = 0xdcdc0200;
const uint32 SUSPEND_FLAG_MEXEC = 0xdcdc0300;
const uint32 SUSPEND_FLAG_SUSPEND_RAM = 0xdcdc0400;
/// Provides administration services for the device manager service and the device tree it controls.
[Discoverable, ForDeprecatedCBindings]
protocol Administrator {
/// Ask all devices to enter the suspend state indicated by `flags`. Flags should be some
/// combination of `DEVICE_SUSPEND_FLAG_*` from the DDK.
Suspend(uint32 flags) -> (zx.status status);
// TODO(fxbug.dev/68529): Remove this API.
/// This is a temporary API until DriverManager can ensure that base drivers
/// will be shut down automatically before fshost exits. This will happen
/// once drivers-as-components is implemented.
/// In the meantime, this API should only be called by fshost, and it must
/// be called before fshost exits. This function iterates over the devices
/// and suspends any device whose driver lives in storage. This API must be
/// called by fshost before it shuts down. Otherwise the devices that live
/// in storage may page fault as it access memory that should be provided by
/// the exited fshost. This function will not return until the devices are
/// suspended. If there are no devices that live in storage, this function
/// will immediatetly return.
UnregisterSystemStorageForShutdown() -> (zx.status status);
};