ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

evsci.c
Go to the documentation of this file.
00001 /*******************************************************************************
00002  *
00003  * Module Name: evsci - System Control Interrupt configuration and
00004  *                      legacy to ACPI mode state transition functions
00005  *
00006  ******************************************************************************/
00007 
00008 /******************************************************************************
00009  *
00010  * 1. Copyright Notice
00011  *
00012  * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
00013  * All rights reserved.
00014  *
00015  * 2. License
00016  *
00017  * 2.1. This is your license from Intel Corp. under its intellectual property
00018  * rights.  You may have additional license terms from the party that provided
00019  * you this software, covering your right to use that party's intellectual
00020  * property rights.
00021  *
00022  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
00023  * copy of the source code appearing in this file ("Covered Code") an
00024  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
00025  * base code distributed originally by Intel ("Original Intel Code") to copy,
00026  * make derivatives, distribute, use and display any portion of the Covered
00027  * Code in any form, with the right to sublicense such rights; and
00028  *
00029  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
00030  * license (with the right to sublicense), under only those claims of Intel
00031  * patents that are infringed by the Original Intel Code, to make, use, sell,
00032  * offer to sell, and import the Covered Code and derivative works thereof
00033  * solely to the minimum extent necessary to exercise the above copyright
00034  * license, and in no event shall the patent license extend to any additions
00035  * to or modifications of the Original Intel Code.  No other license or right
00036  * is granted directly or by implication, estoppel or otherwise;
00037  *
00038  * The above copyright and patent license is granted only if the following
00039  * conditions are met:
00040  *
00041  * 3. Conditions
00042  *
00043  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
00044  * Redistribution of source code of any substantial portion of the Covered
00045  * Code or modification with rights to further distribute source must include
00046  * the above Copyright Notice, the above License, this list of Conditions,
00047  * and the following Disclaimer and Export Compliance provision.  In addition,
00048  * Licensee must cause all Covered Code to which Licensee contributes to
00049  * contain a file documenting the changes Licensee made to create that Covered
00050  * Code and the date of any change.  Licensee must include in that file the
00051  * documentation of any changes made by any predecessor Licensee.  Licensee
00052  * must include a prominent statement that the modification is derived,
00053  * directly or indirectly, from Original Intel Code.
00054  *
00055  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
00056  * Redistribution of source code of any substantial portion of the Covered
00057  * Code or modification without rights to further distribute source must
00058  * include the following Disclaimer and Export Compliance provision in the
00059  * documentation and/or other materials provided with distribution.  In
00060  * addition, Licensee may not authorize further sublicense of source of any
00061  * portion of the Covered Code, and must include terms to the effect that the
00062  * license from Licensee to its licensee is limited to the intellectual
00063  * property embodied in the software Licensee provides to its licensee, and
00064  * not to intellectual property embodied in modifications its licensee may
00065 
00066  * make.
00067  *
00068  * 3.3. Redistribution of Executable. Redistribution in executable form of any
00069  * substantial portion of the Covered Code or modification must reproduce the
00070  * above Copyright Notice, and the following Disclaimer and Export Compliance
00071  * provision in the documentation and/or other materials provided with the
00072  * distribution.
00073  *
00074  * 3.4. Intel retains all right, title, and interest in and to the Original
00075  * Intel Code.
00076  *
00077  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
00078  * Intel shall be used in advertising or otherwise to promote the sale, use or
00079  * other dealings in products derived from or relating to the Covered Code
00080  * without prior written authorization from Intel.
00081  *
00082  * 4. Disclaimer and Export Compliance
00083  *
00084  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
00085  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
00086  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
00087  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
00088  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
00089  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
00090  * PARTICULAR PURPOSE.
00091  *
00092  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
00093  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
00094  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
00095  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
00096  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
00097  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
00098  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
00099  * LIMITED REMEDY.
00100  *
00101  * 4.3. Licensee shall not export, either directly or indirectly, any of this
00102  * software or system incorporating such software without first obtaining any
00103  * required license or other approval from the U. S. Department of Commerce or
00104  * any other agency or department of the United States Government.  In the
00105  * event Licensee exports any such software from the United States or
00106  * re-exports any such software from a foreign destination, Licensee shall
00107  * ensure that the distribution and export/re-export of the software is in
00108  * compliance with all laws, regulations, orders, or other restrictions of the
00109  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
00110  * any of its subsidiaries will export/re-export any technical data, process,
00111  * software, or service, directly or indirectly, to any country for which the
00112  * United States government or any agency thereof requires an export license,
00113  * other governmental approval, or letter of assurance, without first obtaining
00114  * such license, approval or letter.
00115  *
00116  *****************************************************************************/
00117 
00118 #include "acpi.h"
00119 #include "accommon.h"
00120 #include "acevents.h"
00121 
00122 
00123 #define _COMPONENT          ACPI_EVENTS
00124         ACPI_MODULE_NAME    ("evsci")
00125 
00126 /* Local prototypes */
00127 
00128 static UINT32 ACPI_SYSTEM_XFACE
00129 AcpiEvSciXruptHandler (
00130     void                    *Context);
00131 
00132 
00133 /*******************************************************************************
00134  *
00135  * FUNCTION:    AcpiEvSciXruptHandler
00136  *
00137  * PARAMETERS:  Context   - Calling Context
00138  *
00139  * RETURN:      Status code indicates whether interrupt was handled.
00140  *
00141  * DESCRIPTION: Interrupt handler that will figure out what function or
00142  *              control method to call to deal with a SCI.
00143  *
00144  ******************************************************************************/
00145 
00146 static UINT32 ACPI_SYSTEM_XFACE
00147 AcpiEvSciXruptHandler (
00148     void                    *Context)
00149 {
00150     ACPI_GPE_XRUPT_INFO     *GpeXruptList = Context;
00151     UINT32                  InterruptHandled = ACPI_INTERRUPT_NOT_HANDLED;
00152 
00153 
00154     ACPI_FUNCTION_TRACE (EvSciXruptHandler);
00155 
00156 
00157     /*
00158      * We are guaranteed by the ACPI CA initialization/shutdown code that
00159      * if this interrupt handler is installed, ACPI is enabled.
00160      */
00161 
00162     /*
00163      * Fixed Events:
00164      * Check for and dispatch any Fixed Events that have occurred
00165      */
00166     InterruptHandled |= AcpiEvFixedEventDetect ();
00167 
00168     /*
00169      * General Purpose Events:
00170      * Check for and dispatch any GPEs that have occurred
00171      */
00172     InterruptHandled |= AcpiEvGpeDetect (GpeXruptList);
00173 
00174     AcpiSciCount++;
00175     return_UINT32 (InterruptHandled);
00176 }
00177 
00178 
00179 /*******************************************************************************
00180  *
00181  * FUNCTION:    AcpiEvGpeXruptHandler
00182  *
00183  * PARAMETERS:  Context   - Calling Context
00184  *
00185  * RETURN:      Status code indicates whether interrupt was handled.
00186  *
00187  * DESCRIPTION: Handler for GPE Block Device interrupts
00188  *
00189  ******************************************************************************/
00190 
00191 UINT32 ACPI_SYSTEM_XFACE
00192 AcpiEvGpeXruptHandler (
00193     void                    *Context)
00194 {
00195     ACPI_GPE_XRUPT_INFO     *GpeXruptList = Context;
00196     UINT32                  InterruptHandled = ACPI_INTERRUPT_NOT_HANDLED;
00197 
00198 
00199     ACPI_FUNCTION_TRACE (EvGpeXruptHandler);
00200 
00201 
00202     /*
00203      * We are guaranteed by the ACPI CA initialization/shutdown code that
00204      * if this interrupt handler is installed, ACPI is enabled.
00205      */
00206 
00207     /* GPEs: Check for and dispatch any GPEs that have occurred */
00208 
00209     InterruptHandled |= AcpiEvGpeDetect (GpeXruptList);
00210 
00211     return_UINT32 (InterruptHandled);
00212 }
00213 
00214 
00215 /******************************************************************************
00216  *
00217  * FUNCTION:    AcpiEvInstallSciHandler
00218  *
00219  * PARAMETERS:  none
00220  *
00221  * RETURN:      Status
00222  *
00223  * DESCRIPTION: Installs SCI handler.
00224  *
00225  ******************************************************************************/
00226 
00227 UINT32
00228 AcpiEvInstallSciHandler (
00229     void)
00230 {
00231     UINT32                  Status = AE_OK;
00232 
00233 
00234     ACPI_FUNCTION_TRACE (EvInstallSciHandler);
00235 
00236 
00237     Status = AcpiOsInstallInterruptHandler ((UINT32) AcpiGbl_FADT.SciInterrupt,
00238                 AcpiEvSciXruptHandler, AcpiGbl_GpeXruptListHead);
00239     return_ACPI_STATUS (Status);
00240 }
00241 
00242 
00243 /******************************************************************************
00244  *
00245  * FUNCTION:    AcpiEvRemoveSciHandler
00246  *
00247  * PARAMETERS:  none
00248  *
00249  * RETURN:      E_OK if handler uninstalled OK, E_ERROR if handler was not
00250  *              installed to begin with
00251  *
00252  * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be
00253  *              taken.
00254  *
00255  * Note:  It doesn't seem important to disable all events or set the event
00256  *        enable registers to their original values. The OS should disable
00257  *        the SCI interrupt level when the handler is removed, so no more
00258  *        events will come in.
00259  *
00260  ******************************************************************************/
00261 
00262 ACPI_STATUS
00263 AcpiEvRemoveSciHandler (
00264     void)
00265 {
00266     ACPI_STATUS             Status;
00267 
00268 
00269     ACPI_FUNCTION_TRACE (EvRemoveSciHandler);
00270 
00271 
00272     /* Just let the OS remove the handler and disable the level */
00273 
00274     Status = AcpiOsRemoveInterruptHandler ((UINT32) AcpiGbl_FADT.SciInterrupt,
00275                 AcpiEvSciXruptHandler);
00276 
00277     return_ACPI_STATUS (Status);
00278 }
00279 
00280 

Generated on Thu May 24 2012 04:27:46 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.