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/debugger/dbutils.c
          +++ new/usr/src/common/acpica/components/debugger/dbutils.c
   1    1  /*******************************************************************************
   2    2   *
   3    3   * Module Name: dbutils - AML debugger utilities
   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 ↓ 59 lines elided ↑ open up ↑
  78   78   *
  79   79   * RETURN:      Index into command array or ACPI_TYPE_NOT_FOUND if not found
  80   80   *
  81   81   * DESCRIPTION: Search command array for a command match
  82   82   *
  83   83   ******************************************************************************/
  84   84  
  85   85  ACPI_OBJECT_TYPE
  86   86  AcpiDbMatchArgument (
  87   87      char                    *UserArgument,
  88      -    ARGUMENT_INFO           *Arguments)
       88 +    ACPI_DB_ARGUMENT_INFO   *Arguments)
  89   89  {
  90   90      UINT32                  i;
  91   91  
  92   92  
  93   93      if (!UserArgument || UserArgument[0] == 0)
  94   94      {
  95   95          return (ACPI_TYPE_NOT_FOUND);
  96   96      }
  97   97  
  98   98      for (i = 0; Arguments[i].Name; i++)
↓ open down ↓ 11 lines elided ↑ open up ↑
 110  110  
 111  111  
 112  112  /*******************************************************************************
 113  113   *
 114  114   * FUNCTION:    AcpiDbSetOutputDestination
 115  115   *
 116  116   * PARAMETERS:  OutputFlags         - Current flags word
 117  117   *
 118  118   * RETURN:      None
 119  119   *
 120      - * DESCRIPTION: Set the current destination for debugger output.  Also sets
      120 + * DESCRIPTION: Set the current destination for debugger output. Also sets
 121  121   *              the debug output level accordingly.
 122  122   *
 123  123   ******************************************************************************/
 124  124  
 125  125  void
 126  126  AcpiDbSetOutputDestination (
 127  127      UINT32                  OutputFlags)
 128  128  {
 129  129  
 130  130      AcpiGbl_DbOutputFlags = (UINT8) OutputFlags;
↓ open down ↓ 41 lines elided ↑ open up ↑
 172  172          AcpiOsPrintf ("  ");
 173  173      }
 174  174  
 175  175      switch (ObjDesc->Type)
 176  176      {
 177  177      case ACPI_TYPE_ANY:
 178  178  
 179  179          AcpiOsPrintf ("[Null Object] (Type=0)\n");
 180  180          break;
 181  181  
 182      -
 183  182      case ACPI_TYPE_INTEGER:
 184  183  
 185  184          AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n",
 186  185                      ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
 187  186          break;
 188  187  
 189      -
 190  188      case ACPI_TYPE_STRING:
 191  189  
 192  190          AcpiOsPrintf ("[String] Length %.2X = ", ObjDesc->String.Length);
 193      -        for (i = 0; i < ObjDesc->String.Length; i++)
 194      -        {
 195      -            AcpiOsPrintf ("%c", ObjDesc->String.Pointer[i]);
 196      -        }
      191 +        AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
 197  192          AcpiOsPrintf ("\n");
 198  193          break;
 199  194  
 200      -
 201  195      case ACPI_TYPE_BUFFER:
 202  196  
 203  197          AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);
 204  198          if (ObjDesc->Buffer.Length)
 205  199          {
 206  200              if (ObjDesc->Buffer.Length > 16)
 207  201              {
 208  202                  AcpiOsPrintf ("\n");
 209  203              }
 210      -            AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
 211      -                    ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
      204 +            AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
      205 +                    ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT);
 212  206          }
 213  207          else
 214  208          {
 215  209              AcpiOsPrintf ("\n");
 216  210          }
 217  211          break;
 218  212  
 219      -
 220  213      case ACPI_TYPE_PACKAGE:
 221  214  
 222  215          AcpiOsPrintf ("[Package] Contains %u Elements:\n",
 223  216                  ObjDesc->Package.Count);
 224  217  
 225  218          for (i = 0; i < ObjDesc->Package.Count; i++)
 226  219          {
 227  220              AcpiDbDumpExternalObject (&ObjDesc->Package.Elements[i], Level+1);
 228  221          }
 229  222          break;
 230  223  
 231      -
 232  224      case ACPI_TYPE_LOCAL_REFERENCE:
 233  225  
 234  226          AcpiOsPrintf ("[Object Reference] = ");
 235  227          AcpiDmDisplayInternalObject (ObjDesc->Reference.Handle, NULL);
 236  228          break;
 237  229  
 238      -
 239  230      case ACPI_TYPE_PROCESSOR:
 240  231  
 241  232          AcpiOsPrintf ("[Processor]\n");
 242  233          break;
 243  234  
 244      -
 245  235      case ACPI_TYPE_POWER:
 246  236  
 247  237          AcpiOsPrintf ("[Power Resource]\n");
 248  238          break;
 249  239  
 250      -
 251  240      default:
 252  241  
 253  242          AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Type);
 254  243          break;
 255  244      }
 256  245  }
 257  246  
 258  247  
 259  248  /*******************************************************************************
 260  249   *
↓ open down ↓ 21 lines elided ↑ open up ↑
 282  271  
 283  272      /* Convert a leading forward slash to a backslash */
 284  273  
 285  274      if (*Name == '/')
 286  275      {
 287  276          *Name = '\\';
 288  277      }
 289  278  
 290  279      /* Ignore a leading backslash, this is the root prefix */
 291  280  
 292      -    if (*Name == '\\')
      281 +    if (ACPI_IS_ROOT_PREFIX (*Name))
 293  282      {
 294  283          Name++;
 295  284      }
 296  285  
 297  286      /* Convert all slash path separators to dots */
 298  287  
 299  288      while (*Name)
 300  289      {
 301  290          if ((*Name == '/') ||
 302  291              (*Name == '\\'))
↓ open down ↓ 9 lines elided ↑ open up ↑
 312  301  /*******************************************************************************
 313  302   *
 314  303   * FUNCTION:    AcpiDbLocalNsLookup
 315  304   *
 316  305   * PARAMETERS:  Name            - Name to lookup
 317  306   *
 318  307   * RETURN:      Pointer to a namespace node, null on failure
 319  308   *
 320  309   * DESCRIPTION: Lookup a name in the ACPI namespace
 321  310   *
 322      - * Note: Currently begins search from the root.  Could be enhanced to use
      311 + * Note: Currently begins search from the root. Could be enhanced to use
 323  312   * the current prefix (scope) node as the search beginning point.
 324  313   *
 325  314   ******************************************************************************/
 326  315  
 327  316  ACPI_NAMESPACE_NODE *
 328  317  AcpiDbLocalNsLookup (
 329  318      char                    *Name)
 330  319  {
 331  320      char                    *InternalPath;
 332  321      ACPI_STATUS             Status;
↓ open down ↓ 23 lines elided ↑ open up ↑
 356  345                  Name, AcpiFormatException (Status));
 357  346      }
 358  347  
 359  348      ACPI_FREE (InternalPath);
 360  349      return (Node);
 361  350  }
 362  351  
 363  352  
 364  353  /*******************************************************************************
 365  354   *
 366      - * FUNCTION:    AcpiDbUInt32ToHexString
      355 + * FUNCTION:    AcpiDbUint32ToHexString
 367  356   *
 368  357   * PARAMETERS:  Value           - The value to be converted to string
 369  358   *              Buffer          - Buffer for result (not less than 11 bytes)
 370  359   *
 371  360   * RETURN:      None
 372  361   *
 373  362   * DESCRIPTION: Convert the unsigned 32-bit value to the hexadecimal image
 374  363   *
 375  364   * NOTE: It is the caller's responsibility to ensure that the length of buffer
 376  365   *       is sufficient.
 377  366   *
 378  367   ******************************************************************************/
 379  368  
 380  369  void
 381      -AcpiDbUInt32ToHexString (
      370 +AcpiDbUint32ToHexString (
 382  371      UINT32                  Value,
 383  372      char                    *Buffer)
 384  373  {
 385  374      int                     i;
 386  375  
 387  376  
 388  377      if (Value == 0)
 389  378      {
 390  379          ACPI_STRCPY (Buffer, "0");
 391  380          return;
↓ open down ↓ 11 lines elided ↑ open up ↑
 403  392  
 404  393  #ifdef ACPI_OBSOLETE_FUNCTIONS
 405  394  /*******************************************************************************
 406  395   *
 407  396   * FUNCTION:    AcpiDbSecondPassParse
 408  397   *
 409  398   * PARAMETERS:  Root            - Root of the parse tree
 410  399   *
 411  400   * RETURN:      Status
 412  401   *
 413      - * DESCRIPTION: Second pass parse of the ACPI tables.  We need to wait until
      402 + * DESCRIPTION: Second pass parse of the ACPI tables. We need to wait until
 414  403   *              second pass to parse the control methods
 415  404   *
 416  405   ******************************************************************************/
 417  406  
 418  407  ACPI_STATUS
 419  408  AcpiDbSecondPassParse (
 420  409      ACPI_PARSE_OBJECT       *Root)
 421  410  {
 422  411      ACPI_PARSE_OBJECT       *Op = Root;
 423  412      ACPI_PARSE_OBJECT       *Method;
↓ open down ↓ 85 lines elided ↑ open up ↑
 509  498   ******************************************************************************/
 510  499  
 511  500  void
 512  501  AcpiDbDumpBuffer (
 513  502      UINT32                  Address)
 514  503  {
 515  504  
 516  505      AcpiOsPrintf ("\nLocation %X:\n", Address);
 517  506  
 518  507      AcpiDbgLevel |= ACPI_LV_TABLES;
 519      -    AcpiUtDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY,
      508 +    AcpiUtDebugDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY,
 520  509              ACPI_UINT32_MAX);
 521  510  }
 522  511  #endif
 523  512  
 524  513  #endif /* ACPI_DEBUGGER */
 525      -
 526      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX