Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/executer/exdump.c
          +++ new/usr/src/common/acpica/components/executer/exdump.c
   1    1  /******************************************************************************
   2    2   *
   3    3   * Module Name: exdump - Interpreter debug output routines
   4    4   *
   5    5   *****************************************************************************/
   6    6  
   7    7  /*
   8      - * Copyright (C) 2000 - 2011, Intel Corp.
        8 + * Copyright (C) 2000 - 2014, 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
↓ open down ↓ 105 lines elided ↑ open up ↑
 124  124      {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Package.Flags),                "Flags"},
 125  125      {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (Package.Count),                "Elements"},
 126  126      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Package.Elements),             "Element List"},
 127  127      {ACPI_EXD_PACKAGE,  0,                                              NULL}
 128  128  };
 129  129  
 130  130  static ACPI_EXDUMP_INFO     AcpiExDumpDevice[4] =
 131  131  {
 132  132      {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice),         NULL},
 133  133      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Device.Handler),               "Handler"},
 134      -    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Device.SystemNotify),          "System Notify"},
 135      -    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Device.DeviceNotify),          "Device Notify"}
      134 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Device.NotifyList[0]),         "System Notify"},
      135 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Device.NotifyList[1]),         "Device Notify"}
 136  136  };
 137  137  
 138  138  static ACPI_EXDUMP_INFO     AcpiExDumpEvent[2] =
 139  139  {
 140  140      {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpEvent),          NULL},
 141  141      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Event.OsSemaphore),            "OsSemaphore"}
 142  142  };
 143  143  
 144  144  static ACPI_EXDUMP_INFO     AcpiExDumpMethod[9] =
 145  145  {
↓ open down ↓ 26 lines elided ↑ open up ↑
 172  172      {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (Region.Length),                "Length"},
 173  173      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Region.Handler),               "Handler"},
 174  174      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Region.Next),                  "Next"}
 175  175  };
 176  176  
 177  177  static ACPI_EXDUMP_INFO     AcpiExDumpPower[5] =
 178  178  {
 179  179      {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpPower),          NULL},
 180  180      {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (PowerResource.SystemLevel),    "System Level"},
 181  181      {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (PowerResource.ResourceOrder),  "Resource Order"},
 182      -    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (PowerResource.SystemNotify),   "System Notify"},
 183      -    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (PowerResource.DeviceNotify),   "Device Notify"}
      182 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (PowerResource.NotifyList[0]),  "System Notify"},
      183 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (PowerResource.NotifyList[1]),  "Device Notify"}
 184  184  };
 185  185  
 186  186  static ACPI_EXDUMP_INFO     AcpiExDumpProcessor[7] =
 187  187  {
 188  188      {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpProcessor),      NULL},
 189  189      {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Processor.ProcId),             "Processor ID"},
 190  190      {ACPI_EXD_UINT8 ,   ACPI_EXD_OFFSET (Processor.Length),             "Length"},
 191  191      {ACPI_EXD_ADDRESS,  ACPI_EXD_OFFSET (Processor.Address),            "Address"},
 192      -    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Processor.SystemNotify),       "System Notify"},
 193      -    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Processor.DeviceNotify),       "Device Notify"},
      192 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Processor.NotifyList[0]),      "System Notify"},
      193 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Processor.NotifyList[1]),      "Device Notify"},
 194  194      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Processor.Handler),            "Handler"}
 195  195  };
 196  196  
 197  197  static ACPI_EXDUMP_INFO     AcpiExDumpThermal[4] =
 198  198  {
 199  199      {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpThermal),        NULL},
 200      -    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (ThermalZone.SystemNotify),     "System Notify"},
 201      -    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (ThermalZone.DeviceNotify),     "Device Notify"},
      200 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (ThermalZone.NotifyList[0]),    "System Notify"},
      201 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (ThermalZone.NotifyList[1]),    "Device Notify"},
 202  202      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (ThermalZone.Handler),          "Handler"}
 203  203  };
 204  204  
 205  205  static ACPI_EXDUMP_INFO     AcpiExDumpBufferField[3] =
 206  206  {
 207  207      {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpBufferField),    NULL},
 208  208      {ACPI_EXD_FIELD,    0,                                              NULL},
 209  209      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (BufferField.BufferObj),        "Buffer Object"}
 210  210  };
 211  211  
 212      -static ACPI_EXDUMP_INFO     AcpiExDumpRegionField[3] =
      212 +static ACPI_EXDUMP_INFO     AcpiExDumpRegionField[5] =
 213  213  {
 214  214      {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField),    NULL},
 215  215      {ACPI_EXD_FIELD,    0,                                              NULL},
 216      -    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Field.RegionObj),              "Region Object"}
      216 +    {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Field.AccessLength),           "AccessLength"},
      217 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Field.RegionObj),              "Region Object"},
      218 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Field.ResourceBuffer),         "ResourceBuffer"}
 217  219  };
 218  220  
 219  221  static ACPI_EXDUMP_INFO     AcpiExDumpBankField[5] =
 220  222  {
 221  223      {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpBankField),      NULL},
 222  224      {ACPI_EXD_FIELD,    0,                                              NULL},
 223  225      {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (BankField.Value),              "Value"},
 224  226      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (BankField.RegionObj),          "Region Object"},
 225  227      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (BankField.BankObj),            "Bank Object"}
 226  228  };
↓ open down ↓ 22 lines elided ↑ open up ↑
 249  251  static ACPI_EXDUMP_INFO     AcpiExDumpAddressHandler[6] =
 250  252  {
 251  253      {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpAddressHandler), NULL},
 252  254      {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (AddressSpace.SpaceId),         "Space Id"},
 253  255      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (AddressSpace.Next),            "Next"},
 254  256      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (AddressSpace.RegionList),      "Region List"},
 255  257      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (AddressSpace.Node),            "Node"},
 256  258      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (AddressSpace.Context),         "Context"}
 257  259  };
 258  260  
 259      -static ACPI_EXDUMP_INFO     AcpiExDumpNotify[3] =
      261 +static ACPI_EXDUMP_INFO     AcpiExDumpNotify[7] =
 260  262  {
 261  263      {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify),         NULL},
 262  264      {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Notify.Node),                  "Node"},
 263      -    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Notify.Context),               "Context"}
      265 +    {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (Notify.HandlerType),           "Handler Type"},
      266 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Notify.Handler),               "Handler"},
      267 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Notify.Context),               "Context"},
      268 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Notify.Next[0]),               "Next System Notify"},
      269 +    {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Notify.Next[1]),               "Next Device Notify"}
 264  270  };
 265  271  
 266  272  
 267  273  /* Miscellaneous tables */
 268  274  
 269  275  static ACPI_EXDUMP_INFO     AcpiExDumpCommon[4] =
 270  276  {
 271  277      {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpCommon),         NULL},
 272  278      {ACPI_EXD_TYPE ,    0,                                              NULL},
 273  279      {ACPI_EXD_UINT16,   ACPI_EXD_OFFSET (Common.ReferenceCount),        "Reference Count"},
↓ open down ↓ 70 lines elided ↑ open up ↑
 344  350   *
 345  351   ******************************************************************************/
 346  352  
 347  353  static void
 348  354  AcpiExDumpObject (
 349  355      ACPI_OPERAND_OBJECT     *ObjDesc,
 350  356      ACPI_EXDUMP_INFO        *Info)
 351  357  {
 352  358      UINT8                   *Target;
 353  359      char                    *Name;
      360 +    const char              *ReferenceName;
 354  361      UINT8                   Count;
 355  362  
 356  363  
 357  364      if (!Info)
 358  365      {
 359  366          AcpiOsPrintf (
 360  367              "ExDumpObject: Display not implemented for object type %s\n",
 361  368              AcpiUtGetObjectTypeName (ObjDesc));
 362  369          return;
 363  370      }
↓ open down ↓ 3 lines elided ↑ open up ↑
 367  374      Count = Info->Offset;
 368  375  
 369  376      while (Count)
 370  377      {
 371  378          Target = ACPI_ADD_PTR (UINT8, ObjDesc, Info->Offset);
 372  379          Name = Info->Name;
 373  380  
 374  381          switch (Info->Opcode)
 375  382          {
 376  383          case ACPI_EXD_INIT:
      384 +
 377  385              break;
 378  386  
 379  387          case ACPI_EXD_TYPE:
 380  388  
 381  389              AcpiExOutString  ("Type", AcpiUtGetObjectTypeName (ObjDesc));
 382  390              break;
 383  391  
 384  392          case ACPI_EXD_UINT8:
 385  393  
 386  394              AcpiOsPrintf ("%20s : %2.2X\n", Name, *Target);
↓ open down ↓ 40 lines elided ↑ open up ↑
 427  435              AcpiExDumpPackageObj (ObjDesc, 0, 0);
 428  436              break;
 429  437  
 430  438          case ACPI_EXD_FIELD:
 431  439  
 432  440              AcpiExDumpObject (ObjDesc, AcpiExDumpFieldCommon);
 433  441              break;
 434  442  
 435  443          case ACPI_EXD_REFERENCE:
 436  444  
 437      -            AcpiExOutString ("Class Name",
 438      -                ACPI_CAST_PTR (char, AcpiUtGetReferenceName (ObjDesc)));
      445 +            ReferenceName = AcpiUtGetReferenceName (ObjDesc);
      446 +            AcpiExOutString ("Class Name", ACPI_CAST_PTR (char, ReferenceName));
 439  447              AcpiExDumpReferenceObj (ObjDesc);
 440  448              break;
 441  449  
 442  450          default:
 443  451  
 444  452              AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
 445  453                  Info->Opcode);
 446  454              return;
 447  455          }
 448  456  
↓ open down ↓ 21 lines elided ↑ open up ↑
 470  478      ACPI_OPERAND_OBJECT     *ObjDesc,
 471  479      UINT32                  Depth)
 472  480  {
 473  481      UINT32                  Length;
 474  482      UINT32                  Index;
 475  483  
 476  484  
 477  485      ACPI_FUNCTION_NAME (ExDumpOperand)
 478  486  
 479  487  
 480      -    if (!((ACPI_LV_EXEC & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
      488 +    /* Check if debug output enabled */
      489 +
      490 +    if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_EXEC, _COMPONENT))
 481  491      {
 482  492          return;
 483  493      }
 484  494  
 485  495      if (!ObjDesc)
 486  496      {
 487  497          /* This could be a null element of a package */
 488  498  
 489  499          ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n"));
 490  500          return;
↓ open down ↓ 35 lines elided ↑ open up ↑
 526  536  
 527  537          AcpiOsPrintf ("Reference: [%s] ", AcpiUtGetReferenceName (ObjDesc));
 528  538  
 529  539          switch (ObjDesc->Reference.Class)
 530  540          {
 531  541          case ACPI_REFCLASS_DEBUG:
 532  542  
 533  543              AcpiOsPrintf ("\n");
 534  544              break;
 535  545  
 536      -
 537  546          case ACPI_REFCLASS_INDEX:
 538  547  
 539  548              AcpiOsPrintf ("%p\n", ObjDesc->Reference.Object);
 540  549              break;
 541  550  
 542      -
 543  551          case ACPI_REFCLASS_TABLE:
 544  552  
 545  553              AcpiOsPrintf ("Table Index %X\n", ObjDesc->Reference.Value);
 546  554              break;
 547  555  
 548      -
 549  556          case ACPI_REFCLASS_REFOF:
 550  557  
 551  558              AcpiOsPrintf ("%p [%s]\n", ObjDesc->Reference.Object,
 552  559                  AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)
 553  560                      ObjDesc->Reference.Object)->Common.Type));
 554  561              break;
 555  562  
 556      -
 557  563          case ACPI_REFCLASS_NAME:
 558  564  
 559  565              AcpiOsPrintf ("- [%4.4s]\n", ObjDesc->Reference.Node->Name.Ascii);
 560  566              break;
 561  567  
 562      -
 563  568          case ACPI_REFCLASS_ARG:
 564  569          case ACPI_REFCLASS_LOCAL:
 565  570  
 566  571              AcpiOsPrintf ("%X\n", ObjDesc->Reference.Value);
 567  572              break;
 568  573  
 569      -
 570  574          default:    /* Unknown reference class */
 571  575  
 572  576              AcpiOsPrintf ("%2.2X\n", ObjDesc->Reference.Class);
 573  577              break;
 574  578          }
 575  579          break;
 576  580  
 577      -
 578  581      case ACPI_TYPE_BUFFER:
 579  582  
 580  583          AcpiOsPrintf ("Buffer length %.2X @ %p\n",
 581  584              ObjDesc->Buffer.Length, ObjDesc->Buffer.Pointer);
 582  585  
 583  586          /* Debug only -- dump the buffer contents */
 584  587  
 585  588          if (ObjDesc->Buffer.Pointer)
 586  589          {
 587  590              Length = ObjDesc->Buffer.Length;
↓ open down ↓ 1 lines elided ↑ open up ↑
 589  592              {
 590  593                  Length = 128;
 591  594              }
 592  595  
 593  596              AcpiOsPrintf ("Buffer Contents: (displaying length 0x%.2X)\n",
 594  597                  Length);
 595  598              ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, Length);
 596  599          }
 597  600          break;
 598  601  
 599      -
 600  602      case ACPI_TYPE_INTEGER:
 601  603  
 602  604          AcpiOsPrintf ("Integer %8.8X%8.8X\n",
 603  605              ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
 604  606          break;
 605  607  
 606      -
 607  608      case ACPI_TYPE_PACKAGE:
 608  609  
 609  610          AcpiOsPrintf ("Package [Len %X] ElementArray %p\n",
 610  611              ObjDesc->Package.Count, ObjDesc->Package.Elements);
 611  612  
 612  613          /*
 613  614           * If elements exist, package element pointer is valid,
 614  615           * and debug_level exceeds 1, dump package's elements.
 615  616           */
 616  617          if (ObjDesc->Package.Count &&
 617  618              ObjDesc->Package.Elements &&
 618  619              AcpiDbgLevel > 1)
 619  620          {
 620  621              for (Index = 0; Index < ObjDesc->Package.Count; Index++)
 621  622              {
 622  623                  AcpiExDumpOperand (ObjDesc->Package.Elements[Index], Depth+1);
 623  624              }
 624  625          }
 625  626          break;
 626  627  
 627      -
 628  628      case ACPI_TYPE_REGION:
 629  629  
 630  630          AcpiOsPrintf ("Region %s (%X)",
 631  631              AcpiUtGetRegionName (ObjDesc->Region.SpaceId),
 632  632              ObjDesc->Region.SpaceId);
 633  633  
 634  634          /*
 635  635           * If the address and length have not been evaluated,
 636  636           * don't print them.
 637  637           */
↓ open down ↓ 2 lines elided ↑ open up ↑
 640  640              AcpiOsPrintf ("\n");
 641  641          }
 642  642          else
 643  643          {
 644  644              AcpiOsPrintf (" base %8.8X%8.8X Length %X\n",
 645  645                  ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
 646  646                  ObjDesc->Region.Length);
 647  647          }
 648  648          break;
 649  649  
 650      -
 651  650      case ACPI_TYPE_STRING:
 652  651  
 653  652          AcpiOsPrintf ("String length %X @ %p ",
 654  653              ObjDesc->String.Length,
 655  654              ObjDesc->String.Pointer);
 656  655  
 657  656          AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
 658  657          AcpiOsPrintf ("\n");
 659  658          break;
 660  659  
 661      -
 662  660      case ACPI_TYPE_LOCAL_BANK_FIELD:
 663  661  
 664  662          AcpiOsPrintf ("BankField\n");
 665  663          break;
 666  664  
 667      -
 668  665      case ACPI_TYPE_LOCAL_REGION_FIELD:
 669  666  
 670  667          AcpiOsPrintf ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at "
 671  668              "byte=%X bit=%X of below:\n",
 672  669              ObjDesc->Field.BitLength,
 673  670              ObjDesc->Field.AccessByteWidth,
 674  671              ObjDesc->Field.FieldFlags & AML_FIELD_LOCK_RULE_MASK,
 675  672              ObjDesc->Field.FieldFlags & AML_FIELD_UPDATE_RULE_MASK,
 676  673              ObjDesc->Field.BaseByteOffset,
 677  674              ObjDesc->Field.StartFieldBitOffset);
 678  675  
 679  676          AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth+1);
 680  677          break;
 681  678  
 682      -
 683  679      case ACPI_TYPE_LOCAL_INDEX_FIELD:
 684  680  
 685  681          AcpiOsPrintf ("IndexField\n");
 686  682          break;
 687  683  
 688      -
 689  684      case ACPI_TYPE_BUFFER_FIELD:
 690  685  
 691  686          AcpiOsPrintf ("BufferField: %X bits at byte %X bit %X of\n",
 692  687              ObjDesc->BufferField.BitLength,
 693  688              ObjDesc->BufferField.BaseByteOffset,
 694  689              ObjDesc->BufferField.StartFieldBitOffset);
 695  690  
 696  691          if (!ObjDesc->BufferField.BufferObj)
 697  692          {
 698  693              ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL*\n"));
↓ open down ↓ 2 lines elided ↑ open up ↑
 701  696                      ACPI_TYPE_BUFFER)
 702  697          {
 703  698              AcpiOsPrintf ("*not a Buffer*\n");
 704  699          }
 705  700          else
 706  701          {
 707  702              AcpiExDumpOperand (ObjDesc->BufferField.BufferObj, Depth+1);
 708  703          }
 709  704          break;
 710  705  
 711      -
 712  706      case ACPI_TYPE_EVENT:
 713  707  
 714  708          AcpiOsPrintf ("Event\n");
 715  709          break;
 716  710  
 717      -
 718  711      case ACPI_TYPE_METHOD:
 719  712  
 720  713          AcpiOsPrintf ("Method(%X) @ %p:%X\n",
 721  714              ObjDesc->Method.ParamCount,
 722  715              ObjDesc->Method.AmlStart,
 723  716              ObjDesc->Method.AmlLength);
 724  717          break;
 725  718  
 726      -
 727  719      case ACPI_TYPE_MUTEX:
 728  720  
 729  721          AcpiOsPrintf ("Mutex\n");
 730  722          break;
 731  723  
 732      -
 733  724      case ACPI_TYPE_DEVICE:
 734  725  
 735  726          AcpiOsPrintf ("Device\n");
 736  727          break;
 737  728  
 738      -
 739  729      case ACPI_TYPE_POWER:
 740  730  
 741  731          AcpiOsPrintf ("Power\n");
 742  732          break;
 743  733  
 744      -
 745  734      case ACPI_TYPE_PROCESSOR:
 746  735  
 747  736          AcpiOsPrintf ("Processor\n");
 748  737          break;
 749  738  
 750      -
 751  739      case ACPI_TYPE_THERMAL:
 752  740  
 753  741          AcpiOsPrintf ("Thermal\n");
 754  742          break;
 755  743  
 756      -
 757  744      default:
      745 +
 758  746          /* Unknown Type */
 759  747  
 760  748          AcpiOsPrintf ("Unknown Type %X\n", ObjDesc->Common.Type);
 761  749          break;
 762  750      }
 763  751  
 764  752      return;
 765  753  }
 766  754  
 767  755  
↓ open down ↓ 47 lines elided ↑ open up ↑
 815  803  }
 816  804  
 817  805  
 818  806  /*******************************************************************************
 819  807   *
 820  808   * FUNCTION:    AcpiExOut* functions
 821  809   *
 822  810   * PARAMETERS:  Title               - Descriptive text
 823  811   *              Value               - Value to be displayed
 824  812   *
 825      - * DESCRIPTION: Object dump output formatting functions.  These functions
      813 + * DESCRIPTION: Object dump output formatting functions. These functions
 826  814   *              reduce the number of format strings required and keeps them
 827  815   *              all in one place for easy modification.
 828  816   *
 829  817   ******************************************************************************/
 830  818  
 831  819  static void
 832  820  AcpiExOutString (
 833  821      char                    *Title,
 834  822      char                    *Value)
 835  823  {
↓ open down ↓ 24 lines elided ↑ open up ↑
 860  848  AcpiExDumpNamespaceNode (
 861  849      ACPI_NAMESPACE_NODE     *Node,
 862  850      UINT32                  Flags)
 863  851  {
 864  852  
 865  853      ACPI_FUNCTION_ENTRY ();
 866  854  
 867  855  
 868  856      if (!Flags)
 869  857      {
 870      -        if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
      858 +        /* Check if debug output enabled */
      859 +
      860 +        if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT))
 871  861          {
 872  862              return;
 873  863          }
 874  864      }
 875  865  
 876  866      AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node));
 877  867      AcpiExOutString  ("Type", AcpiUtGetTypeName (Node->Type));
 878  868      AcpiExOutPointer ("Attached Object", AcpiNsGetAttachedObject (Node));
 879  869      AcpiExOutPointer ("Parent", Node->Parent);
 880  870  
↓ open down ↓ 107 lines elided ↑ open up ↑
 988  978      /* Packages may only contain a few object types */
 989  979  
 990  980      switch (ObjDesc->Common.Type)
 991  981      {
 992  982      case ACPI_TYPE_INTEGER:
 993  983  
 994  984          AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n",
 995  985              ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
 996  986          break;
 997  987  
 998      -
 999  988      case ACPI_TYPE_STRING:
1000  989  
1001  990          AcpiOsPrintf ("[String]  Value: ");
1002      -        for (i = 0; i < ObjDesc->String.Length; i++)
1003      -        {
1004      -            AcpiOsPrintf ("%c", ObjDesc->String.Pointer[i]);
1005      -        }
      991 +        AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
1006  992          AcpiOsPrintf ("\n");
1007  993          break;
1008  994  
1009      -
1010  995      case ACPI_TYPE_BUFFER:
1011  996  
1012  997          AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);
1013  998          if (ObjDesc->Buffer.Length)
1014  999          {
1015      -            AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
     1000 +            AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
1016 1001                  ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
1017 1002          }
1018 1003          else
1019 1004          {
1020 1005              AcpiOsPrintf ("\n");
1021 1006          }
1022 1007          break;
1023 1008  
1024      -
1025 1009      case ACPI_TYPE_PACKAGE:
1026 1010  
1027 1011          AcpiOsPrintf ("[Package] Contains %u Elements:\n",
1028 1012              ObjDesc->Package.Count);
1029 1013  
1030 1014          for (i = 0; i < ObjDesc->Package.Count; i++)
1031 1015          {
1032 1016              AcpiExDumpPackageObj (ObjDesc->Package.Elements[i], Level+1, i);
1033 1017          }
1034 1018          break;
1035 1019  
1036      -
1037 1020      case ACPI_TYPE_LOCAL_REFERENCE:
1038 1021  
1039 1022          AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X",
1040 1023              AcpiUtGetReferenceName (ObjDesc),
1041 1024              ObjDesc->Reference.Class);
1042 1025          AcpiExDumpReferenceObj (ObjDesc);
1043 1026          break;
1044 1027  
1045      -
1046 1028      default:
1047 1029  
1048 1030          AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Common.Type);
1049 1031          break;
1050 1032      }
1051 1033  }
1052 1034  
1053 1035  
1054 1036  /*******************************************************************************
1055 1037   *
↓ open down ↓ 14 lines elided ↑ open up ↑
1070 1052      ACPI_FUNCTION_TRACE (ExDumpObjectDescriptor);
1071 1053  
1072 1054  
1073 1055      if (!ObjDesc)
1074 1056      {
1075 1057          return_VOID;
1076 1058      }
1077 1059  
1078 1060      if (!Flags)
1079 1061      {
1080      -        if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
     1062 +        /* Check if debug output enabled */
     1063 +
     1064 +        if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT))
1081 1065          {
1082 1066              return_VOID;
1083 1067          }
1084 1068      }
1085 1069  
1086 1070      if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_NAMED)
1087 1071      {
1088 1072          AcpiExDumpNamespaceNode ((ACPI_NAMESPACE_NODE *) ObjDesc, Flags);
1089 1073  
1090 1074          AcpiOsPrintf ("\nAttached Object (%p):\n",
↓ open down ↓ 21 lines elided ↑ open up ↑
1112 1096  
1113 1097      AcpiExDumpObject (ObjDesc, AcpiExDumpCommon);
1114 1098  
1115 1099      /* Object-specific fields */
1116 1100  
1117 1101      AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);
1118 1102      return_VOID;
1119 1103  }
1120 1104  
1121 1105  #endif
1122      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX