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/exutils.c
          +++ new/usr/src/common/acpica/components/executer/exutils.c
   1      -
   2    1  /******************************************************************************
   3    2   *
   4    3   * Module Name: exutils - interpreter/scanner utilities
   5    4   *
   6    5   *****************************************************************************/
   7    6  
   8    7  /*
   9      - * Copyright (C) 2000 - 2011, Intel Corp.
        8 + * Copyright (C) 2000 - 2014, 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 ↓ 20 lines elided ↑ open up ↑
  40   39   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  41   40   * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  42   41   * POSSIBILITY OF SUCH DAMAGES.
  43   42   */
  44   43  
  45   44  #define __EXUTILS_C__
  46   45  
  47   46  /*
  48   47   * DEFINE_AML_GLOBALS is tested in amlcode.h
  49   48   * to determine whether certain global names should be "defined" or only
  50      - * "declared" in the current compilation.  This enhances maintainability
       49 + * "declared" in the current compilation. This enhances maintainability
  51   50   * by enabling a single header file to embody all knowledge of the names
  52   51   * in question.
  53   52   *
  54   53   * Exactly one module of any executable should #define DEFINE_GLOBALS
  55      - * before #including the header files which use this convention.  The
       54 + * before #including the header files which use this convention. The
  56   55   * names in question will be defined and initialized in that module,
  57   56   * and declared as extern in all other modules which #include those
  58   57   * header files.
  59   58   */
  60   59  
  61   60  #define DEFINE_AML_GLOBALS
  62   61  
  63   62  #include "acpi.h"
  64   63  #include "accommon.h"
  65   64  #include "acinterp.h"
↓ open down ↓ 48 lines elided ↑ open up ↑
 114  113  /*******************************************************************************
 115  114   *
 116  115   * FUNCTION:    AcpiExReacquireInterpreter
 117  116   *
 118  117   * PARAMETERS:  None
 119  118   *
 120  119   * RETURN:      None
 121  120   *
 122  121   * DESCRIPTION: Reacquire the interpreter execution region from within the
 123  122   *              interpreter code. Failure to enter the interpreter region is a
 124      - *              fatal system error. Used in  conjuction with
      123 + *              fatal system error. Used in conjunction with
 125  124   *              RelinquishInterpreter
 126  125   *
 127  126   ******************************************************************************/
 128  127  
 129  128  void
 130  129  AcpiExReacquireInterpreter (
 131  130      void)
 132  131  {
 133  132      ACPI_FUNCTION_TRACE (ExReacquireInterpreter);
 134  133  
↓ open down ↓ 88 lines elided ↑ open up ↑
 223  222      return_VOID;
 224  223  }
 225  224  
 226  225  
 227  226  /*******************************************************************************
 228  227   *
 229  228   * FUNCTION:    AcpiExTruncateFor32bitTable
 230  229   *
 231  230   * PARAMETERS:  ObjDesc         - Object to be truncated
 232  231   *
 233      - * RETURN:      none
      232 + * RETURN:      TRUE if a truncation was performed, FALSE otherwise.
 234  233   *
 235  234   * DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is
 236  235   *              32-bit, as determined by the revision of the DSDT.
 237  236   *
 238  237   ******************************************************************************/
 239  238  
 240      -void
      239 +BOOLEAN
 241  240  AcpiExTruncateFor32bitTable (
 242  241      ACPI_OPERAND_OBJECT     *ObjDesc)
 243  242  {
 244  243  
 245  244      ACPI_FUNCTION_ENTRY ();
 246  245  
 247  246  
 248  247      /*
 249  248       * Object must be a valid number and we must be executing
 250      -     * a control method. NS node could be there for AML_INT_NAMEPATH_OP.
      249 +     * a control method. Object could be NS node for AML_INT_NAMEPATH_OP.
 251  250       */
 252  251      if ((!ObjDesc) ||
 253  252          (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) ||
 254  253          (ObjDesc->Common.Type != ACPI_TYPE_INTEGER))
 255  254      {
 256      -        return;
      255 +        return (FALSE);
 257  256      }
 258  257  
 259      -    if (AcpiGbl_IntegerByteWidth == 4)
      258 +    if ((AcpiGbl_IntegerByteWidth == 4) &&
      259 +        (ObjDesc->Integer.Value > (UINT64) ACPI_UINT32_MAX))
 260  260      {
 261  261          /*
 262      -         * We are running a method that exists in a 32-bit ACPI table.
      262 +         * We are executing in a 32-bit ACPI table.
 263  263           * Truncate the value to 32 bits by zeroing out the upper 32-bit field
 264  264           */
 265  265          ObjDesc->Integer.Value &= (UINT64) ACPI_UINT32_MAX;
      266 +        return (TRUE);
 266  267      }
      268 +
      269 +    return (FALSE);
 267  270  }
 268  271  
 269  272  
 270  273  /*******************************************************************************
 271  274   *
 272  275   * FUNCTION:    AcpiExAcquireGlobalLock
 273  276   *
 274  277   * PARAMETERS:  FieldFlags            - Flags with Lock rule:
 275  278   *                                      AlwaysLock or NeverLock
 276  279   *
↓ open down ↓ 215 lines elided ↑ open up ↑
 492  495      DigitsNeeded = AcpiExDigitsNeeded (Value, 10);
 493  496      OutString[DigitsNeeded] = 0;
 494  497  
 495  498      for (Count = DigitsNeeded; Count > 0; Count--)
 496  499      {
 497  500          (void) AcpiUtShortDivide (Value, 10, &Value, &Remainder);
 498  501          OutString[Count-1] = (char) ('0' + Remainder);\
 499  502      }
 500  503  }
 501  504  
      505 +
      506 +/*******************************************************************************
      507 + *
      508 + * FUNCTION:    AcpiIsValidSpaceId
      509 + *
      510 + * PARAMETERS:  SpaceId             - ID to be validated
      511 + *
      512 + * RETURN:      TRUE if valid/supported ID.
      513 + *
      514 + * DESCRIPTION: Validate an operation region SpaceID.
      515 + *
      516 + ******************************************************************************/
      517 +
      518 +BOOLEAN
      519 +AcpiIsValidSpaceId (
      520 +    UINT8                   SpaceId)
      521 +{
      522 +
      523 +    if ((SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) &&
      524 +        (SpaceId < ACPI_USER_REGION_BEGIN) &&
      525 +        (SpaceId != ACPI_ADR_SPACE_DATA_TABLE) &&
      526 +        (SpaceId != ACPI_ADR_SPACE_FIXED_HARDWARE))
      527 +    {
      528 +        return (FALSE);
      529 +    }
      530 +
      531 +    return (TRUE);
      532 +}
      533 +
      534 +
 502  535  #endif
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX