]>
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 | |
8c1b1fe6 CJ |
286 | /// a pointer to the field data. This value is set after the FieldValidator\r |
287 | /// has been called and therefore should not be used by the FieldValidator.\r | |
288 | /// If unused this must be set to NULL.\r | |
ee4dc24f RN |
289 | VOID** ItemPtr;\r |
290 | \r | |
291 | /// Optional pointer to a field validator function.\r | |
292 | /// The function should directly report any appropriate error or warning\r | |
293 | /// and invoke the appropriate counter update function.\r | |
294 | /// If not used this parameter must be set to NULL.\r | |
295 | FNPTR_FIELD_VALIDATOR FieldValidator;\r | |
296 | \r | |
297 | /// Optional pointer to context specific information,\r | |
298 | /// which the Field Validator function can use to determine\r | |
299 | /// additional information about the ACPI table and make\r | |
300 | /// decisions about the field being validated.\r | |
301 | /// e.g. this could be a pointer to the ACPI table header\r | |
302 | VOID* Context;\r | |
303 | } ACPI_PARSER;\r | |
304 | \r | |
a6eaba4d DB |
305 | /**\r |
306 | A structure used to store the pointers to the members of the\r | |
307 | ACPI description header structure that was parsed.\r | |
308 | **/\r | |
ee4dc24f RN |
309 | typedef struct AcpiDescriptionHeaderInfo {\r |
310 | /// ACPI table signature\r | |
311 | UINT32* Signature;\r | |
312 | /// Length of the ACPI table\r | |
313 | UINT32* Length;\r | |
314 | /// Revision\r | |
315 | UINT8* Revision;\r | |
316 | /// Checksum\r | |
317 | UINT8* Checksum;\r | |
318 | /// OEM Id - length is 6 bytes\r | |
319 | UINT8* OemId;\r | |
320 | /// OEM table Id\r | |
321 | UINT64* OemTableId;\r | |
322 | /// OEM revision Id\r | |
323 | UINT32* OemRevision;\r | |
324 | /// Creator Id\r | |
325 | UINT32* CreatorId;\r | |
326 | /// Creator revision\r | |
327 | UINT32* CreatorRevision;\r | |
328 | } ACPI_DESCRIPTION_HEADER_INFO;\r | |
329 | \r | |
a6eaba4d DB |
330 | /**\r |
331 | This function is used to parse an ACPI table buffer.\r | |
ee4dc24f RN |
332 | \r |
333 | The ACPI table buffer is parsed using the ACPI table parser information\r | |
334 | specified by a pointer to an array of ACPI_PARSER elements. This parser\r | |
335 | function iterates through each item on the ACPI_PARSER array and logs the\r | |
336 | ACPI table fields.\r | |
337 | \r | |
338 | This function can optionally be used to parse ACPI tables and fetch specific\r | |
339 | field values. The ItemPtr member of the ACPI_PARSER structure (where used)\r | |
340 | is updated by this parser function to point to the selected field data\r | |
341 | (e.g. useful for variable length nested fields).\r | |
342 | \r | |
343 | @param [in] Trace Trace the ACPI fields TRUE else only parse the\r | |
344 | table.\r | |
345 | @param [in] Indent Number of spaces to indent the output.\r | |
346 | @param [in] AsciiName Optional pointer to an ASCII string that describes\r | |
347 | the table being parsed.\r | |
348 | @param [in] Ptr Pointer to the start of the buffer.\r | |
349 | @param [in] Length Length of the buffer pointed by Ptr.\r | |
350 | @param [in] Parser Pointer to an array of ACPI_PARSER structure that\r | |
351 | describes the table being parsed.\r | |
352 | @param [in] ParserItems Number of items in the ACPI_PARSER array.\r | |
353 | \r | |
354 | @retval Number of bytes parsed.\r | |
a6eaba4d | 355 | **/\r |
ee4dc24f RN |
356 | UINT32\r |
357 | EFIAPI\r | |
358 | ParseAcpi (\r | |
359 | IN BOOLEAN Trace,\r | |
360 | IN UINT32 Indent,\r | |
361 | IN CONST CHAR8* AsciiName OPTIONAL,\r | |
362 | IN UINT8* Ptr,\r | |
363 | IN UINT32 Length,\r | |
364 | IN CONST ACPI_PARSER* Parser,\r | |
365 | IN UINT32 ParserItems\r | |
a6eaba4d | 366 | );\r |
ee4dc24f | 367 | \r |
a6eaba4d DB |
368 | /**\r |
369 | This is a helper macro to pass parameters to the Parser functions.\r | |
ee4dc24f RN |
370 | \r |
371 | @param [in] Parser The name of the ACPI_PARSER array describing the\r | |
372 | ACPI table fields.\r | |
a6eaba4d | 373 | **/\r |
ee4dc24f RN |
374 | #define PARSER_PARAMS(Parser) Parser, sizeof (Parser) / sizeof (Parser[0])\r |
375 | \r | |
a6eaba4d DB |
376 | /**\r |
377 | This is a helper macro for describing the ACPI header fields.\r | |
ee4dc24f RN |
378 | \r |
379 | @param [out] Info Pointer to retrieve the ACPI table header information.\r | |
a6eaba4d | 380 | **/\r |
ee4dc24f RN |
381 | #define PARSE_ACPI_HEADER(Info) \\r |
382 | { L"Signature", 4, 0, NULL, Dump4Chars, \\r | |
383 | (VOID**)&(Info)->Signature , NULL, NULL }, \\r | |
384 | { L"Length", 4, 4, L"%d", NULL, \\r | |
385 | (VOID**)&(Info)->Length, NULL, NULL }, \\r | |
386 | { L"Revision", 1, 8, L"%d", NULL, \\r | |
387 | (VOID**)&(Info)->Revision, NULL, NULL }, \\r | |
388 | { L"Checksum", 1, 9, L"0x%X", NULL, \\r | |
389 | (VOID**)&(Info)->Checksum, NULL, NULL }, \\r | |
390 | { L"Oem ID", 6, 10, NULL, Dump6Chars, \\r | |
391 | (VOID**)&(Info)->OemId, NULL, NULL }, \\r | |
392 | { L"Oem Table ID", 8, 16, NULL, Dump8Chars, \\r | |
393 | (VOID**)&(Info)->OemTableId, NULL, NULL }, \\r | |
394 | { L"Oem Revision", 4, 24, L"0x%X", NULL, \\r | |
395 | (VOID**)&(Info)->OemRevision, NULL, NULL }, \\r | |
396 | { L"Creator ID", 4, 28, NULL, Dump4Chars, \\r | |
397 | (VOID**)&(Info)->CreatorId, NULL, NULL }, \\r | |
398 | { L"Creator Revision", 4, 32, L"0x%X", NULL, \\r | |
399 | (VOID**)&(Info)->CreatorRevision, NULL, NULL }\r | |
400 | \r | |
a6eaba4d DB |
401 | /**\r |
402 | This function indents and traces the GAS structure as described by the GasParser.\r | |
ee4dc24f RN |
403 | \r |
404 | @param [in] Ptr Pointer to the start of the buffer.\r | |
405 | @param [in] Indent Number of spaces to indent the output.\r | |
58cc0ffe KK |
406 | @param [in] Length Length of the GAS structure buffer.\r |
407 | \r | |
408 | @retval Number of bytes parsed.\r | |
a6eaba4d | 409 | **/\r |
58cc0ffe | 410 | UINT32\r |
ee4dc24f RN |
411 | EFIAPI\r |
412 | DumpGasStruct (\r | |
413 | IN UINT8* Ptr,\r | |
58cc0ffe KK |
414 | IN UINT32 Indent,\r |
415 | IN UINT32 Length\r | |
ee4dc24f RN |
416 | );\r |
417 | \r | |
a6eaba4d DB |
418 | /**\r |
419 | This function traces the GAS structure as described by the GasParser.\r | |
ee4dc24f RN |
420 | \r |
421 | @param [in] Format Optional format string for tracing the data.\r | |
422 | @param [in] Ptr Pointer to the start of the buffer.\r | |
a6eaba4d | 423 | **/\r |
ee4dc24f RN |
424 | VOID\r |
425 | EFIAPI\r | |
426 | DumpGas (\r | |
427 | IN CONST CHAR16* Format OPTIONAL,\r | |
428 | IN UINT8* Ptr\r | |
429 | );\r | |
430 | \r | |
a6eaba4d DB |
431 | /**\r |
432 | This function traces the ACPI header as described by the AcpiHeaderParser.\r | |
ee4dc24f RN |
433 | \r |
434 | @param [in] Ptr Pointer to the start of the buffer.\r | |
435 | \r | |
436 | @retval Number of bytes parsed.\r | |
a6eaba4d | 437 | **/\r |
ee4dc24f RN |
438 | UINT32\r |
439 | EFIAPI\r | |
440 | DumpAcpiHeader (\r | |
441 | IN UINT8* Ptr\r | |
442 | );\r | |
443 | \r | |
a6eaba4d DB |
444 | /**\r |
445 | This function parses the ACPI header as described by the AcpiHeaderParser.\r | |
ee4dc24f RN |
446 | \r |
447 | This function optionally returns the Signature, Length and revision of the\r | |
448 | ACPI table.\r | |
449 | \r | |
450 | @param [in] Ptr Pointer to the start of the buffer.\r | |
451 | @param [out] Signature Gets location of the ACPI table signature.\r | |
452 | @param [out] Length Gets location of the length of the ACPI table.\r | |
453 | @param [out] Revision Gets location of the revision of the ACPI table.\r | |
454 | \r | |
455 | @retval Number of bytes parsed.\r | |
a6eaba4d | 456 | **/\r |
ee4dc24f RN |
457 | UINT32\r |
458 | EFIAPI\r | |
459 | ParseAcpiHeader (\r | |
460 | IN UINT8* Ptr,\r | |
461 | OUT CONST UINT32** Signature,\r | |
462 | OUT CONST UINT32** Length,\r | |
463 | OUT CONST UINT8** Revision\r | |
464 | );\r | |
465 | \r | |
1d3d5e32 MMF |
466 | /**\r |
467 | This function parses the ACPI AEST table.\r | |
468 | When trace is enabled this function parses the AEST table and\r | |
469 | traces the ACPI table fields.\r | |
470 | \r | |
471 | This function also performs validation of the ACPI table fields.\r | |
472 | \r | |
473 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
474 | @param [in] Ptr Pointer to the start of the buffer.\r | |
475 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
476 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
477 | **/\r | |
478 | VOID\r | |
479 | EFIAPI\r | |
480 | ParseAcpiAest (\r | |
481 | IN BOOLEAN Trace,\r | |
482 | IN UINT8* Ptr,\r | |
483 | IN UINT32 AcpiTableLength,\r | |
484 | IN UINT8 AcpiTableRevision\r | |
485 | );\r | |
486 | \r | |
a6eaba4d DB |
487 | /**\r |
488 | This function parses the ACPI BGRT table.\r | |
ee4dc24f RN |
489 | When trace is enabled this function parses the BGRT table and\r |
490 | traces the ACPI table fields.\r | |
491 | \r | |
492 | This function also performs validation of the ACPI table fields.\r | |
493 | \r | |
494 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
495 | @param [in] Ptr Pointer to the start of the buffer.\r | |
496 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
497 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 498 | **/\r |
ee4dc24f RN |
499 | VOID\r |
500 | EFIAPI\r | |
501 | ParseAcpiBgrt (\r | |
502 | IN BOOLEAN Trace,\r | |
503 | IN UINT8* Ptr,\r | |
504 | IN UINT32 AcpiTableLength,\r | |
505 | IN UINT8 AcpiTableRevision\r | |
506 | );\r | |
507 | \r | |
a6eaba4d DB |
508 | /**\r |
509 | This function parses the ACPI DBG2 table.\r | |
ee4dc24f RN |
510 | When trace is enabled this function parses the DBG2 table and\r |
511 | traces the ACPI table fields.\r | |
512 | \r | |
513 | This function also performs validation of the ACPI table fields.\r | |
514 | \r | |
515 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
516 | @param [in] Ptr Pointer to the start of the buffer.\r | |
517 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
518 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 519 | **/\r |
ee4dc24f RN |
520 | VOID\r |
521 | EFIAPI\r | |
522 | ParseAcpiDbg2 (\r | |
523 | IN BOOLEAN Trace,\r | |
524 | IN UINT8* Ptr,\r | |
525 | IN UINT32 AcpiTableLength,\r | |
526 | IN UINT8 AcpiTableRevision\r | |
527 | );\r | |
528 | \r | |
a6eaba4d DB |
529 | /**\r |
530 | This function parses the ACPI DSDT table.\r | |
ee4dc24f RN |
531 | When trace is enabled this function parses the DSDT table and\r |
532 | traces the ACPI table fields.\r | |
533 | For the DSDT table only the ACPI header fields are parsed and\r | |
534 | traced.\r | |
535 | \r | |
536 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
537 | @param [in] Ptr Pointer to the start of the buffer.\r | |
538 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
539 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 540 | **/\r |
ee4dc24f RN |
541 | VOID\r |
542 | EFIAPI\r | |
543 | ParseAcpiDsdt (\r | |
544 | IN BOOLEAN Trace,\r | |
545 | IN UINT8* Ptr,\r | |
546 | IN UINT32 AcpiTableLength,\r | |
547 | IN UINT8 AcpiTableRevision\r | |
548 | );\r | |
549 | \r | |
d5cf0fba SM |
550 | /**\r |
551 | This function parses the ACPI FACS table.\r | |
552 | When trace is enabled this function parses the FACS table and\r | |
553 | traces the ACPI table fields.\r | |
554 | \r | |
555 | This function also performs validation of the ACPI table fields.\r | |
556 | \r | |
557 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
558 | @param [in] Ptr Pointer to the start of the buffer.\r | |
559 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
560 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
561 | **/\r | |
562 | VOID\r | |
563 | EFIAPI\r | |
564 | ParseAcpiFacs (\r | |
565 | IN BOOLEAN Trace,\r | |
566 | IN UINT8* Ptr,\r | |
567 | IN UINT32 AcpiTableLength,\r | |
568 | IN UINT8 AcpiTableRevision\r | |
569 | );\r | |
570 | \r | |
a6eaba4d DB |
571 | /**\r |
572 | This function parses the ACPI FADT table.\r | |
ee4dc24f RN |
573 | This function parses the FADT table and optionally traces the ACPI\r |
574 | table fields.\r | |
575 | \r | |
576 | This function also performs validation of the ACPI table fields.\r | |
577 | \r | |
578 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
579 | @param [in] Ptr Pointer to the start of the buffer.\r | |
580 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
581 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 582 | **/\r |
ee4dc24f RN |
583 | VOID\r |
584 | EFIAPI\r | |
585 | ParseAcpiFadt (\r | |
586 | IN BOOLEAN Trace,\r | |
587 | IN UINT8* Ptr,\r | |
588 | IN UINT32 AcpiTableLength,\r | |
589 | IN UINT8 AcpiTableRevision\r | |
590 | );\r | |
591 | \r | |
a6eaba4d DB |
592 | /**\r |
593 | This function parses the ACPI GTDT table.\r | |
ee4dc24f RN |
594 | When trace is enabled this function parses the GTDT table and\r |
595 | traces the ACPI table fields.\r | |
596 | \r | |
597 | This function also parses the following platform timer structures:\r | |
598 | - GT Block timer\r | |
599 | - Watchdog timer\r | |
600 | \r | |
601 | This function also performs validation of the ACPI table fields.\r | |
602 | \r | |
603 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
604 | @param [in] Ptr Pointer to the start of the buffer.\r | |
605 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
606 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 607 | **/\r |
ee4dc24f RN |
608 | VOID\r |
609 | EFIAPI\r | |
610 | ParseAcpiGtdt (\r | |
611 | IN BOOLEAN Trace,\r | |
612 | IN UINT8* Ptr,\r | |
613 | IN UINT32 AcpiTableLength,\r | |
614 | IN UINT8 AcpiTableRevision\r | |
615 | );\r | |
616 | \r | |
618e6a1f MMF |
617 | /**\r |
618 | This function parses the ACPI HMAT table.\r | |
619 | When trace is enabled this function parses the HMAT table and\r | |
620 | traces the ACPI table fields.\r | |
621 | \r | |
622 | This function parses the following HMAT structures:\r | |
623 | - Memory Proximity Domain Attributes Structure (Type 0)\r | |
624 | - System Locality Latency and Bandwidth Info Structure (Type 1)\r | |
625 | - Memory Side Cache Info structure (Type 2)\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 | |
633 | **/\r | |
634 | VOID\r | |
635 | EFIAPI\r | |
636 | ParseAcpiHmat (\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 IORT table.\r | |
ee4dc24f RN |
645 | When trace is enabled this function parses the IORT table and\r |
646 | traces the ACPI fields.\r | |
647 | \r | |
648 | This function also parses the following nodes:\r | |
649 | - ITS Group\r | |
650 | - Named Component\r | |
651 | - Root Complex\r | |
652 | - SMMUv1/2\r | |
653 | - SMMUv3\r | |
654 | - PMCG\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 | ParseAcpiIort (\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 MADT table.\r | |
ee4dc24f RN |
674 | When trace is enabled this function parses the MADT table and\r |
675 | traces the ACPI table fields.\r | |
676 | \r | |
677 | This function currently parses the following Interrupt Controller\r | |
678 | Structures:\r | |
679 | - GICC\r | |
680 | - GICD\r | |
681 | - GIC MSI Frame\r | |
682 | - GICR\r | |
683 | - GIC ITS\r | |
684 | \r | |
685 | This function also performs validation of the ACPI table fields.\r | |
686 | \r | |
687 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
688 | @param [in] Ptr Pointer to the start of the buffer.\r | |
689 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
690 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 691 | **/\r |
ee4dc24f RN |
692 | VOID\r |
693 | EFIAPI\r | |
694 | ParseAcpiMadt (\r | |
695 | IN BOOLEAN Trace,\r | |
696 | IN UINT8* Ptr,\r | |
697 | IN UINT32 AcpiTableLength,\r | |
698 | IN UINT8 AcpiTableRevision\r | |
699 | );\r | |
700 | \r | |
a6eaba4d DB |
701 | /**\r |
702 | This function parses the ACPI MCFG table.\r | |
ee4dc24f RN |
703 | When trace is enabled this function parses the MCFG table and\r |
704 | traces the ACPI table fields.\r | |
705 | \r | |
706 | This function also performs validation of the ACPI table fields.\r | |
707 | \r | |
708 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
709 | @param [in] Ptr Pointer to the start of the buffer.\r | |
710 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
711 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 712 | **/\r |
ee4dc24f RN |
713 | VOID\r |
714 | EFIAPI\r | |
715 | ParseAcpiMcfg (\r | |
716 | IN BOOLEAN Trace,\r | |
717 | IN UINT8* Ptr,\r | |
718 | IN UINT32 AcpiTableLength,\r | |
719 | IN UINT8 AcpiTableRevision\r | |
720 | );\r | |
721 | \r | |
d4633b36 MMF |
722 | /**\r |
723 | This function parses the ACPI PCCT table including its sub-structures\r | |
724 | of type 0 through 4.\r | |
725 | When trace is enabled this function parses the PCCT table and\r | |
726 | traces the ACPI table fields.\r | |
727 | \r | |
728 | This function also performs validation of the ACPI table fields.\r | |
729 | \r | |
730 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
731 | @param [in] Ptr Pointer to the start of the buffer.\r | |
732 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
733 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
734 | **/\r | |
735 | VOID\r | |
736 | EFIAPI\r | |
737 | ParseAcpiPcct (\r | |
738 | IN BOOLEAN Trace,\r | |
739 | IN UINT8* Ptr,\r | |
740 | IN UINT32 AcpiTableLength,\r | |
741 | IN UINT8 AcpiTableRevision\r | |
742 | );\r | |
743 | \r | |
d4d2fdf2 KK |
744 | /**\r |
745 | This function parses the ACPI PPTT table.\r | |
746 | When trace is enabled this function parses the PPTT table and\r | |
747 | traces the ACPI table fields.\r | |
748 | \r | |
749 | This function also performs validation of the ACPI table fields.\r | |
750 | \r | |
751 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
752 | @param [in] Ptr Pointer to the start of the buffer.\r | |
753 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
754 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
755 | **/\r | |
756 | VOID\r | |
757 | EFIAPI\r | |
758 | ParseAcpiPptt (\r | |
759 | IN BOOLEAN Trace,\r | |
760 | IN UINT8* Ptr,\r | |
761 | IN UINT32 AcpiTableLength,\r | |
762 | IN UINT8 AcpiTableRevision\r | |
763 | );\r | |
764 | \r | |
a6eaba4d DB |
765 | /**\r |
766 | This function parses the ACPI RSDP table.\r | |
ee4dc24f RN |
767 | \r |
768 | This function invokes the parser for the XSDT table.\r | |
769 | * Note - This function does not support parsing of RSDT table.\r | |
770 | \r | |
771 | This function also performs a RAW dump of the ACPI table and\r | |
772 | validates the checksum.\r | |
773 | \r | |
774 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
775 | @param [in] Ptr Pointer to the start of the buffer.\r | |
776 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
777 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 778 | **/\r |
ee4dc24f RN |
779 | VOID\r |
780 | EFIAPI\r | |
781 | ParseAcpiRsdp (\r | |
782 | IN BOOLEAN Trace,\r | |
783 | IN UINT8* Ptr,\r | |
784 | IN UINT32 AcpiTableLength,\r | |
785 | IN UINT8 AcpiTableRevision\r | |
786 | );\r | |
787 | \r | |
a6eaba4d DB |
788 | /**\r |
789 | This function parses the ACPI SLIT table.\r | |
ee4dc24f RN |
790 | When trace is enabled this function parses the SLIT table and\r |
791 | traces the ACPI table fields.\r | |
792 | \r | |
793 | This function also validates System Localities for the following:\r | |
794 | - Diagonal elements have a normalized value of 10\r | |
795 | - Relative distance from System Locality at i*N+j is same as\r | |
796 | j*N+i\r | |
797 | \r | |
798 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
799 | @param [in] Ptr Pointer to the start of the buffer.\r | |
800 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
801 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 802 | **/\r |
ee4dc24f RN |
803 | VOID\r |
804 | EFIAPI\r | |
805 | ParseAcpiSlit (\r | |
806 | IN BOOLEAN Trace,\r | |
807 | IN UINT8* Ptr,\r | |
808 | IN UINT32 AcpiTableLength,\r | |
809 | IN UINT8 AcpiTableRevision\r | |
810 | );\r | |
811 | \r | |
a6eaba4d DB |
812 | /**\r |
813 | This function parses the ACPI SPCR table.\r | |
ee4dc24f RN |
814 | When trace is enabled this function parses the SPCR table and\r |
815 | traces the ACPI table fields.\r | |
816 | \r | |
817 | This function also performs validations of the ACPI table fields.\r | |
818 | \r | |
819 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
820 | @param [in] Ptr Pointer to the start of the buffer.\r | |
821 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
822 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 823 | **/\r |
ee4dc24f RN |
824 | VOID\r |
825 | EFIAPI\r | |
826 | ParseAcpiSpcr (\r | |
827 | IN BOOLEAN Trace,\r | |
828 | IN UINT8* Ptr,\r | |
829 | IN UINT32 AcpiTableLength,\r | |
830 | IN UINT8 AcpiTableRevision\r | |
831 | );\r | |
832 | \r | |
a6eaba4d DB |
833 | /**\r |
834 | This function parses the ACPI SRAT table.\r | |
ee4dc24f RN |
835 | When trace is enabled this function parses the SRAT table and\r |
836 | traces the ACPI table fields.\r | |
837 | \r | |
838 | This function parses the following Resource Allocation Structures:\r | |
839 | - Processor Local APIC/SAPIC Affinity Structure\r | |
840 | - Memory Affinity Structure\r | |
841 | - Processor Local x2APIC Affinity Structure\r | |
842 | - GICC Affinity Structure\r | |
843 | \r | |
844 | This function also performs validation of the ACPI table fields.\r | |
845 | \r | |
846 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
847 | @param [in] Ptr Pointer to the start of the buffer.\r | |
848 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
849 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 850 | **/\r |
ee4dc24f RN |
851 | VOID\r |
852 | EFIAPI\r | |
853 | ParseAcpiSrat (\r | |
854 | IN BOOLEAN Trace,\r | |
855 | IN UINT8* Ptr,\r | |
856 | IN UINT32 AcpiTableLength,\r | |
857 | IN UINT8 AcpiTableRevision\r | |
858 | );\r | |
859 | \r | |
a6eaba4d DB |
860 | /**\r |
861 | This function parses the ACPI SSDT table.\r | |
ee4dc24f RN |
862 | When trace is enabled this function parses the SSDT table and\r |
863 | traces the ACPI table fields.\r | |
864 | For the SSDT table only the ACPI header fields are\r | |
865 | parsed and traced.\r | |
866 | \r | |
867 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
868 | @param [in] Ptr Pointer to the start of the buffer.\r | |
869 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
870 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 871 | **/\r |
ee4dc24f RN |
872 | VOID\r |
873 | EFIAPI\r | |
874 | ParseAcpiSsdt (\r | |
875 | IN BOOLEAN Trace,\r | |
876 | IN UINT8* Ptr,\r | |
877 | IN UINT32 AcpiTableLength,\r | |
878 | IN UINT8 AcpiTableRevision\r | |
879 | );\r | |
880 | \r | |
a6eaba4d DB |
881 | /**\r |
882 | This function parses the ACPI XSDT table\r | |
ee4dc24f RN |
883 | and optionally traces the ACPI table fields.\r |
884 | \r | |
885 | This function also performs validation of the XSDT table.\r | |
886 | \r | |
887 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
888 | @param [in] Ptr Pointer to the start of the buffer.\r | |
889 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
890 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
a6eaba4d | 891 | **/\r |
ee4dc24f RN |
892 | VOID\r |
893 | EFIAPI\r | |
894 | ParseAcpiXsdt (\r | |
895 | IN BOOLEAN Trace,\r | |
896 | IN UINT8* Ptr,\r | |
897 | IN UINT32 AcpiTableLength,\r | |
898 | IN UINT8 AcpiTableRevision\r | |
899 | );\r | |
900 | \r | |
901 | #endif // ACPIPARSER_H_\r |