Print this page
update to acpica-unix2-20140114
update to acpica-unix2-20131218
acpica-unix2-20130823
PANKOVs restructure

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/events/evgpeblk.c
          +++ new/usr/src/common/acpica/components/events/evgpeblk.c
   1    1  /******************************************************************************
   2    2   *
   3    3   * Module Name: evgpeblk - GPE block creation and initialization.
   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 ↓ 23 lines elided ↑ open up ↑
  42   42   */
  43   43  
  44   44  #include "acpi.h"
  45   45  #include "accommon.h"
  46   46  #include "acevents.h"
  47   47  #include "acnamesp.h"
  48   48  
  49   49  #define _COMPONENT          ACPI_EVENTS
  50   50          ACPI_MODULE_NAME    ("evgpeblk")
  51   51  
       52 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
       53 +
  52   54  /* Local prototypes */
  53   55  
  54   56  static ACPI_STATUS
  55   57  AcpiEvInstallGpeBlock (
  56   58      ACPI_GPE_BLOCK_INFO     *GpeBlock,
  57   59      UINT32                  InterruptNumber);
  58   60  
  59   61  static ACPI_STATUS
  60   62  AcpiEvCreateGpeInfoBlocks (
  61   63      ACPI_GPE_BLOCK_INFO     *GpeBlock);
↓ open down ↓ 26 lines elided ↑ open up ↑
  88   90  
  89   91      ACPI_FUNCTION_TRACE (EvInstallGpeBlock);
  90   92  
  91   93  
  92   94      Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
  93   95      if (ACPI_FAILURE (Status))
  94   96      {
  95   97          return_ACPI_STATUS (Status);
  96   98      }
  97   99  
  98      -    GpeXruptBlock = AcpiEvGetGpeXruptBlock (InterruptNumber);
  99      -    if (!GpeXruptBlock)
      100 +    Status = AcpiEvGetGpeXruptBlock (InterruptNumber, &GpeXruptBlock);
      101 +    if (ACPI_FAILURE (Status))
 100  102      {
 101      -        Status = AE_NO_MEMORY;
 102  103          goto UnlockAndExit;
 103  104      }
 104  105  
 105  106      /* Install the new block at the end of the list with lock */
 106  107  
 107  108      Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 108  109      if (GpeXruptBlock->GpeBlockListHead)
 109  110      {
 110  111          NextGpeBlock = GpeXruptBlock->GpeBlockListHead;
 111  112          while (NextGpeBlock->Next)
↓ open down ↓ 7 lines elided ↑ open up ↑
 119  120      else
 120  121      {
 121  122          GpeXruptBlock->GpeBlockListHead = GpeBlock;
 122  123      }
 123  124  
 124  125      GpeBlock->XruptBlock = GpeXruptBlock;
 125  126      AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
 126  127  
 127  128  
 128  129  UnlockAndExit:
 129      -    Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
      130 +    (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
 130  131      return_ACPI_STATUS (Status);
 131  132  }
 132  133  
 133  134  
 134  135  /*******************************************************************************
 135  136   *
 136  137   * FUNCTION:    AcpiEvDeleteGpeBlock
 137  138   *
 138  139   * PARAMETERS:  GpeBlock            - Existing GPE block
 139  140   *
↓ open down ↓ 271 lines elided ↑ open up ↑
 411  412      {
 412  413          ACPI_FREE (GpeBlock);
 413  414          return_ACPI_STATUS (Status);
 414  415      }
 415  416  
 416  417      /* Install the new block in the global lists */
 417  418  
 418  419      Status = AcpiEvInstallGpeBlock (GpeBlock, InterruptNumber);
 419  420      if (ACPI_FAILURE (Status))
 420  421      {
      422 +        ACPI_FREE (GpeBlock->RegisterInfo);
      423 +        ACPI_FREE (GpeBlock->EventInfo);
 421  424          ACPI_FREE (GpeBlock);
 422  425          return_ACPI_STATUS (Status);
 423  426      }
 424  427  
 425  428      AcpiGbl_AllGpesInitialized = FALSE;
 426  429  
 427  430      /* Find all GPE methods (_Lxx or_Exx) for this block */
 428  431  
 429  432      WalkInfo.GpeBlock = GpeBlock;
 430  433      WalkInfo.GpeDevice = GpeDevice;
↓ open down ↓ 3 lines elided ↑ open up ↑
 434  437                  ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
 435  438                  AcpiEvMatchGpeMethod, NULL, &WalkInfo, NULL);
 436  439  
 437  440      /* Return the new block */
 438  441  
 439  442      if (ReturnGpeBlock)
 440  443      {
 441  444          (*ReturnGpeBlock) = GpeBlock;
 442  445      }
 443  446  
 444      -    ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
 445      -        "GPE %02X to %02X [%4.4s] %u regs on int 0x%X\n",
      447 +    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
      448 +        "    Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X\n",
 446  449          (UINT32) GpeBlock->BlockBaseNumber,
 447  450          (UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
 448  451          GpeDevice->Name.Ascii, GpeBlock->RegisterCount,
 449  452          InterruptNumber));
 450  453  
 451  454      /* Update global count of currently available GPEs */
 452  455  
 453  456      AcpiCurrentGpeCount += GpeBlock->GpeCount;
 454  457      return_ACPI_STATUS (AE_OK);
 455  458  }
↓ open down ↓ 74 lines elided ↑ open up ↑
 530  533                      GpeIndex + GpeBlock->BlockBaseNumber));
 531  534                  continue;
 532  535              }
 533  536  
 534  537              GpeEnabledCount++;
 535  538          }
 536  539      }
 537  540  
 538  541      if (GpeEnabledCount)
 539  542      {
 540      -        ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
 541      -            "Enabled %u GPEs in this block\n", GpeEnabledCount));
      543 +        ACPI_INFO ((AE_INFO,
      544 +            "Enabled %u GPEs in block %02X to %02X", GpeEnabledCount,
      545 +            (UINT32) GpeBlock->BlockBaseNumber,
      546 +            (UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1))));
 542  547      }
 543  548  
 544  549      GpeBlock->Initialized = TRUE;
 545  550      return_ACPI_STATUS (AE_OK);
 546  551  }
 547  552  
      553 +#endif /* !ACPI_REDUCED_HARDWARE */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX