Merge pull request #473 from SchmErik/remove-module-level-code

remove legacy module-level code due to deprecation
This commit is contained in:
Robert Moore 2019-05-29 13:18:40 -07:00 committed by GitHub
commit fa068aaecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 0 additions and 280 deletions

View File

@ -166,12 +166,6 @@
* Things like Events, Global Lock, etc. are not used
* by the compiler, so they are stubbed out here.
*/
void
AcpiNsExecModuleCodeList (
void)
{
}
ACPI_STATUS
AcpiNsInitializeObjects (
void)

View File

@ -160,13 +160,6 @@
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nseval")
/* Local prototypes */
static void
AcpiNsExecModuleCode (
ACPI_OPERAND_OBJECT *MethodObj,
ACPI_EVALUATE_INFO *Info);
/*******************************************************************************
*
@ -465,206 +458,3 @@ Cleanup:
Info->FullPathname = NULL;
return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
* FUNCTION: AcpiNsExecModuleCodeList
*
* PARAMETERS: None
*
* RETURN: None. Exceptions during method execution are ignored, since
* we cannot abort a table load.
*
* DESCRIPTION: Execute all elements of the global module-level code list.
* Each element is executed as a single control method.
*
* NOTE: With this option enabled, 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. The methods on this
* list are executed 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.
*
******************************************************************************/
void
AcpiNsExecModuleCodeList (
void)
{
ACPI_OPERAND_OBJECT *Prev;
ACPI_OPERAND_OBJECT *Next;
ACPI_EVALUATE_INFO *Info;
UINT32 MethodCount = 0;
ACPI_FUNCTION_TRACE (NsExecModuleCodeList);
/* Exit now if the list is empty */
Next = AcpiGbl_ModuleCodeList;
if (!Next)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INIT_NAMES,
"Legacy MLC block list is empty\n"));
return_VOID;
}
/* Allocate the evaluation information block */
Info = ACPI_ALLOCATE (sizeof (ACPI_EVALUATE_INFO));
if (!Info)
{
return_VOID;
}
/* Walk the list, executing each "method" */
while (Next)
{
Prev = Next;
Next = Next->Method.Mutex;
/* Clear the link field and execute the method */
Prev->Method.Mutex = NULL;
AcpiNsExecModuleCode (Prev, Info);
MethodCount++;
/* Delete the (temporary) method object */
AcpiUtRemoveReference (Prev);
}
ACPI_INFO ((
"Executed %u blocks of module-level executable AML code",
MethodCount));
ACPI_FREE (Info);
AcpiGbl_ModuleCodeList = NULL;
return_VOID;
}
/*******************************************************************************
*
* FUNCTION: AcpiNsExecModuleCode
*
* PARAMETERS: MethodObj - Object container for the module-level code
* Info - Info block for method evaluation
*
* RETURN: None. Exceptions during method execution are ignored, since
* we cannot abort a table load.
*
* DESCRIPTION: Execute a control method containing a block of module-level
* executable AML code. The control method is temporarily
* installed to the root node, then evaluated.
*
******************************************************************************/
static void
AcpiNsExecModuleCode (
ACPI_OPERAND_OBJECT *MethodObj,
ACPI_EVALUATE_INFO *Info)
{
ACPI_OPERAND_OBJECT *ParentObj;
ACPI_NAMESPACE_NODE *ParentNode;
ACPI_OBJECT_TYPE Type;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (NsExecModuleCode);
/*
* Get the parent node. We cheat by using the NextObject field
* of the method object descriptor.
*/
ParentNode = ACPI_CAST_PTR (
ACPI_NAMESPACE_NODE, MethodObj->Method.NextObject);
Type = AcpiNsGetType (ParentNode);
/*
* Get the region handler and save it in the method object. We may need
* this if an operation region declaration causes a _REG method to be run.
*
* We can't do this in AcpiPsLinkModuleCode because
* AcpiGbl_RootNode->Object is NULL at PASS1.
*/
if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object)
{
MethodObj->Method.Dispatch.Handler =
ParentNode->Object->Device.Handler;
}
/* Must clear NextObject (AcpiNsAttachObject needs the field) */
MethodObj->Method.NextObject = NULL;
/* Initialize the evaluation information block */
memset (Info, 0, sizeof (ACPI_EVALUATE_INFO));
Info->PrefixNode = ParentNode;
/*
* Get the currently attached parent object. Add a reference,
* because the ref count will be decreased when the method object
* is installed to the parent node.
*/
ParentObj = AcpiNsGetAttachedObject (ParentNode);
if (ParentObj)
{
AcpiUtAddReference (ParentObj);
}
/* Install the method (module-level code) in the parent node */
Status = AcpiNsAttachObject (ParentNode, MethodObj, ACPI_TYPE_METHOD);
if (ACPI_FAILURE (Status))
{
goto Exit;
}
/* Execute the parent node as a control method */
Status = AcpiNsEvaluate (Info);
ACPI_DEBUG_PRINT ((ACPI_DB_INIT_NAMES,
"Executed module-level code at %p\n",
MethodObj->Method.AmlStart));
/* Delete a possible implicit return value (in slack mode) */
if (Info->ReturnObject)
{
AcpiUtRemoveReference (Info->ReturnObject);
}
/* Detach the temporary method object */
AcpiNsDetachObject (ParentNode);
/* Restore the original parent object */
if (ParentObj)
{
Status = AcpiNsAttachObject (ParentNode, ParentObj, Type);
}
else
{
ParentNode->Type = (UINT8) Type;
}
Exit:
if (ParentObj)
{
AcpiUtRemoveReference (ParentObj);
}
return_VOID;
}

View File

@ -268,18 +268,6 @@ Unlock:
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"**** Completed Table Object Initialization\n"));
/*
* 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.
*/
AcpiNsExecModuleCodeList ();
return_ACPI_STATUS (Status);
}

View File

@ -802,24 +802,11 @@ AcpiNsTerminate (
void)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *Prev;
ACPI_OPERAND_OBJECT *Next;
ACPI_FUNCTION_TRACE (NsTerminate);
/* Delete any module-level code blocks */
Next = AcpiGbl_ModuleCodeList;
while (Next)
{
Prev = Next;
Next = Next->Method.Mutex;
Prev->Method.Mutex = NULL; /* Clear the Mutex (cheated) field */
AcpiUtRemoveReference (Prev);
}
/*
* Free the entire namespace -- all nodes and all objects
* attached to the nodes

View File

@ -1190,19 +1190,6 @@ AcpiTbLoadTable (
Status = AcpiNsLoadTable (TableIndex, ParentNode);
/*
* 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.
*/
AcpiNsExecModuleCodeList ();
/*
* Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
* responsible for discovering any new wake GPEs by running _PRW methods

View File

@ -342,7 +342,6 @@ AcpiUtInitGlobals (
/* Namespace */
AcpiGbl_ModuleCodeList = NULL;
AcpiGbl_RootNode = NULL;
AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;

View File

@ -381,19 +381,6 @@ AcpiInitializeObjects (
ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
/*
* 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.
*/
AcpiNsExecModuleCodeList ();
/*
* Initialize the objects that remain uninitialized. This
* runs the executable AML that may be part of the

View File

@ -323,7 +323,6 @@ ACPI_GLOBAL (BOOLEAN, AcpiGbl_VerboseLeakDump);
ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct);
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode);
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_FadtGpeDevice);
ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_ModuleCodeList);
extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES];
extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES];

View File

@ -419,10 +419,6 @@ ACPI_STATUS
AcpiNsEvaluate (
ACPI_EVALUATE_INFO *Info);
void
AcpiNsExecModuleCodeList (
void);
/*
* nsarguments - Argument count/type checking for predefined/reserved names

View File

@ -301,13 +301,6 @@ AcpiNsEvaluate (
return (AE_NOT_IMPLEMENTED);
}
void
AcpiNsExecModuleCodeList (
void)
{
return;
}
void
AcpiExDoDebugObject (
ACPI_OPERAND_OBJECT *SourceDesc,