13 * All rights reserved. 14 * 15 * 2. License 16 * 17 * 2.1. This is your license from Intel Corp. under its intellectual property 18 * rights. You may have additional license terms from the party that provided 19 * you this software, covering your right to use that party's intellectual 20 * property rights. 21 * 22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23 * copy of the source code appearing in this file ("Covered Code") an 24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25 * base code distributed originally by Intel ("Original Intel Code") to copy, 26 * make derivatives, distribute, use and display any portion of the Covered 27 * Code in any form, with the right to sublicense such rights; and 28 * 29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30 * license (with the right to sublicense), under only those claims of Intel 31 * patents that are infringed by the Original Intel Code, to make, use, sell, 32 * offer to sell, and import the Covered Code and derivative works thereof 33 * solely to the minimum extent necessary to exercise the above copyright 34 * license, and in no event shall the patent license extend to any additions 35 * to or modifications of the Original Intel Code. No other license or right 36 * is granted directly or by implication, estoppel or otherwise; 37 * 38 * The above copyright and patent license is granted only if the following 39 * conditions are met: 40 * 41 * 3. Conditions 42 * 43 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44 * Redistribution of source code of any substantial portion of the Covered 45 * Code or modification with rights to further distribute source must include 46 * the above Copyright Notice, the above License, this list of Conditions, 47 * and the following Disclaimer and Export Compliance provision. In addition, 48 * Licensee must cause all Covered Code to which Licensee contributes to 49 * contain a file documenting the changes Licensee made to create that Covered 50 * Code and the date of any change. Licensee must include in that file the 51 * documentation of any changes made by any predecessor Licensee. Licensee 52 * must include a prominent statement that the modification is derived, 53 * directly or indirectly, from Original Intel Code. 54 * 55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56 * Redistribution of source code of any substantial portion of the Covered 57 * Code or modification without rights to further distribute source must 58 * include the following Disclaimer and Export Compliance provision in the 59 * documentation and/or other materials provided with distribution. In 60 * addition, Licensee may not authorize further sublicense of source of any 61 * portion of the Covered Code, and must include terms to the effect that the 62 * license from Licensee to its licensee is limited to the intellectual 63 * property embodied in the software Licensee provides to its licensee, and 64 * not to intellectual property embodied in modifications its licensee may 65 * make. 66 * 67 * 3.3. Redistribution of Executable. Redistribution in executable form of any 68 * substantial portion of the Covered Code or modification must reproduce the 69 * above Copyright Notice, and the following Disclaimer and Export Compliance 70 * provision in the documentation and/or other materials provided with the 71 * distribution. 72 * 73 * 3.4. Intel retains all right, title, and interest in and to the Original 74 * Intel Code. 75 * 76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77 * Intel shall be used in advertising or otherwise to promote the sale, use or 78 * other dealings in products derived from or relating to the Covered Code 79 * without prior written authorization from Intel. 80 * 81 * 4. Disclaimer and Export Compliance 82 * 83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89 * PARTICULAR PURPOSE. 90 * 91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98 * LIMITED REMEDY. 99 * 100 * 4.3. Licensee shall not export, either directly or indirectly, any of this 101 * software or system incorporating such software without first obtaining any 102 * required license or other approval from the U. S. Department of Commerce or 103 * any other agency or department of the United States Government. In the 104 * event Licensee exports any such software from the United States or 105 * re-exports any such software from a foreign destination, Licensee shall 106 * ensure that the distribution and export/re-export of the software is in 107 * compliance with all laws, regulations, orders, or other restrictions of the 108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109 * any of its subsidiaries will export/re-export any technical data, process, 110 * software, or service, directly or indirectly, to any country for which the 111 * United States government or any agency thereof requires an export license, 112 * other governmental approval, or letter of assurance, without first obtaining 113 * such license, approval or letter. 114 * 115 *****************************************************************************/ 116 117#define __EXDUMP_C__ 118 119#include "acpi.h" 120#include "acinterp.h" 121#include "amlcode.h" 122#include "acnamesp.h" 123#include "acparser.h" 124 125#define _COMPONENT ACPI_EXECUTER 126 ACPI_MODULE_NAME ("exdump") 127 128 129/* 130 * The following routines are used for debug output only 131 */ 132 133#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 134 135/***************************************************************************** 136 * 137 * FUNCTION: AcpiExDumpOperand 138 * 139 * PARAMETERS: *ObjDesc - Pointer to entry to be dumped 140 * 141 * RETURN: Status 142 * 143 * DESCRIPTION: Dump an operand object 144 * 145 ****************************************************************************/ 146 147void 148AcpiExDumpOperand ( 149 ACPI_OPERAND_OBJECT *ObjDesc) 150{ 151 UINT8 *Buf = NULL; 152 UINT32 Length; 153 ACPI_OPERAND_OBJECT **Element; 154 UINT16 ElementIndex; 155 156 157 ACPI_FUNCTION_NAME ("ExDumpOperand") 158 159 160 if (!((ACPI_LV_EXEC & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) 161 { 162 return; 163 } 164 165 if (!ObjDesc) 166 { 167 /* 168 * This usually indicates that something serious is wrong 169 */ 170 AcpiOsPrintf ("Null Object Descriptor\n"); 171 return; 172 } 173 174 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED) 175 { 176 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is a NS Node: ", ObjDesc)); 177 ACPI_DUMP_ENTRY (ObjDesc, ACPI_LV_EXEC); 178 return; 179 } 180 181 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) 182 { 183 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 184 "%p is not a node or operand object: [%s]\n", 185 ObjDesc, AcpiUtGetDescriptorName (ObjDesc))); 186 ACPI_DUMP_BUFFER (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)); 187 return; 188 } 189 190 /* ObjDesc is a valid object */ 191 192 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", ObjDesc)); 193 194 switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) 195 { 196 case ACPI_TYPE_LOCAL_REFERENCE: 197 198 switch (ObjDesc->Reference.Opcode) 199 { 200 case AML_DEBUG_OP: 201 202 AcpiOsPrintf ("Reference: Debug\n"); 203 break; 204 205 206 case AML_NAME_OP: 207 208 ACPI_DUMP_PATHNAME (ObjDesc->Reference.Object, "Reference: Name: ", 209 ACPI_LV_INFO, _COMPONENT); 210 ACPI_DUMP_ENTRY (ObjDesc->Reference.Object, ACPI_LV_INFO); 211 break; 212 213 214 case AML_INDEX_OP: 215 216 AcpiOsPrintf ("Reference: Index %p\n", 217 ObjDesc->Reference.Object); 218 break; 219 220 221 case AML_REF_OF_OP: 222 223 AcpiOsPrintf ("Reference: (RefOf) %p\n", 224 ObjDesc->Reference.Object); 225 break; 226 227 228 case AML_ARG_OP: 229 230 AcpiOsPrintf ("Reference: Arg%d", 231 ObjDesc->Reference.Offset); 232 233 if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER) 234 { 235 /* Value is an Integer */ 236 237 AcpiOsPrintf (" value is [%8.8X%8.8x]", 238 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); 239 } 240 241 AcpiOsPrintf ("\n"); 242 break; 243 244 245 case AML_LOCAL_OP: 246 247 AcpiOsPrintf ("Reference: Local%d", 248 ObjDesc->Reference.Offset); 249 250 if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER) 251 { 252 253 /* Value is an Integer */ 254 255 AcpiOsPrintf (" value is [%8.8X%8.8x]", 256 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); 257 } 258 259 AcpiOsPrintf ("\n"); 260 break; 261 262 263 case AML_INT_NAMEPATH_OP: 264 265 AcpiOsPrintf ("Reference.Node->Name %X\n", 266 ObjDesc->Reference.Node->Name.Integer); 267 break; 268 269 270 default: 271 272 /* Unknown opcode */ 273 274 AcpiOsPrintf ("Unknown Reference opcode=%X\n", 275 ObjDesc->Reference.Opcode); 276 break; 277 278 } 279 280 break; 281 282 283 case ACPI_TYPE_BUFFER: 284 285 AcpiOsPrintf ("Buffer len %X @ %p \n", 286 ObjDesc->Buffer.Length, 287 ObjDesc->Buffer.Pointer); 288 289 Length = ObjDesc->Buffer.Length; 290 291 if (Length > 64) 292 { 293 Length = 64; 294 } 295 296 /* Debug only -- dump the buffer contents */ 297 298 if (ObjDesc->Buffer.Pointer) 299 { 300 AcpiOsPrintf ("Buffer Contents: "); 301 302 for (Buf = ObjDesc->Buffer.Pointer; Length--; ++Buf) 303 { 304 AcpiOsPrintf (" %02x", *Buf); 305 } 306 AcpiOsPrintf ("\n"); 307 } 308 309 break; 310 311 312 case ACPI_TYPE_INTEGER: 313 314 AcpiOsPrintf ("Integer %8.8X%8.8X\n", 315 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); 316 break; 317 318 319 case ACPI_TYPE_PACKAGE: 320 321 AcpiOsPrintf ("Package count %X @ %p\n", 322 ObjDesc->Package.Count, ObjDesc->Package.Elements); 323 324 /* 325 * If elements exist, package vector pointer is valid, 326 * and debug_level exceeds 1, dump package's elements. 327 */ 328 if (ObjDesc->Package.Count && 329 ObjDesc->Package.Elements && 330 AcpiDbgLevel > 1) 331 { 332 for (ElementIndex = 0, Element = ObjDesc->Package.Elements; 333 ElementIndex < ObjDesc->Package.Count; 334 ++ElementIndex, ++Element) 335 { 336 AcpiExDumpOperand (*Element); 337 } 338 } 339 AcpiOsPrintf ("\n"); 340 break; 341 342 343 case ACPI_TYPE_REGION: 344 345 AcpiOsPrintf ("Region %s (%X)", 346 AcpiUtGetRegionName (ObjDesc->Region.SpaceId), 347 ObjDesc->Region.SpaceId); 348 349 /* 350 * If the address and length have not been evaluated, 351 * don't print them. 352 */ 353 if (!(ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)) 354 { 355 AcpiOsPrintf ("\n"); 356 } 357 else 358 { 359 AcpiOsPrintf (" base %8.8X%8.8X Length %X\n", 360 ACPI_FORMAT_UINT64 (ObjDesc->Region.Address), 361 ObjDesc->Region.Length); 362 } 363 break; 364 365 366 case ACPI_TYPE_STRING: 367 368 AcpiOsPrintf ("String length %X @ %p ", 369 ObjDesc->String.Length, ObjDesc->String.Pointer); 370 AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX); 371 AcpiOsPrintf ("\n"); 372 break; 373 374 375 case ACPI_TYPE_LOCAL_BANK_FIELD: 376 377 AcpiOsPrintf ("BankField\n"); 378 break; 379 380 381 case ACPI_TYPE_LOCAL_REGION_FIELD: 382 383 AcpiOsPrintf ( 384 "RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n", 385 ObjDesc->Field.BitLength, ObjDesc->Field.AccessByteWidth, 386 ObjDesc->Field.FieldFlags & AML_FIELD_LOCK_RULE_MASK, 387 ObjDesc->Field.FieldFlags & AML_FIELD_UPDATE_RULE_MASK, 388 ObjDesc->Field.BaseByteOffset, ObjDesc->Field.StartFieldBitOffset); 389 ACPI_DUMP_STACK_ENTRY (ObjDesc->Field.RegionObj); 390 break; 391 392 393 case ACPI_TYPE_LOCAL_INDEX_FIELD: 394 395 AcpiOsPrintf ("IndexField\n"); 396 break; 397 398 399 case ACPI_TYPE_BUFFER_FIELD: 400 401 AcpiOsPrintf ( 402 "BufferField: %X bits at byte %X bit %X of \n", 403 ObjDesc->BufferField.BitLength, ObjDesc->BufferField.BaseByteOffset, 404 ObjDesc->BufferField.StartFieldBitOffset); 405 406 if (!ObjDesc->BufferField.BufferObj) 407 { 408 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n")); 409 } 410 else if (ACPI_GET_OBJECT_TYPE (ObjDesc->BufferField.BufferObj) != ACPI_TYPE_BUFFER) 411 { 412 AcpiOsPrintf ("*not a Buffer* \n"); 413 } 414 else 415 { 416 ACPI_DUMP_STACK_ENTRY (ObjDesc->BufferField.BufferObj); 417 } 418 419 break; 420 421 422 case ACPI_TYPE_EVENT: 423 424 AcpiOsPrintf ("Event\n"); 425 break; 426 427 428 case ACPI_TYPE_METHOD: 429 430 AcpiOsPrintf ( 431 "Method(%X) @ %p:%X\n", 432 ObjDesc->Method.ParamCount, 433 ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength); 434 break; 435 436 437 case ACPI_TYPE_MUTEX: 438 439 AcpiOsPrintf ("Mutex\n"); 440 break; 441 442 443 case ACPI_TYPE_DEVICE: 444 445 AcpiOsPrintf ("Device\n"); 446 break; 447 448 449 case ACPI_TYPE_POWER: 450 451 AcpiOsPrintf ("Power\n"); 452 break; 453 454 455 case ACPI_TYPE_PROCESSOR: 456 457 AcpiOsPrintf ("Processor\n"); 458 break; 459 460 461 case ACPI_TYPE_THERMAL: 462 463 AcpiOsPrintf ("Thermal\n"); 464 break; 465 466 467 default: 468 /* Unknown Type */ 469 470 AcpiOsPrintf ("Unknown Type %X\n", ACPI_GET_OBJECT_TYPE (ObjDesc)); 471 break; 472 } 473 474 return; 475} 476 477 478/***************************************************************************** 479 * 480 * FUNCTION: AcpiExDumpOperands 481 * 482 * PARAMETERS: InterpreterMode - Load or Exec 483 * *Ident - Identification 484 * NumLevels - # of stack entries to dump above line 485 * *Note - Output notation 486 * 487 * DESCRIPTION: Dump the object stack 488 * 489 ****************************************************************************/ 490 491void 492AcpiExDumpOperands ( 493 ACPI_OPERAND_OBJECT **Operands, 494 ACPI_INTERPRETER_MODE InterpreterMode, 495 char *Ident, 496 UINT32 NumLevels, 497 char *Note, 498 char *ModuleName, 499 UINT32 LineNumber) 500{ 501 ACPI_NATIVE_UINT i; 502 ACPI_OPERAND_OBJECT **ObjDesc; 503 504 505 ACPI_FUNCTION_NAME ("ExDumpOperands"); 506 507 508 if (!Ident) 509 { 510 Ident = "?"; 511 } 512 513 if (!Note) 514 { 515 Note = "?"; 516 } 517 518 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 519 "************* Operand Stack Contents (Opcode [%s], %d Operands)\n", 520 Ident, NumLevels)); 521 522 if (NumLevels == 0) 523 { 524 NumLevels = 1; 525 } 526 527 /* Dump the operand stack starting at the top */ 528 529 for (i = 0; NumLevels > 0; i--, NumLevels--) 530 { 531 ObjDesc = &Operands[i]; 532 AcpiExDumpOperand (*ObjDesc); 533 } 534 535 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 536 "************* Stack dump from %s(%d), %s\n", 537 ModuleName, LineNumber, Note)); 538 return; 539} 540 541 542/***************************************************************************** 543 * 544 * FUNCTION: AcpiExOut* 545 * 546 * PARAMETERS: Title - Descriptive text 547 * Value - Value to be displayed 548 * 549 * DESCRIPTION: Object dump output formatting functions. These functions 550 * reduce the number of format strings required and keeps them 551 * all in one place for easy modification. 552 * 553 ****************************************************************************/ 554 555void 556AcpiExOutString ( 557 char *Title, 558 char *Value) 559{ 560 AcpiOsPrintf ("%20s : %s\n", Title, Value); 561} 562 563void 564AcpiExOutPointer ( 565 char *Title, 566 void *Value) 567{ 568 AcpiOsPrintf ("%20s : %p\n", Title, Value); 569} 570 571void 572AcpiExOutInteger ( 573 char *Title, 574 UINT32 Value) 575{ 576 AcpiOsPrintf ("%20s : %X\n", Title, Value); 577} 578 579void 580AcpiExOutAddress ( 581 char *Title, 582 ACPI_PHYSICAL_ADDRESS Value) 583{ 584 585#if ACPI_MACHINE_WIDTH == 16 586 AcpiOsPrintf ("%20s : %p\n", Title, Value); 587#else 588 AcpiOsPrintf ("%20s : %8.8X%8.8X\n", Title, 589 ACPI_FORMAT_UINT64 (Value)); 590#endif 591} 592 593 594/***************************************************************************** 595 * 596 * FUNCTION: AcpiExDumpNode 597 * 598 * PARAMETERS: *Node - Descriptor to dump 599 * Flags - Force display 600 * 601 * DESCRIPTION: Dumps the members of the given.Node 602 * 603 ****************************************************************************/ 604 605void 606AcpiExDumpNode ( 607 ACPI_NAMESPACE_NODE *Node, 608 UINT32 Flags) 609{ 610 611 ACPI_FUNCTION_ENTRY (); 612 613 614 if (!Flags) 615 { 616 if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) 617 { 618 return; 619 } 620 } 621 622 AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node)); 623 AcpiExOutString ("Type", AcpiUtGetTypeName (Node->Type)); 624 AcpiExOutInteger ("Flags", Node->Flags); 625 AcpiExOutInteger ("Owner Id", Node->OwnerId); 626 AcpiExOutInteger ("Reference Count", Node->ReferenceCount); 627 AcpiExOutPointer ("Attached Object", AcpiNsGetAttachedObject (Node)); 628 AcpiExOutPointer ("ChildList", Node->Child); 629 AcpiExOutPointer ("NextPeer", Node->Peer); 630 AcpiExOutPointer ("Parent", AcpiNsGetParentNode (Node)); 631} 632 633 634/***************************************************************************** 635 * 636 * FUNCTION: AcpiExDumpObjectDescriptor 637 * 638 * PARAMETERS: *Object - Descriptor to dump 639 * Flags - Force display 640 * 641 * DESCRIPTION: Dumps the members of the object descriptor given. 642 * 643 ****************************************************************************/ 644 645void 646AcpiExDumpObjectDescriptor ( 647 ACPI_OPERAND_OBJECT *ObjDesc, 648 UINT32 Flags) 649{ 650 UINT32 i; 651 652 653 ACPI_FUNCTION_TRACE ("ExDumpObjectDescriptor"); 654 655 656 if (!Flags) 657 { 658 if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) 659 { 660 return_VOID; 661 } 662 } 663 664 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED) 665 { 666 AcpiExDumpNode ((ACPI_NAMESPACE_NODE *) ObjDesc, Flags); 667 AcpiOsPrintf ("\nAttached Object (%p):\n", ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object); 668 AcpiExDumpObjectDescriptor (((ACPI_NAMESPACE_NODE *) ObjDesc)->Object, Flags); 669 return; 670 } 671 672 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) 673 { 674 AcpiOsPrintf ("ExDumpObjectDescriptor: %p is not an ACPI operand object: [%s]\n", 675 ObjDesc, AcpiUtGetDescriptorName (ObjDesc)); 676 return_VOID; 677 } 678 679 /* Common Fields */ 680 681 AcpiExOutString ("Type", AcpiUtGetObjectTypeName (ObjDesc)); 682 AcpiExOutInteger ("Reference Count", ObjDesc->Common.ReferenceCount); 683 AcpiExOutInteger ("Flags", ObjDesc->Common.Flags); 684 685 /* Object-specific Fields */ 686 687 switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) 688 { 689 case ACPI_TYPE_INTEGER: 690 691 AcpiOsPrintf ("%20s : %8.8X%8.8X\n", "Value", 692 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); 693 break; 694 695 696 case ACPI_TYPE_STRING: 697 698 AcpiExOutInteger ("Length", ObjDesc->String.Length); 699 700 AcpiOsPrintf ("%20s : %p ", "Pointer", ObjDesc->String.Pointer); 701 AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX); 702 AcpiOsPrintf ("\n"); 703 break; 704 705 706 case ACPI_TYPE_BUFFER: 707 708 AcpiExOutInteger ("Length", ObjDesc->Buffer.Length); 709 AcpiExOutPointer ("Pointer", ObjDesc->Buffer.Pointer); 710 ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length); 711 break; 712 713 714 case ACPI_TYPE_PACKAGE: 715 716 AcpiExOutInteger ("Flags", ObjDesc->Package.Flags); 717 AcpiExOutInteger ("Count", ObjDesc->Package.Count); 718 AcpiExOutPointer ("Elements", ObjDesc->Package.Elements); 719 720 /* Dump the package contents */ 721 722 if (ObjDesc->Package.Count > 0) 723 { 724 AcpiOsPrintf ("\nPackage Contents:\n"); 725 for (i = 0; i < ObjDesc->Package.Count; i++) 726 { 727 AcpiOsPrintf ("[%.3d] %p", i, ObjDesc->Package.Elements[i]); 728 if (ObjDesc->Package.Elements[i]) 729 { 730 AcpiOsPrintf (" %s", AcpiUtGetObjectTypeName (ObjDesc->Package.Elements[i])); 731 } 732 AcpiOsPrintf ("\n"); 733 } 734 } 735 break; 736 737 738 case ACPI_TYPE_DEVICE: 739 740 AcpiExOutPointer ("Handler", ObjDesc->Device.Handler); 741 AcpiExOutPointer ("SystemNotify", ObjDesc->Device.SystemNotify); 742 AcpiExOutPointer ("DeviceNotify", ObjDesc->Device.DeviceNotify); 743 break; 744 745 746 case ACPI_TYPE_EVENT: 747 748 AcpiExOutPointer ("Semaphore", ObjDesc->Event.Semaphore); 749 break; 750 751 752 case ACPI_TYPE_METHOD: 753 754 AcpiExOutInteger ("ParamCount", ObjDesc->Method.ParamCount); 755 AcpiExOutInteger ("Concurrency", ObjDesc->Method.Concurrency); 756 AcpiExOutPointer ("Semaphore", ObjDesc->Method.Semaphore); 757 AcpiExOutInteger ("OwningId", ObjDesc->Method.OwningId); 758 AcpiExOutInteger ("AmlLength", ObjDesc->Method.AmlLength); 759 AcpiExOutPointer ("AmlStart", ObjDesc->Method.AmlStart); 760 break; 761 762 763 case ACPI_TYPE_MUTEX: 764 765 AcpiExOutInteger ("SyncLevel", ObjDesc->Mutex.SyncLevel); 766 AcpiExOutPointer ("OwnerThread", ObjDesc->Mutex.OwnerThread); 767 AcpiExOutInteger ("AcquisitionDepth",ObjDesc->Mutex.AcquisitionDepth); 768 AcpiExOutPointer ("Semaphore", ObjDesc->Mutex.Semaphore); 769 break; 770 771 772 case ACPI_TYPE_REGION: 773 774 AcpiExOutInteger ("SpaceId", ObjDesc->Region.SpaceId); 775 AcpiExOutInteger ("Flags", ObjDesc->Region.Flags); 776 AcpiExOutAddress ("Address", ObjDesc->Region.Address); 777 AcpiExOutInteger ("Length", ObjDesc->Region.Length); 778 AcpiExOutPointer ("Handler", ObjDesc->Region.Handler); 779 AcpiExOutPointer ("Next", ObjDesc->Region.Next); 780 break; 781 782 783 case ACPI_TYPE_POWER: 784 785 AcpiExOutInteger ("SystemLevel", ObjDesc->PowerResource.SystemLevel); 786 AcpiExOutInteger ("ResourceOrder", ObjDesc->PowerResource.ResourceOrder); 787 AcpiExOutPointer ("SystemNotify", ObjDesc->PowerResource.SystemNotify); 788 AcpiExOutPointer ("DeviceNotify", ObjDesc->PowerResource.DeviceNotify); 789 break; 790 791 792 case ACPI_TYPE_PROCESSOR: 793 794 AcpiExOutInteger ("Processor ID", ObjDesc->Processor.ProcId); 795 AcpiExOutInteger ("Length", ObjDesc->Processor.Length); 796 AcpiExOutAddress ("Address", (ACPI_PHYSICAL_ADDRESS) ObjDesc->Processor.Address); 797 AcpiExOutPointer ("SystemNotify", ObjDesc->Processor.SystemNotify); 798 AcpiExOutPointer ("DeviceNotify", ObjDesc->Processor.DeviceNotify); 799 AcpiExOutPointer ("Handler", ObjDesc->Processor.Handler); 800 break; 801 802 803 case ACPI_TYPE_THERMAL: 804 805 AcpiExOutPointer ("SystemNotify", ObjDesc->ThermalZone.SystemNotify); 806 AcpiExOutPointer ("DeviceNotify", ObjDesc->ThermalZone.DeviceNotify); 807 AcpiExOutPointer ("Handler", ObjDesc->ThermalZone.Handler); 808 break; 809 810 811 case ACPI_TYPE_BUFFER_FIELD: 812 case ACPI_TYPE_LOCAL_REGION_FIELD: 813 case ACPI_TYPE_LOCAL_BANK_FIELD: 814 case ACPI_TYPE_LOCAL_INDEX_FIELD: 815 816 AcpiExOutInteger ("FieldFlags", ObjDesc->CommonField.FieldFlags); 817 AcpiExOutInteger ("AccessByteWidth", ObjDesc->CommonField.AccessByteWidth); 818 AcpiExOutInteger ("BitLength", ObjDesc->CommonField.BitLength); 819 AcpiExOutInteger ("FldBitOffset", ObjDesc->CommonField.StartFieldBitOffset); 820 AcpiExOutInteger ("BaseByteOffset", ObjDesc->CommonField.BaseByteOffset); 821 AcpiExOutInteger ("DatumValidBits", ObjDesc->CommonField.DatumValidBits); 822 AcpiExOutInteger ("EndFldValidBits", ObjDesc->CommonField.EndFieldValidBits); 823 AcpiExOutInteger ("EndBufValidBits", ObjDesc->CommonField.EndBufferValidBits); 824 AcpiExOutPointer ("ParentNode", ObjDesc->CommonField.Node); 825 826 switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) 827 { 828 case ACPI_TYPE_BUFFER_FIELD: 829 AcpiExOutPointer ("BufferObj", ObjDesc->BufferField.BufferObj); 830 break; 831 832 case ACPI_TYPE_LOCAL_REGION_FIELD: 833 AcpiExOutPointer ("RegionObj", ObjDesc->Field.RegionObj); 834 break; 835 836 case ACPI_TYPE_LOCAL_BANK_FIELD: 837 AcpiExOutInteger ("Value", ObjDesc->BankField.Value); 838 AcpiExOutPointer ("RegionObj", ObjDesc->BankField.RegionObj); 839 AcpiExOutPointer ("BankObj", ObjDesc->BankField.BankObj); 840 break; 841 842 case ACPI_TYPE_LOCAL_INDEX_FIELD: 843 AcpiExOutInteger ("Value", ObjDesc->IndexField.Value); 844 AcpiExOutPointer ("Index", ObjDesc->IndexField.IndexObj); 845 AcpiExOutPointer ("Data", ObjDesc->IndexField.DataObj); 846 break; 847 848 default: 849 /* All object types covered above */ 850 break; 851 } 852 break; 853 854 855 case ACPI_TYPE_LOCAL_REFERENCE: 856 857 AcpiExOutInteger ("TargetType", ObjDesc->Reference.TargetType); 858 AcpiExOutString ("Opcode", (AcpiPsGetOpcodeInfo (ObjDesc->Reference.Opcode))->Name); 859 AcpiExOutInteger ("Offset", ObjDesc->Reference.Offset); 860 AcpiExOutPointer ("ObjDesc", ObjDesc->Reference.Object); 861 AcpiExOutPointer ("Node", ObjDesc->Reference.Node); 862 AcpiExOutPointer ("Where", ObjDesc->Reference.Where); 863 break; 864 865 866 case ACPI_TYPE_LOCAL_ADDRESS_HANDLER: 867 868 AcpiExOutInteger ("SpaceId", ObjDesc->AddressSpace.SpaceId); 869 AcpiExOutPointer ("Next", ObjDesc->AddressSpace.Next); 870 AcpiExOutPointer ("RegionList", ObjDesc->AddressSpace.RegionList); 871 AcpiExOutPointer ("Node", ObjDesc->AddressSpace.Node); 872 AcpiExOutPointer ("Context", ObjDesc->AddressSpace.Context); 873 break; 874 875 876 case ACPI_TYPE_LOCAL_NOTIFY: 877 878 AcpiExOutPointer ("Node", ObjDesc->Notify.Node); 879 AcpiExOutPointer ("Context", ObjDesc->Notify.Context); 880 break; 881 882 883 case ACPI_TYPE_LOCAL_ALIAS: 884 case ACPI_TYPE_LOCAL_EXTRA: 885 case ACPI_TYPE_LOCAL_DATA: 886 default: 887 888 AcpiOsPrintf ("ExDumpObjectDescriptor: Display not implemented for object type %s\n", 889 AcpiUtGetObjectTypeName (ObjDesc)); 890 break; 891 } 892 893 return_VOID; 894} 895 896#endif 897
| 13 * All rights reserved. 14 * 15 * 2. License 16 * 17 * 2.1. This is your license from Intel Corp. under its intellectual property 18 * rights. You may have additional license terms from the party that provided 19 * you this software, covering your right to use that party's intellectual 20 * property rights. 21 * 22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23 * copy of the source code appearing in this file ("Covered Code") an 24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25 * base code distributed originally by Intel ("Original Intel Code") to copy, 26 * make derivatives, distribute, use and display any portion of the Covered 27 * Code in any form, with the right to sublicense such rights; and 28 * 29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30 * license (with the right to sublicense), under only those claims of Intel 31 * patents that are infringed by the Original Intel Code, to make, use, sell, 32 * offer to sell, and import the Covered Code and derivative works thereof 33 * solely to the minimum extent necessary to exercise the above copyright 34 * license, and in no event shall the patent license extend to any additions 35 * to or modifications of the Original Intel Code. No other license or right 36 * is granted directly or by implication, estoppel or otherwise; 37 * 38 * The above copyright and patent license is granted only if the following 39 * conditions are met: 40 * 41 * 3. Conditions 42 * 43 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44 * Redistribution of source code of any substantial portion of the Covered 45 * Code or modification with rights to further distribute source must include 46 * the above Copyright Notice, the above License, this list of Conditions, 47 * and the following Disclaimer and Export Compliance provision. In addition, 48 * Licensee must cause all Covered Code to which Licensee contributes to 49 * contain a file documenting the changes Licensee made to create that Covered 50 * Code and the date of any change. Licensee must include in that file the 51 * documentation of any changes made by any predecessor Licensee. Licensee 52 * must include a prominent statement that the modification is derived, 53 * directly or indirectly, from Original Intel Code. 54 * 55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56 * Redistribution of source code of any substantial portion of the Covered 57 * Code or modification without rights to further distribute source must 58 * include the following Disclaimer and Export Compliance provision in the 59 * documentation and/or other materials provided with distribution. In 60 * addition, Licensee may not authorize further sublicense of source of any 61 * portion of the Covered Code, and must include terms to the effect that the 62 * license from Licensee to its licensee is limited to the intellectual 63 * property embodied in the software Licensee provides to its licensee, and 64 * not to intellectual property embodied in modifications its licensee may 65 * make. 66 * 67 * 3.3. Redistribution of Executable. Redistribution in executable form of any 68 * substantial portion of the Covered Code or modification must reproduce the 69 * above Copyright Notice, and the following Disclaimer and Export Compliance 70 * provision in the documentation and/or other materials provided with the 71 * distribution. 72 * 73 * 3.4. Intel retains all right, title, and interest in and to the Original 74 * Intel Code. 75 * 76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77 * Intel shall be used in advertising or otherwise to promote the sale, use or 78 * other dealings in products derived from or relating to the Covered Code 79 * without prior written authorization from Intel. 80 * 81 * 4. Disclaimer and Export Compliance 82 * 83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89 * PARTICULAR PURPOSE. 90 * 91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98 * LIMITED REMEDY. 99 * 100 * 4.3. Licensee shall not export, either directly or indirectly, any of this 101 * software or system incorporating such software without first obtaining any 102 * required license or other approval from the U. S. Department of Commerce or 103 * any other agency or department of the United States Government. In the 104 * event Licensee exports any such software from the United States or 105 * re-exports any such software from a foreign destination, Licensee shall 106 * ensure that the distribution and export/re-export of the software is in 107 * compliance with all laws, regulations, orders, or other restrictions of the 108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109 * any of its subsidiaries will export/re-export any technical data, process, 110 * software, or service, directly or indirectly, to any country for which the 111 * United States government or any agency thereof requires an export license, 112 * other governmental approval, or letter of assurance, without first obtaining 113 * such license, approval or letter. 114 * 115 *****************************************************************************/ 116 117#define __EXDUMP_C__ 118 119#include "acpi.h" 120#include "acinterp.h" 121#include "amlcode.h" 122#include "acnamesp.h" 123#include "acparser.h" 124 125#define _COMPONENT ACPI_EXECUTER 126 ACPI_MODULE_NAME ("exdump") 127 128 129/* 130 * The following routines are used for debug output only 131 */ 132 133#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 134 135/***************************************************************************** 136 * 137 * FUNCTION: AcpiExDumpOperand 138 * 139 * PARAMETERS: *ObjDesc - Pointer to entry to be dumped 140 * 141 * RETURN: Status 142 * 143 * DESCRIPTION: Dump an operand object 144 * 145 ****************************************************************************/ 146 147void 148AcpiExDumpOperand ( 149 ACPI_OPERAND_OBJECT *ObjDesc) 150{ 151 UINT8 *Buf = NULL; 152 UINT32 Length; 153 ACPI_OPERAND_OBJECT **Element; 154 UINT16 ElementIndex; 155 156 157 ACPI_FUNCTION_NAME ("ExDumpOperand") 158 159 160 if (!((ACPI_LV_EXEC & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) 161 { 162 return; 163 } 164 165 if (!ObjDesc) 166 { 167 /* 168 * This usually indicates that something serious is wrong 169 */ 170 AcpiOsPrintf ("Null Object Descriptor\n"); 171 return; 172 } 173 174 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED) 175 { 176 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is a NS Node: ", ObjDesc)); 177 ACPI_DUMP_ENTRY (ObjDesc, ACPI_LV_EXEC); 178 return; 179 } 180 181 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) 182 { 183 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 184 "%p is not a node or operand object: [%s]\n", 185 ObjDesc, AcpiUtGetDescriptorName (ObjDesc))); 186 ACPI_DUMP_BUFFER (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)); 187 return; 188 } 189 190 /* ObjDesc is a valid object */ 191 192 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", ObjDesc)); 193 194 switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) 195 { 196 case ACPI_TYPE_LOCAL_REFERENCE: 197 198 switch (ObjDesc->Reference.Opcode) 199 { 200 case AML_DEBUG_OP: 201 202 AcpiOsPrintf ("Reference: Debug\n"); 203 break; 204 205 206 case AML_NAME_OP: 207 208 ACPI_DUMP_PATHNAME (ObjDesc->Reference.Object, "Reference: Name: ", 209 ACPI_LV_INFO, _COMPONENT); 210 ACPI_DUMP_ENTRY (ObjDesc->Reference.Object, ACPI_LV_INFO); 211 break; 212 213 214 case AML_INDEX_OP: 215 216 AcpiOsPrintf ("Reference: Index %p\n", 217 ObjDesc->Reference.Object); 218 break; 219 220 221 case AML_REF_OF_OP: 222 223 AcpiOsPrintf ("Reference: (RefOf) %p\n", 224 ObjDesc->Reference.Object); 225 break; 226 227 228 case AML_ARG_OP: 229 230 AcpiOsPrintf ("Reference: Arg%d", 231 ObjDesc->Reference.Offset); 232 233 if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER) 234 { 235 /* Value is an Integer */ 236 237 AcpiOsPrintf (" value is [%8.8X%8.8x]", 238 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); 239 } 240 241 AcpiOsPrintf ("\n"); 242 break; 243 244 245 case AML_LOCAL_OP: 246 247 AcpiOsPrintf ("Reference: Local%d", 248 ObjDesc->Reference.Offset); 249 250 if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER) 251 { 252 253 /* Value is an Integer */ 254 255 AcpiOsPrintf (" value is [%8.8X%8.8x]", 256 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); 257 } 258 259 AcpiOsPrintf ("\n"); 260 break; 261 262 263 case AML_INT_NAMEPATH_OP: 264 265 AcpiOsPrintf ("Reference.Node->Name %X\n", 266 ObjDesc->Reference.Node->Name.Integer); 267 break; 268 269 270 default: 271 272 /* Unknown opcode */ 273 274 AcpiOsPrintf ("Unknown Reference opcode=%X\n", 275 ObjDesc->Reference.Opcode); 276 break; 277 278 } 279 280 break; 281 282 283 case ACPI_TYPE_BUFFER: 284 285 AcpiOsPrintf ("Buffer len %X @ %p \n", 286 ObjDesc->Buffer.Length, 287 ObjDesc->Buffer.Pointer); 288 289 Length = ObjDesc->Buffer.Length; 290 291 if (Length > 64) 292 { 293 Length = 64; 294 } 295 296 /* Debug only -- dump the buffer contents */ 297 298 if (ObjDesc->Buffer.Pointer) 299 { 300 AcpiOsPrintf ("Buffer Contents: "); 301 302 for (Buf = ObjDesc->Buffer.Pointer; Length--; ++Buf) 303 { 304 AcpiOsPrintf (" %02x", *Buf); 305 } 306 AcpiOsPrintf ("\n"); 307 } 308 309 break; 310 311 312 case ACPI_TYPE_INTEGER: 313 314 AcpiOsPrintf ("Integer %8.8X%8.8X\n", 315 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); 316 break; 317 318 319 case ACPI_TYPE_PACKAGE: 320 321 AcpiOsPrintf ("Package count %X @ %p\n", 322 ObjDesc->Package.Count, ObjDesc->Package.Elements); 323 324 /* 325 * If elements exist, package vector pointer is valid, 326 * and debug_level exceeds 1, dump package's elements. 327 */ 328 if (ObjDesc->Package.Count && 329 ObjDesc->Package.Elements && 330 AcpiDbgLevel > 1) 331 { 332 for (ElementIndex = 0, Element = ObjDesc->Package.Elements; 333 ElementIndex < ObjDesc->Package.Count; 334 ++ElementIndex, ++Element) 335 { 336 AcpiExDumpOperand (*Element); 337 } 338 } 339 AcpiOsPrintf ("\n"); 340 break; 341 342 343 case ACPI_TYPE_REGION: 344 345 AcpiOsPrintf ("Region %s (%X)", 346 AcpiUtGetRegionName (ObjDesc->Region.SpaceId), 347 ObjDesc->Region.SpaceId); 348 349 /* 350 * If the address and length have not been evaluated, 351 * don't print them. 352 */ 353 if (!(ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)) 354 { 355 AcpiOsPrintf ("\n"); 356 } 357 else 358 { 359 AcpiOsPrintf (" base %8.8X%8.8X Length %X\n", 360 ACPI_FORMAT_UINT64 (ObjDesc->Region.Address), 361 ObjDesc->Region.Length); 362 } 363 break; 364 365 366 case ACPI_TYPE_STRING: 367 368 AcpiOsPrintf ("String length %X @ %p ", 369 ObjDesc->String.Length, ObjDesc->String.Pointer); 370 AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX); 371 AcpiOsPrintf ("\n"); 372 break; 373 374 375 case ACPI_TYPE_LOCAL_BANK_FIELD: 376 377 AcpiOsPrintf ("BankField\n"); 378 break; 379 380 381 case ACPI_TYPE_LOCAL_REGION_FIELD: 382 383 AcpiOsPrintf ( 384 "RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n", 385 ObjDesc->Field.BitLength, ObjDesc->Field.AccessByteWidth, 386 ObjDesc->Field.FieldFlags & AML_FIELD_LOCK_RULE_MASK, 387 ObjDesc->Field.FieldFlags & AML_FIELD_UPDATE_RULE_MASK, 388 ObjDesc->Field.BaseByteOffset, ObjDesc->Field.StartFieldBitOffset); 389 ACPI_DUMP_STACK_ENTRY (ObjDesc->Field.RegionObj); 390 break; 391 392 393 case ACPI_TYPE_LOCAL_INDEX_FIELD: 394 395 AcpiOsPrintf ("IndexField\n"); 396 break; 397 398 399 case ACPI_TYPE_BUFFER_FIELD: 400 401 AcpiOsPrintf ( 402 "BufferField: %X bits at byte %X bit %X of \n", 403 ObjDesc->BufferField.BitLength, ObjDesc->BufferField.BaseByteOffset, 404 ObjDesc->BufferField.StartFieldBitOffset); 405 406 if (!ObjDesc->BufferField.BufferObj) 407 { 408 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n")); 409 } 410 else if (ACPI_GET_OBJECT_TYPE (ObjDesc->BufferField.BufferObj) != ACPI_TYPE_BUFFER) 411 { 412 AcpiOsPrintf ("*not a Buffer* \n"); 413 } 414 else 415 { 416 ACPI_DUMP_STACK_ENTRY (ObjDesc->BufferField.BufferObj); 417 } 418 419 break; 420 421 422 case ACPI_TYPE_EVENT: 423 424 AcpiOsPrintf ("Event\n"); 425 break; 426 427 428 case ACPI_TYPE_METHOD: 429 430 AcpiOsPrintf ( 431 "Method(%X) @ %p:%X\n", 432 ObjDesc->Method.ParamCount, 433 ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength); 434 break; 435 436 437 case ACPI_TYPE_MUTEX: 438 439 AcpiOsPrintf ("Mutex\n"); 440 break; 441 442 443 case ACPI_TYPE_DEVICE: 444 445 AcpiOsPrintf ("Device\n"); 446 break; 447 448 449 case ACPI_TYPE_POWER: 450 451 AcpiOsPrintf ("Power\n"); 452 break; 453 454 455 case ACPI_TYPE_PROCESSOR: 456 457 AcpiOsPrintf ("Processor\n"); 458 break; 459 460 461 case ACPI_TYPE_THERMAL: 462 463 AcpiOsPrintf ("Thermal\n"); 464 break; 465 466 467 default: 468 /* Unknown Type */ 469 470 AcpiOsPrintf ("Unknown Type %X\n", ACPI_GET_OBJECT_TYPE (ObjDesc)); 471 break; 472 } 473 474 return; 475} 476 477 478/***************************************************************************** 479 * 480 * FUNCTION: AcpiExDumpOperands 481 * 482 * PARAMETERS: InterpreterMode - Load or Exec 483 * *Ident - Identification 484 * NumLevels - # of stack entries to dump above line 485 * *Note - Output notation 486 * 487 * DESCRIPTION: Dump the object stack 488 * 489 ****************************************************************************/ 490 491void 492AcpiExDumpOperands ( 493 ACPI_OPERAND_OBJECT **Operands, 494 ACPI_INTERPRETER_MODE InterpreterMode, 495 char *Ident, 496 UINT32 NumLevels, 497 char *Note, 498 char *ModuleName, 499 UINT32 LineNumber) 500{ 501 ACPI_NATIVE_UINT i; 502 ACPI_OPERAND_OBJECT **ObjDesc; 503 504 505 ACPI_FUNCTION_NAME ("ExDumpOperands"); 506 507 508 if (!Ident) 509 { 510 Ident = "?"; 511 } 512 513 if (!Note) 514 { 515 Note = "?"; 516 } 517 518 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 519 "************* Operand Stack Contents (Opcode [%s], %d Operands)\n", 520 Ident, NumLevels)); 521 522 if (NumLevels == 0) 523 { 524 NumLevels = 1; 525 } 526 527 /* Dump the operand stack starting at the top */ 528 529 for (i = 0; NumLevels > 0; i--, NumLevels--) 530 { 531 ObjDesc = &Operands[i]; 532 AcpiExDumpOperand (*ObjDesc); 533 } 534 535 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 536 "************* Stack dump from %s(%d), %s\n", 537 ModuleName, LineNumber, Note)); 538 return; 539} 540 541 542/***************************************************************************** 543 * 544 * FUNCTION: AcpiExOut* 545 * 546 * PARAMETERS: Title - Descriptive text 547 * Value - Value to be displayed 548 * 549 * DESCRIPTION: Object dump output formatting functions. These functions 550 * reduce the number of format strings required and keeps them 551 * all in one place for easy modification. 552 * 553 ****************************************************************************/ 554 555void 556AcpiExOutString ( 557 char *Title, 558 char *Value) 559{ 560 AcpiOsPrintf ("%20s : %s\n", Title, Value); 561} 562 563void 564AcpiExOutPointer ( 565 char *Title, 566 void *Value) 567{ 568 AcpiOsPrintf ("%20s : %p\n", Title, Value); 569} 570 571void 572AcpiExOutInteger ( 573 char *Title, 574 UINT32 Value) 575{ 576 AcpiOsPrintf ("%20s : %X\n", Title, Value); 577} 578 579void 580AcpiExOutAddress ( 581 char *Title, 582 ACPI_PHYSICAL_ADDRESS Value) 583{ 584 585#if ACPI_MACHINE_WIDTH == 16 586 AcpiOsPrintf ("%20s : %p\n", Title, Value); 587#else 588 AcpiOsPrintf ("%20s : %8.8X%8.8X\n", Title, 589 ACPI_FORMAT_UINT64 (Value)); 590#endif 591} 592 593 594/***************************************************************************** 595 * 596 * FUNCTION: AcpiExDumpNode 597 * 598 * PARAMETERS: *Node - Descriptor to dump 599 * Flags - Force display 600 * 601 * DESCRIPTION: Dumps the members of the given.Node 602 * 603 ****************************************************************************/ 604 605void 606AcpiExDumpNode ( 607 ACPI_NAMESPACE_NODE *Node, 608 UINT32 Flags) 609{ 610 611 ACPI_FUNCTION_ENTRY (); 612 613 614 if (!Flags) 615 { 616 if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) 617 { 618 return; 619 } 620 } 621 622 AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node)); 623 AcpiExOutString ("Type", AcpiUtGetTypeName (Node->Type)); 624 AcpiExOutInteger ("Flags", Node->Flags); 625 AcpiExOutInteger ("Owner Id", Node->OwnerId); 626 AcpiExOutInteger ("Reference Count", Node->ReferenceCount); 627 AcpiExOutPointer ("Attached Object", AcpiNsGetAttachedObject (Node)); 628 AcpiExOutPointer ("ChildList", Node->Child); 629 AcpiExOutPointer ("NextPeer", Node->Peer); 630 AcpiExOutPointer ("Parent", AcpiNsGetParentNode (Node)); 631} 632 633 634/***************************************************************************** 635 * 636 * FUNCTION: AcpiExDumpObjectDescriptor 637 * 638 * PARAMETERS: *Object - Descriptor to dump 639 * Flags - Force display 640 * 641 * DESCRIPTION: Dumps the members of the object descriptor given. 642 * 643 ****************************************************************************/ 644 645void 646AcpiExDumpObjectDescriptor ( 647 ACPI_OPERAND_OBJECT *ObjDesc, 648 UINT32 Flags) 649{ 650 UINT32 i; 651 652 653 ACPI_FUNCTION_TRACE ("ExDumpObjectDescriptor"); 654 655 656 if (!Flags) 657 { 658 if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) 659 { 660 return_VOID; 661 } 662 } 663 664 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED) 665 { 666 AcpiExDumpNode ((ACPI_NAMESPACE_NODE *) ObjDesc, Flags); 667 AcpiOsPrintf ("\nAttached Object (%p):\n", ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object); 668 AcpiExDumpObjectDescriptor (((ACPI_NAMESPACE_NODE *) ObjDesc)->Object, Flags); 669 return; 670 } 671 672 if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) 673 { 674 AcpiOsPrintf ("ExDumpObjectDescriptor: %p is not an ACPI operand object: [%s]\n", 675 ObjDesc, AcpiUtGetDescriptorName (ObjDesc)); 676 return_VOID; 677 } 678 679 /* Common Fields */ 680 681 AcpiExOutString ("Type", AcpiUtGetObjectTypeName (ObjDesc)); 682 AcpiExOutInteger ("Reference Count", ObjDesc->Common.ReferenceCount); 683 AcpiExOutInteger ("Flags", ObjDesc->Common.Flags); 684 685 /* Object-specific Fields */ 686 687 switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) 688 { 689 case ACPI_TYPE_INTEGER: 690 691 AcpiOsPrintf ("%20s : %8.8X%8.8X\n", "Value", 692 ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); 693 break; 694 695 696 case ACPI_TYPE_STRING: 697 698 AcpiExOutInteger ("Length", ObjDesc->String.Length); 699 700 AcpiOsPrintf ("%20s : %p ", "Pointer", ObjDesc->String.Pointer); 701 AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX); 702 AcpiOsPrintf ("\n"); 703 break; 704 705 706 case ACPI_TYPE_BUFFER: 707 708 AcpiExOutInteger ("Length", ObjDesc->Buffer.Length); 709 AcpiExOutPointer ("Pointer", ObjDesc->Buffer.Pointer); 710 ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length); 711 break; 712 713 714 case ACPI_TYPE_PACKAGE: 715 716 AcpiExOutInteger ("Flags", ObjDesc->Package.Flags); 717 AcpiExOutInteger ("Count", ObjDesc->Package.Count); 718 AcpiExOutPointer ("Elements", ObjDesc->Package.Elements); 719 720 /* Dump the package contents */ 721 722 if (ObjDesc->Package.Count > 0) 723 { 724 AcpiOsPrintf ("\nPackage Contents:\n"); 725 for (i = 0; i < ObjDesc->Package.Count; i++) 726 { 727 AcpiOsPrintf ("[%.3d] %p", i, ObjDesc->Package.Elements[i]); 728 if (ObjDesc->Package.Elements[i]) 729 { 730 AcpiOsPrintf (" %s", AcpiUtGetObjectTypeName (ObjDesc->Package.Elements[i])); 731 } 732 AcpiOsPrintf ("\n"); 733 } 734 } 735 break; 736 737 738 case ACPI_TYPE_DEVICE: 739 740 AcpiExOutPointer ("Handler", ObjDesc->Device.Handler); 741 AcpiExOutPointer ("SystemNotify", ObjDesc->Device.SystemNotify); 742 AcpiExOutPointer ("DeviceNotify", ObjDesc->Device.DeviceNotify); 743 break; 744 745 746 case ACPI_TYPE_EVENT: 747 748 AcpiExOutPointer ("Semaphore", ObjDesc->Event.Semaphore); 749 break; 750 751 752 case ACPI_TYPE_METHOD: 753 754 AcpiExOutInteger ("ParamCount", ObjDesc->Method.ParamCount); 755 AcpiExOutInteger ("Concurrency", ObjDesc->Method.Concurrency); 756 AcpiExOutPointer ("Semaphore", ObjDesc->Method.Semaphore); 757 AcpiExOutInteger ("OwningId", ObjDesc->Method.OwningId); 758 AcpiExOutInteger ("AmlLength", ObjDesc->Method.AmlLength); 759 AcpiExOutPointer ("AmlStart", ObjDesc->Method.AmlStart); 760 break; 761 762 763 case ACPI_TYPE_MUTEX: 764 765 AcpiExOutInteger ("SyncLevel", ObjDesc->Mutex.SyncLevel); 766 AcpiExOutPointer ("OwnerThread", ObjDesc->Mutex.OwnerThread); 767 AcpiExOutInteger ("AcquisitionDepth",ObjDesc->Mutex.AcquisitionDepth); 768 AcpiExOutPointer ("Semaphore", ObjDesc->Mutex.Semaphore); 769 break; 770 771 772 case ACPI_TYPE_REGION: 773 774 AcpiExOutInteger ("SpaceId", ObjDesc->Region.SpaceId); 775 AcpiExOutInteger ("Flags", ObjDesc->Region.Flags); 776 AcpiExOutAddress ("Address", ObjDesc->Region.Address); 777 AcpiExOutInteger ("Length", ObjDesc->Region.Length); 778 AcpiExOutPointer ("Handler", ObjDesc->Region.Handler); 779 AcpiExOutPointer ("Next", ObjDesc->Region.Next); 780 break; 781 782 783 case ACPI_TYPE_POWER: 784 785 AcpiExOutInteger ("SystemLevel", ObjDesc->PowerResource.SystemLevel); 786 AcpiExOutInteger ("ResourceOrder", ObjDesc->PowerResource.ResourceOrder); 787 AcpiExOutPointer ("SystemNotify", ObjDesc->PowerResource.SystemNotify); 788 AcpiExOutPointer ("DeviceNotify", ObjDesc->PowerResource.DeviceNotify); 789 break; 790 791 792 case ACPI_TYPE_PROCESSOR: 793 794 AcpiExOutInteger ("Processor ID", ObjDesc->Processor.ProcId); 795 AcpiExOutInteger ("Length", ObjDesc->Processor.Length); 796 AcpiExOutAddress ("Address", (ACPI_PHYSICAL_ADDRESS) ObjDesc->Processor.Address); 797 AcpiExOutPointer ("SystemNotify", ObjDesc->Processor.SystemNotify); 798 AcpiExOutPointer ("DeviceNotify", ObjDesc->Processor.DeviceNotify); 799 AcpiExOutPointer ("Handler", ObjDesc->Processor.Handler); 800 break; 801 802 803 case ACPI_TYPE_THERMAL: 804 805 AcpiExOutPointer ("SystemNotify", ObjDesc->ThermalZone.SystemNotify); 806 AcpiExOutPointer ("DeviceNotify", ObjDesc->ThermalZone.DeviceNotify); 807 AcpiExOutPointer ("Handler", ObjDesc->ThermalZone.Handler); 808 break; 809 810 811 case ACPI_TYPE_BUFFER_FIELD: 812 case ACPI_TYPE_LOCAL_REGION_FIELD: 813 case ACPI_TYPE_LOCAL_BANK_FIELD: 814 case ACPI_TYPE_LOCAL_INDEX_FIELD: 815 816 AcpiExOutInteger ("FieldFlags", ObjDesc->CommonField.FieldFlags); 817 AcpiExOutInteger ("AccessByteWidth", ObjDesc->CommonField.AccessByteWidth); 818 AcpiExOutInteger ("BitLength", ObjDesc->CommonField.BitLength); 819 AcpiExOutInteger ("FldBitOffset", ObjDesc->CommonField.StartFieldBitOffset); 820 AcpiExOutInteger ("BaseByteOffset", ObjDesc->CommonField.BaseByteOffset); 821 AcpiExOutInteger ("DatumValidBits", ObjDesc->CommonField.DatumValidBits); 822 AcpiExOutInteger ("EndFldValidBits", ObjDesc->CommonField.EndFieldValidBits); 823 AcpiExOutInteger ("EndBufValidBits", ObjDesc->CommonField.EndBufferValidBits); 824 AcpiExOutPointer ("ParentNode", ObjDesc->CommonField.Node); 825 826 switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) 827 { 828 case ACPI_TYPE_BUFFER_FIELD: 829 AcpiExOutPointer ("BufferObj", ObjDesc->BufferField.BufferObj); 830 break; 831 832 case ACPI_TYPE_LOCAL_REGION_FIELD: 833 AcpiExOutPointer ("RegionObj", ObjDesc->Field.RegionObj); 834 break; 835 836 case ACPI_TYPE_LOCAL_BANK_FIELD: 837 AcpiExOutInteger ("Value", ObjDesc->BankField.Value); 838 AcpiExOutPointer ("RegionObj", ObjDesc->BankField.RegionObj); 839 AcpiExOutPointer ("BankObj", ObjDesc->BankField.BankObj); 840 break; 841 842 case ACPI_TYPE_LOCAL_INDEX_FIELD: 843 AcpiExOutInteger ("Value", ObjDesc->IndexField.Value); 844 AcpiExOutPointer ("Index", ObjDesc->IndexField.IndexObj); 845 AcpiExOutPointer ("Data", ObjDesc->IndexField.DataObj); 846 break; 847 848 default: 849 /* All object types covered above */ 850 break; 851 } 852 break; 853 854 855 case ACPI_TYPE_LOCAL_REFERENCE: 856 857 AcpiExOutInteger ("TargetType", ObjDesc->Reference.TargetType); 858 AcpiExOutString ("Opcode", (AcpiPsGetOpcodeInfo (ObjDesc->Reference.Opcode))->Name); 859 AcpiExOutInteger ("Offset", ObjDesc->Reference.Offset); 860 AcpiExOutPointer ("ObjDesc", ObjDesc->Reference.Object); 861 AcpiExOutPointer ("Node", ObjDesc->Reference.Node); 862 AcpiExOutPointer ("Where", ObjDesc->Reference.Where); 863 break; 864 865 866 case ACPI_TYPE_LOCAL_ADDRESS_HANDLER: 867 868 AcpiExOutInteger ("SpaceId", ObjDesc->AddressSpace.SpaceId); 869 AcpiExOutPointer ("Next", ObjDesc->AddressSpace.Next); 870 AcpiExOutPointer ("RegionList", ObjDesc->AddressSpace.RegionList); 871 AcpiExOutPointer ("Node", ObjDesc->AddressSpace.Node); 872 AcpiExOutPointer ("Context", ObjDesc->AddressSpace.Context); 873 break; 874 875 876 case ACPI_TYPE_LOCAL_NOTIFY: 877 878 AcpiExOutPointer ("Node", ObjDesc->Notify.Node); 879 AcpiExOutPointer ("Context", ObjDesc->Notify.Context); 880 break; 881 882 883 case ACPI_TYPE_LOCAL_ALIAS: 884 case ACPI_TYPE_LOCAL_EXTRA: 885 case ACPI_TYPE_LOCAL_DATA: 886 default: 887 888 AcpiOsPrintf ("ExDumpObjectDescriptor: Display not implemented for object type %s\n", 889 AcpiUtGetObjectTypeName (ObjDesc)); 890 break; 891 } 892 893 return_VOID; 894} 895 896#endif 897
|