Print this page
acpica-unix2-20130823
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/io/acpica/disassembler/dmresrcl.c
+++ new/usr/src/common/acpica/components/disassembler/dmresrcl.c
1 1 /*******************************************************************************
2 2 *
3 3 * Module Name: dmresrcl.c - "Large" Resource Descriptor disassembly
4 4 *
5 5 ******************************************************************************/
6 6
7 7 /*
8 - * Copyright (C) 2000 - 2011, Intel Corp.
8 + * Copyright (C) 2000 - 2013, Intel Corp.
9 9 * All rights reserved.
10 10 *
11 11 * Redistribution and use in source and binary forms, with or without
12 12 * modification, are permitted provided that the following conditions
13 13 * are met:
14 14 * 1. Redistributions of source code must retain the above copyright
15 15 * notice, this list of conditions, and the following disclaimer,
16 16 * without modification.
17 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 18 * substantially similar to the "NO WARRANTY" disclaimer below
19 19 * ("Disclaimer") and any redistribution must be conditioned upon
20 20 * including a substantially similar Disclaimer requirement for further
21 21 * binary redistribution.
22 22 * 3. Neither the names of the above-listed copyright holders nor the names
23 23 * of any contributors may be used to endorse or promote products derived
24 24 * from this software without specific prior written permission.
25 25 *
26 26 * Alternatively, this software may be distributed under the terms of the
27 27 * GNU General Public License ("GPL") version 2 as published by the Free
28 28 * Software Foundation.
29 29 *
30 30 * NO WARRANTY
31 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 41 * POSSIBILITY OF SUCH DAMAGES.
42 42 */
43 43
44 44
45 45 #include "acpi.h"
46 46 #include "accommon.h"
47 47 #include "acdisasm.h"
48 48
49 49
50 50 #ifdef ACPI_DISASSEMBLER
51 51
52 52 #define _COMPONENT ACPI_CA_DEBUGGER
53 53 ACPI_MODULE_NAME ("dbresrcl")
54 54
55 55
56 56 /* Common names for address and memory descriptors */
57 57
58 58 static char *AcpiDmAddressNames[] =
59 59 {
60 60 "Granularity",
61 61 "Range Minimum",
62 62 "Range Maximum",
63 63 "Translation Offset",
64 64 "Length"
65 65 };
66 66
67 67 static char *AcpiDmMemoryNames[] =
68 68 {
69 69 "Range Minimum",
70 70 "Range Maximum",
71 71 "Alignment",
72 72 "Length"
73 73 };
74 74
75 75
76 76 /* Local prototypes */
77 77
78 78 static void
79 79 AcpiDmSpaceFlags (
80 80 UINT8 Flags);
81 81
82 82 static void
83 83 AcpiDmIoFlags (
84 84 UINT8 Flags);
85 85
86 86 static void
87 87 AcpiDmIoFlags2 (
88 88 UINT8 SpecificFlags);
89 89
90 90 static void
91 91 AcpiDmMemoryFlags (
92 92 UINT8 Flags,
93 93 UINT8 SpecificFlags);
94 94
95 95 static void
96 96 AcpiDmMemoryFlags2 (
97 97 UINT8 SpecificFlags);
98 98
99 99 static void
100 100 AcpiDmResourceSource (
101 101 AML_RESOURCE *Resource,
102 102 ACPI_SIZE MinimumLength,
103 103 UINT32 Length);
104 104
105 105 static void
106 106 AcpiDmAddressFields (
107 107 void *Source,
108 108 UINT8 Type,
109 109 UINT32 Level);
110 110
111 111 static void
112 112 AcpiDmAddressPrefix (
113 113 UINT8 Type);
114 114
115 115 static void
116 116 AcpiDmAddressCommon (
117 117 AML_RESOURCE *Resource,
118 118 UINT8 Type,
119 119 UINT32 Level);
120 120
121 121 static void
122 122 AcpiDmAddressFlags (
123 123 AML_RESOURCE *Resource);
124 124
125 125
126 126 /*******************************************************************************
127 127 *
128 128 * FUNCTION: AcpiDmMemoryFields
129 129 *
130 130 * PARAMETERS: Source - Pointer to the contiguous data fields
131 131 * Type - 16 or 32 (bit)
132 132 * Level - Current source code indentation level
133 133 *
134 134 * RETURN: None
135 135 *
136 136 * DESCRIPTION: Decode fields common to Memory24 and Memory32 descriptors
137 137 *
138 138 ******************************************************************************/
139 139
140 140 static void
141 141 AcpiDmMemoryFields (
142 142 void *Source,
143 143 UINT8 Type,
144 144 UINT32 Level)
145 145 {
↓ open down ↓ |
127 lines elided |
↑ open up ↑ |
146 146 UINT32 i;
147 147
148 148
149 149 for (i = 0; i < 4; i++)
150 150 {
151 151 AcpiDmIndent (Level + 1);
152 152
153 153 switch (Type)
154 154 {
155 155 case 16:
156 +
156 157 AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
157 158 AcpiDmMemoryNames[i]);
158 159 break;
159 160
160 161 case 32:
162 +
161 163 AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
162 164 AcpiDmMemoryNames[i]);
163 165 break;
164 166
165 167 default:
168 +
166 169 return;
167 170 }
168 171 }
169 172 }
170 173
171 174
172 175 /*******************************************************************************
173 176 *
174 177 * FUNCTION: AcpiDmAddressFields
175 178 *
176 179 * PARAMETERS: Source - Pointer to the contiguous data fields
177 180 * Type - 16, 32, or 64 (bit)
178 181 * Level - Current source code indentation level
179 182 *
180 183 * RETURN: None
181 184 *
182 185 * DESCRIPTION: Decode fields common to address descriptors
183 186 *
184 187 ******************************************************************************/
185 188
186 189 static void
187 190 AcpiDmAddressFields (
188 191 void *Source,
189 192 UINT8 Type,
190 193 UINT32 Level)
191 194 {
192 195 UINT32 i;
193 196
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
194 197
195 198 AcpiOsPrintf ("\n");
196 199
197 200 for (i = 0; i < 5; i++)
198 201 {
199 202 AcpiDmIndent (Level + 1);
200 203
201 204 switch (Type)
202 205 {
203 206 case 16:
207 +
204 208 AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
205 209 AcpiDmAddressNames[i]);
206 210 break;
207 211
208 212 case 32:
213 +
209 214 AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
210 215 AcpiDmAddressNames[i]);
211 216 break;
212 217
213 218 case 64:
219 +
214 220 AcpiDmDumpInteger64 (ACPI_CAST_PTR (UINT64, Source)[i],
215 221 AcpiDmAddressNames[i]);
216 222 break;
217 223
218 224 default:
225 +
219 226 return;
220 227 }
221 228 }
222 229 }
223 230
224 231
225 232 /*******************************************************************************
226 233 *
227 234 * FUNCTION: AcpiDmAddressPrefix
228 235 *
229 236 * PARAMETERS: Type - Descriptor type
230 237 *
231 238 * RETURN: None
232 239 *
233 240 * DESCRIPTION: Emit name prefix representing the address descriptor type
234 241 *
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
235 242 ******************************************************************************/
236 243
237 244 static void
238 245 AcpiDmAddressPrefix (
239 246 UINT8 Type)
240 247 {
241 248
242 249 switch (Type)
243 250 {
244 251 case ACPI_RESOURCE_TYPE_ADDRESS16:
252 +
245 253 AcpiOsPrintf ("Word");
246 254 break;
247 255
248 256 case ACPI_RESOURCE_TYPE_ADDRESS32:
257 +
249 258 AcpiOsPrintf ("DWord");
250 259 break;
251 260
252 261 case ACPI_RESOURCE_TYPE_ADDRESS64:
262 +
253 263 AcpiOsPrintf ("QWord");
254 264 break;
255 265
256 266 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
267 +
257 268 AcpiOsPrintf ("Extended");
258 269 break;
259 270
260 271 default:
272 +
261 273 return;
262 274 }
263 275 }
264 276
265 277
266 278 /*******************************************************************************
267 279 *
268 280 * FUNCTION: AcpiDmAddressCommon
269 281 *
270 282 * PARAMETERS: Resource - Raw AML descriptor
271 283 * Type - Descriptor type
272 284 * Level - Current source code indentation level
273 285 *
274 286 * RETURN: None
275 287 *
276 288 * DESCRIPTION: Emit common name and flag fields common to address descriptors
277 289 *
278 290 ******************************************************************************/
279 291
280 292 static void
281 293 AcpiDmAddressCommon (
282 294 AML_RESOURCE *Resource,
283 295 UINT8 Type,
284 296 UINT32 Level)
285 297 {
286 298 UINT8 ResourceType;
287 299 UINT8 SpecificFlags;
288 300 UINT8 Flags;
289 301
290 302
291 303 ResourceType = Resource->Address.ResourceType;
292 304 SpecificFlags = Resource->Address.SpecificFlags;
293 305 Flags = Resource->Address.Flags;
294 306
295 307 AcpiDmIndent (Level);
296 308
297 309 /* Validate ResourceType */
298 310
299 311 if ((ResourceType > 2) && (ResourceType < 0xC0))
300 312 {
301 313 AcpiOsPrintf ("/**** Invalid Resource Type: 0x%X ****/", ResourceType);
302 314 return;
303 315 }
304 316
305 317 /* Prefix is either Word, DWord, QWord, or Extended */
306 318
307 319 AcpiDmAddressPrefix (Type);
308 320
309 321 /* Resource Types above 0xC0 are vendor-defined */
310 322
↓ open down ↓ |
40 lines elided |
↑ open up ↑ |
311 323 if (ResourceType > 2)
312 324 {
313 325 AcpiOsPrintf ("Space (0x%2.2X, ", ResourceType);
314 326 AcpiDmSpaceFlags (Flags);
315 327 AcpiOsPrintf (" 0x%2.2X,", SpecificFlags);
316 328 return;
317 329 }
318 330
319 331 /* This is either a Memory, IO, or BusNumber descriptor (0,1,2) */
320 332
321 - AcpiOsPrintf ("%s (", AcpiGbl_WordDecode [ResourceType & 0x3]);
333 + AcpiOsPrintf ("%s (", AcpiGbl_WordDecode [ACPI_GET_2BIT_FLAG (ResourceType)]);
322 334
323 335 /* Decode the general and type-specific flags */
324 336
325 337 if (ResourceType == ACPI_MEMORY_RANGE)
326 338 {
327 339 AcpiDmMemoryFlags (Flags, SpecificFlags);
328 340 }
329 341 else /* IO range or BusNumberRange */
330 342 {
331 343 AcpiDmIoFlags (Flags);
332 344 if (ResourceType == ACPI_IO_RANGE)
333 345 {
334 - AcpiOsPrintf (" %s,", AcpiGbl_RngDecode [SpecificFlags & 0x3]);
346 + AcpiOsPrintf (" %s,", AcpiGbl_RngDecode [ACPI_GET_2BIT_FLAG (SpecificFlags)]);
335 347 }
336 348 }
337 349 }
338 350
339 351
340 352 /*******************************************************************************
341 353 *
342 354 * FUNCTION: AcpiDmAddressFlags
343 355 *
344 356 * PARAMETERS: Resource - Raw AML descriptor
345 357 *
346 358 * RETURN: None
347 359 *
348 360 * DESCRIPTION: Emit flags common to address descriptors
349 361 *
350 362 ******************************************************************************/
351 363
352 364 static void
353 365 AcpiDmAddressFlags (
354 366 AML_RESOURCE *Resource)
355 367 {
356 368
357 369 if (Resource->Address.ResourceType == ACPI_IO_RANGE)
358 370 {
359 371 AcpiDmIoFlags2 (Resource->Address.SpecificFlags);
360 372 }
361 373 else if (Resource->Address.ResourceType == ACPI_MEMORY_RANGE)
362 374 {
363 375 AcpiDmMemoryFlags2 (Resource->Address.SpecificFlags);
364 376 }
365 377 }
366 378
367 379
368 380 /*******************************************************************************
369 381 *
370 382 * FUNCTION: AcpiDmSpaceFlags
371 383 *
372 384 * PARAMETERS: Flags - Flag byte to be decoded
373 385 *
374 386 * RETURN: None
375 387 *
↓ open down ↓ |
31 lines elided |
↑ open up ↑ |
376 388 * DESCRIPTION: Decode the flags specific to Space Address space descriptors
377 389 *
378 390 ******************************************************************************/
379 391
380 392 static void
381 393 AcpiDmSpaceFlags (
382 394 UINT8 Flags)
383 395 {
384 396
385 397 AcpiOsPrintf ("%s, %s, %s, %s,",
386 - AcpiGbl_ConsumeDecode [(Flags & 1)],
387 - AcpiGbl_DecDecode [(Flags & 0x2) >> 1],
388 - AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
389 - AcpiGbl_MaxDecode [(Flags & 0x8) >> 3]);
398 + AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
399 + AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)],
400 + AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
401 + AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)]);
390 402 }
391 403
392 404
393 405 /*******************************************************************************
394 406 *
395 407 * FUNCTION: AcpiDmIoFlags
396 408 *
397 409 * PARAMETERS: Flags - Flag byte to be decoded
398 410 *
399 411 * RETURN: None
400 412 *
401 413 * DESCRIPTION: Decode the flags specific to IO Address space descriptors
402 414 *
403 415 ******************************************************************************/
404 416
405 417 static void
406 418 AcpiDmIoFlags (
407 419 UINT8 Flags)
408 420 {
409 421 AcpiOsPrintf ("%s, %s, %s, %s,",
410 - AcpiGbl_ConsumeDecode [(Flags & 1)],
411 - AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
412 - AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
413 - AcpiGbl_DecDecode [(Flags & 0x2) >> 1]);
422 + AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
423 + AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
424 + AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)],
425 + AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)]);
414 426 }
415 427
416 428
417 429 /*******************************************************************************
418 430 *
419 431 * FUNCTION: AcpiDmIoFlags2
420 432 *
421 433 * PARAMETERS: SpecificFlags - "Specific" flag byte to be decoded
422 434 *
423 435 * RETURN: None
424 436 *
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
425 437 * DESCRIPTION: Decode the flags specific to IO Address space descriptors
426 438 *
427 439 ******************************************************************************/
428 440
429 441 static void
430 442 AcpiDmIoFlags2 (
431 443 UINT8 SpecificFlags)
432 444 {
433 445
434 446 AcpiOsPrintf (", %s",
435 - AcpiGbl_TtpDecode [(SpecificFlags & 0x10) >> 4]);
447 + AcpiGbl_TtpDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 4)]);
436 448
437 449 /* TRS is only used if TTP is TypeTranslation */
438 450
439 451 if (SpecificFlags & 0x10)
440 452 {
441 453 AcpiOsPrintf (", %s",
442 - AcpiGbl_TrsDecode [(SpecificFlags & 0x20) >> 5]);
454 + AcpiGbl_TrsDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 5)]);
443 455 }
444 456 }
445 457
446 458
447 459 /*******************************************************************************
448 460 *
449 461 * FUNCTION: AcpiDmMemoryFlags
450 462 *
451 463 * PARAMETERS: Flags - Flag byte to be decoded
452 464 * SpecificFlags - "Specific" flag byte to be decoded
453 465 *
454 466 * RETURN: None
455 467 *
456 468 * DESCRIPTION: Decode flags specific to Memory Address Space descriptors
↓ open down ↓ |
4 lines elided |
↑ open up ↑ |
457 469 *
458 470 ******************************************************************************/
459 471
460 472 static void
461 473 AcpiDmMemoryFlags (
462 474 UINT8 Flags,
463 475 UINT8 SpecificFlags)
464 476 {
465 477
466 478 AcpiOsPrintf ("%s, %s, %s, %s, %s, %s,",
467 - AcpiGbl_ConsumeDecode [(Flags & 1)],
468 - AcpiGbl_DecDecode [(Flags & 0x2) >> 1],
469 - AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
470 - AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
471 - AcpiGbl_MemDecode [(SpecificFlags & 0x6) >> 1],
472 - AcpiGbl_RwDecode [(SpecificFlags & 0x1)]);
479 + AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
480 + AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)],
481 + AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
482 + AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)],
483 + AcpiGbl_MemDecode [ACPI_EXTRACT_2BIT_FLAG (SpecificFlags, 1)],
484 + AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (SpecificFlags)]);
473 485 }
474 486
475 487
476 488 /*******************************************************************************
477 489 *
478 490 * FUNCTION: AcpiDmMemoryFlags2
479 491 *
480 492 * PARAMETERS: SpecificFlags - "Specific" flag byte to be decoded
481 493 *
482 494 * RETURN: None
483 495 *
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
484 496 * DESCRIPTION: Decode flags specific to Memory Address Space descriptors
485 497 *
486 498 ******************************************************************************/
487 499
488 500 static void
489 501 AcpiDmMemoryFlags2 (
490 502 UINT8 SpecificFlags)
491 503 {
492 504
493 505 AcpiOsPrintf (", %s, %s",
494 - AcpiGbl_MtpDecode [(SpecificFlags & 0x18) >> 3],
495 - AcpiGbl_TtpDecode [(SpecificFlags & 0x20) >> 5]);
506 + AcpiGbl_MtpDecode [ACPI_EXTRACT_2BIT_FLAG (SpecificFlags, 3)],
507 + AcpiGbl_TtpDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 5)]);
496 508 }
497 509
498 510
499 511 /*******************************************************************************
500 512 *
501 513 * FUNCTION: AcpiDmResourceSource
502 514 *
503 515 * PARAMETERS: Resource - Raw AML descriptor
504 516 * MinimumLength - descriptor length without optional fields
505 517 * ResourceLength
506 518 *
507 519 * RETURN: None
508 520 *
509 521 * DESCRIPTION: Dump optional ResourceSource fields of an address descriptor
510 522 *
511 523 ******************************************************************************/
512 524
513 525 static void
514 526 AcpiDmResourceSource (
515 527 AML_RESOURCE *Resource,
516 528 ACPI_SIZE MinimumTotalLength,
517 529 UINT32 ResourceLength)
518 530 {
519 531 UINT8 *AmlResourceSource;
520 532 UINT32 TotalLength;
521 533
522 534
523 535 TotalLength = ResourceLength + sizeof (AML_RESOURCE_LARGE_HEADER);
524 536
525 537 /* Check if the optional ResourceSource fields are present */
526 538
527 539 if (TotalLength <= MinimumTotalLength)
528 540 {
529 541 /* The two optional fields are not used */
530 542
531 543 AcpiOsPrintf (",, ");
532 544 return;
533 545 }
534 546
535 547 /* Get a pointer to the ResourceSource */
536 548
537 549 AmlResourceSource = ACPI_ADD_PTR (UINT8, Resource, MinimumTotalLength);
538 550
539 551 /*
540 552 * Always emit the ResourceSourceIndex (Byte)
541 553 *
542 554 * NOTE: Some ASL compilers always create a 0 byte (in the AML) for the
543 555 * Index even if the String does not exist. Although this is in violation
544 556 * of the ACPI specification, it is very important to emit ASL code that
545 557 * can be compiled back to the identical AML. There may be fields and/or
↓ open down ↓ |
40 lines elided |
↑ open up ↑ |
546 558 * indexes into the resource template buffer that are compiled to absolute
547 559 * offsets, and these will be broken if the AML length is changed.
548 560 */
549 561 AcpiOsPrintf ("0x%2.2X,", (UINT32) AmlResourceSource[0]);
550 562
551 563 /* Make sure that the ResourceSource string exists before dumping it */
552 564
553 565 if (TotalLength > (MinimumTotalLength + 1))
554 566 {
555 567 AcpiOsPrintf (" ");
556 - AcpiUtPrintString ((char *) &AmlResourceSource[1], ACPI_UINT8_MAX);
568 + AcpiUtPrintString ((char *) &AmlResourceSource[1], ACPI_UINT16_MAX);
557 569 }
558 570
559 571 AcpiOsPrintf (", ");
560 572 }
561 573
562 574
563 575 /*******************************************************************************
564 576 *
565 577 * FUNCTION: AcpiDmWordDescriptor
566 578 *
567 579 * PARAMETERS: Resource - Pointer to the resource descriptor
568 580 * Length - Length of the descriptor in bytes
569 581 * Level - Current source code indentation level
570 582 *
571 583 * RETURN: None
572 584 *
573 585 * DESCRIPTION: Decode a Word Address Space descriptor
574 586 *
575 587 ******************************************************************************/
576 588
577 589 void
578 590 AcpiDmWordDescriptor (
579 591 AML_RESOURCE *Resource,
580 592 UINT32 Length,
581 593 UINT32 Level)
582 594 {
583 595
584 596 /* Dump resource name and flags */
585 597
586 598 AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS16, Level);
587 599
588 600 /* Dump the 5 contiguous WORD values */
589 601
590 602 AcpiDmAddressFields (&Resource->Address16.Granularity, 16, Level);
591 603
592 604 /* The ResourceSource fields are optional */
593 605
594 606 AcpiDmIndent (Level + 1);
595 607 AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS16), Length);
596 608
597 609 /* Insert a descriptor name */
598 610
599 611 AcpiDmDescriptorName ();
600 612
601 613 /* Type-specific flags */
602 614
603 615 AcpiDmAddressFlags (Resource);
604 616 AcpiOsPrintf (")\n");
605 617 }
606 618
607 619
608 620 /*******************************************************************************
609 621 *
610 622 * FUNCTION: AcpiDmDwordDescriptor
611 623 *
612 624 * PARAMETERS: Resource - Pointer to the resource descriptor
613 625 * Length - Length of the descriptor in bytes
614 626 * Level - Current source code indentation level
615 627 *
616 628 * RETURN: None
617 629 *
618 630 * DESCRIPTION: Decode a DWord Address Space descriptor
619 631 *
620 632 ******************************************************************************/
621 633
622 634 void
623 635 AcpiDmDwordDescriptor (
624 636 AML_RESOURCE *Resource,
625 637 UINT32 Length,
626 638 UINT32 Level)
627 639 {
628 640
629 641 /* Dump resource name and flags */
630 642
631 643 AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS32, Level);
632 644
633 645 /* Dump the 5 contiguous DWORD values */
634 646
635 647 AcpiDmAddressFields (&Resource->Address32.Granularity, 32, Level);
636 648
637 649 /* The ResourceSource fields are optional */
638 650
639 651 AcpiDmIndent (Level + 1);
640 652 AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS32), Length);
641 653
642 654 /* Insert a descriptor name */
643 655
644 656 AcpiDmDescriptorName ();
645 657
646 658 /* Type-specific flags */
647 659
648 660 AcpiDmAddressFlags (Resource);
649 661 AcpiOsPrintf (")\n");
650 662 }
651 663
652 664
653 665 /*******************************************************************************
654 666 *
655 667 * FUNCTION: AcpiDmQwordDescriptor
656 668 *
657 669 * PARAMETERS: Resource - Pointer to the resource descriptor
658 670 * Length - Length of the descriptor in bytes
659 671 * Level - Current source code indentation level
660 672 *
661 673 * RETURN: None
662 674 *
663 675 * DESCRIPTION: Decode a QWord Address Space descriptor
664 676 *
665 677 ******************************************************************************/
666 678
667 679 void
668 680 AcpiDmQwordDescriptor (
669 681 AML_RESOURCE *Resource,
670 682 UINT32 Length,
671 683 UINT32 Level)
672 684 {
673 685
674 686 /* Dump resource name and flags */
675 687
676 688 AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS64, Level);
677 689
678 690 /* Dump the 5 contiguous QWORD values */
679 691
680 692 AcpiDmAddressFields (&Resource->Address64.Granularity, 64, Level);
681 693
682 694 /* The ResourceSource fields are optional */
683 695
684 696 AcpiDmIndent (Level + 1);
685 697 AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS64), Length);
686 698
687 699 /* Insert a descriptor name */
688 700
689 701 AcpiDmDescriptorName ();
690 702
691 703 /* Type-specific flags */
692 704
693 705 AcpiDmAddressFlags (Resource);
694 706 AcpiOsPrintf (")\n");
695 707 }
696 708
697 709
698 710 /*******************************************************************************
699 711 *
700 712 * FUNCTION: AcpiDmExtendedDescriptor
701 713 *
702 714 * PARAMETERS: Resource - Pointer to the resource descriptor
703 715 * Length - Length of the descriptor in bytes
704 716 * Level - Current source code indentation level
705 717 *
706 718 * RETURN: None
707 719 *
708 720 * DESCRIPTION: Decode a Extended Address Space descriptor
709 721 *
710 722 ******************************************************************************/
711 723
712 724 void
713 725 AcpiDmExtendedDescriptor (
714 726 AML_RESOURCE *Resource,
715 727 UINT32 Length,
716 728 UINT32 Level)
717 729 {
718 730
719 731 /* Dump resource name and flags */
720 732
721 733 AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, Level);
722 734
723 735 /* Dump the 5 contiguous QWORD values */
724 736
725 737 AcpiDmAddressFields (&Resource->ExtAddress64.Granularity, 64, Level);
726 738
727 739 /* Extra field for this descriptor only */
728 740
729 741 AcpiDmIndent (Level + 1);
730 742 AcpiDmDumpInteger64 (Resource->ExtAddress64.TypeSpecific,
731 743 "Type-Specific Attributes");
732 744
733 745 /* Insert a descriptor name */
734 746
735 747 AcpiDmIndent (Level + 1);
736 748 AcpiDmDescriptorName ();
737 749
738 750 /* Type-specific flags */
739 751
740 752 AcpiDmAddressFlags (Resource);
741 753 AcpiOsPrintf (")\n");
742 754 }
743 755
744 756
745 757 /*******************************************************************************
746 758 *
747 759 * FUNCTION: AcpiDmMemory24Descriptor
748 760 *
749 761 * PARAMETERS: Resource - Pointer to the resource descriptor
750 762 * Length - Length of the descriptor in bytes
751 763 * Level - Current source code indentation level
752 764 *
753 765 * RETURN: None
754 766 *
755 767 * DESCRIPTION: Decode a Memory24 descriptor
756 768 *
757 769 ******************************************************************************/
758 770
759 771 void
↓ open down ↓ |
193 lines elided |
↑ open up ↑ |
760 772 AcpiDmMemory24Descriptor (
761 773 AML_RESOURCE *Resource,
762 774 UINT32 Length,
763 775 UINT32 Level)
764 776 {
765 777
766 778 /* Dump name and read/write flag */
767 779
768 780 AcpiDmIndent (Level);
769 781 AcpiOsPrintf ("Memory24 (%s,\n",
770 - AcpiGbl_RwDecode [Resource->Memory24.Flags & 1]);
782 + AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->Memory24.Flags)]);
771 783
772 784 /* Dump the 4 contiguous WORD values */
773 785
774 786 AcpiDmMemoryFields (&Resource->Memory24.Minimum, 16, Level);
775 787
776 788 /* Insert a descriptor name */
777 789
778 790 AcpiDmIndent (Level + 1);
779 791 AcpiDmDescriptorName ();
780 792 AcpiOsPrintf (")\n");
781 793 }
782 794
783 795
784 796 /*******************************************************************************
785 797 *
786 798 * FUNCTION: AcpiDmMemory32Descriptor
787 799 *
788 800 * PARAMETERS: Resource - Pointer to the resource descriptor
789 801 * Length - Length of the descriptor in bytes
790 802 * Level - Current source code indentation level
791 803 *
792 804 * RETURN: None
793 805 *
794 806 * DESCRIPTION: Decode a Memory32 descriptor
795 807 *
796 808 ******************************************************************************/
797 809
798 810 void
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
799 811 AcpiDmMemory32Descriptor (
800 812 AML_RESOURCE *Resource,
801 813 UINT32 Length,
802 814 UINT32 Level)
803 815 {
804 816
805 817 /* Dump name and read/write flag */
806 818
807 819 AcpiDmIndent (Level);
808 820 AcpiOsPrintf ("Memory32 (%s,\n",
809 - AcpiGbl_RwDecode [Resource->Memory32.Flags & 1]);
821 + AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->Memory32.Flags)]);
810 822
811 823 /* Dump the 4 contiguous DWORD values */
812 824
813 825 AcpiDmMemoryFields (&Resource->Memory32.Minimum, 32, Level);
814 826
815 827 /* Insert a descriptor name */
816 828
817 829 AcpiDmIndent (Level + 1);
818 830 AcpiDmDescriptorName ();
819 831 AcpiOsPrintf (")\n");
820 832 }
821 833
822 834
823 835 /*******************************************************************************
824 836 *
825 837 * FUNCTION: AcpiDmFixedMemory32Descriptor
826 838 *
827 839 * PARAMETERS: Resource - Pointer to the resource descriptor
828 840 * Length - Length of the descriptor in bytes
829 841 * Level - Current source code indentation level
830 842 *
831 843 * RETURN: None
832 844 *
833 845 * DESCRIPTION: Decode a Fixed Memory32 descriptor
834 846 *
835 847 ******************************************************************************/
836 848
837 849 void
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
838 850 AcpiDmFixedMemory32Descriptor (
839 851 AML_RESOURCE *Resource,
840 852 UINT32 Length,
841 853 UINT32 Level)
842 854 {
843 855
844 856 /* Dump name and read/write flag */
845 857
846 858 AcpiDmIndent (Level);
847 859 AcpiOsPrintf ("Memory32Fixed (%s,\n",
848 - AcpiGbl_RwDecode [Resource->FixedMemory32.Flags & 1]);
860 + AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->FixedMemory32.Flags)]);
849 861
850 862 AcpiDmIndent (Level + 1);
851 863 AcpiDmDumpInteger32 (Resource->FixedMemory32.Address, "Address Base");
852 864
853 865 AcpiDmIndent (Level + 1);
854 866 AcpiDmDumpInteger32 (Resource->FixedMemory32.AddressLength, "Address Length");
855 867
856 868 /* Insert a descriptor name */
857 869
858 870 AcpiDmIndent (Level + 1);
859 871 AcpiDmDescriptorName ();
860 872 AcpiOsPrintf (")\n");
861 873 }
862 874
863 875
864 876 /*******************************************************************************
865 877 *
866 878 * FUNCTION: AcpiDmGenericRegisterDescriptor
867 879 *
868 880 * PARAMETERS: Resource - Pointer to the resource descriptor
869 881 * Length - Length of the descriptor in bytes
870 882 * Level - Current source code indentation level
871 883 *
872 884 * RETURN: None
873 885 *
874 886 * DESCRIPTION: Decode a Generic Register descriptor
875 887 *
876 888 ******************************************************************************/
877 889
878 890 void
879 891 AcpiDmGenericRegisterDescriptor (
880 892 AML_RESOURCE *Resource,
881 893 UINT32 Length,
882 894 UINT32 Level)
883 895 {
884 896
885 897 AcpiDmIndent (Level);
886 898 AcpiOsPrintf ("Register (");
887 899 AcpiDmAddressSpace (Resource->GenericReg.AddressSpaceId);
888 900 AcpiOsPrintf ("\n");
889 901
890 902 AcpiDmIndent (Level + 1);
891 903 AcpiDmDumpInteger8 (Resource->GenericReg.BitWidth, "Bit Width");
892 904
893 905 AcpiDmIndent (Level + 1);
894 906 AcpiDmDumpInteger8 (Resource->GenericReg.BitOffset, "Bit Offset");
895 907
896 908 AcpiDmIndent (Level + 1);
897 909 AcpiDmDumpInteger64 (Resource->GenericReg.Address, "Address");
898 910
899 911 /* Optional field for ACPI 3.0 */
900 912
901 913 AcpiDmIndent (Level + 1);
902 914 if (Resource->GenericReg.AccessSize)
903 915 {
904 916 AcpiOsPrintf ("0x%2.2X, // %s\n",
905 917 Resource->GenericReg.AccessSize, "Access Size");
906 918 AcpiDmIndent (Level + 1);
907 919 }
908 920 else
909 921 {
910 922 AcpiOsPrintf (",");
911 923 }
912 924
913 925 /* DescriptorName was added for ACPI 3.0+ */
914 926
915 927 AcpiDmDescriptorName ();
916 928 AcpiOsPrintf (")\n");
917 929 }
918 930
919 931
920 932 /*******************************************************************************
921 933 *
922 934 * FUNCTION: AcpiDmInterruptDescriptor
923 935 *
924 936 * PARAMETERS: Resource - Pointer to the resource descriptor
925 937 * Length - Length of the descriptor in bytes
926 938 * Level - Current source code indentation level
927 939 *
928 940 * RETURN: None
929 941 *
930 942 * DESCRIPTION: Decode a extended Interrupt descriptor
931 943 *
932 944 ******************************************************************************/
933 945
934 946 void
↓ open down ↓ |
76 lines elided |
↑ open up ↑ |
935 947 AcpiDmInterruptDescriptor (
936 948 AML_RESOURCE *Resource,
937 949 UINT32 Length,
938 950 UINT32 Level)
939 951 {
940 952 UINT32 i;
941 953
942 954
943 955 AcpiDmIndent (Level);
944 956 AcpiOsPrintf ("Interrupt (%s, %s, %s, %s, ",
945 - AcpiGbl_ConsumeDecode [(Resource->ExtendedIrq.Flags & 1)],
946 - AcpiGbl_HeDecode [(Resource->ExtendedIrq.Flags >> 1) & 1],
947 - AcpiGbl_LlDecode [(Resource->ExtendedIrq.Flags >> 2) & 1],
948 - AcpiGbl_ShrDecode [(Resource->ExtendedIrq.Flags >> 3) & 1]);
957 + AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->ExtendedIrq.Flags)],
958 + AcpiGbl_HeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->ExtendedIrq.Flags, 1)],
959 + AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->ExtendedIrq.Flags, 2)],
960 + AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->ExtendedIrq.Flags, 3)]);
949 961
950 962 /*
951 963 * The ResourceSource fields are optional and appear after the interrupt
952 964 * list. Must compute length based on length of the list. First xrupt
953 965 * is included in the struct (reason for -1 below)
954 966 */
955 967 AcpiDmResourceSource (Resource,
956 968 sizeof (AML_RESOURCE_EXTENDED_IRQ) +
957 969 ((UINT32) Resource->ExtendedIrq.InterruptCount - 1) * sizeof (UINT32),
958 970 Resource->ExtendedIrq.ResourceLength);
959 971
960 972 /* Insert a descriptor name */
961 973
962 974 AcpiDmDescriptorName ();
963 975 AcpiOsPrintf (")\n");
964 976
965 977 /* Dump the interrupt list */
966 978
967 979 AcpiDmIndent (Level);
968 980 AcpiOsPrintf ("{\n");
969 981 for (i = 0; i < Resource->ExtendedIrq.InterruptCount; i++)
970 982 {
971 983 AcpiDmIndent (Level + 1);
972 984 AcpiOsPrintf ("0x%8.8X,\n",
973 985 (UINT32) Resource->ExtendedIrq.Interrupts[i]);
974 986 }
975 987
976 988 AcpiDmIndent (Level);
977 989 AcpiOsPrintf ("}\n");
978 990 }
979 991
980 992
981 993 /*******************************************************************************
982 994 *
983 995 * FUNCTION: AcpiDmVendorCommon
984 996 *
985 997 * PARAMETERS: Name - Descriptor name suffix
986 998 * ByteData - Pointer to the vendor byte data
987 999 * Length - Length of the byte data
988 1000 * Level - Current source code indentation level
989 1001 *
990 1002 * RETURN: None
991 1003 *
992 1004 * DESCRIPTION: Decode a Vendor descriptor, both Large and Small
993 1005 *
994 1006 ******************************************************************************/
995 1007
996 1008 void
997 1009 AcpiDmVendorCommon (
998 1010 char *Name,
999 1011 UINT8 *ByteData,
1000 1012 UINT32 Length,
1001 1013 UINT32 Level)
1002 1014 {
1003 1015
1004 1016 /* Dump macro name */
1005 1017
1006 1018 AcpiDmIndent (Level);
1007 1019 AcpiOsPrintf ("Vendor%s (", Name);
1008 1020
1009 1021 /* Insert a descriptor name */
1010 1022
1011 1023 AcpiDmDescriptorName ();
1012 1024 AcpiOsPrintf (") // Length = 0x%.2X\n", Length);
1013 1025
1014 1026 /* Dump the vendor bytes */
1015 1027
1016 1028 AcpiDmIndent (Level);
1017 1029 AcpiOsPrintf ("{\n");
1018 1030
1019 1031 AcpiDmDisasmByteList (Level + 1, ByteData, Length);
1020 1032
1021 1033 AcpiDmIndent (Level);
1022 1034 AcpiOsPrintf ("}\n");
1023 1035 }
1024 1036
1025 1037
1026 1038 /*******************************************************************************
1027 1039 *
1028 1040 * FUNCTION: AcpiDmVendorLargeDescriptor
1029 1041 *
1030 1042 * PARAMETERS: Resource - Pointer to the resource descriptor
1031 1043 * Length - Length of the descriptor in bytes
1032 1044 * Level - Current source code indentation level
1033 1045 *
1034 1046 * RETURN: None
1035 1047 *
1036 1048 * DESCRIPTION: Decode a Vendor Large descriptor
1037 1049 *
1038 1050 ******************************************************************************/
1039 1051
1040 1052 void
1041 1053 AcpiDmVendorLargeDescriptor (
1042 1054 AML_RESOURCE *Resource,
↓ open down ↓ |
84 lines elided |
↑ open up ↑ |
1043 1055 UINT32 Length,
1044 1056 UINT32 Level)
1045 1057 {
1046 1058
1047 1059 AcpiDmVendorCommon ("Long ",
1048 1060 ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_LARGE_HEADER)),
1049 1061 Length, Level);
1050 1062 }
1051 1063
1052 1064 #endif
1053 -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX