]>
Commit | Line | Data |
---|---|---|
a6eaba4d | 1 | /** @file\r |
ee4dc24f RN |
2 | Header file for ACPI parser\r |
3 | \r | |
d4633b36 | 4 | Copyright (c) 2016 - 2020, 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 | This function indents and traces the GAS structure as described by the GasParser.\r | |
ee4dc24f RN |
401 | \r |
402 | @param [in] Ptr Pointer to the start of the buffer.\r | |
403 | @param [in] Indent Number of spaces to indent the output.\r | |
58cc0ffe KK |
404 | @param [in] Length Length of the GAS structure buffer.\r |
405 | \r | |
406 | @retval Number of bytes parsed.\r | |
a6eaba4d | 407 | **/\r |
58cc0ffe | 408 | UINT32\r |
ee4dc24f RN |
409 | EFIAPI\r |
410 | DumpGasStruct (\r | |
411 | IN UINT8* Ptr,\r | |
58cc0ffe KK |
412 | IN UINT32 Indent,\r |
413 | IN UINT32 Length\r | |
ee4dc24f RN |
414 | );\r |
415 | \r | |
a6eaba4d DB |
416 | /**\r |
417 | This function traces the GAS structure as described by the GasParser.\r | |
ee4dc24f RN |
418 | \r |
419 | @param [in] Format Optional format string for tracing the data.\r | |
420 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 421 | **/\r |
ee4dc24f RN |
422 | VOID\r |
423 | EFIAPI\r | |
424 | DumpGas (\r | |
425 | IN CONST CHAR16* Format OPTIONAL,\r | |
426 | IN UINT8* Ptr\r | |
427 | );\r | |
428 | \r | |
a6eaba4d DB |
429 | /**\r |
430 | This function traces the ACPI header as described by the AcpiHeaderParser.\r | |
ee4dc24f RN |
431 | \r |
432 | @param [in] Ptr Pointer to the start of the buffer.\r | |
433 | \r | |
434 | @retval Number of bytes parsed.\r | |
a6eaba4d | 435 | **/\r |
ee4dc24f RN |
436 | UINT32\r |
437 | EFIAPI\r | |
438 | DumpAcpiHeader (\r | |
439 | IN UINT8* Ptr\r | |
440 | );\r | |
441 | \r | |
a6eaba4d DB |
442 | /**\r |
443 | This function parses the ACPI header as described by the AcpiHeaderParser.\r | |
ee4dc24f RN |
444 | \r |
445 | This function optionally returns the Signature, Length and revision of the\r | |
446 | ACPI table.\r | |
447 | \r | |
448 | @param [in] Ptr Pointer to the start of the buffer.\r | |
449 | @param [out] Signature Gets location of the ACPI table signature.\r | |
450 | @param [out] Length Gets location of the length of the ACPI table.\r | |
451 | @param [out] Revision Gets location of the revision of the ACPI table.\r | |
452 | \r | |
453 | @retval Number of bytes parsed.\r | |
a6eaba4d | 454 | **/\r |
ee4dc24f RN |
455 | UINT32\r |
456 | EFIAPI\r | |
457 | ParseAcpiHeader (\r | |
458 | IN UINT8* Ptr,\r | |
459 | OUT CONST UINT32** Signature,\r | |
460 | OUT CONST UINT32** Length,\r | |
461 | OUT CONST UINT8** Revision\r | |
462 | );\r | |
463 | \r | |
1d3d5e32 MMF |
464 | /**\r |
465 | This function parses the ACPI AEST table.\r | |
466 | When trace is enabled this function parses the AEST table and\r | |
467 | traces the ACPI table fields.\r | |
468 | \r | |
469 | This function also performs validation of the ACPI table fields.\r | |
470 | \r | |
471 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
472 | @param [in] Ptr Pointer to the start of the buffer.\r | |
473 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
474 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
475 | **/\r | |
476 | VOID\r | |
477 | EFIAPI\r | |
478 | ParseAcpiAest (\r | |
479 | IN BOOLEAN Trace,\r | |
480 | IN UINT8* Ptr,\r | |
481 | IN UINT32 AcpiTableLength,\r | |
482 | IN UINT8 AcpiTableRevision\r | |
483 | );\r | |
484 | \r | |
a6eaba4d DB |
485 | /**\r |
486 | This function parses the ACPI BGRT table.\r | |
ee4dc24f RN |
487 | When trace is enabled this function parses the BGRT table and\r |
488 | traces the ACPI table fields.\r | |
489 | \r | |
490 | This function also performs validation of the ACPI table fields.\r | |
491 | \r | |
492 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
493 | @param [in] Ptr Pointer to the start of the buffer.\r | |
494 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
495 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 496 | **/\r |
ee4dc24f RN |
497 | VOID\r |
498 | EFIAPI\r | |
499 | ParseAcpiBgrt (\r | |
500 | IN BOOLEAN Trace,\r | |
501 | IN UINT8* Ptr,\r | |
502 | IN UINT32 AcpiTableLength,\r | |
503 | IN UINT8 AcpiTableRevision\r | |
504 | );\r | |
505 | \r | |
a6eaba4d DB |
506 | /**\r |
507 | This function parses the ACPI DBG2 table.\r | |
ee4dc24f RN |
508 | When trace is enabled this function parses the DBG2 table and\r |
509 | traces the ACPI table fields.\r | |
510 | \r | |
511 | This function also performs validation of the ACPI table fields.\r | |
512 | \r | |
513 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
514 | @param [in] Ptr Pointer to the start of the buffer.\r | |
515 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
516 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 517 | **/\r |
ee4dc24f RN |
518 | VOID\r |
519 | EFIAPI\r | |
520 | ParseAcpiDbg2 (\r | |
521 | IN BOOLEAN Trace,\r | |
522 | IN UINT8* Ptr,\r | |
523 | IN UINT32 AcpiTableLength,\r | |
524 | IN UINT8 AcpiTableRevision\r | |
525 | );\r | |
526 | \r | |
a6eaba4d DB |
527 | /**\r |
528 | This function parses the ACPI DSDT table.\r | |
ee4dc24f RN |
529 | When trace is enabled this function parses the DSDT table and\r |
530 | traces the ACPI table fields.\r | |
531 | For the DSDT table only the ACPI header fields are parsed and\r | |
532 | traced.\r | |
533 | \r | |
534 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
535 | @param [in] Ptr Pointer to the start of the buffer.\r | |
536 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
537 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 538 | **/\r |
ee4dc24f RN |
539 | VOID\r |
540 | EFIAPI\r | |
541 | ParseAcpiDsdt (\r | |
542 | IN BOOLEAN Trace,\r | |
543 | IN UINT8* Ptr,\r | |
544 | IN UINT32 AcpiTableLength,\r | |
545 | IN UINT8 AcpiTableRevision\r | |
546 | );\r | |
547 | \r | |
d5cf0fba SM |
548 | /**\r |
549 | This function parses the ACPI FACS table.\r | |
550 | When trace is enabled this function parses the FACS table and\r | |
551 | traces the ACPI table fields.\r | |
552 | \r | |
553 | This function also performs validation of the ACPI table fields.\r | |
554 | \r | |
555 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
556 | @param [in] Ptr Pointer to the start of the buffer.\r | |
557 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
558 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
559 | **/\r | |
560 | VOID\r | |
561 | EFIAPI\r | |
562 | ParseAcpiFacs (\r | |
563 | IN BOOLEAN Trace,\r | |
564 | IN UINT8* Ptr,\r | |
565 | IN UINT32 AcpiTableLength,\r | |
566 | IN UINT8 AcpiTableRevision\r | |
567 | );\r | |
568 | \r | |
a6eaba4d DB |
569 | /**\r |
570 | This function parses the ACPI FADT table.\r | |
ee4dc24f RN |
571 | This function parses the FADT table and optionally traces the ACPI\r |
572 | table fields.\r | |
573 | \r | |
574 | This function also performs validation of the ACPI table fields.\r | |
575 | \r | |
576 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
577 | @param [in] Ptr Pointer to the start of the buffer.\r | |
578 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
579 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 580 | **/\r |
ee4dc24f RN |
581 | VOID\r |
582 | EFIAPI\r | |
583 | ParseAcpiFadt (\r | |
584 | IN BOOLEAN Trace,\r | |
585 | IN UINT8* Ptr,\r | |
586 | IN UINT32 AcpiTableLength,\r | |
587 | IN UINT8 AcpiTableRevision\r | |
588 | );\r | |
589 | \r | |
a6eaba4d DB |
590 | /**\r |
591 | This function parses the ACPI GTDT table.\r | |
ee4dc24f RN |
592 | When trace is enabled this function parses the GTDT table and\r |
593 | traces the ACPI table fields.\r | |
594 | \r | |
595 | This function also parses the following platform timer structures:\r | |
596 | - GT Block timer\r | |
597 | - Watchdog timer\r | |
598 | \r | |
599 | This function also performs validation of the ACPI table fields.\r | |
600 | \r | |
601 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
602 | @param [in] Ptr Pointer to the start of the buffer.\r | |
603 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
604 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 605 | **/\r |
ee4dc24f RN |
606 | VOID\r |
607 | EFIAPI\r | |
608 | ParseAcpiGtdt (\r | |
609 | IN BOOLEAN Trace,\r | |
610 | IN UINT8* Ptr,\r | |
611 | IN UINT32 AcpiTableLength,\r | |
612 | IN UINT8 AcpiTableRevision\r | |
613 | );\r | |
614 | \r | |
618e6a1f MMF |
615 | /**\r |
616 | This function parses the ACPI HMAT table.\r | |
617 | When trace is enabled this function parses the HMAT table and\r | |
618 | traces the ACPI table fields.\r | |
619 | \r | |
620 | This function parses the following HMAT structures:\r | |
621 | - Memory Proximity Domain Attributes Structure (Type 0)\r | |
622 | - System Locality Latency and Bandwidth Info Structure (Type 1)\r | |
623 | - Memory Side Cache Info structure (Type 2)\r | |
624 | \r | |
625 | This function also performs validation of the ACPI table fields.\r | |
626 | \r | |
627 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
628 | @param [in] Ptr Pointer to the start of the buffer.\r | |
629 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
630 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
631 | **/\r | |
632 | VOID\r | |
633 | EFIAPI\r | |
634 | ParseAcpiHmat (\r | |
635 | IN BOOLEAN Trace,\r | |
636 | IN UINT8* Ptr,\r | |
637 | IN UINT32 AcpiTableLength,\r | |
638 | IN UINT8 AcpiTableRevision\r | |
639 | );\r | |
640 | \r | |
a6eaba4d DB |
641 | /**\r |
642 | This function parses the ACPI IORT table.\r | |
ee4dc24f RN |
643 | When trace is enabled this function parses the IORT table and\r |
644 | traces the ACPI fields.\r | |
645 | \r | |
646 | This function also parses the following nodes:\r | |
647 | - ITS Group\r | |
648 | - Named Component\r | |
649 | - Root Complex\r | |
650 | - SMMUv1/2\r | |
651 | - SMMUv3\r | |
652 | - PMCG\r | |
653 | \r | |
654 | This function also performs validation of the ACPI table fields.\r | |
655 | \r | |
656 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
657 | @param [in] Ptr Pointer to the start of the buffer.\r | |
658 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
659 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 660 | **/\r |
ee4dc24f RN |
661 | VOID\r |
662 | EFIAPI\r | |
663 | ParseAcpiIort (\r | |
664 | IN BOOLEAN Trace,\r | |
665 | IN UINT8* Ptr,\r | |
666 | IN UINT32 AcpiTableLength,\r | |
667 | IN UINT8 AcpiTableRevision\r | |
668 | );\r | |
669 | \r | |
a6eaba4d DB |
670 | /**\r |
671 | This function parses the ACPI MADT table.\r | |
ee4dc24f RN |
672 | When trace is enabled this function parses the MADT table and\r |
673 | traces the ACPI table fields.\r | |
674 | \r | |
675 | This function currently parses the following Interrupt Controller\r | |
676 | Structures:\r | |
677 | - GICC\r | |
678 | - GICD\r | |
679 | - GIC MSI Frame\r | |
680 | - GICR\r | |
681 | - GIC ITS\r | |
682 | \r | |
683 | This function also performs validation of the ACPI table fields.\r | |
684 | \r | |
685 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
686 | @param [in] Ptr Pointer to the start of the buffer.\r | |
687 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
688 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 689 | **/\r |
ee4dc24f RN |
690 | VOID\r |
691 | EFIAPI\r | |
692 | ParseAcpiMadt (\r | |
693 | IN BOOLEAN Trace,\r | |
694 | IN UINT8* Ptr,\r | |
695 | IN UINT32 AcpiTableLength,\r | |
696 | IN UINT8 AcpiTableRevision\r | |
697 | );\r | |
698 | \r | |
a6eaba4d DB |
699 | /**\r |
700 | This function parses the ACPI MCFG table.\r | |
ee4dc24f RN |
701 | When trace is enabled this function parses the MCFG table and\r |
702 | traces the ACPI table fields.\r | |
703 | \r | |
704 | This function also performs validation of the ACPI table fields.\r | |
705 | \r | |
706 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
707 | @param [in] Ptr Pointer to the start of the buffer.\r | |
708 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
709 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 710 | **/\r |
ee4dc24f RN |
711 | VOID\r |
712 | EFIAPI\r | |
713 | ParseAcpiMcfg (\r | |
714 | IN BOOLEAN Trace,\r | |
715 | IN UINT8* Ptr,\r | |
716 | IN UINT32 AcpiTableLength,\r | |
717 | IN UINT8 AcpiTableRevision\r | |
718 | );\r | |
719 | \r | |
d4633b36 MMF |
720 | /**\r |
721 | This function parses the ACPI PCCT table including its sub-structures\r | |
722 | of type 0 through 4.\r | |
723 | When trace is enabled this function parses the PCCT table and\r | |
724 | traces the ACPI table fields.\r | |
725 | \r | |
726 | This function also performs validation of the ACPI table fields.\r | |
727 | \r | |
728 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
729 | @param [in] Ptr Pointer to the start of the buffer.\r | |
730 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
731 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
732 | **/\r | |
733 | VOID\r | |
734 | EFIAPI\r | |
735 | ParseAcpiPcct (\r | |
736 | IN BOOLEAN Trace,\r | |
737 | IN UINT8* Ptr,\r | |
738 | IN UINT32 AcpiTableLength,\r | |
739 | IN UINT8 AcpiTableRevision\r | |
740 | );\r | |
741 | \r | |
d4d2fdf2 KK |
742 | /**\r |
743 | This function parses the ACPI PPTT table.\r | |
744 | When trace is enabled this function parses the PPTT table and\r | |
745 | traces the ACPI table fields.\r | |
746 | \r | |
747 | This function also performs validation of the ACPI table fields.\r | |
748 | \r | |
749 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
750 | @param [in] Ptr Pointer to the start of the buffer.\r | |
751 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
752 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
753 | **/\r | |
754 | VOID\r | |
755 | EFIAPI\r | |
756 | ParseAcpiPptt (\r | |
757 | IN BOOLEAN Trace,\r | |
758 | IN UINT8* Ptr,\r | |
759 | IN UINT32 AcpiTableLength,\r | |
760 | IN UINT8 AcpiTableRevision\r | |
761 | );\r | |
762 | \r | |
a6eaba4d DB |
763 | /**\r |
764 | This function parses the ACPI RSDP table.\r | |
ee4dc24f RN |
765 | \r |
766 | This function invokes the parser for the XSDT table.\r | |
767 | * Note - This function does not support parsing of RSDT table.\r | |
768 | \r | |
769 | This function also performs a RAW dump of the ACPI table and\r | |
770 | validates the checksum.\r | |
771 | \r | |
772 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
773 | @param [in] Ptr Pointer to the start of the buffer.\r | |
774 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
775 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 776 | **/\r |
ee4dc24f RN |
777 | VOID\r |
778 | EFIAPI\r | |
779 | ParseAcpiRsdp (\r | |
780 | IN BOOLEAN Trace,\r | |
781 | IN UINT8* Ptr,\r | |
782 | IN UINT32 AcpiTableLength,\r | |
783 | IN UINT8 AcpiTableRevision\r | |
784 | );\r | |
785 | \r | |
a6eaba4d DB |
786 | /**\r |
787 | This function parses the ACPI SLIT table.\r | |
ee4dc24f RN |
788 | When trace is enabled this function parses the SLIT table and\r |
789 | traces the ACPI table fields.\r | |
790 | \r | |
791 | This function also validates System Localities for the following:\r | |
792 | - Diagonal elements have a normalized value of 10\r | |
793 | - Relative distance from System Locality at i*N+j is same as\r | |
794 | j*N+i\r | |
795 | \r | |
796 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
797 | @param [in] Ptr Pointer to the start of the buffer.\r | |
798 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
799 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 800 | **/\r |
ee4dc24f RN |
801 | VOID\r |
802 | EFIAPI\r | |
803 | ParseAcpiSlit (\r | |
804 | IN BOOLEAN Trace,\r | |
805 | IN UINT8* Ptr,\r | |
806 | IN UINT32 AcpiTableLength,\r | |
807 | IN UINT8 AcpiTableRevision\r | |
808 | );\r | |
809 | \r | |
a6eaba4d DB |
810 | /**\r |
811 | This function parses the ACPI SPCR table.\r | |
ee4dc24f RN |
812 | When trace is enabled this function parses the SPCR table and\r |
813 | traces the ACPI table fields.\r | |
814 | \r | |
815 | This function also performs validations of the ACPI table fields.\r | |
816 | \r | |
817 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
818 | @param [in] Ptr Pointer to the start of the buffer.\r | |
819 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
820 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 821 | **/\r |
ee4dc24f RN |
822 | VOID\r |
823 | EFIAPI\r | |
824 | ParseAcpiSpcr (\r | |
825 | IN BOOLEAN Trace,\r | |
826 | IN UINT8* Ptr,\r | |
827 | IN UINT32 AcpiTableLength,\r | |
828 | IN UINT8 AcpiTableRevision\r | |
829 | );\r | |
830 | \r | |
a6eaba4d DB |
831 | /**\r |
832 | This function parses the ACPI SRAT table.\r | |
ee4dc24f RN |
833 | When trace is enabled this function parses the SRAT table and\r |
834 | traces the ACPI table fields.\r | |
835 | \r | |
836 | This function parses the following Resource Allocation Structures:\r | |
837 | - Processor Local APIC/SAPIC Affinity Structure\r | |
838 | - Memory Affinity Structure\r | |
839 | - Processor Local x2APIC Affinity Structure\r | |
840 | - GICC Affinity Structure\r | |
841 | \r | |
842 | This function also performs validation of the ACPI table fields.\r | |
843 | \r | |
844 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
845 | @param [in] Ptr Pointer to the start of the buffer.\r | |
846 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
847 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 848 | **/\r |
ee4dc24f RN |
849 | VOID\r |
850 | EFIAPI\r | |
851 | ParseAcpiSrat (\r | |
852 | IN BOOLEAN Trace,\r | |
853 | IN UINT8* Ptr,\r | |
854 | IN UINT32 AcpiTableLength,\r | |
855 | IN UINT8 AcpiTableRevision\r | |
856 | );\r | |
857 | \r | |
a6eaba4d DB |
858 | /**\r |
859 | This function parses the ACPI SSDT table.\r | |
ee4dc24f RN |
860 | When trace is enabled this function parses the SSDT table and\r |
861 | traces the ACPI table fields.\r | |
862 | For the SSDT table only the ACPI header fields are\r | |
863 | parsed and traced.\r | |
864 | \r | |
865 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
866 | @param [in] Ptr Pointer to the start of the buffer.\r | |
867 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
868 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 869 | **/\r |
ee4dc24f RN |
870 | VOID\r |
871 | EFIAPI\r | |
872 | ParseAcpiSsdt (\r | |
873 | IN BOOLEAN Trace,\r | |
874 | IN UINT8* Ptr,\r | |
875 | IN UINT32 AcpiTableLength,\r | |
876 | IN UINT8 AcpiTableRevision\r | |
877 | );\r | |
878 | \r | |
a6eaba4d DB |
879 | /**\r |
880 | This function parses the ACPI XSDT table\r | |
ee4dc24f RN |
881 | and optionally traces the ACPI table fields.\r |
882 | \r | |
883 | This function also performs validation of the XSDT table.\r | |
884 | \r | |
885 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
886 | @param [in] Ptr Pointer to the start of the buffer.\r | |
887 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
888 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 889 | **/\r |
ee4dc24f RN |
890 | VOID\r |
891 | EFIAPI\r | |
892 | ParseAcpiXsdt (\r | |
893 | IN BOOLEAN Trace,\r | |
894 | IN UINT8* Ptr,\r | |
895 | IN UINT32 AcpiTableLength,\r | |
896 | IN UINT8 AcpiTableRevision\r | |
897 | );\r | |
898 | \r | |
899 | #endif // ACPIPARSER_H_\r |