Print this page
acpica-unix2-20130823
PANKOVs restructure

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/executer/exnames.c
          +++ new/usr/src/common/acpica/components/executer/exnames.c
   1      -
   2    1  /******************************************************************************
   3    2   *
   4    3   * Module Name: exnames - interpreter/scanner name load/execute
   5    4   *
   6    5   *****************************************************************************/
   7    6  
   8    7  /*
   9      - * Copyright (C) 2000 - 2011, Intel Corp.
        8 + * Copyright (C) 2000 - 2013, Intel Corp.
  10    9   * All rights reserved.
  11   10   *
  12   11   * Redistribution and use in source and binary forms, with or without
  13   12   * modification, are permitted provided that the following conditions
  14   13   * are met:
  15   14   * 1. Redistributions of source code must retain the above copyright
  16   15   *    notice, this list of conditions, and the following disclaimer,
  17   16   *    without modification.
  18   17   * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  19   18   *    substantially similar to the "NO WARRANTY" disclaimer below
↓ open down ↓ 46 lines elided ↑ open up ↑
  66   65  
  67   66  
  68   67  /*******************************************************************************
  69   68   *
  70   69   * FUNCTION:    AcpiExAllocateNameString
  71   70   *
  72   71   * PARAMETERS:  PrefixCount         - Count of parent levels. Special cases:
  73   72   *                                    (-1)==root,  0==none
  74   73   *              NumNameSegs         - count of 4-character name segments
  75   74   *
  76      - * RETURN:      A pointer to the allocated string segment.  This segment must
       75 + * RETURN:      A pointer to the allocated string segment. This segment must
  77   76   *              be deleted by the caller.
  78   77   *
  79   78   * DESCRIPTION: Allocate a buffer for a name string. Ensure allocated name
  80   79   *              string is long enough, and set up prefix if any.
  81   80   *
  82   81   ******************************************************************************/
  83   82  
  84   83  static char *
  85   84  AcpiExAllocateNameString (
  86   85      UINT32                  PrefixCount,
↓ open down ↓ 241 lines elided ↑ open up ↑
 328  327  
 329  328              /*
 330  329               * Remember that we have a RootPrefix --
 331  330               * see comment in AcpiExAllocateNameString()
 332  331               */
 333  332              AmlAddress++;
 334  333              PrefixCount = ACPI_UINT32_MAX;
 335  334              HasPrefix = TRUE;
 336  335              break;
 337  336  
 338      -
 339  337          case AML_PARENT_PREFIX:
 340  338  
 341  339              /* Increment past possibly multiple parent prefixes */
 342  340  
 343  341              do
 344  342              {
 345  343                  ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "ParentPrefix (^) at %p\n",
 346  344                      AmlAddress));
 347  345  
 348  346                  AmlAddress++;
 349  347                  PrefixCount++;
 350  348  
 351  349              } while (*AmlAddress == AML_PARENT_PREFIX);
 352  350  
 353  351              HasPrefix = TRUE;
 354  352              break;
 355  353  
 356      -
 357  354          default:
 358  355  
 359  356              /* Not a prefix character */
 360  357  
 361  358              break;
 362  359          }
 363  360  
 364  361          /* Examine first character of name for name segment prefix operator */
 365  362  
 366  363          switch (*AmlAddress)
↓ open down ↓ 15 lines elided ↑ open up ↑
 382  379  
 383  380              HasPrefix = TRUE;
 384  381  
 385  382              Status = AcpiExNameSegment (&AmlAddress, NameString);
 386  383              if (ACPI_SUCCESS (Status))
 387  384              {
 388  385                  Status = AcpiExNameSegment (&AmlAddress, NameString);
 389  386              }
 390  387              break;
 391  388  
 392      -
 393  389          case AML_MULTI_NAME_PREFIX_OP:
 394  390  
 395  391              ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "MultiNamePrefix at %p\n",
 396  392                  AmlAddress));
 397  393  
 398  394              /* Fetch count of segments remaining in name path */
 399  395  
 400  396              AmlAddress++;
 401  397              NumSegments = *AmlAddress;
 402  398  
↓ open down ↓ 11 lines elided ↑ open up ↑
 414  410  
 415  411              while (NumSegments &&
 416  412                      (Status = AcpiExNameSegment (&AmlAddress, NameString)) ==
 417  413                          AE_OK)
 418  414              {
 419  415                  NumSegments--;
 420  416              }
 421  417  
 422  418              break;
 423  419  
 424      -
 425  420          case 0:
 426  421  
 427  422              /* NullName valid as of 8-12-98 ASL/AML Grammar Update */
 428  423  
 429  424              if (PrefixCount == ACPI_UINT32_MAX)
 430  425              {
 431  426                  ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
 432  427                      "NameSeg is \"\\\" followed by NULL\n"));
 433  428              }
 434  429  
↓ open down ↓ 2 lines elided ↑ open up ↑
 437  432              AmlAddress++;
 438  433              NameString = AcpiExAllocateNameString (PrefixCount, 0);
 439  434              if (!NameString)
 440  435              {
 441  436                  Status = AE_NO_MEMORY;
 442  437                  break;
 443  438              }
 444  439  
 445  440              break;
 446  441  
 447      -
 448  442          default:
 449  443  
 450  444              /* Name segment string */
 451  445  
 452  446              NameString = AcpiExAllocateNameString (PrefixCount, 1);
 453  447              if (!NameString)
 454  448              {
 455  449                  Status = AE_NO_MEMORY;
 456  450                  break;
 457  451              }
↓ open down ↓ 19 lines elided ↑ open up ↑
 477  471              ACPI_FREE (NameString);
 478  472          }
 479  473          return_ACPI_STATUS (Status);
 480  474      }
 481  475  
 482  476      *OutNameString = NameString;
 483  477      *OutNameLength = (UINT32) (AmlAddress - InAmlAddress);
 484  478  
 485  479      return_ACPI_STATUS (Status);
 486  480  }
 487      -
 488      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX