1 /******************************************************************************* 2 * 3 * Module Name: dmopcode - AML disassembler, specific AML opcodes 4 * 5 ******************************************************************************/ 6 7 /* 8 * Copyright (C) 2000 - 2015, Intel Corp. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions, and the following disclaimer, 16 * without modification. 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18 * substantially similar to the "NO WARRANTY" disclaimer below 19 * ("Disclaimer") and any redistribution must be conditioned upon 20 * including a substantially similar Disclaimer requirement for further 21 * binary redistribution. 22 * 3. Neither the names of the above-listed copyright holders nor the names 23 * of any contributors may be used to endorse or promote products derived 24 * from this software without specific prior written permission. 25 * 26 * Alternatively, this software may be distributed under the terms of the 27 * GNU General Public License ("GPL") version 2 as published by the Free 28 * Software Foundation. 29 * 30 * NO WARRANTY 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41 * POSSIBILITY OF SUCH DAMAGES. 42 */ 43 44 #include <contrib/dev/acpica/include/acpi.h> 45 #include <contrib/dev/acpica/include/accommon.h> 46 #include <contrib/dev/acpica/include/acparser.h> 47 #include <contrib/dev/acpica/include/amlcode.h> 48 #include <contrib/dev/acpica/include/acdisasm.h> 49 #include <contrib/dev/acpica/include/acinterp.h> 50 #include <contrib/dev/acpica/include/acnamesp.h> 51 #include <contrib/dev/acpica/include/acdebug.h> 52 53 #ifdef ACPI_DISASSEMBLER 54 55 #define _COMPONENT ACPI_CA_DEBUGGER 56 ACPI_MODULE_NAME ("dmopcode") 57 58 59 /* Local prototypes */ 60 61 static void 62 AcpiDmMatchKeyword ( 63 ACPI_PARSE_OBJECT *Op); 64 65 66 /******************************************************************************* 67 * 68 * FUNCTION: AcpiDmDisplayTargetPathname 69 * 70 * PARAMETERS: Op - Parse object 71 * 72 * RETURN: None 73 * 74 * DESCRIPTION: For AML opcodes that have a target operand, display the full 75 * pathname for the target, in a comment field. Handles Return() 76 * statements also. 77 * 78 ******************************************************************************/ 79 80 void 81 AcpiDmDisplayTargetPathname ( 82 ACPI_PARSE_OBJECT *Op) 83 { 84 ACPI_PARSE_OBJECT *NextOp; 85 ACPI_PARSE_OBJECT *PrevOp = NULL; 86 char *Pathname; 87 const ACPI_OPCODE_INFO *OpInfo; 88 89 90 if (Op->Common.AmlOpcode == AML_RETURN_OP) 91 { 92 PrevOp = Op->Asl.Value.Arg; 93 } 94 else 95 { 96 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); 97 if (!(OpInfo->Flags & AML_HAS_TARGET)) 98 { 99 return; 100 } 101 102 /* Target is the last Op in the arg list */ 103 104 NextOp = Op->Asl.Value.Arg; 105 while (NextOp) 106 { 107 PrevOp = NextOp; 108 NextOp = PrevOp->Asl.Next; 109 } 110 } 111 112 if (!PrevOp) 113 { 114 return; 115 } 116 117 /* We must have a namepath AML opcode */ 118 119 if (PrevOp->Asl.AmlOpcode != AML_INT_NAMEPATH_OP) 120 { 121 return; 122 } 123 124 /* A null string is the "no target specified" case */ 125 126 if (!PrevOp->Asl.Value.String) 127 { 128 return; 129 } 130 131 /* No node means "unresolved external reference" */ 132 133 if (!PrevOp->Asl.Node) 134 { 135 AcpiOsPrintf (" /* External reference */"); 136 return; 137 } 138 139 /* Ignore if path is already from the root */ 140 141 if (*PrevOp->Asl.Value.String == '\\') 142 { 143 return; 144 } 145 146 /* Now: we can get the full pathname */ 147 148 Pathname = AcpiNsGetExternalPathname (PrevOp->Asl.Node); 149 if (!Pathname) 150 { 151 return; 152 } 153 154 AcpiOsPrintf (" /* %s */", Pathname); 155 ACPI_FREE (Pathname); 156 } 157 158 159 /******************************************************************************* 160 * 161 * FUNCTION: AcpiDmNotifyDescription 162 * 163 * PARAMETERS: Op - Name() parse object 164 * 165 * RETURN: None 166 * 167 * DESCRIPTION: Emit a description comment for the value associated with a 168 * Notify() operator. 169 * 170 ******************************************************************************/ 171 172 void 173 AcpiDmNotifyDescription ( 174 ACPI_PARSE_OBJECT *Op) 175 { 176 ACPI_PARSE_OBJECT *NextOp; 177 ACPI_NAMESPACE_NODE *Node; 178 UINT8 NotifyValue; 179 UINT8 Type = ACPI_TYPE_ANY; 180 181 182 /* The notify value is the second argument */ 183 184 NextOp = Op->Asl.Value.Arg; 185 NextOp = NextOp->Asl.Next; 186 187 switch (NextOp->Common.AmlOpcode) 188 { 189 case AML_ZERO_OP: 190 case AML_ONE_OP: 191 192 NotifyValue = (UINT8) NextOp->Common.AmlOpcode; 193 break; 194 195 case AML_BYTE_OP: 196 197 NotifyValue = (UINT8) NextOp->Asl.Value.Integer; 198 break; 199 200 default: 201 return; 202 } 203 204 /* 205 * Attempt to get the namespace node so we can determine the object type. 206 * Some notify values are dependent on the object type (Device, Thermal, 207 * or Processor). 208 */ 209 Node = Op->Asl.Node; 210 if (Node) 211 { 212 Type = Node->Type; 213 } 214 215 AcpiOsPrintf (" // %s", AcpiUtGetNotifyName (NotifyValue, Type)); 216 } 217 218 219 /******************************************************************************* 220 * 221 * FUNCTION: AcpiDmPredefinedDescription 222 * 223 * PARAMETERS: Op - Name() parse object 224 * 225 * RETURN: None 226 * 227 * DESCRIPTION: Emit a description comment for a predefined ACPI name. 228 * Used for iASL compiler only. 229 * 230 ******************************************************************************/ 231 232 void 233 AcpiDmPredefinedDescription ( 234 ACPI_PARSE_OBJECT *Op) 235 { 236 #ifdef ACPI_ASL_COMPILER 237 const AH_PREDEFINED_NAME *Info; 238 char *NameString; 239 int LastCharIsDigit; 240 int LastCharsAreHex; 241 242 243 if (!Op) 244 { 245 return; 246 } 247 248 /* Ensure that the comment field is emitted only once */ 249 250 if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEF_CHECKED) 251 { 252 return; 253 } 254 Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEF_CHECKED; 255 256 /* Predefined name must start with an underscore */ 257 258 NameString = ACPI_CAST_PTR (char, &Op->Named.Name); 259 if (NameString[0] != '_') 260 { 261 return; 262 } 263 264 /* 265 * Check for the special ACPI names: 266 * _ACd, _ALd, _EJd, _Exx, _Lxx, _Qxx, _Wxx, _T_a 267 * (where d=decimal_digit, x=hex_digit, a=anything) 268 * 269 * Convert these to the generic name for table lookup. 270 * Note: NameString is guaranteed to be upper case here. 271 */ 272 LastCharIsDigit = 273 (isdigit ((int) NameString[3])); /* d */ 274 LastCharsAreHex = 275 (isxdigit ((int) NameString[2]) && /* xx */ 276 isxdigit ((int) NameString[3])); 277 278 switch (NameString[1]) 279 { 280 case 'A': 281 282 if ((NameString[2] == 'C') && (LastCharIsDigit)) 283 { 284 NameString = "_ACx"; 285 } 286 else if ((NameString[2] == 'L') && (LastCharIsDigit)) 287 { 288 NameString = "_ALx"; 289 } 290 break; 291 292 case 'E': 293 294 if ((NameString[2] == 'J') && (LastCharIsDigit)) 295 { 296 NameString = "_EJx"; 297 } 298 else if (LastCharsAreHex) 299 { 300 NameString = "_Exx"; 301 } 302 break; 303 304 case 'L': 305 306 if (LastCharsAreHex) 307 { 308 NameString = "_Lxx"; 309 } 310 break; 311 312 case 'Q': 313 314 if (LastCharsAreHex) 315 { 316 NameString = "_Qxx"; 317 } 318 break; 319 320 case 'T': 321 322 if (NameString[2] == '_') 323 { 324 NameString = "_T_x"; 325 } 326 break; 327 328 case 'W': 329 330 if (LastCharsAreHex) 331 { 332 NameString = "_Wxx"; 333 } 334 break; 335 336 default: 337 338 break; 339 } 340 341 /* Match the name in the info table */ 342 343 Info = AcpiAhMatchPredefinedName (NameString); 344 if (Info) 345 { 346 AcpiOsPrintf (" // %4.4s: %s", 347 NameString, ACPI_CAST_PTR (char, Info->Description)); 348 } 349 350 #endif 351 return; 352 } 353 354 355 /******************************************************************************* 356 * 357 * FUNCTION: AcpiDmFieldPredefinedDescription 358 * 359 * PARAMETERS: Op - Parse object 360 * 361 * RETURN: None 362 * 363 * DESCRIPTION: Emit a description comment for a resource descriptor tag 364 * (which is a predefined ACPI name.) Used for iASL compiler only. 365 * 366 ******************************************************************************/ 367 368 void 369 AcpiDmFieldPredefinedDescription ( 370 ACPI_PARSE_OBJECT *Op) 371 { 372 #ifdef ACPI_ASL_COMPILER 373 ACPI_PARSE_OBJECT *IndexOp; 374 char *Tag; 375 const ACPI_OPCODE_INFO *OpInfo; 376 const AH_PREDEFINED_NAME *Info; 377 378 379 if (!Op) 380 { 381 return; 382 } 383 384 /* Ensure that the comment field is emitted only once */ 385 386 if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEF_CHECKED) 387 { 388 return; 389 } 390 Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEF_CHECKED; 391 392 /* 393 * Op must be one of the Create* operators: CreateField, CreateBitField, 394 * CreateByteField, CreateWordField, CreateDwordField, CreateQwordField 395 */ 396 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); 397 if (!(OpInfo->Flags & AML_CREATE)) 398 { 399 return; 400 } 401 402 /* Second argument is the Index argument */ 403 404 IndexOp = Op->Common.Value.Arg; 405 IndexOp = IndexOp->Common.Next; 406 407 /* Index argument must be a namepath */ 408 409 if (IndexOp->Common.AmlOpcode != AML_INT_NAMEPATH_OP) 410 { 411 return; 412 } 413 414 /* Major cheat: We previously put the Tag ptr in the Node field */ 415 416 Tag = ACPI_CAST_PTR (char, IndexOp->Common.Node); 417 if (!Tag) 418 { 419 return; 420 } 421 422 /* Match the name in the info table */ 423 424 Info = AcpiAhMatchPredefinedName (Tag); 425 if (Info) 426 { 427 AcpiOsPrintf (" // %4.4s: %s", Tag, 428 ACPI_CAST_PTR (char, Info->Description)); 429 } 430 431 #endif 432 return; 433 } 434 435 436 /******************************************************************************* 437 * 438 * FUNCTION: AcpiDmMethodFlags 439 * 440 * PARAMETERS: Op - Method Object to be examined 441 * 442 * RETURN: None 443 * 444 * DESCRIPTION: Decode control method flags 445 * 446 ******************************************************************************/ 447 448 void 449 AcpiDmMethodFlags ( 450 ACPI_PARSE_OBJECT *Op) 451 { 452 UINT32 Flags; 453 UINT32 Args; 454 455 456 /* The next Op contains the flags */ 457 458 Op = AcpiPsGetDepthNext (NULL, Op); 459 Flags = (UINT8) Op->Common.Value.Integer; 460 Args = Flags & 0x07; 461 462 /* Mark the Op as completed */ 463 464 Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; 465 466 /* 1) Method argument count */ 467 468 AcpiOsPrintf (", %u, ", Args); 469 470 /* 2) Serialize rule */ 471 472 if (!(Flags & 0x08)) 473 { 474 AcpiOsPrintf ("Not"); 475 } 476 477 AcpiOsPrintf ("Serialized"); 478 479 /* 3) SyncLevel */ 480 481 if (Flags & 0xF0) 482 { 483 AcpiOsPrintf (", %u", Flags >> 4); 484 } 485 } 486 487 488 /******************************************************************************* 489 * 490 * FUNCTION: AcpiDmFieldFlags 491 * 492 * PARAMETERS: Op - Field Object to be examined 493 * 494 * RETURN: None 495 * 496 * DESCRIPTION: Decode Field definition flags 497 * 498 ******************************************************************************/ 499 500 void 501 AcpiDmFieldFlags ( 502 ACPI_PARSE_OBJECT *Op) 503 { 504 UINT32 Flags; 505 506 507 Op = Op->Common.Next; 508 Flags = (UINT8) Op->Common.Value.Integer; 509 510 /* Mark the Op as completed */ 511 512 Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; 513 514 AcpiOsPrintf ("%s, ", AcpiGbl_AccessTypes [Flags & 0x07]); 515 AcpiOsPrintf ("%s, ", AcpiGbl_LockRule [(Flags & 0x10) >> 4]); 516 AcpiOsPrintf ("%s)", AcpiGbl_UpdateRules [(Flags & 0x60) >> 5]); 517 } 518 519 520 /******************************************************************************* 521 * 522 * FUNCTION: AcpiDmAddressSpace 523 * 524 * PARAMETERS: SpaceId - ID to be translated 525 * 526 * RETURN: None 527 * 528 * DESCRIPTION: Decode a SpaceId to an AddressSpaceKeyword 529 * 530 ******************************************************************************/ 531 532 void 533 AcpiDmAddressSpace ( 534 UINT8 SpaceId) 535 { 536 537 if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) 538 { 539 if (SpaceId == 0x7F) 540 { 541 AcpiOsPrintf ("FFixedHW, "); 542 } 543 else 544 { 545 AcpiOsPrintf ("0x%.2X, ", SpaceId); 546 } 547 } 548 else 549 { 550 AcpiOsPrintf ("%s, ", AcpiGbl_RegionTypes [SpaceId]); 551 } 552 } 553 554 555 /******************************************************************************* 556 * 557 * FUNCTION: AcpiDmRegionFlags 558 * 559 * PARAMETERS: Op - Object to be examined 560 * 561 * RETURN: None 562 * 563 * DESCRIPTION: Decode OperationRegion flags 564 * 565 ******************************************************************************/ 566 567 void 568 AcpiDmRegionFlags ( 569 ACPI_PARSE_OBJECT *Op) 570 { 571 572 /* The next Op contains the SpaceId */ 573 574 Op = AcpiPsGetDepthNext (NULL, Op); 575 576 /* Mark the Op as completed */ 577 578 Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; 579 580 AcpiOsPrintf (", "); 581 AcpiDmAddressSpace ((UINT8) Op->Common.Value.Integer); 582 } 583 584 585 /******************************************************************************* 586 * 587 * FUNCTION: AcpiDmMatchOp 588 * 589 * PARAMETERS: Op - Match Object to be examined 590 * 591 * RETURN: None 592 * 593 * DESCRIPTION: Decode Match opcode operands 594 * 595 ******************************************************************************/ 596 597 void 598 AcpiDmMatchOp ( 599 ACPI_PARSE_OBJECT *Op) 600 { 601 ACPI_PARSE_OBJECT *NextOp; 602 603 604 NextOp = AcpiPsGetDepthNext (NULL, Op); 605 NextOp = NextOp->Common.Next; 606 607 if (!NextOp) 608 { 609 /* Handle partial tree during single-step */ 610 611 return; 612 } 613 614 /* Mark the two nodes that contain the encoding for the match keywords */ 615 616 NextOp->Common.DisasmOpcode = ACPI_DASM_MATCHOP; 617 618 NextOp = NextOp->Common.Next; 619 NextOp = NextOp->Common.Next; 620 NextOp->Common.DisasmOpcode = ACPI_DASM_MATCHOP; 621 } 622 623 624 /******************************************************************************* 625 * 626 * FUNCTION: AcpiDmMatchKeyword 627 * 628 * PARAMETERS: Op - Match Object to be examined 629 * 630 * RETURN: None 631 * 632 * DESCRIPTION: Decode Match opcode operands 633 * 634 ******************************************************************************/ 635 636 static void 637 AcpiDmMatchKeyword ( 638 ACPI_PARSE_OBJECT *Op) 639 { 640 641 if (((UINT32) Op->Common.Value.Integer) > ACPI_MAX_MATCH_OPCODE) 642 { 643 AcpiOsPrintf ("/* Unknown Match Keyword encoding */"); 644 } 645 else 646 { 647 AcpiOsPrintf ("%s", ACPI_CAST_PTR (char, 648 AcpiGbl_MatchOps[(ACPI_SIZE) Op->Common.Value.Integer])); 649 } 650 } 651 652 653 /******************************************************************************* 654 * 655 * FUNCTION: AcpiDmDisassembleOneOp 656 * 657 * PARAMETERS: WalkState - Current walk info 658 * Info - Parse tree walk info 659 * Op - Op that is to be printed 660 * 661 * RETURN: None 662 * 663 * DESCRIPTION: Disassemble a single AML opcode 664 * 665 ******************************************************************************/ 666 667 void 668 AcpiDmDisassembleOneOp ( 669 ACPI_WALK_STATE *WalkState, 670 ACPI_OP_WALK_INFO *Info, 671 ACPI_PARSE_OBJECT *Op) 672 { 673 const ACPI_OPCODE_INFO *OpInfo = NULL; 674 UINT32 Offset; 675 UINT32 Length; 676 ACPI_PARSE_OBJECT *Child; 677 ACPI_STATUS Status; 678 UINT8 *Aml; 679 const AH_DEVICE_ID *IdInfo; 680 681 682 if (!Op) 683 { 684 AcpiOsPrintf ("<NULL OP PTR>"); 685 return; 686 } 687 688 switch (Op->Common.DisasmOpcode) 689 { 690 case ACPI_DASM_MATCHOP: 691 692 AcpiDmMatchKeyword (Op); 693 return; 694 695 case ACPI_DASM_LNOT_SUFFIX: 696 697 if (!AcpiGbl_CstyleDisassembly) 698 { 699 switch (Op->Common.AmlOpcode) 700 { 701 case AML_LEQUAL_OP: 702 AcpiOsPrintf ("LNotEqual"); 703 break; 704 705 case AML_LGREATER_OP: 706 AcpiOsPrintf ("LLessEqual"); 707 break; 708 709 case AML_LLESS_OP: 710 AcpiOsPrintf ("LGreaterEqual"); 711 break; 712 713 default: 714 break; 715 } 716 } 717 718 Op->Common.DisasmOpcode = 0; 719 Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; 720 return; 721 722 default: 723 break; 724 } 725 726 OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); 727 728 /* The op and arguments */ 729 730 switch (Op->Common.AmlOpcode) 731 { 732 case AML_LNOT_OP: 733 734 Child = Op->Common.Value.Arg; 735 if ((Child->Common.AmlOpcode == AML_LEQUAL_OP) || 736 (Child->Common.AmlOpcode == AML_LGREATER_OP) || 737 (Child->Common.AmlOpcode == AML_LLESS_OP)) 738 { 739 Child->Common.DisasmOpcode = ACPI_DASM_LNOT_SUFFIX; 740 Op->Common.DisasmOpcode = ACPI_DASM_LNOT_PREFIX; 741 } 742 else 743 { 744 AcpiOsPrintf ("%s", OpInfo->Name); 745 } 746 break; 747 748 case AML_BYTE_OP: 749 750 AcpiOsPrintf ("0x%2.2X", (UINT32) Op->Common.Value.Integer); 751 break; 752 753 case AML_WORD_OP: 754 755 if (Op->Common.DisasmOpcode == ACPI_DASM_EISAID) 756 { 757 AcpiDmDecompressEisaId ((UINT32) Op->Common.Value.Integer); 758 } 759 else 760 { 761 AcpiOsPrintf ("0x%4.4X", (UINT32) Op->Common.Value.Integer); 762 } 763 break; 764 765 case AML_DWORD_OP: 766 767 if (Op->Common.DisasmOpcode == ACPI_DASM_EISAID) 768 { 769 AcpiDmDecompressEisaId ((UINT32) Op->Common.Value.Integer); 770 } 771 else 772 { 773 AcpiOsPrintf ("0x%8.8X", (UINT32) Op->Common.Value.Integer); 774 } 775 break; 776 777 case AML_QWORD_OP: 778 779 AcpiOsPrintf ("0x%8.8X%8.8X", 780 ACPI_FORMAT_UINT64 (Op->Common.Value.Integer)); 781 break; 782 783 case AML_STRING_OP: 784 785 AcpiUtPrintString (Op->Common.Value.String, ACPI_UINT16_MAX); 786 787 /* For _HID/_CID strings, attempt to output a descriptive comment */ 788 789 if (Op->Common.DisasmOpcode == ACPI_DASM_HID_STRING) 790 { 791 /* If we know about the ID, emit the description */ 792 793 IdInfo = AcpiAhMatchHardwareId (Op->Common.Value.String); 794 if (IdInfo) 795 { 796 AcpiOsPrintf (" /* %s */", IdInfo->Description); 797 } 798 } 799 break; 800 801 case AML_BUFFER_OP: 802 /* 803 * Determine the type of buffer. We can have one of the following: 804 * 805 * 1) ResourceTemplate containing Resource Descriptors. 806 * 2) Unicode String buffer 807 * 3) ASCII String buffer 808 * 4) Raw data buffer (if none of the above) 809 * 810 * Since there are no special AML opcodes to differentiate these 811 * types of buffers, we have to closely look at the data in the 812 * buffer to determine the type. 813 */ 814 if (!AcpiGbl_NoResourceDisassembly) 815 { 816 Status = AcpiDmIsResourceTemplate (WalkState, Op); 817 if (ACPI_SUCCESS (Status)) 818 { 819 Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE; 820 AcpiOsPrintf ("ResourceTemplate"); 821 break; 822 } 823 else if (Status == AE_AML_NO_RESOURCE_END_TAG) 824 { 825 AcpiOsPrintf ("/**** Is ResourceTemplate, but EndTag not at buffer end ****/ "); 826 } 827 } 828 829 if (AcpiDmIsUuidBuffer (Op)) 830 { 831 Op->Common.DisasmOpcode = ACPI_DASM_UUID; 832 AcpiOsPrintf ("ToUUID ("); 833 } 834 else if (AcpiDmIsUnicodeBuffer (Op)) 835 { 836 Op->Common.DisasmOpcode = ACPI_DASM_UNICODE; 837 AcpiOsPrintf ("Unicode ("); 838 } 839 else if (AcpiDmIsStringBuffer (Op)) 840 { 841 Op->Common.DisasmOpcode = ACPI_DASM_STRING; 842 AcpiOsPrintf ("Buffer"); 843 } 844 else if (AcpiDmIsPldBuffer (Op)) 845 { 846 Op->Common.DisasmOpcode = ACPI_DASM_PLD_METHOD; 847 AcpiOsPrintf ("ToPLD ("); 848 } 849 else 850 { 851 Op->Common.DisasmOpcode = ACPI_DASM_BUFFER; 852 AcpiOsPrintf ("Buffer"); 853 } 854 break; 855 856 case AML_INT_NAMEPATH_OP: 857 858 AcpiDmNamestring (Op->Common.Value.Name); 859 break; 860 861 case AML_INT_NAMEDFIELD_OP: 862 863 Length = AcpiDmDumpName (Op->Named.Name); 864 AcpiOsPrintf (",%*.s %u", (unsigned) (5 - Length), " ", 865 (UINT32) Op->Common.Value.Integer); 866 AcpiDmCommaIfFieldMember (Op); 867 868 Info->BitOffset += (UINT32) Op->Common.Value.Integer; 869 break; 870 871 case AML_INT_RESERVEDFIELD_OP: 872 873 /* Offset() -- Must account for previous offsets */ 874 875 Offset = (UINT32) Op->Common.Value.Integer; 876 Info->BitOffset += Offset; 877 878 if (Info->BitOffset % 8 == 0) 879 { 880 AcpiOsPrintf ("Offset (0x%.2X)", ACPI_DIV_8 (Info->BitOffset)); 881 } 882 else 883 { 884 AcpiOsPrintf (" , %u", Offset); 885 } 886 887 AcpiDmCommaIfFieldMember (Op); 888 break; 889 890 case AML_INT_ACCESSFIELD_OP: 891 case AML_INT_EXTACCESSFIELD_OP: 892 893 AcpiOsPrintf ("AccessAs (%s, ", 894 AcpiGbl_AccessTypes [(UINT32) (Op->Common.Value.Integer & 0x7)]); 895 896 AcpiDmDecodeAttribute ((UINT8) (Op->Common.Value.Integer >> 8)); 897 898 if (Op->Common.AmlOpcode == AML_INT_EXTACCESSFIELD_OP) 899 { 900 AcpiOsPrintf (" (0x%2.2X)", (unsigned) ((Op->Common.Value.Integer >> 16) & 0xFF)); 901 } 902 903 AcpiOsPrintf (")"); 904 AcpiDmCommaIfFieldMember (Op); 905 break; 906 907 case AML_INT_CONNECTION_OP: 908 /* 909 * Two types of Connection() - one with a buffer object, the 910 * other with a namestring that points to a buffer object. 911 */ 912 AcpiOsPrintf ("Connection ("); 913 Child = Op->Common.Value.Arg; 914 915 if (Child->Common.AmlOpcode == AML_INT_BYTELIST_OP) 916 { 917 AcpiOsPrintf ("\n"); 918 919 Aml = Child->Named.Data; 920 Length = (UINT32) Child->Common.Value.Integer; 921 922 Info->Level += 1; 923 Info->MappingOp = Op; 924 Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE; 925 926 AcpiDmResourceTemplate (Info, Op->Common.Parent, Aml, Length); 927 928 Info->Level -= 1; 929 AcpiDmIndent (Info->Level); 930 } 931 else 932 { 933 AcpiDmNamestring (Child->Common.Value.Name); 934 } 935 936 AcpiOsPrintf (")"); 937 AcpiDmCommaIfFieldMember (Op); 938 AcpiOsPrintf ("\n"); 939 940 Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; /* for now, ignore in AcpiDmAscendingOp */ 941 Child->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; 942 break; 943 944 case AML_INT_BYTELIST_OP: 945 946 AcpiDmByteList (Info, Op); 947 break; 948 949 case AML_INT_METHODCALL_OP: 950 951 Op = AcpiPsGetDepthNext (NULL, Op); 952 Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; 953 954 AcpiDmNamestring (Op->Common.Value.Name); 955 break; 956 957 default: 958 959 /* Just get the opcode name and print it */ 960 961 AcpiOsPrintf ("%s", OpInfo->Name); 962 963 964 #ifdef ACPI_DEBUGGER 965 966 if ((Op->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP) && 967 (WalkState) && 968 (WalkState->Results) && 969 (WalkState->ResultCount)) 970 { 971 AcpiDbDecodeInternalObject ( 972 WalkState->Results->Results.ObjDesc [ 973 (WalkState->ResultCount - 1) % 974 ACPI_RESULTS_FRAME_OBJ_NUM]); 975 } 976 #endif 977 978 break; 979 } 980 } 981 982 #endif /* ACPI_DISASSEMBLER */ 983