|  | // 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.hardware.acpi; | 
|  | 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. | 
|  | protocol Acpi { | 
|  | /// Return the list of ACPI tables present in the system. | 
|  | 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. | 
|  | ReadNamedTable(resource struct { | 
|  | name AcpiTableSignature; | 
|  | instance uint32; | 
|  | result zx.handle:VMO; | 
|  | }) -> (struct { | 
|  | size uint32; | 
|  | }) error zx.status; | 
|  | }; |