blob: cd04b7dedd79bd1424b1ec70053a024d0100eed1 [file] [log] [blame]
// Copyright 2018 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.
library fuchsia.hardware.acpi;
using zx;
resource struct AcpiMmio {
/// Offset from beginning of VMO where the mmio region begins.
zx.off offset;
/// Size of mmio region.
uint64 size;
zx.handle:VMO vmo;
};
[BanjoLayout = "ddk-protocol"]
protocol Acpi {
GetPio(uint32 index) -> (zx.status s, zx.handle:RESOURCE pio);
GetMmio(uint32 index) -> (zx.status s, AcpiMmio mmio);
MapInterrupt(int64 index) -> (zx.status s, zx.handle:INTERRUPT handle);
GetBti(uint32 bdf, uint32 index) -> (zx.status s, zx.handle:BTI bti);
ConnectSysmem(zx.handle:CHANNEL connection) -> (zx.status s);
RegisterSysmemHeap(uint64 heap, zx.handle:CHANNEL connection) -> (zx.status s);
};
/// A generic ACPI device. This will allow devices to query information directly
/// from ACPI, removing the need for them to be implemented directly in the
/// board driver.
[BanjoLayout = "ddk-protocol"]
protocol AcpiDevice {
/// For now, this has a single stub method, since banjo protocols require
/// at least one method, but we will add methods as the requirements become
/// clearer.
Stub() -> ();
};