summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2019-01-18 09:53:03 -0800
committerGitHub <noreply@github.com>2019-01-18 09:53:03 -0800
commit7c1aa540d39f021b598d1330134dbf969cf9b018 (patch)
treeb80be640ff03397336985f221e32399d24a54913
parent349dd29335d6928f883bc95c614a0edd033141bb (diff)
parent47f5607c204719d9239a12b889df725225098c8f (diff)
downloadacpica-7c1aa540d39f021b598d1330134dbf969cf9b018.tar.gz
Merge pull request #437 from SchmErik/remove-legacy-module-level-code
Remove legacy module-level code support
-rw-r--r--source/components/events/evrgnini.c18
-rw-r--r--source/components/namespace/nsparse.c70
-rw-r--r--source/components/parser/psloop.c195
-rw-r--r--source/components/tables/tbxfload.c26
-rw-r--r--source/include/acpixf.h8
-rw-r--r--source/tools/acpiexec/aemain.c11
-rw-r--r--source/tools/acpinames/anmain.c2
7 files changed, 21 insertions, 309 deletions
diff --git a/source/components/events/evrgnini.c b/source/components/events/evrgnini.c
index a5234a21c..718e2e87d 100644
--- a/source/components/events/evrgnini.c
+++ b/source/components/events/evrgnini.c
@@ -724,24 +724,6 @@ AcpiEvInitializeRegion (
HandlerObj = ObjDesc->CommonNotify.Handler;
break;
- case ACPI_TYPE_METHOD:
- /*
- * If we are executing module level code, the original
- * Node's object was replaced by this Method object and we
- * saved the handler in the method object.
- *
- * Note: Only used for the legacy MLC support. Will
- * be removed in the future.
- *
- * See AcpiNsExecModuleCode
- */
- if (!AcpiGbl_ExecuteTablesAsMethods &&
- ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)
- {
- HandlerObj = ObjDesc->Method.Dispatch.Handler;
- }
- break;
-
default:
/* Ignore other objects */
diff --git a/source/components/namespace/nsparse.c b/source/components/namespace/nsparse.c
index 1aa568cb6..e559223a1 100644
--- a/source/components/namespace/nsparse.c
+++ b/source/components/namespace/nsparse.c
@@ -422,66 +422,18 @@ AcpiNsParseTable (
ACPI_FUNCTION_TRACE (NsParseTable);
- if (AcpiGbl_ExecuteTablesAsMethods)
- {
- /*
- * This case executes the AML table as one large control method.
- * The point of this is to execute any module-level code in-place
- * as the table is parsed. Some AML code depends on this behavior.
- *
- * It is a run-time option at this time, but will eventually become
- * the default.
- *
- * Note: This causes the table to only have a single-pass parse.
- * However, this is compatible with other ACPI implementations.
- */
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
- "%s: **** Start table execution pass\n", ACPI_GET_FUNCTION_NAME));
-
- Status = AcpiNsExecuteTable (TableIndex, StartNode);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
- else
- {
- /*
- * AML Parse, pass 1
- *
- * In this pass, we load most of the namespace. Control methods
- * are not parsed until later. A parse tree is not created.
- * Instead, each Parser Op subtree is deleted when it is finished.
- * This saves a great deal of memory, and allows a small cache of
- * parse objects to service the entire parse. The second pass of
- * the parse then performs another complete parse of the AML.
- */
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 1\n"));
-
- Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS1,
- TableIndex, StartNode);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
+ /*
+ * Executes the AML table as one large control method.
+ * The point of this is to execute any module-level code in-place
+ * as the table is parsed. Some AML code depends on this behavior.
+ *
+ * Note: This causes the table to only have a single-pass parse.
+ * However, this is compatible with other ACPI implementations.
+ */
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
+ "%s: **** Start table execution pass\n", ACPI_GET_FUNCTION_NAME));
- /*
- * AML Parse, pass 2
- *
- * In this pass, we resolve forward references and other things
- * that could not be completed during the first pass.
- * Another complete parse of the AML is performed, but the
- * overhead of this is compensated for by the fact that the
- * parse objects are all cached.
- */
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 2\n"));
- Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS2,
- TableIndex, StartNode);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
- }
+ Status = AcpiNsExecuteTable (TableIndex, StartNode);
return_ACPI_STATUS (Status);
}
diff --git a/source/components/parser/psloop.c b/source/components/parser/psloop.c
index 127850a63..7398c3df2 100644
--- a/source/components/parser/psloop.c
+++ b/source/components/parser/psloop.c
@@ -178,13 +178,6 @@ AcpiPsGetArguments (
UINT8 *AmlOpStart,
ACPI_PARSE_OBJECT *Op);
-static void
-AcpiPsLinkModuleCode (
- ACPI_PARSE_OBJECT *ParentOp,
- UINT8 *AmlStart,
- UINT32 AmlLength,
- ACPI_OWNER_ID OwnerId);
-
/*******************************************************************************
*
@@ -208,7 +201,6 @@ AcpiPsGetArguments (
{
ACPI_STATUS Status = AE_OK;
ACPI_PARSE_OBJECT *Arg = NULL;
- const ACPI_OPCODE_INFO *OpInfo;
ACPI_FUNCTION_TRACE_PTR (PsGetArguments, WalkState);
@@ -287,82 +279,6 @@ AcpiPsGetArguments (
"Final argument count: %8.8X pass %u\n",
WalkState->ArgCount, WalkState->PassNumber));
- /*
- * This case handles the legacy option that groups all module-level
- * code blocks together and defers execution until all of the tables
- * are loaded. Execute all of these blocks at this time.
- * Execute any module-level code that was detected during the table
- * load phase.
- *
- * Note: this option is deprecated and will be eliminated in the
- * future. Use of this option can cause problems with AML code that
- * depends upon in-order immediate execution of module-level code.
- */
- if (!AcpiGbl_ExecuteTablesAsMethods &&
- (WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) &&
- ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) == 0))
- {
- /*
- * We want to skip If/Else/While constructs during Pass1 because we
- * want to actually conditionally execute the code during Pass2.
- *
- * Except for disassembly, where we always want to walk the
- * If/Else/While packages
- */
- switch (Op->Common.AmlOpcode)
- {
- case AML_IF_OP:
- case AML_ELSE_OP:
- case AML_WHILE_OP:
- /*
- * Currently supported module-level opcodes are:
- * IF/ELSE/WHILE. These appear to be the most common,
- * and easiest to support since they open an AML
- * package.
- */
- if (WalkState->PassNumber == ACPI_IMODE_LOAD_PASS1)
- {
- AcpiPsLinkModuleCode (Op->Common.Parent, AmlOpStart,
- (UINT32) (WalkState->ParserState.PkgEnd - AmlOpStart),
- WalkState->OwnerId);
- }
-
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
- "Pass1: Skipping an If/Else/While body\n"));
-
- /* Skip body of if/else/while in pass 1 */
-
- WalkState->ParserState.Aml = WalkState->ParserState.PkgEnd;
- WalkState->ArgCount = 0;
- break;
-
- default:
- /*
- * Check for an unsupported executable opcode at module
- * level. We must be in PASS1, the parent must be a SCOPE,
- * The opcode class must be EXECUTE, and the opcode must
- * not be an argument to another opcode.
- */
- if ((WalkState->PassNumber == ACPI_IMODE_LOAD_PASS1) &&
- (Op->Common.Parent->Common.AmlOpcode == AML_SCOPE_OP))
- {
- OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
- if ((OpInfo->Class == AML_CLASS_EXECUTE) &&
- (!Arg))
- {
- ACPI_WARNING ((AE_INFO,
- "Unsupported module-level executable opcode "
- "0x%.2X at table offset 0x%.4X",
- Op->Common.AmlOpcode,
- (UINT32) (ACPI_PTR_DIFF (AmlOpStart,
- WalkState->ParserState.AmlStart) +
- sizeof (ACPI_TABLE_HEADER))));
- }
- }
- break;
- }
- }
-
/* Special processing for certain opcodes */
switch (Op->Common.AmlOpcode)
@@ -436,117 +352,6 @@ AcpiPsGetArguments (
/*******************************************************************************
*
- * FUNCTION: AcpiPsLinkModuleCode
- *
- * PARAMETERS: ParentOp - Parent parser op
- * AmlStart - Pointer to the AML
- * AmlLength - Length of executable AML
- * OwnerId - OwnerId of module level code
- *
- * RETURN: None.
- *
- * DESCRIPTION: Wrap the module-level code with a method object and link the
- * object to the global list. Note, the mutex field of the method
- * object is used to link multiple module-level code objects.
- *
- * NOTE: In this legacy option, each block of detected executable AML
- * code that is outside of any control method is wrapped with a temporary
- * control method object and placed on a global list below.
- *
- * This function executes the module-level code for all tables only after
- * all of the tables have been loaded. It is a legacy option and is
- * not compatible with other ACPI implementations. See AcpiNsLoadTable.
- *
- * This function will be removed when the legacy option is removed.
- *
- ******************************************************************************/
-
-static void
-AcpiPsLinkModuleCode (
- ACPI_PARSE_OBJECT *ParentOp,
- UINT8 *AmlStart,
- UINT32 AmlLength,
- ACPI_OWNER_ID OwnerId)
-{
- ACPI_OPERAND_OBJECT *Prev;
- ACPI_OPERAND_OBJECT *Next;
- ACPI_OPERAND_OBJECT *MethodObj;
- ACPI_NAMESPACE_NODE *ParentNode;
-
-
- ACPI_FUNCTION_TRACE (PsLinkModuleCode);
-
-
- /* Get the tail of the list */
-
- Prev = Next = AcpiGbl_ModuleCodeList;
- while (Next)
- {
- Prev = Next;
- Next = Next->Method.Mutex;
- }
-
- /*
- * Insert the module level code into the list. Merge it if it is
- * adjacent to the previous element.
- */
- if (!Prev ||
- ((Prev->Method.AmlStart + Prev->Method.AmlLength) != AmlStart))
- {
- /* Create, initialize, and link a new temporary method object */
-
- MethodObj = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
- if (!MethodObj)
- {
- return_VOID;
- }
-
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
- "Create/Link new code block: %p\n", MethodObj));
-
- if (ParentOp->Common.Node)
- {
- ParentNode = ParentOp->Common.Node;
- }
- else
- {
- ParentNode = AcpiGbl_RootNode;
- }
-
- MethodObj->Method.AmlStart = AmlStart;
- MethodObj->Method.AmlLength = AmlLength;
- MethodObj->Method.OwnerId = OwnerId;
- MethodObj->Method.InfoFlags |= ACPI_METHOD_MODULE_LEVEL;
-
- /*
- * Save the parent node in NextObject. This is cheating, but we
- * don't want to expand the method object.
- */
- MethodObj->Method.NextObject =
- ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ParentNode);
-
- if (!Prev)
- {
- AcpiGbl_ModuleCodeList = MethodObj;
- }
- else
- {
- Prev->Method.Mutex = MethodObj;
- }
- }
- else
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
- "Appending to existing code block: %p\n", Prev));
-
- Prev->Method.AmlLength += AmlLength;
- }
-
- return_VOID;
-}
-
-/*******************************************************************************
- *
* FUNCTION: AcpiPsParseLoop
*
* PARAMETERS: WalkState - Current state
diff --git a/source/components/tables/tbxfload.c b/source/components/tables/tbxfload.c
index a3168c5c0..bda55ea2a 100644
--- a/source/components/tables/tbxfload.c
+++ b/source/components/tables/tbxfload.c
@@ -219,25 +219,19 @@ AcpiLoadTables (
"While loading namespace from ACPI tables"));
}
- if (AcpiGbl_ExecuteTablesAsMethods)
+ /*
+ * Initialize the objects in the namespace that remain uninitialized.
+ * This runs the executable AML that may be part of the declaration of
+ * these name objects:
+ * OperationRegions, BufferFields, Buffers, and Packages.
+ *
+ */
+ Status = AcpiNsInitializeObjects ();
+ if (ACPI_SUCCESS (Status))
{
- /*
- * If the module-level code support is enabled, initialize the objects
- * in the namespace that remain uninitialized. This runs the executable
- * AML that may be part of the declaration of these name objects:
- * OperationRegions, BufferFields, Buffers, and Packages.
- *
- * Note: The module-level code is optional at this time, but will
- * become the default in the future.
- */
- Status = AcpiNsInitializeObjects ();
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
+ AcpiGbl_NamespaceInitialized = TRUE;
}
- AcpiGbl_NamespaceInitialized = TRUE;
return_ACPI_STATUS (Status);
}
diff --git a/source/include/acpixf.h b/source/include/acpixf.h
index c57be658e..15c0e2586 100644
--- a/source/include/acpixf.h
+++ b/source/include/acpixf.h
@@ -301,14 +301,6 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE);
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
/*
- * Optionally support module level code by parsing an entire table as
- * a method as it is loaded. Default is TRUE.
- * NOTE, this is essentially obsolete and will be removed soon
- * (01/2018).
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_ExecuteTablesAsMethods, TRUE);
-
-/*
* Optionally use 32-bit FADT addresses if and when there is a conflict
* (address mismatch) between the 32-bit and 64-bit versions of the
* address. Although ACPICA adheres to the ACPI specification which
diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c
index 4f41edbd2..9ee25805b 100644
--- a/source/tools/acpiexec/aemain.c
+++ b/source/tools/acpiexec/aemain.c
@@ -255,8 +255,6 @@ usage (
ACPI_OPTION ("-df", "Disable Local fault handler");
ACPI_OPTION ("-di", "Disable execution of STA/INI methods during init");
ACPI_OPTION ("-do", "Disable Operation Region address simulation");
- ACPI_OPTION ("-dp", "Disable loading DSDT/SSDT as a control method\n"
- " (enable legacy grouping of module-level code)");
ACPI_OPTION ("-dr", "Disable repair of method return values");
ACPI_OPTION ("-ds", "Disable method auto-serialization");
ACPI_OPTION ("-dt", "Disable allocation tracking (performance)");
@@ -353,11 +351,6 @@ AeDoOptions (
AcpiGbl_DbOpt_NoRegionSupport = TRUE;
break;
- case 'p':
-
- AcpiGbl_ExecuteTablesAsMethods = FALSE;
- break;
-
case 'r':
AcpiGbl_DisableAutoRepair = TRUE;
@@ -630,10 +623,6 @@ main (
AcpiDbgLevel = ACPI_NORMAL_DEFAULT;
AcpiDbgLayer = 0xFFFFFFFF;
- /* Module-level code. Use new architecture */
-
- AcpiGbl_ExecuteTablesAsMethods = TRUE;
-
/*
* Initialize ACPICA and start debugger thread.
*
diff --git a/source/tools/acpinames/anmain.c b/source/tools/acpinames/anmain.c
index f2f12122c..91b55215e 100644
--- a/source/tools/acpinames/anmain.c
+++ b/source/tools/acpinames/anmain.c
@@ -239,8 +239,6 @@ main (
/* Set flags so that the interpreter is not used */
- AcpiGbl_ExecuteTablesAsMethods = FALSE;
-
Status = AcpiInitializeSubsystem ();
ACPI_CHECK_OK (AcpiInitializeSubsystem, Status);
if (ACPI_FAILURE (Status))