dmtbdump1.c revision 1.1.1.5 1 1.1 christos /******************************************************************************
2 1.1 christos *
3 1.1 christos * Module Name: dmtbdump1 - Dump ACPI data tables that contain no AML code
4 1.1 christos *
5 1.1 christos *****************************************************************************/
6 1.1 christos
7 1.1 christos /*
8 1.1.1.5 christos * Copyright (C) 2000 - 2021, Intel Corp.
9 1.1 christos * All rights reserved.
10 1.1 christos *
11 1.1 christos * Redistribution and use in source and binary forms, with or without
12 1.1 christos * modification, are permitted provided that the following conditions
13 1.1 christos * are met:
14 1.1 christos * 1. Redistributions of source code must retain the above copyright
15 1.1 christos * notice, this list of conditions, and the following disclaimer,
16 1.1 christos * without modification.
17 1.1 christos * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.1 christos * substantially similar to the "NO WARRANTY" disclaimer below
19 1.1 christos * ("Disclaimer") and any redistribution must be conditioned upon
20 1.1 christos * including a substantially similar Disclaimer requirement for further
21 1.1 christos * binary redistribution.
22 1.1 christos * 3. Neither the names of the above-listed copyright holders nor the names
23 1.1 christos * of any contributors may be used to endorse or promote products derived
24 1.1 christos * from this software without specific prior written permission.
25 1.1 christos *
26 1.1 christos * Alternatively, this software may be distributed under the terms of the
27 1.1 christos * GNU General Public License ("GPL") version 2 as published by the Free
28 1.1 christos * Software Foundation.
29 1.1 christos *
30 1.1 christos * NO WARRANTY
31 1.1 christos * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.1 christos * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.1.1.5 christos * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
34 1.1 christos * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.1 christos * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.1 christos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.1 christos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.1 christos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.1 christos * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.1 christos * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.1 christos * POSSIBILITY OF SUCH DAMAGES.
42 1.1 christos */
43 1.1 christos
44 1.1 christos #include "acpi.h"
45 1.1 christos #include "accommon.h"
46 1.1 christos #include "acdisasm.h"
47 1.1 christos #include "actables.h"
48 1.1 christos
49 1.1 christos /* This module used for application-level code only */
50 1.1 christos
51 1.1 christos #define _COMPONENT ACPI_CA_DISASSEMBLER
52 1.1 christos ACPI_MODULE_NAME ("dmtbdump1")
53 1.1 christos
54 1.1 christos
55 1.1 christos /*******************************************************************************
56 1.1 christos *
57 1.1 christos * FUNCTION: AcpiDmDumpAsf
58 1.1 christos *
59 1.1 christos * PARAMETERS: Table - A ASF table
60 1.1 christos *
61 1.1 christos * RETURN: None
62 1.1 christos *
63 1.1 christos * DESCRIPTION: Format the contents of a ASF table
64 1.1 christos *
65 1.1 christos ******************************************************************************/
66 1.1 christos
67 1.1 christos void
68 1.1 christos AcpiDmDumpAsf (
69 1.1 christos ACPI_TABLE_HEADER *Table)
70 1.1 christos {
71 1.1 christos ACPI_STATUS Status;
72 1.1 christos UINT32 Offset = sizeof (ACPI_TABLE_HEADER);
73 1.1 christos ACPI_ASF_INFO *Subtable;
74 1.1 christos ACPI_DMTABLE_INFO *InfoTable;
75 1.1 christos ACPI_DMTABLE_INFO *DataInfoTable = NULL;
76 1.1 christos UINT8 *DataTable = NULL;
77 1.1 christos UINT32 DataCount = 0;
78 1.1 christos UINT32 DataLength = 0;
79 1.1 christos UINT32 DataOffset = 0;
80 1.1 christos UINT32 i;
81 1.1 christos UINT8 Type;
82 1.1 christos
83 1.1 christos
84 1.1 christos /* No main table, only subtables */
85 1.1 christos
86 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
87 1.1 christos while (Offset < Table->Length)
88 1.1 christos {
89 1.1 christos /* Common subtable header */
90 1.1 christos
91 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
92 1.1 christos Subtable->Header.Length, AcpiDmTableInfoAsfHdr);
93 1.1 christos if (ACPI_FAILURE (Status))
94 1.1 christos {
95 1.1 christos return;
96 1.1 christos }
97 1.1 christos
98 1.1 christos /* The actual type is the lower 7 bits of Type */
99 1.1 christos
100 1.1 christos Type = (UINT8) (Subtable->Header.Type & 0x7F);
101 1.1 christos
102 1.1 christos switch (Type)
103 1.1 christos {
104 1.1 christos case ACPI_ASF_TYPE_INFO:
105 1.1 christos
106 1.1 christos InfoTable = AcpiDmTableInfoAsf0;
107 1.1 christos break;
108 1.1 christos
109 1.1 christos case ACPI_ASF_TYPE_ALERT:
110 1.1 christos
111 1.1 christos InfoTable = AcpiDmTableInfoAsf1;
112 1.1 christos DataInfoTable = AcpiDmTableInfoAsf1a;
113 1.1 christos DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ALERT));
114 1.1 christos DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->Alerts;
115 1.1 christos DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->DataLength;
116 1.1 christos DataOffset = Offset + sizeof (ACPI_ASF_ALERT);
117 1.1 christos break;
118 1.1 christos
119 1.1 christos case ACPI_ASF_TYPE_CONTROL:
120 1.1 christos
121 1.1 christos InfoTable = AcpiDmTableInfoAsf2;
122 1.1 christos DataInfoTable = AcpiDmTableInfoAsf2a;
123 1.1 christos DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_REMOTE));
124 1.1 christos DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->Controls;
125 1.1 christos DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->DataLength;
126 1.1 christos DataOffset = Offset + sizeof (ACPI_ASF_REMOTE);
127 1.1 christos break;
128 1.1 christos
129 1.1 christos case ACPI_ASF_TYPE_BOOT:
130 1.1 christos
131 1.1 christos InfoTable = AcpiDmTableInfoAsf3;
132 1.1 christos break;
133 1.1 christos
134 1.1 christos case ACPI_ASF_TYPE_ADDRESS:
135 1.1 christos
136 1.1 christos InfoTable = AcpiDmTableInfoAsf4;
137 1.1 christos DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ADDRESS));
138 1.1 christos DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, Subtable)->Devices;
139 1.1 christos DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS);
140 1.1 christos break;
141 1.1 christos
142 1.1 christos default:
143 1.1 christos
144 1.1 christos AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n",
145 1.1 christos Subtable->Header.Type);
146 1.1 christos return;
147 1.1 christos }
148 1.1 christos
149 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
150 1.1 christos Subtable->Header.Length, InfoTable);
151 1.1 christos if (ACPI_FAILURE (Status))
152 1.1 christos {
153 1.1 christos return;
154 1.1 christos }
155 1.1 christos
156 1.1 christos /* Dump variable-length extra data */
157 1.1 christos
158 1.1 christos switch (Type)
159 1.1 christos {
160 1.1 christos case ACPI_ASF_TYPE_ALERT:
161 1.1 christos case ACPI_ASF_TYPE_CONTROL:
162 1.1 christos
163 1.1 christos for (i = 0; i < DataCount; i++)
164 1.1 christos {
165 1.1 christos AcpiOsPrintf ("\n");
166 1.1 christos Status = AcpiDmDumpTable (Table->Length, DataOffset,
167 1.1 christos DataTable, DataLength, DataInfoTable);
168 1.1 christos if (ACPI_FAILURE (Status))
169 1.1 christos {
170 1.1 christos return;
171 1.1 christos }
172 1.1 christos
173 1.1 christos DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength);
174 1.1 christos DataOffset += DataLength;
175 1.1 christos }
176 1.1 christos break;
177 1.1 christos
178 1.1 christos case ACPI_ASF_TYPE_ADDRESS:
179 1.1 christos
180 1.1 christos for (i = 0; i < DataLength; i++)
181 1.1 christos {
182 1.1 christos if (!(i % 16))
183 1.1 christos {
184 1.1 christos AcpiDmLineHeader (DataOffset, 1, "Addresses");
185 1.1 christos }
186 1.1 christos
187 1.1 christos AcpiOsPrintf ("%2.2X ", *DataTable);
188 1.1 christos DataTable++;
189 1.1 christos DataOffset++;
190 1.1 christos
191 1.1 christos if (DataOffset > Table->Length)
192 1.1 christos {
193 1.1 christos AcpiOsPrintf (
194 1.1 christos "**** ACPI table terminates in the middle of a "
195 1.1 christos "data structure! (ASF! table)\n");
196 1.1 christos return;
197 1.1 christos }
198 1.1 christos }
199 1.1 christos
200 1.1 christos AcpiOsPrintf ("\n");
201 1.1 christos break;
202 1.1 christos
203 1.1 christos default:
204 1.1 christos
205 1.1 christos break;
206 1.1 christos }
207 1.1 christos
208 1.1 christos AcpiOsPrintf ("\n");
209 1.1 christos
210 1.1 christos /* Point to next subtable */
211 1.1 christos
212 1.1 christos if (!Subtable->Header.Length)
213 1.1 christos {
214 1.1 christos AcpiOsPrintf ("Invalid zero subtable header length\n");
215 1.1 christos return;
216 1.1 christos }
217 1.1 christos
218 1.1 christos Offset += Subtable->Header.Length;
219 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable,
220 1.1 christos Subtable->Header.Length);
221 1.1 christos }
222 1.1 christos }
223 1.1 christos
224 1.1.1.5 christos /*******************************************************************************
225 1.1.1.5 christos *
226 1.1.1.5 christos * FUNCTION: AcpiDmDumpCedt
227 1.1.1.5 christos *
228 1.1.1.5 christos * PARAMETERS: Table - A CEDT table
229 1.1.1.5 christos *
230 1.1.1.5 christos * RETURN: None
231 1.1.1.5 christos *
232 1.1.1.5 christos * DESCRIPTION: Format the contents of a CEDT. This table type consists
233 1.1.1.5 christos * of an open-ended number of subtables.
234 1.1.1.5 christos *
235 1.1.1.5 christos ******************************************************************************/
236 1.1.1.5 christos
237 1.1.1.5 christos void
238 1.1.1.5 christos AcpiDmDumpCedt (
239 1.1.1.5 christos ACPI_TABLE_HEADER *Table)
240 1.1.1.5 christos {
241 1.1.1.5 christos ACPI_STATUS Status;
242 1.1.1.5 christos ACPI_CEDT_HEADER *Subtable;
243 1.1.1.5 christos UINT32 Length = Table->Length;
244 1.1.1.5 christos UINT32 Offset = sizeof (ACPI_TABLE_CEDT);
245 1.1.1.5 christos ACPI_DMTABLE_INFO *InfoTable;
246 1.1.1.5 christos
247 1.1.1.5 christos
248 1.1.1.5 christos /* There is no main table (other than the standard ACPI header) */
249 1.1.1.5 christos
250 1.1.1.5 christos Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Table, Offset);
251 1.1.1.5 christos while (Offset < Table->Length)
252 1.1.1.5 christos {
253 1.1.1.5 christos /* Common subtable header */
254 1.1.1.5 christos
255 1.1.1.5 christos AcpiOsPrintf ("\n");
256 1.1.1.5 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
257 1.1.1.5 christos Subtable->Length, AcpiDmTableInfoCedtHdr);
258 1.1.1.5 christos if (ACPI_FAILURE (Status))
259 1.1.1.5 christos {
260 1.1.1.5 christos return;
261 1.1.1.5 christos }
262 1.1.1.5 christos
263 1.1.1.5 christos switch (Subtable->Type)
264 1.1.1.5 christos {
265 1.1.1.5 christos case ACPI_CEDT_TYPE_CHBS:
266 1.1.1.5 christos
267 1.1.1.5 christos InfoTable = AcpiDmTableInfoCedt0;
268 1.1.1.5 christos break;
269 1.1.1.5 christos
270 1.1.1.5 christos default:
271 1.1.1.5 christos
272 1.1.1.5 christos AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n",
273 1.1.1.5 christos Subtable->Type);
274 1.1.1.5 christos
275 1.1.1.5 christos /* Attempt to continue */
276 1.1.1.5 christos
277 1.1.1.5 christos if (!Subtable->Length)
278 1.1.1.5 christos {
279 1.1.1.5 christos AcpiOsPrintf ("Invalid zero length subtable\n");
280 1.1.1.5 christos return;
281 1.1.1.5 christos }
282 1.1.1.5 christos goto NextSubtable;
283 1.1.1.5 christos }
284 1.1.1.5 christos
285 1.1.1.5 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
286 1.1.1.5 christos Subtable->Length, InfoTable);
287 1.1.1.5 christos if (ACPI_FAILURE (Status))
288 1.1.1.5 christos {
289 1.1.1.5 christos return;
290 1.1.1.5 christos }
291 1.1.1.5 christos
292 1.1.1.5 christos NextSubtable:
293 1.1.1.5 christos /* Point to next subtable */
294 1.1.1.5 christos
295 1.1.1.5 christos Offset += Subtable->Length;
296 1.1.1.5 christos Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable,
297 1.1.1.5 christos Subtable->Length);
298 1.1.1.5 christos }
299 1.1.1.5 christos }
300 1.1 christos
301 1.1 christos /*******************************************************************************
302 1.1 christos *
303 1.1 christos * FUNCTION: AcpiDmDumpCpep
304 1.1 christos *
305 1.1 christos * PARAMETERS: Table - A CPEP table
306 1.1 christos *
307 1.1 christos * RETURN: None
308 1.1 christos *
309 1.1 christos * DESCRIPTION: Format the contents of a CPEP. This table type consists
310 1.1 christos * of an open-ended number of subtables.
311 1.1 christos *
312 1.1 christos ******************************************************************************/
313 1.1 christos
314 1.1 christos void
315 1.1 christos AcpiDmDumpCpep (
316 1.1 christos ACPI_TABLE_HEADER *Table)
317 1.1 christos {
318 1.1 christos ACPI_STATUS Status;
319 1.1 christos ACPI_CPEP_POLLING *Subtable;
320 1.1 christos UINT32 Length = Table->Length;
321 1.1 christos UINT32 Offset = sizeof (ACPI_TABLE_CPEP);
322 1.1 christos
323 1.1 christos
324 1.1 christos /* Main table */
325 1.1 christos
326 1.1 christos Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep);
327 1.1 christos if (ACPI_FAILURE (Status))
328 1.1 christos {
329 1.1 christos return;
330 1.1 christos }
331 1.1 christos
332 1.1 christos /* Subtables */
333 1.1 christos
334 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
335 1.1 christos while (Offset < Table->Length)
336 1.1 christos {
337 1.1 christos AcpiOsPrintf ("\n");
338 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
339 1.1 christos Subtable->Header.Length, AcpiDmTableInfoCpep0);
340 1.1 christos if (ACPI_FAILURE (Status))
341 1.1 christos {
342 1.1 christos return;
343 1.1 christos }
344 1.1 christos
345 1.1 christos /* Point to next subtable */
346 1.1 christos
347 1.1 christos Offset += Subtable->Header.Length;
348 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Subtable,
349 1.1 christos Subtable->Header.Length);
350 1.1 christos }
351 1.1 christos }
352 1.1 christos
353 1.1 christos
354 1.1 christos /*******************************************************************************
355 1.1 christos *
356 1.1 christos * FUNCTION: AcpiDmDumpCsrt
357 1.1 christos *
358 1.1 christos * PARAMETERS: Table - A CSRT table
359 1.1 christos *
360 1.1 christos * RETURN: None
361 1.1 christos *
362 1.1 christos * DESCRIPTION: Format the contents of a CSRT. This table type consists
363 1.1 christos * of an open-ended number of subtables.
364 1.1 christos *
365 1.1 christos ******************************************************************************/
366 1.1 christos
367 1.1 christos void
368 1.1 christos AcpiDmDumpCsrt (
369 1.1 christos ACPI_TABLE_HEADER *Table)
370 1.1 christos {
371 1.1 christos ACPI_STATUS Status;
372 1.1 christos ACPI_CSRT_GROUP *Subtable;
373 1.1 christos ACPI_CSRT_SHARED_INFO *SharedInfoTable;
374 1.1 christos ACPI_CSRT_DESCRIPTOR *SubSubtable;
375 1.1 christos UINT32 Length = Table->Length;
376 1.1 christos UINT32 Offset = sizeof (ACPI_TABLE_CSRT);
377 1.1 christos UINT32 SubOffset;
378 1.1 christos UINT32 SubSubOffset;
379 1.1 christos UINT32 InfoLength;
380 1.1 christos
381 1.1 christos
382 1.1 christos /* The main table only contains the ACPI header, thus already handled */
383 1.1 christos
384 1.1 christos /* Subtables (Resource Groups) */
385 1.1 christos
386 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
387 1.1 christos while (Offset < Table->Length)
388 1.1 christos {
389 1.1 christos /* Resource group subtable */
390 1.1 christos
391 1.1 christos AcpiOsPrintf ("\n");
392 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
393 1.1 christos Subtable->Length, AcpiDmTableInfoCsrt0);
394 1.1 christos if (ACPI_FAILURE (Status))
395 1.1 christos {
396 1.1 christos return;
397 1.1 christos }
398 1.1 christos
399 1.1 christos /* Shared info subtable (One per resource group) */
400 1.1 christos
401 1.1 christos SubOffset = sizeof (ACPI_CSRT_GROUP);
402 1.1 christos SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table,
403 1.1 christos Offset + SubOffset);
404 1.1 christos
405 1.1 christos AcpiOsPrintf ("\n");
406 1.1 christos Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable,
407 1.1 christos sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
408 1.1 christos if (ACPI_FAILURE (Status))
409 1.1 christos {
410 1.1 christos return;
411 1.1 christos }
412 1.1 christos
413 1.1 christos SubOffset += Subtable->SharedInfoLength;
414 1.1 christos
415 1.1 christos /* Sub-Subtables (Resource Descriptors) */
416 1.1 christos
417 1.1 christos SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
418 1.1 christos Offset + SubOffset);
419 1.1 christos
420 1.1 christos while ((SubOffset < Subtable->Length) &&
421 1.1 christos ((Offset + SubOffset) < Table->Length))
422 1.1 christos {
423 1.1 christos AcpiOsPrintf ("\n");
424 1.1 christos Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable,
425 1.1 christos SubSubtable->Length, AcpiDmTableInfoCsrt2);
426 1.1 christos if (ACPI_FAILURE (Status))
427 1.1 christos {
428 1.1 christos return;
429 1.1 christos }
430 1.1 christos
431 1.1 christos SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR);
432 1.1 christos
433 1.1 christos /* Resource-specific info buffer */
434 1.1 christos
435 1.1 christos InfoLength = SubSubtable->Length - SubSubOffset;
436 1.1 christos if (InfoLength)
437 1.1 christos {
438 1.1 christos Status = AcpiDmDumpTable (Length,
439 1.1 christos Offset + SubOffset + SubSubOffset, Table,
440 1.1 christos InfoLength, AcpiDmTableInfoCsrt2a);
441 1.1 christos if (ACPI_FAILURE (Status))
442 1.1 christos {
443 1.1 christos return;
444 1.1 christos }
445 1.1 christos }
446 1.1 christos
447 1.1 christos /* Point to next sub-subtable */
448 1.1 christos
449 1.1 christos SubOffset += SubSubtable->Length;
450 1.1 christos SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable,
451 1.1 christos SubSubtable->Length);
452 1.1 christos }
453 1.1 christos
454 1.1 christos /* Point to next subtable */
455 1.1 christos
456 1.1 christos Offset += Subtable->Length;
457 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable,
458 1.1 christos Subtable->Length);
459 1.1 christos }
460 1.1 christos }
461 1.1 christos
462 1.1 christos
463 1.1 christos /*******************************************************************************
464 1.1 christos *
465 1.1 christos * FUNCTION: AcpiDmDumpDbg2
466 1.1 christos *
467 1.1 christos * PARAMETERS: Table - A DBG2 table
468 1.1 christos *
469 1.1 christos * RETURN: None
470 1.1 christos *
471 1.1 christos * DESCRIPTION: Format the contents of a DBG2. This table type consists
472 1.1 christos * of an open-ended number of subtables.
473 1.1 christos *
474 1.1 christos ******************************************************************************/
475 1.1 christos
476 1.1 christos void
477 1.1 christos AcpiDmDumpDbg2 (
478 1.1 christos ACPI_TABLE_HEADER *Table)
479 1.1 christos {
480 1.1 christos ACPI_STATUS Status;
481 1.1 christos ACPI_DBG2_DEVICE *Subtable;
482 1.1 christos UINT32 Length = Table->Length;
483 1.1 christos UINT32 Offset = sizeof (ACPI_TABLE_DBG2);
484 1.1 christos UINT32 i;
485 1.1 christos UINT32 ArrayOffset;
486 1.1 christos UINT32 AbsoluteOffset;
487 1.1 christos UINT8 *Array;
488 1.1 christos
489 1.1 christos
490 1.1 christos /* Main table */
491 1.1 christos
492 1.1 christos Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
493 1.1 christos if (ACPI_FAILURE (Status))
494 1.1 christos {
495 1.1 christos return;
496 1.1 christos }
497 1.1 christos
498 1.1 christos /* Subtables */
499 1.1 christos
500 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
501 1.1 christos while (Offset < Table->Length)
502 1.1 christos {
503 1.1 christos AcpiOsPrintf ("\n");
504 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
505 1.1 christos Subtable->Length, AcpiDmTableInfoDbg2Device);
506 1.1 christos if (ACPI_FAILURE (Status))
507 1.1 christos {
508 1.1 christos return;
509 1.1 christos }
510 1.1 christos
511 1.1 christos /* Dump the BaseAddress array */
512 1.1 christos
513 1.1 christos for (i = 0; i < Subtable->RegisterCount; i++)
514 1.1 christos {
515 1.1 christos ArrayOffset = Subtable->BaseAddressOffset +
516 1.1 christos (sizeof (ACPI_GENERIC_ADDRESS) * i);
517 1.1 christos AbsoluteOffset = Offset + ArrayOffset;
518 1.1 christos Array = (UINT8 *) Subtable + ArrayOffset;
519 1.1 christos
520 1.1 christos Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
521 1.1 christos Subtable->Length, AcpiDmTableInfoDbg2Addr);
522 1.1 christos if (ACPI_FAILURE (Status))
523 1.1 christos {
524 1.1 christos return;
525 1.1 christos }
526 1.1 christos }
527 1.1 christos
528 1.1 christos /* Dump the AddressSize array */
529 1.1 christos
530 1.1 christos for (i = 0; i < Subtable->RegisterCount; i++)
531 1.1 christos {
532 1.1 christos ArrayOffset = Subtable->AddressSizeOffset +
533 1.1 christos (sizeof (UINT32) * i);
534 1.1 christos AbsoluteOffset = Offset + ArrayOffset;
535 1.1 christos Array = (UINT8 *) Subtable + ArrayOffset;
536 1.1 christos
537 1.1 christos Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
538 1.1 christos Subtable->Length, AcpiDmTableInfoDbg2Size);
539 1.1 christos if (ACPI_FAILURE (Status))
540 1.1 christos {
541 1.1 christos return;
542 1.1 christos }
543 1.1 christos }
544 1.1 christos
545 1.1 christos /* Dump the Namestring (required) */
546 1.1 christos
547 1.1 christos AcpiOsPrintf ("\n");
548 1.1 christos ArrayOffset = Subtable->NamepathOffset;
549 1.1 christos AbsoluteOffset = Offset + ArrayOffset;
550 1.1 christos Array = (UINT8 *) Subtable + ArrayOffset;
551 1.1 christos
552 1.1 christos Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
553 1.1 christos Subtable->Length, AcpiDmTableInfoDbg2Name);
554 1.1 christos if (ACPI_FAILURE (Status))
555 1.1 christos {
556 1.1 christos return;
557 1.1 christos }
558 1.1 christos
559 1.1 christos /* Dump the OemData (optional) */
560 1.1 christos
561 1.1 christos if (Subtable->OemDataOffset)
562 1.1 christos {
563 1.1 christos Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset,
564 1.1 christos Table, Subtable->OemDataLength,
565 1.1 christos AcpiDmTableInfoDbg2OemData);
566 1.1 christos if (ACPI_FAILURE (Status))
567 1.1 christos {
568 1.1 christos return;
569 1.1 christos }
570 1.1 christos }
571 1.1 christos
572 1.1 christos /* Point to next subtable */
573 1.1 christos
574 1.1 christos Offset += Subtable->Length;
575 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable,
576 1.1 christos Subtable->Length);
577 1.1 christos }
578 1.1 christos }
579 1.1 christos
580 1.1 christos
581 1.1 christos /*******************************************************************************
582 1.1 christos *
583 1.1 christos * FUNCTION: AcpiDmDumpDmar
584 1.1 christos *
585 1.1 christos * PARAMETERS: Table - A DMAR table
586 1.1 christos *
587 1.1 christos * RETURN: None
588 1.1 christos *
589 1.1 christos * DESCRIPTION: Format the contents of a DMAR. This table type consists
590 1.1 christos * of an open-ended number of subtables.
591 1.1 christos *
592 1.1 christos ******************************************************************************/
593 1.1 christos
594 1.1 christos void
595 1.1 christos AcpiDmDumpDmar (
596 1.1 christos ACPI_TABLE_HEADER *Table)
597 1.1 christos {
598 1.1 christos ACPI_STATUS Status;
599 1.1 christos ACPI_DMAR_HEADER *Subtable;
600 1.1 christos UINT32 Length = Table->Length;
601 1.1 christos UINT32 Offset = sizeof (ACPI_TABLE_DMAR);
602 1.1 christos ACPI_DMTABLE_INFO *InfoTable;
603 1.1 christos ACPI_DMAR_DEVICE_SCOPE *ScopeTable;
604 1.1 christos UINT32 ScopeOffset;
605 1.1 christos UINT8 *PciPath;
606 1.1 christos UINT32 PathOffset;
607 1.1 christos
608 1.1 christos
609 1.1 christos /* Main table */
610 1.1 christos
611 1.1 christos Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
612 1.1 christos if (ACPI_FAILURE (Status))
613 1.1 christos {
614 1.1 christos return;
615 1.1 christos }
616 1.1 christos
617 1.1 christos /* Subtables */
618 1.1 christos
619 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
620 1.1 christos while (Offset < Table->Length)
621 1.1 christos {
622 1.1 christos /* Common subtable header */
623 1.1 christos
624 1.1 christos AcpiOsPrintf ("\n");
625 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
626 1.1 christos Subtable->Length, AcpiDmTableInfoDmarHdr);
627 1.1 christos if (ACPI_FAILURE (Status))
628 1.1 christos {
629 1.1 christos return;
630 1.1 christos }
631 1.1 christos
632 1.1 christos AcpiOsPrintf ("\n");
633 1.1 christos
634 1.1 christos switch (Subtable->Type)
635 1.1 christos {
636 1.1 christos case ACPI_DMAR_TYPE_HARDWARE_UNIT:
637 1.1 christos
638 1.1 christos InfoTable = AcpiDmTableInfoDmar0;
639 1.1 christos ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT);
640 1.1 christos break;
641 1.1 christos
642 1.1 christos case ACPI_DMAR_TYPE_RESERVED_MEMORY:
643 1.1 christos
644 1.1 christos InfoTable = AcpiDmTableInfoDmar1;
645 1.1 christos ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
646 1.1 christos break;
647 1.1 christos
648 1.1 christos case ACPI_DMAR_TYPE_ROOT_ATS:
649 1.1 christos
650 1.1 christos InfoTable = AcpiDmTableInfoDmar2;
651 1.1 christos ScopeOffset = sizeof (ACPI_DMAR_ATSR);
652 1.1 christos break;
653 1.1 christos
654 1.1 christos case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
655 1.1 christos
656 1.1 christos InfoTable = AcpiDmTableInfoDmar3;
657 1.1 christos ScopeOffset = sizeof (ACPI_DMAR_RHSA);
658 1.1 christos break;
659 1.1 christos
660 1.1 christos case ACPI_DMAR_TYPE_NAMESPACE:
661 1.1 christos
662 1.1 christos InfoTable = AcpiDmTableInfoDmar4;
663 1.1 christos ScopeOffset = sizeof (ACPI_DMAR_ANDD);
664 1.1 christos break;
665 1.1 christos
666 1.1 christos default:
667 1.1 christos
668 1.1 christos AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
669 1.1 christos Subtable->Type);
670 1.1 christos return;
671 1.1 christos }
672 1.1 christos
673 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
674 1.1 christos Subtable->Length, InfoTable);
675 1.1 christos if (ACPI_FAILURE (Status))
676 1.1 christos {
677 1.1 christos return;
678 1.1 christos }
679 1.1 christos
680 1.1 christos /*
681 1.1 christos * Dump the optional device scope entries
682 1.1 christos */
683 1.1 christos if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
684 1.1 christos (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE))
685 1.1 christos {
686 1.1 christos /* These types do not support device scopes */
687 1.1 christos
688 1.1 christos goto NextSubtable;
689 1.1 christos }
690 1.1 christos
691 1.1 christos ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset);
692 1.1 christos while (ScopeOffset < Subtable->Length)
693 1.1 christos {
694 1.1 christos AcpiOsPrintf ("\n");
695 1.1 christos Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
696 1.1 christos ScopeTable->Length, AcpiDmTableInfoDmarScope);
697 1.1 christos if (ACPI_FAILURE (Status))
698 1.1 christos {
699 1.1 christos return;
700 1.1 christos }
701 1.1 christos AcpiOsPrintf ("\n");
702 1.1 christos
703 1.1 christos /* Dump the PCI Path entries for this device scope */
704 1.1 christos
705 1.1 christos PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
706 1.1 christos
707 1.1 christos PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
708 1.1 christos sizeof (ACPI_DMAR_DEVICE_SCOPE));
709 1.1 christos
710 1.1 christos while (PathOffset < ScopeTable->Length)
711 1.1 christos {
712 1.1 christos AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2,
713 1.1 christos "PCI Path");
714 1.1 christos AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]);
715 1.1 christos
716 1.1 christos /* Point to next PCI Path entry */
717 1.1 christos
718 1.1 christos PathOffset += 2;
719 1.1 christos PciPath += 2;
720 1.1 christos AcpiOsPrintf ("\n");
721 1.1 christos }
722 1.1 christos
723 1.1 christos /* Point to next device scope entry */
724 1.1 christos
725 1.1 christos ScopeOffset += ScopeTable->Length;
726 1.1 christos ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
727 1.1 christos ScopeTable, ScopeTable->Length);
728 1.1 christos }
729 1.1 christos
730 1.1 christos NextSubtable:
731 1.1 christos /* Point to next subtable */
732 1.1 christos
733 1.1 christos Offset += Subtable->Length;
734 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable,
735 1.1 christos Subtable->Length);
736 1.1 christos }
737 1.1 christos }
738 1.1 christos
739 1.1 christos
740 1.1 christos /*******************************************************************************
741 1.1 christos *
742 1.1 christos * FUNCTION: AcpiDmDumpDrtm
743 1.1 christos *
744 1.1 christos * PARAMETERS: Table - A DRTM table
745 1.1 christos *
746 1.1 christos * RETURN: None
747 1.1 christos *
748 1.1 christos * DESCRIPTION: Format the contents of a DRTM.
749 1.1 christos *
750 1.1 christos ******************************************************************************/
751 1.1 christos
752 1.1 christos void
753 1.1 christos AcpiDmDumpDrtm (
754 1.1 christos ACPI_TABLE_HEADER *Table)
755 1.1 christos {
756 1.1 christos ACPI_STATUS Status;
757 1.1 christos UINT32 Offset;
758 1.1 christos ACPI_DRTM_VTABLE_LIST *DrtmVtl;
759 1.1 christos ACPI_DRTM_RESOURCE_LIST *DrtmRl;
760 1.1 christos ACPI_DRTM_DPS_ID *DrtmDps;
761 1.1 christos UINT32 Count;
762 1.1 christos
763 1.1 christos
764 1.1 christos /* Main table */
765 1.1 christos
766 1.1 christos Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
767 1.1 christos AcpiDmTableInfoDrtm);
768 1.1 christos if (ACPI_FAILURE (Status))
769 1.1 christos {
770 1.1 christos return;
771 1.1 christos }
772 1.1 christos
773 1.1 christos Offset = sizeof (ACPI_TABLE_DRTM);
774 1.1 christos
775 1.1 christos /* Sub-tables */
776 1.1 christos
777 1.1 christos /* Dump ValidatedTable length */
778 1.1 christos
779 1.1 christos DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
780 1.1 christos AcpiOsPrintf ("\n");
781 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset,
782 1.1 christos DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
783 1.1 christos AcpiDmTableInfoDrtm0);
784 1.1 christos if (ACPI_FAILURE (Status))
785 1.1 christos {
786 1.1 christos return;
787 1.1 christos }
788 1.1 christos
789 1.1 christos Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables);
790 1.1 christos
791 1.1 christos /* Dump Validated table addresses */
792 1.1 christos
793 1.1 christos Count = 0;
794 1.1 christos while ((Offset < Table->Length) &&
795 1.1 christos (DrtmVtl->ValidatedTableCount > Count))
796 1.1 christos {
797 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset,
798 1.1 christos ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
799 1.1 christos AcpiDmTableInfoDrtm0a);
800 1.1 christos if (ACPI_FAILURE (Status))
801 1.1 christos {
802 1.1 christos return;
803 1.1 christos }
804 1.1 christos
805 1.1 christos Offset += sizeof (UINT64);
806 1.1 christos Count++;
807 1.1 christos }
808 1.1 christos
809 1.1 christos /* Dump ResourceList length */
810 1.1 christos
811 1.1 christos DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
812 1.1 christos AcpiOsPrintf ("\n");
813 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset,
814 1.1 christos DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
815 1.1 christos AcpiDmTableInfoDrtm1);
816 1.1 christos if (ACPI_FAILURE (Status))
817 1.1 christos {
818 1.1 christos return;
819 1.1 christos }
820 1.1 christos
821 1.1 christos Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources);
822 1.1 christos
823 1.1 christos /* Dump the Resource List */
824 1.1 christos
825 1.1 christos Count = 0;
826 1.1 christos while ((Offset < Table->Length) &&
827 1.1 christos (DrtmRl->ResourceCount > Count))
828 1.1 christos {
829 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset,
830 1.1 christos ACPI_ADD_PTR (void, Table, Offset),
831 1.1 christos sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
832 1.1 christos if (ACPI_FAILURE (Status))
833 1.1 christos {
834 1.1 christos return;
835 1.1 christos }
836 1.1 christos
837 1.1 christos Offset += sizeof (ACPI_DRTM_RESOURCE);
838 1.1 christos Count++;
839 1.1 christos }
840 1.1 christos
841 1.1 christos /* Dump DPS */
842 1.1 christos
843 1.1 christos DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
844 1.1 christos AcpiOsPrintf ("\n");
845 1.1 christos (void) AcpiDmDumpTable (Table->Length, Offset,
846 1.1 christos DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
847 1.1 christos }
848 1.1 christos
849 1.1 christos
850 1.1 christos /*******************************************************************************
851 1.1 christos *
852 1.1 christos * FUNCTION: AcpiDmDumpEinj
853 1.1 christos *
854 1.1 christos * PARAMETERS: Table - A EINJ table
855 1.1 christos *
856 1.1 christos * RETURN: None
857 1.1 christos *
858 1.1 christos * DESCRIPTION: Format the contents of a EINJ. This table type consists
859 1.1 christos * of an open-ended number of subtables.
860 1.1 christos *
861 1.1 christos ******************************************************************************/
862 1.1 christos
863 1.1 christos void
864 1.1 christos AcpiDmDumpEinj (
865 1.1 christos ACPI_TABLE_HEADER *Table)
866 1.1 christos {
867 1.1 christos ACPI_STATUS Status;
868 1.1 christos ACPI_WHEA_HEADER *Subtable;
869 1.1 christos UINT32 Length = Table->Length;
870 1.1 christos UINT32 Offset = sizeof (ACPI_TABLE_EINJ);
871 1.1 christos
872 1.1 christos
873 1.1 christos /* Main table */
874 1.1 christos
875 1.1 christos Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj);
876 1.1 christos if (ACPI_FAILURE (Status))
877 1.1 christos {
878 1.1 christos return;
879 1.1 christos }
880 1.1 christos
881 1.1 christos /* Subtables */
882 1.1 christos
883 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
884 1.1 christos while (Offset < Table->Length)
885 1.1 christos {
886 1.1 christos AcpiOsPrintf ("\n");
887 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
888 1.1 christos sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
889 1.1 christos if (ACPI_FAILURE (Status))
890 1.1 christos {
891 1.1 christos return;
892 1.1 christos }
893 1.1 christos
894 1.1 christos /* Point to next subtable (each subtable is of fixed length) */
895 1.1 christos
896 1.1 christos Offset += sizeof (ACPI_WHEA_HEADER);
897 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable,
898 1.1 christos sizeof (ACPI_WHEA_HEADER));
899 1.1 christos }
900 1.1 christos }
901 1.1 christos
902 1.1 christos
903 1.1 christos /*******************************************************************************
904 1.1 christos *
905 1.1 christos * FUNCTION: AcpiDmDumpErst
906 1.1 christos *
907 1.1 christos * PARAMETERS: Table - A ERST table
908 1.1 christos *
909 1.1 christos * RETURN: None
910 1.1 christos *
911 1.1 christos * DESCRIPTION: Format the contents of a ERST. This table type consists
912 1.1 christos * of an open-ended number of subtables.
913 1.1 christos *
914 1.1 christos ******************************************************************************/
915 1.1 christos
916 1.1 christos void
917 1.1 christos AcpiDmDumpErst (
918 1.1 christos ACPI_TABLE_HEADER *Table)
919 1.1 christos {
920 1.1 christos ACPI_STATUS Status;
921 1.1 christos ACPI_WHEA_HEADER *Subtable;
922 1.1 christos UINT32 Length = Table->Length;
923 1.1 christos UINT32 Offset = sizeof (ACPI_TABLE_ERST);
924 1.1 christos
925 1.1 christos
926 1.1 christos /* Main table */
927 1.1 christos
928 1.1 christos Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst);
929 1.1 christos if (ACPI_FAILURE (Status))
930 1.1 christos {
931 1.1 christos return;
932 1.1 christos }
933 1.1 christos
934 1.1 christos /* Subtables */
935 1.1 christos
936 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
937 1.1 christos while (Offset < Table->Length)
938 1.1 christos {
939 1.1 christos AcpiOsPrintf ("\n");
940 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
941 1.1 christos sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
942 1.1 christos if (ACPI_FAILURE (Status))
943 1.1 christos {
944 1.1 christos return;
945 1.1 christos }
946 1.1 christos
947 1.1 christos /* Point to next subtable (each subtable is of fixed length) */
948 1.1 christos
949 1.1 christos Offset += sizeof (ACPI_WHEA_HEADER);
950 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable,
951 1.1 christos sizeof (ACPI_WHEA_HEADER));
952 1.1 christos }
953 1.1 christos }
954 1.1 christos
955 1.1 christos
956 1.1 christos /*******************************************************************************
957 1.1 christos *
958 1.1 christos * FUNCTION: AcpiDmDumpFpdt
959 1.1 christos *
960 1.1 christos * PARAMETERS: Table - A FPDT table
961 1.1 christos *
962 1.1 christos * RETURN: None
963 1.1 christos *
964 1.1 christos * DESCRIPTION: Format the contents of a FPDT. This table type consists
965 1.1 christos * of an open-ended number of subtables.
966 1.1 christos *
967 1.1 christos ******************************************************************************/
968 1.1 christos
969 1.1 christos void
970 1.1 christos AcpiDmDumpFpdt (
971 1.1 christos ACPI_TABLE_HEADER *Table)
972 1.1 christos {
973 1.1 christos ACPI_STATUS Status;
974 1.1 christos ACPI_FPDT_HEADER *Subtable;
975 1.1 christos UINT32 Length = Table->Length;
976 1.1 christos UINT32 Offset = sizeof (ACPI_TABLE_FPDT);
977 1.1 christos ACPI_DMTABLE_INFO *InfoTable;
978 1.1 christos
979 1.1 christos
980 1.1 christos /* There is no main table (other than the standard ACPI header) */
981 1.1 christos
982 1.1 christos /* Subtables */
983 1.1 christos
984 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
985 1.1 christos while (Offset < Table->Length)
986 1.1 christos {
987 1.1 christos /* Common subtable header */
988 1.1 christos
989 1.1 christos AcpiOsPrintf ("\n");
990 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
991 1.1 christos Subtable->Length, AcpiDmTableInfoFpdtHdr);
992 1.1 christos if (ACPI_FAILURE (Status))
993 1.1 christos {
994 1.1 christos return;
995 1.1 christos }
996 1.1 christos
997 1.1 christos switch (Subtable->Type)
998 1.1 christos {
999 1.1 christos case ACPI_FPDT_TYPE_BOOT:
1000 1.1 christos
1001 1.1 christos InfoTable = AcpiDmTableInfoFpdt0;
1002 1.1 christos break;
1003 1.1 christos
1004 1.1 christos case ACPI_FPDT_TYPE_S3PERF:
1005 1.1 christos
1006 1.1 christos InfoTable = AcpiDmTableInfoFpdt1;
1007 1.1 christos break;
1008 1.1 christos
1009 1.1 christos default:
1010 1.1 christos
1011 1.1 christos AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n",
1012 1.1 christos Subtable->Type);
1013 1.1 christos
1014 1.1 christos /* Attempt to continue */
1015 1.1 christos
1016 1.1 christos if (!Subtable->Length)
1017 1.1 christos {
1018 1.1 christos AcpiOsPrintf ("Invalid zero length subtable\n");
1019 1.1 christos return;
1020 1.1 christos }
1021 1.1 christos goto NextSubtable;
1022 1.1 christos }
1023 1.1 christos
1024 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
1025 1.1 christos Subtable->Length, InfoTable);
1026 1.1 christos if (ACPI_FAILURE (Status))
1027 1.1 christos {
1028 1.1 christos return;
1029 1.1 christos }
1030 1.1 christos
1031 1.1 christos NextSubtable:
1032 1.1 christos /* Point to next subtable */
1033 1.1 christos
1034 1.1 christos Offset += Subtable->Length;
1035 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable,
1036 1.1 christos Subtable->Length);
1037 1.1 christos }
1038 1.1 christos }
1039 1.1 christos
1040 1.1 christos
1041 1.1 christos /*******************************************************************************
1042 1.1 christos *
1043 1.1 christos * FUNCTION: AcpiDmDumpGtdt
1044 1.1 christos *
1045 1.1 christos * PARAMETERS: Table - A GTDT table
1046 1.1 christos *
1047 1.1 christos * RETURN: None
1048 1.1 christos *
1049 1.1 christos * DESCRIPTION: Format the contents of a GTDT. This table type consists
1050 1.1 christos * of an open-ended number of subtables.
1051 1.1 christos *
1052 1.1 christos ******************************************************************************/
1053 1.1 christos
1054 1.1 christos void
1055 1.1 christos AcpiDmDumpGtdt (
1056 1.1 christos ACPI_TABLE_HEADER *Table)
1057 1.1 christos {
1058 1.1 christos ACPI_STATUS Status;
1059 1.1 christos ACPI_GTDT_HEADER *Subtable;
1060 1.1 christos UINT32 Length = Table->Length;
1061 1.1 christos UINT32 Offset = sizeof (ACPI_TABLE_GTDT);
1062 1.1 christos ACPI_DMTABLE_INFO *InfoTable;
1063 1.1 christos UINT32 SubtableLength;
1064 1.1 christos UINT32 GtCount;
1065 1.1 christos ACPI_GTDT_TIMER_ENTRY *GtxTable;
1066 1.1 christos
1067 1.1 christos
1068 1.1 christos /* Main table */
1069 1.1 christos
1070 1.1 christos Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
1071 1.1 christos if (ACPI_FAILURE (Status))
1072 1.1 christos {
1073 1.1 christos return;
1074 1.1 christos }
1075 1.1 christos
1076 1.1.1.2 christos /* Rev 3 fields */
1077 1.1 christos
1078 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
1079 1.1.1.2 christos
1080 1.1.1.2 christos if (Table->Revision > 2)
1081 1.1.1.2 christos {
1082 1.1.1.2 christos SubtableLength = sizeof (ACPI_GTDT_EL2);
1083 1.1.1.2 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
1084 1.1.1.2 christos SubtableLength, AcpiDmTableInfoGtdtEl2);
1085 1.1.1.2 christos if (ACPI_FAILURE (Status))
1086 1.1.1.2 christos {
1087 1.1.1.2 christos return;
1088 1.1.1.2 christos }
1089 1.1.1.2 christos Offset += SubtableLength;
1090 1.1.1.2 christos }
1091 1.1.1.2 christos
1092 1.1.1.2 christos Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
1093 1.1.1.2 christos
1094 1.1.1.2 christos /* Subtables */
1095 1.1.1.2 christos
1096 1.1 christos while (Offset < Table->Length)
1097 1.1 christos {
1098 1.1 christos /* Common subtable header */
1099 1.1 christos
1100 1.1 christos AcpiOsPrintf ("\n");
1101 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
1102 1.1 christos Subtable->Length, AcpiDmTableInfoGtdtHdr);
1103 1.1 christos if (ACPI_FAILURE (Status))
1104 1.1 christos {
1105 1.1 christos return;
1106 1.1 christos }
1107 1.1 christos
1108 1.1 christos GtCount = 0;
1109 1.1 christos switch (Subtable->Type)
1110 1.1 christos {
1111 1.1 christos case ACPI_GTDT_TYPE_TIMER_BLOCK:
1112 1.1 christos
1113 1.1 christos SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
1114 1.1 christos GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
1115 1.1 christos Subtable))->TimerCount;
1116 1.1 christos
1117 1.1 christos InfoTable = AcpiDmTableInfoGtdt0;
1118 1.1 christos break;
1119 1.1 christos
1120 1.1 christos case ACPI_GTDT_TYPE_WATCHDOG:
1121 1.1 christos
1122 1.1 christos SubtableLength = sizeof (ACPI_GTDT_WATCHDOG);
1123 1.1 christos
1124 1.1 christos InfoTable = AcpiDmTableInfoGtdt1;
1125 1.1 christos break;
1126 1.1 christos
1127 1.1 christos default:
1128 1.1 christos
1129 1.1 christos /* Cannot continue on unknown type - no length */
1130 1.1 christos
1131 1.1 christos AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n",
1132 1.1 christos Subtable->Type);
1133 1.1 christos return;
1134 1.1 christos }
1135 1.1 christos
1136 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
1137 1.1 christos Subtable->Length, InfoTable);
1138 1.1 christos if (ACPI_FAILURE (Status))
1139 1.1 christos {
1140 1.1 christos return;
1141 1.1 christos }
1142 1.1 christos
1143 1.1 christos /* Point to end of current subtable (each subtable above is of fixed length) */
1144 1.1 christos
1145 1.1 christos Offset += SubtableLength;
1146 1.1 christos
1147 1.1 christos /* If there are any Gt Timer Blocks from above, dump them now */
1148 1.1 christos
1149 1.1 christos if (GtCount)
1150 1.1 christos {
1151 1.1 christos GtxTable = ACPI_ADD_PTR (
1152 1.1 christos ACPI_GTDT_TIMER_ENTRY, Subtable, SubtableLength);
1153 1.1 christos SubtableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
1154 1.1 christos
1155 1.1 christos while (GtCount)
1156 1.1 christos {
1157 1.1 christos AcpiOsPrintf ("\n");
1158 1.1 christos Status = AcpiDmDumpTable (Length, Offset, GtxTable,
1159 1.1 christos sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
1160 1.1 christos if (ACPI_FAILURE (Status))
1161 1.1 christos {
1162 1.1 christos return;
1163 1.1 christos }
1164 1.1 christos Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
1165 1.1 christos GtxTable++;
1166 1.1 christos GtCount--;
1167 1.1 christos }
1168 1.1 christos }
1169 1.1 christos
1170 1.1 christos /* Point to next subtable */
1171 1.1 christos
1172 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Subtable, SubtableLength);
1173 1.1 christos }
1174 1.1 christos }
1175 1.1 christos
1176 1.1 christos
1177 1.1 christos /*******************************************************************************
1178 1.1 christos *
1179 1.1 christos * FUNCTION: AcpiDmDumpHest
1180 1.1 christos *
1181 1.1 christos * PARAMETERS: Table - A HEST table
1182 1.1 christos *
1183 1.1 christos * RETURN: None
1184 1.1 christos *
1185 1.1 christos * DESCRIPTION: Format the contents of a HEST. This table type consists
1186 1.1 christos * of an open-ended number of subtables.
1187 1.1 christos *
1188 1.1 christos ******************************************************************************/
1189 1.1 christos
1190 1.1 christos void
1191 1.1 christos AcpiDmDumpHest (
1192 1.1 christos ACPI_TABLE_HEADER *Table)
1193 1.1 christos {
1194 1.1 christos ACPI_STATUS Status;
1195 1.1 christos ACPI_HEST_HEADER *Subtable;
1196 1.1 christos UINT32 Length = Table->Length;
1197 1.1 christos UINT32 Offset = sizeof (ACPI_TABLE_HEST);
1198 1.1 christos ACPI_DMTABLE_INFO *InfoTable;
1199 1.1 christos UINT32 SubtableLength;
1200 1.1 christos UINT32 BankCount;
1201 1.1 christos ACPI_HEST_IA_ERROR_BANK *BankTable;
1202 1.1 christos
1203 1.1 christos
1204 1.1 christos /* Main table */
1205 1.1 christos
1206 1.1 christos Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
1207 1.1 christos if (ACPI_FAILURE (Status))
1208 1.1 christos {
1209 1.1 christos return;
1210 1.1 christos }
1211 1.1 christos
1212 1.1 christos /* Subtables */
1213 1.1 christos
1214 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
1215 1.1 christos while (Offset < Table->Length)
1216 1.1 christos {
1217 1.1 christos BankCount = 0;
1218 1.1 christos switch (Subtable->Type)
1219 1.1 christos {
1220 1.1 christos case ACPI_HEST_TYPE_IA32_CHECK:
1221 1.1 christos
1222 1.1 christos InfoTable = AcpiDmTableInfoHest0;
1223 1.1 christos SubtableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
1224 1.1 christos BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
1225 1.1 christos Subtable))->NumHardwareBanks;
1226 1.1 christos break;
1227 1.1 christos
1228 1.1 christos case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
1229 1.1 christos
1230 1.1 christos InfoTable = AcpiDmTableInfoHest1;
1231 1.1 christos SubtableLength = sizeof (ACPI_HEST_IA_CORRECTED);
1232 1.1 christos BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
1233 1.1 christos Subtable))->NumHardwareBanks;
1234 1.1 christos break;
1235 1.1 christos
1236 1.1 christos case ACPI_HEST_TYPE_IA32_NMI:
1237 1.1 christos
1238 1.1 christos InfoTable = AcpiDmTableInfoHest2;
1239 1.1 christos SubtableLength = sizeof (ACPI_HEST_IA_NMI);
1240 1.1 christos break;
1241 1.1 christos
1242 1.1 christos case ACPI_HEST_TYPE_AER_ROOT_PORT:
1243 1.1 christos
1244 1.1 christos InfoTable = AcpiDmTableInfoHest6;
1245 1.1 christos SubtableLength = sizeof (ACPI_HEST_AER_ROOT);
1246 1.1 christos break;
1247 1.1 christos
1248 1.1 christos case ACPI_HEST_TYPE_AER_ENDPOINT:
1249 1.1 christos
1250 1.1 christos InfoTable = AcpiDmTableInfoHest7;
1251 1.1 christos SubtableLength = sizeof (ACPI_HEST_AER);
1252 1.1 christos break;
1253 1.1 christos
1254 1.1 christos case ACPI_HEST_TYPE_AER_BRIDGE:
1255 1.1 christos
1256 1.1 christos InfoTable = AcpiDmTableInfoHest8;
1257 1.1 christos SubtableLength = sizeof (ACPI_HEST_AER_BRIDGE);
1258 1.1 christos break;
1259 1.1 christos
1260 1.1 christos case ACPI_HEST_TYPE_GENERIC_ERROR:
1261 1.1 christos
1262 1.1 christos InfoTable = AcpiDmTableInfoHest9;
1263 1.1 christos SubtableLength = sizeof (ACPI_HEST_GENERIC);
1264 1.1 christos break;
1265 1.1 christos
1266 1.1 christos case ACPI_HEST_TYPE_GENERIC_ERROR_V2:
1267 1.1 christos
1268 1.1 christos InfoTable = AcpiDmTableInfoHest10;
1269 1.1 christos SubtableLength = sizeof (ACPI_HEST_GENERIC_V2);
1270 1.1 christos break;
1271 1.1 christos
1272 1.1 christos case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
1273 1.1 christos
1274 1.1 christos InfoTable = AcpiDmTableInfoHest11;
1275 1.1 christos SubtableLength = sizeof (ACPI_HEST_IA_DEFERRED_CHECK);
1276 1.1 christos BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK,
1277 1.1 christos Subtable))->NumHardwareBanks;
1278 1.1 christos break;
1279 1.1 christos
1280 1.1 christos default:
1281 1.1 christos
1282 1.1 christos /* Cannot continue on unknown type - no length */
1283 1.1 christos
1284 1.1 christos AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
1285 1.1 christos Subtable->Type);
1286 1.1 christos return;
1287 1.1 christos }
1288 1.1 christos
1289 1.1 christos AcpiOsPrintf ("\n");
1290 1.1 christos Status = AcpiDmDumpTable (Length, Offset, Subtable,
1291 1.1 christos SubtableLength, InfoTable);
1292 1.1 christos if (ACPI_FAILURE (Status))
1293 1.1 christos {
1294 1.1 christos return;
1295 1.1 christos }
1296 1.1 christos
1297 1.1 christos /* Point to end of current subtable (each subtable above is of fixed length) */
1298 1.1 christos
1299 1.1 christos Offset += SubtableLength;
1300 1.1 christos
1301 1.1 christos /* If there are any (fixed-length) Error Banks from above, dump them now */
1302 1.1 christos
1303 1.1 christos if (BankCount)
1304 1.1 christos {
1305 1.1 christos BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, Subtable,
1306 1.1 christos SubtableLength);
1307 1.1 christos SubtableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
1308 1.1 christos
1309 1.1 christos while (BankCount)
1310 1.1 christos {
1311 1.1 christos AcpiOsPrintf ("\n");
1312 1.1 christos Status = AcpiDmDumpTable (Length, Offset, BankTable,
1313 1.1 christos sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
1314 1.1 christos if (ACPI_FAILURE (Status))
1315 1.1 christos {
1316 1.1 christos return;
1317 1.1 christos }
1318 1.1 christos
1319 1.1 christos Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
1320 1.1 christos BankTable++;
1321 1.1 christos BankCount--;
1322 1.1 christos }
1323 1.1 christos }
1324 1.1 christos
1325 1.1 christos /* Point to next subtable */
1326 1.1 christos
1327 1.1 christos Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Subtable, SubtableLength);
1328 1.1 christos }
1329 1.1 christos }
1330 1.1 christos
1331 1.1 christos
1332 1.1 christos /*******************************************************************************
1333 1.1 christos *
1334 1.1 christos * FUNCTION: AcpiDmDumpHmat
1335 1.1 christos *
1336 1.1 christos * PARAMETERS: Table - A HMAT table
1337 1.1 christos *
1338 1.1 christos * RETURN: None
1339 1.1 christos *
1340 1.1 christos * DESCRIPTION: Format the contents of a HMAT.
1341 1.1 christos *
1342 1.1 christos ******************************************************************************/
1343 1.1 christos
1344 1.1 christos void
1345 1.1 christos AcpiDmDumpHmat (
1346 1.1 christos ACPI_TABLE_HEADER *Table)
1347 1.1 christos {
1348 1.1 christos ACPI_STATUS Status;
1349 1.1 christos ACPI_HMAT_STRUCTURE *HmatStruct;
1350 1.1 christos ACPI_HMAT_LOCALITY *HmatLocality;
1351 1.1 christos ACPI_HMAT_CACHE *HmatCache;
1352 1.1 christos UINT32 Offset;
1353 1.1 christos UINT32 SubtableOffset;
1354 1.1 christos UINT32 Length;
1355 1.1 christos ACPI_DMTABLE_INFO *InfoTable;
1356 1.1 christos UINT32 i, j;
1357 1.1 christos
1358 1.1 christos
1359 1.1 christos /* Main table */
1360 1.1 christos
1361 1.1 christos Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoHmat);
1362 1.1 christos if (ACPI_FAILURE (Status))
1363 1.1 christos {
1364 1.1 christos return;
1365 1.1 christos }
1366 1.1 christos Offset = sizeof (ACPI_TABLE_HMAT);
1367 1.1 christos
1368 1.1 christos while (Offset < Table->Length)
1369 1.1 christos {
1370 1.1 christos AcpiOsPrintf ("\n");
1371 1.1 christos
1372 1.1 christos /* Dump HMAT structure header */
1373 1.1 christos
1374 1.1 christos HmatStruct = ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, Table, Offset);
1375 1.1 christos if (HmatStruct->Length < sizeof (ACPI_HMAT_STRUCTURE))
1376 1.1 christos {
1377 1.1 christos AcpiOsPrintf ("Invalid HMAT structure length\n");
1378 1.1 christos return;
1379 1.1 christos }
1380 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
1381 1.1 christos HmatStruct->Length, AcpiDmTableInfoHmatHdr);
1382 1.1 christos if (ACPI_FAILURE (Status))
1383 1.1 christos {
1384 1.1 christos return;
1385 1.1 christos }
1386 1.1 christos
1387 1.1 christos switch (HmatStruct->Type)
1388 1.1 christos {
1389 1.1 christos case ACPI_HMAT_TYPE_ADDRESS_RANGE:
1390 1.1 christos
1391 1.1 christos InfoTable = AcpiDmTableInfoHmat0;
1392 1.1.1.2 christos Length = sizeof (ACPI_HMAT_PROXIMITY_DOMAIN);
1393 1.1 christos break;
1394 1.1 christos
1395 1.1 christos case ACPI_HMAT_TYPE_LOCALITY:
1396 1.1 christos
1397 1.1 christos InfoTable = AcpiDmTableInfoHmat1;
1398 1.1 christos Length = sizeof (ACPI_HMAT_LOCALITY);
1399 1.1 christos break;
1400 1.1 christos
1401 1.1 christos case ACPI_HMAT_TYPE_CACHE:
1402 1.1 christos
1403 1.1 christos InfoTable = AcpiDmTableInfoHmat2;
1404 1.1 christos Length = sizeof (ACPI_HMAT_CACHE);
1405 1.1 christos break;
1406 1.1 christos
1407 1.1 christos default:
1408 1.1 christos
1409 1.1 christos AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n",
1410 1.1 christos HmatStruct->Type);
1411 1.1 christos
1412 1.1 christos /* Attempt to continue */
1413 1.1 christos
1414 1.1 christos goto NextSubtable;
1415 1.1 christos }
1416 1.1 christos
1417 1.1 christos /* Dump HMAT structure body */
1418 1.1 christos
1419 1.1 christos if (HmatStruct->Length < Length)
1420 1.1 christos {
1421 1.1 christos AcpiOsPrintf ("Invalid HMAT structure length\n");
1422 1.1 christos return;
1423 1.1 christos }
1424 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
1425 1.1 christos HmatStruct->Length, InfoTable);
1426 1.1 christos if (ACPI_FAILURE (Status))
1427 1.1 christos {
1428 1.1 christos return;
1429 1.1 christos }
1430 1.1 christos
1431 1.1 christos /* Dump HMAT structure additionals */
1432 1.1 christos
1433 1.1 christos switch (HmatStruct->Type)
1434 1.1 christos {
1435 1.1 christos case ACPI_HMAT_TYPE_LOCALITY:
1436 1.1 christos
1437 1.1 christos HmatLocality = ACPI_CAST_PTR (ACPI_HMAT_LOCALITY, HmatStruct);
1438 1.1 christos SubtableOffset = sizeof (ACPI_HMAT_LOCALITY);
1439 1.1 christos
1440 1.1 christos /* Dump initiator proximity domains */
1441 1.1 christos
1442 1.1 christos if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1443 1.1 christos (UINT32)(HmatLocality->NumberOfInitiatorPDs * 4))
1444 1.1 christos {
1445 1.1 christos AcpiOsPrintf ("Invalid initiator proximity domain number\n");
1446 1.1 christos return;
1447 1.1 christos }
1448 1.1 christos for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
1449 1.1 christos {
1450 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1451 1.1 christos ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1452 1.1 christos 4, AcpiDmTableInfoHmat1a);
1453 1.1.1.3 christos if (ACPI_FAILURE (Status))
1454 1.1.1.3 christos {
1455 1.1.1.3 christos return;
1456 1.1.1.3 christos }
1457 1.1.1.3 christos
1458 1.1 christos SubtableOffset += 4;
1459 1.1 christos }
1460 1.1 christos
1461 1.1 christos /* Dump target proximity domains */
1462 1.1 christos
1463 1.1 christos if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1464 1.1 christos (UINT32)(HmatLocality->NumberOfTargetPDs * 4))
1465 1.1 christos {
1466 1.1 christos AcpiOsPrintf ("Invalid target proximity domain number\n");
1467 1.1 christos return;
1468 1.1 christos }
1469 1.1 christos for (i = 0; i < HmatLocality->NumberOfTargetPDs; i++)
1470 1.1 christos {
1471 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1472 1.1 christos ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1473 1.1 christos 4, AcpiDmTableInfoHmat1b);
1474 1.1.1.3 christos if (ACPI_FAILURE (Status))
1475 1.1.1.3 christos {
1476 1.1.1.3 christos return;
1477 1.1.1.3 christos }
1478 1.1.1.3 christos
1479 1.1 christos SubtableOffset += 4;
1480 1.1 christos }
1481 1.1 christos
1482 1.1 christos /* Dump latency/bandwidth entris */
1483 1.1 christos
1484 1.1 christos if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1485 1.1 christos (UINT32)(HmatLocality->NumberOfInitiatorPDs *
1486 1.1 christos HmatLocality->NumberOfTargetPDs * 2))
1487 1.1 christos {
1488 1.1 christos AcpiOsPrintf ("Invalid latency/bandwidth entry number\n");
1489 1.1 christos return;
1490 1.1 christos }
1491 1.1 christos for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
1492 1.1 christos {
1493 1.1 christos for (j = 0; j < HmatLocality->NumberOfTargetPDs; j++)
1494 1.1 christos {
1495 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1496 1.1 christos ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1497 1.1 christos 2, AcpiDmTableInfoHmat1c);
1498 1.1.1.3 christos if (ACPI_FAILURE(Status))
1499 1.1.1.3 christos {
1500 1.1.1.3 christos return;
1501 1.1.1.3 christos }
1502 1.1.1.3 christos
1503 1.1 christos SubtableOffset += 2;
1504 1.1 christos }
1505 1.1 christos }
1506 1.1 christos break;
1507 1.1 christos
1508 1.1 christos case ACPI_HMAT_TYPE_CACHE:
1509 1.1 christos
1510 1.1 christos HmatCache = ACPI_CAST_PTR (ACPI_HMAT_CACHE, HmatStruct);
1511 1.1 christos SubtableOffset = sizeof (ACPI_HMAT_CACHE);
1512 1.1 christos
1513 1.1 christos /* Dump SMBIOS handles */
1514 1.1 christos
1515 1.1 christos if ((UINT32)(HmatStruct->Length - SubtableOffset) <
1516 1.1 christos (UINT32)(HmatCache->NumberOfSMBIOSHandles * 2))
1517 1.1 christos {
1518 1.1 christos AcpiOsPrintf ("Invalid SMBIOS handle number\n");
1519 1.1 christos return;
1520 1.1 christos }
1521 1.1 christos for (i = 0; i < HmatCache->NumberOfSMBIOSHandles; i++)
1522 1.1 christos {
1523 1.1 christos Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
1524 1.1 christos ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
1525 1.1 christos 2, AcpiDmTableInfoHmat2a);
1526 1.1.1.3 christos if (ACPI_FAILURE (Status))
1527 1.1.1.3 christos {
1528 1.1.1.3 christos return;
1529 1.1.1.3 christos }
1530 1.1.1.3 christos
1531 1.1 christos SubtableOffset += 2;
1532 1.1 christos }
1533 1.1 christos break;
1534 1.1 christos
1535 1.1 christos default:
1536 1.1 christos
1537 1.1 christos break;
1538 1.1 christos }
1539 1.1 christos
1540 1.1 christos NextSubtable:
1541 1.1 christos /* Point to next HMAT structure subtable */
1542 1.1 christos
1543 1.1 christos Offset += (HmatStruct->Length);
1544 1.1 christos }
1545 1.1 christos }
1546