blob: d97e8547ea179d871a0c60b48b0cfa2c8ebff5ba [file] [log] [blame]
// Copyright 2020 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.acpi.tables;
using zx;
const MAX_ACPI_TABLE_ENTRIES uint32 = 512;
/// An ACPI table name signature. This consists of four ASCII characters.
alias AcpiTableSignature = array<uint8, 4>;
/// Metadata about an ACPI table entry.
type TableInfo = struct {
/// Name of the table. There may be multiple tables with the same name.
name AcpiTableSignature;
/// The size of the table, in bytes.
size uint32;
};
/// Defines access to raw system ACPI data.
///
/// This interface is intended only for low-level debugging tools.
closed protocol Tables {
/// Return the list of ACPI tables present in the system.
strict ListTableEntries() -> (struct {
entries vector<TableInfo>:MAX_ACPI_TABLE_ENTRIES;
}) error zx.Status;
/// Write the raw content of the named ACPI table into the given VMO.
///
/// Some systems may have multiple ACPI tables with the same name ("SSDT" is
/// a commonly repeated table, for example). |instance| is used to specify
/// which instance of the named table to return. A value of |n| returns the
/// |n|'th occurence. If only one table with the given name is present,
/// |instance| should be 0.
///
/// On success, returns the number of bytes written into result.
strict ReadNamedTable(resource struct {
name AcpiTableSignature;
instance uint32;
result zx.Handle:VMO;
}) -> (struct {
size uint32;
}) error zx.Status;
};