1 /******************************************************************************
2  *
3  * Name: actables.h - ACPI table management
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2014, Intel Corp.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43 
44 #ifndef __ACTABLES_H__
45 #define __ACTABLES_H__
46 
47 
48 ACPI_STATUS
49 AcpiAllocateRootTable (
50     UINT32                  InitialTableCount);
51 
52 /*
53  * tbxfroot - Root pointer utilities
54  */
55 UINT32
56 AcpiTbGetRsdpLength (
57     ACPI_TABLE_RSDP         *Rsdp);
58 
59 ACPI_STATUS
60 AcpiTbValidateRsdp (
61     ACPI_TABLE_RSDP         *Rsdp);
62 
63 UINT8 *
64 AcpiTbScanMemoryForRsdp (
65     UINT8                   *StartAddress,
66     UINT32                  Length);
67 
68 
69 /*
70  * tbdata - table data structure management
71  */
72 ACPI_STATUS
73 AcpiTbGetNextRootIndex (
74     UINT32                  *TableIndex);
75 
76 void
77 AcpiTbInitTableDescriptor (
78     ACPI_TABLE_DESC         *TableDesc,
79     ACPI_PHYSICAL_ADDRESS   Address,
80     UINT8                   Flags,
81     ACPI_TABLE_HEADER       *Table);
82 
83 ACPI_STATUS
84 AcpiTbAcquireTempTable (
85     ACPI_TABLE_DESC         *TableDesc,
86     ACPI_PHYSICAL_ADDRESS   Address,
87     UINT8                   Flags);
88 
89 void
90 AcpiTbReleaseTempTable (
91     ACPI_TABLE_DESC         *TableDesc);
92 
93 ACPI_STATUS
94 AcpiTbValidateTempTable (
95     ACPI_TABLE_DESC         *TableDesc);
96 
97 ACPI_STATUS
98 AcpiTbVerifyTempTable (
99     ACPI_TABLE_DESC         *TableDesc,
100     char                    *Signature);
101 
102 BOOLEAN
103 AcpiTbIsTableLoaded (
104     UINT32                  TableIndex);
105 
106 void
107 AcpiTbSetTableLoadedFlag (
108     UINT32                  TableIndex,
109     BOOLEAN                 IsLoaded);
110 
111 
112 /*
113  * tbfadt - FADT parse/convert/validate
114  */
115 void
116 AcpiTbParseFadt (
117     UINT32                  TableIndex);
118 
119 void
120 AcpiTbCreateLocalFadt (
121     ACPI_TABLE_HEADER       *Table,
122     UINT32                  Length);
123 
124 
125 /*
126  * tbfind - find ACPI table
127  */
128 ACPI_STATUS
129 AcpiTbFindTable (
130     char                    *Signature,
131     char                    *OemId,
132     char                    *OemTableId,
133     UINT32                  *TableIndex);
134 
135 
136 /*
137  * tbinstal - Table removal and deletion
138  */
139 ACPI_STATUS
140 AcpiTbResizeRootTableList (
141     void);
142 
143 ACPI_STATUS
144 AcpiTbValidateTable (
145     ACPI_TABLE_DESC         *TableDesc);
146 
147 void
148 AcpiTbInvalidateTable (
149     ACPI_TABLE_DESC         *TableDesc);
150 
151 void
152 AcpiTbOverrideTable (
153     ACPI_TABLE_DESC         *OldTableDesc);
154 
155 ACPI_STATUS
156 AcpiTbAcquireTable (
157     ACPI_TABLE_DESC         *TableDesc,
158     ACPI_TABLE_HEADER       **TablePtr,
159     UINT32                  *TableLength,
160     UINT8                   *TableFlags);
161 
162 void
163 AcpiTbReleaseTable (
164     ACPI_TABLE_HEADER       *Table,
165     UINT32                  TableLength,
166     UINT8                   TableFlags);
167 
168 ACPI_STATUS
169 AcpiTbInstallStandardTable (
170     ACPI_PHYSICAL_ADDRESS   Address,
171     UINT8                   Flags,
172     BOOLEAN                 Reload,
173     BOOLEAN                 Override,
174     UINT32                  *TableIndex);
175 
176 ACPI_STATUS
177 AcpiTbStoreTable (
178     ACPI_PHYSICAL_ADDRESS   Address,
179     ACPI_TABLE_HEADER       *Table,
180     UINT32                  Length,
181     UINT8                   Flags,
182     UINT32                  *TableIndex);
183 
184 void
185 AcpiTbUninstallTable (
186     ACPI_TABLE_DESC        *TableDesc);
187 
188 void
189 AcpiTbTerminate (
190     void);
191 
192 ACPI_STATUS
193 AcpiTbDeleteNamespaceByOwner (
194     UINT32                  TableIndex);
195 
196 ACPI_STATUS
197 AcpiTbAllocateOwnerId (
198     UINT32                  TableIndex);
199 
200 ACPI_STATUS
201 AcpiTbReleaseOwnerId (
202     UINT32                  TableIndex);
203 
204 ACPI_STATUS
205 AcpiTbGetOwnerId (
206     UINT32                  TableIndex,
207     ACPI_OWNER_ID           *OwnerId);
208 
209 
210 /*
211  * tbutils - table manager utilities
212  */
213 ACPI_STATUS
214 AcpiTbInitializeFacs (
215     void);
216 
217 BOOLEAN
218 AcpiTbTablesLoaded (
219     void);
220 
221 void
222 AcpiTbPrintTableHeader(
223     ACPI_PHYSICAL_ADDRESS   Address,
224     ACPI_TABLE_HEADER       *Header);
225 
226 UINT8
227 AcpiTbChecksum (
228     UINT8                   *Buffer,
229     UINT32                  Length);
230 
231 ACPI_STATUS
232 AcpiTbVerifyChecksum (
233     ACPI_TABLE_HEADER       *Table,
234     UINT32                  Length);
235 
236 void
237 AcpiTbCheckDsdtHeader (
238     void);
239 
240 ACPI_TABLE_HEADER *
241 AcpiTbCopyDsdt (
242     UINT32                  TableIndex);
243 
244 void
245 AcpiTbInstallTableWithOverride (
246     UINT32                  TableIndex,
247     ACPI_TABLE_DESC         *NewTableDesc,
248     BOOLEAN                 Override);
249 
250 ACPI_STATUS
251 AcpiTbInstallFixedTable (
252     ACPI_PHYSICAL_ADDRESS   Address,
253     char                    *Signature,
254     UINT32                  TableIndex);
255 
256 ACPI_STATUS
257 AcpiTbParseRootTable (
258     ACPI_PHYSICAL_ADDRESS   RsdpAddress);
259 
260 #endif /* __ACTABLES_H__ */
261