diff options
author | jkim <jkim@FreeBSD.org> | 2013-08-23 18:01:58 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2013-08-23 18:01:58 +0000 |
commit | b2a92415360aacb32d9b6107bdcf100d16d09167 (patch) | |
tree | 89234dd9f502de2faaf4a280ccd0d3785a7ae96f /source/tools/acpiexec/aehandlers.c | |
parent | 8e9a373708032aaf58694e237e3889d7d3fd796f (diff) | |
download | FreeBSD-src-b2a92415360aacb32d9b6107bdcf100d16d09167.zip FreeBSD-src-b2a92415360aacb32d9b6107bdcf100d16d09167.tar.gz |
Import ACPICA 20130823.
Diffstat (limited to 'source/tools/acpiexec/aehandlers.c')
-rw-r--r-- | source/tools/acpiexec/aehandlers.c | 83 |
1 files changed, 76 insertions, 7 deletions
diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c index 44ce31f..5272f41 100644 --- a/source/tools/acpiexec/aehandlers.c +++ b/source/tools/acpiexec/aehandlers.c @@ -126,6 +126,10 @@ static UINT32 AeEventHandler ( void *Context); +static UINT32 +AeSciHandler ( + void *Context); + static char *TableEvents[] = { "LOAD", @@ -632,9 +636,9 @@ AeInterfaceHandler ( #if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * - * FUNCTION: AeEventHandler + * FUNCTION: AeEventHandler, AeSciHandler * - * DESCRIPTION: Handler for Fixed Events + * DESCRIPTION: Handler for Fixed Events and SCIs * *****************************************************************************/ @@ -644,6 +648,16 @@ AeEventHandler ( { return (0); } + +static UINT32 +AeSciHandler ( + void *Context) +{ + + AcpiOsPrintf ("[AcpiExec] Received an SCI at handler\n"); + return (0); +} + #endif /* !ACPI_REDUCED_HARDWARE */ @@ -666,10 +680,15 @@ AeRegionInit ( void *HandlerContext, void **RegionContext) { - /* - * Real simple, set the RegionContext to the RegionHandle - */ - *RegionContext = RegionHandle; + + if (Function == ACPI_REGION_DEACTIVATE) + { + *RegionContext = NULL; + } + else + { + *RegionContext = RegionHandle; + } return (AE_OK); } @@ -677,6 +696,51 @@ AeRegionInit ( /******************************************************************************* * + * FUNCTION: AeInstallSciHandler + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Install handler for SCIs. Exercise the code by doing an + * install/remove/install. + * + ******************************************************************************/ + +static ACPI_STATUS +AeInstallSciHandler ( + void) +{ + ACPI_STATUS Status; + + + Status = AcpiInstallSciHandler (AeSciHandler, &AeMyContext); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "Could not install an SCI handler (1)")); + } + + Status = AcpiRemoveSciHandler (AeSciHandler); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "Could not remove an SCI handler")); + } + + Status = AcpiInstallSciHandler (AeSciHandler, &AeMyContext); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "Could not install an SCI handler (2)")); + } + + return (Status); +} + + +/******************************************************************************* + * * FUNCTION: AeInstallDeviceHandlers, AeInstallEcHandler, * AeInstallPciHandler * @@ -685,7 +749,7 @@ AeRegionInit ( * RETURN: Status * * DESCRIPTION: Walk entire namespace, install a handler for every EC - * device found. + * and PCI device found. * ******************************************************************************/ @@ -785,6 +849,11 @@ AeInstallLateHandlers ( #if (!ACPI_REDUCED_HARDWARE) if (!AcpiGbl_ReducedHardware) { + /* Install a user SCI handler */ + + Status = AeInstallSciHandler (); + AE_CHECK_OK (AeInstallSciHandler, Status); + /* Install some fixed event handlers */ Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL, AeEventHandler, NULL); |