summaryrefslogtreecommitdiff
path: root/source/tools/acpiexec
diff options
context:
space:
mode:
Diffstat (limited to 'source/tools/acpiexec')
-rw-r--r--source/tools/acpiexec/aehandlers.c83
-rw-r--r--source/tools/acpiexec/aemain.c10
-rw-r--r--source/tools/acpiexec/aetables.c2
3 files changed, 85 insertions, 10 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);
diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c
index aa0612c0703f..dbd030135742 100644
--- a/source/tools/acpiexec/aemain.c
+++ b/source/tools/acpiexec/aemain.c
@@ -91,7 +91,8 @@ static char BatchBuffer[AE_BUFFER_SIZE]; /* Batch command buf
static char *FileList[ASL_MAX_FILES];
static AE_TABLE_DESC *AeTableListHead = NULL;
-#define AE_SUPPORTED_OPTIONS "?b:d:e:f:ghm^orv:x:"
+#define ACPIEXEC_NAME "AML Execution/Debug Utility"
+#define AE_SUPPORTED_OPTIONS "?b:d:e:f:ghm^orv^:x:"
/******************************************************************************
@@ -134,6 +135,7 @@ usage (
ACPI_OPTION ("-f <Value>", "Operation Region initialization fill value");
ACPI_OPTION ("-r", "Use hardware-reduced FADT V5");
+ ACPI_OPTION ("-v", "Display version information");
ACPI_OPTION ("-vi", "Verbose initialization output");
ACPI_OPTION ("-vr", "Verbose region handler output");
ACPI_OPTION ("-x <DebugLevel>", "Debug output level");
@@ -302,6 +304,10 @@ AeDoOptions (
switch (AcpiGbl_Optarg[0])
{
+ case '^': /* -v: (Version): signon already emitted, just exit */
+
+ exit (0);
+
case 'i':
AcpiDbgLevel |= ACPI_LV_INIT_NAMES;
@@ -366,7 +372,7 @@ main (
ACPI_DEBUG_INITIALIZE (); /* For debug version only */
- printf (ACPI_COMMON_SIGNON ("AML Execution/Debug Utility"));
+ printf (ACPI_COMMON_SIGNON (ACPIEXEC_NAME));
if (argc < 2)
{
usage ();
diff --git a/source/tools/acpiexec/aetables.c b/source/tools/acpiexec/aetables.c
index a32c4c54dea8..1ba876e25333 100644
--- a/source/tools/acpiexec/aetables.c
+++ b/source/tools/acpiexec/aetables.c
@@ -247,7 +247,7 @@ AeBuildLocalTables (
/* Build an RSDP */
ACPI_MEMSET (&LocalRSDP, 0, sizeof (ACPI_TABLE_RSDP));
- ACPI_MEMCPY (LocalRSDP.Signature, ACPI_SIG_RSDP, 8);
+ ACPI_MAKE_RSDP_SIG (LocalRSDP.Signature);
ACPI_MEMCPY (LocalRSDP.OemId, "I_TEST", 6);
LocalRSDP.Revision = 2;
LocalRSDP.XsdtPhysicalAddress = ACPI_PTR_TO_PHYSADDR (LocalXSDT);