1 /******************************************************************************
3 * Module Name: evgpe - General Purpose Event handling and dispatch
6 *****************************************************************************/
8 /******************************************************************************
12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
13 * All rights reserved.
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code. No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
38 * The above copyright and patent license is granted only if the following
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision. In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change. Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee. Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution. In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
73 * 3.4. Intel retains all right, title, and interest in and to the Original
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
81 * 4. Disclaimer and Export Compliance
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government. In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
115 *****************************************************************************/
118 #include "acevents.h"
119 #include "acnamesp.h"
121 #define _COMPONENT ACPI_EVENTS
122 ACPI_MODULE_NAME ("evgpe")
125 /*******************************************************************************
127 * FUNCTION: AcpiEvSetGpeType
129 * PARAMETERS: GpeEventInfo - GPE to set
134 * DESCRIPTION: Sets the new type for the GPE (wake, run, or wake/run)
136 ******************************************************************************/
140 ACPI_GPE_EVENT_INFO *GpeEventInfo,
146 ACPI_FUNCTION_TRACE ("EvSetGpeType");
149 /* Validate type and update register enable masks */
153 case ACPI_GPE_TYPE_WAKE:
154 case ACPI_GPE_TYPE_RUNTIME:
155 case ACPI_GPE_TYPE_WAKE_RUN:
159 return_ACPI_STATUS (AE_BAD_PARAMETER);
162 /* Disable the GPE if currently enabled */
164 Status = AcpiEvDisableGpe (GpeEventInfo);
166 /* Type was validated above */
168 GpeEventInfo->Flags &= ~ACPI_GPE_TYPE_MASK; /* Clear type bits */
169 GpeEventInfo->Flags |= Type; /* Insert type */
170 return_ACPI_STATUS (Status);
174 /*******************************************************************************
176 * FUNCTION: AcpiEvUpdateGpeEnableMasks
178 * PARAMETERS: GpeEventInfo - GPE to update
179 * Type - What to do: ACPI_GPE_DISABLE or
184 * DESCRIPTION: Updates GPE register enable masks based on the GPE type
186 ******************************************************************************/
189 AcpiEvUpdateGpeEnableMasks (
190 ACPI_GPE_EVENT_INFO *GpeEventInfo,
193 ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
197 ACPI_FUNCTION_TRACE ("EvUpdateGpeEnableMasks");
200 GpeRegisterInfo = GpeEventInfo->RegisterInfo;
201 if (!GpeRegisterInfo)
203 return_ACPI_STATUS (AE_NOT_EXIST);
205 RegisterBit = GpeEventInfo->RegisterBit;
207 /* 1) Disable case. Simply clear all enable bits */
209 if (Type == ACPI_GPE_DISABLE)
211 ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, RegisterBit);
212 ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForRun, RegisterBit);
213 return_ACPI_STATUS (AE_OK);
216 /* 2) Enable case. Set/Clear the appropriate enable bits */
218 switch (GpeEventInfo->Flags & ACPI_GPE_TYPE_MASK)
220 case ACPI_GPE_TYPE_WAKE:
221 ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, RegisterBit);
222 ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForRun, RegisterBit);
225 case ACPI_GPE_TYPE_RUNTIME:
226 ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, RegisterBit);
227 ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, RegisterBit);
230 case ACPI_GPE_TYPE_WAKE_RUN:
231 ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, RegisterBit);
232 ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, RegisterBit);
236 return_ACPI_STATUS (AE_BAD_PARAMETER);
239 return_ACPI_STATUS (AE_OK);
243 /*******************************************************************************
245 * FUNCTION: AcpiEvEnableGpe
247 * PARAMETERS: GpeEventInfo - GPE to enable
248 * WriteToHardware - Enable now, or just mark data structs
249 * (WAKE GPEs should be deferred)
253 * DESCRIPTION: Enable a GPE based on the GPE type
255 ******************************************************************************/
259 ACPI_GPE_EVENT_INFO *GpeEventInfo,
260 BOOLEAN WriteToHardware)
265 ACPI_FUNCTION_TRACE ("EvEnableGpe");
268 /* Make sure HW enable masks are updated */
270 Status = AcpiEvUpdateGpeEnableMasks (GpeEventInfo, ACPI_GPE_ENABLE);
271 if (ACPI_FAILURE (Status))
273 return_ACPI_STATUS (Status);
276 /* Mark wake-enabled or HW enable, or both */
278 switch (GpeEventInfo->Flags & ACPI_GPE_TYPE_MASK)
280 case ACPI_GPE_TYPE_WAKE:
282 ACPI_SET_BIT (GpeEventInfo->Flags, ACPI_GPE_WAKE_ENABLED);
285 case ACPI_GPE_TYPE_WAKE_RUN:
287 ACPI_SET_BIT (GpeEventInfo->Flags, ACPI_GPE_WAKE_ENABLED);
289 /*lint -fallthrough */
291 case ACPI_GPE_TYPE_RUNTIME:
293 ACPI_SET_BIT (GpeEventInfo->Flags, ACPI_GPE_RUN_ENABLED);
297 /* Clear the GPE (of stale events), then enable it */
299 Status = AcpiHwClearGpe (GpeEventInfo);
300 if (ACPI_FAILURE (Status))
302 return_ACPI_STATUS (Status);
305 /* Enable the requested runtime GPE */
307 Status = AcpiHwWriteGpeEnableReg (GpeEventInfo);
312 return_ACPI_STATUS (AE_BAD_PARAMETER);
315 return_ACPI_STATUS (AE_OK);
319 /*******************************************************************************
321 * FUNCTION: AcpiEvDisableGpe
323 * PARAMETERS: GpeEventInfo - GPE to disable
327 * DESCRIPTION: Disable a GPE based on the GPE type
329 ******************************************************************************/
333 ACPI_GPE_EVENT_INFO *GpeEventInfo)
338 ACPI_FUNCTION_TRACE ("EvDisableGpe");
341 if (!(GpeEventInfo->Flags & ACPI_GPE_ENABLE_MASK))
343 return_ACPI_STATUS (AE_OK);
346 /* Make sure HW enable masks are updated */
348 Status = AcpiEvUpdateGpeEnableMasks (GpeEventInfo, ACPI_GPE_DISABLE);
349 if (ACPI_FAILURE (Status))
351 return_ACPI_STATUS (Status);
354 /* Mark wake-disabled or HW disable, or both */
356 switch (GpeEventInfo->Flags & ACPI_GPE_TYPE_MASK)
358 case ACPI_GPE_TYPE_WAKE:
359 ACPI_CLEAR_BIT (GpeEventInfo->Flags, ACPI_GPE_WAKE_ENABLED);
362 case ACPI_GPE_TYPE_WAKE_RUN:
363 ACPI_CLEAR_BIT (GpeEventInfo->Flags, ACPI_GPE_WAKE_ENABLED);
365 /*lint -fallthrough */
367 case ACPI_GPE_TYPE_RUNTIME:
369 /* Disable the requested runtime GPE */
371 ACPI_CLEAR_BIT (GpeEventInfo->Flags, ACPI_GPE_RUN_ENABLED);
372 Status = AcpiHwWriteGpeEnableReg (GpeEventInfo);
376 return_ACPI_STATUS (AE_BAD_PARAMETER);
379 return_ACPI_STATUS (AE_OK);
383 /*******************************************************************************
385 * FUNCTION: AcpiEvGetGpeEventInfo
387 * PARAMETERS: GpeDevice - Device node. NULL for GPE0/GPE1
388 * GpeNumber - Raw GPE number
390 * RETURN: A GPE EventInfo struct. NULL if not a valid GPE
392 * DESCRIPTION: Returns the EventInfo struct associated with this GPE.
393 * Validates the GpeBlock and the GpeNumber
395 * Should be called only when the GPE lists are semaphore locked
396 * and not subject to change.
398 ******************************************************************************/
400 ACPI_GPE_EVENT_INFO *
401 AcpiEvGetGpeEventInfo (
402 ACPI_HANDLE GpeDevice,
405 ACPI_OPERAND_OBJECT *ObjDesc;
406 ACPI_GPE_BLOCK_INFO *GpeBlock;
410 ACPI_FUNCTION_ENTRY ();
413 /* A NULL GpeBlock means use the FADT-defined GPE block(s) */
417 /* Examine GPE Block 0 and 1 (These blocks are permanent) */
419 for (i = 0; i < ACPI_MAX_GPE_BLOCKS; i++)
421 GpeBlock = AcpiGbl_GpeFadtBlocks[i];
424 if ((GpeNumber >= GpeBlock->BlockBaseNumber) &&
425 (GpeNumber < GpeBlock->BlockBaseNumber + (GpeBlock->RegisterCount * 8)))
427 return (&GpeBlock->EventInfo[GpeNumber - GpeBlock->BlockBaseNumber]);
432 /* The GpeNumber was not in the range of either FADT GPE block */
437 /* A Non-NULL GpeDevice means this is a GPE Block Device */
439 ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) GpeDevice);
441 !ObjDesc->Device.GpeBlock)
446 GpeBlock = ObjDesc->Device.GpeBlock;
448 if ((GpeNumber >= GpeBlock->BlockBaseNumber) &&
449 (GpeNumber < GpeBlock->BlockBaseNumber + (GpeBlock->RegisterCount * 8)))
451 return (&GpeBlock->EventInfo[GpeNumber - GpeBlock->BlockBaseNumber]);
458 /*******************************************************************************
460 * FUNCTION: AcpiEvGpeDetect
462 * PARAMETERS: GpeXruptList - Interrupt block for this interrupt.
463 * Can have multiple GPE blocks attached.
465 * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
467 * DESCRIPTION: Detect if any GP events have occurred. This function is
468 * executed at interrupt level.
470 ******************************************************************************/
474 ACPI_GPE_XRUPT_INFO *GpeXruptList)
476 UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
477 UINT8 EnabledStatusByte;
478 ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
482 ACPI_GPE_BLOCK_INFO *GpeBlock;
487 ACPI_FUNCTION_NAME ("EvGpeDetect");
489 /* Check for the case where there are no GPEs */
496 /* Examine all GPE blocks attached to this interrupt level */
498 AcpiOsAcquireLock (AcpiGbl_GpeLock, ACPI_ISR);
499 GpeBlock = GpeXruptList->GpeBlockListHead;
503 * Read all of the 8-bit GPE status and enable registers
504 * in this GPE block, saving all of them.
505 * Find all currently active GP events.
507 for (i = 0; i < GpeBlock->RegisterCount; i++)
509 /* Get the next status/enable pair */
511 GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
513 /* Read the Status Register */
515 Status = AcpiHwLowLevelRead (ACPI_GPE_REGISTER_WIDTH, &StatusReg,
516 &GpeRegisterInfo->StatusAddress);
517 if (ACPI_FAILURE (Status))
522 /* Read the Enable Register */
524 Status = AcpiHwLowLevelRead (ACPI_GPE_REGISTER_WIDTH, &EnableReg,
525 &GpeRegisterInfo->EnableAddress);
526 if (ACPI_FAILURE (Status))
531 ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
532 "Read GPE Register at GPE%X: Status=%02X, Enable=%02X\n",
533 GpeRegisterInfo->BaseGpeNumber, StatusReg, EnableReg));
535 /* First check if there is anything active at all in this register */
537 EnabledStatusByte = (UINT8) (StatusReg & EnableReg);
538 if (!EnabledStatusByte)
540 /* No active GPEs in this register, move on */
545 /* Now look at the individual GPEs in this byte register */
547 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
549 /* Examine one GPE bit */
551 if (EnabledStatusByte & AcpiGbl_DecodeTo8bit[j])
554 * Found an active GPE. Dispatch the event to a handler
557 IntStatus |= AcpiEvGpeDispatch (
558 &GpeBlock->EventInfo[(i * ACPI_GPE_REGISTER_WIDTH) + j],
559 (UINT32) j + GpeRegisterInfo->BaseGpeNumber);
564 GpeBlock = GpeBlock->Next;
569 AcpiOsReleaseLock (AcpiGbl_GpeLock, ACPI_ISR);
574 /*******************************************************************************
576 * FUNCTION: AcpiEvAsynchExecuteGpeMethod
578 * PARAMETERS: Context (GpeEventInfo) - Info for this GPE
582 * DESCRIPTION: Perform the actual execution of a GPE control method. This
583 * function is called from an invocation of AcpiOsQueueForExecution
584 * (and therefore does NOT execute at interrupt level) so that
585 * the control method itself is not executed in the context of
586 * an interrupt handler.
588 ******************************************************************************/
590 static void ACPI_SYSTEM_XFACE
591 AcpiEvAsynchExecuteGpeMethod (
594 ACPI_GPE_EVENT_INFO *GpeEventInfo = (void *) Context;
595 UINT32 GpeNumber = 0;
597 ACPI_GPE_EVENT_INFO LocalGpeEventInfo;
598 ACPI_PARAMETER_INFO Info;
601 ACPI_FUNCTION_TRACE ("EvAsynchExecuteGpeMethod");
604 Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
605 if (ACPI_FAILURE (Status))
610 /* Must revalidate the GpeNumber/GpeBlock */
612 if (!AcpiEvValidGpeEvent (GpeEventInfo))
614 Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
618 /* Set the GPE flags for return to enabled state */
620 (void) AcpiEvEnableGpe (GpeEventInfo, FALSE);
623 * Take a snapshot of the GPE info for this level - we copy the
624 * info to prevent a race condition with RemoveHandler/RemoveBlock.
626 ACPI_MEMCPY (&LocalGpeEventInfo, GpeEventInfo, sizeof (ACPI_GPE_EVENT_INFO));
628 Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
629 if (ACPI_FAILURE (Status))
635 * Must check for control method type dispatch one more
636 * time to avoid race with EvGpeInstallHandler
638 if ((LocalGpeEventInfo.Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_METHOD)
641 * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx
642 * control method that corresponds to this GPE
644 Info.Node = LocalGpeEventInfo.Dispatch.MethodNode;
645 Info.Parameters = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT *, GpeEventInfo);
646 Info.ParameterType = ACPI_PARAM_GPE;
648 Status = AcpiNsEvaluateByHandle (&Info);
649 if (ACPI_FAILURE (Status))
652 "%s while evaluating method [%4.4s] for GPE[%2X]\n",
653 AcpiFormatException (Status),
654 AcpiUtGetNodeName (LocalGpeEventInfo.Dispatch.MethodNode),
659 if ((LocalGpeEventInfo.Flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_LEVEL_TRIGGERED)
662 * GPE is level-triggered, we clear the GPE status bit after
663 * handling the event.
665 Status = AcpiHwClearGpe (&LocalGpeEventInfo);
666 if (ACPI_FAILURE (Status))
672 /* Enable this GPE */
674 (void) AcpiHwWriteGpeEnableReg (&LocalGpeEventInfo);
679 /*******************************************************************************
681 * FUNCTION: AcpiEvGpeDispatch
683 * PARAMETERS: GpeEventInfo - info for this GPE
684 * GpeNumber - Number relative to the parent GPE block
686 * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
688 * DESCRIPTION: Dispatch a General Purpose Event to either a function (e.g. EC)
689 * or method (e.g. _Lxx/_Exx) handler.
691 * This function executes at interrupt level.
693 ******************************************************************************/
697 ACPI_GPE_EVENT_INFO *GpeEventInfo,
703 ACPI_FUNCTION_TRACE ("EvGpeDispatch");
707 * If edge-triggered, clear the GPE status bit now. Note that
708 * level-triggered events are cleared after the GPE is serviced.
710 if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_EDGE_TRIGGERED)
712 Status = AcpiHwClearGpe (GpeEventInfo);
713 if (ACPI_FAILURE (Status))
715 ACPI_REPORT_ERROR (("AcpiEvGpeDispatch: Unable to clear GPE[%2X]\n",
717 return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
721 /* Save current system state */
723 if (AcpiGbl_SystemAwakeAndRunning)
725 ACPI_SET_BIT (GpeEventInfo->Flags, ACPI_GPE_SYSTEM_RUNNING);
729 ACPI_CLEAR_BIT (GpeEventInfo->Flags, ACPI_GPE_SYSTEM_RUNNING);
733 * Dispatch the GPE to either an installed handler, or the control
734 * method associated with this GPE (_Lxx or _Exx).
735 * If a handler exists, we invoke it and do not attempt to run the method.
736 * If there is neither a handler nor a method, we disable the level to
737 * prevent further events from coming in here.
739 switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
741 case ACPI_GPE_DISPATCH_HANDLER:
744 * Invoke the installed handler (at interrupt level)
745 * Ignore return status for now. TBD: leave GPE disabled on error?
747 (void) GpeEventInfo->Dispatch.Handler->Address (
748 GpeEventInfo->Dispatch.Handler->Context);
750 /* It is now safe to clear level-triggered events. */
752 if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_LEVEL_TRIGGERED)
754 Status = AcpiHwClearGpe (GpeEventInfo);
755 if (ACPI_FAILURE (Status))
758 "AcpiEvGpeDispatch: Unable to clear GPE[%2X]\n",
760 return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
765 case ACPI_GPE_DISPATCH_METHOD:
768 * Disable GPE, so it doesn't keep firing before the method has a
771 Status = AcpiEvDisableGpe (GpeEventInfo);
772 if (ACPI_FAILURE (Status))
775 "AcpiEvGpeDispatch: Unable to disable GPE[%2X]\n",
777 return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
781 * Execute the method associated with the GPE
782 * NOTE: Level-triggered GPEs are cleared after the method completes.
784 if (ACPI_FAILURE (AcpiOsQueueForExecution (OSD_PRIORITY_GPE,
785 AcpiEvAsynchExecuteGpeMethod,
789 "AcpiEvGpeDispatch: Unable to queue handler for GPE[%2X], event is disabled\n",
796 /* No handler or method to run! */
799 "AcpiEvGpeDispatch: No handler or method for GPE[%2X], disabling event\n",
803 * Disable the GPE. The GPE will remain disabled until the ACPI
804 * Core Subsystem is restarted, or a handler is installed.
806 Status = AcpiEvDisableGpe (GpeEventInfo);
807 if (ACPI_FAILURE (Status))
810 "AcpiEvGpeDispatch: Unable to disable GPE[%2X]\n",
812 return_VALUE (ACPI_INTERRUPT_NOT_HANDLED);
817 return_VALUE (ACPI_INTERRUPT_HANDLED);
821 #ifdef ACPI_GPE_NOTIFY_CHECK
823 /*******************************************************************************
824 * TBD: NOT USED, PROTOTYPE ONLY AND WILL PROBABLY BE REMOVED
826 * FUNCTION: AcpiEvCheckForWakeOnlyGpe
828 * PARAMETERS: GpeEventInfo - info for this GPE
832 * DESCRIPTION: Determine if a a GPE is "wake-only".
834 * Called from Notify() code in interpreter when a "DeviceWake"
837 ******************************************************************************/
840 AcpiEvCheckForWakeOnlyGpe (
841 ACPI_GPE_EVENT_INFO *GpeEventInfo)
846 ACPI_FUNCTION_TRACE ("EvCheckForWakeOnlyGpe");
849 if ((GpeEventInfo) && /* Only >0 for _Lxx/_Exx */
850 ((GpeEventInfo->Flags & ACPI_GPE_SYSTEM_MASK) == ACPI_GPE_SYSTEM_RUNNING)) /* System state at GPE time */
852 /* This must be a wake-only GPE, disable it */
854 Status = AcpiEvDisableGpe (GpeEventInfo);
856 /* Set GPE to wake-only. Do not change wake disabled/enabled status */
858 AcpiEvSetGpeType (GpeEventInfo, ACPI_GPE_TYPE_WAKE);
860 ACPI_REPORT_INFO (("GPE %p was updated from wake/run to wake-only\n",
863 /* This was a wake-only GPE */
865 return_ACPI_STATUS (AE_WAKE_ONLY_GPE);
868 return_ACPI_STATUS (AE_OK);