aboutsummaryrefslogtreecommitdiff
path: root/source/tools/acpiexec/aehandlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/tools/acpiexec/aehandlers.c')
-rw-r--r--source/tools/acpiexec/aehandlers.c83
1 files changed, 76 insertions, 7 deletions
diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c
index 44ce31fdebc3..5272f4170133 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);