Skip to content

Commit

Permalink
Events: Cleanup to move AcpiGbl_GlobalEventHandler invocation out of …
Browse files Browse the repository at this point in the history
…AcpiEvGpeDispatch().

This patch follows AcpiEvFixedEventDetect(), which invokes
AcpiGbl_GlobalEventHandler instead of invoking it in
AcpiEvFixedEventDispatch(), moves AcpiGbl_GlobalEventHandler from
AcpiEvGpeDispatch() to AcpiEvGpeDetect(). This makes further cleanups
around AcpiEvGpeDispatch() simpler. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Lv Zheng committed Dec 11, 2014
1 parent b2b18bb commit 04f25ac
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions source/components/events/evgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,10 @@ AcpiEvGpeDetect (
{
ACPI_STATUS Status;
ACPI_GPE_BLOCK_INFO *GpeBlock;
ACPI_NAMESPACE_NODE *GpeDevice;
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
UINT32 GpeNumber;
UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
UINT8 EnabledStatusByte;
UINT32 StatusReg;
Expand Down Expand Up @@ -474,6 +477,8 @@ AcpiEvGpeDetect (
GpeBlock = GpeXruptList->GpeBlockListHead;
while (GpeBlock)
{
GpeDevice = GpeBlock->Node;

/*
* Read all of the 8-bit GPE status and enable registers in this GPE
* block, saving all of them. Find all currently active GP events.
Expand Down Expand Up @@ -542,16 +547,28 @@ AcpiEvGpeDetect (
{
/* Examine one GPE bit */

GpeEventInfo = &GpeBlock->EventInfo[((ACPI_SIZE) i *
ACPI_GPE_REGISTER_WIDTH) + j];
GpeNumber = j + GpeRegisterInfo->BaseGpeNumber;

if (EnabledStatusByte & (1 << j))
{
/* Invoke global event handler if present */

AcpiGpeCount++;
if (AcpiGbl_GlobalEventHandler)
{
AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE,
GpeDevice, GpeNumber,
AcpiGbl_GlobalEventHandlerContext);
}

/*
* Found an active GPE. Dispatch the event to a handler
* or method.
*/
IntStatus |= AcpiEvGpeDispatch (GpeBlock->Node,
&GpeBlock->EventInfo[((ACPI_SIZE) i *
ACPI_GPE_REGISTER_WIDTH) + j],
j + GpeRegisterInfo->BaseGpeNumber);
IntStatus |= AcpiEvGpeDispatch (GpeDevice,
GpeEventInfo, GpeNumber);
}
}
}
Expand Down Expand Up @@ -775,15 +792,6 @@ AcpiEvGpeDispatch (
ACPI_FUNCTION_TRACE (EvGpeDispatch);


/* Invoke global event handler if present */

AcpiGpeCount++;
if (AcpiGbl_GlobalEventHandler)
{
AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE, GpeDevice,
GpeNumber, AcpiGbl_GlobalEventHandlerContext);
}

/*
* Always disable the GPE so that it does not keep firing before
* any asynchronous activity completes (either from the execution
Expand Down

0 comments on commit 04f25ac

Please sign in to comment.