xref: /freebsd/sys/contrib/dev/acpica/include/actables.h (revision f0157ce528a128e2abb181a5c766033a2ce49a5f)
1 /******************************************************************************
2  *
3  * Name: actables.h - ACPI table management
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2013, 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 UINT8 *
56 AcpiTbScanMemoryForRsdp (
57     UINT8                   *StartAddress,
58     UINT32                  Length);
59 
60 
61 /*
62  * tbfadt - FADT parse/convert/validate
63  */
64 void
65 AcpiTbParseFadt (
66     UINT32                  TableIndex);
67 
68 void
69 AcpiTbCreateLocalFadt (
70     ACPI_TABLE_HEADER       *Table,
71     UINT32                  Length);
72 
73 
74 /*
75  * tbfind - find ACPI table
76  */
77 ACPI_STATUS
78 AcpiTbFindTable (
79     char                    *Signature,
80     char                    *OemId,
81     char                    *OemTableId,
82     UINT32                  *TableIndex);
83 
84 
85 /*
86  * tbinstal - Table removal and deletion
87  */
88 ACPI_STATUS
89 AcpiTbResizeRootTableList (
90     void);
91 
92 ACPI_STATUS
93 AcpiTbVerifyTable (
94     ACPI_TABLE_DESC         *TableDesc);
95 
96 ACPI_TABLE_HEADER *
97 AcpiTbTableOverride (
98     ACPI_TABLE_HEADER       *TableHeader,
99     ACPI_TABLE_DESC         *TableDesc);
100 
101 ACPI_STATUS
102 AcpiTbAddTable (
103     ACPI_TABLE_DESC         *TableDesc,
104     UINT32                  *TableIndex);
105 
106 ACPI_STATUS
107 AcpiTbStoreTable (
108     ACPI_PHYSICAL_ADDRESS   Address,
109     ACPI_TABLE_HEADER       *Table,
110     UINT32                  Length,
111     UINT8                   Flags,
112     UINT32                  *TableIndex);
113 
114 void
115 AcpiTbDeleteTable (
116     ACPI_TABLE_DESC        *TableDesc);
117 
118 void
119 AcpiTbTerminate (
120     void);
121 
122 ACPI_STATUS
123 AcpiTbDeleteNamespaceByOwner (
124     UINT32                  TableIndex);
125 
126 ACPI_STATUS
127 AcpiTbAllocateOwnerId (
128     UINT32                  TableIndex);
129 
130 ACPI_STATUS
131 AcpiTbReleaseOwnerId (
132     UINT32                  TableIndex);
133 
134 ACPI_STATUS
135 AcpiTbGetOwnerId (
136     UINT32                  TableIndex,
137     ACPI_OWNER_ID           *OwnerId);
138 
139 BOOLEAN
140 AcpiTbIsTableLoaded (
141     UINT32                  TableIndex);
142 
143 void
144 AcpiTbSetTableLoadedFlag (
145     UINT32                  TableIndex,
146     BOOLEAN                 IsLoaded);
147 
148 
149 /*
150  * tbutils - table manager utilities
151  */
152 ACPI_STATUS
153 AcpiTbInitializeFacs (
154     void);
155 
156 BOOLEAN
157 AcpiTbTablesLoaded (
158     void);
159 
160 void
161 AcpiTbPrintTableHeader(
162     ACPI_PHYSICAL_ADDRESS   Address,
163     ACPI_TABLE_HEADER       *Header);
164 
165 UINT8
166 AcpiTbChecksum (
167     UINT8                   *Buffer,
168     UINT32                  Length);
169 
170 ACPI_STATUS
171 AcpiTbVerifyChecksum (
172     ACPI_TABLE_HEADER       *Table,
173     UINT32                  Length);
174 
175 void
176 AcpiTbCheckDsdtHeader (
177     void);
178 
179 ACPI_TABLE_HEADER *
180 AcpiTbCopyDsdt (
181     UINT32                  TableIndex);
182 
183 void
184 AcpiTbInstallTable (
185     ACPI_PHYSICAL_ADDRESS   Address,
186     char                    *Signature,
187     UINT32                  TableIndex);
188 
189 ACPI_STATUS
190 AcpiTbParseRootTable (
191     ACPI_PHYSICAL_ADDRESS   RsdpAddress);
192 
193 #endif /* __ACTABLES_H__ */
194