mirror of
https://github.com/reactos/reactos.git
synced 2025-07-14 09:54:13 +00:00
[ACPICA] Update to version 20190703. CORE-16202
This commit is contained in:
parent
10798fa3ff
commit
aa46da57d4
22 changed files with 167 additions and 322 deletions
|
@ -254,7 +254,7 @@ AcpiDsInitializeObjects (
|
||||||
if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_DSDT))
|
if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_DSDT))
|
||||||
{
|
{
|
||||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||||
"\nInitializing Namespace objects:\n"));
|
"\nACPI table initialization:\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Summary of objects initialized */
|
/* Summary of objects initialized */
|
||||||
|
|
|
@ -208,6 +208,7 @@ AcpiEvMaskGpe (
|
||||||
* FUNCTION: AcpiEvAddGpeReference
|
* FUNCTION: AcpiEvAddGpeReference
|
||||||
*
|
*
|
||||||
* PARAMETERS: GpeEventInfo - Add a reference to this GPE
|
* PARAMETERS: GpeEventInfo - Add a reference to this GPE
|
||||||
|
* ClearOnEnable - Clear GPE status before enabling it
|
||||||
*
|
*
|
||||||
* RETURN: Status
|
* RETURN: Status
|
||||||
*
|
*
|
||||||
|
@ -218,7 +219,8 @@ AcpiEvMaskGpe (
|
||||||
|
|
||||||
ACPI_STATUS
|
ACPI_STATUS
|
||||||
AcpiEvAddGpeReference (
|
AcpiEvAddGpeReference (
|
||||||
ACPI_GPE_EVENT_INFO *GpeEventInfo)
|
ACPI_GPE_EVENT_INFO *GpeEventInfo,
|
||||||
|
BOOLEAN ClearOnEnable)
|
||||||
{
|
{
|
||||||
ACPI_STATUS Status = AE_OK;
|
ACPI_STATUS Status = AE_OK;
|
||||||
|
|
||||||
|
@ -236,6 +238,11 @@ AcpiEvAddGpeReference (
|
||||||
{
|
{
|
||||||
/* Enable on first reference */
|
/* Enable on first reference */
|
||||||
|
|
||||||
|
if (ClearOnEnable)
|
||||||
|
{
|
||||||
|
(void) AcpiHwClearGpe (GpeEventInfo);
|
||||||
|
}
|
||||||
|
|
||||||
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
|
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
|
||||||
if (ACPI_SUCCESS (Status))
|
if (ACPI_SUCCESS (Status))
|
||||||
{
|
{
|
||||||
|
|
|
@ -529,7 +529,7 @@ AcpiEvInitializeGpeBlock (
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = AcpiEvAddGpeReference (GpeEventInfo);
|
Status = AcpiEvAddGpeReference (GpeEventInfo, FALSE);
|
||||||
if (ACPI_FAILURE (Status))
|
if (ACPI_FAILURE (Status))
|
||||||
{
|
{
|
||||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||||
|
|
|
@ -1148,7 +1148,7 @@ AcpiRemoveGpeHandler (
|
||||||
ACPI_GPE_DISPATCH_NOTIFY)) &&
|
ACPI_GPE_DISPATCH_NOTIFY)) &&
|
||||||
Handler->OriginallyEnabled)
|
Handler->OriginallyEnabled)
|
||||||
{
|
{
|
||||||
(void) AcpiEvAddGpeReference (GpeEventInfo);
|
(void) AcpiEvAddGpeReference (GpeEventInfo, FALSE);
|
||||||
if (ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
|
if (ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
|
||||||
{
|
{
|
||||||
/* Poll edge triggered GPEs to handle existing events */
|
/* Poll edge triggered GPEs to handle existing events */
|
||||||
|
|
|
@ -159,7 +159,7 @@ AcpiEnableGpe (
|
||||||
if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) !=
|
if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) !=
|
||||||
ACPI_GPE_DISPATCH_NONE)
|
ACPI_GPE_DISPATCH_NONE)
|
||||||
{
|
{
|
||||||
Status = AcpiEvAddGpeReference (GpeEventInfo);
|
Status = AcpiEvAddGpeReference (GpeEventInfo, TRUE);
|
||||||
if (ACPI_SUCCESS (Status) &&
|
if (ACPI_SUCCESS (Status) &&
|
||||||
ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
|
ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
|
||||||
{
|
{
|
||||||
|
|
|
@ -233,10 +233,9 @@ AcpiExLoadTableOp (
|
||||||
return_ACPI_STATUS (Status);
|
return_ACPI_STATUS (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Complete the initialization/resolution of package objects */
|
/* Complete the initialization/resolution of new objects */
|
||||||
|
|
||||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
|
AcpiNsInitializeObjects ();
|
||||||
ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
/* Parameter Data (optional) */
|
/* Parameter Data (optional) */
|
||||||
|
|
||||||
|
@ -511,10 +510,11 @@ AcpiExLoadOp (
|
||||||
return_ACPI_STATUS (Status);
|
return_ACPI_STATUS (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Complete the initialization/resolution of package objects */
|
/* Complete the initialization/resolution of new objects */
|
||||||
|
|
||||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
|
AcpiExExitInterpreter ();
|
||||||
ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
|
AcpiNsInitializeObjects ();
|
||||||
|
AcpiExEnterInterpreter ();
|
||||||
|
|
||||||
/* Store the DdbHandle into the Target operand */
|
/* Store the DdbHandle into the Target operand */
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,8 @@ AcpiEvMaskGpe (
|
||||||
|
|
||||||
ACPI_STATUS
|
ACPI_STATUS
|
||||||
AcpiEvAddGpeReference (
|
AcpiEvAddGpeReference (
|
||||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
ACPI_GPE_EVENT_INFO *GpeEventInfo,
|
||||||
|
BOOLEAN ClearOnEnable);
|
||||||
|
|
||||||
ACPI_STATUS
|
ACPI_STATUS
|
||||||
AcpiEvRemoveGpeReference (
|
AcpiEvRemoveGpeReference (
|
||||||
|
|
|
@ -215,7 +215,6 @@ ACPI_GLOBAL (BOOLEAN, AcpiGbl_VerboseLeakDump);
|
||||||
ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct);
|
ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct);
|
||||||
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode);
|
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode);
|
||||||
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_FadtGpeDevice);
|
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 UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES];
|
||||||
extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES];
|
extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES];
|
||||||
|
|
|
@ -311,10 +311,6 @@ ACPI_STATUS
|
||||||
AcpiNsEvaluate (
|
AcpiNsEvaluate (
|
||||||
ACPI_EVALUATE_INFO *Info);
|
ACPI_EVALUATE_INFO *Info);
|
||||||
|
|
||||||
void
|
|
||||||
AcpiNsExecModuleCodeList (
|
|
||||||
void);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* nsarguments - Argument count/type checking for predefined/reserved names
|
* nsarguments - Argument count/type checking for predefined/reserved names
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
/* Current ACPICA subsystem version in YYYYMMDD format */
|
/* Current ACPICA subsystem version in YYYYMMDD format */
|
||||||
|
|
||||||
#define ACPI_CA_VERSION 0x20190509
|
#define ACPI_CA_VERSION 0x20190703
|
||||||
|
|
||||||
#include "acconfig.h"
|
#include "acconfig.h"
|
||||||
#include "actypes.h"
|
#include "actypes.h"
|
||||||
|
|
|
@ -211,6 +211,10 @@
|
||||||
#endif /* _M_IX86 */
|
#endif /* _M_IX86 */
|
||||||
#endif /* __REACTOS__ */
|
#endif /* __REACTOS__ */
|
||||||
|
|
||||||
|
/* warn C4001: use of slash-slash comments */
|
||||||
|
/* NOTE: MSVC 2015 headers use these extensively */
|
||||||
|
#pragma warning(disable:4001)
|
||||||
|
|
||||||
/* warn C4100: unreferenced formal parameter */
|
/* warn C4100: unreferenced formal parameter */
|
||||||
#pragma warning(disable:4100)
|
#pragma warning(disable:4100)
|
||||||
|
|
||||||
|
@ -223,10 +227,21 @@
|
||||||
/* warn C4131: uses old-style declarator (iASL compiler only) */
|
/* warn C4131: uses old-style declarator (iASL compiler only) */
|
||||||
#pragma warning(disable:4131)
|
#pragma warning(disable:4131)
|
||||||
|
|
||||||
|
/* warn C4131: uses old-style declarator (iASL compiler only) */
|
||||||
|
#pragma warning(disable:4459)
|
||||||
|
|
||||||
#if _MSC_VER > 1200 /* Versions above VC++ 6 */
|
#if _MSC_VER > 1200 /* Versions above VC++ 6 */
|
||||||
#pragma warning( disable : 4295 ) /* needed for acpredef.h array */
|
#pragma warning( disable : 4295 ) /* needed for acpredef.h array */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MSVC 2015+
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* warn C4459: xxxx (identifier) hides global declaration */
|
||||||
|
#pragma warning(disable:4459)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Debug support. */
|
/* Debug support. */
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,33 @@
|
||||||
#ifndef __ACWIN_H__
|
#ifndef __ACWIN_H__
|
||||||
#define __ACWIN_H__
|
#define __ACWIN_H__
|
||||||
|
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
#define ACPI_USE_STANDARD_HEADERS
|
#define ACPI_USE_STANDARD_HEADERS
|
||||||
#define ACPI_USE_SYSTEM_CLIBRARY
|
#define ACPI_USE_SYSTEM_CLIBRARY
|
||||||
|
|
||||||
|
/* Note: do not include any C library headers here */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note: MSVC project files should define ACPI_DEBUGGER and ACPI_DISASSEMBLER
|
||||||
|
* as appropriate to enable editor functions like "Find all references".
|
||||||
|
* The editor isn't smart enough to dig through the include files to find
|
||||||
|
* out if these are actually defined.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Eliminate warnings for "old" (non-secure) versions of clib functions */
|
||||||
|
|
||||||
|
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||||
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Eliminate warnings for POSIX clib function names (open, write, etc.) */
|
||||||
|
|
||||||
|
#ifndef _CRT_NONSTDC_NO_DEPRECATE
|
||||||
|
#define _CRT_NONSTDC_NO_DEPRECATE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define ACPI_MACHINE_WIDTH 32
|
#define ACPI_MACHINE_WIDTH 32
|
||||||
#define ACPI_USE_NATIVE_DIVIDE
|
#define ACPI_USE_NATIVE_DIVIDE
|
||||||
#define ACPI_USE_NATIVE_MATH64
|
#define ACPI_USE_NATIVE_MATH64
|
||||||
|
@ -75,7 +99,9 @@ typedef COMPILER_DEPENDENT_UINT64 u64;
|
||||||
#define stat _stat
|
#define stat _stat
|
||||||
#define fstat _fstat
|
#define fstat _fstat
|
||||||
#define mkdir _mkdir
|
#define mkdir _mkdir
|
||||||
#define snprintf _snprintf
|
#define fileno _fileno
|
||||||
|
#define isatty _isatty
|
||||||
|
|
||||||
#if _MSC_VER <= 1200 /* Versions below VC++ 6 */
|
#if _MSC_VER <= 1200 /* Versions below VC++ 6 */
|
||||||
#define vsnprintf _vsnprintf
|
#define vsnprintf _vsnprintf
|
||||||
#endif
|
#endif
|
||||||
|
@ -87,6 +113,9 @@ typedef COMPILER_DEPENDENT_UINT64 u64;
|
||||||
#define S_IREAD _S_IREAD
|
#define S_IREAD _S_IREAD
|
||||||
#define S_IWRITE _S_IWRITE
|
#define S_IWRITE _S_IWRITE
|
||||||
#define S_IFDIR _S_IFDIR
|
#define S_IFDIR _S_IFDIR
|
||||||
|
#if _MSC_VER < 1900
|
||||||
|
#define snprintf _snprintf
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -47,6 +47,28 @@
|
||||||
#define ACPI_USE_STANDARD_HEADERS
|
#define ACPI_USE_STANDARD_HEADERS
|
||||||
#define ACPI_USE_SYSTEM_CLIBRARY
|
#define ACPI_USE_SYSTEM_CLIBRARY
|
||||||
|
|
||||||
|
/* Note: do not include any C library headers here */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note: MSVC project files should define ACPI_DEBUGGER and ACPI_DISASSEMBLER
|
||||||
|
* as appropriate to enable editor functions like "Find all references".
|
||||||
|
* The editor isn't smart enough to dig through the include files to find
|
||||||
|
* out if these are actually defined.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Eliminate warnings for "old" (non-secure) versions of clib functions */
|
||||||
|
|
||||||
|
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||||
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Eliminate warnings for POSIX clib function names (open, write, etc.) */
|
||||||
|
|
||||||
|
#ifndef _CRT_NONSTDC_NO_DEPRECATE
|
||||||
|
#define _CRT_NONSTDC_NO_DEPRECATE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define ACPI_MACHINE_WIDTH 64
|
#define ACPI_MACHINE_WIDTH 64
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -76,6 +76,7 @@ AcpiNsRootInitialize (
|
||||||
ACPI_STATUS Status;
|
ACPI_STATUS Status;
|
||||||
const ACPI_PREDEFINED_NAMES *InitVal = NULL;
|
const ACPI_PREDEFINED_NAMES *InitVal = NULL;
|
||||||
ACPI_NAMESPACE_NODE *NewNode;
|
ACPI_NAMESPACE_NODE *NewNode;
|
||||||
|
ACPI_NAMESPACE_NODE *PrevNode = NULL;
|
||||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||||
ACPI_STRING Val = NULL;
|
ACPI_STRING Val = NULL;
|
||||||
|
|
||||||
|
@ -105,13 +106,30 @@ AcpiNsRootInitialize (
|
||||||
*/
|
*/
|
||||||
AcpiGbl_RootNode = &AcpiGbl_RootNodeStruct;
|
AcpiGbl_RootNode = &AcpiGbl_RootNodeStruct;
|
||||||
|
|
||||||
/* Enter the pre-defined names in the name table */
|
/* Enter the predefined names in the name table */
|
||||||
|
|
||||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||||
"Entering predefined entries into namespace\n"));
|
"Entering predefined entries into namespace\n"));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create the initial (default) namespace.
|
||||||
|
* This namespace looks like something similar to this:
|
||||||
|
*
|
||||||
|
* ACPI Namespace (from Namespace Root):
|
||||||
|
* 0 _GPE Scope 00203160 00
|
||||||
|
* 0 _PR_ Scope 002031D0 00
|
||||||
|
* 0 _SB_ Device 00203240 00 Notify Object: 0020ADD8
|
||||||
|
* 0 _SI_ Scope 002032B0 00
|
||||||
|
* 0 _TZ_ Device 00203320 00
|
||||||
|
* 0 _REV Integer 00203390 00 = 0000000000000002
|
||||||
|
* 0 _OS_ String 00203488 00 Len 14 "Microsoft Windows NT"
|
||||||
|
* 0 _GL_ Mutex 00203580 00 Object 002035F0
|
||||||
|
* 0 _OSI Method 00203678 00 Args 1 Len 0000 Aml 00000000
|
||||||
|
*/
|
||||||
for (InitVal = AcpiGbl_PreDefinedNames; InitVal->Name; InitVal++)
|
for (InitVal = AcpiGbl_PreDefinedNames; InitVal->Name; InitVal++)
|
||||||
{
|
{
|
||||||
|
Status = AE_OK;
|
||||||
|
|
||||||
/* _OSI is optional for now, will be permanent later */
|
/* _OSI is optional for now, will be permanent later */
|
||||||
|
|
||||||
if (!strcmp (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod)
|
if (!strcmp (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod)
|
||||||
|
@ -119,17 +137,35 @@ AcpiNsRootInitialize (
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = AcpiNsLookup (NULL, ACPI_CAST_PTR (char, InitVal->Name),
|
/*
|
||||||
InitVal->Type, ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH,
|
* Create, init, and link the new predefined name
|
||||||
NULL, &NewNode);
|
* Note: No need to use AcpiNsLookup here because all the
|
||||||
if (ACPI_FAILURE (Status))
|
* predefined names are at the root level. It is much easier to
|
||||||
|
* just create and link the new node(s) here.
|
||||||
|
*/
|
||||||
|
NewNode = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_NAMESPACE_NODE));
|
||||||
|
if (!NewNode)
|
||||||
{
|
{
|
||||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
Status = AE_NO_MEMORY;
|
||||||
"Could not create predefined name %s",
|
goto UnlockAndExit;
|
||||||
InitVal->Name));
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ACPI_COPY_NAMESEG (NewNode->Name.Ascii, InitVal->Name);
|
||||||
|
NewNode->DescriptorType = ACPI_DESC_TYPE_NAMED;
|
||||||
|
NewNode->Type = InitVal->Type;
|
||||||
|
|
||||||
|
if (!PrevNode)
|
||||||
|
{
|
||||||
|
AcpiGbl_RootNodeStruct.Child = NewNode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PrevNode->Peer = NewNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
NewNode->Parent = &AcpiGbl_RootNodeStruct;
|
||||||
|
PrevNode = NewNode;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Name entered successfully. If entry in PreDefinedNames[] specifies
|
* Name entered successfully. If entry in PreDefinedNames[] specifies
|
||||||
* an initial value, create the initial value.
|
* an initial value, create the initial value.
|
||||||
|
@ -178,7 +214,7 @@ AcpiNsRootInitialize (
|
||||||
|
|
||||||
NewNode->Value = ObjDesc->Method.ParamCount;
|
NewNode->Value = ObjDesc->Method.ParamCount;
|
||||||
#else
|
#else
|
||||||
/* Mark this as a very SPECIAL method */
|
/* Mark this as a very SPECIAL method (_OSI) */
|
||||||
|
|
||||||
ObjDesc->Method.InfoFlags = ACPI_METHOD_INTERNAL_ONLY;
|
ObjDesc->Method.InfoFlags = ACPI_METHOD_INTERNAL_ONLY;
|
||||||
ObjDesc->Method.Dispatch.Implementation = AcpiUtOsiImplementation;
|
ObjDesc->Method.Dispatch.Implementation = AcpiUtOsiImplementation;
|
||||||
|
@ -251,7 +287,6 @@ AcpiNsRootInitialize (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UnlockAndExit:
|
UnlockAndExit:
|
||||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||||
|
|
||||||
|
|
|
@ -51,13 +51,6 @@
|
||||||
#define _COMPONENT ACPI_NAMESPACE
|
#define _COMPONENT ACPI_NAMESPACE
|
||||||
ACPI_MODULE_NAME ("nseval")
|
ACPI_MODULE_NAME ("nseval")
|
||||||
|
|
||||||
/* Local prototypes */
|
|
||||||
|
|
||||||
static void
|
|
||||||
AcpiNsExecModuleCode (
|
|
||||||
ACPI_OPERAND_OBJECT *MethodObj,
|
|
||||||
ACPI_EVALUATE_INFO *Info);
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
|
@ -356,206 +349,3 @@ Cleanup:
|
||||||
Info->FullPathname = NULL;
|
Info->FullPathname = NULL;
|
||||||
return_ACPI_STATUS (Status);
|
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;
|
|
||||||
}
|
|
||||||
|
|
|
@ -104,29 +104,30 @@ AcpiNsInitializeObjects (
|
||||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||||
"**** Starting initialization of namespace objects ****\n"));
|
"**** Starting initialization of namespace objects ****\n"));
|
||||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||||
"Completing Region/Field/Buffer/Package initialization:\n"));
|
"Final data object initialization: "));
|
||||||
|
|
||||||
/* Set all init info to zero */
|
/* Clear the info block */
|
||||||
|
|
||||||
memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
|
memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
|
||||||
|
|
||||||
/* Walk entire namespace from the supplied root */
|
/* Walk entire namespace from the supplied root */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TBD: will become ACPI_TYPE_PACKAGE as this type object
|
||||||
|
* is now the only one that supports deferred initialization
|
||||||
|
* (forward references).
|
||||||
|
*/
|
||||||
Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
|
Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
|
||||||
ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL,
|
ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL, &Info, NULL);
|
||||||
&Info, NULL);
|
|
||||||
if (ACPI_FAILURE (Status))
|
if (ACPI_FAILURE (Status))
|
||||||
{
|
{
|
||||||
ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
|
ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
|
||||||
}
|
}
|
||||||
|
|
||||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||||
" Initialized %u/%u Regions %u/%u Fields %u/%u "
|
"Namespace contains %u (0x%X) objects\n",
|
||||||
"Buffers %u/%u Packages (%u nodes)\n",
|
Info.ObjectCount,
|
||||||
Info.OpRegionInit, Info.OpRegionCount,
|
Info.ObjectCount));
|
||||||
Info.FieldInit, Info.FieldCount,
|
|
||||||
Info.BufferInit, Info.BufferCount,
|
|
||||||
Info.PackageInit, Info.PackageCount, Info.ObjectCount));
|
|
||||||
|
|
||||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||||
"%u Control Methods found\n%u Op Regions found\n",
|
"%u Control Methods found\n%u Op Regions found\n",
|
||||||
|
@ -453,35 +454,19 @@ AcpiNsInitOneObject (
|
||||||
AcpiExEnterInterpreter ();
|
AcpiExEnterInterpreter ();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Each of these types can contain executable AML code within the
|
* Only initialization of Package objects can be deferred, in order
|
||||||
* declaration.
|
* to support forward references.
|
||||||
*/
|
*/
|
||||||
switch (Type)
|
switch (Type)
|
||||||
{
|
{
|
||||||
case ACPI_TYPE_REGION:
|
|
||||||
|
|
||||||
Info->OpRegionInit++;
|
|
||||||
Status = AcpiDsGetRegionArguments (ObjDesc);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ACPI_TYPE_BUFFER_FIELD:
|
|
||||||
|
|
||||||
Info->FieldInit++;
|
|
||||||
Status = AcpiDsGetBufferFieldArguments (ObjDesc);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||||
|
|
||||||
|
/* TBD: BankFields do not require deferred init, remove this code */
|
||||||
|
|
||||||
Info->FieldInit++;
|
Info->FieldInit++;
|
||||||
Status = AcpiDsGetBankFieldArguments (ObjDesc);
|
Status = AcpiDsGetBankFieldArguments (ObjDesc);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACPI_TYPE_BUFFER:
|
|
||||||
|
|
||||||
Info->BufferInit++;
|
|
||||||
Status = AcpiDsGetBufferArguments (ObjDesc);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ACPI_TYPE_PACKAGE:
|
case ACPI_TYPE_PACKAGE:
|
||||||
|
|
||||||
/* Complete the initialization/resolution of the package object */
|
/* Complete the initialization/resolution of the package object */
|
||||||
|
@ -492,8 +477,12 @@ AcpiNsInitOneObject (
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
/* No other types can get here */
|
/* No other types should get here */
|
||||||
|
|
||||||
|
Status = AE_TYPE;
|
||||||
|
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||||
|
"Opcode is not deferred [%4.4s] (%s)",
|
||||||
|
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Type)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,18 +160,6 @@ Unlock:
|
||||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||||
"**** Completed Table Object Initialization\n"));
|
"**** 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);
|
return_ACPI_STATUS (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -694,24 +694,11 @@ AcpiNsTerminate (
|
||||||
void)
|
void)
|
||||||
{
|
{
|
||||||
ACPI_STATUS Status;
|
ACPI_STATUS Status;
|
||||||
ACPI_OPERAND_OBJECT *Prev;
|
|
||||||
ACPI_OPERAND_OBJECT *Next;
|
|
||||||
|
|
||||||
|
|
||||||
ACPI_FUNCTION_TRACE (NsTerminate);
|
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
|
* Free the entire namespace -- all nodes and all objects
|
||||||
* attached to the nodes
|
* attached to the nodes
|
||||||
|
|
|
@ -1082,19 +1082,6 @@ AcpiTbLoadTable (
|
||||||
|
|
||||||
Status = AcpiNsLoadTable (TableIndex, ParentNode);
|
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
|
* Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
|
||||||
* responsible for discovering any new wake GPEs by running _PRW methods
|
* responsible for discovering any new wake GPEs by running _PRW methods
|
||||||
|
|
|
@ -371,6 +371,13 @@ AcpiLoadTable (
|
||||||
ACPI_INFO (("Host-directed Dynamic ACPI Table Load:"));
|
ACPI_INFO (("Host-directed Dynamic ACPI Table Load:"));
|
||||||
Status = AcpiTbInstallAndLoadTable (ACPI_PTR_TO_PHYSADDR (Table),
|
Status = AcpiTbInstallAndLoadTable (ACPI_PTR_TO_PHYSADDR (Table),
|
||||||
ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE, &TableIndex);
|
ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE, &TableIndex);
|
||||||
|
if (ACPI_SUCCESS (Status))
|
||||||
|
{
|
||||||
|
/* Complete the initialization/resolution of new objects */
|
||||||
|
|
||||||
|
AcpiNsInitializeObjects ();
|
||||||
|
}
|
||||||
|
|
||||||
return_ACPI_STATUS (Status);
|
return_ACPI_STATUS (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,6 @@ AcpiUtInitGlobals (
|
||||||
|
|
||||||
/* Namespace */
|
/* Namespace */
|
||||||
|
|
||||||
AcpiGbl_ModuleCodeList = NULL;
|
|
||||||
AcpiGbl_RootNode = NULL;
|
AcpiGbl_RootNode = NULL;
|
||||||
AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
|
AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
|
||||||
AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
|
AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
|
||||||
|
|
|
@ -273,24 +273,17 @@ AcpiInitializeObjects (
|
||||||
ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
|
ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef ACPI_OBSOLETE_BEHAVIOR
|
||||||
/*
|
/*
|
||||||
* This case handles the legacy option that groups all module-level
|
* 05/2019: Removed, initialization now happens at both object
|
||||||
* code blocks together and defers execution until all of the tables
|
* creation and table load time
|
||||||
* 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
|
* Initialize the objects that remain uninitialized. This
|
||||||
* runs the executable AML that may be part of the
|
* runs the executable AML that may be part of the
|
||||||
* declaration of these objects:
|
* declaration of these objects: OperationRegions, BufferFields,
|
||||||
* OperationRegions, BufferFields, Buffers, and Packages.
|
* BankFields, Buffers, and Packages.
|
||||||
*/
|
*/
|
||||||
if (!(Flags & ACPI_NO_OBJECT_INIT))
|
if (!(Flags & ACPI_NO_OBJECT_INIT))
|
||||||
{
|
{
|
||||||
|
@ -300,6 +293,7 @@ AcpiInitializeObjects (
|
||||||
return_ACPI_STATUS (Status);
|
return_ACPI_STATUS (Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize all device/region objects in the namespace. This runs
|
* Initialize all device/region objects in the namespace. This runs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue