]>
Commit | Line | Data |
---|---|---|
a6eaba4d | 1 | /** @file\r |
ee4dc24f RN |
2 | Header file for ACPI parser\r |
3 | \r | |
d4d2fdf2 | 4 | Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.\r |
ee4dc24f RN |
5 | This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | **/\r | |
13 | \r | |
14 | #ifndef ACPIPARSER_H_\r | |
15 | #define ACPIPARSER_H_\r | |
16 | \r | |
17 | #define OUTPUT_FIELD_COLUMN_WIDTH 36\r | |
18 | \r | |
19 | /// The RSDP table signature is "RSD PTR " (8 bytes)\r | |
20 | /// However The signature for ACPI tables is 4 bytes.\r | |
21 | /// To work around this oddity define a signature type\r | |
22 | /// that allows us to process the log options.\r | |
23 | #define RSDP_TABLE_INFO SIGNATURE_32('R', 'S', 'D', 'P')\r | |
24 | \r | |
a6eaba4d DB |
25 | /**\r |
26 | This function increments the ACPI table error counter.\r | |
27 | **/\r | |
ee4dc24f RN |
28 | VOID\r |
29 | EFIAPI\r | |
30 | IncrementErrorCount (\r | |
31 | VOID\r | |
32 | );\r | |
33 | \r | |
a6eaba4d DB |
34 | /**\r |
35 | This function increments the ACPI table warning counter.\r | |
36 | **/\r | |
ee4dc24f RN |
37 | VOID\r |
38 | EFIAPI\r | |
39 | IncrementWarningCount (\r | |
40 | VOID\r | |
41 | );\r | |
42 | \r | |
a6eaba4d DB |
43 | /**\r |
44 | This function verifies the ACPI table checksum.\r | |
ee4dc24f RN |
45 | \r |
46 | This function verifies the checksum for the ACPI table and optionally\r | |
47 | prints the status.\r | |
48 | \r | |
49 | @param [in] Log If TRUE log the status of the checksum.\r | |
50 | @param [in] Ptr Pointer to the start of the table buffer.\r | |
51 | @param [in] Length The length of the buffer.\r | |
52 | \r | |
53 | @retval TRUE The checksum is OK.\r | |
54 | @retval FALSE The checksum failed.\r | |
a6eaba4d | 55 | **/\r |
ee4dc24f RN |
56 | BOOLEAN\r |
57 | EFIAPI\r | |
58 | VerifyChecksum (\r | |
59 | IN BOOLEAN Log,\r | |
60 | IN UINT8* Ptr,\r | |
61 | IN UINT32 Length\r | |
62 | );\r | |
63 | \r | |
a6eaba4d DB |
64 | /**\r |
65 | This function performs a raw data dump of the ACPI table.\r | |
ee4dc24f RN |
66 | \r |
67 | @param [in] Ptr Pointer to the start of the table buffer.\r | |
68 | @param [in] Length The length of the buffer.\r | |
a6eaba4d | 69 | **/\r |
ee4dc24f RN |
70 | VOID\r |
71 | EFIAPI\r | |
72 | DumpRaw (\r | |
73 | IN UINT8* Ptr,\r | |
74 | IN UINT32 Length\r | |
75 | );\r | |
76 | \r | |
a6eaba4d DB |
77 | /**\r |
78 | This function traces 1 byte of datum as specified in the format string.\r | |
ee4dc24f RN |
79 | \r |
80 | @param [in] Format The format string for tracing the data.\r | |
81 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 82 | **/\r |
ee4dc24f RN |
83 | VOID\r |
84 | EFIAPI\r | |
85 | DumpUint8 (\r | |
86 | IN CONST CHAR16* Format,\r | |
87 | IN UINT8* Ptr\r | |
88 | );\r | |
89 | \r | |
a6eaba4d DB |
90 | /**\r |
91 | This function traces 2 bytes of data as specified in the format string.\r | |
ee4dc24f RN |
92 | \r |
93 | @param [in] Format The format string for tracing the data.\r | |
94 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 95 | **/\r |
ee4dc24f RN |
96 | VOID\r |
97 | EFIAPI\r | |
98 | DumpUint16 (\r | |
99 | IN CONST CHAR16* Format,\r | |
100 | IN UINT8* Ptr\r | |
101 | );\r | |
102 | \r | |
a6eaba4d DB |
103 | /**\r |
104 | This function traces 4 bytes of data as specified in the format string.\r | |
ee4dc24f RN |
105 | \r |
106 | @param [in] Format The format string for tracing the data.\r | |
107 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 108 | **/\r |
ee4dc24f RN |
109 | VOID\r |
110 | EFIAPI\r | |
111 | DumpUint32 (\r | |
112 | IN CONST CHAR16* Format,\r | |
113 | IN UINT8* Ptr\r | |
114 | );\r | |
115 | \r | |
a6eaba4d DB |
116 | /**\r |
117 | This function traces 8 bytes of data as specified by the format string.\r | |
ee4dc24f RN |
118 | \r |
119 | @param [in] Format The format string for tracing the data.\r | |
120 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 121 | **/\r |
ee4dc24f RN |
122 | VOID\r |
123 | EFIAPI\r | |
124 | DumpUint64 (\r | |
125 | IN CONST CHAR16* Format,\r | |
126 | IN UINT8* Ptr\r | |
127 | );\r | |
128 | \r | |
a6eaba4d DB |
129 | /**\r |
130 | This function traces 3 characters which can be optionally\r | |
131 | formated using the format string if specified.\r | |
ee4dc24f RN |
132 | \r |
133 | If no format string is specified the Format must be NULL.\r | |
134 | \r | |
135 | @param [in] Format Optional format string for tracing the data.\r | |
136 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 137 | **/\r |
ee4dc24f RN |
138 | VOID\r |
139 | EFIAPI\r | |
140 | Dump3Chars (\r | |
141 | IN CONST CHAR16* Format OPTIONAL,\r | |
142 | IN UINT8* Ptr\r | |
143 | );\r | |
144 | \r | |
a6eaba4d DB |
145 | /**\r |
146 | This function traces 4 characters which can be optionally\r | |
147 | formated using the format string if specified.\r | |
ee4dc24f RN |
148 | \r |
149 | If no format string is specified the Format must be NULL.\r | |
150 | \r | |
151 | @param [in] Format Optional format string for tracing the data.\r | |
152 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 153 | **/\r |
ee4dc24f RN |
154 | VOID\r |
155 | EFIAPI\r | |
156 | Dump4Chars (\r | |
157 | IN CONST CHAR16* Format OPTIONAL,\r | |
158 | IN UINT8* Ptr\r | |
159 | );\r | |
160 | \r | |
a6eaba4d DB |
161 | /**\r |
162 | This function traces 6 characters which can be optionally\r | |
163 | formated using the format string if specified.\r | |
ee4dc24f RN |
164 | \r |
165 | If no format string is specified the Format must be NULL.\r | |
166 | \r | |
167 | @param [in] Format Optional format string for tracing the data.\r | |
168 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 169 | **/\r |
ee4dc24f RN |
170 | VOID\r |
171 | EFIAPI\r | |
172 | Dump6Chars (\r | |
173 | IN CONST CHAR16* Format OPTIONAL,\r | |
174 | IN UINT8* Ptr\r | |
175 | );\r | |
176 | \r | |
a6eaba4d DB |
177 | /**\r |
178 | This function traces 8 characters which can be optionally\r | |
179 | formated using the format string if specified.\r | |
ee4dc24f RN |
180 | \r |
181 | If no format string is specified the Format must be NULL.\r | |
182 | \r | |
183 | @param [in] Format Optional format string for tracing the data.\r | |
184 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 185 | **/\r |
ee4dc24f RN |
186 | VOID\r |
187 | EFIAPI\r | |
188 | Dump8Chars (\r | |
189 | IN CONST CHAR16* Format OPTIONAL,\r | |
190 | IN UINT8* Ptr\r | |
191 | );\r | |
192 | \r | |
a6eaba4d DB |
193 | /**\r |
194 | This function indents and prints the ACPI table Field Name.\r | |
ee4dc24f RN |
195 | \r |
196 | @param [in] Indent Number of spaces to add to the global table\r | |
197 | indent. The global table indent is 0 by default;\r | |
198 | however this value is updated on entry to the\r | |
199 | ParseAcpi() by adding the indent value provided to\r | |
200 | ParseAcpi() and restored back on exit. Therefore\r | |
201 | the total indent in the output is dependent on from\r | |
202 | where this function is called.\r | |
203 | @param [in] FieldName Pointer to the Field Name.\r | |
a6eaba4d | 204 | **/\r |
ee4dc24f RN |
205 | VOID\r |
206 | EFIAPI\r | |
207 | PrintFieldName (\r | |
208 | IN UINT32 Indent,\r | |
209 | IN CONST CHAR16* FieldName\r | |
a6eaba4d | 210 | );\r |
ee4dc24f | 211 | \r |
a6eaba4d DB |
212 | /**\r |
213 | This function pointer is the template for customizing the trace output\r | |
ee4dc24f RN |
214 | \r |
215 | @param [in] Format Format string for tracing the data as specified by\r | |
216 | the 'Format' member of ACPI_PARSER.\r | |
217 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 218 | **/\r |
ee4dc24f RN |
219 | typedef VOID (EFIAPI *FNPTR_PRINT_FORMATTER)(CONST CHAR16* Format, UINT8* Ptr);\r |
220 | \r | |
a6eaba4d DB |
221 | /**\r |
222 | This function pointer is the template for validating an ACPI table field.\r | |
ee4dc24f RN |
223 | \r |
224 | @param [in] Ptr Pointer to the start of the field data.\r | |
225 | @param [in] Context Pointer to context specific information as specified by\r | |
226 | the 'Context' member of the ACPI_PARSER.\r | |
227 | e.g. this could be a pointer to the ACPI table header.\r | |
a6eaba4d | 228 | **/\r |
ee4dc24f RN |
229 | typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8* Ptr, VOID* Context);\r |
230 | \r | |
a6eaba4d DB |
231 | /**\r |
232 | The ACPI_PARSER structure describes the fields of an ACPI table and\r | |
233 | provides means for the parser to interpret and trace appropriately.\r | |
ee4dc24f RN |
234 | \r |
235 | The first three members are populated based on information present in\r | |
236 | in the ACPI table specifications. The remaining members describe how\r | |
237 | the parser should report the field information, validate the field data\r | |
238 | and/or update an external pointer to the field (ItemPtr).\r | |
239 | \r | |
240 | ParseAcpi() uses the format string specified by 'Format' for tracing\r | |
241 | the field data. If the field is more complex and requires additional\r | |
242 | processing for formatting and representation a print formatter function\r | |
243 | can be specified in 'PrintFormatter'.\r | |
244 | The PrintFormatter function may choose to use the format string\r | |
245 | specified by 'Format' or use its own internal format string.\r | |
246 | \r | |
247 | The 'Format' and 'PrintFormatter' members allow flexibility for\r | |
248 | representing the field data.\r | |
a6eaba4d | 249 | **/\r |
ee4dc24f RN |
250 | typedef struct AcpiParser {\r |
251 | \r | |
252 | /// String describing the ACPI table field\r | |
253 | /// (Field column from ACPI table spec)\r | |
254 | CONST CHAR16* NameStr;\r | |
255 | \r | |
256 | /// The length of the field.\r | |
257 | /// (Byte Length column from ACPI table spec)\r | |
258 | UINT32 Length;\r | |
259 | \r | |
260 | /// The offset of the field from the start of the table.\r | |
261 | /// (Byte Offset column from ACPI table spec)\r | |
262 | UINT32 Offset;\r | |
263 | \r | |
264 | /// Optional Print() style format string for tracing the data. If not\r | |
265 | /// used this must be set to NULL.\r | |
266 | CONST CHAR16* Format;\r | |
267 | \r | |
268 | /// Optional pointer to a print formatter function which\r | |
269 | /// is typically used to trace complex field information.\r | |
270 | /// If not used this must be set to NULL.\r | |
271 | /// The Format string is passed to the PrintFormatter function\r | |
272 | /// but may be ignored by the implementation code.\r | |
273 | FNPTR_PRINT_FORMATTER PrintFormatter;\r | |
274 | \r | |
275 | /// Optional pointer which may be set to request the parser to update\r | |
276 | /// a pointer to the field data. If unused this must be set to NULL.\r | |
277 | VOID** ItemPtr;\r | |
278 | \r | |
279 | /// Optional pointer to a field validator function.\r | |
280 | /// The function should directly report any appropriate error or warning\r | |
281 | /// and invoke the appropriate counter update function.\r | |
282 | /// If not used this parameter must be set to NULL.\r | |
283 | FNPTR_FIELD_VALIDATOR FieldValidator;\r | |
284 | \r | |
285 | /// Optional pointer to context specific information,\r | |
286 | /// which the Field Validator function can use to determine\r | |
287 | /// additional information about the ACPI table and make\r | |
288 | /// decisions about the field being validated.\r | |
289 | /// e.g. this could be a pointer to the ACPI table header\r | |
290 | VOID* Context;\r | |
291 | } ACPI_PARSER;\r | |
292 | \r | |
a6eaba4d DB |
293 | /**\r |
294 | A structure used to store the pointers to the members of the\r | |
295 | ACPI description header structure that was parsed.\r | |
296 | **/\r | |
ee4dc24f RN |
297 | typedef struct AcpiDescriptionHeaderInfo {\r |
298 | /// ACPI table signature\r | |
299 | UINT32* Signature;\r | |
300 | /// Length of the ACPI table\r | |
301 | UINT32* Length;\r | |
302 | /// Revision\r | |
303 | UINT8* Revision;\r | |
304 | /// Checksum\r | |
305 | UINT8* Checksum;\r | |
306 | /// OEM Id - length is 6 bytes\r | |
307 | UINT8* OemId;\r | |
308 | /// OEM table Id\r | |
309 | UINT64* OemTableId;\r | |
310 | /// OEM revision Id\r | |
311 | UINT32* OemRevision;\r | |
312 | /// Creator Id\r | |
313 | UINT32* CreatorId;\r | |
314 | /// Creator revision\r | |
315 | UINT32* CreatorRevision;\r | |
316 | } ACPI_DESCRIPTION_HEADER_INFO;\r | |
317 | \r | |
a6eaba4d DB |
318 | /**\r |
319 | This function is used to parse an ACPI table buffer.\r | |
ee4dc24f RN |
320 | \r |
321 | The ACPI table buffer is parsed using the ACPI table parser information\r | |
322 | specified by a pointer to an array of ACPI_PARSER elements. This parser\r | |
323 | function iterates through each item on the ACPI_PARSER array and logs the\r | |
324 | ACPI table fields.\r | |
325 | \r | |
326 | This function can optionally be used to parse ACPI tables and fetch specific\r | |
327 | field values. The ItemPtr member of the ACPI_PARSER structure (where used)\r | |
328 | is updated by this parser function to point to the selected field data\r | |
329 | (e.g. useful for variable length nested fields).\r | |
330 | \r | |
331 | @param [in] Trace Trace the ACPI fields TRUE else only parse the\r | |
332 | table.\r | |
333 | @param [in] Indent Number of spaces to indent the output.\r | |
334 | @param [in] AsciiName Optional pointer to an ASCII string that describes\r | |
335 | the table being parsed.\r | |
336 | @param [in] Ptr Pointer to the start of the buffer.\r | |
337 | @param [in] Length Length of the buffer pointed by Ptr.\r | |
338 | @param [in] Parser Pointer to an array of ACPI_PARSER structure that\r | |
339 | describes the table being parsed.\r | |
340 | @param [in] ParserItems Number of items in the ACPI_PARSER array.\r | |
341 | \r | |
342 | @retval Number of bytes parsed.\r | |
a6eaba4d | 343 | **/\r |
ee4dc24f RN |
344 | UINT32\r |
345 | EFIAPI\r | |
346 | ParseAcpi (\r | |
347 | IN BOOLEAN Trace,\r | |
348 | IN UINT32 Indent,\r | |
349 | IN CONST CHAR8* AsciiName OPTIONAL,\r | |
350 | IN UINT8* Ptr,\r | |
351 | IN UINT32 Length,\r | |
352 | IN CONST ACPI_PARSER* Parser,\r | |
353 | IN UINT32 ParserItems\r | |
a6eaba4d | 354 | );\r |
ee4dc24f | 355 | \r |
a6eaba4d DB |
356 | /**\r |
357 | This is a helper macro to pass parameters to the Parser functions.\r | |
ee4dc24f RN |
358 | \r |
359 | @param [in] Parser The name of the ACPI_PARSER array describing the\r | |
360 | ACPI table fields.\r | |
a6eaba4d | 361 | **/\r |
ee4dc24f RN |
362 | #define PARSER_PARAMS(Parser) Parser, sizeof (Parser) / sizeof (Parser[0])\r |
363 | \r | |
a6eaba4d DB |
364 | /**\r |
365 | This is a helper macro for describing the ACPI header fields.\r | |
ee4dc24f RN |
366 | \r |
367 | @param [out] Info Pointer to retrieve the ACPI table header information.\r | |
a6eaba4d | 368 | **/\r |
ee4dc24f RN |
369 | #define PARSE_ACPI_HEADER(Info) \\r |
370 | { L"Signature", 4, 0, NULL, Dump4Chars, \\r | |
371 | (VOID**)&(Info)->Signature , NULL, NULL }, \\r | |
372 | { L"Length", 4, 4, L"%d", NULL, \\r | |
373 | (VOID**)&(Info)->Length, NULL, NULL }, \\r | |
374 | { L"Revision", 1, 8, L"%d", NULL, \\r | |
375 | (VOID**)&(Info)->Revision, NULL, NULL }, \\r | |
376 | { L"Checksum", 1, 9, L"0x%X", NULL, \\r | |
377 | (VOID**)&(Info)->Checksum, NULL, NULL }, \\r | |
378 | { L"Oem ID", 6, 10, NULL, Dump6Chars, \\r | |
379 | (VOID**)&(Info)->OemId, NULL, NULL }, \\r | |
380 | { L"Oem Table ID", 8, 16, NULL, Dump8Chars, \\r | |
381 | (VOID**)&(Info)->OemTableId, NULL, NULL }, \\r | |
382 | { L"Oem Revision", 4, 24, L"0x%X", NULL, \\r | |
383 | (VOID**)&(Info)->OemRevision, NULL, NULL }, \\r | |
384 | { L"Creator ID", 4, 28, NULL, Dump4Chars, \\r | |
385 | (VOID**)&(Info)->CreatorId, NULL, NULL }, \\r | |
386 | { L"Creator Revision", 4, 32, L"0x%X", NULL, \\r | |
387 | (VOID**)&(Info)->CreatorRevision, NULL, NULL }\r | |
388 | \r | |
a6eaba4d DB |
389 | /**\r |
390 | Length of the ACPI GAS structure.\r | |
ee4dc24f RN |
391 | \r |
392 | NOTE: This might normally be defined as\r | |
393 | sizeof (EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE).\r | |
394 | However, we deliberately minimise any reference to the EDK2 ACPI\r | |
395 | headers in an attempt to provide cross checking.\r | |
a6eaba4d | 396 | **/\r |
ee4dc24f RN |
397 | #define GAS_LENGTH 12\r |
398 | \r | |
a6eaba4d DB |
399 | /**\r |
400 | Length of the ACPI Header structure.\r | |
ee4dc24f RN |
401 | \r |
402 | NOTE: This might normally be defined as\r | |
403 | sizeof (EFI_ACPI_DESCRIPTION_HEADER).\r | |
404 | However, we deliberately minimise any reference to the EDK2 ACPI\r | |
405 | headers in an attempt to provide cross checking.\r | |
a6eaba4d | 406 | **/\r |
ee4dc24f RN |
407 | #define ACPI_DESCRIPTION_HEADER_LENGTH 36\r |
408 | \r | |
a6eaba4d DB |
409 | /**\r |
410 | This function indents and traces the GAS structure as described by the GasParser.\r | |
ee4dc24f RN |
411 | \r |
412 | @param [in] Ptr Pointer to the start of the buffer.\r | |
413 | @param [in] Indent Number of spaces to indent the output.\r | |
a6eaba4d | 414 | **/\r |
ee4dc24f RN |
415 | VOID\r |
416 | EFIAPI\r | |
417 | DumpGasStruct (\r | |
418 | IN UINT8* Ptr,\r | |
419 | IN UINT32 Indent\r | |
420 | );\r | |
421 | \r | |
a6eaba4d DB |
422 | /**\r |
423 | This function traces the GAS structure as described by the GasParser.\r | |
ee4dc24f RN |
424 | \r |
425 | @param [in] Format Optional format string for tracing the data.\r | |
426 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 427 | **/\r |
ee4dc24f RN |
428 | VOID\r |
429 | EFIAPI\r | |
430 | DumpGas (\r | |
431 | IN CONST CHAR16* Format OPTIONAL,\r | |
432 | IN UINT8* Ptr\r | |
433 | );\r | |
434 | \r | |
a6eaba4d DB |
435 | /**\r |
436 | This function traces the ACPI header as described by the AcpiHeaderParser.\r | |
ee4dc24f RN |
437 | \r |
438 | @param [in] Ptr Pointer to the start of the buffer.\r | |
439 | \r | |
440 | @retval Number of bytes parsed.\r | |
a6eaba4d | 441 | **/\r |
ee4dc24f RN |
442 | UINT32\r |
443 | EFIAPI\r | |
444 | DumpAcpiHeader (\r | |
445 | IN UINT8* Ptr\r | |
446 | );\r | |
447 | \r | |
a6eaba4d DB |
448 | /**\r |
449 | This function parses the ACPI header as described by the AcpiHeaderParser.\r | |
ee4dc24f RN |
450 | \r |
451 | This function optionally returns the Signature, Length and revision of the\r | |
452 | ACPI table.\r | |
453 | \r | |
454 | @param [in] Ptr Pointer to the start of the buffer.\r | |
455 | @param [out] Signature Gets location of the ACPI table signature.\r | |
456 | @param [out] Length Gets location of the length of the ACPI table.\r | |
457 | @param [out] Revision Gets location of the revision of the ACPI table.\r | |
458 | \r | |
459 | @retval Number of bytes parsed.\r | |
a6eaba4d | 460 | **/\r |
ee4dc24f RN |
461 | UINT32\r |
462 | EFIAPI\r | |
463 | ParseAcpiHeader (\r | |
464 | IN UINT8* Ptr,\r | |
465 | OUT CONST UINT32** Signature,\r | |
466 | OUT CONST UINT32** Length,\r | |
467 | OUT CONST UINT8** Revision\r | |
468 | );\r | |
469 | \r | |
a6eaba4d DB |
470 | /**\r |
471 | This function parses the ACPI BGRT table.\r | |
ee4dc24f RN |
472 | When trace is enabled this function parses the BGRT table and\r |
473 | traces the ACPI table fields.\r | |
474 | \r | |
475 | This function also performs validation of the ACPI table fields.\r | |
476 | \r | |
477 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
478 | @param [in] Ptr Pointer to the start of the buffer.\r | |
479 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
480 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 481 | **/\r |
ee4dc24f RN |
482 | VOID\r |
483 | EFIAPI\r | |
484 | ParseAcpiBgrt (\r | |
485 | IN BOOLEAN Trace,\r | |
486 | IN UINT8* Ptr,\r | |
487 | IN UINT32 AcpiTableLength,\r | |
488 | IN UINT8 AcpiTableRevision\r | |
489 | );\r | |
490 | \r | |
a6eaba4d DB |
491 | /**\r |
492 | This function parses the ACPI DBG2 table.\r | |
ee4dc24f RN |
493 | When trace is enabled this function parses the DBG2 table and\r |
494 | traces the ACPI table fields.\r | |
495 | \r | |
496 | This function also performs validation of the ACPI table fields.\r | |
497 | \r | |
498 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
499 | @param [in] Ptr Pointer to the start of the buffer.\r | |
500 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
501 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 502 | **/\r |
ee4dc24f RN |
503 | VOID\r |
504 | EFIAPI\r | |
505 | ParseAcpiDbg2 (\r | |
506 | IN BOOLEAN Trace,\r | |
507 | IN UINT8* Ptr,\r | |
508 | IN UINT32 AcpiTableLength,\r | |
509 | IN UINT8 AcpiTableRevision\r | |
510 | );\r | |
511 | \r | |
a6eaba4d DB |
512 | /**\r |
513 | This function parses the ACPI DSDT table.\r | |
ee4dc24f RN |
514 | When trace is enabled this function parses the DSDT table and\r |
515 | traces the ACPI table fields.\r | |
516 | For the DSDT table only the ACPI header fields are parsed and\r | |
517 | traced.\r | |
518 | \r | |
519 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
520 | @param [in] Ptr Pointer to the start of the buffer.\r | |
521 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
522 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 523 | **/\r |
ee4dc24f RN |
524 | VOID\r |
525 | EFIAPI\r | |
526 | ParseAcpiDsdt (\r | |
527 | IN BOOLEAN Trace,\r | |
528 | IN UINT8* Ptr,\r | |
529 | IN UINT32 AcpiTableLength,\r | |
530 | IN UINT8 AcpiTableRevision\r | |
531 | );\r | |
532 | \r | |
a6eaba4d DB |
533 | /**\r |
534 | This function parses the ACPI FADT table.\r | |
ee4dc24f RN |
535 | This function parses the FADT table and optionally traces the ACPI\r |
536 | table fields.\r | |
537 | \r | |
538 | This function also performs validation of the ACPI table fields.\r | |
539 | \r | |
540 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
541 | @param [in] Ptr Pointer to the start of the buffer.\r | |
542 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
543 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 544 | **/\r |
ee4dc24f RN |
545 | VOID\r |
546 | EFIAPI\r | |
547 | ParseAcpiFadt (\r | |
548 | IN BOOLEAN Trace,\r | |
549 | IN UINT8* Ptr,\r | |
550 | IN UINT32 AcpiTableLength,\r | |
551 | IN UINT8 AcpiTableRevision\r | |
552 | );\r | |
553 | \r | |
a6eaba4d DB |
554 | /**\r |
555 | This function parses the ACPI GTDT table.\r | |
ee4dc24f RN |
556 | When trace is enabled this function parses the GTDT table and\r |
557 | traces the ACPI table fields.\r | |
558 | \r | |
559 | This function also parses the following platform timer structures:\r | |
560 | - GT Block timer\r | |
561 | - Watchdog timer\r | |
562 | \r | |
563 | This function also performs validation of the ACPI table fields.\r | |
564 | \r | |
565 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
566 | @param [in] Ptr Pointer to the start of the buffer.\r | |
567 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
568 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 569 | **/\r |
ee4dc24f RN |
570 | VOID\r |
571 | EFIAPI\r | |
572 | ParseAcpiGtdt (\r | |
573 | IN BOOLEAN Trace,\r | |
574 | IN UINT8* Ptr,\r | |
575 | IN UINT32 AcpiTableLength,\r | |
576 | IN UINT8 AcpiTableRevision\r | |
577 | );\r | |
578 | \r | |
a6eaba4d DB |
579 | /**\r |
580 | This function parses the ACPI IORT table.\r | |
ee4dc24f RN |
581 | When trace is enabled this function parses the IORT table and\r |
582 | traces the ACPI fields.\r | |
583 | \r | |
584 | This function also parses the following nodes:\r | |
585 | - ITS Group\r | |
586 | - Named Component\r | |
587 | - Root Complex\r | |
588 | - SMMUv1/2\r | |
589 | - SMMUv3\r | |
590 | - PMCG\r | |
591 | \r | |
592 | This function also performs validation of the ACPI table fields.\r | |
593 | \r | |
594 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
595 | @param [in] Ptr Pointer to the start of the buffer.\r | |
596 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
597 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 598 | **/\r |
ee4dc24f RN |
599 | VOID\r |
600 | EFIAPI\r | |
601 | ParseAcpiIort (\r | |
602 | IN BOOLEAN Trace,\r | |
603 | IN UINT8* Ptr,\r | |
604 | IN UINT32 AcpiTableLength,\r | |
605 | IN UINT8 AcpiTableRevision\r | |
606 | );\r | |
607 | \r | |
a6eaba4d DB |
608 | /**\r |
609 | This function parses the ACPI MADT table.\r | |
ee4dc24f RN |
610 | When trace is enabled this function parses the MADT table and\r |
611 | traces the ACPI table fields.\r | |
612 | \r | |
613 | This function currently parses the following Interrupt Controller\r | |
614 | Structures:\r | |
615 | - GICC\r | |
616 | - GICD\r | |
617 | - GIC MSI Frame\r | |
618 | - GICR\r | |
619 | - GIC ITS\r | |
620 | \r | |
621 | This function also performs validation of the ACPI table fields.\r | |
622 | \r | |
623 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
624 | @param [in] Ptr Pointer to the start of the buffer.\r | |
625 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
626 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 627 | **/\r |
ee4dc24f RN |
628 | VOID\r |
629 | EFIAPI\r | |
630 | ParseAcpiMadt (\r | |
631 | IN BOOLEAN Trace,\r | |
632 | IN UINT8* Ptr,\r | |
633 | IN UINT32 AcpiTableLength,\r | |
634 | IN UINT8 AcpiTableRevision\r | |
635 | );\r | |
636 | \r | |
a6eaba4d DB |
637 | /**\r |
638 | This function parses the ACPI MCFG table.\r | |
ee4dc24f RN |
639 | When trace is enabled this function parses the MCFG table and\r |
640 | traces the ACPI table fields.\r | |
641 | \r | |
642 | This function also performs validation of the ACPI table fields.\r | |
643 | \r | |
644 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
645 | @param [in] Ptr Pointer to the start of the buffer.\r | |
646 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
647 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 648 | **/\r |
ee4dc24f RN |
649 | VOID\r |
650 | EFIAPI\r | |
651 | ParseAcpiMcfg (\r | |
652 | IN BOOLEAN Trace,\r | |
653 | IN UINT8* Ptr,\r | |
654 | IN UINT32 AcpiTableLength,\r | |
655 | IN UINT8 AcpiTableRevision\r | |
656 | );\r | |
657 | \r | |
d4d2fdf2 KK |
658 | /**\r |
659 | This function parses the ACPI PPTT table.\r | |
660 | When trace is enabled this function parses the PPTT table and\r | |
661 | traces the ACPI table fields.\r | |
662 | \r | |
663 | This function also performs validation of the ACPI table fields.\r | |
664 | \r | |
665 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
666 | @param [in] Ptr Pointer to the start of the buffer.\r | |
667 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
668 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
669 | **/\r | |
670 | VOID\r | |
671 | EFIAPI\r | |
672 | ParseAcpiPptt (\r | |
673 | IN BOOLEAN Trace,\r | |
674 | IN UINT8* Ptr,\r | |
675 | IN UINT32 AcpiTableLength,\r | |
676 | IN UINT8 AcpiTableRevision\r | |
677 | );\r | |
678 | \r | |
a6eaba4d DB |
679 | /**\r |
680 | This function parses the ACPI RSDP table.\r | |
ee4dc24f RN |
681 | \r |
682 | This function invokes the parser for the XSDT table.\r | |
683 | * Note - This function does not support parsing of RSDT table.\r | |
684 | \r | |
685 | This function also performs a RAW dump of the ACPI table and\r | |
686 | validates the checksum.\r | |
687 | \r | |
688 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
689 | @param [in] Ptr Pointer to the start of the buffer.\r | |
690 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
691 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 692 | **/\r |
ee4dc24f RN |
693 | VOID\r |
694 | EFIAPI\r | |
695 | ParseAcpiRsdp (\r | |
696 | IN BOOLEAN Trace,\r | |
697 | IN UINT8* Ptr,\r | |
698 | IN UINT32 AcpiTableLength,\r | |
699 | IN UINT8 AcpiTableRevision\r | |
700 | );\r | |
701 | \r | |
a6eaba4d DB |
702 | /**\r |
703 | This function parses the ACPI SLIT table.\r | |
ee4dc24f RN |
704 | When trace is enabled this function parses the SLIT table and\r |
705 | traces the ACPI table fields.\r | |
706 | \r | |
707 | This function also validates System Localities for the following:\r | |
708 | - Diagonal elements have a normalized value of 10\r | |
709 | - Relative distance from System Locality at i*N+j is same as\r | |
710 | j*N+i\r | |
711 | \r | |
712 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
713 | @param [in] Ptr Pointer to the start of the buffer.\r | |
714 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
715 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 716 | **/\r |
ee4dc24f RN |
717 | VOID\r |
718 | EFIAPI\r | |
719 | ParseAcpiSlit (\r | |
720 | IN BOOLEAN Trace,\r | |
721 | IN UINT8* Ptr,\r | |
722 | IN UINT32 AcpiTableLength,\r | |
723 | IN UINT8 AcpiTableRevision\r | |
724 | );\r | |
725 | \r | |
a6eaba4d DB |
726 | /**\r |
727 | This function parses the ACPI SPCR table.\r | |
ee4dc24f RN |
728 | When trace is enabled this function parses the SPCR table and\r |
729 | traces the ACPI table fields.\r | |
730 | \r | |
731 | This function also performs validations of the ACPI table fields.\r | |
732 | \r | |
733 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
734 | @param [in] Ptr Pointer to the start of the buffer.\r | |
735 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
736 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 737 | **/\r |
ee4dc24f RN |
738 | VOID\r |
739 | EFIAPI\r | |
740 | ParseAcpiSpcr (\r | |
741 | IN BOOLEAN Trace,\r | |
742 | IN UINT8* Ptr,\r | |
743 | IN UINT32 AcpiTableLength,\r | |
744 | IN UINT8 AcpiTableRevision\r | |
745 | );\r | |
746 | \r | |
a6eaba4d DB |
747 | /**\r |
748 | This function parses the ACPI SRAT table.\r | |
ee4dc24f RN |
749 | When trace is enabled this function parses the SRAT table and\r |
750 | traces the ACPI table fields.\r | |
751 | \r | |
752 | This function parses the following Resource Allocation Structures:\r | |
753 | - Processor Local APIC/SAPIC Affinity Structure\r | |
754 | - Memory Affinity Structure\r | |
755 | - Processor Local x2APIC Affinity Structure\r | |
756 | - GICC Affinity Structure\r | |
757 | \r | |
758 | This function also performs validation of the ACPI table fields.\r | |
759 | \r | |
760 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
761 | @param [in] Ptr Pointer to the start of the buffer.\r | |
762 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
763 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 764 | **/\r |
ee4dc24f RN |
765 | VOID\r |
766 | EFIAPI\r | |
767 | ParseAcpiSrat (\r | |
768 | IN BOOLEAN Trace,\r | |
769 | IN UINT8* Ptr,\r | |
770 | IN UINT32 AcpiTableLength,\r | |
771 | IN UINT8 AcpiTableRevision\r | |
772 | );\r | |
773 | \r | |
a6eaba4d DB |
774 | /**\r |
775 | This function parses the ACPI SSDT table.\r | |
ee4dc24f RN |
776 | When trace is enabled this function parses the SSDT table and\r |
777 | traces the ACPI table fields.\r | |
778 | For the SSDT table only the ACPI header fields are\r | |
779 | parsed and traced.\r | |
780 | \r | |
781 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
782 | @param [in] Ptr Pointer to the start of the buffer.\r | |
783 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
784 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 785 | **/\r |
ee4dc24f RN |
786 | VOID\r |
787 | EFIAPI\r | |
788 | ParseAcpiSsdt (\r | |
789 | IN BOOLEAN Trace,\r | |
790 | IN UINT8* Ptr,\r | |
791 | IN UINT32 AcpiTableLength,\r | |
792 | IN UINT8 AcpiTableRevision\r | |
793 | );\r | |
794 | \r | |
a6eaba4d DB |
795 | /**\r |
796 | This function parses the ACPI XSDT table\r | |
ee4dc24f RN |
797 | and optionally traces the ACPI table fields.\r |
798 | \r | |
799 | This function also performs validation of the XSDT table.\r | |
800 | \r | |
801 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
802 | @param [in] Ptr Pointer to the start of the buffer.\r | |
803 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
804 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 805 | **/\r |
ee4dc24f RN |
806 | VOID\r |
807 | EFIAPI\r | |
808 | ParseAcpiXsdt (\r | |
809 | IN BOOLEAN Trace,\r | |
810 | IN UINT8* Ptr,\r | |
811 | IN UINT32 AcpiTableLength,\r | |
812 | IN UINT8 AcpiTableRevision\r | |
813 | );\r | |
814 | \r | |
815 | #endif // ACPIPARSER_H_\r |