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/events/evgpeinit.c
          +++ new/usr/src/common/acpica/components/events/evgpeinit.c
   1    1  /******************************************************************************
   2    2   *
   3    3   * Module Name: evgpeinit - System GPE initialization and update
   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 ↓ 24 lines elided ↑ open up ↑
  43   43  
  44   44  
  45   45  #include "acpi.h"
  46   46  #include "accommon.h"
  47   47  #include "acevents.h"
  48   48  #include "acnamesp.h"
  49   49  
  50   50  #define _COMPONENT          ACPI_EVENTS
  51   51          ACPI_MODULE_NAME    ("evgpeinit")
  52   52  
       53 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
  53   54  
  54   55  /*
  55   56   * Note: History of _PRW support in ACPICA
  56   57   *
  57   58   * Originally (2000 - 2010), the GPE initialization code performed a walk of
  58   59   * the entire namespace to execute the _PRW methods and detect all GPEs
  59   60   * capable of waking the system.
  60   61   *
  61   62   * As of 10/2010, the _PRW method execution has been removed since it is
  62   63   * actually unnecessary. The host OS must in fact execute all _PRW methods
↓ open down ↓ 23 lines elided ↑ open up ↑
  86   87  {
  87   88      UINT32                  RegisterCount0 = 0;
  88   89      UINT32                  RegisterCount1 = 0;
  89   90      UINT32                  GpeNumberMax = 0;
  90   91      ACPI_STATUS             Status;
  91   92  
  92   93  
  93   94      ACPI_FUNCTION_TRACE (EvGpeInitialize);
  94   95  
  95   96  
       97 +    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
       98 +        "Initializing General Purpose Events (GPEs):\n"));
       99 +
  96  100      Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
  97  101      if (ACPI_FAILURE (Status))
  98  102      {
  99  103          return_ACPI_STATUS (Status);
 100  104      }
 101  105  
 102  106      /*
 103  107       * Initialize the GPE Block(s) defined in the FADT
 104  108       *
 105  109       * Why the GPE register block lengths are divided by 2:  From the ACPI
↓ open down ↓ 17 lines elided ↑ open up ↑
 123  127       *
 124  128       * If EITHER the register length OR the block address are zero, then that
 125  129       * particular block is not supported.
 126  130       */
 127  131      if (AcpiGbl_FADT.Gpe0BlockLength &&
 128  132          AcpiGbl_FADT.XGpe0Block.Address)
 129  133      {
 130  134          /* GPE block 0 exists (has both length and address > 0) */
 131  135  
 132  136          RegisterCount0 = (UINT16) (AcpiGbl_FADT.Gpe0BlockLength / 2);
 133      -
 134  137          GpeNumberMax = (RegisterCount0 * ACPI_GPE_REGISTER_WIDTH) - 1;
 135  138  
 136  139          /* Install GPE Block 0 */
 137  140  
 138  141          Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
 139  142                      &AcpiGbl_FADT.XGpe0Block, RegisterCount0, 0,
 140  143                      AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
 141  144  
 142  145          if (ACPI_FAILURE (Status))
 143  146          {
↓ open down ↓ 54 lines elided ↑ open up ↑
 198  201      if ((RegisterCount0 + RegisterCount1) == 0)
 199  202      {
 200  203          /* GPEs are not required by ACPI, this is OK */
 201  204  
 202  205          ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
 203  206              "There are no GPE blocks defined in the FADT\n"));
 204  207          Status = AE_OK;
 205  208          goto Cleanup;
 206  209      }
 207  210  
 208      -    /* Check for Max GPE number out-of-range */
 209  211  
 210      -    if (GpeNumberMax > ACPI_GPE_MAX)
 211      -    {
 212      -        ACPI_ERROR ((AE_INFO,
 213      -            "Maximum GPE number from FADT is too large: 0x%X",
 214      -            GpeNumberMax));
 215      -        Status = AE_BAD_VALUE;
 216      -        goto Cleanup;
 217      -    }
 218      -
 219  212  Cleanup:
 220  213      (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
 221  214      return_ACPI_STATUS (AE_OK);
 222  215  }
 223  216  
 224  217  
 225  218  /*******************************************************************************
 226  219   *
 227  220   * FUNCTION:    AcpiEvUpdateGpes
 228  221   *
↓ open down ↓ 142 lines elided ↑ open up ↑
 371  364          return_ACPI_STATUS (AE_OK); /* Ignore this method */
 372  365      }
 373  366  
 374  367      /*
 375  368       * 3) Edge/Level determination is based on the 2nd character
 376  369       *    of the method name
 377  370       */
 378  371      switch (Name[1])
 379  372      {
 380  373      case 'L':
      374 +
 381  375          Type = ACPI_GPE_LEVEL_TRIGGERED;
 382  376          break;
 383  377  
 384  378      case 'E':
      379 +
 385  380          Type = ACPI_GPE_EDGE_TRIGGERED;
 386  381          break;
 387  382  
 388  383      default:
      384 +
 389  385          /* Unknown method type, just ignore it */
 390  386  
 391  387          ACPI_DEBUG_PRINT ((ACPI_DB_LOAD,
 392  388              "Ignoring unknown GPE method type: %s "
 393  389              "(name not of form _Lxx or _Exx)", Name));
 394  390          return_ACPI_STATUS (AE_OK);
 395  391      }
 396  392  
 397  393      /* 4) The last two characters of the name are the hex GPE Number */
 398  394  
↓ open down ↓ 51 lines elided ↑ open up ↑
 450  446       */
 451  447      GpeEventInfo->Flags &= ~(ACPI_GPE_DISPATCH_MASK);
 452  448      GpeEventInfo->Flags |= (UINT8) (Type | ACPI_GPE_DISPATCH_METHOD);
 453  449      GpeEventInfo->Dispatch.MethodNode = MethodNode;
 454  450  
 455  451      ACPI_DEBUG_PRINT ((ACPI_DB_LOAD,
 456  452          "Registered GPE method %s as GPE number 0x%.2X\n",
 457  453          Name, GpeNumber));
 458  454      return_ACPI_STATUS (AE_OK);
 459  455  }
      456 +
      457 +#endif /* !ACPI_REDUCED_HARDWARE */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX