hwxfsleep.c revision 1.5 1 1.1 christos /******************************************************************************
2 1.1 christos *
3 1.1 christos * Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces
4 1.1 christos *
5 1.1 christos *****************************************************************************/
6 1.1 christos
7 1.1 christos /*
8 1.4 christos * Copyright (C) 2000 - 2015, Intel Corp.
9 1.1 christos * All rights reserved.
10 1.1 christos *
11 1.1 christos * Redistribution and use in source and binary forms, with or without
12 1.1 christos * modification, are permitted provided that the following conditions
13 1.1 christos * are met:
14 1.1 christos * 1. Redistributions of source code must retain the above copyright
15 1.1 christos * notice, this list of conditions, and the following disclaimer,
16 1.1 christos * without modification.
17 1.1 christos * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.1 christos * substantially similar to the "NO WARRANTY" disclaimer below
19 1.1 christos * ("Disclaimer") and any redistribution must be conditioned upon
20 1.1 christos * including a substantially similar Disclaimer requirement for further
21 1.1 christos * binary redistribution.
22 1.1 christos * 3. Neither the names of the above-listed copyright holders nor the names
23 1.1 christos * of any contributors may be used to endorse or promote products derived
24 1.1 christos * from this software without specific prior written permission.
25 1.1 christos *
26 1.1 christos * Alternatively, this software may be distributed under the terms of the
27 1.1 christos * GNU General Public License ("GPL") version 2 as published by the Free
28 1.1 christos * Software Foundation.
29 1.1 christos *
30 1.1 christos * NO WARRANTY
31 1.1 christos * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.1 christos * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.1 christos * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.1 christos * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.1 christos * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.1 christos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.1 christos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.1 christos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.1 christos * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.1 christos * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.1 christos * POSSIBILITY OF SUCH DAMAGES.
42 1.1 christos */
43 1.1 christos
44 1.1 christos #define EXPORT_ACPI_INTERFACES
45 1.1 christos
46 1.1 christos #include "acpi.h"
47 1.1 christos #include "accommon.h"
48 1.1 christos
49 1.1 christos #define _COMPONENT ACPI_HARDWARE
50 1.1 christos ACPI_MODULE_NAME ("hwxfsleep")
51 1.1 christos
52 1.1 christos /* Local prototypes */
53 1.1 christos
54 1.5 christos #if (!ACPI_REDUCED_HARDWARE)
55 1.5 christos static ACPI_STATUS
56 1.5 christos AcpiHwSetFirmwareWakingVector (
57 1.5 christos ACPI_TABLE_FACS *Facs,
58 1.5 christos ACPI_PHYSICAL_ADDRESS PhysicalAddress,
59 1.5 christos ACPI_PHYSICAL_ADDRESS PhysicalAddress64);
60 1.5 christos #endif
61 1.5 christos
62 1.1 christos static ACPI_STATUS
63 1.1 christos AcpiHwSleepDispatch (
64 1.1 christos UINT8 SleepState,
65 1.1 christos UINT32 FunctionId);
66 1.1 christos
67 1.1 christos /*
68 1.1 christos * Dispatch table used to efficiently branch to the various sleep
69 1.1 christos * functions.
70 1.1 christos */
71 1.1 christos #define ACPI_SLEEP_FUNCTION_ID 0
72 1.1 christos #define ACPI_WAKE_PREP_FUNCTION_ID 1
73 1.1 christos #define ACPI_WAKE_FUNCTION_ID 2
74 1.1 christos
75 1.1 christos /* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
76 1.1 christos
77 1.1 christos static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
78 1.1 christos {
79 1.1 christos {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep), AcpiHwExtendedSleep},
80 1.1 christos {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep), AcpiHwExtendedWakePrep},
81 1.1 christos {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake), AcpiHwExtendedWake}
82 1.1 christos };
83 1.1 christos
84 1.1 christos
85 1.1 christos /*
86 1.1 christos * These functions are removed for the ACPI_REDUCED_HARDWARE case:
87 1.1 christos * AcpiSetFirmwareWakingVector
88 1.1 christos * AcpiEnterSleepStateS4bios
89 1.1 christos */
90 1.1 christos
91 1.1 christos #if (!ACPI_REDUCED_HARDWARE)
92 1.1 christos /*******************************************************************************
93 1.1 christos *
94 1.5 christos * FUNCTION: AcpiHwSetFirmwareWakingVector
95 1.1 christos *
96 1.5 christos * PARAMETERS: Facs - Pointer to FACS table
97 1.5 christos * PhysicalAddress - 32-bit physical address of ACPI real mode
98 1.5 christos * entry point
99 1.5 christos * PhysicalAddress64 - 64-bit physical address of ACPI protected
100 1.5 christos * entry point
101 1.1 christos *
102 1.1 christos * RETURN: Status
103 1.1 christos *
104 1.5 christos * DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS
105 1.1 christos *
106 1.1 christos ******************************************************************************/
107 1.1 christos
108 1.5 christos static ACPI_STATUS
109 1.5 christos AcpiHwSetFirmwareWakingVector (
110 1.5 christos ACPI_TABLE_FACS *Facs,
111 1.5 christos ACPI_PHYSICAL_ADDRESS PhysicalAddress,
112 1.5 christos ACPI_PHYSICAL_ADDRESS PhysicalAddress64)
113 1.1 christos {
114 1.5 christos ACPI_FUNCTION_TRACE (AcpiHwSetFirmwareWakingVector);
115 1.1 christos
116 1.1 christos
117 1.1 christos /*
118 1.1 christos * According to the ACPI specification 2.0c and later, the 64-bit
119 1.1 christos * waking vector should be cleared and the 32-bit waking vector should
120 1.1 christos * be used, unless we want the wake-up code to be called by the BIOS in
121 1.1 christos * Protected Mode. Some systems (for example HP dv5-1004nr) are known
122 1.1 christos * to fail to resume if the 64-bit vector is used.
123 1.1 christos */
124 1.1 christos
125 1.1 christos /* Set the 32-bit vector */
126 1.1 christos
127 1.5 christos Facs->FirmwareWakingVector = (UINT32) PhysicalAddress;
128 1.1 christos
129 1.5 christos if (Facs->Length > 32)
130 1.5 christos {
131 1.5 christos if (Facs->Version >= 1)
132 1.5 christos {
133 1.5 christos /* Set the 64-bit vector */
134 1.5 christos
135 1.5 christos Facs->XFirmwareWakingVector = PhysicalAddress64;
136 1.5 christos }
137 1.5 christos else
138 1.5 christos {
139 1.5 christos /* Clear the 64-bit vector if it exists */
140 1.1 christos
141 1.5 christos Facs->XFirmwareWakingVector = 0;
142 1.5 christos }
143 1.1 christos }
144 1.1 christos
145 1.1 christos return_ACPI_STATUS (AE_OK);
146 1.1 christos }
147 1.1 christos
148 1.1 christos
149 1.1 christos /*******************************************************************************
150 1.1 christos *
151 1.5 christos * FUNCTION: AcpiSetFirmwareWakingVector
152 1.1 christos *
153 1.5 christos * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
154 1.5 christos * entry point
155 1.5 christos * PhysicalAddress64 - 64-bit physical address of ACPI protected
156 1.5 christos * entry point
157 1.1 christos *
158 1.1 christos * RETURN: Status
159 1.1 christos *
160 1.5 christos * DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS
161 1.1 christos *
162 1.1 christos ******************************************************************************/
163 1.1 christos
164 1.1 christos ACPI_STATUS
165 1.5 christos AcpiSetFirmwareWakingVector (
166 1.5 christos ACPI_PHYSICAL_ADDRESS PhysicalAddress,
167 1.5 christos ACPI_PHYSICAL_ADDRESS PhysicalAddress64)
168 1.1 christos {
169 1.1 christos
170 1.5 christos ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
171 1.1 christos
172 1.5 christos /* If Hardware Reduced flag is set, there is no FACS */
173 1.1 christos
174 1.5 christos if (AcpiGbl_ReducedHardware)
175 1.1 christos {
176 1.5 christos return_ACPI_STATUS (AE_OK);
177 1.1 christos }
178 1.1 christos
179 1.5 christos if (AcpiGbl_Facs32)
180 1.5 christos {
181 1.5 christos (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_Facs32,
182 1.5 christos PhysicalAddress, PhysicalAddress64);
183 1.5 christos }
184 1.5 christos if (AcpiGbl_Facs64)
185 1.5 christos {
186 1.5 christos (void) AcpiHwSetFirmwareWakingVector (AcpiGbl_Facs64,
187 1.5 christos PhysicalAddress, PhysicalAddress64);
188 1.5 christos }
189 1.1 christos
190 1.1 christos return_ACPI_STATUS (AE_OK);
191 1.1 christos }
192 1.1 christos
193 1.5 christos ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector)
194 1.1 christos
195 1.1 christos
196 1.1 christos /*******************************************************************************
197 1.1 christos *
198 1.1 christos * FUNCTION: AcpiEnterSleepStateS4bios
199 1.1 christos *
200 1.1 christos * PARAMETERS: None
201 1.1 christos *
202 1.1 christos * RETURN: Status
203 1.1 christos *
204 1.1 christos * DESCRIPTION: Perform a S4 bios request.
205 1.1 christos * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
206 1.1 christos *
207 1.1 christos ******************************************************************************/
208 1.1 christos
209 1.1 christos ACPI_STATUS
210 1.1 christos AcpiEnterSleepStateS4bios (
211 1.1 christos void)
212 1.1 christos {
213 1.1 christos UINT32 InValue;
214 1.1 christos ACPI_STATUS Status;
215 1.1 christos
216 1.1 christos
217 1.1 christos ACPI_FUNCTION_TRACE (AcpiEnterSleepStateS4bios);
218 1.1 christos
219 1.1 christos
220 1.1 christos /* Clear the wake status bit (PM1) */
221 1.1 christos
222 1.1 christos Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
223 1.1 christos if (ACPI_FAILURE (Status))
224 1.1 christos {
225 1.1 christos return_ACPI_STATUS (Status);
226 1.1 christos }
227 1.1 christos
228 1.1 christos Status = AcpiHwClearAcpiStatus ();
229 1.1 christos if (ACPI_FAILURE (Status))
230 1.1 christos {
231 1.1 christos return_ACPI_STATUS (Status);
232 1.1 christos }
233 1.1 christos
234 1.1 christos /*
235 1.1 christos * 1) Disable/Clear all GPEs
236 1.1 christos * 2) Enable all wakeup GPEs
237 1.1 christos */
238 1.1 christos Status = AcpiHwDisableAllGpes ();
239 1.1 christos if (ACPI_FAILURE (Status))
240 1.1 christos {
241 1.1 christos return_ACPI_STATUS (Status);
242 1.1 christos }
243 1.1 christos AcpiGbl_SystemAwakeAndRunning = FALSE;
244 1.1 christos
245 1.1 christos Status = AcpiHwEnableAllWakeupGpes ();
246 1.1 christos if (ACPI_FAILURE (Status))
247 1.1 christos {
248 1.1 christos return_ACPI_STATUS (Status);
249 1.1 christos }
250 1.1 christos
251 1.1 christos ACPI_FLUSH_CPU_CACHE ();
252 1.1 christos
253 1.1 christos Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
254 1.1 christos (UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
255 1.1 christos
256 1.1 christos do {
257 1.1 christos AcpiOsStall (ACPI_USEC_PER_MSEC);
258 1.1 christos Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
259 1.1 christos if (ACPI_FAILURE (Status))
260 1.1 christos {
261 1.1 christos return_ACPI_STATUS (Status);
262 1.1 christos }
263 1.1 christos } while (!InValue);
264 1.1 christos
265 1.1 christos return_ACPI_STATUS (AE_OK);
266 1.1 christos }
267 1.1 christos
268 1.1 christos ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios)
269 1.1 christos
270 1.1 christos #endif /* !ACPI_REDUCED_HARDWARE */
271 1.1 christos
272 1.1 christos
273 1.1 christos /*******************************************************************************
274 1.1 christos *
275 1.1 christos * FUNCTION: AcpiHwSleepDispatch
276 1.1 christos *
277 1.1 christos * PARAMETERS: SleepState - Which sleep state to enter/exit
278 1.1 christos * FunctionId - Sleep, WakePrep, or Wake
279 1.1 christos *
280 1.1 christos * RETURN: Status from the invoked sleep handling function.
281 1.1 christos *
282 1.1 christos * DESCRIPTION: Dispatch a sleep/wake request to the appropriate handling
283 1.1 christos * function.
284 1.1 christos *
285 1.1 christos ******************************************************************************/
286 1.1 christos
287 1.1 christos static ACPI_STATUS
288 1.1 christos AcpiHwSleepDispatch (
289 1.1 christos UINT8 SleepState,
290 1.1 christos UINT32 FunctionId)
291 1.1 christos {
292 1.1 christos ACPI_STATUS Status;
293 1.1 christos ACPI_SLEEP_FUNCTIONS *SleepFunctions = &AcpiSleepDispatch[FunctionId];
294 1.1 christos
295 1.1 christos
296 1.1 christos #if (!ACPI_REDUCED_HARDWARE)
297 1.1 christos /*
298 1.1 christos * If the Hardware Reduced flag is set (from the FADT), we must
299 1.1 christos * use the extended sleep registers (FADT). Note: As per the ACPI
300 1.1 christos * specification, these extended registers are to be used for HW-reduced
301 1.1 christos * platforms only. They are not general-purpose replacements for the
302 1.1 christos * legacy PM register sleep support.
303 1.1 christos */
304 1.1 christos if (AcpiGbl_ReducedHardware)
305 1.1 christos {
306 1.1 christos Status = SleepFunctions->ExtendedFunction (SleepState);
307 1.1 christos }
308 1.1 christos else
309 1.1 christos {
310 1.1 christos /* Legacy sleep */
311 1.1 christos
312 1.1 christos Status = SleepFunctions->LegacyFunction (SleepState);
313 1.1 christos }
314 1.1 christos
315 1.1 christos return (Status);
316 1.1 christos
317 1.1 christos #else
318 1.1 christos /*
319 1.1 christos * For the case where reduced-hardware-only code is being generated,
320 1.1 christos * we know that only the extended sleep registers are available
321 1.1 christos */
322 1.1 christos Status = SleepFunctions->ExtendedFunction (SleepState);
323 1.1 christos return (Status);
324 1.1 christos
325 1.1 christos #endif /* !ACPI_REDUCED_HARDWARE */
326 1.1 christos }
327 1.1 christos
328 1.1 christos
329 1.1 christos /*******************************************************************************
330 1.1 christos *
331 1.1 christos * FUNCTION: AcpiEnterSleepStatePrep
332 1.1 christos *
333 1.1 christos * PARAMETERS: SleepState - Which sleep state to enter
334 1.1 christos *
335 1.1 christos * RETURN: Status
336 1.1 christos *
337 1.1 christos * DESCRIPTION: Prepare to enter a system sleep state.
338 1.1 christos * This function must execute with interrupts enabled.
339 1.1 christos * We break sleeping into 2 stages so that OSPM can handle
340 1.1 christos * various OS-specific tasks between the two steps.
341 1.1 christos *
342 1.1 christos ******************************************************************************/
343 1.1 christos
344 1.1 christos ACPI_STATUS
345 1.1 christos AcpiEnterSleepStatePrep (
346 1.1 christos UINT8 SleepState)
347 1.1 christos {
348 1.1 christos ACPI_STATUS Status;
349 1.1 christos ACPI_OBJECT_LIST ArgList;
350 1.1 christos ACPI_OBJECT Arg;
351 1.1 christos UINT32 SstValue;
352 1.1 christos
353 1.1 christos
354 1.1 christos ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep);
355 1.1 christos
356 1.1 christos
357 1.1 christos Status = AcpiGetSleepTypeData (SleepState,
358 1.1 christos &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
359 1.1 christos if (ACPI_FAILURE (Status))
360 1.1 christos {
361 1.1 christos return_ACPI_STATUS (Status);
362 1.1 christos }
363 1.1 christos
364 1.1 christos /* Execute the _PTS method (Prepare To Sleep) */
365 1.1 christos
366 1.1 christos ArgList.Count = 1;
367 1.1 christos ArgList.Pointer = &Arg;
368 1.1 christos Arg.Type = ACPI_TYPE_INTEGER;
369 1.1 christos Arg.Integer.Value = SleepState;
370 1.1 christos
371 1.1 christos Status = AcpiEvaluateObject (NULL, METHOD_PATHNAME__PTS, &ArgList, NULL);
372 1.1 christos if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
373 1.1 christos {
374 1.1 christos return_ACPI_STATUS (Status);
375 1.1 christos }
376 1.1 christos
377 1.1 christos /* Setup the argument to the _SST method (System STatus) */
378 1.1 christos
379 1.1 christos switch (SleepState)
380 1.1 christos {
381 1.1 christos case ACPI_STATE_S0:
382 1.1 christos
383 1.1 christos SstValue = ACPI_SST_WORKING;
384 1.1 christos break;
385 1.1 christos
386 1.1 christos case ACPI_STATE_S1:
387 1.1 christos case ACPI_STATE_S2:
388 1.1 christos case ACPI_STATE_S3:
389 1.1 christos
390 1.1 christos SstValue = ACPI_SST_SLEEPING;
391 1.1 christos break;
392 1.1 christos
393 1.1 christos case ACPI_STATE_S4:
394 1.1 christos
395 1.1 christos SstValue = ACPI_SST_SLEEP_CONTEXT;
396 1.1 christos break;
397 1.1 christos
398 1.1 christos default:
399 1.1 christos
400 1.1 christos SstValue = ACPI_SST_INDICATOR_OFF; /* Default is off */
401 1.1 christos break;
402 1.1 christos }
403 1.1 christos
404 1.1 christos /*
405 1.1 christos * Set the system indicators to show the desired sleep state.
406 1.1 christos * _SST is an optional method (return no error if not found)
407 1.1 christos */
408 1.2 christos AcpiHwExecuteSleepMethod (__UNCONST(METHOD_PATHNAME__SST), SstValue);
409 1.1 christos return_ACPI_STATUS (AE_OK);
410 1.1 christos }
411 1.1 christos
412 1.1 christos ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
413 1.1 christos
414 1.1 christos
415 1.1 christos /*******************************************************************************
416 1.1 christos *
417 1.1 christos * FUNCTION: AcpiEnterSleepState
418 1.1 christos *
419 1.1 christos * PARAMETERS: SleepState - Which sleep state to enter
420 1.1 christos *
421 1.1 christos * RETURN: Status
422 1.1 christos *
423 1.1 christos * DESCRIPTION: Enter a system sleep state
424 1.1 christos * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
425 1.1 christos *
426 1.1 christos ******************************************************************************/
427 1.1 christos
428 1.1 christos ACPI_STATUS
429 1.1 christos AcpiEnterSleepState (
430 1.1 christos UINT8 SleepState)
431 1.1 christos {
432 1.1 christos ACPI_STATUS Status;
433 1.1 christos
434 1.1 christos
435 1.1 christos ACPI_FUNCTION_TRACE (AcpiEnterSleepState);
436 1.1 christos
437 1.1 christos
438 1.1 christos if ((AcpiGbl_SleepTypeA > ACPI_SLEEP_TYPE_MAX) ||
439 1.1 christos (AcpiGbl_SleepTypeB > ACPI_SLEEP_TYPE_MAX))
440 1.1 christos {
441 1.1 christos ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X",
442 1.1 christos AcpiGbl_SleepTypeA, AcpiGbl_SleepTypeB));
443 1.1 christos return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
444 1.1 christos }
445 1.1 christos
446 1.1 christos Status = AcpiHwSleepDispatch (SleepState, ACPI_SLEEP_FUNCTION_ID);
447 1.1 christos return_ACPI_STATUS (Status);
448 1.1 christos }
449 1.1 christos
450 1.1 christos ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
451 1.1 christos
452 1.1 christos
453 1.1 christos /*******************************************************************************
454 1.1 christos *
455 1.1 christos * FUNCTION: AcpiLeaveSleepStatePrep
456 1.1 christos *
457 1.1 christos * PARAMETERS: SleepState - Which sleep state we are exiting
458 1.1 christos *
459 1.1 christos * RETURN: Status
460 1.1 christos *
461 1.1 christos * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a
462 1.1 christos * sleep. Called with interrupts DISABLED.
463 1.1 christos * We break wake/resume into 2 stages so that OSPM can handle
464 1.1 christos * various OS-specific tasks between the two steps.
465 1.1 christos *
466 1.1 christos ******************************************************************************/
467 1.1 christos
468 1.1 christos ACPI_STATUS
469 1.1 christos AcpiLeaveSleepStatePrep (
470 1.1 christos UINT8 SleepState)
471 1.1 christos {
472 1.1 christos ACPI_STATUS Status;
473 1.1 christos
474 1.1 christos
475 1.1 christos ACPI_FUNCTION_TRACE (AcpiLeaveSleepStatePrep);
476 1.1 christos
477 1.1 christos
478 1.1 christos Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_PREP_FUNCTION_ID);
479 1.1 christos return_ACPI_STATUS (Status);
480 1.1 christos }
481 1.1 christos
482 1.1 christos ACPI_EXPORT_SYMBOL (AcpiLeaveSleepStatePrep)
483 1.1 christos
484 1.1 christos
485 1.1 christos /*******************************************************************************
486 1.1 christos *
487 1.1 christos * FUNCTION: AcpiLeaveSleepState
488 1.1 christos *
489 1.1 christos * PARAMETERS: SleepState - Which sleep state we are exiting
490 1.1 christos *
491 1.1 christos * RETURN: Status
492 1.1 christos *
493 1.1 christos * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
494 1.1 christos * Called with interrupts ENABLED.
495 1.1 christos *
496 1.1 christos ******************************************************************************/
497 1.1 christos
498 1.1 christos ACPI_STATUS
499 1.1 christos AcpiLeaveSleepState (
500 1.1 christos UINT8 SleepState)
501 1.1 christos {
502 1.1 christos ACPI_STATUS Status;
503 1.1 christos
504 1.1 christos
505 1.1 christos ACPI_FUNCTION_TRACE (AcpiLeaveSleepState);
506 1.1 christos
507 1.1 christos
508 1.1 christos Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_FUNCTION_ID);
509 1.1 christos return_ACPI_STATUS (Status);
510 1.1 christos }
511 1.1 christos
512 1.1 christos ACPI_EXPORT_SYMBOL (AcpiLeaveSleepState)
513