Skip to content

Commit

Permalink
remove legacy module-level code due to deprecation
Browse files Browse the repository at this point in the history
There have been several places that has been calling functions
regarding module level code blocks. This change removes all old
vestiges in the codebase. This is dead code.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
  • Loading branch information
Erik Schmauss committed May 16, 2019
1 parent 316dc10 commit 1ca34b1
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 280 deletions.
6 changes: 0 additions & 6 deletions source/compiler/aslstubs.c
Expand Up @@ -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)
Expand Down
210 changes: 0 additions & 210 deletions source/components/namespace/nseval.c
Expand Up @@ -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);


/*******************************************************************************
*
Expand Down Expand Up @@ -465,206 +458,3 @@ AcpiNsEvaluate (
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;
}
12 changes: 0 additions & 12 deletions source/components/namespace/nsload.c
Expand Up @@ -268,18 +268,6 @@ AcpiNsLoadTable (
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);
}

Expand Down
13 changes: 0 additions & 13 deletions source/components/namespace/nsutils.c
Expand Up @@ -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
Expand Down
13 changes: 0 additions & 13 deletions source/components/tables/tbdata.c
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion source/components/utilities/utinit.c
Expand Up @@ -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;
Expand Down
13 changes: 0 additions & 13 deletions source/components/utilities/utxfinit.c
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion source/include/acglobal.h
Expand Up @@ -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];
Expand Down
4 changes: 0 additions & 4 deletions source/include/acnamesp.h
Expand Up @@ -419,10 +419,6 @@ ACPI_STATUS
AcpiNsEvaluate (
ACPI_EVALUATE_INFO *Info);

void
AcpiNsExecModuleCodeList (
void);


/*
* nsarguments - Argument count/type checking for predefined/reserved names
Expand Down
7 changes: 0 additions & 7 deletions source/tools/acpinames/anstubs.c
Expand Up @@ -301,13 +301,6 @@ AcpiNsEvaluate (
return (AE_NOT_IMPLEMENTED);
}

void
AcpiNsExecModuleCodeList (
void)
{
return;
}

void
AcpiExDoDebugObject (
ACPI_OPERAND_OBJECT *SourceDesc,
Expand Down

0 comments on commit 1ca34b1

Please sign in to comment.