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