hwgpe.c revision 91116
171867Smsmith
267754Smsmith/******************************************************************************
367754Smsmith *
467754Smsmith * Module Name: hwgpe - Low level GPE enable/disable/clear functions
591116Smsmith *              $Revision: 39 $
667754Smsmith *
767754Smsmith *****************************************************************************/
867754Smsmith
967754Smsmith/******************************************************************************
1067754Smsmith *
1167754Smsmith * 1. Copyright Notice
1267754Smsmith *
1391116Smsmith * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
1470243Smsmith * All rights reserved.
1567754Smsmith *
1667754Smsmith * 2. License
1767754Smsmith *
1867754Smsmith * 2.1. This is your license from Intel Corp. under its intellectual property
1967754Smsmith * rights.  You may have additional license terms from the party that provided
2067754Smsmith * you this software, covering your right to use that party's intellectual
2167754Smsmith * property rights.
2267754Smsmith *
2367754Smsmith * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
2467754Smsmith * copy of the source code appearing in this file ("Covered Code") an
2567754Smsmith * irrevocable, perpetual, worldwide license under Intel's copyrights in the
2667754Smsmith * base code distributed originally by Intel ("Original Intel Code") to copy,
2767754Smsmith * make derivatives, distribute, use and display any portion of the Covered
2867754Smsmith * Code in any form, with the right to sublicense such rights; and
2967754Smsmith *
3067754Smsmith * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
3167754Smsmith * license (with the right to sublicense), under only those claims of Intel
3267754Smsmith * patents that are infringed by the Original Intel Code, to make, use, sell,
3367754Smsmith * offer to sell, and import the Covered Code and derivative works thereof
3467754Smsmith * solely to the minimum extent necessary to exercise the above copyright
3567754Smsmith * license, and in no event shall the patent license extend to any additions
3667754Smsmith * to or modifications of the Original Intel Code.  No other license or right
3767754Smsmith * is granted directly or by implication, estoppel or otherwise;
3867754Smsmith *
3967754Smsmith * The above copyright and patent license is granted only if the following
4067754Smsmith * conditions are met:
4167754Smsmith *
4267754Smsmith * 3. Conditions
4367754Smsmith *
4467754Smsmith * 3.1. Redistribution of Source with Rights to Further Distribute Source.
4567754Smsmith * Redistribution of source code of any substantial portion of the Covered
4667754Smsmith * Code or modification with rights to further distribute source must include
4767754Smsmith * the above Copyright Notice, the above License, this list of Conditions,
4867754Smsmith * and the following Disclaimer and Export Compliance provision.  In addition,
4967754Smsmith * Licensee must cause all Covered Code to which Licensee contributes to
5067754Smsmith * contain a file documenting the changes Licensee made to create that Covered
5167754Smsmith * Code and the date of any change.  Licensee must include in that file the
5267754Smsmith * documentation of any changes made by any predecessor Licensee.  Licensee
5367754Smsmith * must include a prominent statement that the modification is derived,
5467754Smsmith * directly or indirectly, from Original Intel Code.
5567754Smsmith *
5667754Smsmith * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
5767754Smsmith * Redistribution of source code of any substantial portion of the Covered
5867754Smsmith * Code or modification without rights to further distribute source must
5967754Smsmith * include the following Disclaimer and Export Compliance provision in the
6067754Smsmith * documentation and/or other materials provided with distribution.  In
6167754Smsmith * addition, Licensee may not authorize further sublicense of source of any
6267754Smsmith * portion of the Covered Code, and must include terms to the effect that the
6367754Smsmith * license from Licensee to its licensee is limited to the intellectual
6467754Smsmith * property embodied in the software Licensee provides to its licensee, and
6567754Smsmith * not to intellectual property embodied in modifications its licensee may
6667754Smsmith * make.
6767754Smsmith *
6867754Smsmith * 3.3. Redistribution of Executable. Redistribution in executable form of any
6967754Smsmith * substantial portion of the Covered Code or modification must reproduce the
7067754Smsmith * above Copyright Notice, and the following Disclaimer and Export Compliance
7167754Smsmith * provision in the documentation and/or other materials provided with the
7267754Smsmith * distribution.
7367754Smsmith *
7467754Smsmith * 3.4. Intel retains all right, title, and interest in and to the Original
7567754Smsmith * Intel Code.
7667754Smsmith *
7767754Smsmith * 3.5. Neither the name Intel nor any other trademark owned or controlled by
7867754Smsmith * Intel shall be used in advertising or otherwise to promote the sale, use or
7967754Smsmith * other dealings in products derived from or relating to the Covered Code
8067754Smsmith * without prior written authorization from Intel.
8167754Smsmith *
8267754Smsmith * 4. Disclaimer and Export Compliance
8367754Smsmith *
8467754Smsmith * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
8567754Smsmith * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
8667754Smsmith * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
8767754Smsmith * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
8867754Smsmith * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
8967754Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
9067754Smsmith * PARTICULAR PURPOSE.
9167754Smsmith *
9267754Smsmith * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
9367754Smsmith * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
9467754Smsmith * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
9567754Smsmith * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
9667754Smsmith * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
9767754Smsmith * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
9867754Smsmith * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
9967754Smsmith * LIMITED REMEDY.
10067754Smsmith *
10167754Smsmith * 4.3. Licensee shall not export, either directly or indirectly, any of this
10267754Smsmith * software or system incorporating such software without first obtaining any
10367754Smsmith * required license or other approval from the U. S. Department of Commerce or
10467754Smsmith * any other agency or department of the United States Government.  In the
10567754Smsmith * event Licensee exports any such software from the United States or
10667754Smsmith * re-exports any such software from a foreign destination, Licensee shall
10767754Smsmith * ensure that the distribution and export/re-export of the software is in
10867754Smsmith * compliance with all laws, regulations, orders, or other restrictions of the
10967754Smsmith * U.S. Export Administration Regulations. Licensee agrees that neither it nor
11067754Smsmith * any of its subsidiaries will export/re-export any technical data, process,
11167754Smsmith * software, or service, directly or indirectly, to any country for which the
11267754Smsmith * United States government or any agency thereof requires an export license,
11367754Smsmith * other governmental approval, or letter of assurance, without first obtaining
11467754Smsmith * such license, approval or letter.
11567754Smsmith *
11667754Smsmith *****************************************************************************/
11767754Smsmith
11867754Smsmith#include "acpi.h"
11967754Smsmith#include "achware.h"
12067754Smsmith#include "acnamesp.h"
12167754Smsmith#include "acevents.h"
12267754Smsmith
12377424Smsmith#define _COMPONENT          ACPI_HARDWARE
12491116Smsmith        ACPI_MODULE_NAME    ("hwgpe")
12567754Smsmith
12667754Smsmith
12767754Smsmith/******************************************************************************
12867754Smsmith *
12991116Smsmith * FUNCTION:    AcpiHwGetGpeBitMask
13091116Smsmith *
13191116Smsmith * PARAMETERS:  GpeNumber       - The GPE
13291116Smsmith *
13391116Smsmith * RETURN:      Gpe register bitmask for this gpe level
13491116Smsmith *
13591116Smsmith * DESCRIPTION: Get the bitmask for this GPE
13691116Smsmith *
13791116Smsmith ******************************************************************************/
13891116Smsmith
13991116SmsmithUINT32
14091116SmsmithAcpiHwGetGpeBitMask (
14191116Smsmith    UINT32                  GpeNumber)
14291116Smsmith{
14391116Smsmith    return (AcpiGbl_GpeNumberInfo [AcpiEvGetGpeNumberIndex (GpeNumber)].BitMask);
14491116Smsmith}
14591116Smsmith
14691116Smsmith
14791116Smsmith/******************************************************************************
14891116Smsmith *
14967754Smsmith * FUNCTION:    AcpiHwEnableGpe
15067754Smsmith *
15167754Smsmith * PARAMETERS:  GpeNumber       - The GPE
15267754Smsmith *
15367754Smsmith * RETURN:      None
15467754Smsmith *
15567754Smsmith * DESCRIPTION: Enable a single GPE.
15667754Smsmith *
15767754Smsmith ******************************************************************************/
15867754Smsmith
15967754Smsmithvoid
16067754SmsmithAcpiHwEnableGpe (
16167754Smsmith    UINT32                  GpeNumber)
16267754Smsmith{
16380062Smsmith    UINT32                  InByte;
16467754Smsmith    UINT32                  RegisterIndex;
16580062Smsmith    UINT32                  BitMask;
16667754Smsmith
16783174Smsmith
16891116Smsmith    ACPI_FUNCTION_ENTRY ();
16983174Smsmith
17083174Smsmith
17191116Smsmith    /* Translate GPE number to index into global registers array. */
17267754Smsmith
17391116Smsmith    RegisterIndex = AcpiEvGetGpeRegisterIndex (GpeNumber);
17467754Smsmith
17591116Smsmith    /* Get the register bitmask for this GPE */
17691116Smsmith
17791116Smsmith    BitMask = AcpiHwGetGpeBitMask (GpeNumber);
17891116Smsmith
17967754Smsmith    /*
18067754Smsmith     * Read the current value of the register, set the appropriate bit
18167754Smsmith     * to enable the GPE, and write out the new register.
18267754Smsmith     */
18380062Smsmith    InByte = 0;
18491116Smsmith    AcpiOsReadPort  (AcpiGbl_GpeRegisterInfo[RegisterIndex].EnableAddr, &InByte, 8);
18591116Smsmith    AcpiOsWritePort (AcpiGbl_GpeRegisterInfo[RegisterIndex].EnableAddr,
18691116Smsmith                    (InByte | BitMask), 8);
18767754Smsmith}
18867754Smsmith
18991116Smsmith
19084491Smsmith/******************************************************************************
19184491Smsmith *
19284491Smsmith * FUNCTION:    AcpiHwEnableGpeForWakeup
19384491Smsmith *
19484491Smsmith * PARAMETERS:  GpeNumber       - The GPE
19584491Smsmith *
19684491Smsmith * RETURN:      None
19784491Smsmith *
19884491Smsmith * DESCRIPTION: Keep track of which GPEs the OS has requested not be
19984491Smsmith *              disabled when going to sleep.
20084491Smsmith *
20184491Smsmith ******************************************************************************/
20267754Smsmith
20384491Smsmithvoid
20484491SmsmithAcpiHwEnableGpeForWakeup (
20584491Smsmith    UINT32                  GpeNumber)
20684491Smsmith{
20784491Smsmith    UINT32                  RegisterIndex;
20884491Smsmith    UINT32                  BitMask;
20984491Smsmith
21084491Smsmith
21191116Smsmith    ACPI_FUNCTION_ENTRY ();
21284491Smsmith
21384491Smsmith
21491116Smsmith    /* Translate GPE number to index into global registers array. */
21584491Smsmith
21691116Smsmith    RegisterIndex = AcpiEvGetGpeRegisterIndex (GpeNumber);
21784491Smsmith
21891116Smsmith    /* Get the register bitmask for this GPE */
21991116Smsmith
22091116Smsmith    BitMask = AcpiHwGetGpeBitMask (GpeNumber);
22191116Smsmith
22284491Smsmith    /*
22384491Smsmith     * Set the bit so we will not disable this when sleeping
22484491Smsmith     */
22591116Smsmith    AcpiGbl_GpeRegisterInfo[RegisterIndex].WakeEnable |= BitMask;
22684491Smsmith}
22784491Smsmith
22891116Smsmith
22967754Smsmith/******************************************************************************
23067754Smsmith *
23167754Smsmith * FUNCTION:    AcpiHwDisableGpe
23267754Smsmith *
23367754Smsmith * PARAMETERS:  GpeNumber       - The GPE
23467754Smsmith *
23567754Smsmith * RETURN:      None
23667754Smsmith *
23767754Smsmith * DESCRIPTION: Disable a single GPE.
23867754Smsmith *
23967754Smsmith ******************************************************************************/
24067754Smsmith
24167754Smsmithvoid
24267754SmsmithAcpiHwDisableGpe (
24367754Smsmith    UINT32                  GpeNumber)
24467754Smsmith{
24580062Smsmith    UINT32                  InByte;
24667754Smsmith    UINT32                  RegisterIndex;
24780062Smsmith    UINT32                  BitMask;
24867754Smsmith
24983174Smsmith
25091116Smsmith    ACPI_FUNCTION_ENTRY ();
25183174Smsmith
25283174Smsmith
25391116Smsmith    /* Translate GPE number to index into global registers array. */
25467754Smsmith
25591116Smsmith    RegisterIndex = AcpiEvGetGpeRegisterIndex (GpeNumber);
25667754Smsmith
25791116Smsmith    /* Get the register bitmask for this GPE */
25891116Smsmith
25991116Smsmith    BitMask = AcpiHwGetGpeBitMask (GpeNumber);
26091116Smsmith
26167754Smsmith    /*
26267754Smsmith     * Read the current value of the register, clear the appropriate bit,
26367754Smsmith     * and write out the new register value to disable the GPE.
26467754Smsmith     */
26580062Smsmith    InByte = 0;
26691116Smsmith    AcpiOsReadPort (AcpiGbl_GpeRegisterInfo[RegisterIndex].EnableAddr, &InByte, 8);
26791116Smsmith    AcpiOsWritePort (AcpiGbl_GpeRegisterInfo[RegisterIndex].EnableAddr,
26880062Smsmith                (InByte & ~BitMask), 8);
26984491Smsmith
27084491Smsmith    AcpiHwDisableGpeForWakeup(GpeNumber);
27167754Smsmith}
27267754Smsmith
27391116Smsmith
27484491Smsmith/******************************************************************************
27584491Smsmith *
27684491Smsmith * FUNCTION:    AcpiHwDisableGpeForWakeup
27784491Smsmith *
27884491Smsmith * PARAMETERS:  GpeNumber       - The GPE
27984491Smsmith *
28084491Smsmith * RETURN:      None
28184491Smsmith *
28284491Smsmith * DESCRIPTION: Keep track of which GPEs the OS has requested not be
28384491Smsmith *              disabled when going to sleep.
28484491Smsmith *
28584491Smsmith ******************************************************************************/
28667754Smsmith
28784491Smsmithvoid
28884491SmsmithAcpiHwDisableGpeForWakeup (
28984491Smsmith    UINT32                  GpeNumber)
29084491Smsmith{
29184491Smsmith    UINT32                  RegisterIndex;
29284491Smsmith    UINT32                  BitMask;
29384491Smsmith
29484491Smsmith
29591116Smsmith    ACPI_FUNCTION_ENTRY ();
29684491Smsmith
29784491Smsmith
29891116Smsmith    /* Translate GPE number to index into global registers array. */
29984491Smsmith
30091116Smsmith    RegisterIndex = AcpiEvGetGpeRegisterIndex (GpeNumber);
30184491Smsmith
30291116Smsmith    /* Get the register bitmask for this GPE */
30391116Smsmith
30491116Smsmith    BitMask = AcpiHwGetGpeBitMask (GpeNumber);
30591116Smsmith
30684491Smsmith    /*
30784491Smsmith     * Clear the bit so we will disable this when sleeping
30884491Smsmith     */
30991116Smsmith    AcpiGbl_GpeRegisterInfo[RegisterIndex].WakeEnable &= ~BitMask;
31084491Smsmith}
31184491Smsmith
31291116Smsmith
31367754Smsmith/******************************************************************************
31467754Smsmith *
31567754Smsmith * FUNCTION:    AcpiHwClearGpe
31667754Smsmith *
31767754Smsmith * PARAMETERS:  GpeNumber       - The GPE
31867754Smsmith *
31967754Smsmith * RETURN:      None
32067754Smsmith *
32167754Smsmith * DESCRIPTION: Clear a single GPE.
32267754Smsmith *
32367754Smsmith ******************************************************************************/
32467754Smsmith
32567754Smsmithvoid
32667754SmsmithAcpiHwClearGpe (
32767754Smsmith    UINT32                  GpeNumber)
32867754Smsmith{
32967754Smsmith    UINT32                  RegisterIndex;
33080062Smsmith    UINT32                  BitMask;
33167754Smsmith
33280062Smsmith
33391116Smsmith    ACPI_FUNCTION_ENTRY ();
33483174Smsmith
33583174Smsmith
33691116Smsmith    /* Translate GPE number to index into global registers array. */
33767754Smsmith
33891116Smsmith    RegisterIndex = AcpiEvGetGpeRegisterIndex (GpeNumber);
33967754Smsmith
34091116Smsmith    /* Get the register bitmask for this GPE */
34191116Smsmith
34291116Smsmith    BitMask = AcpiHwGetGpeBitMask (GpeNumber);
34391116Smsmith
34467754Smsmith    /*
34567754Smsmith     * Write a one to the appropriate bit in the status register to
34667754Smsmith     * clear this GPE.
34767754Smsmith     */
34891116Smsmith    AcpiOsWritePort (AcpiGbl_GpeRegisterInfo[RegisterIndex].StatusAddr, BitMask, 8);
34967754Smsmith}
35067754Smsmith
35167754Smsmith
35267754Smsmith/******************************************************************************
35367754Smsmith *
35467754Smsmith * FUNCTION:    AcpiHwGetGpeStatus
35567754Smsmith *
35667754Smsmith * PARAMETERS:  GpeNumber       - The GPE
35767754Smsmith *
35867754Smsmith * RETURN:      None
35967754Smsmith *
36067754Smsmith * DESCRIPTION: Return the status of a single GPE.
36167754Smsmith *
36267754Smsmith ******************************************************************************/
36367754Smsmith
36467754Smsmithvoid
36567754SmsmithAcpiHwGetGpeStatus (
36667754Smsmith    UINT32                  GpeNumber,
36767754Smsmith    ACPI_EVENT_STATUS       *EventStatus)
36867754Smsmith{
36980062Smsmith    UINT32                  InByte = 0;
37067754Smsmith    UINT32                  RegisterIndex = 0;
37180062Smsmith    UINT32                  BitMask = 0;
37291116Smsmith    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;
37367754Smsmith
37480062Smsmith
37591116Smsmith    ACPI_FUNCTION_ENTRY ();
37683174Smsmith
37783174Smsmith
37867754Smsmith    if (!EventStatus)
37967754Smsmith    {
38067754Smsmith        return;
38167754Smsmith    }
38267754Smsmith
38367754Smsmith    (*EventStatus) = 0;
38467754Smsmith
38591116Smsmith    /* Translate GPE number to index into global registers array. */
38667754Smsmith
38791116Smsmith    RegisterIndex = AcpiEvGetGpeRegisterIndex (GpeNumber);
38891116Smsmith    GpeRegisterInfo = &AcpiGbl_GpeRegisterInfo[RegisterIndex];
38967754Smsmith
39091116Smsmith    /* Get the register bitmask for this GPE */
39191116Smsmith
39291116Smsmith    BitMask = AcpiHwGetGpeBitMask (GpeNumber);
39391116Smsmith
39491116Smsmith    /* GPE Enabled? */
39591116Smsmith
39680062Smsmith    InByte = 0;
39791116Smsmith    AcpiOsReadPort (GpeRegisterInfo->EnableAddr, &InByte, 8);
39867754Smsmith    if (BitMask & InByte)
39967754Smsmith    {
40067754Smsmith        (*EventStatus) |= ACPI_EVENT_FLAG_ENABLED;
40167754Smsmith    }
40267754Smsmith
40391116Smsmith    /* GPE Enabled for wake? */
40491116Smsmith
40591116Smsmith    if (BitMask & GpeRegisterInfo->WakeEnable)
40684491Smsmith    {
40784491Smsmith        (*EventStatus) |= ACPI_EVENT_FLAG_WAKE_ENABLED;
40884491Smsmith    }
40984491Smsmith
41091116Smsmith    /* GPE active (set)? */
41191116Smsmith
41280062Smsmith    InByte = 0;
41391116Smsmith    AcpiOsReadPort (GpeRegisterInfo->StatusAddr, &InByte, 8);
41467754Smsmith    if (BitMask & InByte)
41567754Smsmith    {
41667754Smsmith        (*EventStatus) |= ACPI_EVENT_FLAG_SET;
41767754Smsmith    }
41867754Smsmith}
41984491Smsmith
42091116Smsmith
42184491Smsmith/******************************************************************************
42284491Smsmith *
42384491Smsmith * FUNCTION:    AcpiHwDisableNonWakeupGpes
42484491Smsmith *
42584491Smsmith * PARAMETERS:  None
42684491Smsmith *
42784491Smsmith * RETURN:      None
42884491Smsmith *
42984491Smsmith * DESCRIPTION: Disable all non-wakeup GPEs
43084491Smsmith *              Call with interrupts disabled. The interrupt handler also
43191116Smsmith *              modifies AcpiGbl_GpeRegisterInfo[i].Enable, so it should not be
43284491Smsmith *              given the chance to run until after non-wake GPEs are
43384491Smsmith *              re-enabled.
43484491Smsmith *
43584491Smsmith ******************************************************************************/
43684491Smsmith
43784491Smsmithvoid
43884491SmsmithAcpiHwDisableNonWakeupGpes (
43984491Smsmith    void)
44084491Smsmith{
44184491Smsmith    UINT32                  i;
44291116Smsmith    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;
44384491Smsmith
44484491Smsmith
44591116Smsmith    ACPI_FUNCTION_ENTRY ();
44691116Smsmith
44791116Smsmith
44884491Smsmith    for (i = 0; i < AcpiGbl_GpeRegisterCount; i++)
44984491Smsmith    {
45091116Smsmith        GpeRegisterInfo = &AcpiGbl_GpeRegisterInfo[i];
45191116Smsmith
45284491Smsmith        /*
45384491Smsmith         * Read the enabled status of all GPEs. We
45484491Smsmith         * will be using it to restore all the GPEs later.
45584491Smsmith         */
45691116Smsmith        AcpiOsReadPort (GpeRegisterInfo->EnableAddr,
45791116Smsmith                        &GpeRegisterInfo->Enable, 8);
45884491Smsmith
45984491Smsmith        /*
46091116Smsmith         * Disable all GPEs except wakeup GPEs.
46184491Smsmith         */
46291116Smsmith        AcpiOsWritePort(GpeRegisterInfo->EnableAddr,
46391116Smsmith                        GpeRegisterInfo->WakeEnable, 8);
46484491Smsmith    }
46584491Smsmith}
46684491Smsmith
46791116Smsmith
46884491Smsmith/******************************************************************************
46984491Smsmith *
47084491Smsmith * FUNCTION:    AcpiHwEnableNonWakeupGpes
47184491Smsmith *
47284491Smsmith * PARAMETERS:  None
47384491Smsmith *
47484491Smsmith * RETURN:      None
47584491Smsmith *
47684491Smsmith * DESCRIPTION: Enable all non-wakeup GPEs we previously enabled.
47784491Smsmith *
47884491Smsmith ******************************************************************************/
47984491Smsmith
48084491Smsmithvoid
48184491SmsmithAcpiHwEnableNonWakeupGpes (
48284491Smsmith    void)
48384491Smsmith{
48484491Smsmith    UINT32                  i;
48591116Smsmith    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;
48684491Smsmith
48784491Smsmith
48891116Smsmith    ACPI_FUNCTION_ENTRY ();
48991116Smsmith
49091116Smsmith
49184491Smsmith    for (i = 0; i < AcpiGbl_GpeRegisterCount; i++)
49284491Smsmith    {
49391116Smsmith        GpeRegisterInfo = &AcpiGbl_GpeRegisterInfo[i];
49491116Smsmith
49584491Smsmith        /*
49684491Smsmith         * We previously stored the enabled status of all GPEs.
49784491Smsmith         * Blast them back in.
49884491Smsmith         */
49991116Smsmith        AcpiOsWritePort(GpeRegisterInfo->EnableAddr,
50091116Smsmith                        GpeRegisterInfo->Enable, 8);
50184491Smsmith    }
50284491Smsmith}
503