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