Print this page
update to acpica-unix2-20131218
acpica-unix2-20130823
PANKOVs restructure

*** 3,13 **** * Module Name: evgpeutil - GPE utilities * *****************************************************************************/ /* ! * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: --- 3,13 ---- * Module Name: evgpeutil - GPE utilities * *****************************************************************************/ /* ! * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met:
*** 39,57 **** * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. */ - #include "acpi.h" #include "accommon.h" #include "acevents.h" #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpeutil") /******************************************************************************* * * FUNCTION: AcpiEvWalkGpeList * * PARAMETERS: GpeWalkCallback - Routine called for each GPE block --- 39,57 ---- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. */ #include "acpi.h" #include "accommon.h" #include "acevents.h" #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpeutil") + #if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * * FUNCTION: AcpiEvWalkGpeList * * PARAMETERS: GpeWalkCallback - Routine called for each GPE block
*** 215,237 **** /******************************************************************************* * * FUNCTION: AcpiEvGetGpeXruptBlock * * PARAMETERS: InterruptNumber - Interrupt for a GPE block * ! * RETURN: A GPE interrupt block * * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt * block per unique interrupt level used for GPEs. Should be * called only when the GPE lists are semaphore locked and not * subject to change. * ******************************************************************************/ ! ACPI_GPE_XRUPT_INFO * AcpiEvGetGpeXruptBlock ( ! UINT32 InterruptNumber) { ACPI_GPE_XRUPT_INFO *NextGpeXrupt; ACPI_GPE_XRUPT_INFO *GpeXrupt; ACPI_STATUS Status; ACPI_CPU_FLAGS Flags; --- 215,239 ---- /******************************************************************************* * * FUNCTION: AcpiEvGetGpeXruptBlock * * PARAMETERS: InterruptNumber - Interrupt for a GPE block + * GpeXruptBlock - Where the block is returned * ! * RETURN: Status * * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt * block per unique interrupt level used for GPEs. Should be * called only when the GPE lists are semaphore locked and not * subject to change. * ******************************************************************************/ ! ACPI_STATUS AcpiEvGetGpeXruptBlock ( ! UINT32 InterruptNumber, ! ACPI_GPE_XRUPT_INFO **GpeXruptBlock) { ACPI_GPE_XRUPT_INFO *NextGpeXrupt; ACPI_GPE_XRUPT_INFO *GpeXrupt; ACPI_STATUS Status; ACPI_CPU_FLAGS Flags;
*** 245,255 **** NextGpeXrupt = AcpiGbl_GpeXruptListHead; while (NextGpeXrupt) { if (NextGpeXrupt->InterruptNumber == InterruptNumber) { ! return_PTR (NextGpeXrupt); } NextGpeXrupt = NextGpeXrupt->Next; } --- 247,258 ---- NextGpeXrupt = AcpiGbl_GpeXruptListHead; while (NextGpeXrupt) { if (NextGpeXrupt->InterruptNumber == InterruptNumber) { ! *GpeXruptBlock = NextGpeXrupt; ! return_ACPI_STATUS (AE_OK); } NextGpeXrupt = NextGpeXrupt->Next; }
*** 256,266 **** /* Not found, must allocate a new xrupt descriptor */ GpeXrupt = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_XRUPT_INFO)); if (!GpeXrupt) { ! return_PTR (NULL); } GpeXrupt->InterruptNumber = InterruptNumber; /* Install new interrupt descriptor with spin lock */ --- 259,269 ---- /* Not found, must allocate a new xrupt descriptor */ GpeXrupt = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_XRUPT_INFO)); if (!GpeXrupt) { ! return_ACPI_STATUS (AE_NO_MEMORY); } GpeXrupt->InterruptNumber = InterruptNumber; /* Install new interrupt descriptor with spin lock */
*** 279,288 **** --- 282,292 ---- } else { AcpiGbl_GpeXruptListHead = GpeXrupt; } + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); /* Install new interrupt handler if not SCI_INT */ if (InterruptNumber != AcpiGbl_FADT.SciInterrupt)
*** 289,306 **** { Status = AcpiOsInstallInterruptHandler (InterruptNumber, AcpiEvGpeXruptHandler, GpeXrupt); if (ACPI_FAILURE (Status)) { ! ACPI_ERROR ((AE_INFO, "Could not install GPE interrupt handler at level 0x%X", InterruptNumber)); ! return_PTR (NULL); } } ! return_PTR (GpeXrupt); } /******************************************************************************* * --- 293,311 ---- { Status = AcpiOsInstallInterruptHandler (InterruptNumber, AcpiEvGpeXruptHandler, GpeXrupt); if (ACPI_FAILURE (Status)) { ! ACPI_EXCEPTION ((AE_INFO, Status, "Could not install GPE interrupt handler at level 0x%X", InterruptNumber)); ! return_ACPI_STATUS (Status); } } ! *GpeXruptBlock = GpeXrupt; ! return_ACPI_STATUS (AE_OK); } /******************************************************************************* *
*** 389,398 **** --- 394,405 ---- ACPI_GPE_XRUPT_INFO *GpeXruptInfo, ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context) { ACPI_GPE_EVENT_INFO *GpeEventInfo; + ACPI_GPE_NOTIFY_INFO *Notify; + ACPI_GPE_NOTIFY_INFO *Next; UINT32 i; UINT32 j; ACPI_FUNCTION_TRACE (EvDeleteGpeHandlers);
*** 410,424 **** --- 417,449 ---- ACPI_GPE_REGISTER_WIDTH) + j]; if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) { + /* Delete an installed handler block */ + ACPI_FREE (GpeEventInfo->Dispatch.Handler); GpeEventInfo->Dispatch.Handler = NULL; GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK; } + else if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == + ACPI_GPE_DISPATCH_NOTIFY) + { + /* Delete the implicit notification device list */ + + Notify = GpeEventInfo->Dispatch.NotifyList; + while (Notify) + { + Next = Notify->Next; + ACPI_FREE (Notify); + Notify = Next; } + GpeEventInfo->Dispatch.NotifyList = NULL; + GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK; } + } + } return_ACPI_STATUS (AE_OK); } + #endif /* !ACPI_REDUCED_HARDWARE */