1 /******************************************************************************
2  *
3  * Name: actables.h - ACPI table management
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2022, 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 MERCHANTABILITY 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 AcpiTbGetNextTableDescriptor (
74     UINT32                  *TableIndex,
75     ACPI_TABLE_DESC         **TableDesc);
76 
77 void
78 AcpiTbInitTableDescriptor (
79     ACPI_TABLE_DESC         *TableDesc,
80     ACPI_PHYSICAL_ADDRESS   Address,
81     UINT8                   Flags,
82     ACPI_TABLE_HEADER       *Table);
83 
84 ACPI_STATUS
85 AcpiTbAcquireTempTable (
86     ACPI_TABLE_DESC         *TableDesc,
87     ACPI_PHYSICAL_ADDRESS   Address,
88     UINT8                   Flags,
89     ACPI_TABLE_HEADER       *Table);
90 
91 void
92 AcpiTbReleaseTempTable (
93     ACPI_TABLE_DESC         *TableDesc);
94 
95 ACPI_STATUS
96 AcpiTbValidateTempTable (
97     ACPI_TABLE_DESC         *TableDesc);
98 
99 ACPI_STATUS
100 AcpiTbVerifyTempTable (
101     ACPI_TABLE_DESC         *TableDesc,
102     char                    *Signature,
103     UINT32                  *TableIndex);
104 
105 BOOLEAN
106 AcpiTbIsTableLoaded (
107     UINT32                  TableIndex);
108 
109 void
110 AcpiTbSetTableLoadedFlag (
111     UINT32                  TableIndex,
112     BOOLEAN                 IsLoaded);
113 
114 
115 /*
116  * tbfadt - FADT parse/convert/validate
117  */
118 void
119 AcpiTbParseFadt (
120     void);
121 
122 void
123 AcpiTbCreateLocalFadt (
124     ACPI_TABLE_HEADER       *Table,
125     UINT32                  Length);
126 
127 
128 /*
129  * tbfind - find ACPI table
130  */
131 ACPI_STATUS
132 AcpiTbFindTable (
133     char                    *Signature,
134     char                    *OemId,
135     char                    *OemTableId,
136     UINT32                  *TableIndex);
137 
138 
139 /*
140  * tbinstal - Table removal and deletion
141  */
142 ACPI_STATUS
143 AcpiTbResizeRootTableList (
144     void);
145 
146 ACPI_STATUS
147 AcpiTbValidateTable (
148     ACPI_TABLE_DESC         *TableDesc);
149 
150 void
151 AcpiTbInvalidateTable (
152     ACPI_TABLE_DESC         *TableDesc);
153 
154 void
155 AcpiTbOverrideTable (
156     ACPI_TABLE_DESC         *OldTableDesc);
157 
158 ACPI_STATUS
159 AcpiTbAcquireTable (
160     ACPI_TABLE_DESC         *TableDesc,
161     ACPI_TABLE_HEADER       **TablePtr,
162     UINT32                  *TableLength,
163     UINT8                   *TableFlags);
164 
165 void
166 AcpiTbReleaseTable (
167     ACPI_TABLE_HEADER       *Table,
168     UINT32                  TableLength,
169     UINT8                   TableFlags);
170 
171 ACPI_STATUS
172 AcpiTbInstallStandardTable (
173     ACPI_PHYSICAL_ADDRESS   Address,
174     UINT8                   Flags,
175     ACPI_TABLE_HEADER       *Table,
176     BOOLEAN                 Reload,
177     BOOLEAN                 Override,
178     UINT32                  *TableIndex);
179 
180 void
181 AcpiTbUninstallTable (
182     ACPI_TABLE_DESC        *TableDesc);
183 
184 ACPI_STATUS
185 AcpiTbLoadTable (
186     UINT32                  TableIndex,
187     ACPI_NAMESPACE_NODE     *ParentNode);
188 
189 ACPI_STATUS
190 AcpiTbInstallAndLoadTable (
191     ACPI_PHYSICAL_ADDRESS   Address,
192     UINT8                   Flags,
193     ACPI_TABLE_HEADER       *Table,
194     BOOLEAN                 Override,
195     UINT32                  *TableIndex);
196 
197 ACPI_STATUS
198 AcpiTbUnloadTable (
199     UINT32                  TableIndex);
200 
201 void
202 AcpiTbNotifyTable (
203     UINT32                          Event,
204     void                            *Table);
205 
206 void
207 AcpiTbTerminate (
208     void);
209 
210 ACPI_STATUS
211 AcpiTbDeleteNamespaceByOwner (
212     UINT32                  TableIndex);
213 
214 ACPI_STATUS
215 AcpiTbAllocateOwnerId (
216     UINT32                  TableIndex);
217 
218 ACPI_STATUS
219 AcpiTbReleaseOwnerId (
220     UINT32                  TableIndex);
221 
222 ACPI_STATUS
223 AcpiTbGetOwnerId (
224     UINT32                  TableIndex,
225     ACPI_OWNER_ID           *OwnerId);
226 
227 
228 /*
229  * tbutils - table manager utilities
230  */
231 ACPI_STATUS
232 AcpiTbInitializeFacs (
233     void);
234 
235 void
236 AcpiTbPrintTableHeader(
237     ACPI_PHYSICAL_ADDRESS   Address,
238     ACPI_TABLE_HEADER       *Header);
239 
240 void
241 AcpiTbCheckDsdtHeader (
242     void);
243 
244 ACPI_TABLE_HEADER *
245 AcpiTbCopyDsdt (
246     UINT32                  TableIndex);
247 
248 void
249 AcpiTbInstallTableWithOverride (
250     ACPI_TABLE_DESC         *NewTableDesc,
251     BOOLEAN                 Override,
252     UINT32                  *TableIndex);
253 
254 ACPI_STATUS
255 AcpiTbParseRootTable (
256     ACPI_PHYSICAL_ADDRESS   RsdpAddress);
257 
258 ACPI_STATUS
259 AcpiTbGetTable (
260     ACPI_TABLE_DESC        *TableDesc,
261     ACPI_TABLE_HEADER      **OutTable);
262 
263 void
264 AcpiTbPutTable (
265     ACPI_TABLE_DESC        *TableDesc);
266 
267 
268 /*
269  * tbxfload
270  */
271 ACPI_STATUS
272 AcpiTbLoadNamespace (
273     void);
274 
275 #endif /* __ACTABLES_H__ */
276