Print this page
acpica-unix2-20130823
PANKOVs restructure

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/hardware/hwgpe.c
          +++ new/usr/src/common/acpica/components/hardware/hwgpe.c
   1      -
   2    1  /******************************************************************************
   3    2   *
   4    3   * Module Name: hwgpe - Low level GPE enable/disable/clear functions
   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 ↓ 22 lines elided ↑ open up ↑
  42   41   * POSSIBILITY OF SUCH DAMAGES.
  43   42   */
  44   43  
  45   44  #include "acpi.h"
  46   45  #include "accommon.h"
  47   46  #include "acevents.h"
  48   47  
  49   48  #define _COMPONENT          ACPI_HARDWARE
  50   49          ACPI_MODULE_NAME    ("hwgpe")
  51   50  
       51 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
       52 +
  52   53  /* Local prototypes */
  53   54  
  54   55  static ACPI_STATUS
  55   56  AcpiHwEnableWakeupGpeBlock (
  56   57      ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
  57   58      ACPI_GPE_BLOCK_INFO     *GpeBlock,
  58   59      void                    *Context);
  59   60  
  60   61  
  61   62  /******************************************************************************
  62   63   *
  63   64   * FUNCTION:    AcpiHwGetGpeRegisterBit
  64   65   *
  65   66   * PARAMETERS:  GpeEventInfo        - Info block for the GPE
  66      - *              GpeRegisterInfo     - Info block for the GPE register
  67   67   *
  68   68   * RETURN:      Register mask with a one in the GPE bit position
  69   69   *
  70   70   * DESCRIPTION: Compute the register mask for this GPE. One bit is set in the
  71   71   *              correct position for the input GPE.
  72   72   *
  73   73   ******************************************************************************/
  74   74  
  75   75  UINT32
  76   76  AcpiHwGetGpeRegisterBit (
  77      -    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
  78      -    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo)
       77 +    ACPI_GPE_EVENT_INFO     *GpeEventInfo)
  79   78  {
  80   79  
  81   80      return ((UINT32) 1 <<
  82      -        (GpeEventInfo->GpeNumber - GpeRegisterInfo->BaseGpeNumber));
       81 +        (GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber));
  83   82  }
  84   83  
  85   84  
  86   85  /******************************************************************************
  87   86   *
  88   87   * FUNCTION:    AcpiHwLowSetGpe
  89   88   *
  90   89   * PARAMETERS:  GpeEventInfo        - Info block for the GPE to be disabled
  91   90   *              Action              - Enable or disable
  92   91   *
↓ open down ↓ 28 lines elided ↑ open up ↑
 121  120      /* Get current value of the enable register that contains this GPE */
 122  121  
 123  122      Status = AcpiHwRead (&EnableMask, &GpeRegisterInfo->EnableAddress);
 124  123      if (ACPI_FAILURE (Status))
 125  124      {
 126  125          return (Status);
 127  126      }
 128  127  
 129  128      /* Set or clear just the bit that corresponds to this GPE */
 130  129  
 131      -    RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
      130 +    RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
 132  131      switch (Action)
 133  132      {
 134  133      case ACPI_GPE_CONDITIONAL_ENABLE:
 135  134  
 136  135          /* Only enable if the EnableForRun bit is set */
 137  136  
 138  137          if (!(RegisterBit & GpeRegisterInfo->EnableForRun))
 139  138          {
 140  139              return (AE_BAD_PARAMETER);
 141  140          }
 142  141  
 143  142          /*lint -fallthrough */
 144  143  
 145  144      case ACPI_GPE_ENABLE:
      145 +
 146  146          ACPI_SET_BIT (EnableMask, RegisterBit);
 147  147          break;
 148  148  
 149  149      case ACPI_GPE_DISABLE:
      150 +
 150  151          ACPI_CLEAR_BIT (EnableMask, RegisterBit);
 151  152          break;
 152  153  
 153  154      default:
 154      -        ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u\n", Action));
      155 +
      156 +        ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u", Action));
 155  157          return (AE_BAD_PARAMETER);
 156  158      }
 157  159  
 158  160      /* Write the updated enable mask */
 159  161  
 160  162      Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
 161  163      return (Status);
 162  164  }
 163  165  
 164  166  
↓ open down ↓ 25 lines elided ↑ open up ↑
 190  192      GpeRegisterInfo = GpeEventInfo->RegisterInfo;
 191  193      if (!GpeRegisterInfo)
 192  194      {
 193  195          return (AE_NOT_EXIST);
 194  196      }
 195  197  
 196  198      /*
 197  199       * Write a one to the appropriate bit in the status register to
 198  200       * clear this GPE.
 199  201       */
 200      -    RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
      202 +    RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
 201  203  
 202  204      Status = AcpiHwWrite (RegisterBit,
 203  205                      &GpeRegisterInfo->StatusAddress);
 204  206  
 205  207      return (Status);
 206  208  }
 207  209  
 208  210  
 209  211  /******************************************************************************
 210  212   *
↓ open down ↓ 27 lines elided ↑ open up ↑
 238  240      {
 239  241          return (AE_BAD_PARAMETER);
 240  242      }
 241  243  
 242  244      /* Get the info block for the entire GPE register */
 243  245  
 244  246      GpeRegisterInfo = GpeEventInfo->RegisterInfo;
 245  247  
 246  248      /* Get the register bitmask for this GPE */
 247  249  
 248      -    RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
      250 +    RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
 249  251  
 250  252      /* GPE currently enabled? (enabled for runtime?) */
 251  253  
 252  254      if (RegisterBit & GpeRegisterInfo->EnableForRun)
 253  255      {
 254  256          LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
 255  257      }
 256  258  
 257  259      /* GPE enabled for wake? */
 258  260  
↓ open down ↓ 272 lines elided ↑ open up ↑
 531  533      ACPI_STATUS             Status;
 532  534  
 533  535  
 534  536      ACPI_FUNCTION_TRACE (HwEnableAllWakeupGpes);
 535  537  
 536  538  
 537  539      Status = AcpiEvWalkGpeList (AcpiHwEnableWakeupGpeBlock, NULL);
 538  540      return_ACPI_STATUS (Status);
 539  541  }
 540  542  
      543 +#endif /* !ACPI_REDUCED_HARDWARE */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX