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/evevent.c
          +++ new/usr/src/common/acpica/components/events/evevent.c
   1    1  /******************************************************************************
   2    2   *
   3    3   * Module Name: evevent - Fixed Event handling and dispatch
   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 ↓ 22 lines elided ↑ open up ↑
  41   41   * POSSIBILITY OF SUCH DAMAGES.
  42   42   */
  43   43  
  44   44  #include "acpi.h"
  45   45  #include "accommon.h"
  46   46  #include "acevents.h"
  47   47  
  48   48  #define _COMPONENT          ACPI_EVENTS
  49   49          ACPI_MODULE_NAME    ("evevent")
  50   50  
       51 +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
       52 +
  51   53  /* Local prototypes */
  52   54  
  53   55  static ACPI_STATUS
  54   56  AcpiEvFixedEventInitialize (
  55   57      void);
  56   58  
  57   59  static UINT32
  58   60  AcpiEvFixedEventDispatch (
  59   61      UINT32                  Event);
  60   62  
↓ open down ↓ 13 lines elided ↑ open up ↑
  74   76  ACPI_STATUS
  75   77  AcpiEvInitializeEvents (
  76   78      void)
  77   79  {
  78   80      ACPI_STATUS             Status;
  79   81  
  80   82  
  81   83      ACPI_FUNCTION_TRACE (EvInitializeEvents);
  82   84  
  83   85  
       86 +    /* If Hardware Reduced flag is set, there are no fixed events */
       87 +
       88 +    if (AcpiGbl_ReducedHardware)
       89 +    {
       90 +        return_ACPI_STATUS (AE_OK);
       91 +    }
       92 +
  84   93      /*
  85   94       * Initialize the Fixed and General Purpose Events. This is done prior to
  86   95       * enabling SCIs to prevent interrupts from occurring before the handlers
  87   96       * are installed.
  88   97       */
  89   98      Status = AcpiEvFixedEventInitialize ();
  90   99      if (ACPI_FAILURE (Status))
  91  100      {
  92  101          ACPI_EXCEPTION ((AE_INFO, Status,
  93  102              "Unable to initialize fixed events"));
↓ open down ↓ 27 lines elided ↑ open up ↑
 121  130  ACPI_STATUS
 122  131  AcpiEvInstallXruptHandlers (
 123  132      void)
 124  133  {
 125  134      ACPI_STATUS             Status;
 126  135  
 127  136  
 128  137      ACPI_FUNCTION_TRACE (EvInstallXruptHandlers);
 129  138  
 130  139  
      140 +    /* If Hardware Reduced flag is set, there is no ACPI h/w */
      141 +
      142 +    if (AcpiGbl_ReducedHardware)
      143 +    {
      144 +        return_ACPI_STATUS (AE_OK);
      145 +    }
      146 +
 131  147      /* Install the SCI handler */
 132  148  
 133  149      Status = AcpiEvInstallSciHandler ();
 134  150      if (ACPI_FAILURE (Status))
 135  151      {
 136  152          ACPI_EXCEPTION ((AE_INFO, Status,
 137  153              "Unable to install System Control Interrupt handler"));
 138  154          return_ACPI_STATUS (Status);
 139  155      }
 140  156  
↓ open down ↓ 127 lines elided ↑ open up ↑
 268  284  /*******************************************************************************
 269  285   *
 270  286   * FUNCTION:    AcpiEvFixedEventDispatch
 271  287   *
 272  288   * PARAMETERS:  Event               - Event type
 273  289   *
 274  290   * RETURN:      INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
 275  291   *
 276  292   * DESCRIPTION: Clears the status bit for the requested event, calls the
 277  293   *              handler that previously registered for the event.
      294 + *              NOTE: If there is no handler for the event, the event is
      295 + *              disabled to prevent further interrupts.
 278  296   *
 279  297   ******************************************************************************/
 280  298  
 281  299  static UINT32
 282  300  AcpiEvFixedEventDispatch (
 283  301      UINT32                  Event)
 284  302  {
 285  303  
 286  304      ACPI_FUNCTION_ENTRY ();
 287  305  
 288  306  
 289  307      /* Clear the status bit */
 290  308  
 291  309      (void) AcpiWriteBitRegister (
 292  310              AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
 293  311              ACPI_CLEAR_STATUS);
 294  312  
 295  313      /*
 296      -     * Make sure we've got a handler. If not, report an error. The event is
 297      -     * disabled to prevent further interrupts.
      314 +     * Make sure that a handler exists. If not, report an error
      315 +     * and disable the event to prevent further interrupts.
 298  316       */
 299      -    if (NULL == AcpiGbl_FixedEventHandlers[Event].Handler)
      317 +    if (!AcpiGbl_FixedEventHandlers[Event].Handler)
 300  318      {
 301  319          (void) AcpiWriteBitRegister (
 302  320                  AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
 303  321                  ACPI_DISABLE_EVENT);
 304  322  
 305  323          ACPI_ERROR ((AE_INFO,
 306      -            "No installed handler for fixed event [0x%08X]",
 307      -            Event));
      324 +            "No installed handler for fixed event - %s (%u), disabling",
      325 +            AcpiUtGetEventName (Event), Event));
 308  326  
 309  327          return (ACPI_INTERRUPT_NOT_HANDLED);
 310  328      }
 311  329  
 312  330      /* Invoke the Fixed Event handler */
 313  331  
 314  332      return ((AcpiGbl_FixedEventHandlers[Event].Handler)(
 315  333                  AcpiGbl_FixedEventHandlers[Event].Context));
 316  334  }
 317  335  
 318      -
      336 +#endif /* !ACPI_REDUCED_HARDWARE */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX