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