Rev 1498 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1498 | Rev 2216 | ||
---|---|---|---|
1 | /****************************************************************************** |
1 | /****************************************************************************** |
2 | * |
2 | * |
3 | * Module Name: dttable.c - handling for specific ACPI tables |
3 | * Module Name: dttable.c - handling for specific ACPI tables |
4 | * |
4 | * |
5 | *****************************************************************************/ |
5 | *****************************************************************************/ |
6 | 6 | ||
7 | /****************************************************************************** |
7 | /****************************************************************************** |
8 | * |
8 | * |
9 | * 1. Copyright Notice |
9 | * 1. Copyright Notice |
10 | * |
10 | * |
11 | * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
11 | * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
12 | * All rights reserved. |
12 | * All rights reserved. |
13 | * |
13 | * |
14 | * 2. License |
14 | * 2. License |
15 | * |
15 | * |
16 | * 2.1. This is your license from Intel Corp. under its intellectual property |
16 | * 2.1. This is your license from Intel Corp. under its intellectual property |
17 | * rights. You may have additional license terms from the party that provided |
17 | * rights. You may have additional license terms from the party that provided |
18 | * you this software, covering your right to use that party's intellectual |
18 | * you this software, covering your right to use that party's intellectual |
19 | * property rights. |
19 | * property rights. |
20 | * |
20 | * |
21 | * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a |
21 | * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a |
22 | * copy of the source code appearing in this file ("Covered Code") an |
22 | * copy of the source code appearing in this file ("Covered Code") an |
23 | * irrevocable, perpetual, worldwide license under Intel's copyrights in the |
23 | * irrevocable, perpetual, worldwide license under Intel's copyrights in the |
24 | * base code distributed originally by Intel ("Original Intel Code") to copy, |
24 | * base code distributed originally by Intel ("Original Intel Code") to copy, |
25 | * make derivatives, distribute, use and display any portion of the Covered |
25 | * make derivatives, distribute, use and display any portion of the Covered |
26 | * Code in any form, with the right to sublicense such rights; and |
26 | * Code in any form, with the right to sublicense such rights; and |
27 | * |
27 | * |
28 | * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent |
28 | * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent |
29 | * license (with the right to sublicense), under only those claims of Intel |
29 | * license (with the right to sublicense), under only those claims of Intel |
30 | * patents that are infringed by the Original Intel Code, to make, use, sell, |
30 | * patents that are infringed by the Original Intel Code, to make, use, sell, |
31 | * offer to sell, and import the Covered Code and derivative works thereof |
31 | * offer to sell, and import the Covered Code and derivative works thereof |
32 | * solely to the minimum extent necessary to exercise the above copyright |
32 | * solely to the minimum extent necessary to exercise the above copyright |
33 | * license, and in no event shall the patent license extend to any additions |
33 | * license, and in no event shall the patent license extend to any additions |
34 | * to or modifications of the Original Intel Code. No other license or right |
34 | * to or modifications of the Original Intel Code. No other license or right |
35 | * is granted directly or by implication, estoppel or otherwise; |
35 | * is granted directly or by implication, estoppel or otherwise; |
36 | * |
36 | * |
37 | * The above copyright and patent license is granted only if the following |
37 | * The above copyright and patent license is granted only if the following |
38 | * conditions are met: |
38 | * conditions are met: |
39 | * |
39 | * |
40 | * 3. Conditions |
40 | * 3. Conditions |
41 | * |
41 | * |
42 | * 3.1. Redistribution of Source with Rights to Further Distribute Source. |
42 | * 3.1. Redistribution of Source with Rights to Further Distribute Source. |
43 | * Redistribution of source code of any substantial portion of the Covered |
43 | * Redistribution of source code of any substantial portion of the Covered |
44 | * Code or modification with rights to further distribute source must include |
44 | * Code or modification with rights to further distribute source must include |
45 | * the above Copyright Notice, the above License, this list of Conditions, |
45 | * the above Copyright Notice, the above License, this list of Conditions, |
46 | * and the following Disclaimer and Export Compliance provision. In addition, |
46 | * and the following Disclaimer and Export Compliance provision. In addition, |
47 | * Licensee must cause all Covered Code to which Licensee contributes to |
47 | * Licensee must cause all Covered Code to which Licensee contributes to |
48 | * contain a file documenting the changes Licensee made to create that Covered |
48 | * contain a file documenting the changes Licensee made to create that Covered |
49 | * Code and the date of any change. Licensee must include in that file the |
49 | * Code and the date of any change. Licensee must include in that file the |
50 | * documentation of any changes made by any predecessor Licensee. Licensee |
50 | * documentation of any changes made by any predecessor Licensee. Licensee |
51 | * must include a prominent statement that the modification is derived, |
51 | * must include a prominent statement that the modification is derived, |
52 | * directly or indirectly, from Original Intel Code. |
52 | * directly or indirectly, from Original Intel Code. |
53 | * |
53 | * |
54 | * 3.2. Redistribution of Source with no Rights to Further Distribute Source. |
54 | * 3.2. Redistribution of Source with no Rights to Further Distribute Source. |
55 | * Redistribution of source code of any substantial portion of the Covered |
55 | * Redistribution of source code of any substantial portion of the Covered |
56 | * Code or modification without rights to further distribute source must |
56 | * Code or modification without rights to further distribute source must |
57 | * include the following Disclaimer and Export Compliance provision in the |
57 | * include the following Disclaimer and Export Compliance provision in the |
58 | * documentation and/or other materials provided with distribution. In |
58 | * documentation and/or other materials provided with distribution. In |
59 | * addition, Licensee may not authorize further sublicense of source of any |
59 | * addition, Licensee may not authorize further sublicense of source of any |
60 | * portion of the Covered Code, and must include terms to the effect that the |
60 | * portion of the Covered Code, and must include terms to the effect that the |
61 | * license from Licensee to its licensee is limited to the intellectual |
61 | * license from Licensee to its licensee is limited to the intellectual |
62 | * property embodied in the software Licensee provides to its licensee, and |
62 | * property embodied in the software Licensee provides to its licensee, and |
63 | * not to intellectual property embodied in modifications its licensee may |
63 | * not to intellectual property embodied in modifications its licensee may |
64 | * make. |
64 | * make. |
65 | * |
65 | * |
66 | * 3.3. Redistribution of Executable. Redistribution in executable form of any |
66 | * 3.3. Redistribution of Executable. Redistribution in executable form of any |
67 | * substantial portion of the Covered Code or modification must reproduce the |
67 | * substantial portion of the Covered Code or modification must reproduce the |
68 | * above Copyright Notice, and the following Disclaimer and Export Compliance |
68 | * above Copyright Notice, and the following Disclaimer and Export Compliance |
69 | * provision in the documentation and/or other materials provided with the |
69 | * provision in the documentation and/or other materials provided with the |
70 | * distribution. |
70 | * distribution. |
71 | * |
71 | * |
72 | * 3.4. Intel retains all right, title, and interest in and to the Original |
72 | * 3.4. Intel retains all right, title, and interest in and to the Original |
73 | * Intel Code. |
73 | * Intel Code. |
74 | * |
74 | * |
75 | * 3.5. Neither the name Intel nor any other trademark owned or controlled by |
75 | * 3.5. Neither the name Intel nor any other trademark owned or controlled by |
76 | * Intel shall be used in advertising or otherwise to promote the sale, use or |
76 | * Intel shall be used in advertising or otherwise to promote the sale, use or |
77 | * other dealings in products derived from or relating to the Covered Code |
77 | * other dealings in products derived from or relating to the Covered Code |
78 | * without prior written authorization from Intel. |
78 | * without prior written authorization from Intel. |
79 | * |
79 | * |
80 | * 4. Disclaimer and Export Compliance |
80 | * 4. Disclaimer and Export Compliance |
81 | * |
81 | * |
82 | * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED |
82 | * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED |
83 | * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE |
83 | * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE |
84 | * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, |
84 | * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, |
85 | * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY |
85 | * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY |
86 | * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY |
86 | * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY |
87 | * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A |
87 | * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A |
88 | * PARTICULAR PURPOSE. |
88 | * PARTICULAR PURPOSE. |
89 | * |
89 | * |
90 | * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES |
90 | * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES |
91 | * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR |
91 | * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR |
92 | * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, |
92 | * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, |
93 | * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY |
93 | * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY |
94 | * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL |
94 | * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL |
95 | * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS |
95 | * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS |
96 | * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY |
96 | * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY |
97 | * LIMITED REMEDY. |
97 | * LIMITED REMEDY. |
98 | * |
98 | * |
99 | * 4.3. Licensee shall not export, either directly or indirectly, any of this |
99 | * 4.3. Licensee shall not export, either directly or indirectly, any of this |
100 | * software or system incorporating such software without first obtaining any |
100 | * software or system incorporating such software without first obtaining any |
101 | * required license or other approval from the U. S. Department of Commerce or |
101 | * required license or other approval from the U. S. Department of Commerce or |
102 | * any other agency or department of the United States Government. In the |
102 | * any other agency or department of the United States Government. In the |
103 | * event Licensee exports any such software from the United States or |
103 | * event Licensee exports any such software from the United States or |
104 | * re-exports any such software from a foreign destination, Licensee shall |
104 | * re-exports any such software from a foreign destination, Licensee shall |
105 | * ensure that the distribution and export/re-export of the software is in |
105 | * ensure that the distribution and export/re-export of the software is in |
106 | * compliance with all laws, regulations, orders, or other restrictions of the |
106 | * compliance with all laws, regulations, orders, or other restrictions of the |
107 | * U.S. Export Administration Regulations. Licensee agrees that neither it nor |
107 | * U.S. Export Administration Regulations. Licensee agrees that neither it nor |
108 | * any of its subsidiaries will export/re-export any technical data, process, |
108 | * any of its subsidiaries will export/re-export any technical data, process, |
109 | * software, or service, directly or indirectly, to any country for which the |
109 | * software, or service, directly or indirectly, to any country for which the |
110 | * United States government or any agency thereof requires an export license, |
110 | * United States government or any agency thereof requires an export license, |
111 | * other governmental approval, or letter of assurance, without first obtaining |
111 | * other governmental approval, or letter of assurance, without first obtaining |
112 | * such license, approval or letter. |
112 | * such license, approval or letter. |
113 | * |
113 | * |
114 | *****************************************************************************/ |
114 | *****************************************************************************/ |
115 | 115 | ||
116 | #define __DTTABLE_C__ |
116 | #define __DTTABLE_C__ |
117 | 117 | ||
118 | /* Compile all complex data tables */ |
118 | /* Compile all complex data tables */ |
119 | 119 | ||
120 | #include "aslcompiler.h" |
120 | #include "aslcompiler.h" |
121 | #include "dtcompiler.h" |
121 | #include "dtcompiler.h" |
122 | 122 | ||
123 | #define _COMPONENT DT_COMPILER |
123 | #define _COMPONENT DT_COMPILER |
124 | ACPI_MODULE_NAME ("dttable") |
124 | ACPI_MODULE_NAME ("dttable") |
125 | 125 | ||
126 | 126 | ||
127 | /* TBD: merge these into dmtbinfo.c? */ |
127 | /* TBD: merge these into dmtbinfo.c? */ |
128 | 128 | ||
129 | static ACPI_DMTABLE_INFO TableInfoAsfAddress[] = |
129 | static ACPI_DMTABLE_INFO TableInfoAsfAddress[] = |
130 | { |
130 | { |
131 | {ACPI_DMT_BUFFER, 0, "Addresses", 0}, |
131 | {ACPI_DMT_BUFFER, 0, "Addresses", 0}, |
132 | {ACPI_DMT_EXIT, 0, NULL, 0} |
132 | {ACPI_DMT_EXIT, 0, NULL, 0} |
133 | }; |
133 | }; |
134 | 134 | ||
135 | static ACPI_DMTABLE_INFO TableInfoDmarPciPath[] = |
135 | static ACPI_DMTABLE_INFO TableInfoDmarPciPath[] = |
136 | { |
136 | { |
137 | {ACPI_DMT_PCI_PATH, 0, "PCI Path", 0}, |
137 | {ACPI_DMT_PCI_PATH, 0, "PCI Path", 0}, |
138 | {ACPI_DMT_EXIT, 0, NULL, 0} |
138 | {ACPI_DMT_EXIT, 0, NULL, 0} |
139 | }; |
139 | }; |
140 | 140 | ||
141 | 141 | ||
142 | /* TBD: move to acmacros.h */ |
142 | /* TBD: move to acmacros.h */ |
143 | 143 | ||
144 | #define ACPI_SUB_PTR(t, a, b) \ |
144 | #define ACPI_SUB_PTR(t, a, b) \ |
145 | ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b))) |
145 | ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b))) |
146 | 146 | ||
147 | 147 | ||
148 | /* Local prototypes */ |
148 | /* Local prototypes */ |
149 | 149 | ||
150 | static ACPI_STATUS |
150 | static ACPI_STATUS |
151 | DtCompileTwoSubtables ( |
151 | DtCompileTwoSubtables ( |
152 | void **List, |
152 | void **List, |
153 | ACPI_DMTABLE_INFO *TableInfo1, |
153 | ACPI_DMTABLE_INFO *TableInfo1, |
154 | ACPI_DMTABLE_INFO *TableInfo2); |
154 | ACPI_DMTABLE_INFO *TableInfo2); |
155 | 155 | ||
156 | 156 | ||
157 | /****************************************************************************** |
157 | /****************************************************************************** |
158 | * |
158 | * |
159 | * FUNCTION: DtCompileTwoSubtables |
159 | * FUNCTION: DtCompileTwoSubtables |
160 | * |
160 | * |
161 | * PARAMETERS: List - Current field list pointer |
161 | * PARAMETERS: List - Current field list pointer |
162 | * TableInfo1 - Info table 1 |
162 | * TableInfo1 - Info table 1 |
163 | * TableInfo1 - Info table 2 |
163 | * TableInfo1 - Info table 2 |
164 | * |
164 | * |
165 | * RETURN: Status |
165 | * RETURN: Status |
166 | * |
166 | * |
167 | * DESCRIPTION: Compile tables with a header and one or more same subtables. |
167 | * DESCRIPTION: Compile tables with a header and one or more same subtables. |
168 | * Include CPEP, EINJ, ERST, MCFG, MSCT, WDAT |
168 | * Include CPEP, EINJ, ERST, MCFG, MSCT, WDAT |
169 | * |
169 | * |
170 | *****************************************************************************/ |
170 | *****************************************************************************/ |
171 | 171 | ||
172 | static ACPI_STATUS |
172 | static ACPI_STATUS |
173 | DtCompileTwoSubtables ( |
173 | DtCompileTwoSubtables ( |
174 | void **List, |
174 | void **List, |
175 | ACPI_DMTABLE_INFO *TableInfo1, |
175 | ACPI_DMTABLE_INFO *TableInfo1, |
176 | ACPI_DMTABLE_INFO *TableInfo2) |
176 | ACPI_DMTABLE_INFO *TableInfo2) |
177 | { |
177 | { |
178 | ACPI_STATUS Status; |
178 | ACPI_STATUS Status; |
179 | DT_SUBTABLE *Subtable; |
179 | DT_SUBTABLE *Subtable; |
180 | DT_SUBTABLE *ParentTable; |
180 | DT_SUBTABLE *ParentTable; |
181 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
181 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
182 | 182 | ||
183 | 183 | ||
184 | Status = DtCompileTable (PFieldList, TableInfo1, &Subtable, TRUE); |
184 | Status = DtCompileTable (PFieldList, TableInfo1, &Subtable, TRUE); |
185 | if (ACPI_FAILURE (Status)) |
185 | if (ACPI_FAILURE (Status)) |
186 | { |
186 | { |
187 | return (Status); |
187 | return (Status); |
188 | } |
188 | } |
189 | 189 | ||
190 | ParentTable = DtPeekSubtable (); |
190 | ParentTable = DtPeekSubtable (); |
191 | DtInsertSubtable (ParentTable, Subtable); |
191 | DtInsertSubtable (ParentTable, Subtable); |
192 | 192 | ||
193 | while (*PFieldList) |
193 | while (*PFieldList) |
194 | { |
194 | { |
195 | Status = DtCompileTable (PFieldList, TableInfo2, &Subtable, FALSE); |
195 | Status = DtCompileTable (PFieldList, TableInfo2, &Subtable, FALSE); |
196 | if (ACPI_FAILURE (Status)) |
196 | if (ACPI_FAILURE (Status)) |
197 | { |
197 | { |
198 | return (Status); |
198 | return (Status); |
199 | } |
199 | } |
200 | 200 | ||
201 | DtInsertSubtable (ParentTable, Subtable); |
201 | DtInsertSubtable (ParentTable, Subtable); |
202 | } |
202 | } |
203 | 203 | ||
204 | return (AE_OK); |
204 | return (AE_OK); |
205 | } |
205 | } |
206 | 206 | ||
207 | 207 | ||
208 | /****************************************************************************** |
208 | /****************************************************************************** |
209 | * |
209 | * |
210 | * FUNCTION: DtCompileFacs |
210 | * FUNCTION: DtCompileFacs |
211 | * |
211 | * |
212 | * PARAMETERS: PFieldList - Current field list pointer |
212 | * PARAMETERS: PFieldList - Current field list pointer |
213 | * |
213 | * |
214 | * RETURN: Status |
214 | * RETURN: Status |
215 | * |
215 | * |
216 | * DESCRIPTION: Compile FACS. |
216 | * DESCRIPTION: Compile FACS. |
217 | * |
217 | * |
218 | *****************************************************************************/ |
218 | *****************************************************************************/ |
219 | 219 | ||
220 | ACPI_STATUS |
220 | ACPI_STATUS |
221 | DtCompileFacs ( |
221 | DtCompileFacs ( |
222 | DT_FIELD **PFieldList) |
222 | DT_FIELD **PFieldList) |
223 | { |
223 | { |
224 | DT_SUBTABLE *Subtable; |
224 | DT_SUBTABLE *Subtable; |
225 | UINT8 *ReservedBuffer; |
225 | UINT8 *ReservedBuffer; |
226 | ACPI_STATUS Status; |
226 | ACPI_STATUS Status; |
227 | UINT32 ReservedSize; |
227 | UINT32 ReservedSize; |
228 | 228 | ||
229 | 229 | ||
230 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoFacs, |
230 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoFacs, |
231 | &Gbl_RootTable, TRUE); |
231 | &Gbl_RootTable, TRUE); |
232 | if (ACPI_FAILURE (Status)) |
232 | if (ACPI_FAILURE (Status)) |
233 | { |
233 | { |
234 | return (Status); |
234 | return (Status); |
235 | } |
235 | } |
236 | 236 | ||
237 | /* Large FACS reserved area at the end of the table */ |
237 | /* Large FACS reserved area at the end of the table */ |
238 | 238 | ||
239 | ReservedSize = (UINT32) sizeof (((ACPI_TABLE_FACS *) NULL)->Reserved1); |
239 | ReservedSize = (UINT32) sizeof (((ACPI_TABLE_FACS *) NULL)->Reserved1); |
240 | ReservedBuffer = UtLocalCalloc (ReservedSize); |
240 | ReservedBuffer = UtLocalCalloc (ReservedSize); |
241 | 241 | ||
242 | DtCreateSubtable (ReservedBuffer, ReservedSize, &Subtable); |
242 | DtCreateSubtable (ReservedBuffer, ReservedSize, &Subtable); |
243 | 243 | ||
244 | ACPI_FREE (ReservedBuffer); |
244 | ACPI_FREE (ReservedBuffer); |
245 | DtInsertSubtable (Gbl_RootTable, Subtable); |
245 | DtInsertSubtable (Gbl_RootTable, Subtable); |
246 | return (AE_OK); |
246 | return (AE_OK); |
247 | } |
247 | } |
248 | 248 | ||
249 | 249 | ||
250 | /****************************************************************************** |
250 | /****************************************************************************** |
251 | * |
251 | * |
252 | * FUNCTION: DtCompileRsdp |
252 | * FUNCTION: DtCompileRsdp |
253 | * |
253 | * |
254 | * PARAMETERS: PFieldList - Current field list pointer |
254 | * PARAMETERS: PFieldList - Current field list pointer |
255 | * |
255 | * |
256 | * RETURN: Status |
256 | * RETURN: Status |
257 | * |
257 | * |
258 | * DESCRIPTION: Compile RSDP. |
258 | * DESCRIPTION: Compile RSDP. |
259 | * |
259 | * |
260 | *****************************************************************************/ |
260 | *****************************************************************************/ |
261 | 261 | ||
262 | ACPI_STATUS |
262 | ACPI_STATUS |
263 | DtCompileRsdp ( |
263 | DtCompileRsdp ( |
264 | DT_FIELD **PFieldList) |
264 | DT_FIELD **PFieldList) |
265 | { |
265 | { |
266 | DT_SUBTABLE *Subtable; |
266 | DT_SUBTABLE *Subtable; |
267 | ACPI_TABLE_RSDP *Table; |
267 | ACPI_TABLE_RSDP *Rsdp; |
- | 268 | ACPI_RSDP_EXTENSION *RsdpExtension; |
|
268 | ACPI_STATUS Status; |
269 | ACPI_STATUS Status; |
269 | 270 | ||
- | 271 | ||
- | 272 | /* Compile the "common" RSDP (ACPI 1.0) */ |
|
270 | 273 | ||
271 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp1, |
274 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp1, |
272 | &Gbl_RootTable, TRUE); |
275 | &Gbl_RootTable, TRUE); |
273 | if (ACPI_FAILURE (Status)) |
276 | if (ACPI_FAILURE (Status)) |
274 | { |
277 | { |
275 | return (Status); |
278 | return (Status); |
276 | } |
279 | } |
277 | 280 | ||
278 | Table = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Gbl_RootTable->Buffer); |
281 | Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Gbl_RootTable->Buffer); |
279 | DtSetTableChecksum (&Table->Checksum); |
282 | DtSetTableChecksum (&Rsdp->Checksum); |
280 | 283 | ||
- | 284 | if (Rsdp->Revision > 0) |
|
- | 285 | { |
|
281 | if (Table->Revision > 0) |
286 | /* Compile the "extended" part of the RSDP as a subtable */ |
282 | { |
287 | |
283 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp2, |
288 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp2, |
284 | &Subtable, TRUE); |
289 | &Subtable, TRUE); |
285 | if (ACPI_FAILURE (Status)) |
290 | if (ACPI_FAILURE (Status)) |
286 | { |
291 | { |
287 | return (Status); |
292 | return (Status); |
288 | } |
293 | } |
289 | 294 | ||
290 | DtInsertSubtable (Gbl_RootTable, Subtable); |
295 | DtInsertSubtable (Gbl_RootTable, Subtable); |
- | 296 | ||
- | 297 | /* Set length and extended checksum for entire RSDP */ |
|
- | 298 | ||
- | 299 | RsdpExtension = ACPI_CAST_PTR (ACPI_RSDP_EXTENSION, Subtable->Buffer); |
|
- | 300 | RsdpExtension->Length = Gbl_RootTable->Length + Subtable->Length; |
|
291 | DtSetTableChecksum (&Table->ExtendedChecksum); |
301 | DtSetTableChecksum (&RsdpExtension->ExtendedChecksum); |
292 | } |
302 | } |
293 | 303 | ||
294 | return (AE_OK); |
304 | return (AE_OK); |
295 | } |
305 | } |
296 | 306 | ||
297 | 307 | ||
298 | /****************************************************************************** |
308 | /****************************************************************************** |
299 | * |
309 | * |
300 | * FUNCTION: DtCompileAsf |
310 | * FUNCTION: DtCompileAsf |
301 | * |
311 | * |
302 | * PARAMETERS: List - Current field list pointer |
312 | * PARAMETERS: List - Current field list pointer |
303 | * |
313 | * |
304 | * RETURN: Status |
314 | * RETURN: Status |
305 | * |
315 | * |
306 | * DESCRIPTION: Compile ASF!. |
316 | * DESCRIPTION: Compile ASF!. |
307 | * |
317 | * |
308 | *****************************************************************************/ |
318 | *****************************************************************************/ |
309 | 319 | ||
310 | ACPI_STATUS |
320 | ACPI_STATUS |
311 | DtCompileAsf ( |
321 | DtCompileAsf ( |
312 | void **List) |
322 | void **List) |
313 | { |
323 | { |
314 | ACPI_ASF_INFO *AsfTable; |
324 | ACPI_ASF_INFO *AsfTable; |
315 | DT_SUBTABLE *Subtable; |
325 | DT_SUBTABLE *Subtable; |
316 | DT_SUBTABLE *ParentTable; |
326 | DT_SUBTABLE *ParentTable; |
317 | ACPI_DMTABLE_INFO *InfoTable; |
327 | ACPI_DMTABLE_INFO *InfoTable; |
318 | ACPI_DMTABLE_INFO *DataInfoTable = NULL; |
328 | ACPI_DMTABLE_INFO *DataInfoTable = NULL; |
319 | UINT32 DataCount = 0; |
329 | UINT32 DataCount = 0; |
320 | ACPI_STATUS Status; |
330 | ACPI_STATUS Status; |
321 | UINT32 i; |
331 | UINT32 i; |
322 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
332 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
323 | DT_FIELD *SubtableStart; |
333 | DT_FIELD *SubtableStart; |
324 | 334 | ||
325 | 335 | ||
326 | while (*PFieldList) |
336 | while (*PFieldList) |
327 | { |
337 | { |
328 | SubtableStart = *PFieldList; |
338 | SubtableStart = *PFieldList; |
329 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoAsfHdr, |
339 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoAsfHdr, |
330 | &Subtable, TRUE); |
340 | &Subtable, TRUE); |
331 | if (ACPI_FAILURE (Status)) |
341 | if (ACPI_FAILURE (Status)) |
332 | { |
342 | { |
333 | return (Status); |
343 | return (Status); |
334 | } |
344 | } |
335 | 345 | ||
336 | ParentTable = DtPeekSubtable (); |
346 | ParentTable = DtPeekSubtable (); |
337 | DtInsertSubtable (ParentTable, Subtable); |
347 | DtInsertSubtable (ParentTable, Subtable); |
338 | DtPushSubtable (Subtable); |
348 | DtPushSubtable (Subtable); |
339 | 349 | ||
340 | AsfTable = ACPI_CAST_PTR (ACPI_ASF_INFO, Subtable->Buffer); |
350 | AsfTable = ACPI_CAST_PTR (ACPI_ASF_INFO, Subtable->Buffer); |
341 | 351 | ||
342 | switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */ |
352 | switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */ |
343 | { |
353 | { |
344 | case ACPI_ASF_TYPE_INFO: |
354 | case ACPI_ASF_TYPE_INFO: |
345 | InfoTable = AcpiDmTableInfoAsf0; |
355 | InfoTable = AcpiDmTableInfoAsf0; |
346 | break; |
356 | break; |
347 | 357 | ||
348 | case ACPI_ASF_TYPE_ALERT: |
358 | case ACPI_ASF_TYPE_ALERT: |
349 | InfoTable = AcpiDmTableInfoAsf1; |
359 | InfoTable = AcpiDmTableInfoAsf1; |
350 | break; |
360 | break; |
351 | 361 | ||
352 | case ACPI_ASF_TYPE_CONTROL: |
362 | case ACPI_ASF_TYPE_CONTROL: |
353 | InfoTable = AcpiDmTableInfoAsf2; |
363 | InfoTable = AcpiDmTableInfoAsf2; |
354 | break; |
364 | break; |
355 | 365 | ||
356 | case ACPI_ASF_TYPE_BOOT: |
366 | case ACPI_ASF_TYPE_BOOT: |
357 | InfoTable = AcpiDmTableInfoAsf3; |
367 | InfoTable = AcpiDmTableInfoAsf3; |
358 | break; |
368 | break; |
359 | 369 | ||
360 | case ACPI_ASF_TYPE_ADDRESS: |
370 | case ACPI_ASF_TYPE_ADDRESS: |
361 | InfoTable = AcpiDmTableInfoAsf4; |
371 | InfoTable = AcpiDmTableInfoAsf4; |
362 | break; |
372 | break; |
363 | 373 | ||
364 | default: |
374 | default: |
365 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!"); |
375 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!"); |
366 | return (AE_ERROR); |
376 | return (AE_ERROR); |
367 | } |
377 | } |
368 | 378 | ||
369 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
379 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
370 | if (ACPI_FAILURE (Status)) |
380 | if (ACPI_FAILURE (Status)) |
371 | { |
381 | { |
372 | return (Status); |
382 | return (Status); |
373 | } |
383 | } |
374 | 384 | ||
375 | ParentTable = DtPeekSubtable (); |
385 | ParentTable = DtPeekSubtable (); |
376 | DtInsertSubtable (ParentTable, Subtable); |
386 | DtInsertSubtable (ParentTable, Subtable); |
377 | 387 | ||
378 | switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */ |
388 | switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */ |
379 | { |
389 | { |
380 | case ACPI_ASF_TYPE_INFO: |
390 | case ACPI_ASF_TYPE_INFO: |
381 | DataInfoTable = NULL; |
391 | DataInfoTable = NULL; |
382 | break; |
392 | break; |
383 | 393 | ||
384 | case ACPI_ASF_TYPE_ALERT: |
394 | case ACPI_ASF_TYPE_ALERT: |
385 | DataInfoTable = AcpiDmTableInfoAsf1a; |
395 | DataInfoTable = AcpiDmTableInfoAsf1a; |
386 | DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, |
396 | DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, |
387 | ACPI_SUB_PTR (UINT8, Subtable->Buffer, |
397 | ACPI_SUB_PTR (UINT8, Subtable->Buffer, |
388 | sizeof (ACPI_ASF_HEADER)))->Alerts; |
398 | sizeof (ACPI_ASF_HEADER)))->Alerts; |
389 | break; |
399 | break; |
390 | 400 | ||
391 | case ACPI_ASF_TYPE_CONTROL: |
401 | case ACPI_ASF_TYPE_CONTROL: |
392 | DataInfoTable = AcpiDmTableInfoAsf2a; |
402 | DataInfoTable = AcpiDmTableInfoAsf2a; |
393 | DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, |
403 | DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, |
394 | ACPI_SUB_PTR (UINT8, Subtable->Buffer, |
404 | ACPI_SUB_PTR (UINT8, Subtable->Buffer, |
395 | sizeof (ACPI_ASF_HEADER)))->Controls; |
405 | sizeof (ACPI_ASF_HEADER)))->Controls; |
396 | break; |
406 | break; |
397 | 407 | ||
398 | case ACPI_ASF_TYPE_BOOT: |
408 | case ACPI_ASF_TYPE_BOOT: |
399 | DataInfoTable = NULL; |
409 | DataInfoTable = NULL; |
400 | break; |
410 | break; |
401 | 411 | ||
402 | case ACPI_ASF_TYPE_ADDRESS: |
412 | case ACPI_ASF_TYPE_ADDRESS: |
403 | DataInfoTable = TableInfoAsfAddress; |
413 | DataInfoTable = TableInfoAsfAddress; |
404 | DataCount = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, |
414 | DataCount = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, |
405 | ACPI_SUB_PTR (UINT8, Subtable->Buffer, |
415 | ACPI_SUB_PTR (UINT8, Subtable->Buffer, |
406 | sizeof (ACPI_ASF_HEADER)))->Devices; |
416 | sizeof (ACPI_ASF_HEADER)))->Devices; |
407 | break; |
417 | break; |
408 | 418 | ||
409 | default: |
419 | default: |
410 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!"); |
420 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!"); |
411 | return (AE_ERROR); |
421 | return (AE_ERROR); |
412 | } |
422 | } |
413 | 423 | ||
414 | if (DataInfoTable) |
424 | if (DataInfoTable) |
415 | { |
425 | { |
416 | switch (AsfTable->Header.Type & 0x7F) |
426 | switch (AsfTable->Header.Type & 0x7F) |
417 | { |
427 | { |
418 | case ACPI_ASF_TYPE_ADDRESS: |
428 | case ACPI_ASF_TYPE_ADDRESS: |
419 | 429 | ||
420 | while (DataCount > 0) |
430 | while (DataCount > 0) |
421 | { |
431 | { |
422 | Status = DtCompileTable (PFieldList, DataInfoTable, |
432 | Status = DtCompileTable (PFieldList, DataInfoTable, |
423 | &Subtable, TRUE); |
433 | &Subtable, TRUE); |
424 | if (ACPI_FAILURE (Status)) |
434 | if (ACPI_FAILURE (Status)) |
425 | { |
435 | { |
426 | return (Status); |
436 | return (Status); |
427 | } |
437 | } |
428 | 438 | ||
429 | DtInsertSubtable (ParentTable, Subtable); |
439 | DtInsertSubtable (ParentTable, Subtable); |
430 | DataCount = DataCount - Subtable->Length; |
440 | DataCount = DataCount - Subtable->Length; |
431 | } |
441 | } |
432 | break; |
442 | break; |
433 | 443 | ||
434 | default: |
444 | default: |
435 | 445 | ||
436 | for (i = 0; i < DataCount; i++) |
446 | for (i = 0; i < DataCount; i++) |
437 | { |
447 | { |
438 | Status = DtCompileTable (PFieldList, DataInfoTable, |
448 | Status = DtCompileTable (PFieldList, DataInfoTable, |
439 | &Subtable, TRUE); |
449 | &Subtable, TRUE); |
440 | if (ACPI_FAILURE (Status)) |
450 | if (ACPI_FAILURE (Status)) |
441 | { |
451 | { |
442 | return (Status); |
452 | return (Status); |
443 | } |
453 | } |
444 | 454 | ||
445 | DtInsertSubtable (ParentTable, Subtable); |
455 | DtInsertSubtable (ParentTable, Subtable); |
446 | } |
456 | } |
447 | break; |
457 | break; |
448 | } |
458 | } |
449 | } |
459 | } |
450 | 460 | ||
451 | DtPopSubtable (); |
461 | DtPopSubtable (); |
452 | } |
462 | } |
453 | 463 | ||
454 | return (AE_OK); |
464 | return (AE_OK); |
455 | } |
465 | } |
456 | 466 | ||
457 | 467 | ||
458 | /****************************************************************************** |
468 | /****************************************************************************** |
459 | * |
469 | * |
460 | * FUNCTION: DtCompileCpep |
470 | * FUNCTION: DtCompileCpep |
461 | * |
471 | * |
462 | * PARAMETERS: List - Current field list pointer |
472 | * PARAMETERS: List - Current field list pointer |
463 | * |
473 | * |
464 | * RETURN: Status |
474 | * RETURN: Status |
465 | * |
475 | * |
466 | * DESCRIPTION: Compile CPEP. |
476 | * DESCRIPTION: Compile CPEP. |
467 | * |
477 | * |
468 | *****************************************************************************/ |
478 | *****************************************************************************/ |
469 | 479 | ||
470 | ACPI_STATUS |
480 | ACPI_STATUS |
471 | DtCompileCpep ( |
481 | DtCompileCpep ( |
472 | void **List) |
482 | void **List) |
473 | { |
483 | { |
474 | ACPI_STATUS Status; |
484 | ACPI_STATUS Status; |
475 | 485 | ||
476 | 486 | ||
477 | Status = DtCompileTwoSubtables (List, |
487 | Status = DtCompileTwoSubtables (List, |
478 | AcpiDmTableInfoCpep, AcpiDmTableInfoCpep0); |
488 | AcpiDmTableInfoCpep, AcpiDmTableInfoCpep0); |
479 | return (Status); |
489 | return (Status); |
480 | } |
490 | } |
481 | 491 | ||
482 | 492 | ||
483 | /****************************************************************************** |
493 | /****************************************************************************** |
484 | * |
494 | * |
485 | * FUNCTION: DtCompileDmar |
495 | * FUNCTION: DtCompileDmar |
486 | * |
496 | * |
487 | * PARAMETERS: List - Current field list pointer |
497 | * PARAMETERS: List - Current field list pointer |
488 | * |
498 | * |
489 | * RETURN: Status |
499 | * RETURN: Status |
490 | * |
500 | * |
491 | * DESCRIPTION: Compile DMAR. |
501 | * DESCRIPTION: Compile DMAR. |
492 | * |
502 | * |
493 | *****************************************************************************/ |
503 | *****************************************************************************/ |
494 | 504 | ||
495 | ACPI_STATUS |
505 | ACPI_STATUS |
496 | DtCompileDmar ( |
506 | DtCompileDmar ( |
497 | void **List) |
507 | void **List) |
498 | { |
508 | { |
499 | ACPI_STATUS Status; |
509 | ACPI_STATUS Status; |
500 | DT_SUBTABLE *Subtable; |
510 | DT_SUBTABLE *Subtable; |
501 | DT_SUBTABLE *ParentTable; |
511 | DT_SUBTABLE *ParentTable; |
502 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
512 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
503 | DT_FIELD *SubtableStart; |
513 | DT_FIELD *SubtableStart; |
504 | ACPI_DMTABLE_INFO *InfoTable; |
514 | ACPI_DMTABLE_INFO *InfoTable; |
505 | ACPI_DMAR_HEADER *DmarHeader; |
515 | ACPI_DMAR_HEADER *DmarHeader; |
506 | UINT8 *ReservedBuffer; |
516 | UINT8 *ReservedBuffer; |
507 | UINT32 ReservedSize; |
517 | UINT32 ReservedSize; |
508 | 518 | ||
509 | 519 | ||
510 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable, TRUE); |
520 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable, TRUE); |
511 | if (ACPI_FAILURE (Status)) |
521 | if (ACPI_FAILURE (Status)) |
512 | { |
522 | { |
513 | return (Status); |
523 | return (Status); |
514 | } |
524 | } |
515 | 525 | ||
516 | ParentTable = DtPeekSubtable (); |
526 | ParentTable = DtPeekSubtable (); |
517 | DtInsertSubtable (ParentTable, Subtable); |
527 | DtInsertSubtable (ParentTable, Subtable); |
518 | 528 | ||
519 | /* DMAR Reserved area */ |
529 | /* DMAR Reserved area */ |
520 | 530 | ||
521 | ReservedSize = (UINT32) sizeof (((ACPI_TABLE_DMAR *) NULL)->Reserved); |
531 | ReservedSize = (UINT32) sizeof (((ACPI_TABLE_DMAR *) NULL)->Reserved); |
522 | ReservedBuffer = UtLocalCalloc (ReservedSize); |
532 | ReservedBuffer = UtLocalCalloc (ReservedSize); |
523 | 533 | ||
524 | DtCreateSubtable (ReservedBuffer, ReservedSize, &Subtable); |
534 | DtCreateSubtable (ReservedBuffer, ReservedSize, &Subtable); |
525 | 535 | ||
526 | ACPI_FREE (ReservedBuffer); |
536 | ACPI_FREE (ReservedBuffer); |
527 | ParentTable = DtPeekSubtable (); |
537 | ParentTable = DtPeekSubtable (); |
528 | DtInsertSubtable (ParentTable, Subtable); |
538 | DtInsertSubtable (ParentTable, Subtable); |
529 | 539 | ||
530 | while (*PFieldList) |
540 | while (*PFieldList) |
531 | { |
541 | { |
532 | /* DMAR Header */ |
542 | /* DMAR Header */ |
533 | 543 | ||
534 | SubtableStart = *PFieldList; |
544 | SubtableStart = *PFieldList; |
535 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarHdr, |
545 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarHdr, |
536 | &Subtable, TRUE); |
546 | &Subtable, TRUE); |
537 | if (ACPI_FAILURE (Status)) |
547 | if (ACPI_FAILURE (Status)) |
538 | { |
548 | { |
539 | return (Status); |
549 | return (Status); |
540 | } |
550 | } |
541 | 551 | ||
542 | ParentTable = DtPeekSubtable (); |
552 | ParentTable = DtPeekSubtable (); |
543 | DtInsertSubtable (ParentTable, Subtable); |
553 | DtInsertSubtable (ParentTable, Subtable); |
544 | DtPushSubtable (Subtable); |
554 | DtPushSubtable (Subtable); |
545 | 555 | ||
546 | DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer); |
556 | DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer); |
547 | 557 | ||
548 | switch (DmarHeader->Type) |
558 | switch (DmarHeader->Type) |
549 | { |
559 | { |
550 | case ACPI_DMAR_TYPE_HARDWARE_UNIT: |
560 | case ACPI_DMAR_TYPE_HARDWARE_UNIT: |
551 | InfoTable = AcpiDmTableInfoDmar0; |
561 | InfoTable = AcpiDmTableInfoDmar0; |
552 | break; |
562 | break; |
553 | case ACPI_DMAR_TYPE_RESERVED_MEMORY: |
563 | case ACPI_DMAR_TYPE_RESERVED_MEMORY: |
554 | InfoTable = AcpiDmTableInfoDmar1; |
564 | InfoTable = AcpiDmTableInfoDmar1; |
555 | break; |
565 | break; |
556 | case ACPI_DMAR_TYPE_ATSR: |
566 | case ACPI_DMAR_TYPE_ATSR: |
557 | InfoTable = AcpiDmTableInfoDmar2; |
567 | InfoTable = AcpiDmTableInfoDmar2; |
558 | break; |
568 | break; |
559 | case ACPI_DMAR_HARDWARE_AFFINITY: |
569 | case ACPI_DMAR_HARDWARE_AFFINITY: |
560 | InfoTable = AcpiDmTableInfoDmar3; |
570 | InfoTable = AcpiDmTableInfoDmar3; |
561 | break; |
571 | break; |
562 | default: |
572 | default: |
563 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR"); |
573 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR"); |
564 | return (AE_ERROR); |
574 | return (AE_ERROR); |
565 | } |
575 | } |
566 | 576 | ||
567 | /* DMAR Subtable */ |
577 | /* DMAR Subtable */ |
568 | 578 | ||
569 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
579 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
570 | if (ACPI_FAILURE (Status)) |
580 | if (ACPI_FAILURE (Status)) |
571 | { |
581 | { |
572 | return (Status); |
582 | return (Status); |
573 | } |
583 | } |
574 | 584 | ||
575 | ParentTable = DtPeekSubtable (); |
585 | ParentTable = DtPeekSubtable (); |
576 | DtInsertSubtable (ParentTable, Subtable); |
586 | DtInsertSubtable (ParentTable, Subtable); |
577 | 587 | ||
578 | /* Optional Device Scope subtables */ |
588 | /* Optional Device Scope subtables */ |
579 | 589 | ||
580 | while (*PFieldList) |
590 | while (*PFieldList) |
581 | { |
591 | { |
582 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope, |
592 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope, |
583 | &Subtable, FALSE); |
593 | &Subtable, FALSE); |
584 | if (Status == AE_NOT_FOUND) |
594 | if (Status == AE_NOT_FOUND) |
585 | { |
595 | { |
586 | break; |
596 | break; |
587 | } |
597 | } |
588 | 598 | ||
589 | ParentTable = DtPeekSubtable (); |
599 | ParentTable = DtPeekSubtable (); |
590 | DtInsertSubtable (ParentTable, Subtable); |
600 | DtInsertSubtable (ParentTable, Subtable); |
591 | DtPushSubtable (Subtable); |
601 | DtPushSubtable (Subtable); |
592 | 602 | ||
593 | /* Optional PCI Paths */ |
603 | /* Optional PCI Paths */ |
594 | 604 | ||
595 | while (*PFieldList) |
605 | while (*PFieldList) |
596 | { |
606 | { |
597 | Status = DtCompileTable (PFieldList, TableInfoDmarPciPath, |
607 | Status = DtCompileTable (PFieldList, TableInfoDmarPciPath, |
598 | &Subtable, FALSE); |
608 | &Subtable, FALSE); |
599 | if (Status == AE_NOT_FOUND) |
609 | if (Status == AE_NOT_FOUND) |
600 | { |
610 | { |
601 | DtPopSubtable (); |
611 | DtPopSubtable (); |
602 | break; |
612 | break; |
603 | } |
613 | } |
604 | 614 | ||
605 | ParentTable = DtPeekSubtable (); |
615 | ParentTable = DtPeekSubtable (); |
606 | DtInsertSubtable (ParentTable, Subtable); |
616 | DtInsertSubtable (ParentTable, Subtable); |
607 | } |
617 | } |
608 | } |
618 | } |
609 | 619 | ||
610 | DtPopSubtable (); |
620 | DtPopSubtable (); |
611 | } |
621 | } |
612 | 622 | ||
613 | return (AE_OK); |
623 | return (AE_OK); |
614 | } |
624 | } |
615 | 625 | ||
616 | 626 | ||
617 | /****************************************************************************** |
627 | /****************************************************************************** |
618 | * |
628 | * |
619 | * FUNCTION: DtCompileEinj |
629 | * FUNCTION: DtCompileEinj |
620 | * |
630 | * |
621 | * PARAMETERS: List - Current field list pointer |
631 | * PARAMETERS: List - Current field list pointer |
622 | * |
632 | * |
623 | * RETURN: Status |
633 | * RETURN: Status |
624 | * |
634 | * |
625 | * DESCRIPTION: Compile EINJ. |
635 | * DESCRIPTION: Compile EINJ. |
626 | * |
636 | * |
627 | *****************************************************************************/ |
637 | *****************************************************************************/ |
628 | 638 | ||
629 | ACPI_STATUS |
639 | ACPI_STATUS |
630 | DtCompileEinj ( |
640 | DtCompileEinj ( |
631 | void **List) |
641 | void **List) |
632 | { |
642 | { |
633 | ACPI_STATUS Status; |
643 | ACPI_STATUS Status; |
634 | 644 | ||
635 | 645 | ||
636 | Status = DtCompileTwoSubtables (List, |
646 | Status = DtCompileTwoSubtables (List, |
637 | AcpiDmTableInfoEinj, AcpiDmTableInfoEinj0); |
647 | AcpiDmTableInfoEinj, AcpiDmTableInfoEinj0); |
638 | return (Status); |
648 | return (Status); |
639 | } |
649 | } |
640 | 650 | ||
641 | 651 | ||
642 | /****************************************************************************** |
652 | /****************************************************************************** |
643 | * |
653 | * |
644 | * FUNCTION: DtCompileErst |
654 | * FUNCTION: DtCompileErst |
645 | * |
655 | * |
646 | * PARAMETERS: List - Current field list pointer |
656 | * PARAMETERS: List - Current field list pointer |
647 | * |
657 | * |
648 | * RETURN: Status |
658 | * RETURN: Status |
649 | * |
659 | * |
650 | * DESCRIPTION: Compile ERST. |
660 | * DESCRIPTION: Compile ERST. |
651 | * |
661 | * |
652 | *****************************************************************************/ |
662 | *****************************************************************************/ |
653 | 663 | ||
654 | ACPI_STATUS |
664 | ACPI_STATUS |
655 | DtCompileErst ( |
665 | DtCompileErst ( |
656 | void **List) |
666 | void **List) |
657 | { |
667 | { |
658 | ACPI_STATUS Status; |
668 | ACPI_STATUS Status; |
659 | 669 | ||
660 | 670 | ||
661 | Status = DtCompileTwoSubtables (List, |
671 | Status = DtCompileTwoSubtables (List, |
662 | AcpiDmTableInfoErst, AcpiDmTableInfoEinj0); |
672 | AcpiDmTableInfoErst, AcpiDmTableInfoEinj0); |
663 | return (Status); |
673 | return (Status); |
664 | } |
674 | } |
665 | 675 | ||
666 | 676 | ||
667 | /****************************************************************************** |
677 | /****************************************************************************** |
668 | * |
678 | * |
669 | * FUNCTION: DtCompileFadt |
679 | * FUNCTION: DtCompileFadt |
670 | * |
680 | * |
671 | * PARAMETERS: List - Current field list pointer |
681 | * PARAMETERS: List - Current field list pointer |
672 | * |
682 | * |
673 | * RETURN: Status |
683 | * RETURN: Status |
674 | * |
684 | * |
675 | * DESCRIPTION: Compile FADT. |
685 | * DESCRIPTION: Compile FADT. |
676 | * |
686 | * |
677 | *****************************************************************************/ |
687 | *****************************************************************************/ |
678 | 688 | ||
679 | ACPI_STATUS |
689 | ACPI_STATUS |
680 | DtCompileFadt ( |
690 | DtCompileFadt ( |
681 | void **List) |
691 | void **List) |
682 | { |
692 | { |
683 | ACPI_STATUS Status; |
693 | ACPI_STATUS Status; |
684 | DT_SUBTABLE *Subtable; |
694 | DT_SUBTABLE *Subtable; |
685 | DT_SUBTABLE *ParentTable; |
695 | DT_SUBTABLE *ParentTable; |
686 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
696 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
687 | ACPI_TABLE_HEADER *Table; |
697 | ACPI_TABLE_HEADER *Table; |
688 | UINT8 Revision; |
698 | UINT8 Revision; |
689 | 699 | ||
690 | 700 | ||
691 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt1, |
701 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt1, |
692 | &Subtable, TRUE); |
702 | &Subtable, TRUE); |
693 | if (ACPI_FAILURE (Status)) |
703 | if (ACPI_FAILURE (Status)) |
694 | { |
704 | { |
695 | return (Status); |
705 | return (Status); |
696 | } |
706 | } |
697 | 707 | ||
698 | ParentTable = DtPeekSubtable (); |
708 | ParentTable = DtPeekSubtable (); |
699 | DtInsertSubtable (ParentTable, Subtable); |
709 | DtInsertSubtable (ParentTable, Subtable); |
700 | 710 | ||
701 | Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); |
711 | Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer); |
702 | Revision = Table->Revision; |
712 | Revision = Table->Revision; |
703 | 713 | ||
704 | if (Revision == 2) |
714 | if (Revision == 2) |
705 | { |
715 | { |
706 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt2, |
716 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt2, |
707 | &Subtable, TRUE); |
717 | &Subtable, TRUE); |
708 | if (ACPI_FAILURE (Status)) |
718 | if (ACPI_FAILURE (Status)) |
709 | { |
719 | { |
710 | return (Status); |
720 | return (Status); |
711 | } |
721 | } |
712 | 722 | ||
713 | DtInsertSubtable (ParentTable, Subtable); |
723 | DtInsertSubtable (ParentTable, Subtable); |
714 | } |
724 | } |
715 | else if (Revision >= 2) |
725 | else if (Revision >= 2) |
716 | { |
726 | { |
717 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt3, |
727 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt3, |
718 | &Subtable, TRUE); |
728 | &Subtable, TRUE); |
719 | if (ACPI_FAILURE (Status)) |
729 | if (ACPI_FAILURE (Status)) |
720 | { |
730 | { |
721 | return (Status); |
731 | return (Status); |
722 | } |
732 | } |
723 | 733 | ||
724 | DtInsertSubtable (ParentTable, Subtable); |
734 | DtInsertSubtable (ParentTable, Subtable); |
725 | } |
735 | } |
726 | 736 | ||
727 | return (AE_OK); |
737 | return (AE_OK); |
728 | } |
738 | } |
729 | 739 | ||
730 | 740 | ||
731 | /****************************************************************************** |
741 | /****************************************************************************** |
732 | * |
742 | * |
733 | * FUNCTION: DtCompileHest |
743 | * FUNCTION: DtCompileHest |
734 | * |
744 | * |
735 | * PARAMETERS: List - Current field list pointer |
745 | * PARAMETERS: List - Current field list pointer |
736 | * |
746 | * |
737 | * RETURN: Status |
747 | * RETURN: Status |
738 | * |
748 | * |
739 | * DESCRIPTION: Compile HEST. |
749 | * DESCRIPTION: Compile HEST. |
740 | * |
750 | * |
741 | *****************************************************************************/ |
751 | *****************************************************************************/ |
742 | 752 | ||
743 | ACPI_STATUS |
753 | ACPI_STATUS |
744 | DtCompileHest ( |
754 | DtCompileHest ( |
745 | void **List) |
755 | void **List) |
746 | { |
756 | { |
747 | ACPI_STATUS Status; |
757 | ACPI_STATUS Status; |
748 | DT_SUBTABLE *Subtable; |
758 | DT_SUBTABLE *Subtable; |
749 | DT_SUBTABLE *ParentTable; |
759 | DT_SUBTABLE *ParentTable; |
750 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
760 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
751 | DT_FIELD *SubtableStart; |
761 | DT_FIELD *SubtableStart; |
752 | ACPI_DMTABLE_INFO *InfoTable; |
762 | ACPI_DMTABLE_INFO *InfoTable; |
753 | UINT16 Type; |
763 | UINT16 Type; |
754 | UINT32 BankCount; |
764 | UINT32 BankCount; |
755 | 765 | ||
756 | 766 | ||
757 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoHest, |
767 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoHest, |
758 | &Subtable, TRUE); |
768 | &Subtable, TRUE); |
759 | if (ACPI_FAILURE (Status)) |
769 | if (ACPI_FAILURE (Status)) |
760 | { |
770 | { |
761 | return (Status); |
771 | return (Status); |
762 | } |
772 | } |
763 | 773 | ||
764 | ParentTable = DtPeekSubtable (); |
774 | ParentTable = DtPeekSubtable (); |
765 | DtInsertSubtable (ParentTable, Subtable); |
775 | DtInsertSubtable (ParentTable, Subtable); |
766 | 776 | ||
767 | while (*PFieldList) |
777 | while (*PFieldList) |
768 | { |
778 | { |
769 | /* Get subtable type */ |
779 | /* Get subtable type */ |
770 | 780 | ||
771 | SubtableStart = *PFieldList; |
781 | SubtableStart = *PFieldList; |
772 | DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0); |
782 | DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0); |
773 | 783 | ||
774 | switch (Type) |
784 | switch (Type) |
775 | { |
785 | { |
776 | case ACPI_HEST_TYPE_IA32_CHECK: |
786 | case ACPI_HEST_TYPE_IA32_CHECK: |
777 | InfoTable = AcpiDmTableInfoHest0; |
787 | InfoTable = AcpiDmTableInfoHest0; |
778 | break; |
788 | break; |
779 | 789 | ||
780 | case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: |
790 | case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: |
781 | InfoTable = AcpiDmTableInfoHest1; |
791 | InfoTable = AcpiDmTableInfoHest1; |
782 | break; |
792 | break; |
783 | 793 | ||
784 | case ACPI_HEST_TYPE_IA32_NMI: |
794 | case ACPI_HEST_TYPE_IA32_NMI: |
785 | InfoTable = AcpiDmTableInfoHest2; |
795 | InfoTable = AcpiDmTableInfoHest2; |
786 | break; |
796 | break; |
787 | 797 | ||
788 | case ACPI_HEST_TYPE_AER_ROOT_PORT: |
798 | case ACPI_HEST_TYPE_AER_ROOT_PORT: |
789 | InfoTable = AcpiDmTableInfoHest6; |
799 | InfoTable = AcpiDmTableInfoHest6; |
790 | break; |
800 | break; |
791 | 801 | ||
792 | case ACPI_HEST_TYPE_AER_ENDPOINT: |
802 | case ACPI_HEST_TYPE_AER_ENDPOINT: |
793 | InfoTable = AcpiDmTableInfoHest7; |
803 | InfoTable = AcpiDmTableInfoHest7; |
794 | break; |
804 | break; |
795 | 805 | ||
796 | case ACPI_HEST_TYPE_AER_BRIDGE: |
806 | case ACPI_HEST_TYPE_AER_BRIDGE: |
797 | InfoTable = AcpiDmTableInfoHest8; |
807 | InfoTable = AcpiDmTableInfoHest8; |
798 | break; |
808 | break; |
799 | 809 | ||
800 | case ACPI_HEST_TYPE_GENERIC_ERROR: |
810 | case ACPI_HEST_TYPE_GENERIC_ERROR: |
801 | InfoTable = AcpiDmTableInfoHest9; |
811 | InfoTable = AcpiDmTableInfoHest9; |
802 | break; |
812 | break; |
803 | 813 | ||
804 | default: |
814 | default: |
805 | /* Cannot continue on unknown type */ |
815 | /* Cannot continue on unknown type */ |
806 | 816 | ||
807 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HEST"); |
817 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HEST"); |
808 | return (AE_ERROR); |
818 | return (AE_ERROR); |
809 | } |
819 | } |
810 | 820 | ||
811 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
821 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
812 | if (ACPI_FAILURE (Status)) |
822 | if (ACPI_FAILURE (Status)) |
813 | { |
823 | { |
814 | return (Status); |
824 | return (Status); |
815 | } |
825 | } |
816 | 826 | ||
817 | DtInsertSubtable (ParentTable, Subtable); |
827 | DtInsertSubtable (ParentTable, Subtable); |
818 | 828 | ||
819 | /* |
829 | /* |
820 | * Additional subtable data - IA32 Error Bank(s) |
830 | * Additional subtable data - IA32 Error Bank(s) |
821 | */ |
831 | */ |
822 | BankCount = 0; |
832 | BankCount = 0; |
823 | switch (Type) |
833 | switch (Type) |
824 | { |
834 | { |
825 | case ACPI_HEST_TYPE_IA32_CHECK: |
835 | case ACPI_HEST_TYPE_IA32_CHECK: |
826 | BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK, |
836 | BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK, |
827 | Subtable->Buffer))->NumHardwareBanks; |
837 | Subtable->Buffer))->NumHardwareBanks; |
828 | break; |
838 | break; |
829 | 839 | ||
830 | case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: |
840 | case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: |
831 | BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED, |
841 | BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED, |
832 | Subtable->Buffer))->NumHardwareBanks; |
842 | Subtable->Buffer))->NumHardwareBanks; |
833 | break; |
843 | break; |
834 | 844 | ||
835 | default: |
845 | default: |
836 | break; |
846 | break; |
837 | } |
847 | } |
838 | 848 | ||
839 | while (BankCount) |
849 | while (BankCount) |
840 | { |
850 | { |
841 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoHestBank, |
851 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoHestBank, |
842 | &Subtable, TRUE); |
852 | &Subtable, TRUE); |
843 | if (ACPI_FAILURE (Status)) |
853 | if (ACPI_FAILURE (Status)) |
844 | { |
854 | { |
845 | return (Status); |
855 | return (Status); |
846 | } |
856 | } |
847 | 857 | ||
848 | DtInsertSubtable (ParentTable, Subtable); |
858 | DtInsertSubtable (ParentTable, Subtable); |
849 | BankCount--; |
859 | BankCount--; |
850 | } |
860 | } |
851 | } |
861 | } |
852 | 862 | ||
853 | return AE_OK; |
863 | return AE_OK; |
854 | } |
864 | } |
855 | 865 | ||
856 | 866 | ||
857 | /****************************************************************************** |
867 | /****************************************************************************** |
858 | * |
868 | * |
859 | * FUNCTION: DtCompileIvrs |
869 | * FUNCTION: DtCompileIvrs |
860 | * |
870 | * |
861 | * PARAMETERS: List - Current field list pointer |
871 | * PARAMETERS: List - Current field list pointer |
862 | * |
872 | * |
863 | * RETURN: Status |
873 | * RETURN: Status |
864 | * |
874 | * |
865 | * DESCRIPTION: Compile IVRS. |
875 | * DESCRIPTION: Compile IVRS. |
866 | * |
876 | * |
867 | *****************************************************************************/ |
877 | *****************************************************************************/ |
868 | 878 | ||
869 | ACPI_STATUS |
879 | ACPI_STATUS |
870 | DtCompileIvrs ( |
880 | DtCompileIvrs ( |
871 | void **List) |
881 | void **List) |
872 | { |
882 | { |
873 | ACPI_STATUS Status; |
883 | ACPI_STATUS Status; |
874 | DT_SUBTABLE *Subtable; |
884 | DT_SUBTABLE *Subtable; |
875 | DT_SUBTABLE *ParentTable; |
885 | DT_SUBTABLE *ParentTable; |
876 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
886 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
877 | DT_FIELD *SubtableStart; |
887 | DT_FIELD *SubtableStart; |
878 | ACPI_DMTABLE_INFO *InfoTable; |
888 | ACPI_DMTABLE_INFO *InfoTable; |
879 | ACPI_IVRS_HEADER *IvrsHeader; |
889 | ACPI_IVRS_HEADER *IvrsHeader; |
880 | UINT8 EntryType; |
890 | UINT8 EntryType; |
881 | 891 | ||
882 | 892 | ||
883 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrs, |
893 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrs, |
884 | &Subtable, TRUE); |
894 | &Subtable, TRUE); |
885 | if (ACPI_FAILURE (Status)) |
895 | if (ACPI_FAILURE (Status)) |
886 | { |
896 | { |
887 | return (Status); |
897 | return (Status); |
888 | } |
898 | } |
889 | 899 | ||
890 | ParentTable = DtPeekSubtable (); |
900 | ParentTable = DtPeekSubtable (); |
891 | DtInsertSubtable (ParentTable, Subtable); |
901 | DtInsertSubtable (ParentTable, Subtable); |
892 | 902 | ||
893 | while (*PFieldList) |
903 | while (*PFieldList) |
894 | { |
904 | { |
895 | SubtableStart = *PFieldList; |
905 | SubtableStart = *PFieldList; |
896 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHdr, |
906 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHdr, |
897 | &Subtable, TRUE); |
907 | &Subtable, TRUE); |
898 | if (ACPI_FAILURE (Status)) |
908 | if (ACPI_FAILURE (Status)) |
899 | { |
909 | { |
900 | return (Status); |
910 | return (Status); |
901 | } |
911 | } |
902 | 912 | ||
903 | ParentTable = DtPeekSubtable (); |
913 | ParentTable = DtPeekSubtable (); |
904 | DtInsertSubtable (ParentTable, Subtable); |
914 | DtInsertSubtable (ParentTable, Subtable); |
905 | DtPushSubtable (Subtable); |
915 | DtPushSubtable (Subtable); |
906 | 916 | ||
907 | IvrsHeader = ACPI_CAST_PTR (ACPI_IVRS_HEADER, Subtable->Buffer); |
917 | IvrsHeader = ACPI_CAST_PTR (ACPI_IVRS_HEADER, Subtable->Buffer); |
908 | 918 | ||
909 | switch (IvrsHeader->Type) |
919 | switch (IvrsHeader->Type) |
910 | { |
920 | { |
911 | case ACPI_IVRS_TYPE_HARDWARE: |
921 | case ACPI_IVRS_TYPE_HARDWARE: |
912 | InfoTable = AcpiDmTableInfoIvrs0; |
922 | InfoTable = AcpiDmTableInfoIvrs0; |
913 | break; |
923 | break; |
914 | 924 | ||
915 | case ACPI_IVRS_TYPE_MEMORY1: |
925 | case ACPI_IVRS_TYPE_MEMORY1: |
916 | case ACPI_IVRS_TYPE_MEMORY2: |
926 | case ACPI_IVRS_TYPE_MEMORY2: |
917 | case ACPI_IVRS_TYPE_MEMORY3: |
927 | case ACPI_IVRS_TYPE_MEMORY3: |
918 | InfoTable = AcpiDmTableInfoIvrs1; |
928 | InfoTable = AcpiDmTableInfoIvrs1; |
919 | break; |
929 | break; |
920 | 930 | ||
921 | default: |
931 | default: |
922 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IVRS"); |
932 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IVRS"); |
923 | return (AE_ERROR); |
933 | return (AE_ERROR); |
924 | } |
934 | } |
925 | 935 | ||
926 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
936 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
927 | if (ACPI_FAILURE (Status)) |
937 | if (ACPI_FAILURE (Status)) |
928 | { |
938 | { |
929 | return (Status); |
939 | return (Status); |
930 | } |
940 | } |
931 | 941 | ||
932 | ParentTable = DtPeekSubtable (); |
942 | ParentTable = DtPeekSubtable (); |
933 | DtInsertSubtable (ParentTable, Subtable); |
943 | DtInsertSubtable (ParentTable, Subtable); |
934 | 944 | ||
935 | if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE) |
945 | if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE) |
936 | { |
946 | { |
937 | while (*PFieldList && |
947 | while (*PFieldList && |
938 | !ACPI_STRCMP ((*PFieldList)->Name, "Entry Type")) |
948 | !ACPI_STRCMP ((*PFieldList)->Name, "Entry Type")) |
939 | { |
949 | { |
940 | SubtableStart = *PFieldList; |
950 | SubtableStart = *PFieldList; |
941 | DtCompileInteger (&EntryType, *PFieldList, 1, 0); |
951 | DtCompileInteger (&EntryType, *PFieldList, 1, 0); |
942 | 952 | ||
943 | switch (EntryType) |
953 | switch (EntryType) |
944 | { |
954 | { |
945 | /* 4-byte device entries */ |
955 | /* 4-byte device entries */ |
946 | 956 | ||
947 | case ACPI_IVRS_TYPE_PAD4: |
957 | case ACPI_IVRS_TYPE_PAD4: |
948 | case ACPI_IVRS_TYPE_ALL: |
958 | case ACPI_IVRS_TYPE_ALL: |
949 | case ACPI_IVRS_TYPE_SELECT: |
959 | case ACPI_IVRS_TYPE_SELECT: |
950 | case ACPI_IVRS_TYPE_START: |
960 | case ACPI_IVRS_TYPE_START: |
951 | case ACPI_IVRS_TYPE_END: |
961 | case ACPI_IVRS_TYPE_END: |
952 | 962 | ||
953 | InfoTable = AcpiDmTableInfoIvrs4; |
963 | InfoTable = AcpiDmTableInfoIvrs4; |
954 | break; |
964 | break; |
955 | 965 | ||
956 | /* 8-byte entries, type A */ |
966 | /* 8-byte entries, type A */ |
957 | 967 | ||
958 | case ACPI_IVRS_TYPE_ALIAS_SELECT: |
968 | case ACPI_IVRS_TYPE_ALIAS_SELECT: |
959 | case ACPI_IVRS_TYPE_ALIAS_START: |
969 | case ACPI_IVRS_TYPE_ALIAS_START: |
960 | 970 | ||
961 | InfoTable = AcpiDmTableInfoIvrs8a; |
971 | InfoTable = AcpiDmTableInfoIvrs8a; |
962 | break; |
972 | break; |
963 | 973 | ||
964 | /* 8-byte entries, type B */ |
974 | /* 8-byte entries, type B */ |
965 | 975 | ||
966 | case ACPI_IVRS_TYPE_PAD8: |
976 | case ACPI_IVRS_TYPE_PAD8: |
967 | case ACPI_IVRS_TYPE_EXT_SELECT: |
977 | case ACPI_IVRS_TYPE_EXT_SELECT: |
968 | case ACPI_IVRS_TYPE_EXT_START: |
978 | case ACPI_IVRS_TYPE_EXT_START: |
969 | 979 | ||
970 | InfoTable = AcpiDmTableInfoIvrs8b; |
980 | InfoTable = AcpiDmTableInfoIvrs8b; |
971 | break; |
981 | break; |
972 | 982 | ||
973 | /* 8-byte entries, type C */ |
983 | /* 8-byte entries, type C */ |
974 | 984 | ||
975 | case ACPI_IVRS_TYPE_SPECIAL: |
985 | case ACPI_IVRS_TYPE_SPECIAL: |
976 | 986 | ||
977 | InfoTable = AcpiDmTableInfoIvrs8c; |
987 | InfoTable = AcpiDmTableInfoIvrs8c; |
978 | break; |
988 | break; |
979 | 989 | ||
980 | default: |
990 | default: |
981 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, |
991 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, |
982 | "IVRS Device Entry"); |
992 | "IVRS Device Entry"); |
983 | return (AE_ERROR); |
993 | return (AE_ERROR); |
984 | } |
994 | } |
985 | 995 | ||
986 | Status = DtCompileTable (PFieldList, InfoTable, |
996 | Status = DtCompileTable (PFieldList, InfoTable, |
987 | &Subtable, TRUE); |
997 | &Subtable, TRUE); |
988 | if (ACPI_FAILURE (Status)) |
998 | if (ACPI_FAILURE (Status)) |
989 | { |
999 | { |
990 | return (Status); |
1000 | return (Status); |
991 | } |
1001 | } |
992 | 1002 | ||
993 | DtInsertSubtable (ParentTable, Subtable); |
1003 | DtInsertSubtable (ParentTable, Subtable); |
994 | } |
1004 | } |
995 | } |
1005 | } |
996 | 1006 | ||
997 | DtPopSubtable (); |
1007 | DtPopSubtable (); |
998 | } |
1008 | } |
999 | 1009 | ||
1000 | return (AE_OK); |
1010 | return (AE_OK); |
1001 | } |
1011 | } |
1002 | 1012 | ||
1003 | 1013 | ||
1004 | /****************************************************************************** |
1014 | /****************************************************************************** |
1005 | * |
1015 | * |
1006 | * FUNCTION: DtCompileMadt |
1016 | * FUNCTION: DtCompileMadt |
1007 | * |
1017 | * |
1008 | * PARAMETERS: List - Current field list pointer |
1018 | * PARAMETERS: List - Current field list pointer |
1009 | * |
1019 | * |
1010 | * RETURN: Status |
1020 | * RETURN: Status |
1011 | * |
1021 | * |
1012 | * DESCRIPTION: Compile MADT. |
1022 | * DESCRIPTION: Compile MADT. |
1013 | * |
1023 | * |
1014 | *****************************************************************************/ |
1024 | *****************************************************************************/ |
1015 | 1025 | ||
1016 | ACPI_STATUS |
1026 | ACPI_STATUS |
1017 | DtCompileMadt ( |
1027 | DtCompileMadt ( |
1018 | void **List) |
1028 | void **List) |
1019 | { |
1029 | { |
1020 | ACPI_STATUS Status; |
1030 | ACPI_STATUS Status; |
1021 | DT_SUBTABLE *Subtable; |
1031 | DT_SUBTABLE *Subtable; |
1022 | DT_SUBTABLE *ParentTable; |
1032 | DT_SUBTABLE *ParentTable; |
1023 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
1033 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
1024 | DT_FIELD *SubtableStart; |
1034 | DT_FIELD *SubtableStart; |
1025 | ACPI_SUBTABLE_HEADER *MadtHeader; |
1035 | ACPI_SUBTABLE_HEADER *MadtHeader; |
1026 | ACPI_DMTABLE_INFO *InfoTable; |
1036 | ACPI_DMTABLE_INFO *InfoTable; |
1027 | 1037 | ||
1028 | 1038 | ||
1029 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadt, |
1039 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadt, |
1030 | &Subtable, TRUE); |
1040 | &Subtable, TRUE); |
1031 | if (ACPI_FAILURE (Status)) |
1041 | if (ACPI_FAILURE (Status)) |
1032 | { |
1042 | { |
1033 | return (Status); |
1043 | return (Status); |
1034 | } |
1044 | } |
1035 | 1045 | ||
1036 | ParentTable = DtPeekSubtable (); |
1046 | ParentTable = DtPeekSubtable (); |
1037 | DtInsertSubtable (ParentTable, Subtable); |
1047 | DtInsertSubtable (ParentTable, Subtable); |
1038 | 1048 | ||
1039 | while (*PFieldList) |
1049 | while (*PFieldList) |
1040 | { |
1050 | { |
1041 | SubtableStart = *PFieldList; |
1051 | SubtableStart = *PFieldList; |
1042 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadtHdr, |
1052 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadtHdr, |
1043 | &Subtable, TRUE); |
1053 | &Subtable, TRUE); |
1044 | if (ACPI_FAILURE (Status)) |
1054 | if (ACPI_FAILURE (Status)) |
1045 | { |
1055 | { |
1046 | return (Status); |
1056 | return (Status); |
1047 | } |
1057 | } |
1048 | 1058 | ||
1049 | ParentTable = DtPeekSubtable (); |
1059 | ParentTable = DtPeekSubtable (); |
1050 | DtInsertSubtable (ParentTable, Subtable); |
1060 | DtInsertSubtable (ParentTable, Subtable); |
1051 | DtPushSubtable (Subtable); |
1061 | DtPushSubtable (Subtable); |
1052 | 1062 | ||
1053 | MadtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer); |
1063 | MadtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer); |
1054 | 1064 | ||
1055 | switch (MadtHeader->Type) |
1065 | switch (MadtHeader->Type) |
1056 | { |
1066 | { |
1057 | case ACPI_MADT_TYPE_LOCAL_APIC: |
1067 | case ACPI_MADT_TYPE_LOCAL_APIC: |
1058 | InfoTable = AcpiDmTableInfoMadt0; |
1068 | InfoTable = AcpiDmTableInfoMadt0; |
1059 | break; |
1069 | break; |
1060 | case ACPI_MADT_TYPE_IO_APIC: |
1070 | case ACPI_MADT_TYPE_IO_APIC: |
1061 | InfoTable = AcpiDmTableInfoMadt1; |
1071 | InfoTable = AcpiDmTableInfoMadt1; |
1062 | break; |
1072 | break; |
1063 | case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE: |
1073 | case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE: |
1064 | InfoTable = AcpiDmTableInfoMadt2; |
1074 | InfoTable = AcpiDmTableInfoMadt2; |
1065 | break; |
1075 | break; |
1066 | case ACPI_MADT_TYPE_NMI_SOURCE: |
1076 | case ACPI_MADT_TYPE_NMI_SOURCE: |
1067 | InfoTable = AcpiDmTableInfoMadt3; |
1077 | InfoTable = AcpiDmTableInfoMadt3; |
1068 | break; |
1078 | break; |
1069 | case ACPI_MADT_TYPE_LOCAL_APIC_NMI: |
1079 | case ACPI_MADT_TYPE_LOCAL_APIC_NMI: |
1070 | InfoTable = AcpiDmTableInfoMadt4; |
1080 | InfoTable = AcpiDmTableInfoMadt4; |
1071 | break; |
1081 | break; |
1072 | case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: |
1082 | case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: |
1073 | InfoTable = AcpiDmTableInfoMadt5; |
1083 | InfoTable = AcpiDmTableInfoMadt5; |
1074 | break; |
1084 | break; |
1075 | case ACPI_MADT_TYPE_IO_SAPIC: |
1085 | case ACPI_MADT_TYPE_IO_SAPIC: |
1076 | InfoTable = AcpiDmTableInfoMadt6; |
1086 | InfoTable = AcpiDmTableInfoMadt6; |
1077 | break; |
1087 | break; |
1078 | case ACPI_MADT_TYPE_LOCAL_SAPIC: |
1088 | case ACPI_MADT_TYPE_LOCAL_SAPIC: |
1079 | InfoTable = AcpiDmTableInfoMadt7; |
1089 | InfoTable = AcpiDmTableInfoMadt7; |
1080 | break; |
1090 | break; |
1081 | case ACPI_MADT_TYPE_INTERRUPT_SOURCE: |
1091 | case ACPI_MADT_TYPE_INTERRUPT_SOURCE: |
1082 | InfoTable = AcpiDmTableInfoMadt8; |
1092 | InfoTable = AcpiDmTableInfoMadt8; |
1083 | break; |
1093 | break; |
1084 | case ACPI_MADT_TYPE_LOCAL_X2APIC: |
1094 | case ACPI_MADT_TYPE_LOCAL_X2APIC: |
1085 | InfoTable = AcpiDmTableInfoMadt9; |
1095 | InfoTable = AcpiDmTableInfoMadt9; |
1086 | break; |
1096 | break; |
1087 | case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI: |
1097 | case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI: |
1088 | InfoTable = AcpiDmTableInfoMadt10; |
1098 | InfoTable = AcpiDmTableInfoMadt10; |
1089 | break; |
1099 | break; |
1090 | default: |
1100 | default: |
1091 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT"); |
1101 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT"); |
1092 | return (AE_ERROR); |
1102 | return (AE_ERROR); |
1093 | } |
1103 | } |
1094 | 1104 | ||
1095 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
1105 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
1096 | if (ACPI_FAILURE (Status)) |
1106 | if (ACPI_FAILURE (Status)) |
1097 | { |
1107 | { |
1098 | return (Status); |
1108 | return (Status); |
1099 | } |
1109 | } |
1100 | 1110 | ||
1101 | ParentTable = DtPeekSubtable (); |
1111 | ParentTable = DtPeekSubtable (); |
1102 | DtInsertSubtable (ParentTable, Subtable); |
1112 | DtInsertSubtable (ParentTable, Subtable); |
1103 | DtPopSubtable (); |
1113 | DtPopSubtable (); |
1104 | } |
1114 | } |
1105 | 1115 | ||
1106 | return (AE_OK); |
1116 | return (AE_OK); |
1107 | } |
1117 | } |
1108 | 1118 | ||
1109 | 1119 | ||
1110 | /****************************************************************************** |
1120 | /****************************************************************************** |
1111 | * |
1121 | * |
1112 | * FUNCTION: DtCompileMcfg |
1122 | * FUNCTION: DtCompileMcfg |
1113 | * |
1123 | * |
1114 | * PARAMETERS: List - Current field list pointer |
1124 | * PARAMETERS: List - Current field list pointer |
1115 | * |
1125 | * |
1116 | * RETURN: Status |
1126 | * RETURN: Status |
1117 | * |
1127 | * |
1118 | * DESCRIPTION: Compile MCFG. |
1128 | * DESCRIPTION: Compile MCFG. |
1119 | * |
1129 | * |
1120 | *****************************************************************************/ |
1130 | *****************************************************************************/ |
1121 | 1131 | ||
1122 | ACPI_STATUS |
1132 | ACPI_STATUS |
1123 | DtCompileMcfg ( |
1133 | DtCompileMcfg ( |
1124 | void **List) |
1134 | void **List) |
1125 | { |
1135 | { |
1126 | ACPI_STATUS Status; |
1136 | ACPI_STATUS Status; |
1127 | 1137 | ||
1128 | 1138 | ||
1129 | Status = DtCompileTwoSubtables (List, |
1139 | Status = DtCompileTwoSubtables (List, |
1130 | AcpiDmTableInfoMcfg, AcpiDmTableInfoMcfg0); |
1140 | AcpiDmTableInfoMcfg, AcpiDmTableInfoMcfg0); |
1131 | return (Status); |
1141 | return (Status); |
1132 | } |
1142 | } |
1133 | 1143 | ||
1134 | 1144 | ||
1135 | /****************************************************************************** |
1145 | /****************************************************************************** |
1136 | * |
1146 | * |
1137 | * FUNCTION: DtCompileMsct |
1147 | * FUNCTION: DtCompileMsct |
1138 | * |
1148 | * |
1139 | * PARAMETERS: List - Current field list pointer |
1149 | * PARAMETERS: List - Current field list pointer |
1140 | * |
1150 | * |
1141 | * RETURN: Status |
1151 | * RETURN: Status |
1142 | * |
1152 | * |
1143 | * DESCRIPTION: Compile MSCT. |
1153 | * DESCRIPTION: Compile MSCT. |
1144 | * |
1154 | * |
1145 | *****************************************************************************/ |
1155 | *****************************************************************************/ |
1146 | 1156 | ||
1147 | ACPI_STATUS |
1157 | ACPI_STATUS |
1148 | DtCompileMsct ( |
1158 | DtCompileMsct ( |
1149 | void **List) |
1159 | void **List) |
1150 | { |
1160 | { |
1151 | ACPI_STATUS Status; |
1161 | ACPI_STATUS Status; |
1152 | 1162 | ||
1153 | 1163 | ||
1154 | Status = DtCompileTwoSubtables (List, |
1164 | Status = DtCompileTwoSubtables (List, |
1155 | AcpiDmTableInfoMsct, AcpiDmTableInfoMsct0); |
1165 | AcpiDmTableInfoMsct, AcpiDmTableInfoMsct0); |
1156 | return (Status); |
1166 | return (Status); |
1157 | } |
1167 | } |
1158 | 1168 | ||
1159 | 1169 | ||
1160 | /****************************************************************************** |
1170 | /****************************************************************************** |
1161 | * |
1171 | * |
1162 | * FUNCTION: DtCompileRsdt |
1172 | * FUNCTION: DtCompileRsdt |
1163 | * |
1173 | * |
1164 | * PARAMETERS: List - Current field list pointer |
1174 | * PARAMETERS: List - Current field list pointer |
1165 | * |
1175 | * |
1166 | * RETURN: Status |
1176 | * RETURN: Status |
1167 | * |
1177 | * |
1168 | * DESCRIPTION: Compile RSDT. |
1178 | * DESCRIPTION: Compile RSDT. |
1169 | * |
1179 | * |
1170 | *****************************************************************************/ |
1180 | *****************************************************************************/ |
1171 | 1181 | ||
1172 | ACPI_STATUS |
1182 | ACPI_STATUS |
1173 | DtCompileRsdt ( |
1183 | DtCompileRsdt ( |
1174 | void **List) |
1184 | void **List) |
1175 | { |
1185 | { |
1176 | DT_SUBTABLE *Subtable; |
1186 | DT_SUBTABLE *Subtable; |
1177 | DT_SUBTABLE *ParentTable; |
1187 | DT_SUBTABLE *ParentTable; |
1178 | DT_FIELD *FieldList = *(DT_FIELD **) List; |
1188 | DT_FIELD *FieldList = *(DT_FIELD **) List; |
1179 | UINT32 Address; |
1189 | UINT32 Address; |
1180 | 1190 | ||
1181 | 1191 | ||
1182 | ParentTable = DtPeekSubtable (); |
1192 | ParentTable = DtPeekSubtable (); |
1183 | 1193 | ||
1184 | while (FieldList) |
1194 | while (FieldList) |
1185 | { |
1195 | { |
1186 | DtCompileInteger ((UINT8 *) &Address, FieldList, 4, DT_NON_ZERO); |
1196 | DtCompileInteger ((UINT8 *) &Address, FieldList, 4, DT_NON_ZERO); |
1187 | 1197 | ||
1188 | DtCreateSubtable ((UINT8 *) &Address, 4, &Subtable); |
1198 | DtCreateSubtable ((UINT8 *) &Address, 4, &Subtable); |
1189 | DtInsertSubtable (ParentTable, Subtable); |
1199 | DtInsertSubtable (ParentTable, Subtable); |
1190 | FieldList = FieldList->Next; |
1200 | FieldList = FieldList->Next; |
1191 | } |
1201 | } |
1192 | 1202 | ||
1193 | return (AE_OK); |
1203 | return (AE_OK); |
1194 | } |
1204 | } |
1195 | 1205 | ||
1196 | 1206 | ||
1197 | /****************************************************************************** |
1207 | /****************************************************************************** |
1198 | * |
1208 | * |
- | 1209 | * FUNCTION: DtCompileSlic |
|
- | 1210 | * |
|
- | 1211 | * PARAMETERS: List - Current field list pointer |
|
- | 1212 | * |
|
- | 1213 | * RETURN: Status |
|
- | 1214 | * |
|
- | 1215 | * DESCRIPTION: Compile SLIC. |
|
- | 1216 | * |
|
- | 1217 | *****************************************************************************/ |
|
- | 1218 | ||
- | 1219 | ACPI_STATUS |
|
- | 1220 | DtCompileSlic ( |
|
- | 1221 | void **List) |
|
- | 1222 | { |
|
- | 1223 | ACPI_STATUS Status; |
|
- | 1224 | DT_SUBTABLE *Subtable; |
|
- | 1225 | DT_SUBTABLE *ParentTable; |
|
- | 1226 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
|
- | 1227 | DT_FIELD *SubtableStart; |
|
- | 1228 | ACPI_SLIC_HEADER *SlicHeader; |
|
- | 1229 | ACPI_DMTABLE_INFO *InfoTable; |
|
- | 1230 | ||
- | 1231 | ||
- | 1232 | while (*PFieldList) |
|
- | 1233 | { |
|
- | 1234 | SubtableStart = *PFieldList; |
|
- | 1235 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlicHdr, |
|
- | 1236 | &Subtable, TRUE); |
|
- | 1237 | if (ACPI_FAILURE (Status)) |
|
- | 1238 | { |
|
- | 1239 | return (Status); |
|
- | 1240 | } |
|
- | 1241 | ||
- | 1242 | ParentTable = DtPeekSubtable (); |
|
- | 1243 | DtInsertSubtable (ParentTable, Subtable); |
|
- | 1244 | DtPushSubtable (Subtable); |
|
- | 1245 | ||
- | 1246 | SlicHeader = ACPI_CAST_PTR (ACPI_SLIC_HEADER, Subtable->Buffer); |
|
- | 1247 | ||
- | 1248 | switch (SlicHeader->Type) |
|
- | 1249 | { |
|
- | 1250 | case ACPI_SLIC_TYPE_PUBLIC_KEY: |
|
- | 1251 | InfoTable = AcpiDmTableInfoSlic0; |
|
- | 1252 | break; |
|
- | 1253 | case ACPI_SLIC_TYPE_WINDOWS_MARKER: |
|
- | 1254 | InfoTable = AcpiDmTableInfoSlic1; |
|
- | 1255 | break; |
|
- | 1256 | default: |
|
- | 1257 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SLIC"); |
|
- | 1258 | return (AE_ERROR); |
|
- | 1259 | } |
|
- | 1260 | ||
- | 1261 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
|
- | 1262 | if (ACPI_FAILURE (Status)) |
|
- | 1263 | { |
|
- | 1264 | return (Status); |
|
- | 1265 | } |
|
- | 1266 | ||
- | 1267 | ParentTable = DtPeekSubtable (); |
|
- | 1268 | DtInsertSubtable (ParentTable, Subtable); |
|
- | 1269 | DtPopSubtable (); |
|
- | 1270 | } |
|
- | 1271 | ||
- | 1272 | return (AE_OK); |
|
- | 1273 | } |
|
- | 1274 | ||
- | 1275 | ||
- | 1276 | /****************************************************************************** |
|
- | 1277 | * |
|
1199 | * FUNCTION: DtCompileSlit |
1278 | * FUNCTION: DtCompileSlit |
1200 | * |
1279 | * |
1201 | * PARAMETERS: List - Current field list pointer |
1280 | * PARAMETERS: List - Current field list pointer |
1202 | * |
1281 | * |
1203 | * RETURN: Status |
1282 | * RETURN: Status |
1204 | * |
1283 | * |
1205 | * DESCRIPTION: Compile SLIT. |
1284 | * DESCRIPTION: Compile SLIT. |
1206 | * |
1285 | * |
1207 | *****************************************************************************/ |
1286 | *****************************************************************************/ |
1208 | 1287 | ||
1209 | ACPI_STATUS |
1288 | ACPI_STATUS |
1210 | DtCompileSlit ( |
1289 | DtCompileSlit ( |
1211 | void **List) |
1290 | void **List) |
1212 | { |
1291 | { |
1213 | ACPI_STATUS Status; |
1292 | ACPI_STATUS Status; |
1214 | DT_SUBTABLE *Subtable; |
1293 | DT_SUBTABLE *Subtable; |
1215 | DT_SUBTABLE *ParentTable; |
1294 | DT_SUBTABLE *ParentTable; |
1216 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
1295 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
1217 | DT_FIELD *FieldList; |
1296 | DT_FIELD *FieldList; |
1218 | UINT32 Localities; |
1297 | UINT32 Localities; |
1219 | UINT8 *LocalityBuffer; |
1298 | UINT8 *LocalityBuffer; |
1220 | UINT32 RemainingData; |
- | |
1221 | 1299 | ||
1222 | 1300 | ||
1223 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit, |
1301 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit, |
1224 | &Subtable, TRUE); |
1302 | &Subtable, TRUE); |
1225 | if (ACPI_FAILURE (Status)) |
1303 | if (ACPI_FAILURE (Status)) |
1226 | { |
1304 | { |
1227 | return (Status); |
1305 | return (Status); |
1228 | } |
1306 | } |
1229 | 1307 | ||
1230 | ParentTable = DtPeekSubtable (); |
1308 | ParentTable = DtPeekSubtable (); |
1231 | DtInsertSubtable (ParentTable, Subtable); |
1309 | DtInsertSubtable (ParentTable, Subtable); |
1232 | 1310 | ||
1233 | Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer); |
1311 | Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer); |
1234 | LocalityBuffer = UtLocalCalloc (Localities); |
1312 | LocalityBuffer = UtLocalCalloc (Localities); |
- | 1313 | ||
- | 1314 | /* Compile each locality buffer */ |
|
1235 | 1315 | ||
1236 | FieldList = *PFieldList; |
1316 | FieldList = *PFieldList; |
1237 | while (FieldList) |
1317 | while (FieldList) |
1238 | { |
1318 | { |
1239 | /* Handle multiple-line buffer */ |
- | |
1240 | - | ||
1241 | RemainingData = Localities; |
1319 | DtCompileBuffer (LocalityBuffer, |
1242 | while (RemainingData && FieldList) |
- | |
1243 | { |
- | |
1244 | RemainingData = DtCompileBuffer ( |
- | |
1245 | LocalityBuffer + (Localities - RemainingData), |
- | |
1246 | FieldList->Value, FieldList, RemainingData); |
1320 | FieldList->Value, FieldList, Localities); |
1247 | FieldList = FieldList->Next; |
- | |
1248 | } |
- | |
1249 | 1321 | ||
1250 | DtCreateSubtable (LocalityBuffer, Localities, &Subtable); |
1322 | DtCreateSubtable (LocalityBuffer, Localities, &Subtable); |
1251 | DtInsertSubtable (ParentTable, Subtable); |
1323 | DtInsertSubtable (ParentTable, Subtable); |
- | 1324 | FieldList = FieldList->Next; |
|
1252 | } |
1325 | } |
1253 | 1326 | ||
1254 | ACPI_FREE (LocalityBuffer); |
1327 | ACPI_FREE (LocalityBuffer); |
1255 | return (AE_OK); |
1328 | return (AE_OK); |
1256 | } |
1329 | } |
1257 | 1330 | ||
1258 | 1331 | ||
1259 | /****************************************************************************** |
1332 | /****************************************************************************** |
1260 | * |
1333 | * |
1261 | * FUNCTION: DtCompileSrat |
1334 | * FUNCTION: DtCompileSrat |
1262 | * |
1335 | * |
1263 | * PARAMETERS: List - Current field list pointer |
1336 | * PARAMETERS: List - Current field list pointer |
1264 | * |
1337 | * |
1265 | * RETURN: Status |
1338 | * RETURN: Status |
1266 | * |
1339 | * |
1267 | * DESCRIPTION: Compile SRAT. |
1340 | * DESCRIPTION: Compile SRAT. |
1268 | * |
1341 | * |
1269 | *****************************************************************************/ |
1342 | *****************************************************************************/ |
1270 | 1343 | ||
1271 | ACPI_STATUS |
1344 | ACPI_STATUS |
1272 | DtCompileSrat ( |
1345 | DtCompileSrat ( |
1273 | void **List) |
1346 | void **List) |
1274 | { |
1347 | { |
1275 | ACPI_STATUS Status; |
1348 | ACPI_STATUS Status; |
1276 | DT_SUBTABLE *Subtable; |
1349 | DT_SUBTABLE *Subtable; |
1277 | DT_SUBTABLE *ParentTable; |
1350 | DT_SUBTABLE *ParentTable; |
1278 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
1351 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
1279 | DT_FIELD *SubtableStart; |
1352 | DT_FIELD *SubtableStart; |
1280 | ACPI_SUBTABLE_HEADER *SratHeader; |
1353 | ACPI_SUBTABLE_HEADER *SratHeader; |
1281 | ACPI_DMTABLE_INFO *InfoTable; |
1354 | ACPI_DMTABLE_INFO *InfoTable; |
1282 | 1355 | ||
1283 | 1356 | ||
1284 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoSrat, |
1357 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoSrat, |
1285 | &Subtable, TRUE); |
1358 | &Subtable, TRUE); |
1286 | if (ACPI_FAILURE (Status)) |
1359 | if (ACPI_FAILURE (Status)) |
1287 | { |
1360 | { |
1288 | return (Status); |
1361 | return (Status); |
1289 | } |
1362 | } |
1290 | 1363 | ||
1291 | ParentTable = DtPeekSubtable (); |
1364 | ParentTable = DtPeekSubtable (); |
1292 | DtInsertSubtable (ParentTable, Subtable); |
1365 | DtInsertSubtable (ParentTable, Subtable); |
1293 | 1366 | ||
1294 | while (*PFieldList) |
1367 | while (*PFieldList) |
1295 | { |
1368 | { |
1296 | SubtableStart = *PFieldList; |
1369 | SubtableStart = *PFieldList; |
1297 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoSratHdr, |
1370 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoSratHdr, |
1298 | &Subtable, TRUE); |
1371 | &Subtable, TRUE); |
1299 | if (ACPI_FAILURE (Status)) |
1372 | if (ACPI_FAILURE (Status)) |
1300 | { |
1373 | { |
1301 | return (Status); |
1374 | return (Status); |
1302 | } |
1375 | } |
1303 | 1376 | ||
1304 | ParentTable = DtPeekSubtable (); |
1377 | ParentTable = DtPeekSubtable (); |
1305 | DtInsertSubtable (ParentTable, Subtable); |
1378 | DtInsertSubtable (ParentTable, Subtable); |
1306 | DtPushSubtable (Subtable); |
1379 | DtPushSubtable (Subtable); |
1307 | 1380 | ||
1308 | SratHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer); |
1381 | SratHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer); |
1309 | 1382 | ||
1310 | switch (SratHeader->Type) |
1383 | switch (SratHeader->Type) |
1311 | { |
1384 | { |
1312 | case ACPI_SRAT_TYPE_CPU_AFFINITY: |
1385 | case ACPI_SRAT_TYPE_CPU_AFFINITY: |
1313 | InfoTable = AcpiDmTableInfoSrat0; |
1386 | InfoTable = AcpiDmTableInfoSrat0; |
1314 | break; |
1387 | break; |
1315 | case ACPI_SRAT_TYPE_MEMORY_AFFINITY: |
1388 | case ACPI_SRAT_TYPE_MEMORY_AFFINITY: |
1316 | InfoTable = AcpiDmTableInfoSrat1; |
1389 | InfoTable = AcpiDmTableInfoSrat1; |
1317 | break; |
1390 | break; |
1318 | case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY: |
1391 | case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY: |
1319 | InfoTable = AcpiDmTableInfoSrat2; |
1392 | InfoTable = AcpiDmTableInfoSrat2; |
1320 | break; |
1393 | break; |
1321 | default: |
1394 | default: |
1322 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT"); |
1395 | DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT"); |
1323 | return (AE_ERROR); |
1396 | return (AE_ERROR); |
1324 | } |
1397 | } |
1325 | 1398 | ||
1326 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
1399 | Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE); |
1327 | if (ACPI_FAILURE (Status)) |
1400 | if (ACPI_FAILURE (Status)) |
1328 | { |
1401 | { |
1329 | return (Status); |
1402 | return (Status); |
1330 | } |
1403 | } |
1331 | 1404 | ||
1332 | ParentTable = DtPeekSubtable (); |
1405 | ParentTable = DtPeekSubtable (); |
1333 | DtInsertSubtable (ParentTable, Subtable); |
1406 | DtInsertSubtable (ParentTable, Subtable); |
1334 | DtPopSubtable (); |
1407 | DtPopSubtable (); |
1335 | } |
1408 | } |
1336 | 1409 | ||
1337 | return (AE_OK); |
1410 | return (AE_OK); |
1338 | } |
1411 | } |
1339 | 1412 | ||
1340 | 1413 | ||
1341 | /****************************************************************************** |
1414 | /****************************************************************************** |
1342 | * |
1415 | * |
- | 1416 | * FUNCTION: DtGetGenericTableInfo |
|
- | 1417 | * |
|
- | 1418 | * PARAMETERS: Name - Generic type name |
|
- | 1419 | * |
|
- | 1420 | * RETURN: Info entry |
|
- | 1421 | * |
|
- | 1422 | * DESCRIPTION: Obtain table info for a generic name entry |
|
- | 1423 | * |
|
- | 1424 | *****************************************************************************/ |
|
- | 1425 | ||
- | 1426 | ACPI_DMTABLE_INFO * |
|
- | 1427 | DtGetGenericTableInfo ( |
|
- | 1428 | char *Name) |
|
- | 1429 | { |
|
- | 1430 | ACPI_DMTABLE_INFO *Info; |
|
- | 1431 | UINT32 i; |
|
- | 1432 | ||
- | 1433 | ||
- | 1434 | if (!Name) |
|
- | 1435 | { |
|
- | 1436 | return (NULL); |
|
- | 1437 | } |
|
- | 1438 | ||
- | 1439 | /* Search info table for name match */ |
|
- | 1440 | ||
- | 1441 | for (i = 0; ; i++) |
|
- | 1442 | { |
|
- | 1443 | Info = AcpiDmTableInfoGeneric[i]; |
|
- | 1444 | if (Info->Opcode == ACPI_DMT_EXIT) |
|
- | 1445 | { |
|
- | 1446 | Info = NULL; |
|
- | 1447 | break; |
|
- | 1448 | } |
|
- | 1449 | ||
- | 1450 | if (!ACPI_STRCMP (Name, Info->Name)) |
|
- | 1451 | { |
|
- | 1452 | break; |
|
- | 1453 | } |
|
- | 1454 | } |
|
- | 1455 | ||
- | 1456 | return (Info); |
|
- | 1457 | } |
|
- | 1458 | ||
- | 1459 | ||
- | 1460 | /****************************************************************************** |
|
- | 1461 | * |
|
- | 1462 | * FUNCTION: DtCompileUefi |
|
- | 1463 | * |
|
- | 1464 | * PARAMETERS: List - Current field list pointer |
|
- | 1465 | * |
|
- | 1466 | * RETURN: Status |
|
- | 1467 | * |
|
- | 1468 | * DESCRIPTION: Compile UEFI. |
|
- | 1469 | * |
|
- | 1470 | *****************************************************************************/ |
|
- | 1471 | ||
- | 1472 | ACPI_STATUS |
|
- | 1473 | DtCompileUefi ( |
|
- | 1474 | void **List) |
|
- | 1475 | { |
|
- | 1476 | ACPI_STATUS Status; |
|
- | 1477 | DT_SUBTABLE *Subtable; |
|
- | 1478 | DT_SUBTABLE *ParentTable; |
|
- | 1479 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
|
- | 1480 | UINT16 *DataOffset; |
|
- | 1481 | ||
- | 1482 | ||
- | 1483 | /* Compile the predefined portion of the UEFI table */ |
|
- | 1484 | ||
- | 1485 | Status = DtCompileTable (PFieldList, AcpiDmTableInfoUefi, |
|
- | 1486 | &Subtable, TRUE); |
|
- | 1487 | if (ACPI_FAILURE (Status)) |
|
- | 1488 | { |
|
- | 1489 | return (Status); |
|
- | 1490 | } |
|
- | 1491 | ||
- | 1492 | DataOffset = (UINT16 *) (Subtable->Buffer + 16); |
|
- | 1493 | *DataOffset = sizeof (ACPI_TABLE_UEFI); |
|
- | 1494 | ||
- | 1495 | ParentTable = DtPeekSubtable (); |
|
- | 1496 | DtInsertSubtable (ParentTable, Subtable); |
|
- | 1497 | ||
- | 1498 | /* |
|
- | 1499 | * Compile the "generic" portion of the UEFI table. This |
|
- | 1500 | * part of the table is not predefined and any of the generic |
|
- | 1501 | * operators may be used. |
|
- | 1502 | */ |
|
- | 1503 | ||
- | 1504 | DtCompileGeneric ((void **) PFieldList); |
|
- | 1505 | ||
- | 1506 | return (AE_OK); |
|
- | 1507 | } |
|
- | 1508 | ||
- | 1509 | ||
- | 1510 | /****************************************************************************** |
|
- | 1511 | * |
|
1343 | * FUNCTION: DtCompileWdat |
1512 | * FUNCTION: DtCompileWdat |
1344 | * |
1513 | * |
1345 | * PARAMETERS: List - Current field list pointer |
1514 | * PARAMETERS: List - Current field list pointer |
1346 | * |
1515 | * |
1347 | * RETURN: Status |
1516 | * RETURN: Status |
1348 | * |
1517 | * |
1349 | * DESCRIPTION: Compile WDAT. |
1518 | * DESCRIPTION: Compile WDAT. |
1350 | * |
1519 | * |
1351 | *****************************************************************************/ |
1520 | *****************************************************************************/ |
1352 | 1521 | ||
1353 | ACPI_STATUS |
1522 | ACPI_STATUS |
1354 | DtCompileWdat ( |
1523 | DtCompileWdat ( |
1355 | void **List) |
1524 | void **List) |
1356 | { |
1525 | { |
1357 | ACPI_STATUS Status; |
1526 | ACPI_STATUS Status; |
1358 | 1527 | ||
1359 | 1528 | ||
1360 | Status = DtCompileTwoSubtables (List, |
1529 | Status = DtCompileTwoSubtables (List, |
1361 | AcpiDmTableInfoWdat, AcpiDmTableInfoWdat0); |
1530 | AcpiDmTableInfoWdat, AcpiDmTableInfoWdat0); |
1362 | return (Status); |
1531 | return (Status); |
1363 | } |
1532 | } |
1364 | 1533 | ||
1365 | 1534 | ||
1366 | /****************************************************************************** |
1535 | /****************************************************************************** |
1367 | * |
1536 | * |
1368 | * FUNCTION: DtCompileXsdt |
1537 | * FUNCTION: DtCompileXsdt |
1369 | * |
1538 | * |
1370 | * PARAMETERS: List - Current field list pointer |
1539 | * PARAMETERS: List - Current field list pointer |
1371 | * |
1540 | * |
1372 | * RETURN: Status |
1541 | * RETURN: Status |
1373 | * |
1542 | * |
1374 | * DESCRIPTION: Compile XSDT. |
1543 | * DESCRIPTION: Compile XSDT. |
1375 | * |
1544 | * |
1376 | *****************************************************************************/ |
1545 | *****************************************************************************/ |
1377 | 1546 | ||
1378 | ACPI_STATUS |
1547 | ACPI_STATUS |
1379 | DtCompileXsdt ( |
1548 | DtCompileXsdt ( |
1380 | void **List) |
1549 | void **List) |
1381 | { |
1550 | { |
1382 | DT_SUBTABLE *Subtable; |
1551 | DT_SUBTABLE *Subtable; |
1383 | DT_SUBTABLE *ParentTable; |
1552 | DT_SUBTABLE *ParentTable; |
1384 | DT_FIELD *FieldList = *(DT_FIELD **) List; |
1553 | DT_FIELD *FieldList = *(DT_FIELD **) List; |
1385 | UINT64 Address; |
1554 | UINT64 Address; |
1386 | 1555 | ||
1387 | ParentTable = DtPeekSubtable (); |
1556 | ParentTable = DtPeekSubtable (); |
1388 | 1557 | ||
1389 | while (FieldList) |
1558 | while (FieldList) |
1390 | { |
1559 | { |
1391 | DtCompileInteger ((UINT8 *) &Address, FieldList, 8, DT_NON_ZERO); |
1560 | DtCompileInteger ((UINT8 *) &Address, FieldList, 8, DT_NON_ZERO); |
1392 | 1561 | ||
1393 | DtCreateSubtable ((UINT8 *) &Address, 8, &Subtable); |
1562 | DtCreateSubtable ((UINT8 *) &Address, 8, &Subtable); |
1394 | DtInsertSubtable (ParentTable, Subtable); |
1563 | DtInsertSubtable (ParentTable, Subtable); |
1395 | FieldList = FieldList->Next; |
1564 | FieldList = FieldList->Next; |
1396 | } |
1565 | } |
- | 1566 | ||
- | 1567 | return (AE_OK); |
|
- | 1568 | } |
|
- | 1569 | ||
- | 1570 | ||
- | 1571 | /****************************************************************************** |
|
- | 1572 | * |
|
- | 1573 | * FUNCTION: DtCompileGeneric |
|
- | 1574 | * |
|
- | 1575 | * PARAMETERS: List - Current field list pointer |
|
- | 1576 | * |
|
- | 1577 | * RETURN: Status |
|
- | 1578 | * |
|
- | 1579 | * DESCRIPTION: Compile generic unknown table. |
|
- | 1580 | * |
|
- | 1581 | *****************************************************************************/ |
|
- | 1582 | ||
- | 1583 | ACPI_STATUS |
|
- | 1584 | DtCompileGeneric ( |
|
- | 1585 | void **List) |
|
- | 1586 | { |
|
- | 1587 | ACPI_STATUS Status; |
|
- | 1588 | DT_SUBTABLE *Subtable; |
|
- | 1589 | DT_SUBTABLE *ParentTable; |
|
- | 1590 | DT_FIELD **PFieldList = (DT_FIELD **) List; |
|
- | 1591 | ACPI_DMTABLE_INFO *Info; |
|
- | 1592 | ||
- | 1593 | ||
- | 1594 | ParentTable = DtPeekSubtable (); |
|
- | 1595 | ||
- | 1596 | /* |
|
- | 1597 | * Compile the "generic" portion of the table. This |
|
- | 1598 | * part of the table is not predefined and any of the generic |
|
- | 1599 | * operators may be used. |
|
- | 1600 | */ |
|
- | 1601 | ||
- | 1602 | /* Find any and all labels in the entire generic portion */ |
|
- | 1603 | ||
- | 1604 | DtDetectAllLabels (*PFieldList); |
|
- | 1605 | ||
- | 1606 | /* Now we can actually compile the parse tree */ |
|
- | 1607 | ||
- | 1608 | while (*PFieldList) |
|
- | 1609 | { |
|
- | 1610 | Info = DtGetGenericTableInfo ((*PFieldList)->Name); |
|
- | 1611 | if (!Info) |
|
- | 1612 | { |
|
- | 1613 | sprintf (MsgBuffer, "Generic data type \"%s\" not found", |
|
- | 1614 | (*PFieldList)->Name); |
|
- | 1615 | DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, |
|
- | 1616 | (*PFieldList), MsgBuffer); |
|
- | 1617 | ||
- | 1618 | *PFieldList = (*PFieldList)->Next; |
|
- | 1619 | continue; |
|
- | 1620 | } |
|
- | 1621 | ||
- | 1622 | Status = DtCompileTable (PFieldList, Info, |
|
- | 1623 | &Subtable, TRUE); |
|
- | 1624 | if (ACPI_SUCCESS (Status)) |
|
- | 1625 | { |
|
- | 1626 | DtInsertSubtable (ParentTable, Subtable); |
|
- | 1627 | } |
|
- | 1628 | else |
|
- | 1629 | { |
|
- | 1630 | *PFieldList = (*PFieldList)->Next; |
|
- | 1631 | ||
- | 1632 | if (Status == AE_NOT_FOUND) |
|
- | 1633 | { |
|
- | 1634 | sprintf (MsgBuffer, "Generic data type \"%s\" not found", |
|
- | 1635 | (*PFieldList)->Name); |
|
- | 1636 | DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME, |
|
- | 1637 | (*PFieldList), MsgBuffer); |
|
- | 1638 | } |
|
- | 1639 | } |
|
- | 1640 | } |
|
1397 | 1641 | ||
1398 | return (AE_OK); |
1642 | return (AE_OK); |
1399 | }> |
1643 | }> |