Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:03

0001 /******************************************************************************
0002  *
0003  * Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces
0004  *
0005  *****************************************************************************/
0006 
0007 /******************************************************************************
0008  *
0009  * 1. Copyright Notice
0010  *
0011  * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
0012  * All rights reserved.
0013  *
0014  * 2. License
0015  *
0016  * 2.1. This is your license from Intel Corp. under its intellectual property
0017  * rights. You may have additional license terms from the party that provided
0018  * you this software, covering your right to use that party's intellectual
0019  * property rights.
0020  *
0021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0022  * copy of the source code appearing in this file ("Covered Code") an
0023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0024  * base code distributed originally by Intel ("Original Intel Code") to copy,
0025  * make derivatives, distribute, use and display any portion of the Covered
0026  * Code in any form, with the right to sublicense such rights; and
0027  *
0028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0029  * license (with the right to sublicense), under only those claims of Intel
0030  * patents that are infringed by the Original Intel Code, to make, use, sell,
0031  * offer to sell, and import the Covered Code and derivative works thereof
0032  * solely to the minimum extent necessary to exercise the above copyright
0033  * license, and in no event shall the patent license extend to any additions
0034  * to or modifications of the Original Intel Code. No other license or right
0035  * is granted directly or by implication, estoppel or otherwise;
0036  *
0037  * The above copyright and patent license is granted only if the following
0038  * conditions are met:
0039  *
0040  * 3. Conditions
0041  *
0042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0043  * Redistribution of source code of any substantial portion of the Covered
0044  * Code or modification with rights to further distribute source must include
0045  * the above Copyright Notice, the above License, this list of Conditions,
0046  * and the following Disclaimer and Export Compliance provision. In addition,
0047  * Licensee must cause all Covered Code to which Licensee contributes to
0048  * contain a file documenting the changes Licensee made to create that Covered
0049  * Code and the date of any change. Licensee must include in that file the
0050  * documentation of any changes made by any predecessor Licensee. Licensee
0051  * must include a prominent statement that the modification is derived,
0052  * directly or indirectly, from Original Intel Code.
0053  *
0054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0055  * Redistribution of source code of any substantial portion of the Covered
0056  * Code or modification without rights to further distribute source must
0057  * include the following Disclaimer and Export Compliance provision in the
0058  * documentation and/or other materials provided with distribution. In
0059  * addition, Licensee may not authorize further sublicense of source of any
0060  * portion of the Covered Code, and must include terms to the effect that the
0061  * license from Licensee to its licensee is limited to the intellectual
0062  * property embodied in the software Licensee provides to its licensee, and
0063  * not to intellectual property embodied in modifications its licensee may
0064  * make.
0065  *
0066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0067  * substantial portion of the Covered Code or modification must reproduce the
0068  * above Copyright Notice, and the following Disclaimer and Export Compliance
0069  * provision in the documentation and/or other materials provided with the
0070  * distribution.
0071  *
0072  * 3.4. Intel retains all right, title, and interest in and to the Original
0073  * Intel Code.
0074  *
0075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0076  * Intel shall be used in advertising or otherwise to promote the sale, use or
0077  * other dealings in products derived from or relating to the Covered Code
0078  * without prior written authorization from Intel.
0079  *
0080  * 4. Disclaimer and Export Compliance
0081  *
0082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0083  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
0085  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
0086  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
0087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0088  * PARTICULAR PURPOSE.
0089  *
0090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
0096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0097  * LIMITED REMEDY.
0098  *
0099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0100  * software or system incorporating such software without first obtaining any
0101  * required license or other approval from the U. S. Department of Commerce or
0102  * any other agency or department of the United States Government. In the
0103  * event Licensee exports any such software from the United States or
0104  * re-exports any such software from a foreign destination, Licensee shall
0105  * ensure that the distribution and export/re-export of the software is in
0106  * compliance with all laws, regulations, orders, or other restrictions of the
0107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0108  * any of its subsidiaries will export/re-export any technical data, process,
0109  * software, or service, directly or indirectly, to any country for which the
0110  * United States government or any agency thereof requires an export license,
0111  * other governmental approval, or letter of assurance, without first obtaining
0112  * such license, approval or letter.
0113  *
0114  *****************************************************************************
0115  *
0116  * Alternatively, you may choose to be licensed under the terms of the
0117  * following license:
0118  *
0119  * Redistribution and use in source and binary forms, with or without
0120  * modification, are permitted provided that the following conditions
0121  * are met:
0122  * 1. Redistributions of source code must retain the above copyright
0123  *    notice, this list of conditions, and the following disclaimer,
0124  *    without modification.
0125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
0126  *    substantially similar to the "NO WARRANTY" disclaimer below
0127  *    ("Disclaimer") and any redistribution must be conditioned upon
0128  *    including a substantially similar Disclaimer requirement for further
0129  *    binary redistribution.
0130  * 3. Neither the names of the above-listed copyright holders nor the names
0131  *    of any contributors may be used to endorse or promote products derived
0132  *    from this software without specific prior written permission.
0133  *
0134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0145  *
0146  * Alternatively, you may choose to be licensed under the terms of the
0147  * GNU General Public License ("GPL") version 2 as published by the Free
0148  * Software Foundation.
0149  *
0150  *****************************************************************************/
0151 
0152 #define EXPORT_ACPI_INTERFACES
0153 
0154 #include "acpi.h"
0155 #include "accommon.h"
0156 
0157 #define _COMPONENT          ACPI_HARDWARE
0158         ACPI_MODULE_NAME    ("hwxfsleep")
0159 
0160 /* Local prototypes */
0161 
0162 #if (!ACPI_REDUCED_HARDWARE)
0163 static ACPI_STATUS
0164 AcpiHwSetFirmwareWakingVector (
0165     ACPI_TABLE_FACS         *Facs,
0166     ACPI_PHYSICAL_ADDRESS   PhysicalAddress,
0167     ACPI_PHYSICAL_ADDRESS   PhysicalAddress64);
0168 #endif
0169 
0170 static ACPI_STATUS
0171 AcpiHwSleepDispatch (
0172     UINT8                   SleepState,
0173     UINT32                  FunctionId);
0174 
0175 /*
0176  * Dispatch table used to efficiently branch to the various sleep
0177  * functions.
0178  */
0179 #define ACPI_SLEEP_FUNCTION_ID          0
0180 #define ACPI_WAKE_PREP_FUNCTION_ID      1
0181 #define ACPI_WAKE_FUNCTION_ID           2
0182 
0183 /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
0184 
0185 static ACPI_SLEEP_FUNCTIONS         AcpiSleepDispatch[] =
0186 {
0187     {ACPI_STRUCT_INIT (LegacyFunction,
0188                        ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep)),
0189      ACPI_STRUCT_INIT (ExtendedFunction,
0190                        AcpiHwExtendedSleep) },
0191     {ACPI_STRUCT_INIT (LegacyFunction,
0192                        ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep)),
0193      ACPI_STRUCT_INIT (ExtendedFunction,
0194                        AcpiHwExtendedWakePrep) },
0195     {ACPI_STRUCT_INIT (LegacyFunction,
0196                        ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake)),
0197      ACPI_STRUCT_INIT (ExtendedFunction,
0198                        AcpiHwExtendedWake) }
0199 };
0200 
0201 
0202 /*
0203  * These functions are removed for the ACPI_REDUCED_HARDWARE case:
0204  *      AcpiSetFirmwareWakingVector
0205  *      AcpiEnterSleepStateS4bios
0206  */
0207 
0208 #if (!ACPI_REDUCED_HARDWARE)
0209 /*******************************************************************************
0210  *
0211  * FUNCTION:    AcpiHwSetFirmwareWakingVector
0212  *
0213  * PARAMETERS:  Facs                - Pointer to FACS table
0214  *              PhysicalAddress     - 32-bit physical address of ACPI real mode
0215  *                                    entry point
0216  *              PhysicalAddress64   - 64-bit physical address of ACPI protected
0217  *                                    mode entry point
0218  *
0219  * RETURN:      Status
0220  *
0221  * DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS
0222  *
0223  ******************************************************************************/
0224 
0225 static ACPI_STATUS
0226 AcpiHwSetFirmwareWakingVector (
0227     ACPI_TABLE_FACS         *Facs,
0228     ACPI_PHYSICAL_ADDRESS   PhysicalAddress,
0229     ACPI_PHYSICAL_ADDRESS   PhysicalAddress64)
0230 {
0231     ACPI_FUNCTION_TRACE (AcpiHwSetFirmwareWakingVector);
0232 
0233 
0234     /*
0235      * According to the ACPI specification 2.0c and later, the 64-bit
0236      * waking vector should be cleared and the 32-bit waking vector should
0237      * be used, unless we want the wake-up code to be called by the BIOS in
0238      * Protected Mode. Some systems (for example HP dv5-1004nr) are known
0239      * to fail to resume if the 64-bit vector is used.
0240      */
0241 
0242     /* Set the 32-bit vector */
0243 
0244     Facs->FirmwareWakingVector = (UINT32) PhysicalAddress;
0245 
0246     if (Facs->Length > 32)
0247     {
0248         if (Facs->Version >= 1)
0249         {
0250             /* Set the 64-bit vector */
0251 
0252             Facs->XFirmwareWakingVector = PhysicalAddress64;
0253         }
0254         else
0255         {
0256             /* Clear the 64-bit vector if it exists */
0257 
0258             Facs->XFirmwareWakingVector = 0;
0259         }
0260     }
0261 
0262     return_ACPI_STATUS (AE_OK);
0263 }
0264 
0265 
0266 /*******************************************************************************
0267  *
0268  * FUNCTION:    AcpiSetFirmwareWakingVector
0269  *
0270  * PARAMETERS:  PhysicalAddress     - 32-bit physical address of ACPI real mode
0271  *                                    entry point
0272  *              PhysicalAddress64   - 64-bit physical address of ACPI protected
0273  *                                    mode entry point
0274  *
0275  * RETURN:      Status
0276  *
0277  * DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS
0278  *
0279  ******************************************************************************/
0280 
0281 ACPI_STATUS
0282 AcpiSetFirmwareWakingVector (
0283     ACPI_PHYSICAL_ADDRESS   PhysicalAddress,
0284     ACPI_PHYSICAL_ADDRESS   PhysicalAddress64)
0285 {
0286 
0287     ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
0288 
0289     if (AcpiGbl_FACS)
0290     {
0291         (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_FACS,
0292             PhysicalAddress, PhysicalAddress64);
0293     }
0294 
0295     return_ACPI_STATUS (AE_OK);
0296 }
0297 
0298 ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector)
0299 
0300 
0301 /*******************************************************************************
0302  *
0303  * FUNCTION:    AcpiEnterSleepStateS4bios
0304  *
0305  * PARAMETERS:  None
0306  *
0307  * RETURN:      Status
0308  *
0309  * DESCRIPTION: Perform a S4 bios request.
0310  *              THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
0311  *
0312  ******************************************************************************/
0313 
0314 ACPI_STATUS
0315 AcpiEnterSleepStateS4bios (
0316     void)
0317 {
0318     UINT32                  InValue;
0319     ACPI_STATUS             Status;
0320 
0321 
0322     ACPI_FUNCTION_TRACE (AcpiEnterSleepStateS4bios);
0323 
0324 
0325     /* Clear the wake status bit (PM1) */
0326 
0327     Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
0328     if (ACPI_FAILURE (Status))
0329     {
0330         return_ACPI_STATUS (Status);
0331     }
0332 
0333     Status = AcpiHwClearAcpiStatus ();
0334     if (ACPI_FAILURE (Status))
0335     {
0336         return_ACPI_STATUS (Status);
0337     }
0338 
0339     /*
0340      * 1) Disable all GPEs
0341      * 2) Enable all wakeup GPEs
0342      */
0343     Status = AcpiHwDisableAllGpes ();
0344     if (ACPI_FAILURE (Status))
0345     {
0346         return_ACPI_STATUS (Status);
0347     }
0348     AcpiGbl_SystemAwakeAndRunning = FALSE;
0349 
0350     Status = AcpiHwEnableAllWakeupGpes ();
0351     if (ACPI_FAILURE (Status))
0352     {
0353         return_ACPI_STATUS (Status);
0354     }
0355 
0356     Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
0357         (UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
0358     if (ACPI_FAILURE (Status))
0359     {
0360         return_ACPI_STATUS (Status);
0361     }
0362 
0363     do {
0364         AcpiOsStall (ACPI_USEC_PER_MSEC);
0365         Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
0366         if (ACPI_FAILURE (Status))
0367         {
0368             return_ACPI_STATUS (Status);
0369         }
0370 
0371     } while (!InValue);
0372 
0373     return_ACPI_STATUS (AE_OK);
0374 }
0375 
0376 ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios)
0377 
0378 #endif /* !ACPI_REDUCED_HARDWARE */
0379 
0380 
0381 /*******************************************************************************
0382  *
0383  * FUNCTION:    AcpiHwSleepDispatch
0384  *
0385  * PARAMETERS:  SleepState          - Which sleep state to enter/exit
0386  *              FunctionId          - Sleep, WakePrep, or Wake
0387  *
0388  * RETURN:      Status from the invoked sleep handling function.
0389  *
0390  * DESCRIPTION: Dispatch a sleep/wake request to the appropriate handling
0391  *              function.
0392  *
0393  ******************************************************************************/
0394 
0395 static ACPI_STATUS
0396 AcpiHwSleepDispatch (
0397     UINT8                   SleepState,
0398     UINT32                  FunctionId)
0399 {
0400     ACPI_STATUS             Status;
0401     ACPI_SLEEP_FUNCTIONS    *SleepFunctions = &AcpiSleepDispatch[FunctionId];
0402 
0403 
0404 #if (!ACPI_REDUCED_HARDWARE)
0405     /*
0406      * If the Hardware Reduced flag is set (from the FADT), we must
0407      * use the extended sleep registers (FADT). Note: As per the ACPI
0408      * specification, these extended registers are to be used for HW-reduced
0409      * platforms only. They are not general-purpose replacements for the
0410      * legacy PM register sleep support.
0411      */
0412     if (AcpiGbl_ReducedHardware)
0413     {
0414         Status = SleepFunctions->ExtendedFunction (SleepState);
0415     }
0416     else
0417     {
0418         /* Legacy sleep */
0419 
0420         Status = SleepFunctions->LegacyFunction (SleepState);
0421     }
0422 
0423     return (Status);
0424 
0425 #else
0426     /*
0427      * For the case where reduced-hardware-only code is being generated,
0428      * we know that only the extended sleep registers are available
0429      */
0430     Status = SleepFunctions->ExtendedFunction (SleepState);
0431     return (Status);
0432 
0433 #endif /* !ACPI_REDUCED_HARDWARE */
0434 }
0435 
0436 
0437 /*******************************************************************************
0438  *
0439  * FUNCTION:    AcpiEnterSleepStatePrep
0440  *
0441  * PARAMETERS:  SleepState          - Which sleep state to enter
0442  *
0443  * RETURN:      Status
0444  *
0445  * DESCRIPTION: Prepare to enter a system sleep state.
0446  *              This function must execute with interrupts enabled.
0447  *              We break sleeping into 2 stages so that OSPM can handle
0448  *              various OS-specific tasks between the two steps.
0449  *
0450  ******************************************************************************/
0451 
0452 ACPI_STATUS
0453 AcpiEnterSleepStatePrep (
0454     UINT8                   SleepState)
0455 {
0456     ACPI_STATUS             Status;
0457     ACPI_OBJECT_LIST        ArgList;
0458     ACPI_OBJECT             Arg;
0459     UINT32                  SstValue;
0460 
0461 
0462     ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep);
0463 
0464 
0465     Status = AcpiGetSleepTypeData (SleepState,
0466         &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
0467     if (ACPI_FAILURE (Status))
0468     {
0469         return_ACPI_STATUS (Status);
0470     }
0471 
0472     Status = AcpiGetSleepTypeData (ACPI_STATE_S0,
0473         &AcpiGbl_SleepTypeAS0, &AcpiGbl_SleepTypeBS0);
0474     if (ACPI_FAILURE (Status)) {
0475         AcpiGbl_SleepTypeAS0 = ACPI_SLEEP_TYPE_INVALID;
0476     }
0477 
0478     /* Execute the _PTS method (Prepare To Sleep) */
0479 
0480     ArgList.Count = 1;
0481     ArgList.Pointer = &Arg;
0482     Arg.Type = ACPI_TYPE_INTEGER;
0483     Arg.Integer.Value = SleepState;
0484 
0485     Status = AcpiEvaluateObject (NULL, METHOD_PATHNAME__PTS, &ArgList, NULL);
0486     if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
0487     {
0488         return_ACPI_STATUS (Status);
0489     }
0490 
0491     /* Setup the argument to the _SST method (System STatus) */
0492 
0493     switch (SleepState)
0494     {
0495     case ACPI_STATE_S0:
0496 
0497         SstValue = ACPI_SST_WORKING;
0498         break;
0499 
0500     case ACPI_STATE_S1:
0501     case ACPI_STATE_S2:
0502     case ACPI_STATE_S3:
0503 
0504         SstValue = ACPI_SST_SLEEPING;
0505         break;
0506 
0507     case ACPI_STATE_S4:
0508 
0509         SstValue = ACPI_SST_SLEEP_CONTEXT;
0510         break;
0511 
0512     default:
0513 
0514         SstValue = ACPI_SST_INDICATOR_OFF; /* Default is off */
0515         break;
0516     }
0517 
0518     /*
0519      * Set the system indicators to show the desired sleep state.
0520      * _SST is an optional method (return no error if not found)
0521      */
0522     AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, SstValue);
0523     return_ACPI_STATUS (AE_OK);
0524 }
0525 
0526 ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
0527 
0528 
0529 /*******************************************************************************
0530  *
0531  * FUNCTION:    AcpiEnterSleepState
0532  *
0533  * PARAMETERS:  SleepState          - Which sleep state to enter
0534  *
0535  * RETURN:      Status
0536  *
0537  * DESCRIPTION: Enter a system sleep state
0538  *              THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
0539  *
0540  ******************************************************************************/
0541 
0542 ACPI_STATUS
0543 AcpiEnterSleepState (
0544     UINT8                   SleepState)
0545 {
0546     ACPI_STATUS             Status;
0547 
0548 
0549     ACPI_FUNCTION_TRACE (AcpiEnterSleepState);
0550 
0551 
0552     if ((AcpiGbl_SleepTypeA > ACPI_SLEEP_TYPE_MAX) ||
0553         (AcpiGbl_SleepTypeB > ACPI_SLEEP_TYPE_MAX))
0554     {
0555         ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X",
0556             AcpiGbl_SleepTypeA, AcpiGbl_SleepTypeB));
0557         return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
0558     }
0559 
0560     Status = AcpiHwSleepDispatch (SleepState, ACPI_SLEEP_FUNCTION_ID);
0561     return_ACPI_STATUS (Status);
0562 }
0563 
0564 ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
0565 
0566 
0567 /*******************************************************************************
0568  *
0569  * FUNCTION:    AcpiLeaveSleepStatePrep
0570  *
0571  * PARAMETERS:  SleepState          - Which sleep state we are exiting
0572  *
0573  * RETURN:      Status
0574  *
0575  * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a
0576  *              sleep. Called with interrupts DISABLED.
0577  *              We break wake/resume into 2 stages so that OSPM can handle
0578  *              various OS-specific tasks between the two steps.
0579  *
0580  ******************************************************************************/
0581 
0582 ACPI_STATUS
0583 AcpiLeaveSleepStatePrep (
0584     UINT8                   SleepState)
0585 {
0586     ACPI_STATUS             Status;
0587 
0588 
0589     ACPI_FUNCTION_TRACE (AcpiLeaveSleepStatePrep);
0590 
0591 
0592     Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_PREP_FUNCTION_ID);
0593     return_ACPI_STATUS (Status);
0594 }
0595 
0596 ACPI_EXPORT_SYMBOL (AcpiLeaveSleepStatePrep)
0597 
0598 
0599 /*******************************************************************************
0600  *
0601  * FUNCTION:    AcpiLeaveSleepState
0602  *
0603  * PARAMETERS:  SleepState          - Which sleep state we are exiting
0604  *
0605  * RETURN:      Status
0606  *
0607  * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
0608  *              Called with interrupts ENABLED.
0609  *
0610  ******************************************************************************/
0611 
0612 ACPI_STATUS
0613 AcpiLeaveSleepState (
0614     UINT8                   SleepState)
0615 {
0616     ACPI_STATUS             Status;
0617 
0618 
0619     ACPI_FUNCTION_TRACE (AcpiLeaveSleepState);
0620 
0621 
0622     Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_FUNCTION_ID);
0623     return_ACPI_STATUS (Status);
0624 }
0625 
0626 ACPI_EXPORT_SYMBOL (AcpiLeaveSleepState)