xref: /titanic_51/usr/src/uts/intel/sys/acpi/actables.h (revision 385cc6b4ad1792caef3f84eb61eed3f27085801f)
17c478bd9Sstevel@tonic-gate /******************************************************************************
27c478bd9Sstevel@tonic-gate  *
37c478bd9Sstevel@tonic-gate  * Name: actables.h - ACPI table management
47c478bd9Sstevel@tonic-gate  *
57c478bd9Sstevel@tonic-gate  *****************************************************************************/
67c478bd9Sstevel@tonic-gate 
726f3cdf0SGordon Ross /*
8*385cc6b4SJerry Jelinek  * Copyright (C) 2000 - 2016, Intel Corp.
97c478bd9Sstevel@tonic-gate  * All rights reserved.
107c478bd9Sstevel@tonic-gate  *
1126f3cdf0SGordon Ross  * Redistribution and use in source and binary forms, with or without
1226f3cdf0SGordon Ross  * modification, are permitted provided that the following conditions
1326f3cdf0SGordon Ross  * are met:
1426f3cdf0SGordon Ross  * 1. Redistributions of source code must retain the above copyright
1526f3cdf0SGordon Ross  *    notice, this list of conditions, and the following disclaimer,
1626f3cdf0SGordon Ross  *    without modification.
1726f3cdf0SGordon Ross  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
1826f3cdf0SGordon Ross  *    substantially similar to the "NO WARRANTY" disclaimer below
1926f3cdf0SGordon Ross  *    ("Disclaimer") and any redistribution must be conditioned upon
2026f3cdf0SGordon Ross  *    including a substantially similar Disclaimer requirement for further
2126f3cdf0SGordon Ross  *    binary redistribution.
2226f3cdf0SGordon Ross  * 3. Neither the names of the above-listed copyright holders nor the names
2326f3cdf0SGordon Ross  *    of any contributors may be used to endorse or promote products derived
2426f3cdf0SGordon Ross  *    from this software without specific prior written permission.
257c478bd9Sstevel@tonic-gate  *
2626f3cdf0SGordon Ross  * Alternatively, this software may be distributed under the terms of the
2726f3cdf0SGordon Ross  * GNU General Public License ("GPL") version 2 as published by the Free
2826f3cdf0SGordon Ross  * Software Foundation.
297c478bd9Sstevel@tonic-gate  *
3026f3cdf0SGordon Ross  * NO WARRANTY
3126f3cdf0SGordon Ross  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3226f3cdf0SGordon Ross  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3326f3cdf0SGordon Ross  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
3426f3cdf0SGordon Ross  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3526f3cdf0SGordon Ross  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3626f3cdf0SGordon Ross  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3726f3cdf0SGordon Ross  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3826f3cdf0SGordon Ross  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
3926f3cdf0SGordon Ross  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
4026f3cdf0SGordon Ross  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4126f3cdf0SGordon Ross  * POSSIBILITY OF SUCH DAMAGES.
4226f3cdf0SGordon Ross  */
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate #ifndef __ACTABLES_H__
457c478bd9Sstevel@tonic-gate #define __ACTABLES_H__
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate 
48db2bae30SDana Myers ACPI_STATUS
49db2bae30SDana Myers AcpiAllocateRootTable (
50db2bae30SDana Myers     UINT32                  InitialTableCount);
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate /*
53*385cc6b4SJerry Jelinek  * tbxfroot - Root pointer utilities
54*385cc6b4SJerry Jelinek  */
55*385cc6b4SJerry Jelinek UINT32
56*385cc6b4SJerry Jelinek AcpiTbGetRsdpLength (
57*385cc6b4SJerry Jelinek     ACPI_TABLE_RSDP         *Rsdp);
58*385cc6b4SJerry Jelinek 
59*385cc6b4SJerry Jelinek ACPI_STATUS
60*385cc6b4SJerry Jelinek AcpiTbValidateRsdp (
61*385cc6b4SJerry Jelinek     ACPI_TABLE_RSDP         *Rsdp);
62*385cc6b4SJerry Jelinek 
63*385cc6b4SJerry Jelinek UINT8 *
64*385cc6b4SJerry Jelinek AcpiTbScanMemoryForRsdp (
65*385cc6b4SJerry Jelinek     UINT8                   *StartAddress,
66*385cc6b4SJerry Jelinek     UINT32                  Length);
67*385cc6b4SJerry Jelinek 
68*385cc6b4SJerry Jelinek 
69*385cc6b4SJerry Jelinek /*
70*385cc6b4SJerry Jelinek  * tbdata - table data structure management
71*385cc6b4SJerry Jelinek  */
72*385cc6b4SJerry Jelinek ACPI_STATUS
73*385cc6b4SJerry Jelinek AcpiTbGetNextTableDescriptor (
74*385cc6b4SJerry Jelinek     UINT32                  *TableIndex,
75*385cc6b4SJerry Jelinek     ACPI_TABLE_DESC         **TableDesc);
76*385cc6b4SJerry Jelinek 
77*385cc6b4SJerry Jelinek void
78*385cc6b4SJerry Jelinek AcpiTbInitTableDescriptor (
79*385cc6b4SJerry Jelinek     ACPI_TABLE_DESC         *TableDesc,
80*385cc6b4SJerry Jelinek     ACPI_PHYSICAL_ADDRESS   Address,
81*385cc6b4SJerry Jelinek     UINT8                   Flags,
82*385cc6b4SJerry Jelinek     ACPI_TABLE_HEADER       *Table);
83*385cc6b4SJerry Jelinek 
84*385cc6b4SJerry Jelinek ACPI_STATUS
85*385cc6b4SJerry Jelinek AcpiTbAcquireTempTable (
86*385cc6b4SJerry Jelinek     ACPI_TABLE_DESC         *TableDesc,
87*385cc6b4SJerry Jelinek     ACPI_PHYSICAL_ADDRESS   Address,
88*385cc6b4SJerry Jelinek     UINT8                   Flags);
89*385cc6b4SJerry Jelinek 
90*385cc6b4SJerry Jelinek void
91*385cc6b4SJerry Jelinek AcpiTbReleaseTempTable (
92*385cc6b4SJerry Jelinek     ACPI_TABLE_DESC         *TableDesc);
93*385cc6b4SJerry Jelinek 
94*385cc6b4SJerry Jelinek ACPI_STATUS
95*385cc6b4SJerry Jelinek AcpiTbValidateTempTable (
96*385cc6b4SJerry Jelinek     ACPI_TABLE_DESC         *TableDesc);
97*385cc6b4SJerry Jelinek 
98*385cc6b4SJerry Jelinek ACPI_STATUS
99*385cc6b4SJerry Jelinek AcpiTbVerifyTempTable (
100*385cc6b4SJerry Jelinek     ACPI_TABLE_DESC         *TableDesc,
101*385cc6b4SJerry Jelinek     char                    *Signature);
102*385cc6b4SJerry Jelinek 
103*385cc6b4SJerry Jelinek BOOLEAN
104*385cc6b4SJerry Jelinek AcpiTbIsTableLoaded (
105*385cc6b4SJerry Jelinek     UINT32                  TableIndex);
106*385cc6b4SJerry Jelinek 
107*385cc6b4SJerry Jelinek void
108*385cc6b4SJerry Jelinek AcpiTbSetTableLoadedFlag (
109*385cc6b4SJerry Jelinek     UINT32                  TableIndex,
110*385cc6b4SJerry Jelinek     BOOLEAN                 IsLoaded);
111*385cc6b4SJerry Jelinek 
112*385cc6b4SJerry Jelinek 
113*385cc6b4SJerry Jelinek /*
114db2bae30SDana Myers  * tbfadt - FADT parse/convert/validate
1157c478bd9Sstevel@tonic-gate  */
1167c478bd9Sstevel@tonic-gate void
117db2bae30SDana Myers AcpiTbParseFadt (
118*385cc6b4SJerry Jelinek     void);
1197c478bd9Sstevel@tonic-gate 
1207c478bd9Sstevel@tonic-gate void
121db2bae30SDana Myers AcpiTbCreateLocalFadt (
122db2bae30SDana Myers     ACPI_TABLE_HEADER       *Table,
123db2bae30SDana Myers     UINT32                  Length);
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate /*
127db2bae30SDana Myers  * tbfind - find ACPI table
1287c478bd9Sstevel@tonic-gate  */
1297c478bd9Sstevel@tonic-gate ACPI_STATUS
1307c478bd9Sstevel@tonic-gate AcpiTbFindTable (
1317c478bd9Sstevel@tonic-gate     char                    *Signature,
1327c478bd9Sstevel@tonic-gate     char                    *OemId,
1337c478bd9Sstevel@tonic-gate     char                    *OemTableId,
134db2bae30SDana Myers     UINT32                  *TableIndex);
135450d6964Smyers 
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate /*
138db2bae30SDana Myers  * tbinstal - Table removal and deletion
1397c478bd9Sstevel@tonic-gate  */
1407c478bd9Sstevel@tonic-gate ACPI_STATUS
141db2bae30SDana Myers AcpiTbResizeRootTableList (
142db2bae30SDana Myers     void);
143186507a7Smyers 
144186507a7Smyers ACPI_STATUS
145*385cc6b4SJerry Jelinek AcpiTbValidateTable (
146db2bae30SDana Myers     ACPI_TABLE_DESC         *TableDesc);
1477c478bd9Sstevel@tonic-gate 
148*385cc6b4SJerry Jelinek void
149*385cc6b4SJerry Jelinek AcpiTbInvalidateTable (
150*385cc6b4SJerry Jelinek     ACPI_TABLE_DESC         *TableDesc);
151*385cc6b4SJerry Jelinek 
152*385cc6b4SJerry Jelinek void
153*385cc6b4SJerry Jelinek AcpiTbOverrideTable (
154*385cc6b4SJerry Jelinek     ACPI_TABLE_DESC         *OldTableDesc);
1557c478bd9Sstevel@tonic-gate 
156db2bae30SDana Myers ACPI_STATUS
157*385cc6b4SJerry Jelinek AcpiTbAcquireTable (
158*385cc6b4SJerry Jelinek     ACPI_TABLE_DESC         *TableDesc,
159*385cc6b4SJerry Jelinek     ACPI_TABLE_HEADER       **TablePtr,
160*385cc6b4SJerry Jelinek     UINT32                  *TableLength,
161*385cc6b4SJerry Jelinek     UINT8                   *TableFlags);
162*385cc6b4SJerry Jelinek 
163*385cc6b4SJerry Jelinek void
164*385cc6b4SJerry Jelinek AcpiTbReleaseTable (
165db2bae30SDana Myers     ACPI_TABLE_HEADER       *Table,
166*385cc6b4SJerry Jelinek     UINT32                  TableLength,
167*385cc6b4SJerry Jelinek     UINT8                   TableFlags);
168*385cc6b4SJerry Jelinek 
169*385cc6b4SJerry Jelinek ACPI_STATUS
170*385cc6b4SJerry Jelinek AcpiTbInstallStandardTable (
171*385cc6b4SJerry Jelinek     ACPI_PHYSICAL_ADDRESS   Address,
172db2bae30SDana Myers     UINT8                   Flags,
173*385cc6b4SJerry Jelinek     BOOLEAN                 Reload,
174*385cc6b4SJerry Jelinek     BOOLEAN                 Override,
175db2bae30SDana Myers     UINT32                  *TableIndex);
17627f7c583Smyers 
17727f7c583Smyers void
178*385cc6b4SJerry Jelinek AcpiTbUninstallTable (
179db2bae30SDana Myers     ACPI_TABLE_DESC        *TableDesc);
180db2bae30SDana Myers 
181db2bae30SDana Myers void
182db2bae30SDana Myers AcpiTbTerminate (
183db2bae30SDana Myers     void);
184db2bae30SDana Myers 
185aa2aa9a6SDana Myers ACPI_STATUS
186db2bae30SDana Myers AcpiTbDeleteNamespaceByOwner (
187db2bae30SDana Myers     UINT32                  TableIndex);
18827f7c583Smyers 
1897c478bd9Sstevel@tonic-gate ACPI_STATUS
190db2bae30SDana Myers AcpiTbAllocateOwnerId (
191db2bae30SDana Myers     UINT32                  TableIndex);
192db2bae30SDana Myers 
193db2bae30SDana Myers ACPI_STATUS
194db2bae30SDana Myers AcpiTbReleaseOwnerId (
195db2bae30SDana Myers     UINT32                  TableIndex);
196db2bae30SDana Myers 
197db2bae30SDana Myers ACPI_STATUS
198db2bae30SDana Myers AcpiTbGetOwnerId (
199db2bae30SDana Myers     UINT32                  TableIndex,
200db2bae30SDana Myers     ACPI_OWNER_ID           *OwnerId);
201db2bae30SDana Myers 
202db2bae30SDana Myers 
203db2bae30SDana Myers /*
204db2bae30SDana Myers  * tbutils - table manager utilities
205db2bae30SDana Myers  */
206aa2aa9a6SDana Myers ACPI_STATUS
207aa2aa9a6SDana Myers AcpiTbInitializeFacs (
208aa2aa9a6SDana Myers     void);
209aa2aa9a6SDana Myers 
210db2bae30SDana Myers void
211db2bae30SDana Myers AcpiTbPrintTableHeader(
212db2bae30SDana Myers     ACPI_PHYSICAL_ADDRESS   Address,
213db2bae30SDana Myers     ACPI_TABLE_HEADER       *Header);
214db2bae30SDana Myers 
215db2bae30SDana Myers UINT8
216db2bae30SDana Myers AcpiTbChecksum (
217db2bae30SDana Myers     UINT8                   *Buffer,
218db2bae30SDana Myers     UINT32                  Length);
219db2bae30SDana Myers 
220db2bae30SDana Myers ACPI_STATUS
221db2bae30SDana Myers AcpiTbVerifyChecksum (
222db2bae30SDana Myers     ACPI_TABLE_HEADER       *Table,
223db2bae30SDana Myers     UINT32                  Length);
224db2bae30SDana Myers 
225db2bae30SDana Myers void
22626f3cdf0SGordon Ross AcpiTbCheckDsdtHeader (
22726f3cdf0SGordon Ross     void);
22826f3cdf0SGordon Ross 
22926f3cdf0SGordon Ross ACPI_TABLE_HEADER *
23026f3cdf0SGordon Ross AcpiTbCopyDsdt (
23126f3cdf0SGordon Ross     UINT32                  TableIndex);
23226f3cdf0SGordon Ross 
23326f3cdf0SGordon Ross void
234*385cc6b4SJerry Jelinek AcpiTbInstallTableWithOverride (
235*385cc6b4SJerry Jelinek     ACPI_TABLE_DESC         *NewTableDesc,
236*385cc6b4SJerry Jelinek     BOOLEAN                 Override,
237*385cc6b4SJerry Jelinek     UINT32                  *TableIndex);
238*385cc6b4SJerry Jelinek 
239*385cc6b4SJerry Jelinek ACPI_STATUS
240*385cc6b4SJerry Jelinek AcpiTbInstallFixedTable (
241db2bae30SDana Myers     ACPI_PHYSICAL_ADDRESS   Address,
242db2bae30SDana Myers     char                    *Signature,
243*385cc6b4SJerry Jelinek     UINT32                  *TableIndex);
244db2bae30SDana Myers 
245db2bae30SDana Myers ACPI_STATUS
246db2bae30SDana Myers AcpiTbParseRootTable (
247aa2aa9a6SDana Myers     ACPI_PHYSICAL_ADDRESS   RsdpAddress);
2487c478bd9Sstevel@tonic-gate 
249*385cc6b4SJerry Jelinek 
250*385cc6b4SJerry Jelinek /*
251*385cc6b4SJerry Jelinek  * tbxfload
252*385cc6b4SJerry Jelinek  */
253*385cc6b4SJerry Jelinek ACPI_STATUS
254*385cc6b4SJerry Jelinek AcpiTbLoadNamespace (
255*385cc6b4SJerry Jelinek     void);
256*385cc6b4SJerry Jelinek 
2577c478bd9Sstevel@tonic-gate #endif /* __ACTABLES_H__ */
258