ACK: [PATCH] ACPICA: Update to version 20160212 (LP: #1545099)
ivanhu
ivan.hu at canonical.com
Tue Feb 16 03:07:02 UTC 2016
On 2016年02月13日 02:15, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Changes in this release of ACPICA are detailed at the following
> link on the ACPICA developer mailing list:
>
> https://lists.acpica.org/pipermail/devel/2016-February/000870.html
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpica/fwts_acpica.c | 2 -
> src/acpica/source/common/adwalk.c | 23 +-
> src/acpica/source/common/ahids.c | 5 +
> src/acpica/source/common/ahpredef.c | 5 +-
> src/acpica/source/common/dmextern.c | 204 ++---
> src/acpica/source/common/dmtable.c | 1 +
> src/acpica/source/common/dmtables.c | 5 +
> src/acpica/source/common/dmtbdump.c | 6 +
> src/acpica/source/common/dmtbinfo.c | 22 +
> src/acpica/source/compiler/Makefile.am | 5 +-
> src/acpica/source/compiler/aslanalyze.c | 6 +
> src/acpica/source/compiler/aslbtypes.c | 19 +-
> src/acpica/source/compiler/aslcodegen.c | 67 +-
> src/acpica/source/compiler/aslcompile.c | 74 +-
> src/acpica/source/compiler/aslcompiler.h | 76 +-
> src/acpica/source/compiler/aslcompiler.y | 1 -
> src/acpica/source/compiler/asldebug.c | 325 ++++++++
> src/acpica/source/compiler/asldefine.h | 35 +-
> src/acpica/source/compiler/aslexternal.c | 563 +++++++++++++
> src/acpica/source/compiler/aslfiles.c | 18 +
> src/acpica/source/compiler/aslglobal.h | 12 +-
> src/acpica/source/compiler/asllength.c | 1 -
> src/acpica/source/compiler/asllisting.c | 95 ++-
> src/acpica/source/compiler/aslload.c | 2 -
> src/acpica/source/compiler/aslmain.c | 39 +-
> src/acpica/source/compiler/aslmap.c | 32 +-
> src/acpica/source/compiler/aslmapoutput.c | 2 +-
> src/acpica/source/compiler/aslmethod.c | 11 +-
> src/acpica/source/compiler/aslopcodes.c | 6 -
> src/acpica/source/compiler/asloperands.c | 10 +-
> src/acpica/source/compiler/aslprune.c | 2 +-
> src/acpica/source/compiler/aslrestype2s.c | 35 -
> src/acpica/source/compiler/aslrules.y | 1 -
> src/acpica/source/compiler/aslstubs.c | 7 +
> src/acpica/source/compiler/asltransform.c | 45 +-
> src/acpica/source/compiler/asltree.c | 6 +-
> src/acpica/source/compiler/asltypes.h | 24 +-
> src/acpica/source/compiler/aslutils.c | 343 ++------
> src/acpica/source/compiler/aslwalks.c | 13 +-
> src/acpica/source/compiler/aslxref.c | 9 +-
> src/acpica/source/compiler/aslxrefout.c | 882 +++++++++++++++++++++
> src/acpica/source/compiler/dtparser.y | 8 +-
> src/acpica/source/compiler/prparser.y | 4 +-
> src/acpica/source/compiler/prscan.c | 10 +-
> src/acpica/source/components/debugger/dbcmds.c | 2 +-
> src/acpica/source/components/debugger/dbconvert.c | 5 +-
> .../source/components/disassembler/dmopcode.c | 4 +
> src/acpica/source/components/disassembler/dmwalk.c | 33 +-
> src/acpica/source/components/dispatcher/dsmethod.c | 2 +-
> src/acpica/source/components/dispatcher/dsobject.c | 2 +-
> src/acpica/source/components/events/evgpeblk.c | 2 +-
> src/acpica/source/components/events/evgpeinit.c | 2 +-
> src/acpica/source/components/events/evregion.c | 3 +-
> src/acpica/source/components/executer/exconfig.c | 4 +-
> src/acpica/source/components/executer/exoparg3.c | 4 +-
> src/acpica/source/components/hardware/hwxfsleep.c | 4 +-
> src/acpica/source/components/namespace/nseval.c | 2 +-
> src/acpica/source/components/namespace/nsinit.c | 137 ++--
> src/acpica/source/components/parser/psargs.c | 8 +-
> src/acpica/source/components/tables/tbinstal.c | 4 +-
> src/acpica/source/components/tables/tbprint.c | 6 +-
> src/acpica/source/components/tables/tbutils.c | 2 +-
> src/acpica/source/components/tables/tbxfload.c | 27 +-
> src/acpica/source/components/utilities/utcache.c | 2 +-
> src/acpica/source/components/utilities/utdecode.c | 29 +-
> src/acpica/source/components/utilities/utnonansi.c | 305 +++++--
> src/acpica/source/components/utilities/uttrack.c | 2 +-
> src/acpica/source/components/utilities/utxferror.c | 2 -
> src/acpica/source/components/utilities/utxfinit.c | 72 +-
> src/acpica/source/include/acdisasm.h | 1 +
> src/acpica/source/include/acglobal.h | 4 +-
> src/acpica/source/include/aclocal.h | 6 +-
> src/acpica/source/include/acnamesp.h | 2 +-
> src/acpica/source/include/acoutput.h | 2 +-
> src/acpica/source/include/acpixf.h | 10 +-
> src/acpica/source/include/acpredef.h | 13 +-
> src/acpica/source/include/actbl.h | 2 +-
> src/acpica/source/include/actbl1.h | 32 +-
> src/acpica/source/include/actypes.h | 3 +-
> 79 files changed, 2960 insertions(+), 841 deletions(-)
> create mode 100644 src/acpica/source/compiler/asldebug.c
> create mode 100644 src/acpica/source/compiler/aslexternal.c
> create mode 100644 src/acpica/source/compiler/aslxrefout.c
>
> diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c
> index 88f83a6..77a96ca 100644
> --- a/src/acpica/fwts_acpica.c
> +++ b/src/acpica/fwts_acpica.c
> @@ -1099,8 +1099,6 @@ int fwts_acpica_init(fwts_framework *fw)
> fwts_acpica_RSDP = NULL;
> }
>
> - AcpiGbl_OverrideDefaultRegionHandlers = TRUE;
> -
> if (ACPI_FAILURE(AcpiInitializeSubsystem())) {
> fwts_log_error(fw, "Failed to initialise ACPICA subsystem.");
> goto failed;
> diff --git a/src/acpica/source/common/adwalk.c b/src/acpica/source/common/adwalk.c
> index c2d218a..8bc07ee 100644
> --- a/src/acpica/source/common/adwalk.c
> +++ b/src/acpica/source/common/adwalk.c
> @@ -832,6 +832,7 @@ AcpiDmXrefDescendingOp (
> ACPI_OPERAND_OBJECT *Object;
> UINT32 ParamCount = 0;
> char *Pathname;
> + UINT16 Flags = 0;
>
>
> WalkState = Info->WalkState;
> @@ -846,7 +847,24 @@ AcpiDmXrefDescendingOp (
> {
> goto Exit;
> }
> + else if (Op->Common.Parent &&
> + Op->Common.Parent->Common.AmlOpcode == AML_EXTERNAL_OP)
> + {
> + /* External() NamePath */
> +
> + Path = Op->Common.Value.String;
> + ObjectType = (ACPI_OBJECT_TYPE) Op->Common.Next->Common.Value.Integer;
> + if (ObjectType == ACPI_TYPE_METHOD)
> + {
> + ParamCount = (UINT32)
> + Op->Common.Next->Common.Next->Common.Value.Integer;
> + }
> +
> + AcpiDmAddOpToExternalList (Op, Path,
> + (UINT8) ObjectType, ParamCount, Flags);
>
> + goto Exit;
> + }
>
> /* Get the NamePath from the appropriate place */
>
> @@ -914,6 +932,7 @@ AcpiDmXrefDescendingOp (
> /* Node was created by an External() statement */
>
> Status = AE_NOT_FOUND;
> + Flags = ACPI_EXT_RESOLVED_REFERENCE;
> }
>
> if (ACPI_FAILURE (Status))
> @@ -933,12 +952,12 @@ AcpiDmXrefDescendingOp (
> if (Node)
> {
> AcpiDmAddNodeToExternalList (Node,
> - (UINT8) ObjectType, 0, 0);
> + (UINT8) ObjectType, 0, Flags);
> }
> else
> {
> AcpiDmAddOpToExternalList (Op, Path,
> - (UINT8) ObjectType, 0, 0);
> + (UINT8) ObjectType, 0, Flags);
> }
> }
> }
> diff --git a/src/acpica/source/common/ahids.c b/src/acpica/source/common/ahids.c
> index 7cd9c2c..d0e5916 100644
> --- a/src/acpica/source/common/ahids.c
> +++ b/src/acpica/source/common/ahids.c
> @@ -147,6 +147,10 @@ const AH_DEVICE_ID AslDeviceIds[] =
> {"ACPI000D", "Power Meter Device"},
> {"ACPI000E", "Time and Alarm Device"},
> {"ACPI000F", "User Presence Detection Device"},
> + {"ACPI0010", "Processor Container Device"},
> + {"ACPI0011", "Generic Buttons Device"},
> + {"ACPI0012", "NVDIMM Root Device"},
> + {"ACPI0013", "Generic Event Device"},
> {"ADMA0F28", "Intel Audio DMA"},
> {"AMCR0F28", "Intel Audio Machine Driver"},
> {"ATK4001", "Asus Radio Control Button"},
> @@ -257,6 +261,7 @@ const AH_DEVICE_ID AslDeviceIds[] =
> {"PNP0C12", "Device Bay Controller"},
> {"PNP0C14", "Windows Management Instrumentation Device"},
> {"PNP0C15", "Docking Station"},
> + {"PNP0C33", "Error Device"},
> {"PNP0C40", "Standard Button Controller"},
> {"PNP0C50", "HID Protocol Device (I2C bus)"},
> {"PNP0C60", "Display Sensor Device"},
> diff --git a/src/acpica/source/common/ahpredef.c b/src/acpica/source/common/ahpredef.c
> index 4bef8e9..1c81444 100644
> --- a/src/acpica/source/common/ahpredef.c
> +++ b/src/acpica/source/common/ahpredef.c
> @@ -212,6 +212,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
> AH_PREDEF ("_FDI", "Floppy Drive Information", "Returns a floppy drive information block"),
> AH_PREDEF ("_FDM", "Floppy Drive Mode", "Sets a floppy drive speed"),
> AH_PREDEF ("_FIF", "Fan Information", "Returns fan device information"),
> + AH_PREDEF ("_FIT", "Firmware Interface Table", "Returns a list of NFIT structures"),
> AH_PREDEF ("_FIX", "Fixed Register Resource Provider", "Returns a list of devices that implement FADT register blocks"),
> AH_PREDEF ("_FLC", "Flow Control", "Flow control, Resource Descriptor field"),
> AH_PREDEF ("_FPS", "Fan Performance States", "Returns a list of supported fan performance states"),
> @@ -404,8 +405,10 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
> AH_PREDEF ("_UPP", "User Presence Polling", "Returns the recommended user presence polling interval"),
> AH_PREDEF ("_VEN", "Vendor Data", "Resource Descriptor field"),
> AH_PREDEF ("_VPO", "Video Post Options", "Returns the implemented video post options"),
> - AH_PREDEF ("_WAK", "Wake", "Inform AML that the system has just awakened"),
> AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"),
> + AH_PREDEF ("_WAK", "Wake", "Inform AML that the system has just awakened"),
> + AH_PREDEF ("_WPC", "Wireless Power Calibration", "Calibrate power and notify wireless device"),
> + AH_PREDEF ("_WPP", "Wireless Power Polling", "Get recommended polling interval"),
> AH_PREDEF (NULL, NULL, NULL)
> };
>
> diff --git a/src/acpica/source/common/dmextern.c b/src/acpica/source/common/dmextern.c
> index 229397f..397fe2b 100644
> --- a/src/acpica/source/common/dmextern.c
> +++ b/src/acpica/source/common/dmextern.c
> @@ -826,6 +826,46 @@ AcpiDmAddPathToExternalList (
>
> /*******************************************************************************
> *
> + * FUNCTION: AcpiDmEternalIsMatch
> + *
> + * PARAMETERS: NamePath - Path to match to External Name
> + * ExternalPath - External NamePath to be matched
> + *
> + * RETURN: BOOLEAN
> + *
> + * DESCRIPTION: Returns TRUE if NamePath matches the last NamePath-length
> + * characters of ExternalPath.
> + *
> + * External (_SB_.DEV0.ABCD) will match:
> + * _SB_.DEV0.ABCD
> + * DEV0.ABCD
> + * ABCD
> + *
> + ******************************************************************************/
> +
> +static BOOLEAN
> +AcpiDmExternalIsMatch (
> + const char * NamePath,
> + const char * ListNamePath)
> +{
> + BOOLEAN Match = FALSE;
> +
> +
> + if (strlen (ListNamePath) >= strlen (NamePath))
> + {
> + if (!strcmp (ListNamePath +
> + (strlen (ListNamePath) - strlen (NamePath)), NamePath))
> + {
> + return (TRUE);
> + }
> + }
> +
> + return (Match);
> +}
> +
> +
> +/*******************************************************************************
> + *
> * FUNCTION: AcpiDmCreateNewExternal
> *
> * PARAMETERS: ExternalPath - External path to the object
> @@ -880,11 +920,14 @@ AcpiDmCreateNewExternal (
> NextExternal = AcpiGbl_ExternalList;
> while (NextExternal)
> {
> - if (!strcmp (ExternalPath, NextExternal->Path))
> + /* Check for duplicates */
> +
> + if (AcpiDmExternalIsMatch (ExternalPath, NextExternal->Path))
> {
> /* Duplicate method, check that the Value (ArgCount) is the same */
>
> if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
> + (NextExternal->Flags & ANOBJ_IS_EXTERNAL) &&
> (NextExternal->Value != Value) &&
> (Value > 0))
> {
> @@ -902,6 +945,11 @@ AcpiDmCreateNewExternal (
> NextExternal->Value = Value;
> }
>
> + /* Update flags. */
> +
> + NextExternal->Flags |= Flags;
> + NextExternal->Flags &= ~ACPI_EXT_INTERNAL_PATH_ALLOCATED;
> +
> return_ACPI_STATUS (AE_ALREADY_EXISTS);
> }
>
> @@ -1338,76 +1386,85 @@ appearing in an SSDT, the disassembler does not know what to do unless
> the owning SSDT has been loaded via the -e option.
> #endif
>
> +static char ExternalWarningPart1[600];
> +static char ExternalWarningPart2[400];
> +static char ExternalWarningPart3[400];
> +static char ExternalWarningPart4[200];
> +
> void
> AcpiDmUnresolvedWarning (
> UINT8 Type)
> {
> + char *Format;
> + char Pad[] = " *";
> + char NoPad[] = "";
> +
>
> if (!AcpiGbl_NumExternalMethods)
> {
> return;
> }
>
> + if (AcpiGbl_NumExternalMethods == AcpiGbl_ResolvedExternalMethods)
> + {
> + return;
> + }
> +
> + Format = Type ? Pad : NoPad;
> +
> + sprintf (ExternalWarningPart1,
> + "%s iASL Warning: There were %u external control methods found during\n"
> + "%s disassembly, but only %u %s resolved (%u unresolved). Additional\n"
> + "%s ACPI tables may be required to properly disassemble the code. This\n"
> + "%s resulting disassembler output file may not compile because the\n"
> + "%s disassembler did not know how many arguments to assign to the\n"
> + "%s unresolved methods. Note: SSDTs can be dynamically loaded at\n"
> + "%s runtime and may or may not be available via the host OS.\n",
> + Format, AcpiGbl_NumExternalMethods, Format, AcpiGbl_ResolvedExternalMethods,
> + (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
> + (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods),
> + Format, Format, Format, Format, Format);
> +
> + sprintf (ExternalWarningPart2,
> + "%s To specify the tables needed to resolve external control method\n"
> + "%s references, the -e option can be used to specify the filenames.\n"
> + "%s Example iASL invocations:\n"
> + "%s iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
> + "%s iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
> + "%s iasl -e ssdt*.aml -d dsdt.aml\n",
> + Format, Format, Format, Format, Format, Format);
> +
> + sprintf (ExternalWarningPart3,
> + "%s In addition, the -fe option can be used to specify a file containing\n"
> + "%s control method external declarations with the associated method\n"
> + "%s argument counts. Each line of the file must be of the form:\n"
> + "%s External (<method pathname>, MethodObj, <argument count>)\n"
> + "%s Invocation:\n"
> + "%s iasl -fe refs.txt -d dsdt.aml\n",
> + Format, Format, Format, Format, Format, Format);
> +
> + sprintf (ExternalWarningPart4,
> + "%s The following methods were unresolved and many not compile properly\n"
> + "%s because the disassembler had to guess at the number of arguments\n"
> + "%s required for each:\n",
> + Format, Format, Format);
> +
> if (Type)
> {
> if (!AcpiGbl_ExternalFileList)
> {
> /* The -e option was not specified */
>
> - AcpiOsPrintf (" /*\n"
> - " * iASL Warning: There were %u external control methods found during\n"
> - " * disassembly, but additional ACPI tables to resolve these externals\n"
> - " * were not specified. This resulting disassembler output file may not\n"
> - " * compile because the disassembler did not know how many arguments\n"
> - " * to assign to these methods. To specify the tables needed to resolve\n"
> - " * external control method references, the -e option can be used to\n"
> - " * specify the filenames. Note: SSDTs can be dynamically loaded at\n"
> - " * runtime and may or may not be available via the host OS.\n"
> - " * Example iASL invocations:\n"
> - " * iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
> - " * iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
> - " * iasl -e ssdt*.aml -d dsdt.aml\n"
> - " *\n"
> - " * In addition, the -fe option can be used to specify a file containing\n"
> - " * control method external declarations with the associated method\n"
> - " * argument counts. Each line of the file must be of the form:\n"
> - " * External (<method pathname>, MethodObj, <argument count>)\n"
> - " * Invocation:\n"
> - " * iasl -fe refs.txt -d dsdt.aml\n"
> - " *\n"
> - " * The following methods were unresolved and many not compile properly\n"
> - " * because the disassembler had to guess at the number of arguments\n"
> - " * required for each:\n"
> - " */\n",
> - AcpiGbl_NumExternalMethods);
> + AcpiOsPrintf (" /*\n%s *\n%s *\n%s *\n%s */\n",
> + ExternalWarningPart1, ExternalWarningPart2, ExternalWarningPart3,
> + ExternalWarningPart4);
> }
> - else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
> + else
> {
> /* The -e option was specified, but there are still some unresolved externals */
>
> - AcpiOsPrintf (" /*\n"
> - " * iASL Warning: There were %u external control methods found during\n"
> - " * disassembly, but only %u %s resolved (%u unresolved). Additional\n"
> - " * ACPI tables may be required to properly disassemble the code. This\n"
> - " * resulting disassembler output file may not compile because the\n"
> - " * disassembler did not know how many arguments to assign to the\n"
> - " * unresolved methods. Note: SSDTs can be dynamically loaded at\n"
> - " * runtime and may or may not be available via the host OS.\n"
> - " *\n"
> - " * If necessary, the -fe option can be used to specify a file containing\n"
> - " * control method external declarations with the associated method\n"
> - " * argument counts. Each line of the file must be of the form:\n"
> - " * External (<method pathname>, MethodObj, <argument count>)\n"
> - " * Invocation:\n"
> - " * iasl -fe refs.txt -d dsdt.aml\n"
> - " *\n"
> - " * The following methods were unresolved and many not compile properly\n"
> - " * because the disassembler had to guess at the number of arguments\n"
> - " * required for each:\n"
> - " */\n",
> - AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
> - (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
> - (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
> + AcpiOsPrintf (" /*\n%s *\n *\n */\n",
> + ExternalWarningPart1, ExternalWarningPart3, ExternalWarningPart4);
> }
> }
> else
> @@ -1416,50 +1473,15 @@ AcpiDmUnresolvedWarning (
> {
> /* The -e option was not specified */
>
> - fprintf (stderr, "\n"
> - "iASL Warning: There were %u external control methods found during\n"
> - "disassembly, but additional ACPI tables to resolve these externals\n"
> - "were not specified. The resulting disassembler output file may not\n"
> - "compile because the disassembler did not know how many arguments\n"
> - "to assign to these methods. To specify the tables needed to resolve\n"
> - "external control method references, the -e option can be used to\n"
> - "specify the filenames. Note: SSDTs can be dynamically loaded at\n"
> - "runtime and may or may not be available via the host OS.\n"
> - "Example iASL invocations:\n"
> - " iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml\n"
> - " iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml\n"
> - " iasl -e ssdt*.aml -d dsdt.aml\n"
> - "\n"
> - "In addition, the -fe option can be used to specify a file containing\n"
> - "control method external declarations with the associated method\n"
> - "argument counts. Each line of the file must be of the form:\n"
> - " External (<method pathname>, MethodObj, <argument count>)\n"
> - "Invocation:\n"
> - " iasl -fe refs.txt -d dsdt.aml\n",
> - AcpiGbl_NumExternalMethods);
> + fprintf (stderr, "\n%s\n%s\n%s\n",
> + ExternalWarningPart1, ExternalWarningPart2, ExternalWarningPart3);
> }
> - else if (AcpiGbl_NumExternalMethods != AcpiGbl_ResolvedExternalMethods)
> + else
> {
> /* The -e option was specified, but there are still some unresolved externals */
>
> - fprintf (stderr, "\n"
> - "iASL Warning: There were %u external control methods found during\n"
> - "disassembly, but only %u %s resolved (%u unresolved). Additional\n"
> - "ACPI tables may be required to properly disassemble the code. The\n"
> - "resulting disassembler output file may not compile because the\n"
> - "disassembler did not know how many arguments to assign to the\n"
> - "unresolved methods. Note: SSDTs can be dynamically loaded at\n"
> - "runtime and may or may not be available via the host OS.\n"
> - "\n"
> - "If necessary, the -fe option can be used to specify a file containing\n"
> - "control method external declarations with the associated method\n"
> - "argument counts. Each line of the file must be of the form:\n"
> - " External (<method pathname>, MethodObj, <argument count>)\n"
> - "Invocation:\n"
> - " iasl -fe refs.txt -d dsdt.aml\n",
> - AcpiGbl_NumExternalMethods, AcpiGbl_ResolvedExternalMethods,
> - (AcpiGbl_ResolvedExternalMethods > 1 ? "were" : "was"),
> - (AcpiGbl_NumExternalMethods - AcpiGbl_ResolvedExternalMethods));
> + fprintf (stderr, "\n%s\n%s\n",
> + ExternalWarningPart1, ExternalWarningPart3);
> }
> }
> }
> diff --git a/src/acpica/source/common/dmtable.c b/src/acpica/source/common/dmtable.c
> index 5cd1247..a62c48d 100644
> --- a/src/acpica/source/common/dmtable.c
> +++ b/src/acpica/source/common/dmtable.c
> @@ -268,6 +268,7 @@ static const char *AcpiDmHestSubnames[] =
> "PCI Express AER (AER Endpoint)",
> "PCI Express/PCI-X Bridge AER",
> "Generic Hardware Error Source",
> + "Generic Hardware Error Source V2",
> "Unknown Subtable Type" /* Reserved */
> };
>
> diff --git a/src/acpica/source/common/dmtables.c b/src/acpica/source/common/dmtables.c
> index da66043..6894d9f 100644
> --- a/src/acpica/source/common/dmtables.c
> +++ b/src/acpica/source/common/dmtables.c
> @@ -217,6 +217,11 @@ AdCreateTableHeader (
> UINT8 Checksum;
>
>
> + /* Reset globals for External statements */
> +
> + AcpiGbl_NumExternalMethods = 0;
> + AcpiGbl_ResolvedExternalMethods = 0;
> +
> /*
> * Print file header and dump original table header
> */
> diff --git a/src/acpica/source/common/dmtbdump.c b/src/acpica/source/common/dmtbdump.c
> index 409d4f6..a3f67c9 100644
> --- a/src/acpica/source/common/dmtbdump.c
> +++ b/src/acpica/source/common/dmtbdump.c
> @@ -1688,6 +1688,12 @@ AcpiDmDumpHest (
> SubTableLength = sizeof (ACPI_HEST_GENERIC);
> break;
>
> + case ACPI_HEST_TYPE_GENERIC_ERROR_V2:
> +
> + InfoTable = AcpiDmTableInfoHest10;
> + SubTableLength = sizeof (ACPI_HEST_GENERIC_V2);
> + break;
> +
> default:
>
> /* Cannot continue on unknown type - no length */
> diff --git a/src/acpica/source/common/dmtbinfo.c b/src/acpica/source/common/dmtbinfo.c
> index 1e749b0..bb2cdbf 100644
> --- a/src/acpica/source/common/dmtbinfo.c
> +++ b/src/acpica/source/common/dmtbinfo.c
> @@ -235,6 +235,7 @@
> #define ACPI_HEST7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER,f)
> #define ACPI_HEST8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f)
> #define ACPI_HEST9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC,f)
> +#define ACPI_HEST10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC_V2,f)
> #define ACPI_HESTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_NOTIFY,f)
> #define ACPI_HESTB_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f)
> #define ACPI_IORT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ITS_GROUP,f)
> @@ -1414,6 +1415,26 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[] =
> ACPI_DMT_TERMINATOR
> };
>
> +/* 10: Generic Hardware Error Source - Version 2 */
> +
> +ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[] =
> +{
> + ACPI_DM_HEST_HEADER,
> + {ACPI_DMT_UINT16, ACPI_HEST10_OFFSET (RelatedSourceId), "Related Source Id", 0},
> + {ACPI_DMT_UINT8, ACPI_HEST10_OFFSET (Reserved), "Reserved", 0},
> + {ACPI_DMT_UINT8, ACPI_HEST10_OFFSET (Enabled), "Enabled", 0},
> + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
> + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0},
> + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (MaxRawDataLength), "Max Raw Data Length", 0},
> + {ACPI_DMT_GAS, ACPI_HEST10_OFFSET (ErrorStatusAddress), "Error Status Address", 0},
> + {ACPI_DMT_HESTNTFY, ACPI_HEST10_OFFSET (Notify), "Notify", 0},
> + {ACPI_DMT_UINT32, ACPI_HEST10_OFFSET (ErrorBlockLength), "Error Status Block Length", 0},
> + {ACPI_DMT_GAS, ACPI_HEST10_OFFSET (ReadAckRegister), "Read Ack Register", 0},
> + {ACPI_DMT_UINT64, ACPI_HEST10_OFFSET (ReadAckPreserve), "Read Ack Preserve", 0},
> + {ACPI_DMT_UINT64, ACPI_HEST10_OFFSET (ReadAckWrite), "Read Ack Write", 0},
> + ACPI_DMT_TERMINATOR
> +};
> +
> ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[] =
> {
> {ACPI_DMT_HESTNTYP, ACPI_HESTN_OFFSET (Type), "Notify Type", 0},
> @@ -2213,6 +2234,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit1[] =
> {ACPI_DMT_FLAG3, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Device not armed", 0},
> {ACPI_DMT_FLAG4, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Health events observed", 0},
> {ACPI_DMT_FLAG5, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Health events enabled", 0},
> + {ACPI_DMT_FLAG6, ACPI_NFIT1_FLAG_OFFSET (Flags,0), "Mapping failed", 0},
> {ACPI_DMT_UINT16, ACPI_NFIT1_OFFSET (Reserved), "Reserved", 0},
> ACPI_DMT_TERMINATOR
> };
> diff --git a/src/acpica/source/compiler/Makefile.am b/src/acpica/source/compiler/Makefile.am
> index 26968d2..9dc9539 100644
> --- a/src/acpica/source/compiler/Makefile.am
> +++ b/src/acpica/source/compiler/Makefile.am
> @@ -58,13 +58,15 @@ CLEANFILES = y.output y.tab.c y.tab.h aslcompiler.y.h $(BUILT_SOURCES)
> libfwtsiasl_la_CPPFLAGS = $(AM_CPPFLAGS)
> libfwtsiasl_la_SOURCES = \
> fwts_iasl_interface.c \
> + aslanalyze.c \
> aslascii.c \
> aslcompile.c \
> aslcompilerlex.c \
> aslcompiler.c \
> - aslanalyze.c \
> aslcodegen.c \
> + asldebug.c \
> aslerror.c \
> + aslexternal.c \
> aslfiles.c \
> aslfold.c \
> asllength.c \
> @@ -102,6 +104,7 @@ libfwtsiasl_la_SOURCES = \
> asllistsup.c \
> asloffset.c \
> aslxref.c \
> + aslxrefout.c \
> aslprepkg.c \
> aslprintf.c \
> aslprune.c \
> diff --git a/src/acpica/source/compiler/aslanalyze.c b/src/acpica/source/compiler/aslanalyze.c
> index 3d49f21..bcbdc55 100644
> --- a/src/acpica/source/compiler/aslanalyze.c
> +++ b/src/acpica/source/compiler/aslanalyze.c
> @@ -380,6 +380,12 @@ AnCheckMethodReturnValue (
>
> Node = ArgOp->Asl.Node;
>
> + if (!Node)
> + {
> + /* No error message, this can happen and is OK */
> +
> + return;
> + }
>
> /* Examine the parent op of this method */
>
> diff --git a/src/acpica/source/compiler/aslbtypes.c b/src/acpica/source/compiler/aslbtypes.c
> index d472df7..cad5b66 100644
> --- a/src/acpica/source/compiler/aslbtypes.c
> +++ b/src/acpica/source/compiler/aslbtypes.c
> @@ -480,12 +480,25 @@ AnGetBtype (
> Node = Op->Asl.Node;
> if (!Node)
> {
> + /* These are not expected to have a node at this time */
> +
> + if ((Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEWORDFIELD) ||
> + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEDWORDFIELD) ||
> + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEQWORDFIELD) ||
> + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEBYTEFIELD) ||
> + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEBITFIELD) ||
> + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CREATEFIELD) ||
> + (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF))
> + {
> + return (ACPI_UINT32_MAX - 1);
> + }
> +
> DbgPrint (ASL_DEBUG_OUTPUT,
> "No attached Nsnode: [%s] at line %u name [%s], "
> - "ignoring typecheck\n",
> + "ignoring typecheck. Parent [%s]\n",
> Op->Asl.ParseOpName, Op->Asl.LineNumber,
> - Op->Asl.ExternalName);
> - return (ACPI_UINT32_MAX);
> + Op->Asl.ExternalName, Op->Asl.Parent->Asl.ParseOpName);
> + return (ACPI_UINT32_MAX - 1);
> }
>
> ThisNodeBtype = AnMapEtypeToBtype (Node->Type);
> diff --git a/src/acpica/source/compiler/aslcodegen.c b/src/acpica/source/compiler/aslcodegen.c
> index 1bfc0e1..ae96b36 100644
> --- a/src/acpica/source/compiler/aslcodegen.c
> +++ b/src/acpica/source/compiler/aslcodegen.c
> @@ -169,22 +169,16 @@ CgGenerateAmlOutput (
> void)
> {
>
> - DbgPrint (ASL_DEBUG_OUTPUT, "\nWriting AML\n\n");
> -
> /* Generate the AML output file */
>
> FlSeekFile (ASL_FILE_SOURCE_OUTPUT, 0);
> Gbl_SourceLine = 0;
> Gbl_NextError = Gbl_ErrorLog;
>
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> CgAmlWriteWalk, NULL, NULL);
>
> - DbgPrint (ASL_TREE_OUTPUT,
> - "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"
> - " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n",
> - 76, " ");
> -
> + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2);
> CgCloseTable ();
> }
>
> @@ -208,40 +202,43 @@ CgAmlWriteWalk (
> void *Context)
> {
>
> - /*
> - * Print header at level 0. Alignment assumes 32-bit pointers
> - */
> - if (!Level)
> + /* Generate the AML for this node */
> +
> + CgWriteNode (Op);
> +
> + if (!Gbl_DebugFlag)
> {
> - DbgPrint (ASL_TREE_OUTPUT,
> - "Final parse tree used for AML output:\n");
> - DbgPrint (ASL_TREE_OUTPUT,
> - "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"
> - " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n",
> - 76, " ");
> + return (AE_OK);
> }
>
> - /* Debug output */
> -
> - DbgPrint (ASL_TREE_OUTPUT,
> - "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
> - UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
> + /* Print header at level 0. Alignment assumes 32-bit pointers */
>
> - if (Op->Asl.ParseOpcode == PARSEOP_NAMESEG ||
> - Op->Asl.ParseOpcode == PARSEOP_NAMESTRING ||
> - Op->Asl.ParseOpcode == PARSEOP_METHODCALL)
> + if (!Level)
> {
> DbgPrint (ASL_TREE_OUTPUT,
> - "%10.32s ", Op->Asl.ExternalName);
> + "\nFinal parse tree used for AML output:\n");
> + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2);
> }
> - else
> +
> + /* Dump ParseOp name and possible value */
> +
> + switch (Op->Asl.ParseOpcode)
> {
> - DbgPrint (ASL_TREE_OUTPUT, " ");
> + case PARSEOP_NAMESEG:
> + case PARSEOP_NAMESTRING:
> + case PARSEOP_METHODCALL:
> + case PARSEOP_STRING_LITERAL:
> +
> + UtDumpStringOp (Op, Level);
> + break;
> +
> + default:
> +
> + UtDumpBasicOp (Op, Level);
> + break;
> }
>
> - DbgPrint (ASL_TREE_OUTPUT,
> - "%08X %04X %04X %01X %04X %04X %04X %04X "
> - "%08X %08X %08X %08X %08X %08X %04X %02d %02d %02d %02d %02d\n",
> + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_DEBUG2,
> /* 1 */ (UINT32) Op->Asl.Value.Integer,
> /* 2 */ Op->Asl.ParseOpcode,
> /* 3 */ Op->Asl.AmlOpcode,
> @@ -263,9 +260,6 @@ CgAmlWriteWalk (
> /* 19 */ Op->Asl.LogicalLineNumber,
> /* 20 */ Op->Asl.EndLogicalLine);
>
> - /* Generate the AML for this node */
> -
> - CgWriteNode (Op);
> return (AE_OK);
> }
>
> @@ -630,7 +624,7 @@ CgCloseTable (
>
> /* Process all definition blocks */
>
> - Op = RootNode->Asl.Child;
> + Op = Gbl_ParseTreeRoot->Asl.Child;
> while (Op)
> {
> CgUpdateHeader (Op);
> @@ -662,7 +656,6 @@ CgWriteNode (
> /* TBD: this may not be the best place for this check */
>
> if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) ||
> - (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) ||
> (Op->Asl.ParseOpcode == PARSEOP_INCLUDE) ||
> (Op->Asl.ParseOpcode == PARSEOP_INCLUDE_END))
> {
> diff --git a/src/acpica/source/compiler/aslcompile.c b/src/acpica/source/compiler/aslcompile.c
> index c7d120e..63d9c6a 100644
> --- a/src/acpica/source/compiler/aslcompile.c
> +++ b/src/acpica/source/compiler/aslcompile.c
> @@ -210,7 +210,7 @@ CmDoCompile (
>
> /* Did the parse tree get successfully constructed? */
>
> - if (!RootNode)
> + if (!Gbl_ParseTreeRoot)
> {
> /*
> * If there are no errors, then we have some sort of
> @@ -238,22 +238,22 @@ CmDoCompile (
>
> LsDumpParseTree ();
>
> - OpcGetIntegerWidth (RootNode->Asl.Child);
> + OpcGetIntegerWidth (Gbl_ParseTreeRoot->Asl.Child);
> UtEndEvent (Event);
>
> /* Pre-process parse tree for any operator transforms */
>
> Event = UtBeginEvent ("Parse tree transforms");
> DbgPrint (ASL_DEBUG_OUTPUT, "\nParse tree transforms\n\n");
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
> - TrAmlTransformWalk, NULL, NULL);
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
> + TrAmlTransformWalkBegin, TrAmlTransformWalkEnd, NULL);
> UtEndEvent (Event);
>
> /* Generate AML opcodes corresponding to the parse tokens */
>
> Event = UtBeginEvent ("Generate AML opcodes");
> - DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating AML opcodes\n\n");
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
> + DbgPrint (ASL_DEBUG_OUTPUT, "Generating AML opcodes\n\n");
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL,
> OpcAmlOpcodeWalk, NULL);
> UtEndEvent (Event);
>
> @@ -275,11 +275,11 @@ CmDoCompile (
>
> Event = UtBeginEvent ("Constant folding via AML interpreter");
> DbgPrint (ASL_DEBUG_OUTPUT,
> - "\nInterpreting compile-time constant expressions\n\n");
> + "Interpreting compile-time constant expressions\n\n");
>
> if (Gbl_FoldConstants)
> {
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> OpcAmlConstantWalk, NULL, NULL);
> }
> else
> @@ -292,16 +292,16 @@ CmDoCompile (
>
> Event = UtBeginEvent ("Updating AML opcodes after constant folding");
> DbgPrint (ASL_DEBUG_OUTPUT,
> - "\nUpdating AML opcodes after constant folding\n\n");
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
> + "Updating AML opcodes after constant folding\n\n");
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD,
> NULL, OpcAmlOpcodeUpdateWalk, NULL);
> UtEndEvent (Event);
>
> /* Calculate all AML package lengths */
>
> Event = UtBeginEvent ("Generate AML package lengths");
> - DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n");
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
> + DbgPrint (ASL_DEBUG_OUTPUT, "Generating Package lengths\n\n");
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL,
> LnPackageLengthWalk, NULL);
> UtEndEvent (Event);
>
> @@ -327,7 +327,8 @@ CmDoCompile (
> /* Namespace loading */
>
> Event = UtBeginEvent ("Create ACPI Namespace");
> - Status = LdLoadNamespace (RootNode);
> + DbgPrint (ASL_DEBUG_OUTPUT, "Creating ACPI Namespace\n\n");
> + Status = LdLoadNamespace (Gbl_ParseTreeRoot);
> UtEndEvent (Event);
> if (ACPI_FAILURE (Status))
> {
> @@ -338,6 +339,7 @@ CmDoCompile (
>
> AslGbl_NamespaceEvent = UtBeginEvent (
> "Cross reference parse tree and Namespace");
> + DbgPrint (ASL_DEBUG_OUTPUT, "Cross referencing namespace\n\n");
> Status = XfCrossReferenceNamespace ();
> if (ACPI_FAILURE (Status))
> {
> @@ -349,6 +351,14 @@ CmDoCompile (
> LkFindUnreferencedObjects ();
> UtEndEvent (AslGbl_NamespaceEvent);
>
> + /* Resolve External Declarations */
> +
> + Event = UtBeginEvent ("Resolve all Externals");
> + DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n");
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
> + ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL);
> + UtEndEvent (Event);
> +
> /*
> * Semantic analysis. This can happen only after the
> * namespace has been loaded and cross-referenced.
> @@ -358,17 +368,30 @@ CmDoCompile (
> Event = UtBeginEvent ("Analyze control method return types");
> AnalysisWalkInfo.MethodStack = NULL;
>
> - DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method analysis\n\n");
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE,
> + DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - Method analysis\n\n");
> +
> + if (Gbl_CrossReferenceOutput)
> + {
> + OtPrintHeaders ("Part 1: Object Reference Map "
> + "(Object references from within each control method)");
> + }
> +
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
> MtMethodAnalysisWalkBegin,
> MtMethodAnalysisWalkEnd, &AnalysisWalkInfo);
> UtEndEvent (Event);
>
> + /* Generate the object cross-reference file if requested */
> +
> + Event = UtBeginEvent ("Generate cross-reference file");
> + OtCreateXrefFile ();
> + UtEndEvent (Event);
> +
> /* Semantic error checking part two - typing of method returns */
>
> Event = UtBeginEvent ("Determine object types returned by methods");
> - DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - Method typing\n\n");
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
> + DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - Method typing\n\n");
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD,
> NULL, AnMethodTypingWalkEnd, NULL);
> UtEndEvent (Event);
>
> @@ -376,10 +399,10 @@ CmDoCompile (
>
> Event = UtBeginEvent ("Analyze AML operand types");
> DbgPrint (ASL_DEBUG_OUTPUT,
> - "\nSemantic analysis - Operand type checking\n\n");
> + "Semantic analysis - Operand type checking\n\n");
> if (Gbl_DoTypechecking)
> {
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD,
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD,
> NULL, AnOperandTypecheckWalkEnd, &AnalysisWalkInfo);
> }
> UtEndEvent (Event);
> @@ -387,8 +410,8 @@ CmDoCompile (
> /* Semantic error checking part four - other miscellaneous checks */
>
> Event = UtBeginEvent ("Miscellaneous analysis");
> - DbgPrint (ASL_DEBUG_OUTPUT, "\nSemantic analysis - miscellaneous\n\n");
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
> + DbgPrint (ASL_DEBUG_OUTPUT, "Semantic analysis - miscellaneous\n\n");
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> AnOtherSemanticAnalysisWalkBegin,
> NULL, &AnalysisWalkInfo);
> UtEndEvent (Event);
> @@ -396,16 +419,17 @@ CmDoCompile (
> /* Calculate all AML package lengths */
>
> Event = UtBeginEvent ("Finish AML package length generation");
> - DbgPrint (ASL_DEBUG_OUTPUT, "\nGenerating Package lengths\n\n");
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
> + DbgPrint (ASL_DEBUG_OUTPUT, "Generating Package lengths\n\n");
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL,
> LnInitLengthsWalk, NULL);
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_UPWARD, NULL,
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_UPWARD, NULL,
> LnPackageLengthWalk, NULL);
> UtEndEvent (Event);
>
> /* Code generation - emit the AML */
>
> Event = UtBeginEvent ("Generate AML code and write output files");
> + DbgPrint (ASL_DEBUG_OUTPUT, "Writing AML byte code\n\n");
> CgGenerateAmlOutput ();
> UtEndEvent (Event);
>
> @@ -888,7 +912,7 @@ CmDeleteCaches (
> Gbl_ParseOpCount = 0;
> Gbl_ParseOpCacheNext = NULL;
> Gbl_ParseOpCacheLast = NULL;
> - RootNode = NULL;
> + Gbl_ParseTreeRoot = NULL;
>
> /* Generic string cache */
>
> diff --git a/src/acpica/source/compiler/aslcompiler.h b/src/acpica/source/compiler/aslcompiler.h
> index 13dee53..d610260 100644
> --- a/src/acpica/source/compiler/aslcompiler.h
> +++ b/src/acpica/source/compiler/aslcompiler.h
> @@ -724,7 +724,13 @@ ApCheckPackage (
> * asltransform - parse tree transformations
> */
> ACPI_STATUS
> -TrAmlTransformWalk (
> +TrAmlTransformWalkBegin (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context);
> +
> +ACPI_STATUS
> +TrAmlTransformWalkEnd (
> ACPI_PARSE_OBJECT *Op,
> UINT32 Level,
> void *Context);
> @@ -741,6 +747,25 @@ TrWalkParseTree (
> ASL_WALK_CALLBACK AscendingCallback,
> void *Context);
>
> +/*
> + * aslexternal - External opcode support
> + */
> +ACPI_STATUS
> +ExAmlExternalWalkBegin (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context);
> +
> +ACPI_STATUS
> +ExAmlExternalWalkEnd (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context);
> +
> +void
> +ExDoExternal (
> + ACPI_PARSE_OBJECT *Op);
> +
> /* Values for "Visitation" parameter above */
>
> #define ASL_WALK_VISIT_DOWNWARD 0x01
> @@ -981,6 +1006,24 @@ XfCrossReferenceNamespace (
>
>
> /*
> + * aslxrefout
> + */
> +void
> +OtPrintHeaders (
> + char *Message);
> +
> +void
> +OtCreateXrefFile (
> + void);
> +
> +void
> +OtXrefWalkPart1 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + ASL_METHOD_INFO *MethodInfo);
> +
> +
> +/*
> * aslutils - common compiler utilites
> */
> void
> @@ -995,11 +1038,31 @@ DbgPrint (
> #define ASL_PARSE_OUTPUT 1
> #define ASL_TREE_OUTPUT 2
>
> +UINT8
> +UtIsBigEndianMachine (
> + void);
> +
> BOOLEAN
> UtQueryForOverwrite (
> char *Pathname);
>
> void
> +UtDumpStringOp (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level);
> +
> +void
> +UtDumpIntegerOp (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + UINT32 IntegerLength);
> +
> +void
> +UtDumpBasicOp (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level);
> +
> +void
> UtDisplaySupportedTables (
> void);
>
> @@ -1020,11 +1083,6 @@ UtLocalCalloc (
> UINT32 Size);
>
> void
> -UtPrintFormattedName (
> - UINT16 ParseOpcode,
> - UINT32 Level);
> -
> -void
> UtDisplaySummary (
> UINT32 FileId);
>
> @@ -1078,12 +1136,6 @@ UINT64
> UtDoConstant (
> char *String);
>
> -ACPI_STATUS
> -stroul64 (
> - char *String,
> - UINT32 Base,
> - UINT64 *RetInteger);
> -
>
> /*
> * asluuid - UUID support
> diff --git a/src/acpica/source/compiler/aslcompiler.y b/src/acpica/source/compiler/aslcompiler.y
> index 4f69f30..efa5ce1 100644
> --- a/src/acpica/source/compiler/aslcompiler.y
> +++ b/src/acpica/source/compiler/aslcompiler.y
> @@ -1404,7 +1404,6 @@ ObjectTypeName
> | RefOfTerm {}
> | DerefOfTerm {}
> | IndexTerm {}
> -
> /* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */
> ;
>
> diff --git a/src/acpica/source/compiler/asldebug.c b/src/acpica/source/compiler/asldebug.c
> new file mode 100644
> index 0000000..4a3aa6d
> --- /dev/null
> +++ b/src/acpica/source/compiler/asldebug.c
> @@ -0,0 +1,325 @@
> +/******************************************************************************
> + *
> + * Module Name: asldebug -- Debug output support
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +#include "aslcompiler.h"
> +#include "aslcompiler.y.h"
> +
> +
> +#define _COMPONENT ACPI_COMPILER
> + ACPI_MODULE_NAME ("asldebug")
> +
> +
> +/* Local prototypes */
> +
> +static void
> +UtDumpParseOpName (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + UINT32 DataLength);
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: UtDumpIntegerOp
> + *
> + * PARAMETERS: Op - Current parse op
> + * Level - Current output indentation level
> + * IntegerLength - Output length of the integer (2/4/8/16)
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Emit formatted debug output for "integer" ops.
> + * Note: IntegerLength must be one of 2,4,8,16.
> + *
> + ******************************************************************************/
> +
> +void
> +UtDumpIntegerOp (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + UINT32 IntegerLength)
> +{
> +
> + /* Emit the ParseOp name, leaving room for the integer */
> +
> + UtDumpParseOpName (Op, Level, IntegerLength);
> +
> + /* Emit the integer based upon length */
> +
> + switch (IntegerLength)
> + {
> + case 2: /* Byte */
> + case 4: /* Word */
> + case 8: /* Dword */
> +
> + DbgPrint (ASL_TREE_OUTPUT,
> + "%*.*X", IntegerLength, IntegerLength, Op->Asl.Value.Integer);
> + break;
> +
> + case 16: /* Qword and Integer */
> +
> + DbgPrint (ASL_TREE_OUTPUT,
> + "%8.8X%8.8X", ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
> + break;
> +
> + default:
> + break;
> + }
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: UtDumpStringOp
> + *
> + * PARAMETERS: Op - Current parse op
> + * Level - Current output indentation level
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Emit formatted debug output for String/Pathname ops.
> + *
> + ******************************************************************************/
> +
> +void
> +UtDumpStringOp (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level)
> +{
> + char *String;
> +
> +
> + String = Op->Asl.Value.String;
> +
> + if (Op->Asl.ParseOpcode != PARSEOP_STRING_LITERAL)
> + {
> + /*
> + * For the "path" ops NAMEPATH, NAMESEG, METHODCALL -- if the
> + * ExternalName is valid, it takes precedence. In these cases the
> + * Value.String is the raw "internal" name from the AML code, which
> + * we don't want to use, because it contains non-ascii characters.
> + */
> + if (Op->Asl.ExternalName)
> + {
> + String = Op->Asl.ExternalName;
> + }
> + }
> +
> + if (!String)
> + {
> + DbgPrint (ASL_TREE_OUTPUT,
> + " ERROR: Could not find a valid String/Path pointer\n");
> + return;
> + }
> +
> + /* Emit the ParseOp name, leaving room for the string */
> +
> + UtDumpParseOpName (Op, Level, strlen (String));
> + DbgPrint (ASL_TREE_OUTPUT, "%s", String);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: UtDumpBasicOp
> + *
> + * PARAMETERS: Op - Current parse op
> + * Level - Current output indentation level
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Generic formatted debug output for "basic" ops that have no
> + * associated strings or integer values.
> + *
> + ******************************************************************************/
> +
> +void
> +UtDumpBasicOp (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level)
> +{
> +
> + /* Just print out the ParseOp name, there is no extra data */
> +
> + UtDumpParseOpName (Op, Level, 0);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: UtDumpParseOpName
> + *
> + * PARAMETERS: Op - Current parse op
> + * Level - Current output indentation level
> + * DataLength - Length of data to appear after the name
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Indent and emit the ascii ParseOp name for the op
> + *
> + ******************************************************************************/
> +
> +static void
> +UtDumpParseOpName (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + UINT32 DataLength)
> +{
> + char *ParseOpName;
> + UINT32 IndentLength;
> + UINT32 NameLength;
> + UINT32 LineLength;
> + UINT32 PaddingLength;
> +
> +
> + /* Emit the LineNumber/IndentLevel prefix on each output line */
> +
> + DbgPrint (ASL_TREE_OUTPUT,
> + "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
> +
> + ParseOpName = UtGetOpName (Op->Asl.ParseOpcode);
> +
> + /* Calculate various lengths for output alignment */
> +
> + IndentLength = Level * DEBUG_SPACES_PER_INDENT;
> + NameLength = strlen (ParseOpName);
> + LineLength = IndentLength + 1 + NameLength + 1 + DataLength;
> + PaddingLength = (DEBUG_MAX_LINE_LENGTH + 1) - LineLength;
> +
> + /* Parse tree indentation is based upon the nesting/indent level */
> +
> + if (Level)
> + {
> + DbgPrint (ASL_TREE_OUTPUT, "%*s", IndentLength, " ");
> + }
> +
> + /* Emit the actual name here */
> +
> + DbgPrint (ASL_TREE_OUTPUT, " %s", ParseOpName);
> +
> + /* Emit extra padding blanks for alignment of later data items */
> +
> + if (LineLength > DEBUG_MAX_LINE_LENGTH)
> + {
> + /* Split a long line immediately after the ParseOpName string */
> +
> + DbgPrint (ASL_TREE_OUTPUT, "\n%*s",
> + (DEBUG_FULL_LINE_LENGTH - DataLength), " ");
> + }
> + else
> + {
> + DbgPrint (ASL_TREE_OUTPUT, "%*s", PaddingLength, " ");
> + }
> +}
> diff --git a/src/acpica/source/compiler/asldefine.h b/src/acpica/source/compiler/asldefine.h
> index 7287c43..47e64ac 100644
> --- a/src/acpica/source/compiler/asldefine.h
> +++ b/src/acpica/source/compiler/asldefine.h
> @@ -126,7 +126,7 @@
> #define ASL_CREATOR_ID "INTL"
> #define ASL_DEFINE "__IASL__"
>
> -#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.0"
> +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.1"
>
>
> /* Configuration constants */
> @@ -190,8 +190,7 @@
> #define ASL_ABORT TRUE
> #define ASL_NO_ABORT FALSE
> #define ASL_EOF ACPI_UINT32_MAX
> -#define ASL_WITHIN_COMMENT (ACPI_UINT32_MAX -1)
> -#define ASL_BLANK_LINE (ACPI_UINT32_MAX -1)
> +#define ASL_IGNORE_LINE (ACPI_UINT32_MAX -1)
>
>
> /* Listings */
> @@ -228,4 +227,34 @@
> #define RsCreateQwordField(Op, Name, ByteOffset) \
> RsCreateResourceField (Op, Name, ByteOffset, 0, 64);
>
> +
> +/*
> + * Macros for debug output
> + */
> +
> +#define DEBUG_MAX_LINE_LENGTH 61
> +#define DEBUG_SPACES_PER_INDENT 3
> +#define DEBUG_FULL_LINE_LENGTH 71
> +
> +#define ASL_PARSE_TREE_FULL_LINE "\n%71.71s"
> +
> +/* Header/Trailer for original parse tree directly from the parser */
> +
> +#define ASL_PARSE_TREE_HEADER1 \
> + "%*s Value P_Op Flags Line# End# LogL# EndL#\n", 65, " "
> +
> +#define ASL_PARSE_TREE_DEBUG1 \
> + " %4.4X %8.8X %5d %5d %5d %5d"
> +
> +/* Header/Trailer for processed parse tree used for AML generation */
> +
> +#define ASL_PARSE_TREE_HEADER2 \
> + "%*s NameString Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr"\
> + " Parent Child Next Flags AcTyp Final Col"\
> + " Line# End# LogL# EndL#\n", 60, " "
> +
> +#define ASL_PARSE_TREE_DEBUG2 \
> + " %08X %04X %04X %01X %04X %04X %05X %05X "\
> + "%08X %08X %08X %08X %08X %08X %04X %02d %5d %5d %5d %5d\n"
> +
> #endif /* ASLDEFINE.H */
> diff --git a/src/acpica/source/compiler/aslexternal.c b/src/acpica/source/compiler/aslexternal.c
> new file mode 100644
> index 0000000..7a347f5
> --- /dev/null
> +++ b/src/acpica/source/compiler/aslexternal.c
> @@ -0,0 +1,563 @@
> +/******************************************************************************
> + *
> + * Module Name: aslexternal - ASL External opcode compiler support
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +#include "aslcompiler.h"
> +#include "aslcompiler.y.h"
> +#include "acparser.h"
> +#include "amlcode.h"
> +#include "acnamesp.h"
> +
> +
> +#define _COMPONENT ACPI_COMPILER
> + ACPI_MODULE_NAME ("aslexternal")
> +
> +
> +/* Local prototypes */
> +
> +static void
> +ExInsertArgCount (
> + ACPI_PARSE_OBJECT *Op);
> +
> +static void
> +ExMoveExternals (
> + ACPI_PARSE_OBJECT *DefinitionBlockOp);
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: ExDoExternal
> + *
> + * PARAMETERS: Op - Current Parse node
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Add an External() definition to the global list. This list
> + * is used to generate External opcodes.
> + *
> + ******************************************************************************/
> +
> +void
> +ExDoExternal (
> + ACPI_PARSE_OBJECT *Op)
> +{
> + ACPI_PARSE_OBJECT *ListOp;
> + ACPI_PARSE_OBJECT *Prev;
> + ACPI_PARSE_OBJECT *Next;
> + ACPI_PARSE_OBJECT *ArgCountOp;
> +
> +
> + ArgCountOp = Op->Asl.Child->Asl.Next->Asl.Next;
> + ArgCountOp->Asl.AmlOpcode = AML_RAW_DATA_BYTE;
> + ArgCountOp->Asl.ParseOpcode = PARSEOP_BYTECONST;
> + ArgCountOp->Asl.Value.Integer = 0;
> + UtSetParseOpName (ArgCountOp);
> +
> + /* Create new list node of arbitrary type */
> +
> + ListOp = TrAllocateNode (PARSEOP_DEFAULT_ARG);
> +
> + /* Store External node as child */
> +
> + ListOp->Asl.Child = Op;
> + ListOp->Asl.Next = NULL;
> +
> + if (Gbl_ExternalsListHead)
> + {
> + /* Link new External to end of list */
> +
> + Prev = Gbl_ExternalsListHead;
> + Next = Prev;
> + while (Next)
> + {
> + Prev = Next;
> + Next = Next->Asl.Next;
> + }
> +
> + Prev->Asl.Next = ListOp;
> + }
> + else
> + {
> + Gbl_ExternalsListHead = ListOp;
> + }
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: ExInsertArgCount
> + *
> + * PARAMETERS: Op - Op for a method invocation
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Obtain the number of arguments for a control method -- from
> + * the actual invocation.
> + *
> + ******************************************************************************/
> +
> +static void
> +ExInsertArgCount (
> + ACPI_PARSE_OBJECT *Op)
> +{
> + ACPI_PARSE_OBJECT *Next;
> + ACPI_PARSE_OBJECT *NameOp;
> + ACPI_PARSE_OBJECT *Child;
> + ACPI_PARSE_OBJECT *ArgCountOp;
> + char * ExternalName;
> + char * CallName;
> + UINT16 ArgCount = 0;
> +
> +
> + CallName = AcpiNsGetNormalizedPathname (Op->Asl.Node, TRUE);
> +
> + Next = Gbl_ExternalsListHead;
> + while (Next)
> + {
> + ArgCount = 0;
> +
> + /* Skip if External node already handled */
> +
> + if (Next->Asl.Child->Asl.CompileFlags & NODE_VISITED)
> + {
> + Next = Next->Asl.Next;
> + continue;
> + }
> +
> + NameOp = Next->Asl.Child->Asl.Child;
> + ExternalName = AcpiNsGetNormalizedPathname (NameOp->Asl.Node, TRUE);
> +
> + if (!strcmp (CallName, ExternalName))
> + {
> + Next->Asl.Child->Asl.CompileFlags |= NODE_VISITED;
> +
> + /*
> + * Since we will reposition Externals to the Root, set Namepath
> + * to the fully qualified name and recalculate the aml length
> + */
> + if (ACPI_FAILURE (UtInternalizeName (
> + ExternalName, &NameOp->Asl.Value.String)))
> + {
> + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL,
> + NULL, "- Could not Internalize External");
> +
> + break;
> + }
> +
> + NameOp->Asl.AmlLength = strlen (NameOp->Asl.Value.String);
> +
> + /* Get argument count */
> +
> + Child = Op->Asl.Child;
> + while (Child)
> + {
> + ArgCount++;
> + Child = Child->Asl.Next;
> + }
> +
> + /* Setup ArgCount operand */
> +
> + ArgCountOp = Next->Asl.Child->Asl.Child->Asl.Next->Asl.Next;
> + ArgCountOp->Asl.Value.Integer = ArgCount;
> + break;
> + }
> +
> + Next = Next->Asl.Next;
> + }
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: ExAmlExternalWalkBegin
> + *
> + * PARAMETERS: ASL_WALK_CALLBACK
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Parse tree walk to create external opcode list for methods.
> + *
> + ******************************************************************************/
> +
> +ACPI_STATUS
> +ExAmlExternalWalkBegin (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context)
> +{
> +
> + /* External list head saved in the definition block op */
> +
> + if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK)
> + {
> + Gbl_ExternalsListHead = Op->Asl.Value.Arg;
> + }
> +
> + if (!Gbl_ExternalsListHead)
> + {
> + return (AE_OK);
> + }
> +
> + if (Op->Asl.ParseOpcode != PARSEOP_METHODCALL)
> + {
> + return (AE_OK);
> + }
> +
> + /*
> + * The NameOp child under an ExternalOp gets turned into PARSE_METHODCALL
> + * by XfNamespaceLocateBegin(). Ignore these.
> + */
> + if (Op->Asl.Parent &&
> + Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_EXTERNAL)
> + {
> + return (AE_OK);
> + }
> +
> + ExInsertArgCount (Op);
> + return (AE_OK);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: ExAmlExternalWalkEnd
> + *
> + * PARAMETERS: ASL_WALK_CALLBACK
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Parse tree walk to create external opcode list for methods.
> + * Here, we just want to catch the case where a definition block
> + * has been completed. Then we move all of the externals into
> + * a single block in the parse tree and thus the AML code.
> + *
> + ******************************************************************************/
> +
> +ACPI_STATUS
> +ExAmlExternalWalkEnd (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context)
> +{
> +
> + if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK)
> + {
> + /*
> + * Process any existing external list. (Support for
> + * multiple definition blocks in a single file/compile)
> + */
> + ExMoveExternals (Op);
> + Gbl_ExternalsListHead = NULL;
> + }
> +
> + return (AE_OK);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: ExMoveExternals
> + *
> + * PARAMETERS: DefinitionBlockOp - Op for current definition block
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Move all externals present in the source file into a single
> + * block of AML code, surrounded by an "If (0)" to prevent
> + * AML interpreters from attempting to execute the External
> + * opcodes.
> + *
> + ******************************************************************************/
> +
> +static void
> +ExMoveExternals (
> + ACPI_PARSE_OBJECT *DefinitionBlockOp)
> +{
> + ACPI_PARSE_OBJECT *ParentOp;
> + ACPI_PARSE_OBJECT *ExternalOp;
> + ACPI_PARSE_OBJECT *PredicateOp;
> + ACPI_PARSE_OBJECT *NextOp;
> + ACPI_PARSE_OBJECT *Prev;
> + ACPI_PARSE_OBJECT *Next;
> + ACPI_OBJECT_TYPE ObjType;
> + UINT32 i;
> +
> +
> + if (!Gbl_ExternalsListHead)
> + {
> + return;
> + }
> +
> + /* Remove the External nodes from the tree */
> +
> + NextOp = Gbl_ExternalsListHead;
> + while (NextOp)
> + {
> + /*
> + * The External is stored in child pointer of each node in the
> + * list
> + */
> + ExternalOp = NextOp->Asl.Child;
> +
> + /* Set line numbers (for listings, etc.) */
> +
> + ExternalOp->Asl.LineNumber = 0;
> + ExternalOp->Asl.LogicalLineNumber = 0;
> +
> + Next = ExternalOp->Asl.Child;
> + Next->Asl.LineNumber = 0;
> + Next->Asl.LogicalLineNumber = 0;
> +
> + Next = Next->Asl.Next;
> + Next->Asl.LineNumber = 0;
> + Next->Asl.LogicalLineNumber = 0;
> +
> + Next = Next->Asl.Next;
> + Next->Asl.LineNumber = 0;
> + Next->Asl.LogicalLineNumber = 0;
> +
> + Next = Next->Asl.Next;
> + Next->Asl.LineNumber = 0;
> + Next->Asl.LogicalLineNumber = 0;
> +
> + ParentOp = ExternalOp->Asl.Parent;
> + Prev = Next = ParentOp->Asl.Child;
> +
> + /* Now find the External node's position in parse tree */
> +
> + while (Next != ExternalOp)
> + {
> + Prev = Next;
> + Next = Next->Asl.Next;
> + }
> +
> + /* Remove the External from the parse tree */
> +
> + if (Prev == ExternalOp)
> + {
> + /* External was the first child node */
> +
> + ParentOp->Asl.Child = ExternalOp->Asl.Next;
> + }
> +
> + Prev->Asl.Next = ExternalOp->Asl.Next;
> + ExternalOp->Asl.Next = NULL;
> + ExternalOp->Asl.Parent = Gbl_ExternalsListHead;
> +
> + /* Point the External to the next in the list */
> +
> + if (NextOp->Asl.Next)
> + {
> + ExternalOp->Asl.Next = NextOp->Asl.Next->Asl.Child;
> + }
> +
> + NextOp = NextOp->Asl.Next;
> + }
> +
> + /*
> + * Loop again to remove MethodObj Externals for which
> + * a MethodCall was not found (dead external reference)
> + */
> + Prev = Gbl_ExternalsListHead->Asl.Child;
> + Next = Prev;
> + while (Next)
> + {
> + ObjType = (ACPI_OBJECT_TYPE)
> + Next->Asl.Child->Asl.Next->Asl.Value.Integer;
> +
> + if (ObjType == ACPI_TYPE_METHOD &&
> + !(Next->Asl.CompileFlags & NODE_VISITED))
> + {
> + if (Next == Prev)
> + {
> + Gbl_ExternalsListHead->Asl.Child = Next->Asl.Next;
> + Next->Asl.Next = NULL;
> + Prev = Gbl_ExternalsListHead->Asl.Child;
> + Next = Prev;
> + continue;
> + }
> + else
> + {
> + Prev->Asl.Next = Next->Asl.Next;
> + Next->Asl.Next = NULL;
> + Next = Prev->Asl.Next;
> + continue;
> + }
> + }
> +
> + Prev = Next;
> + Next = Next->Asl.Next;
> + }
> +
> + /* If list is now empty, don't bother to make If (0) block */
> +
> + if (!Gbl_ExternalsListHead->Asl.Child)
> + {
> + return;
> + }
> +
> + /* Convert Gbl_ExternalsListHead parent to If(). */
> +
> + Gbl_ExternalsListHead->Asl.ParseOpcode = PARSEOP_IF;
> + Gbl_ExternalsListHead->Asl.AmlOpcode = AML_IF_OP;
> + Gbl_ExternalsListHead->Asl.CompileFlags = NODE_AML_PACKAGE;
> + UtSetParseOpName (Gbl_ExternalsListHead);
> +
> + /* Create a Zero op for the If predicate */
> +
> + PredicateOp = TrAllocateNode (PARSEOP_ZERO);
> + PredicateOp->Asl.AmlOpcode = AML_ZERO_OP;
> +
> + PredicateOp->Asl.Parent = Gbl_ExternalsListHead;
> + PredicateOp->Asl.Child = NULL;
> + PredicateOp->Asl.Next = Gbl_ExternalsListHead->Asl.Child;
> + Gbl_ExternalsListHead->Asl.Child = PredicateOp;
> +
> + /* Set line numbers (for listings, etc.) */
> +
> + Gbl_ExternalsListHead->Asl.LineNumber = 0;
> + Gbl_ExternalsListHead->Asl.LogicalLineNumber = 0;
> +
> + PredicateOp->Asl.LineNumber = 0;
> + PredicateOp->Asl.LogicalLineNumber = 0;
> +
> + /* Insert block back in the list */
> +
> + Prev = DefinitionBlockOp->Asl.Child;
> + Next = Prev;
> +
> + /* Find last default arg */
> +
> + for (i = 0; i < 6; i++)
> + {
> + Prev = Next;
> + Next = Prev->Asl.Next;
> + }
> +
> + if (Next)
> + {
> + /* Definition Block is not empty */
> +
> + Gbl_ExternalsListHead->Asl.Next = Next;
> + }
> + else
> + {
> + /* Definition Block is empty. */
> +
> + Gbl_ExternalsListHead->Asl.Next = NULL;
> + }
> +
> + Prev->Asl.Next = Gbl_ExternalsListHead;
> + Gbl_ExternalsListHead->Asl.Parent = Prev->Asl.Parent;
> +}
> diff --git a/src/acpica/source/compiler/aslfiles.c b/src/acpica/source/compiler/aslfiles.c
> index 472cbd9..f681b28 100644
> --- a/src/acpica/source/compiler/aslfiles.c
> +++ b/src/acpica/source/compiler/aslfiles.c
> @@ -705,6 +705,24 @@ FlOpenMiscOutputFiles (
> AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT);
> }
>
> + /* Create/Open a cross-reference output file if asked */
> +
> + if (Gbl_CrossReferenceOutput)
> + {
> + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_XREF);
> + if (!Filename)
> + {
> + AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
> + 0, 0, 0, 0, NULL, NULL);
> + return (AE_ERROR);
> + }
> +
> + FlOpenFile (ASL_FILE_XREF_OUTPUT, Filename, "w+t");
> +
> + AslCompilerSignon (ASL_FILE_XREF_OUTPUT);
> + AslCompilerFileHeader (ASL_FILE_XREF_OUTPUT);
> + }
> +
> /* Create/Open a listing output file if asked */
>
> if (Gbl_ListingFlag)
> diff --git a/src/acpica/source/compiler/aslglobal.h b/src/acpica/source/compiler/aslglobal.h
> index ef64159..14a4db2 100644
> --- a/src/acpica/source/compiler/aslglobal.h
> +++ b/src/acpica/source/compiler/aslglobal.h
> @@ -155,7 +155,8 @@ ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] =
> {NULL, NULL, "ASM Include: ", "Assembly Header Output"},
> {NULL, NULL, "C Include: ", "C Header Output"},
> {NULL, NULL, "Offset Table: ", "C Offset Table Output"},
> - {NULL, NULL, "Device Map: ", "Device Map Output"}
> + {NULL, NULL, "Device Map: ", "Device Map Output"},
> + {NULL, NULL, "Cross Ref: ", "Cross-reference Output"}
> };
>
> #else
> @@ -221,6 +222,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE);
> ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE);
> ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_KeepPreprocessorTempFile, FALSE);
> ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE);
> +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CrossReferenceOutput, FALSE);
> ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE);
> ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE);
> ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_OffsetTableFlag, FALSE);
> @@ -312,14 +314,16 @@ ASL_EXTERN ACPI_SERIAL_INFO ASL_INIT_GLOBAL (*Gbl_SerialList, NULL);
>
> ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_RevisionOverride, 0);
> ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_TempCount, 0);
> -ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*RootNode, NULL);
> +ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ParseTreeRoot, NULL);
> +ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_ExternalsListHead, NULL);
> ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_TableLength, 0);
> ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_SourceLine, 0);
> ASL_EXTERN ASL_LISTING_NODE ASL_INIT_GLOBAL (*Gbl_ListingNode, NULL);
> -ASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode;
> ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_FileType, 0);
> ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Signature, NULL);
>
> +ASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode;
> +
> ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0);
> ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentAmlOffset, 0);
> ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLine, 0);
> @@ -340,7 +344,7 @@ ASL_EXTERN ACPI_TABLE_HEADER TableHeader;
>
> /* Event timing */
>
> -#define ASL_NUM_EVENTS 20
> +#define ASL_NUM_EVENTS 24
> ASL_EXTERN ASL_EVENT_INFO AslGbl_Events[ASL_NUM_EVENTS];
> ASL_EXTERN UINT8 AslGbl_NextEvent;
> ASL_EXTERN UINT8 AslGbl_NamespaceEvent;
> diff --git a/src/acpica/source/compiler/asllength.c b/src/acpica/source/compiler/asllength.c
> index 25f13b2..79e70a6 100644
> --- a/src/acpica/source/compiler/asllength.c
> +++ b/src/acpica/source/compiler/asllength.c
> @@ -471,7 +471,6 @@ CgGenerateAmlLengths (
> break;
>
> case PARSEOP_DEFAULT_ARG:
> - case PARSEOP_EXTERNAL:
> case PARSEOP_INCLUDE:
> case PARSEOP_INCLUDE_END:
>
> diff --git a/src/acpica/source/compiler/asllisting.c b/src/acpica/source/compiler/asllisting.c
> index 92c5bea..0c81359 100644
> --- a/src/acpica/source/compiler/asllisting.c
> +++ b/src/acpica/source/compiler/asllisting.c
> @@ -235,16 +235,16 @@ LsGenerateListing (
>
> LsDoOffsetTableHeader (FileId);
>
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlOffsetWalk,
> - NULL, (void *) ACPI_TO_POINTER (FileId));
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> + LsAmlOffsetWalk, NULL, (void *) ACPI_TO_POINTER (FileId));
> LsDoOffsetTableFooter (FileId);
> return;
> }
>
> /* Process all parse nodes */
>
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD, LsAmlListingWalk,
> - NULL, (void *) ACPI_TO_POINTER (FileId));
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> + LsAmlListingWalk, NULL, (void *) ACPI_TO_POINTER (FileId));
>
> /* Final processing */
>
> @@ -330,8 +330,12 @@ LsDumpParseTree (
> }
>
> DbgPrint (ASL_TREE_OUTPUT, "\nOriginal parse tree from parser:\n\n");
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
> + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER1);
> +
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> LsTreeWriteWalk, NULL, NULL);
> +
> + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER1);
> }
>
>
> @@ -342,43 +346,69 @@ LsTreeWriteWalk (
> void *Context)
> {
>
> - /* Debug output */
> + /* Dump ParseOp name and possible value */
>
> - DbgPrint (ASL_TREE_OUTPUT,
> - "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
> + switch (Op->Asl.ParseOpcode)
> + {
> + case PARSEOP_NAMESEG:
> + case PARSEOP_NAMESTRING:
> + case PARSEOP_METHODCALL:
> + case PARSEOP_STRING_LITERAL:
>
> - UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
> + UtDumpStringOp (Op, Level);
> + break;
> +
> + case PARSEOP_BYTECONST:
> +
> + UtDumpIntegerOp (Op, Level, 2);
> + break;
> +
> + case PARSEOP_WORDCONST:
> + case PARSEOP_PACKAGE_LENGTH:
> +
> + UtDumpIntegerOp (Op, Level, 4);
> + break;
> +
> + case PARSEOP_DWORDCONST:
> + case PARSEOP_EISAID:
> +
> + UtDumpIntegerOp (Op, Level, 8);
> + break;
> +
> + case PARSEOP_QWORDCONST:
> + case PARSEOP_INTEGER:
> + case PARSEOP_ONE:
> + case PARSEOP_ZERO:
> + case PARSEOP_ONES:
> +
> + UtDumpIntegerOp (Op, Level, 16);
> + break;
> +
> + case PARSEOP_INCLUDE:
>
> - if (Op->Asl.ParseOpcode == PARSEOP_NAMESEG)
> - {
> - DbgPrint (ASL_TREE_OUTPUT,
> - "%10.4s ", Op->Asl.Value.Name);
> - }
> - else if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
> - (Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
> - {
> - DbgPrint (ASL_TREE_OUTPUT,
> - "%10.32s ", Op->Asl.Value.String);
> - }
> - else if (Op->Asl.ParseOpcode == PARSEOP_INCLUDE)
> - {
> DbgPrint (ASL_TREE_OUTPUT,
> "Open: %s\n", Op->Asl.Value.String);
> return (AE_OK);
> - }
> - else if (Op->Asl.ParseOpcode == PARSEOP_INCLUDE_END)
> - {
> +
> + case PARSEOP_INCLUDE_END:
> +
> DbgPrint (ASL_TREE_OUTPUT,
> "Close: %s\n", Op->Asl.Filename);
> return (AE_OK);
> +
> + default:
> +
> + UtDumpBasicOp (Op, Level);
> + break;
> }
> - else
> - {
> - DbgPrint (ASL_TREE_OUTPUT, " ");
> - }
>
> - DbgPrint (ASL_TREE_OUTPUT, " (%.4X) Flags %8.8X",
> - Op->Asl.ParseOpcode, Op->Asl.CompileFlags);
> + /* Dump the remaining data */
> +
> + DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_DEBUG1,
> + Op->Asl.ParseOpcode, Op->Asl.CompileFlags,
> + Op->Asl.LineNumber, Op->Asl.EndLine,
> + Op->Asl.LogicalLineNumber, Op->Asl.EndLogicalLine);
> +
> TrPrintNodeCompileFlags (Op->Asl.CompileFlags);
> DbgPrint (ASL_TREE_OUTPUT, "\n");
> return (AE_OK);
> @@ -471,6 +501,9 @@ LsWriteNodeToListing (
> {
> case PARSEOP_DEFINITION_BLOCK:
>
> + /* Always start a definition block at AML offset zero */
> +
> + Gbl_CurrentAmlOffset = 0;
> LsWriteSourceLines (Op->Asl.EndLine, Op->Asl.EndLogicalLine, FileId);
>
> /* Use the table Signature and TableId to build a unique name */
> diff --git a/src/acpica/source/compiler/aslload.c b/src/acpica/source/compiler/aslload.c
> index 65ff84b..d85750d 100644
> --- a/src/acpica/source/compiler/aslload.c
> +++ b/src/acpica/source/compiler/aslload.c
> @@ -176,8 +176,6 @@ LdLoadNamespace (
> ACPI_WALK_STATE *WalkState;
>
>
> - DbgPrint (ASL_DEBUG_OUTPUT, "\nCreating namespace\n\n");
> -
> /* Create a new walk state */
>
> WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
> diff --git a/src/acpica/source/compiler/aslmain.c b/src/acpica/source/compiler/aslmain.c
> index 0ac138b..671c76f 100644
> --- a/src/acpica/source/compiler/aslmain.c
> +++ b/src/acpica/source/compiler/aslmain.c
> @@ -145,36 +145,6 @@ static void
> AslInitialize (
> void);
>
> -UINT8
> -AcpiIsBigEndianMachine (
> - void);
> -
> -
> -/*******************************************************************************
> - *
> - * FUNCTION: AcpiIsBigEndianMachine
> - *
> - * PARAMETERS: None
> - *
> - * RETURN: TRUE if machine is big endian
> - * FALSE if machine is little endian
> - *
> - * DESCRIPTION: Detect whether machine is little endian or big endian.
> - *
> - ******************************************************************************/
> -
> -UINT8
> -AcpiIsBigEndianMachine (
> - void)
> -{
> - union {
> - UINT32 Integer;
> - UINT8 Bytes[4];
> - } Overlay = {0xFF000000};
> -
> - return (Overlay.Bytes[0]); /* Returns 0xFF (TRUE) for big endian */
> -}
> -
>
> /*******************************************************************************
> *
> @@ -249,6 +219,7 @@ Usage (
> ACPI_OPTION ("-lm", "Create hardware summary map file (*.map)");
> ACPI_OPTION ("-ln", "Create namespace file (*.nsp)");
> ACPI_OPTION ("-ls", "Create combined source file (expanded includes) (*.src)");
> + ACPI_OPTION ("-lx", "Create cross-reference file (*.xrf)");
>
> printf ("\nData Table Compiler:\n");
> ACPI_OPTION ("-G", "Compile custom table that contains generic operators");
> @@ -375,6 +346,12 @@ AslInitialize (
>
> AcpiGbl_DmOpt_Verbose = FALSE;
>
> + /* Default integer width is 64 bits */
> +
> + AcpiGbl_IntegerBitWidth = 64;
> + AcpiGbl_IntegerNybbleWidth = 16;
> + AcpiGbl_IntegerByteWidth = 8;
> +
> for (i = 0; i < ASL_NUM_FILES; i++)
> {
> Gbl_Files[i].Handle = NULL;
> @@ -418,7 +395,7 @@ main (
> * be little-endian, and support for big-endian machines needs to
> * be implemented.
> */
> - if (AcpiIsBigEndianMachine ())
> + if (UtIsBigEndianMachine ())
> {
> fprintf (stderr,
> "iASL is not currently supported on big-endian machines.\n");
> diff --git a/src/acpica/source/compiler/aslmap.c b/src/acpica/source/compiler/aslmap.c
> index 4502a32..b664593 100644
> --- a/src/acpica/source/compiler/aslmap.c
> +++ b/src/acpica/source/compiler/aslmap.c
> @@ -386,22 +386,22 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
> /* NOT */ OP_TABLE_ENTRY (AML_BIT_NOT_OP, 0, 0, ACPI_BTYPE_INTEGER),
> /* NOTIFY */ OP_TABLE_ENTRY (AML_NOTIFY_OP, 0, 0, 0),
> /* OBJECTTYPE */ OP_TABLE_ENTRY (AML_OBJECT_TYPE_OP, 0, 0, ACPI_BTYPE_INTEGER),
> -/* OBJECTTYPE_BFF */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_BUFFER_FIELD, 0, 0),
> -/* OBJECTTYPE_BUF */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_BUFFER, 0, 0),
> -/* OBJECTTYPE_DDB */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_DDB_HANDLE, 0, 0),
> -/* OBJECTTYPE_DEV */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_DEVICE, 0, 0),
> -/* OBJECTTYPE_EVT */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_EVENT, 0, 0),
> -/* OBJECTTYPE_FLD */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_FIELD_UNIT, 0, 0),
> -/* OBJECTTYPE_INT */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_INTEGER, 0, 0),
> -/* OBJECTTYPE_MTH */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_METHOD, 0, 0),
> -/* OBJECTTYPE_MTX */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_MUTEX, 0, 0),
> -/* OBJECTTYPE_OPR */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_REGION, 0, 0),
> -/* OBJECTTYPE_PKG */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_PACKAGE, 0, 0),
> -/* OBJECTTYPE_POW */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_POWER, 0, 0),
> -/* OBJECTTYPE_PRO */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_PROCESSOR, 0, 0),
> -/* OBJECTTYPE_STR */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_STRING, 0, 0),
> -/* OBJECTTYPE_THZ */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_THERMAL, 0, 0),
> -/* OBJECTTYPE_UNK */ OP_TABLE_ENTRY (AML_BYTE_OP, ACPI_TYPE_ANY, 0, 0),
> +/* OBJECTTYPE_BFF */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_BUFFER_FIELD, 0, 0),
> +/* OBJECTTYPE_BUF */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_BUFFER, 0, 0),
> +/* OBJECTTYPE_DDB */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_DDB_HANDLE, 0, 0),
> +/* OBJECTTYPE_DEV */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_DEVICE, 0, 0),
> +/* OBJECTTYPE_EVT */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_EVENT, 0, 0),
> +/* OBJECTTYPE_FLD */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_FIELD_UNIT, 0, 0),
> +/* OBJECTTYPE_INT */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_INTEGER, 0, 0),
> +/* OBJECTTYPE_MTH */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_METHOD, 0, 0),
> +/* OBJECTTYPE_MTX */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_MUTEX, 0, 0),
> +/* OBJECTTYPE_OPR */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_REGION, 0, 0),
> +/* OBJECTTYPE_PKG */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_PACKAGE, 0, 0),
> +/* OBJECTTYPE_POW */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_POWER, 0, 0),
> +/* OBJECTTYPE_PRO */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_PROCESSOR, 0, 0),
> +/* OBJECTTYPE_STR */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_STRING, 0, 0),
> +/* OBJECTTYPE_THZ */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_THERMAL, 0, 0),
> +/* OBJECTTYPE_UNK */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_TYPE_ANY, 0, 0),
> /* OFFSET */ OP_TABLE_ENTRY (AML_INT_RESERVEDFIELD_OP, 0, 0, 0),
> /* ONE */ OP_TABLE_ENTRY (AML_ONE_OP, 0, 0, ACPI_BTYPE_INTEGER),
> /* ONES */ OP_TABLE_ENTRY (AML_ONES_OP, 0, 0, ACPI_BTYPE_INTEGER),
> diff --git a/src/acpica/source/compiler/aslmapoutput.c b/src/acpica/source/compiler/aslmapoutput.c
> index d83711e..6a65cfe 100644
> --- a/src/acpica/source/compiler/aslmapoutput.c
> +++ b/src/acpica/source/compiler/aslmapoutput.c
> @@ -605,7 +605,7 @@ MpXrefDevices (
>
> /* Walk the entire parse tree */
>
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> MpNamespaceXrefBegin, NULL, Info);
>
> if (!Info->References)
> diff --git a/src/acpica/source/compiler/aslmethod.c b/src/acpica/source/compiler/aslmethod.c
> index 1e7de0c..6dce884 100644
> --- a/src/acpica/source/compiler/aslmethod.c
> +++ b/src/acpica/source/compiler/aslmethod.c
> @@ -125,7 +125,7 @@
>
> /* Local prototypes */
>
> -void
> +static void
> MtCheckNamedObjectInMethod (
> ACPI_PARSE_OBJECT *Op,
> ASL_METHOD_INFO *MethodInfo);
> @@ -165,6 +165,13 @@ MtMethodAnalysisWalkBegin (
> UINT8 ActualArgs = 0;
>
>
> + /* Build cross-reference output file if requested */
> +
> + if (Gbl_CrossReferenceOutput)
> + {
> + OtXrefWalkPart1 (Op, Level, MethodInfo);
> + }
> +
> switch (Op->Asl.ParseOpcode)
> {
> case PARSEOP_METHOD:
> @@ -565,7 +572,7 @@ MtMethodAnalysisWalkBegin (
> *
> ******************************************************************************/
>
> -void
> +static void
> MtCheckNamedObjectInMethod (
> ACPI_PARSE_OBJECT *Op,
> ASL_METHOD_INFO *MethodInfo)
> diff --git a/src/acpica/source/compiler/aslopcodes.c b/src/acpica/source/compiler/aslopcodes.c
> index 230b695..bc49954 100644
> --- a/src/acpica/source/compiler/aslopcodes.c
> +++ b/src/acpica/source/compiler/aslopcodes.c
> @@ -1585,12 +1585,6 @@ OpcGenerateAmlOpcode (
> Gbl_HasIncludeFiles = TRUE;
> break;
>
> - case PARSEOP_EXTERNAL:
> -
> - Op->Asl.Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
> - Op->Asl.Child->Asl.Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
> - break;
> -
> case PARSEOP_TIMER:
>
> if (AcpiGbl_IntegerBitWidth == 32)
> diff --git a/src/acpica/source/compiler/asloperands.c b/src/acpica/source/compiler/asloperands.c
> index 27d088b..2e2f2d1 100644
> --- a/src/acpica/source/compiler/asloperands.c
> +++ b/src/acpica/source/compiler/asloperands.c
> @@ -1121,15 +1121,12 @@ OpnAttachNameToNode (
> ACPI_PARSE_OBJECT *Child = NULL;
>
>
> - if (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)
> - {
> - Child = UtGetArg (Op, 0);
> - }
> - else switch (Op->Asl.AmlOpcode)
> + switch (Op->Asl.AmlOpcode)
> {
> case AML_DATA_REGION_OP:
> case AML_DEVICE_OP:
> case AML_EVENT_OP:
> + case AML_EXTERNAL_OP:
> case AML_METHOD_OP:
> case AML_MUTEX_OP:
> case AML_REGION_OP:
> @@ -1260,9 +1257,6 @@ OpnGenerateAmlOperands (
> case PARSEOP_NAMESTRING:
> case PARSEOP_METHODCALL:
> case PARSEOP_STRING_LITERAL:
> -
> - break;
> -
> default:
>
> break;
> diff --git a/src/acpica/source/compiler/aslprune.c b/src/acpica/source/compiler/aslprune.c
> index e51ff1b..b044a3d 100644
> --- a/src/acpica/source/compiler/aslprune.c
> +++ b/src/acpica/source/compiler/aslprune.c
> @@ -194,7 +194,7 @@ AslPruneParseTree (
>
> AcpiOsPrintf ("\nRemoving Objects:\n");
>
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> PrTreePruneWalk, NULL, ACPI_CAST_PTR (void, &PruneObj));
>
> AcpiOsPrintf ("\n%u Total Objects Removed\n", PruneObj.Count);
> diff --git a/src/acpica/source/compiler/aslrestype2s.c b/src/acpica/source/compiler/aslrestype2s.c
> index 79f677e..64f2cb7 100644
> --- a/src/acpica/source/compiler/aslrestype2s.c
> +++ b/src/acpica/source/compiler/aslrestype2s.c
> @@ -410,13 +410,6 @@ RsDoGpioIntDescriptor (
> Descriptor->Gpio.ResSourceOffset = (UINT16)
> ACPI_PTR_DIFF (ResourceSource, Descriptor);
>
> - DbgPrint (ASL_DEBUG_OUTPUT,
> - "%16s - Actual: %.2X, Base: %.2X, ResLen: "
> - "%.2X, VendLen: %.2X, IntLen: %.2X\n",
> - "GpioInt", Descriptor->Gpio.ResourceLength,
> - (UINT16) sizeof (AML_RESOURCE_GPIO),
> - ResSourceLength, VendorLength, InterruptLength);
> -
> /* Process all child initialization nodes */
>
> for (i = 0; InitializerOp; i++)
> @@ -626,13 +619,6 @@ RsDoGpioIoDescriptor (
> Descriptor->Gpio.ResSourceOffset = (UINT16)
> ACPI_PTR_DIFF (ResourceSource, Descriptor);
>
> - DbgPrint (ASL_DEBUG_OUTPUT,
> - "%16s - Actual: %.2X, Base: %.2X, ResLen: "
> - "%.2X, VendLen: %.2X, IntLen: %.2X\n",
> - "GpioIo", Descriptor->Gpio.ResourceLength,
> - (UINT16) sizeof (AML_RESOURCE_GPIO),
> - ResSourceLength, VendorLength, InterruptLength);
> -
> /* Process all child initialization nodes */
>
> for (i = 0; InitializerOp; i++)
> @@ -825,13 +811,6 @@ RsDoI2cSerialBusDescriptor (
> VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_I2C_SERIALBUS));
> ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
>
> - DbgPrint (ASL_DEBUG_OUTPUT,
> - "%16s - Actual: %.2X, Base: %.2X, ResLen: "
> - "%.2X, VendLen: %.2X, TypLen: %.2X\n",
> - "I2cSerialBus", Descriptor->I2cSerialBus.ResourceLength,
> - (UINT16) sizeof (AML_RESOURCE_I2C_SERIALBUS), ResSourceLength,
> - VendorLength, Descriptor->I2cSerialBus.TypeDataLength);
> -
> /* Process all child initialization nodes */
>
> for (i = 0; InitializerOp; i++)
> @@ -976,13 +955,6 @@ RsDoSpiSerialBusDescriptor (
> sizeof (AML_RESOURCE_SPI_SERIALBUS));
> ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
>
> - DbgPrint (ASL_DEBUG_OUTPUT,
> - "%16s - Actual: %.2X, Base: %.2X, ResLen: "
> - "%.2X, VendLen: %.2X, TypLen: %.2X\n",
> - "SpiSerialBus", Descriptor->SpiSerialBus.ResourceLength,
> - (UINT16) sizeof (AML_RESOURCE_SPI_SERIALBUS), ResSourceLength,
> - VendorLength, Descriptor->SpiSerialBus.TypeDataLength);
> -
> /* Process all child initialization nodes */
>
> for (i = 0; InitializerOp; i++)
> @@ -1154,13 +1126,6 @@ RsDoUartSerialBusDescriptor (
> VendorData = ACPI_ADD_PTR (UINT8, Descriptor, sizeof (AML_RESOURCE_UART_SERIALBUS));
> ResourceSource = ACPI_ADD_PTR (char, VendorData, VendorLength);
>
> - DbgPrint (ASL_DEBUG_OUTPUT,
> - "%16s - Actual: %.2X, Base: %.2X, ResLen: "
> - "%.2X, VendLen: %.2X, TypLen: %.2X\n",
> - "UartSerialBus", Descriptor->UartSerialBus.ResourceLength,
> - (UINT16) sizeof (AML_RESOURCE_UART_SERIALBUS), ResSourceLength,
> - VendorLength, Descriptor->UartSerialBus.TypeDataLength);
> -
> /* Process all child initialization nodes */
>
> for (i = 0; InitializerOp; i++)
> diff --git a/src/acpica/source/compiler/aslrules.y b/src/acpica/source/compiler/aslrules.y
> index f349448..d360573 100644
> --- a/src/acpica/source/compiler/aslrules.y
> +++ b/src/acpica/source/compiler/aslrules.y
> @@ -541,7 +541,6 @@ ObjectTypeName
> | RefOfTerm {}
> | DerefOfTerm {}
> | IndexTerm {}
> -
> /* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */
> ;
>
> diff --git a/src/acpica/source/compiler/aslstubs.c b/src/acpica/source/compiler/aslstubs.c
> index d255e90..055392b 100644
> --- a/src/acpica/source/compiler/aslstubs.c
> +++ b/src/acpica/source/compiler/aslstubs.c
> @@ -192,6 +192,13 @@ AcpiDsStoreObjectToLocal (
> }
>
> ACPI_STATUS
> +AcpiEvInstallRegionHandlers (
> + void)
> +{
> + return (AE_OK);
> +}
> +
> +ACPI_STATUS
> AcpiEvQueueNotifyRequest (
> ACPI_NAMESPACE_NODE *Node,
> UINT32 NotifyValue)
> diff --git a/src/acpica/source/compiler/asltransform.c b/src/acpica/source/compiler/asltransform.c
> index 8ff773e..530076d 100644
> --- a/src/acpica/source/compiler/asltransform.c
> +++ b/src/acpica/source/compiler/asltransform.c
> @@ -321,7 +321,7 @@ TrAmlInsertPeer (
>
> /*******************************************************************************
> *
> - * FUNCTION: TrAmlTransformWalk
> + * FUNCTION: TrAmlTransformWalkBegin
> *
> * PARAMETERS: ASL_WALK_CALLBACK
> *
> @@ -333,7 +333,7 @@ TrAmlInsertPeer (
> ******************************************************************************/
>
> ACPI_STATUS
> -TrAmlTransformWalk (
> +TrAmlTransformWalkBegin (
> ACPI_PARSE_OBJECT *Op,
> UINT32 Level,
> void *Context)
> @@ -346,6 +346,38 @@ TrAmlTransformWalk (
>
> /*******************************************************************************
> *
> + * FUNCTION: TrAmlTransformWalkEnd
> + *
> + * PARAMETERS: ASL_WALK_CALLBACK
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Parse tree walk to generate both the AML opcodes and the AML
> + * operands.
> + *
> + ******************************************************************************/
> +
> +ACPI_STATUS
> +TrAmlTransformWalkEnd (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context)
> +{
> +
> + /* Save possible Externals list in the DefintionBlock Op */
> +
> + if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK)
> + {
> + Op->Asl.Value.Arg = Gbl_ExternalsListHead;
> + Gbl_ExternalsListHead = NULL;
> + }
> +
> + return (AE_OK);
> +}
> +
> +
> +/*******************************************************************************
> + *
> * FUNCTION: TrTransformSubtree
> *
> * PARAMETERS: Op - The parent parse node
> @@ -388,6 +420,11 @@ TrTransformSubtree (
> Gbl_TempCount = 0;
> break;
>
> + case PARSEOP_EXTERNAL:
> +
> + ExDoExternal (Op);
> + break;
> +
> default:
>
> /* Nothing to do here for other opcodes */
> @@ -419,6 +456,10 @@ TrDoDefinitionBlock (
> UINT32 i;
>
>
> + /* Reset external list when starting a definition block */
> +
> + Gbl_ExternalsListHead = NULL;
> +
> Next = Op->Asl.Child;
> for (i = 0; i < 5; i++)
> {
> diff --git a/src/acpica/source/compiler/asltree.c b/src/acpica/source/compiler/asltree.c
> index e58aedf..a898584 100644
> --- a/src/acpica/source/compiler/asltree.c
> +++ b/src/acpica/source/compiler/asltree.c
> @@ -1054,7 +1054,7 @@ TrCreateNode (
> {
> case PARSEOP_ASL_CODE:
>
> - RootNode = Op;
> + Gbl_ParseTreeRoot = Op;
> Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
> DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->");
> break;
> @@ -1183,7 +1183,7 @@ TrLinkChildren (
> {
> case PARSEOP_ASL_CODE:
>
> - RootNode = Op;
> + Gbl_ParseTreeRoot = Op;
> Op->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
> DbgPrint (ASL_PARSE_OUTPUT, "ASLCODE (Tree Completed)->");
> break;
> @@ -1489,7 +1489,7 @@ TrWalkParseTree (
> ACPI_STATUS Status;
>
>
> - if (!RootNode)
> + if (!Gbl_ParseTreeRoot)
> {
> return (AE_OK);
> }
> diff --git a/src/acpica/source/compiler/asltypes.h b/src/acpica/source/compiler/asltypes.h
> index 83d365e..95f33fd 100644
> --- a/src/acpica/source/compiler/asltypes.h
> +++ b/src/acpica/source/compiler/asltypes.h
> @@ -153,6 +153,7 @@
> typedef struct asl_method_info
> {
> ACPI_PARSE_OBJECT *Op;
> + ACPI_PARSE_OBJECT *CurrentOp;
> struct asl_method_info *Next;
> UINT32 ValidArgTypes[ACPI_METHOD_NUM_ARGS];
> UINT32 ValidReturnTypes;
> @@ -243,12 +244,13 @@ typedef enum
> ASL_FILE_ASM_INCLUDE_OUTPUT,/* .inc */
> ASL_FILE_C_INCLUDE_OUTPUT, /* .h */
> ASL_FILE_C_OFFSET_OUTPUT, /* .offset.h */
> - ASL_FILE_MAP_OUTPUT /* .map */
> + ASL_FILE_MAP_OUTPUT, /* .map */
> + ASL_FILE_XREF_OUTPUT /* .xrf */
>
> } ASL_FILE_TYPES;
>
>
> -#define ASL_MAX_FILE_TYPE 16
> +#define ASL_MAX_FILE_TYPE 17
> #define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1)
>
> /* Name suffixes used to create filenames for output files */
> @@ -268,6 +270,7 @@ typedef enum
> #define FILE_SUFFIX_C_INCLUDE "h"
> #define FILE_SUFFIX_C_OFFSET "offset.h"
> #define FILE_SUFFIX_MAP "map"
> +#define FILE_SUFFIX_XREF "xrf"
>
>
> /* Cache block structure for ParseOps and Strings */
> @@ -388,4 +391,21 @@ typedef struct asl_method_local
> #define ASL_ARG_INITIALIZED (1<<3)
> #define ASL_ARG_REFERENCED (1<<4)
>
> +/* Info used to track method counts for cross reference output file */
> +
> +typedef struct asl_xref_info
> +{
> + UINT32 ThisMethodInvocations;
> + UINT32 TotalPredefinedMethods;
> + UINT32 TotalUserMethods;
> + UINT32 TotalUnreferenceUserMethods;
> + UINT32 ThisObjectReferences;
> + UINT32 TotalObjects;
> + UINT32 TotalUnreferencedObjects;
> + ACPI_PARSE_OBJECT *MethodOp;
> + ACPI_PARSE_OBJECT *CurrentMethodOp;
> +
> +} ASL_XREF_INFO;
> +
> +
> #endif /* __ASLTYPES_H */
> diff --git a/src/acpica/source/compiler/aslutils.c b/src/acpica/source/compiler/aslutils.c
> index 28fb415..2a45f6e 100644
> --- a/src/acpica/source/compiler/aslutils.c
> +++ b/src/acpica/source/compiler/aslutils.c
> @@ -139,6 +139,33 @@ UtAttachNameseg (
> char *Name);
>
>
> +/*******************************************************************************
> + *
> + * FUNCTION: UtIsBigEndianMachine
> + *
> + * PARAMETERS: None
> + *
> + * RETURN: TRUE if machine is big endian
> + * FALSE if machine is little endian
> + *
> + * DESCRIPTION: Detect whether machine is little endian or big endian.
> + *
> + ******************************************************************************/
> +
> +UINT8
> +UtIsBigEndianMachine (
> + void)
> +{
> + union {
> + UINT32 Integer;
> + UINT8 Bytes[4];
> + } Overlay = {0xFF000000};
> +
> +
> + return (Overlay.Bytes[0]); /* Returns 0xFF (TRUE) for big endian */
> +}
> +
> +
> /******************************************************************************
> *
> * FUNCTION: UtQueryForOverwrite
> @@ -341,63 +368,6 @@ UtEndEvent (
>
> /*******************************************************************************
> *
> - * FUNCTION: UtConvertByteToHex
> - *
> - * PARAMETERS: RawByte - Binary data
> - * Buffer - Pointer to where the hex bytes will be
> - * stored
> - *
> - * RETURN: Ascii hex byte is stored in Buffer.
> - *
> - * DESCRIPTION: Perform hex-to-ascii translation. The return data is prefixed
> - * with "0x"
> - *
> - ******************************************************************************/
> -
> -void
> -UtConvertByteToHex (
> - UINT8 RawByte,
> - UINT8 *Buffer)
> -{
> -
> - Buffer[0] = '0';
> - Buffer[1] = 'x';
> -
> - Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
> - Buffer[3] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
> -}
> -
> -
> -/*******************************************************************************
> - *
> - * FUNCTION: UtConvertByteToAsmHex
> - *
> - * PARAMETERS: RawByte - Binary data
> - * Buffer - Pointer to where the hex bytes will be
> - * stored
> - *
> - * RETURN: Ascii hex byte is stored in Buffer.
> - *
> - * DESCRIPTION: Perform hex-to-ascii translation. The return data is prefixed
> - * with '0', and a trailing 'h' is added.
> - *
> - ******************************************************************************/
> -
> -void
> -UtConvertByteToAsmHex (
> - UINT8 RawByte,
> - UINT8 *Buffer)
> -{
> -
> - Buffer[0] = '0';
> - Buffer[1] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
> - Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
> - Buffer[3] = 'h';
> -}
> -
> -
> -/*******************************************************************************
> - *
> * FUNCTION: DbgPrint
> *
> * PARAMETERS: Type - Type of output
> @@ -440,43 +410,6 @@ DbgPrint (
>
> /*******************************************************************************
> *
> - * FUNCTION: UtPrintFormattedName
> - *
> - * PARAMETERS: ParseOpcode - Parser keyword ID
> - * Level - Indentation level
> - *
> - * RETURN: None
> - *
> - * DESCRIPTION: Print the ascii name of the parse opcode.
> - *
> - ******************************************************************************/
> -
> -#define TEXT_OFFSET 10
> -
> -void
> -UtPrintFormattedName (
> - UINT16 ParseOpcode,
> - UINT32 Level)
> -{
> -
> - if (Level)
> - {
> - DbgPrint (ASL_TREE_OUTPUT,
> - "%*s", (3 * Level), " ");
> - }
> - DbgPrint (ASL_TREE_OUTPUT,
> - " %-20.20s", UtGetOpName (ParseOpcode));
> -
> - if (Level < TEXT_OFFSET)
> - {
> - DbgPrint (ASL_TREE_OUTPUT,
> - "%*s", (TEXT_OFFSET - Level) * 3, " ");
> - }
> -}
> -
> -
> -/*******************************************************************************
> - *
> * FUNCTION: UtSetParseOpName
> *
> * PARAMETERS: Op - Parse op to be named.
> @@ -1045,7 +978,7 @@ UtDoConstant (
> char ErrBuf[64];
>
>
> - Status = stroul64 (String, 0, &Converted);
> + Status = AcpiUtStrtoul64 (String, 0, &Converted);
> if (ACPI_FAILURE (Status))
> {
> sprintf (ErrBuf, "%s %s\n", "Conversion error:",
> @@ -1057,198 +990,62 @@ UtDoConstant (
> }
>
>
> -/* TBD: use version in ACPICA main code base? */
> +#ifdef _OBSOLETE_FUNCTIONS
> +/* Removed 01/2016 */
>
> /*******************************************************************************
> *
> - * FUNCTION: stroul64
> + * FUNCTION: UtConvertByteToHex
> *
> - * PARAMETERS: String - Null terminated string
> - * Terminater - Where a pointer to the terminating byte
> - * is returned
> - * Base - Radix of the string
> + * PARAMETERS: RawByte - Binary data
> + * Buffer - Pointer to where the hex bytes will be
> + * stored
> *
> - * RETURN: Converted value
> + * RETURN: Ascii hex byte is stored in Buffer.
> *
> - * DESCRIPTION: Convert a string into an unsigned value.
> + * DESCRIPTION: Perform hex-to-ascii translation. The return data is prefixed
> + * with "0x"
> *
> ******************************************************************************/
>
> -ACPI_STATUS
> -stroul64 (
> - char *String,
> - UINT32 Base,
> - UINT64 *RetInteger)
> +void
> +UtConvertByteToHex (
> + UINT8 RawByte,
> + UINT8 *Buffer)
> {
> - UINT32 Index;
> - UINT32 Sign;
> - UINT64 ReturnValue = 0;
> - ACPI_STATUS Status = AE_OK;
> -
> -
> - *RetInteger = 0;
> -
> - switch (Base)
> - {
> - case 0:
> - case 8:
> - case 10:
> - case 16:
> -
> - break;
> -
> - default:
> - /*
> - * The specified Base parameter is not in the domain of
> - * this function:
> - */
> - return (AE_BAD_PARAMETER);
> - }
> -
> - /* Skip over any white space in the buffer: */
> -
> - while (isspace ((int) *String) || *String == '\t')
> - {
> - ++String;
> - }
> -
> - /*
> - * The buffer may contain an optional plus or minus sign.
> - * If it does, then skip over it but remember what is was:
> - */
> - if (*String == '-')
> - {
> - Sign = ACPI_SIGN_NEGATIVE;
> - ++String;
> - }
> - else if (*String == '+')
> - {
> - ++String;
> - Sign = ACPI_SIGN_POSITIVE;
> - }
> - else
> - {
> - Sign = ACPI_SIGN_POSITIVE;
> - }
> -
> - /*
> - * If the input parameter Base is zero, then we need to
> - * determine if it is octal, decimal, or hexadecimal:
> - */
> - if (Base == 0)
> - {
> - if (*String == '0')
> - {
> - if (tolower ((int) *(++String)) == 'x')
> - {
> - Base = 16;
> - ++String;
> - }
> - else
> - {
> - Base = 8;
> - }
> - }
> - else
> - {
> - Base = 10;
> - }
> - }
> -
> - /*
> - * For octal and hexadecimal bases, skip over the leading
> - * 0 or 0x, if they are present.
> - */
> - if (Base == 8 && *String == '0')
> - {
> - String++;
> - }
> -
> - if (Base == 16 &&
> - *String == '0' &&
> - tolower ((int) *(++String)) == 'x')
> - {
> - String++;
> - }
> -
> - /* Main loop: convert the string to an unsigned long */
> -
> - while (*String)
> - {
> - if (isdigit ((int) *String))
> - {
> - Index = ((UINT8) *String) - '0';
> - }
> - else
> - {
> - Index = (UINT8) toupper ((int) *String);
> - if (isupper ((int) Index))
> - {
> - Index = Index - 'A' + 10;
> - }
> - else
> - {
> - goto ErrorExit;
> - }
> - }
> -
> - if (Index >= Base)
> - {
> - goto ErrorExit;
> - }
> -
> - /* Check to see if value is out of range: */
> -
> - if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) /
> - (UINT64) Base))
> - {
> - goto ErrorExit;
> - }
> - else
> - {
> - ReturnValue *= Base;
> - ReturnValue += Index;
> - }
> -
> - ++String;
> - }
> -
> -
> - /* If a minus sign was present, then "the conversion is negated": */
> -
> - if (Sign == ACPI_SIGN_NEGATIVE)
> - {
> - ReturnValue = (ACPI_UINT32_MAX - ReturnValue) + 1;
> - }
> -
> - *RetInteger = ReturnValue;
> - return (Status);
> -
> -
> -ErrorExit:
> - switch (Base)
> - {
> - case 8:
>
> - Status = AE_BAD_OCTAL_CONSTANT;
> - break;
> -
> - case 10:
> -
> - Status = AE_BAD_DECIMAL_CONSTANT;
> - break;
> -
> - case 16:
> + Buffer[0] = '0';
> + Buffer[1] = 'x';
>
> - Status = AE_BAD_HEX_CONSTANT;
> - break;
> + Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
> + Buffer[3] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
> +}
>
> - default:
>
> - /* Base validated above */
> +/*******************************************************************************
> + *
> + * FUNCTION: UtConvertByteToAsmHex
> + *
> + * PARAMETERS: RawByte - Binary data
> + * Buffer - Pointer to where the hex bytes will be
> + * stored
> + *
> + * RETURN: Ascii hex byte is stored in Buffer.
> + *
> + * DESCRIPTION: Perform hex-to-ascii translation. The return data is prefixed
> + * with '0', and a trailing 'h' is added.
> + *
> + ******************************************************************************/
>
> - break;
> - }
> +void
> +UtConvertByteToAsmHex (
> + UINT8 RawByte,
> + UINT8 *Buffer)
> +{
>
> - return (Status);
> + Buffer[0] = '0';
> + Buffer[1] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
> + Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
> + Buffer[3] = 'h';
> }
> +#endif /* OBSOLETE_FUNCTIONS */
> diff --git a/src/acpica/source/compiler/aslwalks.c b/src/acpica/source/compiler/aslwalks.c
> index 5b9f79f..1eb7d45 100644
> --- a/src/acpica/source/compiler/aslwalks.c
> +++ b/src/acpica/source/compiler/aslwalks.c
> @@ -931,10 +931,21 @@ AnAnalyzeStoreOperator (
> case PARSEOP_DEREFOF:
> case PARSEOP_REFOF:
> case PARSEOP_INDEX:
> - case PARSEOP_METHODCALL:
>
> return;
>
> + case PARSEOP_METHODCALL:
> + /*
> + * A target is not allowed to be a method call.
> + * It is not supported by the ACPICA interpreter, nor is it
> + * supported by the MS ASL compiler or the MS interpreter.
> + * Although legal syntax up until ACPI 6.1, support for this
> + * will be removed for ACPI 6.2 (02/2016)
> + */
> + AslError (ASL_ERROR, ASL_MSG_SYNTAX,
> + TargetOperandOp, "Illegal method invocation as a target operand");
> + return;
> +
> default:
> break;
> }
> diff --git a/src/acpica/source/compiler/aslxref.c b/src/acpica/source/compiler/aslxref.c
> index b83bea7..a3eab4a 100644
> --- a/src/acpica/source/compiler/aslxref.c
> +++ b/src/acpica/source/compiler/aslxref.c
> @@ -205,8 +205,6 @@ XfCrossReferenceNamespace (
> ACPI_WALK_STATE *WalkState;
>
>
> - DbgPrint (ASL_DEBUG_OUTPUT, "\nCross referencing namespace\n\n");
> -
> /*
> * Create a new walk state for use when looking up names
> * within the namespace (Passed as context to the callbacks)
> @@ -219,8 +217,8 @@ XfCrossReferenceNamespace (
>
> /* Walk the entire parse tree */
>
> - TrWalkParseTree (RootNode, ASL_WALK_VISIT_TWICE, XfNamespaceLocateBegin,
> - XfNamespaceLocateEnd, WalkState);
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
> + XfNamespaceLocateBegin, XfNamespaceLocateEnd, WalkState);
>
> ACPI_FREE (WalkState);
> return (AE_OK);
> @@ -952,7 +950,8 @@ XfNamespaceLocateBegin (
> NextOp = NextOp->Asl.Next;
> }
>
> - if (Node->Value != ASL_EXTERNAL_METHOD)
> + if (Node->Value != ASL_EXTERNAL_METHOD &&
> + Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_EXTERNAL)
> {
> /*
> * Check the parsed arguments with the number expected by the
> diff --git a/src/acpica/source/compiler/aslxrefout.c b/src/acpica/source/compiler/aslxrefout.c
> new file mode 100644
> index 0000000..6fe872d
> --- /dev/null
> +++ b/src/acpica/source/compiler/aslxrefout.c
> @@ -0,0 +1,882 @@
> +/******************************************************************************
> + *
> + * Module Name: aslxrefout.c - support for optional cross-reference file
> + *
> + *****************************************************************************/
> +
> +/******************************************************************************
> + *
> + * 1. Copyright Notice
> + *
> + * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
> + * All rights reserved.
> + *
> + * 2. License
> + *
> + * 2.1. This is your license from Intel Corp. under its intellectual property
> + * rights. You may have additional license terms from the party that provided
> + * you this software, covering your right to use that party's intellectual
> + * property rights.
> + *
> + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
> + * copy of the source code appearing in this file ("Covered Code") an
> + * irrevocable, perpetual, worldwide license under Intel's copyrights in the
> + * base code distributed originally by Intel ("Original Intel Code") to copy,
> + * make derivatives, distribute, use and display any portion of the Covered
> + * Code in any form, with the right to sublicense such rights; and
> + *
> + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
> + * license (with the right to sublicense), under only those claims of Intel
> + * patents that are infringed by the Original Intel Code, to make, use, sell,
> + * offer to sell, and import the Covered Code and derivative works thereof
> + * solely to the minimum extent necessary to exercise the above copyright
> + * license, and in no event shall the patent license extend to any additions
> + * to or modifications of the Original Intel Code. No other license or right
> + * is granted directly or by implication, estoppel or otherwise;
> + *
> + * The above copyright and patent license is granted only if the following
> + * conditions are met:
> + *
> + * 3. Conditions
> + *
> + * 3.1. Redistribution of Source with Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification with rights to further distribute source must include
> + * the above Copyright Notice, the above License, this list of Conditions,
> + * and the following Disclaimer and Export Compliance provision. In addition,
> + * Licensee must cause all Covered Code to which Licensee contributes to
> + * contain a file documenting the changes Licensee made to create that Covered
> + * Code and the date of any change. Licensee must include in that file the
> + * documentation of any changes made by any predecessor Licensee. Licensee
> + * must include a prominent statement that the modification is derived,
> + * directly or indirectly, from Original Intel Code.
> + *
> + * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
> + * Redistribution of source code of any substantial portion of the Covered
> + * Code or modification without rights to further distribute source must
> + * include the following Disclaimer and Export Compliance provision in the
> + * documentation and/or other materials provided with distribution. In
> + * addition, Licensee may not authorize further sublicense of source of any
> + * portion of the Covered Code, and must include terms to the effect that the
> + * license from Licensee to its licensee is limited to the intellectual
> + * property embodied in the software Licensee provides to its licensee, and
> + * not to intellectual property embodied in modifications its licensee may
> + * make.
> + *
> + * 3.3. Redistribution of Executable. Redistribution in executable form of any
> + * substantial portion of the Covered Code or modification must reproduce the
> + * above Copyright Notice, and the following Disclaimer and Export Compliance
> + * provision in the documentation and/or other materials provided with the
> + * distribution.
> + *
> + * 3.4. Intel retains all right, title, and interest in and to the Original
> + * Intel Code.
> + *
> + * 3.5. Neither the name Intel nor any other trademark owned or controlled by
> + * Intel shall be used in advertising or otherwise to promote the sale, use or
> + * other dealings in products derived from or relating to the Covered Code
> + * without prior written authorization from Intel.
> + *
> + * 4. Disclaimer and Export Compliance
> + *
> + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
> + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
> + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
> + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
> + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
> + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
> + * PARTICULAR PURPOSE.
> + *
> + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
> + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
> + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
> + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
> + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
> + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
> + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
> + * LIMITED REMEDY.
> + *
> + * 4.3. Licensee shall not export, either directly or indirectly, any of this
> + * software or system incorporating such software without first obtaining any
> + * required license or other approval from the U. S. Department of Commerce or
> + * any other agency or department of the United States Government. In the
> + * event Licensee exports any such software from the United States or
> + * re-exports any such software from a foreign destination, Licensee shall
> + * ensure that the distribution and export/re-export of the software is in
> + * compliance with all laws, regulations, orders, or other restrictions of the
> + * U.S. Export Administration Regulations. Licensee agrees that neither it nor
> + * any of its subsidiaries will export/re-export any technical data, process,
> + * software, or service, directly or indirectly, to any country for which the
> + * United States government or any agency thereof requires an export license,
> + * other governmental approval, or letter of assurance, without first obtaining
> + * such license, approval or letter.
> + *
> + *****************************************************************************/
> +
> +#include "aslcompiler.h"
> +#include "aslcompiler.y.h"
> +#include "acnamesp.h"
> +#include "acparser.h"
> +#include "amlcode.h"
> +
> +#define _COMPONENT ACPI_COMPILER
> + ACPI_MODULE_NAME ("aslxrefout")
> +
> +
> +/* Local prototypes */
> +
> +static ACPI_STATUS
> +OtXrefWalkPart2 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context);
> +
> +static ACPI_STATUS
> +OtXrefWalkPart3 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context);
> +
> +static ACPI_STATUS
> +OtXrefAnalysisWalkPart1 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context);
> +
> +
> +static ACPI_STATUS
> +OtXrefAnalysisWalkPart2 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context);
> +
> +static ACPI_STATUS
> +OtXrefAnalysisWalkPart3 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context);
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OtPrintHeaders
> + *
> + * PARAMETERS: Message - Main header message
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Emits the main header message along with field descriptions
> + *
> + ******************************************************************************/
> +
> +void
> +OtPrintHeaders (
> + char *Message)
> +{
> + UINT32 Length;
> +
> +
> + Length = strlen (Message);
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, "\n\n%s\n", Message);
> + while (Length)
> + {
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, "-");
> + Length--;
> + }
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, "\n\nLineno %-40s Description\n",
> + "Full Pathname");
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OtCreateXrefFile
> + *
> + * PARAMETERS: None
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION Main entry point for parts 2 and 3 of the cross-reference
> + * file.
> + *
> + ******************************************************************************/
> +
> +void
> +OtCreateXrefFile (
> + void)
> +{
> + ASL_XREF_INFO XrefInfo;
> +
> +
> + /* Build cross-reference output file if requested */
> +
> + if (!Gbl_CrossReferenceOutput)
> + {
> + return;
> + }
> +
> + memset (&XrefInfo, 0, sizeof (ASL_XREF_INFO));
> +
> + /* Cross-reference output file, part 2 (Method invocations) */
> +
> + OtPrintHeaders ("Part 2: Method Reference Map "
> + "(Invocations of each user-defined control method)");
> +
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> + OtXrefWalkPart2, NULL, &XrefInfo);
> +
> + /* Cross-reference output file, part 3 (All other object refs) */
> +
> + OtPrintHeaders ("Part 3: Full Object Reference Map "
> + "(Methods that reference each object in namespace");
> +
> + TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> + OtXrefWalkPart3, NULL, &XrefInfo);
> +
> + /* Cross-reference summary */
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, "\n\nObject Summary\n");
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + "\nTotal methods: %u\n",
> + XrefInfo.TotalPredefinedMethods + XrefInfo.TotalUserMethods);
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + "Total predefined methods: %u\n",
> + XrefInfo.TotalPredefinedMethods);
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + "\nTotal user methods: %u\n",
> + XrefInfo.TotalUserMethods);
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + "Total unreferenced user methods %u\n",
> + XrefInfo.TotalUnreferenceUserMethods);
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + "\nTotal defined objects: %u\n",
> + XrefInfo.TotalObjects);
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + "Total unreferenced objects: %u\n",
> + XrefInfo.TotalUnreferencedObjects);
> +}
> +
> +
> +/*
> + * Part 1 of the cross reference file. This part emits the namespace objects
> + * that are referenced by each control method in the namespace.
> + *
> + * Part 2 and 3 are below part 1.
> + */
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OtXrefWalkPart1
> + *
> + * PARAMETERS: Op - Current parse Op
> + * Level - Current tree nesting level
> + * MethodInfo - Info block for the current method
> + *
> + *
> + * RETURN: None
> + *
> + * DESCRIPTION: Entry point for the creation of the method call reference map.
> + * For each control method in the namespace, all other methods
> + * that invoke the method are listed. Predefined names/methods
> + * that start with an underscore are ignored, because these are
> + * essentially external/public interfaces.
> +
> + * DESCRIPTION: Entry point for the creation of the object reference map.
> + * For each control method in the namespace, all objects that
> + * are referenced by the method are listed.
> + *
> + * Called during a normal namespace walk, once per namespace
> + * object. (MtMethodAnalysisWalkBegin)
> + *
> + ******************************************************************************/
> +
> +void
> +OtXrefWalkPart1 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + ASL_METHOD_INFO *MethodInfo)
> +{
> + ACPI_NAMESPACE_NODE *Node;
> + ACPI_PARSE_OBJECT *NextOp;
> + ACPI_PARSE_OBJECT *FieldOp;
> + char *ParentPath;
> + UINT32 Length;
> + ACPI_STATUS Status;
> +
> +
> + switch (Op->Asl.ParseOpcode)
> + {
> + case PARSEOP_NAMESEG:
> + case PARSEOP_NAMESTRING:
> + case PARSEOP_METHODCALL:
> +
> + if (!MethodInfo ||
> + (MethodInfo->Op->Asl.Child == Op) ||
> + !Op->Asl.Node)
> + {
> + break;
> + }
> +
> + MethodInfo->CurrentOp = Op;
> + Node = Op->Asl.Node;
> + ParentPath = AcpiNsGetNormalizedPathname (Node, TRUE);
> +
> + /* Find all objects referenced by this method */
> +
> + Status = TrWalkParseTree (MethodInfo->Op, ASL_WALK_VISIT_DOWNWARD,
> + OtXrefAnalysisWalkPart1, NULL, MethodInfo);
> +
> + if (Status == AE_CTRL_TERMINATE)
> + {
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, " %-40s %s",
> + ParentPath, AcpiUtGetTypeName (Node->Type));
> +
> + switch (Node->Type)
> + {
> + /* Handle externals */
> +
> + case ACPI_TYPE_ANY:
> + case ACPI_TYPE_FIELD_UNIT:
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, " <External Object>");
> + break;
> +
> + case ACPI_TYPE_INTEGER:
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, " %8.8X%8.8X",
> + ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
> + break;
> +
> + case ACPI_TYPE_METHOD:
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, " Invocation (%u args)",
> + Node->ArgCount);
> + break;
> +
> + case ACPI_TYPE_BUFFER_FIELD:
> +
> + NextOp = Node->Op; /* Create Buffer Field Op */
> + switch (NextOp->Asl.ParseOpcode)
> + {
> + case PARSEOP_CREATEBITFIELD:
> + Length = 1;
> + break;
> +
> + case PARSEOP_CREATEBYTEFIELD:
> + Length = 8;
> + break;
> +
> + case PARSEOP_CREATEWORDFIELD:
> + Length = 16;
> + break;
> +
> + case PARSEOP_CREATEDWORDFIELD:
> + Length = 32;
> + break;
> +
> + case PARSEOP_CREATEQWORDFIELD:
> + Length = 64;
> + break;
> +
> + default:
> + Length = 0;
> + break;
> + }
> +
> + NextOp = NextOp->Asl.Child; /* Buffer name */
> +
> + if (!NextOp->Asl.ExternalName)
> + {
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, " in Arg/Local");
> + }
> + else
> + {
> + ACPI_FREE (ParentPath);
> + ParentPath = AcpiNsGetNormalizedPathname (
> + NextOp->Asl.Node, TRUE);
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, " (%.2u bit) in Buffer %s",
> + Length, ParentPath);
> + }
> + break;
> +
> + case ACPI_TYPE_LOCAL_REGION_FIELD:
> +
> + NextOp = Node->Op;
> + FieldOp = NextOp->Asl.Parent;
> + NextOp = FieldOp->Asl.Child;
> +
> + ACPI_FREE (ParentPath);
> + ParentPath = AcpiNsGetNormalizedPathname (
> + NextOp->Asl.Node, TRUE);
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, " (%.2u bit) in Region %s",
> + (UINT32) Node->Op->Asl.Child->Asl.Value.Integer,
> + ParentPath);
> +
> + if (FieldOp->Asl.ParseOpcode == PARSEOP_FIELD)
> + {
> + Node = NextOp->Asl.Node; /* Region node */
> + NextOp = Node->Op; /* PARSEOP_REGION */
> + NextOp = NextOp->Asl.Child; /* Region name */
> + NextOp = NextOp->Asl.Next;
> +
> + /* Get region space/addr/len? */
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, " (%s)",
> + AcpiUtGetRegionName ((UINT8)
> + NextOp->Asl.Value.Integer));
> + }
> + break;
> +
> + default:
> + break;
> + }
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT, "\n");
> + ACPI_FREE (ParentPath);
> + }
> + break;
> +
> + case PARSEOP_METHOD:
> +
> + ParentPath = AcpiNsGetNormalizedPathname (Op->Asl.Node, TRUE);
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + "\n[%5u] %-40s %s Declaration (%u args)\n",
> + Op->Asl.LogicalLineNumber, ParentPath,
> + AcpiUtGetTypeName (Op->Asl.Node->Type), Op->Asl.Node->ArgCount);
> +
> + ACPI_FREE (ParentPath);
> + break;
> +
> + default:
> + break;
> + }
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OtXrefAnalysisWalkPart1
> + *
> + * PARAMETERS: ASL_WALK_CALLBACK
> + *
> + * RETURN: Status
> + *
> + * DESCRIPTION: Secondary walk for cross-reference part 1.
> + *
> + ******************************************************************************/
> +
> +static ACPI_STATUS
> +OtXrefAnalysisWalkPart1 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context)
> +{
> + ASL_METHOD_INFO *MethodInfo = (ASL_METHOD_INFO *) Context;
> + ACPI_PARSE_OBJECT *Next;
> +
> +
> + /* Only interested in name string Ops -- ignore all others */
> +
> + if ((Op->Asl.ParseOpcode != PARSEOP_NAMESEG) &&
> + (Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) &&
> + (Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
> + {
> + return (AE_OK);
> + }
> +
> + /* No node means a locally declared object -- ignore */
> +
> + if (!Op->Asl.Node)
> + {
> + return (AE_OK);
> + }
> +
> + /* When we encounter the source Op, we are done */
> +
> + Next = MethodInfo->CurrentOp;
> + if (Next == Op)
> + {
> + return (AE_CTRL_TERMINATE);
> + }
> +
> + /* If we have a name match, this Op is a duplicate */
> +
> + if ((Next->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
> + (Next->Asl.ParseOpcode == PARSEOP_NAMESTRING) ||
> + (Next->Asl.ParseOpcode == PARSEOP_METHODCALL))
> + {
> + if (!strcmp (Op->Asl.ExternalName, Next->Asl.ExternalName))
> + {
> + return (AE_ALREADY_EXISTS);
> + }
> + }
> +
> + return (AE_OK);
> +}
> +
> +
> +/*
> + * Part 2 of the cross reference file. This part emits the names of each
> + * non-predefined method in the namespace (user methods), along with the
> + * names of each control method that references that method.
> + */
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OtXrefWalkPart2
> + *
> + * PARAMETERS: ASL_WALK_CALLBACK
> + *
> + * RETURN: Status
> + *
> + * DESCRIPTION: For each control method in the namespace, we will re-walk the
> + * namespace to find each and every invocation of that control
> + * method. Brute force, but does not matter, even for large
> + * namespaces. Ignore predefined names (start with underscore).
> + *
> + ******************************************************************************/
> +
> +static ACPI_STATUS
> +OtXrefWalkPart2 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context)
> +{
> + ASL_XREF_INFO *XrefInfo = (ASL_XREF_INFO *) Context;
> + ACPI_NAMESPACE_NODE *Node;
> + char *ParentPath;
> +
> +
> + /* Looking for Method Declaration Ops only */
> +
> + if (!Op->Asl.Node ||
> + (Op->Asl.ParseOpcode != PARSEOP_METHOD))
> + {
> + return (AE_OK);
> + }
> +
> + /* Ignore predefined names */
> +
> + if (Op->Asl.Node->Name.Ascii[0] == '_')
> + {
> + XrefInfo->TotalPredefinedMethods++;
> + return (AE_OK);
> + }
> +
> + Node = Op->Asl.Node;
> + ParentPath = AcpiNsGetNormalizedPathname (Node, TRUE);
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + "\n[%5u] %-40s %s Declaration (%u args)\n",
> + Op->Asl.LogicalLineNumber, ParentPath,
> + AcpiUtGetTypeName (Node->Type), Node->ArgCount);
> +
> + XrefInfo->TotalUserMethods++;
> + XrefInfo->ThisMethodInvocations = 0;
> + XrefInfo->MethodOp = Op;
> +
> + (void) TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> + OtXrefAnalysisWalkPart2, NULL, XrefInfo);
> +
> + if (!XrefInfo->ThisMethodInvocations)
> + {
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + " Zero invocations of this method in this module\n");
> + XrefInfo->TotalUnreferenceUserMethods++;
> + }
> + else
> + {
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + " %u invocations of method %s in this module\n",
> + XrefInfo->ThisMethodInvocations, ParentPath);
> + }
> +
> + ACPI_FREE (ParentPath);
> + return (AE_OK);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OtXrefAnalysisWalkPart2
> + *
> + * PARAMETERS: ASL_WALK_CALLBACK
> + *
> + * RETURN: Status
> + *
> + * DESCRIPTION: For every Op that is a method invocation, emit a reference
> + * line if the Op is invoking the target method.
> + *
> + ******************************************************************************/
> +
> +static ACPI_STATUS
> +OtXrefAnalysisWalkPart2 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context)
> +{
> + ASL_XREF_INFO *XrefInfo = (ASL_XREF_INFO *) Context;
> + ACPI_PARSE_OBJECT *CallerOp;
> + char *CallerFullPathname;
> +
> +
> + /* Looking for MethodCall Ops only */
> +
> + if (!Op->Asl.Node ||
> + (Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
> + {
> + return (AE_OK);
> + }
> +
> + /* If not a match to the target method, we are done */
> +
> + if (Op->Asl.Node != XrefInfo->MethodOp->Asl.Node)
> + {
> + return (AE_CTRL_DEPTH);
> + }
> +
> + /* Find parent method to get method caller namepath */
> +
> + CallerOp = Op->Asl.Parent;
> + while (CallerOp &&
> + (CallerOp->Asl.ParseOpcode != PARSEOP_METHOD))
> + {
> + CallerOp = CallerOp->Asl.Parent;
> + }
> +
> + /* There is no parent method for External() statements */
> +
> + if (!CallerOp)
> + {
> + return (AE_OK);
> + }
> +
> + CallerFullPathname = AcpiNsGetNormalizedPathname (
> + CallerOp->Asl.Node, TRUE);
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + "[%5u] %-40s Invocation path: %s\n",
> + Op->Asl.LogicalLineNumber, CallerFullPathname,
> + Op->Asl.ExternalName);
> +
> + ACPI_FREE (CallerFullPathname);
> + XrefInfo->ThisMethodInvocations++;
> + return (AE_OK);
> +}
> +
> +
> +/*
> + * Part 3 of the cross reference file. This part emits the names of each
> + * non-predefined method in the namespace (user methods), along with the
> + * names of each control method that references that method.
> + */
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OtXrefWalkPart3
> + *
> + * PARAMETERS: ASL_WALK_CALLBACK
> + *
> + * RETURN: Status
> + *
> + * DESCRIPTION: Cross-reference part 3. references to objects other than
> + * control methods.
> + *
> + ******************************************************************************/
> +
> +static ACPI_STATUS
> +OtXrefWalkPart3 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context)
> +{
> + ASL_XREF_INFO *XrefInfo = (ASL_XREF_INFO *) Context;
> + ACPI_NAMESPACE_NODE *Node;
> + char *ParentPath;
> + const ACPI_OPCODE_INFO *OpInfo;
> +
> +
> + /* Ignore method declarations */
> +
> + if (!Op->Asl.Node ||
> + (Op->Asl.ParseOpcode == PARSEOP_METHOD))
> + {
> + return (AE_OK);
> + }
> +
> + OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
> + if (!(OpInfo->Class & AML_CLASS_NAMED_OBJECT))
> + {
> + return (AE_OK);
> + }
> +
> + /* Only care about named object creation opcodes */
> +
> + if ((Op->Asl.ParseOpcode != PARSEOP_NAME) &&
> + (Op->Asl.ParseOpcode != PARSEOP_DEVICE) &&
> + (Op->Asl.ParseOpcode != PARSEOP_MUTEX) &&
> + (Op->Asl.ParseOpcode != PARSEOP_OPERATIONREGION) &&
> + (Op->Asl.ParseOpcode != PARSEOP_FIELD) &&
> + (Op->Asl.ParseOpcode != PARSEOP_EVENT))
> + {
> + return (AE_OK);
> + }
> +
> + /* Ignore predefined names */
> +
> + if (Op->Asl.Node->Name.Ascii[0] == '_')
> + {
> + return (AE_OK);
> + }
> +
> + Node = Op->Asl.Node;
> + ParentPath = AcpiNsGetNormalizedPathname (Node, TRUE);
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + "\n[%5u] %-40s %s Declaration\n",
> + Op->Asl.LogicalLineNumber, ParentPath,
> + AcpiUtGetTypeName (Node->Type));
> +
> + XrefInfo->MethodOp = Op;
> + XrefInfo->ThisObjectReferences = 0;
> + XrefInfo->TotalObjects = 0;
> +
> + (void) TrWalkParseTree (Gbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
> + OtXrefAnalysisWalkPart3, NULL, XrefInfo);
> +
> + if (!XrefInfo->ThisObjectReferences)
> + {
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + " Zero references to this object in this module\n");
> + XrefInfo->TotalUnreferencedObjects++;
> + }
> + else
> + {
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + " %u references to this object in this module\n",
> + XrefInfo->ThisObjectReferences, ParentPath);
> + }
> +
> + return (AE_OK);
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION: OtXrefAnalysisWalkPart3
> + *
> + * PARAMETERS: ASL_WALK_CALLBACK
> + *
> + * RETURN: Status
> + *
> + * DESCRIPTION: Secondary walk for cross-reference part 3.
> + *
> + ******************************************************************************/
> +
> +static ACPI_STATUS
> +OtXrefAnalysisWalkPart3 (
> + ACPI_PARSE_OBJECT *Op,
> + UINT32 Level,
> + void *Context)
> +{
> + ASL_XREF_INFO *XrefInfo = (ASL_XREF_INFO *) Context;
> + char *CallerFullPathname;
> + ACPI_PARSE_OBJECT *CallerOp;
> + const char *Operator;
> +
> +
> + if (!Op->Asl.Node)
> + {
> + return (AE_OK);
> + }
> +
> + XrefInfo->TotalObjects++;
> +
> + /* Ignore Op that actually defined the object */
> +
> + if (Op == XrefInfo->MethodOp)
> + {
> + return (AE_OK);
> + }
> +
> + /* Only interested in Ops that reference the target node */
> +
> + if (Op->Asl.Node != XrefInfo->MethodOp->Asl.Node)
> + {
> + return (AE_OK);
> + }
> +
> + /* Find parent "open scope" object to get method caller namepath */
> +
> + CallerOp = Op->Asl.Parent;
> + while (CallerOp &&
> + (CallerOp->Asl.ParseOpcode != PARSEOP_NAME) &&
> + (CallerOp->Asl.ParseOpcode != PARSEOP_METHOD) &&
> + (CallerOp->Asl.ParseOpcode != PARSEOP_DEVICE) &&
> + (CallerOp->Asl.ParseOpcode != PARSEOP_POWERRESOURCE) &&
> + (CallerOp->Asl.ParseOpcode != PARSEOP_PROCESSOR) &&
> + (CallerOp->Asl.ParseOpcode != PARSEOP_THERMALZONE))
> + {
> + CallerOp = CallerOp->Asl.Parent;
> + }
> +
> + /* There are some special cases for the oddball operators */
> +
> + if (CallerOp)
> + {
> + CallerFullPathname = AcpiNsGetNormalizedPathname (
> + CallerOp->Asl.Node, TRUE);
> + }
> + else
> + {
> + CallerFullPathname = "<root>";
> + }
> +
> + if (CallerOp == XrefInfo->CurrentMethodOp)
> + {
> + return (AE_OK);
> + }
> +
> + if (Op->Asl.ParseOpcode == PARSEOP_SCOPE)
> + {
> + Operator = "Scope";
> +
> + }
> + else if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_ALIAS)
> + {
> + Operator = "Alias";
> + }
> + else if (!CallerOp)
> + {
> + Operator = "ModLevel";
> + }
> + else
> + {
> + Operator = AcpiUtGetTypeName (CallerOp->Asl.Node->Type);
> + }
> +
> + FlPrintFile (ASL_FILE_XREF_OUTPUT,
> + "[%5u] %-40s %-8s via path: %s, Operator: %s\n",
> + Op->Asl.LogicalLineNumber,
> + CallerFullPathname,
> + Operator,
> + Op->Asl.ExternalName,
> + Op->Asl.Parent->Asl.ParseOpName);
> +
> + if (!CallerOp)
> + {
> + CallerOp = ACPI_TO_POINTER (0xFFFFFFFF);
> + }
> +
> + XrefInfo->CurrentMethodOp = CallerOp;
> + XrefInfo->ThisObjectReferences++;
> + return (AE_OK);
> +}
> diff --git a/src/acpica/source/compiler/dtparser.y b/src/acpica/source/compiler/dtparser.y
> index 0706197..d66936e 100644
> --- a/src/acpica/source/compiler/dtparser.y
> +++ b/src/acpica/source/compiler/dtparser.y
> @@ -241,15 +241,15 @@ Expression
>
> /* Default base for a non-prefixed integer is 16 */
>
> - | EXPOP_NUMBER { stroul64 (DtParsertext, 16, &$$);}
> + | EXPOP_NUMBER { AcpiUtStrtoul64 (DtParsertext, 16, &$$);}
>
> /* Standard hex number (0x1234) */
>
> - | EXPOP_HEX_NUMBER { stroul64 (DtParsertext, 16, &$$);}
> + | EXPOP_HEX_NUMBER { AcpiUtStrtoul64 (DtParsertext, 16, &$$);}
>
> - /* TBD: Decimal number with prefix (0d1234) - Not supported by stroul64 at this time */
> + /* TBD: Decimal number with prefix (0d1234) - Not supported by strtoul64 at this time */
>
> - | EXPOP_DECIMAL_NUMBER { stroul64 (DtParsertext, 10, &$$);}
> + | EXPOP_DECIMAL_NUMBER { AcpiUtStrtoul64 (DtParsertext, 10, &$$);}
> ;
> %%
>
> diff --git a/src/acpica/source/compiler/prparser.y b/src/acpica/source/compiler/prparser.y
> index 39cb8b7..b69a3a4 100644
> --- a/src/acpica/source/compiler/prparser.y
> +++ b/src/acpica/source/compiler/prparser.y
> @@ -254,11 +254,11 @@ Expression
>
> /* Default base for a non-prefixed integer is 10 */
>
> - | EXPOP_NUMBER { stroul64 (PrParsertext, 10, &$$);}
> + | EXPOP_NUMBER { AcpiUtStrtoul64 (PrParsertext, 10, &$$);}
>
> /* Standard hex number (0x1234) */
>
> - | EXPOP_HEX_NUMBER { stroul64 (PrParsertext, 16, &$$);}
> + | EXPOP_HEX_NUMBER { AcpiUtStrtoul64 (PrParsertext, 16, &$$);}
> ;
> %%
>
> diff --git a/src/acpica/source/compiler/prscan.c b/src/acpica/source/compiler/prscan.c
> index e30e33d..3fab524 100644
> --- a/src/acpica/source/compiler/prscan.c
> +++ b/src/acpica/source/compiler/prscan.c
> @@ -406,8 +406,7 @@ PrPreprocessInputFile (
> Gbl_CurrentLineNumber++;
> Gbl_LogicalLineNumber++;
>
> - if ((Status == ASL_WITHIN_COMMENT) ||
> - (Status == ASL_BLANK_LINE))
> + if (Status == ASL_IGNORE_LINE)
> {
> goto WriteEntireLine;
> }
> @@ -942,7 +941,8 @@ SyntaxError:
> *
> * RETURN: Status of the GetLine operation:
> * AE_OK - Normal line, OK status
> - * ASL_WITHIN_COMMENT - Line is part of a multi-line comment
> + * ASL_IGNORE_LINE - Line is blank or part of a multi-line
> + * comment
> * ASL_EOF - End-of-file reached
> *
> * DESCRIPTION: Get the next text line from the input file. Does not strip
> @@ -1058,7 +1058,7 @@ PrGetNextLine (
>
> if (AcpiGbl_LineScanState == PR_MULTI_LINE_COMMENT)
> {
> - return (ASL_WITHIN_COMMENT);
> + return (ASL_IGNORE_LINE);
> }
>
> /* End of single-line comment */
> @@ -1073,7 +1073,7 @@ PrGetNextLine (
>
> if (i == 1)
> {
> - return (ASL_BLANK_LINE);
> + return (ASL_IGNORE_LINE);
> }
>
> return (AE_OK);
> diff --git a/src/acpica/source/components/debugger/dbcmds.c b/src/acpica/source/components/debugger/dbcmds.c
> index 8668120..52a9e90 100644
> --- a/src/acpica/source/components/debugger/dbcmds.c
> +++ b/src/acpica/source/components/debugger/dbcmds.c
> @@ -477,7 +477,7 @@ AcpiDbDisplayTableInfo (
> {
> /* If the pointer is null, the table has been unloaded */
>
> - ACPI_INFO ((AE_INFO, "%4.4s - Table has been unloaded",
> + ACPI_INFO (("%4.4s - Table has been unloaded",
> TableDesc->Signature.Ascii));
> }
> }
> diff --git a/src/acpica/source/components/debugger/dbconvert.c b/src/acpica/source/components/debugger/dbconvert.c
> index 302d2e6..968a2d7 100644
> --- a/src/acpica/source/components/debugger/dbconvert.c
> +++ b/src/acpica/source/components/debugger/dbconvert.c
> @@ -537,7 +537,7 @@ AcpiDbDumpPldBuffer (
> NewBuffer = AcpiDbEncodePldBuffer (PldInfo);
> if (!NewBuffer)
> {
> - return;
> + goto Exit;
> }
>
> /* The two bit-packed buffers should match */
> @@ -596,6 +596,7 @@ AcpiDbDumpPldBuffer (
> AcpiOsPrintf (ACPI_PLD_OUTPUT, "PLD_HorizontalOffset", PldInfo->HorizontalOffset);
> }
>
> - ACPI_FREE (PldInfo);
> ACPI_FREE (NewBuffer);
> +Exit:
> + ACPI_FREE (PldInfo);
> }
> diff --git a/src/acpica/source/components/disassembler/dmopcode.c b/src/acpica/source/components/disassembler/dmopcode.c
> index 5ea815c..45b9f7d 100644
> --- a/src/acpica/source/components/disassembler/dmopcode.c
> +++ b/src/acpica/source/components/disassembler/dmopcode.c
> @@ -1041,6 +1041,10 @@ AcpiDmDisassembleOneOp (
> AcpiDmConvertToElseIf (Op);
> break;
>
> + case AML_EXTERNAL_OP:
> +
> + break;
> +
> default:
>
> /* Just get the opcode name and print it */
> diff --git a/src/acpica/source/components/disassembler/dmwalk.c b/src/acpica/source/components/disassembler/dmwalk.c
> index bf6ef2e..11c78f1 100644
> --- a/src/acpica/source/components/disassembler/dmwalk.c
> +++ b/src/acpica/source/components/disassembler/dmwalk.c
> @@ -482,6 +482,7 @@ AcpiDmDescendingOp (
> const ACPI_OPCODE_INFO *OpInfo;
> UINT32 Name;
> ACPI_PARSE_OBJECT *NextOp;
> + ACPI_PARSE_OBJECT *NextOp2;
> UINT32 AmlOffset;
>
>
> @@ -508,8 +509,7 @@ AcpiDmDescendingOp (
> AcpiUtDumpBuffer (
> (Info->StartAml + Info->AmlOffset),
> (Op->Common.Aml - Info->PreviousAml),
> - DB_BYTE_DISPLAY,
> - Info->AmlOffset);
> + DB_BYTE_DISPLAY, Info->AmlOffset);
> AcpiOsPrintf ("\n");
> }
>
> @@ -527,6 +527,33 @@ AcpiDmDescendingOp (
> return (AE_CTRL_DEPTH);
> }
>
> + if (Op->Common.AmlOpcode == AML_IF_OP)
> + {
> + NextOp = AcpiPsGetDepthNext (NULL, Op);
> + if (NextOp)
> + {
> + NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST;
> + }
> +
> + /*
> + * A Zero predicate indicates the possibility of one or more
> + * External() opcodes within the If() block.
> + */
> + if (NextOp->Common.AmlOpcode == AML_ZERO_OP)
> + {
> + NextOp2 = NextOp->Common.Next;
> +
> + if (NextOp2 &&
> + (NextOp2->Common.AmlOpcode == AML_EXTERNAL_OP))
> + {
> + /* Ignore the If 0 block and all children */
> +
> + Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
> + return (AE_CTRL_DEPTH);
> + }
> + }
> + }
> +
> /* Level 0 is at the Definition Block level */
>
> if (Level == 0)
> @@ -860,8 +887,8 @@ AcpiDmDescendingOp (
> NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMLIST;
> return (AE_OK);
>
> - case AML_VAR_PACKAGE_OP:
> case AML_IF_OP:
> + case AML_VAR_PACKAGE_OP:
> case AML_WHILE_OP:
>
> /* The next op is the size or predicate parameter */
> diff --git a/src/acpica/source/components/dispatcher/dsmethod.c b/src/acpica/source/components/dispatcher/dsmethod.c
> index 393b1d0..a861838 100644
> --- a/src/acpica/source/components/dispatcher/dsmethod.c
> +++ b/src/acpica/source/components/dispatcher/dsmethod.c
> @@ -939,7 +939,7 @@ AcpiDsTerminateControlMethod (
> {
> if (WalkState)
> {
> - ACPI_INFO ((AE_INFO,
> + ACPI_INFO ((
> "Marking method %4.4s as Serialized "
> "because of AE_ALREADY_EXISTS error",
> WalkState->MethodNode->Name.Ascii));
> diff --git a/src/acpica/source/components/dispatcher/dsobject.c b/src/acpica/source/components/dispatcher/dsobject.c
> index 8dac6c9..47e527e 100644
> --- a/src/acpica/source/components/dispatcher/dsobject.c
> +++ b/src/acpica/source/components/dispatcher/dsobject.c
> @@ -610,7 +610,7 @@ AcpiDsBuildInternalPackageObj (
> Arg = Arg->Common.Next;
> }
>
> - ACPI_INFO ((AE_INFO,
> + ACPI_INFO ((
> "Actual Package length (%u) is larger than "
> "NumElements field (%u), truncated",
> i, ElementCount));
> diff --git a/src/acpica/source/components/events/evgpeblk.c b/src/acpica/source/components/events/evgpeblk.c
> index 392ba37..dac8b71 100644
> --- a/src/acpica/source/components/events/evgpeblk.c
> +++ b/src/acpica/source/components/events/evgpeblk.c
> @@ -614,7 +614,7 @@ AcpiEvInitializeGpeBlock (
>
> if (GpeEnabledCount)
> {
> - ACPI_INFO ((AE_INFO,
> + ACPI_INFO ((
> "Enabled %u GPEs in block %02X to %02X", GpeEnabledCount,
> (UINT32) GpeBlock->BlockBaseNumber,
> (UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1))));
> diff --git a/src/acpica/source/components/events/evgpeinit.c b/src/acpica/source/components/events/evgpeinit.c
> index 5bb554b..2ad4785 100644
> --- a/src/acpica/source/components/events/evgpeinit.c
> +++ b/src/acpica/source/components/events/evgpeinit.c
> @@ -364,7 +364,7 @@ AcpiEvUpdateGpes (
>
> if (WalkInfo.Count)
> {
> - ACPI_INFO ((AE_INFO, "Enabled %u new GPEs", WalkInfo.Count));
> + ACPI_INFO (("Enabled %u new GPEs", WalkInfo.Count));
> }
>
> (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
> diff --git a/src/acpica/source/components/events/evregion.c b/src/acpica/source/components/events/evregion.c
> index ed32b17..9e1aa1c 100644
> --- a/src/acpica/source/components/events/evregion.c
> +++ b/src/acpica/source/components/events/evregion.c
> @@ -171,7 +171,6 @@ AcpiEvInitializeOpRegions (
>
> /* Run the _REG methods for OpRegions in each default address space */
>
> - AcpiGbl_RegMethodsEnabled = TRUE;
> for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++)
> {
> /*
> @@ -709,7 +708,7 @@ AcpiEvExecuteRegMethod (
>
> if (RegionObj2->Extra.Method_REG == NULL ||
> RegionObj->Region.Handler == NULL ||
> - !AcpiGbl_RegMethodsEnabled)
> + !AcpiGbl_NamespaceInitialized)
> {
> return_ACPI_STATUS (AE_OK);
> }
> diff --git a/src/acpica/source/components/executer/exconfig.c b/src/acpica/source/components/executer/exconfig.c
> index bff70d0..eea6e2a 100644
> --- a/src/acpica/source/components/executer/exconfig.c
> +++ b/src/acpica/source/components/executer/exconfig.c
> @@ -349,7 +349,7 @@ AcpiExLoadTableOp (
> Status = AcpiGetTableByIndex (TableIndex, &Table);
> if (ACPI_SUCCESS (Status))
> {
> - ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:"));
> + ACPI_INFO (("Dynamic OEM Table Load:"));
> AcpiTbPrintTableHeader (0, Table);
> }
>
> @@ -589,7 +589,7 @@ AcpiExLoadOp (
>
> /* Install the new table into the local data structures */
>
> - ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:"));
> + ACPI_INFO (("Dynamic OEM Table Load:"));
> (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
>
> Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
> diff --git a/src/acpica/source/components/executer/exoparg3.c b/src/acpica/source/components/executer/exoparg3.c
> index 4d979c5..d450190 100644
> --- a/src/acpica/source/components/executer/exoparg3.c
> +++ b/src/acpica/source/components/executer/exoparg3.c
> @@ -207,8 +207,10 @@ AcpiExOpcode_3A_0T_0R (
> * op is intended for use by disassemblers in order to properly
> * disassemble control method invocations. The opcode or group of
> * opcodes should be surrounded by an "if (0)" clause to ensure that
> - * AML interpreters never see the opcode.
> + * AML interpreters never see the opcode. Thus, something is
> + * wrong if an external opcode ever gets here.
> */
> + ACPI_ERROR ((AE_INFO, "Executed External Op"));
> Status = AE_OK;
> goto Cleanup;
>
> diff --git a/src/acpica/source/components/hardware/hwxfsleep.c b/src/acpica/source/components/hardware/hwxfsleep.c
> index 47ffeae..5959351 100644
> --- a/src/acpica/source/components/hardware/hwxfsleep.c
> +++ b/src/acpica/source/components/hardware/hwxfsleep.c
> @@ -169,7 +169,7 @@ static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
> * PhysicalAddress - 32-bit physical address of ACPI real mode
> * entry point
> * PhysicalAddress64 - 64-bit physical address of ACPI protected
> - * entry point
> + * mode entry point
> *
> * RETURN: Status
> *
> @@ -225,7 +225,7 @@ AcpiHwSetFirmwareWakingVector (
> * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
> * entry point
> * PhysicalAddress64 - 64-bit physical address of ACPI protected
> - * entry point
> + * mode entry point
> *
> * RETURN: Status
> *
> diff --git a/src/acpica/source/components/namespace/nseval.c b/src/acpica/source/components/namespace/nseval.c
> index a5cc2f6..895d621 100644
> --- a/src/acpica/source/components/namespace/nseval.c
> +++ b/src/acpica/source/components/namespace/nseval.c
> @@ -469,7 +469,7 @@ AcpiNsExecModuleCodeList (
> AcpiUtRemoveReference (Prev);
> }
>
> - ACPI_INFO ((AE_INFO,
> + ACPI_INFO ((
> "Executed %u blocks of module-level executable AML code",
> MethodCount));
>
> diff --git a/src/acpica/source/components/namespace/nsinit.c b/src/acpica/source/components/namespace/nsinit.c
> index 838f02a..c26dd03 100644
> --- a/src/acpica/source/components/namespace/nsinit.c
> +++ b/src/acpica/source/components/namespace/nsinit.c
> @@ -118,6 +118,7 @@
> #include "acnamesp.h"
> #include "acdispat.h"
> #include "acinterp.h"
> +#include "acevents.h"
>
> #define _COMPONENT ACPI_NAMESPACE
> ACPI_MODULE_NAME ("nsinit")
> @@ -223,84 +224,112 @@ AcpiNsInitializeObjects (
>
> ACPI_STATUS
> AcpiNsInitializeDevices (
> - void)
> + UINT32 Flags)
> {
> - ACPI_STATUS Status;
> + ACPI_STATUS Status = AE_OK;
> ACPI_DEVICE_WALK_INFO Info;
>
>
> ACPI_FUNCTION_TRACE (NsInitializeDevices);
>
>
> - /* Init counters */
> + if (!(Flags & ACPI_NO_DEVICE_INIT))
> + {
> + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
> + "[Init] Initializing ACPI Devices\n"));
>
> - Info.DeviceCount = 0;
> - Info.Num_STA = 0;
> - Info.Num_INI = 0;
> + /* Init counters */
>
> - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
> - "Initializing Device/Processor/Thermal objects "
> - "and executing _INI/_STA methods:\n"));
> + Info.DeviceCount = 0;
> + Info.Num_STA = 0;
> + Info.Num_INI = 0;
>
> - /* Tree analysis: find all subtrees that contain _INI methods */
> + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
> + "Initializing Device/Processor/Thermal objects "
> + "and executing _INI/_STA methods:\n"));
>
> - Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
> - ACPI_UINT32_MAX, FALSE, AcpiNsFindIniMethods, NULL, &Info, NULL);
> - if (ACPI_FAILURE (Status))
> - {
> - goto ErrorExit;
> - }
> + /* Tree analysis: find all subtrees that contain _INI methods */
>
> - /* Allocate the evaluation information block */
> + Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
> + ACPI_UINT32_MAX, FALSE, AcpiNsFindIniMethods, NULL, &Info, NULL);
> + if (ACPI_FAILURE (Status))
> + {
> + goto ErrorExit;
> + }
>
> - Info.EvaluateInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
> - if (!Info.EvaluateInfo)
> - {
> - Status = AE_NO_MEMORY;
> - goto ErrorExit;
> - }
> + /* Allocate the evaluation information block */
>
> - /*
> - * Execute the "global" _INI method that may appear at the root. This
> - * support is provided for Windows compatibility (Vista+) and is not
> - * part of the ACPI specification.
> - */
> - Info.EvaluateInfo->PrefixNode = AcpiGbl_RootNode;
> - Info.EvaluateInfo->RelativePathname = METHOD_NAME__INI;
> - Info.EvaluateInfo->Parameters = NULL;
> - Info.EvaluateInfo->Flags = ACPI_IGNORE_RETURN_VALUE;
> + Info.EvaluateInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
> + if (!Info.EvaluateInfo)
> + {
> + Status = AE_NO_MEMORY;
> + goto ErrorExit;
> + }
>
> - Status = AcpiNsEvaluate (Info.EvaluateInfo);
> - if (ACPI_SUCCESS (Status))
> - {
> - Info.Num_INI++;
> + /*
> + * Execute the "global" _INI method that may appear at the root.
> + * This support is provided for Windows compatibility (Vista+) and
> + * is not part of the ACPI specification.
> + */
> + Info.EvaluateInfo->PrefixNode = AcpiGbl_RootNode;
> + Info.EvaluateInfo->RelativePathname = METHOD_NAME__INI;
> + Info.EvaluateInfo->Parameters = NULL;
> + Info.EvaluateInfo->Flags = ACPI_IGNORE_RETURN_VALUE;
> +
> + Status = AcpiNsEvaluate (Info.EvaluateInfo);
> + if (ACPI_SUCCESS (Status))
> + {
> + Info.Num_INI++;
> + }
> }
>
> - /* Walk namespace to execute all _INIs on present devices */
> -
> - Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
> - ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, NULL, &Info, NULL);
> -
> /*
> - * Any _OSI requests should be completed by now. If the BIOS has
> - * requested any Windows OSI strings, we will always truncate
> - * I/O addresses to 16 bits -- for Windows compatibility.
> + * Run all _REG methods
> + *
> + * Note: Any objects accessed by the _REG methods will be automatically
> + * initialized, even if they contain executable AML (see the call to
> + * AcpiNsInitializeObjects below).
> */
> - if (AcpiGbl_OsiData >= ACPI_OSI_WIN_2000)
> + if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
> {
> - AcpiGbl_TruncateIoAddresses = TRUE;
> + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
> + "[Init] Executing _REG OpRegion methods\n"));
> +
> + Status = AcpiEvInitializeOpRegions ();
> + if (ACPI_FAILURE (Status))
> + {
> + goto ErrorExit;
> + }
> }
>
> - ACPI_FREE (Info.EvaluateInfo);
> - if (ACPI_FAILURE (Status))
> + if (!(Flags & ACPI_NO_DEVICE_INIT))
> {
> - goto ErrorExit;
> - }
> + /* Walk namespace to execute all _INIs on present devices */
>
> - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
> - " Executed %u _INI methods requiring %u _STA executions "
> - "(examined %u objects)\n",
> - Info.Num_INI, Info.Num_STA, Info.DeviceCount));
> + Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
> + ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, NULL, &Info, NULL);
> +
> + /*
> + * Any _OSI requests should be completed by now. If the BIOS has
> + * requested any Windows OSI strings, we will always truncate
> + * I/O addresses to 16 bits -- for Windows compatibility.
> + */
> + if (AcpiGbl_OsiData >= ACPI_OSI_WIN_2000)
> + {
> + AcpiGbl_TruncateIoAddresses = TRUE;
> + }
> +
> + ACPI_FREE (Info.EvaluateInfo);
> + if (ACPI_FAILURE (Status))
> + {
> + goto ErrorExit;
> + }
> +
> + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
> + " Executed %u _INI methods requiring %u _STA executions "
> + "(examined %u objects)\n",
> + Info.Num_INI, Info.Num_STA, Info.DeviceCount));
> + }
>
> return_ACPI_STATUS (Status);
>
> diff --git a/src/acpica/source/components/parser/psargs.c b/src/acpica/source/components/parser/psargs.c
> index c5a8b09..db2fdd8 100644
> --- a/src/acpica/source/components/parser/psargs.c
> +++ b/src/acpica/source/components/parser/psargs.c
> @@ -370,7 +370,7 @@ AcpiPsGetNextNamepath (
> PossibleMethodCall &&
> (Node->Type == ACPI_TYPE_METHOD))
> {
> - if (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) == ARGP_SUPERNAME)
> + if (WalkState->Opcode == AML_UNLOAD_OP)
> {
> /*
> * AcpiPsGetNextNamestring has increased the AML pointer,
> @@ -816,7 +816,7 @@ AcpiPsGetNextField (
> *
> * PARAMETERS: WalkState - Current state
> * ParserState - Current parser state object
> - * ArgType - The parser argument type (ARGP_*)
> + * ArgType - The argument type (AML_*_ARG)
> * ReturnArg - Where the next arg is returned
> *
> * RETURN: Status, and an op object containing the next argument.
> @@ -945,9 +945,9 @@ AcpiPsGetNextArg (
> return_ACPI_STATUS (AE_NO_MEMORY);
> }
>
> - /* SuperName allows argument to be a method call */
> + /* To support SuperName arg of Unload */
>
> - if (ArgType == ARGP_SUPERNAME)
> + if (WalkState->Opcode == AML_UNLOAD_OP)
> {
> Status = AcpiPsGetNextNamepath (WalkState, ParserState,
> Arg, ACPI_POSSIBLE_METHOD_CALL);
> diff --git a/src/acpica/source/components/tables/tbinstal.c b/src/acpica/source/components/tables/tbinstal.c
> index a0d834d..85fcedc 100644
> --- a/src/acpica/source/components/tables/tbinstal.c
> +++ b/src/acpica/source/components/tables/tbinstal.c
> @@ -364,7 +364,7 @@ AcpiTbInstallStandardTable (
> AcpiGbl_DisableSsdtTableInstall &&
> ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT))
> {
> - ACPI_INFO ((AE_INFO,
> + ACPI_INFO ((
> "Ignoring installation of %4.4s at %8.8X%8.8X",
> NewTableDesc.Signature.Ascii, ACPI_FORMAT_UINT64 (Address)));
> goto ReleaseAndExit;
> @@ -536,7 +536,7 @@ FinishOverride:
> return;
> }
>
> - ACPI_INFO ((AE_INFO, "%4.4s 0x%8.8X%8.8X"
> + ACPI_INFO (("%4.4s 0x%8.8X%8.8X"
> " %s table override, new table: 0x%8.8X%8.8X",
> OldTableDesc->Signature.Ascii,
> ACPI_FORMAT_UINT64 (OldTableDesc->Address),
> diff --git a/src/acpica/source/components/tables/tbprint.c b/src/acpica/source/components/tables/tbprint.c
> index 0bb0df0..a5a7980 100644
> --- a/src/acpica/source/components/tables/tbprint.c
> +++ b/src/acpica/source/components/tables/tbprint.c
> @@ -221,7 +221,7 @@ AcpiTbPrintTableHeader (
> {
> /* FACS only has signature and length fields */
>
> - ACPI_INFO ((AE_INFO, "%-4.4s 0x%8.8X%8.8X %06X",
> + ACPI_INFO (("%-4.4s 0x%8.8X%8.8X %06X",
> Header->Signature, ACPI_FORMAT_UINT64 (Address),
> Header->Length));
> }
> @@ -233,7 +233,7 @@ AcpiTbPrintTableHeader (
> Header)->OemId, ACPI_OEM_ID_SIZE);
> AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE);
>
> - ACPI_INFO ((AE_INFO, "RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
> + ACPI_INFO (("RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
> ACPI_FORMAT_UINT64 (Address),
> (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ?
> ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20,
> @@ -246,7 +246,7 @@ AcpiTbPrintTableHeader (
>
> AcpiTbCleanupTableHeader (&LocalHeader, Header);
>
> - ACPI_INFO ((AE_INFO,
> + ACPI_INFO ((
> "%-4.4s 0x%8.8X%8.8X"
> " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
> LocalHeader.Signature, ACPI_FORMAT_UINT64 (Address),
> diff --git a/src/acpica/source/components/tables/tbutils.c b/src/acpica/source/components/tables/tbutils.c
> index 13f020d..ba6d2f9 100644
> --- a/src/acpica/source/components/tables/tbutils.c
> +++ b/src/acpica/source/components/tables/tbutils.c
> @@ -257,7 +257,7 @@ AcpiTbCopyDsdt (
> ACPI_PTR_TO_PHYSADDR (NewTable),
> ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, NewTable);
>
> - ACPI_INFO ((AE_INFO,
> + ACPI_INFO ((
> "Forced DSDT copy: length 0x%05X copied locally, original unmapped",
> NewTable->Length));
>
> diff --git a/src/acpica/source/components/tables/tbxfload.c b/src/acpica/source/components/tables/tbxfload.c
> index bce2db5..9de6979 100644
> --- a/src/acpica/source/components/tables/tbxfload.c
> +++ b/src/acpica/source/components/tables/tbxfload.c
> @@ -119,6 +119,7 @@
> #include "accommon.h"
> #include "acnamesp.h"
> #include "actables.h"
> +#include "acevents.h"
>
> #define _COMPONENT ACPI_TABLES
> ACPI_MODULE_NAME ("tbxfload")
> @@ -146,6 +147,28 @@ AcpiLoadTables (
> ACPI_FUNCTION_TRACE (AcpiLoadTables);
>
>
> + /*
> + * Install the default operation region handlers. These are the
> + * handlers that are defined by the ACPI specification to be
> + * "always accessible" -- namely, SystemMemory, SystemIO, and
> + * PCI_Config. This also means that no _REG methods need to be
> + * run for these address spaces. We need to have these handlers
> + * installed before any AML code can be executed, especially any
> + * module-level code (11/2015).
> + * Note that we allow OSPMs to install their own region handlers
> + * between AcpiInitializeSubsystem() and AcpiLoadTables() to use
> + * their customized default region handlers.
> + */
> + if (AcpiGbl_GroupModuleLevelCode)
> + {
> + Status = AcpiEvInstallRegionHandlers ();
> + if (ACPI_FAILURE (Status) && Status != AE_ALREADY_EXISTS)
> + {
> + ACPI_EXCEPTION ((AE_INFO, Status, "During Region initialization"));
> + return_ACPI_STATUS (Status);
> + }
> + }
> +
> /* Load the namespace from the tables */
>
> Status = AcpiTbLoadNamespace ();
> @@ -299,7 +322,7 @@ AcpiTbLoadNamespace (
>
> if (!TablesFailed)
> {
> - ACPI_INFO ((AE_INFO,
> + ACPI_INFO ((
> "%u ACPI AML tables successfully acquired and loaded\n",
> TablesLoaded));
> }
> @@ -412,7 +435,7 @@ AcpiLoadTable (
>
> /* Install the table and load it into the namespace */
>
> - ACPI_INFO ((AE_INFO, "Host-directed Dynamic ACPI Table Load:"));
> + ACPI_INFO (("Host-directed Dynamic ACPI Table Load:"));
> (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
>
> Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
> diff --git a/src/acpica/source/components/utilities/utcache.c b/src/acpica/source/components/utilities/utcache.c
> index 5c5a76a..a47d394 100644
> --- a/src/acpica/source/components/utilities/utcache.c
> +++ b/src/acpica/source/components/utilities/utcache.c
> @@ -351,7 +351,7 @@ AcpiOsAcquireObject (
> void *Object;
>
>
> - ACPI_FUNCTION_NAME (OsAcquireObject);
> + ACPI_FUNCTION_TRACE (OsAcquireObject);
>
>
> if (!Cache)
> diff --git a/src/acpica/source/components/utilities/utdecode.c b/src/acpica/source/components/utilities/utdecode.c
> index 15ab305..7d1180d 100644
> --- a/src/acpica/source/components/utilities/utdecode.c
> +++ b/src/acpica/source/components/utilities/utdecode.c
> @@ -578,7 +578,7 @@ AcpiUtGetMutexName (
>
> /* Names for Notify() values, used for debug output */
>
> -static const char *AcpiGbl_GenericNotify[ACPI_NOTIFY_MAX + 1] =
> +static const char *AcpiGbl_GenericNotify[ACPI_GENERIC_NOTIFY_MAX + 1] =
> {
> /* 00 */ "Bus Check",
> /* 01 */ "Device Check",
> @@ -592,32 +592,35 @@ static const char *AcpiGbl_GenericNotify[ACPI_NOTIFY_MAX + 1] =
> /* 09 */ "Device PLD Check",
> /* 0A */ "Reserved",
> /* 0B */ "System Locality Update",
> - /* 0C */ "Shutdown Request",
> + /* 0C */ "Shutdown Request", /* Reserved in ACPI 6.0 */
> /* 0D */ "System Resource Affinity Update"
> };
>
> -static const char *AcpiGbl_DeviceNotify[4] =
> +static const char *AcpiGbl_DeviceNotify[5] =
> {
> /* 80 */ "Status Change",
> /* 81 */ "Information Change",
> /* 82 */ "Device-Specific Change",
> - /* 83 */ "Device-Specific Change"
> + /* 83 */ "Device-Specific Change",
> + /* 84 */ "Reserved"
> };
>
> -static const char *AcpiGbl_ProcessorNotify[4] =
> +static const char *AcpiGbl_ProcessorNotify[5] =
> {
> /* 80 */ "Performance Capability Change",
> /* 81 */ "C-State Change",
> /* 82 */ "Throttling Capability Change",
> - /* 83 */ "Device-Specific Change"
> + /* 83 */ "Guaranteed Change",
> + /* 84 */ "Minimum Excursion"
> };
>
> -static const char *AcpiGbl_ThermalNotify[4] =
> +static const char *AcpiGbl_ThermalNotify[5] =
> {
> /* 80 */ "Thermal Status Change",
> /* 81 */ "Thermal Trip Point Change",
> /* 82 */ "Thermal Device List Change",
> - /* 83 */ "Thermal Relationship Change"
> + /* 83 */ "Thermal Relationship Change",
> + /* 84 */ "Reserved"
> };
>
>
> @@ -627,23 +630,23 @@ AcpiUtGetNotifyName (
> ACPI_OBJECT_TYPE Type)
> {
>
> - /* 00 - 0D are common to all object types */
> + /* 00 - 0D are "common to all object types" (from ACPI Spec) */
>
> - if (NotifyValue <= ACPI_NOTIFY_MAX)
> + if (NotifyValue <= ACPI_GENERIC_NOTIFY_MAX)
> {
> return (AcpiGbl_GenericNotify[NotifyValue]);
> }
>
> - /* 0D - 7F are reserved */
> + /* 0E - 7F are reserved */
>
> if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
> {
> return ("Reserved");
> }
>
> - /* 80 - 83 are per-object-type */
> + /* 80 - 84 are per-object-type */
>
> - if (NotifyValue <= 0x83)
> + if (NotifyValue <= ACPI_SPECIFIC_NOTIFY_MAX)
> {
> switch (Type)
> {
> diff --git a/src/acpica/source/components/utilities/utnonansi.c b/src/acpica/source/components/utilities/utnonansi.c
> index ad848be..47413cd 100644
> --- a/src/acpica/source/components/utilities/utnonansi.c
> +++ b/src/acpica/source/components/utilities/utnonansi.c
> @@ -236,6 +236,82 @@ AcpiUtStricmp (
> }
>
>
> +#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
> +/*******************************************************************************
> + *
> + * FUNCTION: AcpiUtSafeStrcpy, AcpiUtSafeStrcat, AcpiUtSafeStrncat
> + *
> + * PARAMETERS: Adds a "DestSize" parameter to each of the standard string
> + * functions. This is the size of the Destination buffer.
> + *
> + * RETURN: TRUE if the operation would overflow the destination buffer.
> + *
> + * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that
> + * the result of the operation will not overflow the output string
> + * buffer.
> + *
> + * NOTE: These functions are typically only helpful for processing
> + * user input and command lines. For most ACPICA code, the
> + * required buffer length is precisely calculated before buffer
> + * allocation, so the use of these functions is unnecessary.
> + *
> + ******************************************************************************/
> +
> +BOOLEAN
> +AcpiUtSafeStrcpy (
> + char *Dest,
> + ACPI_SIZE DestSize,
> + char *Source)
> +{
> +
> + if (strlen (Source) >= DestSize)
> + {
> + return (TRUE);
> + }
> +
> + strcpy (Dest, Source);
> + return (FALSE);
> +}
> +
> +BOOLEAN
> +AcpiUtSafeStrcat (
> + char *Dest,
> + ACPI_SIZE DestSize,
> + char *Source)
> +{
> +
> + if ((strlen (Dest) + strlen (Source)) >= DestSize)
> + {
> + return (TRUE);
> + }
> +
> + strcat (Dest, Source);
> + return (FALSE);
> +}
> +
> +BOOLEAN
> +AcpiUtSafeStrncat (
> + char *Dest,
> + ACPI_SIZE DestSize,
> + char *Source,
> + ACPI_SIZE MaxTransferLength)
> +{
> + ACPI_SIZE ActualTransferLength;
> +
> +
> + ActualTransferLength = ACPI_MIN (MaxTransferLength, strlen (Source));
> +
> + if ((strlen (Dest) + ActualTransferLength) >= DestSize)
> + {
> + return (TRUE);
> + }
> +
> + strncat (Dest, Source, MaxTransferLength);
> + return (FALSE);
> +}
> +#endif
> +
> +
> /*******************************************************************************
> *
> * FUNCTION: AcpiUtStrtoul64
> @@ -251,7 +327,15 @@ AcpiUtStricmp (
> * 32-bit or 64-bit conversion, depending on the current mode
> * of the interpreter.
> *
> - * NOTE: Does not support Octal strings, not needed.
> + * NOTES: AcpiGbl_IntegerByteWidth should be set to the proper width.
> + * For the core ACPICA code, this width depends on the DSDT
> + * version. For iASL, the default byte width is always 8.
> + *
> + * Does not support Octal strings, not needed at this time.
> + *
> + * There is an earlier version of the function after this one,
> + * below. It is slightly different than this one, and the two
> + * may eventually may need to be merged. (01/2016).
> *
> ******************************************************************************/
>
> @@ -272,7 +356,7 @@ AcpiUtStrtoul64 (
> UINT8 Term = 0;
>
>
> - ACPI_FUNCTION_TRACE_STR (UtStroul64, String);
> + ACPI_FUNCTION_TRACE_STR (UtStrtoul64, String);
>
>
> switch (Base)
> @@ -448,78 +532,201 @@ ErrorExit:
> }
> }
>
> +#ifdef _OBSOLETE_FUNCTIONS
> +/* TBD: use version in ACPICA main code base? */
> +/* DONE: 01/2016 */
>
> -#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
> /*******************************************************************************
> *
> - * FUNCTION: AcpiUtSafeStrcpy, AcpiUtSafeStrcat, AcpiUtSafeStrncat
> + * FUNCTION: strtoul64
> *
> - * PARAMETERS: Adds a "DestSize" parameter to each of the standard string
> - * functions. This is the size of the Destination buffer.
> + * PARAMETERS: String - Null terminated string
> + * Terminater - Where a pointer to the terminating byte
> + * is returned
> + * Base - Radix of the string
> *
> - * RETURN: TRUE if the operation would overflow the destination buffer.
> - *
> - * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that
> - * the result of the operation will not overflow the output string
> - * buffer.
> + * RETURN: Converted value
> *
> - * NOTE: These functions are typically only helpful for processing
> - * user input and command lines. For most ACPICA code, the
> - * required buffer length is precisely calculated before buffer
> - * allocation, so the use of these functions is unnecessary.
> + * DESCRIPTION: Convert a string into an unsigned value.
> *
> ******************************************************************************/
>
> -BOOLEAN
> -AcpiUtSafeStrcpy (
> - char *Dest,
> - ACPI_SIZE DestSize,
> - char *Source)
> +ACPI_STATUS
> +strtoul64 (
> + char *String,
> + UINT32 Base,
> + UINT64 *RetInteger)
> {
> + UINT32 Index;
> + UINT32 Sign;
> + UINT64 ReturnValue = 0;
> + ACPI_STATUS Status = AE_OK;
>
> - if (strlen (Source) >= DestSize)
> +
> + *RetInteger = 0;
> +
> + switch (Base)
> {
> - return (TRUE);
> + case 0:
> + case 8:
> + case 10:
> + case 16:
> +
> + break;
> +
> + default:
> + /*
> + * The specified Base parameter is not in the domain of
> + * this function:
> + */
> + return (AE_BAD_PARAMETER);
> }
>
> - strcpy (Dest, Source);
> - return (FALSE);
> -}
> + /* Skip over any white space in the buffer: */
>
> -BOOLEAN
> -AcpiUtSafeStrcat (
> - char *Dest,
> - ACPI_SIZE DestSize,
> - char *Source)
> -{
> + while (isspace ((int) *String) || *String == '\t')
> + {
> + ++String;
> + }
>
> - if ((strlen (Dest) + strlen (Source)) >= DestSize)
> + /*
> + * The buffer may contain an optional plus or minus sign.
> + * If it does, then skip over it but remember what is was:
> + */
> + if (*String == '-')
> {
> - return (TRUE);
> + Sign = ACPI_SIGN_NEGATIVE;
> + ++String;
> + }
> + else if (*String == '+')
> + {
> + ++String;
> + Sign = ACPI_SIGN_POSITIVE;
> + }
> + else
> + {
> + Sign = ACPI_SIGN_POSITIVE;
> }
>
> - strcat (Dest, Source);
> - return (FALSE);
> -}
> + /*
> + * If the input parameter Base is zero, then we need to
> + * determine if it is octal, decimal, or hexadecimal:
> + */
> + if (Base == 0)
> + {
> + if (*String == '0')
> + {
> + if (tolower ((int) *(++String)) == 'x')
> + {
> + Base = 16;
> + ++String;
> + }
> + else
> + {
> + Base = 8;
> + }
> + }
> + else
> + {
> + Base = 10;
> + }
> + }
>
> -BOOLEAN
> -AcpiUtSafeStrncat (
> - char *Dest,
> - ACPI_SIZE DestSize,
> - char *Source,
> - ACPI_SIZE MaxTransferLength)
> -{
> - ACPI_SIZE ActualTransferLength;
> + /*
> + * For octal and hexadecimal bases, skip over the leading
> + * 0 or 0x, if they are present.
> + */
> + if (Base == 8 && *String == '0')
> + {
> + String++;
> + }
>
> + if (Base == 16 &&
> + *String == '0' &&
> + tolower ((int) *(++String)) == 'x')
> + {
> + String++;
> + }
>
> - ActualTransferLength = ACPI_MIN (MaxTransferLength, strlen (Source));
> + /* Main loop: convert the string to an unsigned long */
>
> - if ((strlen (Dest) + ActualTransferLength) >= DestSize)
> + while (*String)
> {
> - return (TRUE);
> + if (isdigit ((int) *String))
> + {
> + Index = ((UINT8) *String) - '0';
> + }
> + else
> + {
> + Index = (UINT8) toupper ((int) *String);
> + if (isupper ((int) Index))
> + {
> + Index = Index - 'A' + 10;
> + }
> + else
> + {
> + goto ErrorExit;
> + }
> + }
> +
> + if (Index >= Base)
> + {
> + goto ErrorExit;
> + }
> +
> + /* Check to see if value is out of range: */
> +
> + if (ReturnValue > ((ACPI_UINT64_MAX - (UINT64) Index) /
> + (UINT64) Base))
> + {
> + goto ErrorExit;
> + }
> + else
> + {
> + ReturnValue *= Base;
> + ReturnValue += Index;
> + }
> +
> + ++String;
> }
>
> - strncat (Dest, Source, MaxTransferLength);
> - return (FALSE);
> +
> + /* If a minus sign was present, then "the conversion is negated": */
> +
> + if (Sign == ACPI_SIGN_NEGATIVE)
> + {
> + ReturnValue = (ACPI_UINT32_MAX - ReturnValue) + 1;
> + }
> +
> + *RetInteger = ReturnValue;
> + return (Status);
> +
> +
> +ErrorExit:
> + switch (Base)
> + {
> + case 8:
> +
> + Status = AE_BAD_OCTAL_CONSTANT;
> + break;
> +
> + case 10:
> +
> + Status = AE_BAD_DECIMAL_CONSTANT;
> + break;
> +
> + case 16:
> +
> + Status = AE_BAD_HEX_CONSTANT;
> + break;
> +
> + default:
> +
> + /* Base validated above */
> +
> + break;
> + }
> +
> + return (Status);
> }
> #endif
> diff --git a/src/acpica/source/components/utilities/uttrack.c b/src/acpica/source/components/utilities/uttrack.c
> index 5288394..7808ed5 100644
> --- a/src/acpica/source/components/utilities/uttrack.c
> +++ b/src/acpica/source/components/utilities/uttrack.c
> @@ -847,7 +847,7 @@ AcpiUtDumpAllocations (
>
> if (!NumOutstanding)
> {
> - ACPI_INFO ((AE_INFO, "No outstanding allocations"));
> + ACPI_INFO (("No outstanding allocations"));
> }
> else
> {
> diff --git a/src/acpica/source/components/utilities/utxferror.c b/src/acpica/source/components/utilities/utxferror.c
> index 9010ff9..8db84b9 100644
> --- a/src/acpica/source/components/utilities/utxferror.c
> +++ b/src/acpica/source/components/utilities/utxferror.c
> @@ -277,8 +277,6 @@ ACPI_EXPORT_SYMBOL (AcpiWarning)
>
> void ACPI_INTERNAL_VAR_XFACE
> AcpiInfo (
> - const char *ModuleName,
> - UINT32 LineNumber,
> const char *Format,
> ...)
> {
> diff --git a/src/acpica/source/components/utilities/utxfinit.c b/src/acpica/source/components/utilities/utxfinit.c
> index 16be627..1513ea6 100644
> --- a/src/acpica/source/components/utilities/utxfinit.c
> +++ b/src/acpica/source/components/utilities/utxfinit.c
> @@ -204,25 +204,6 @@ AcpiInitializeSubsystem (
> return_ACPI_STATUS (Status);
> }
>
> - if (!AcpiGbl_OverrideDefaultRegionHandlers)
> - {
> - /*
> - * Install the default operation region handlers. These are the
> - * handlers that are defined by the ACPI specification to be
> - * "always accessible" -- namely, SystemMemory, SystemIO, and
> - * PCI_Config. This also means that no _REG methods need to be
> - * run for these address spaces. We need to have these handlers
> - * installed before any AML code can be executed, especially any
> - * module-level code (11/2015).
> - */
> - Status = AcpiEvInstallRegionHandlers ();
> - if (ACPI_FAILURE (Status))
> - {
> - ACPI_EXCEPTION ((AE_INFO, Status, "During Region initialization"));
> - return_ACPI_STATUS (Status);
> - }
> - }
> -
> return_ACPI_STATUS (AE_OK);
> }
>
> @@ -259,17 +240,17 @@ AcpiEnableSubsystem (
> */
> AcpiGbl_EarlyInitialization = FALSE;
>
> - if (AcpiGbl_OverrideDefaultRegionHandlers)
> + /*
> + * Install the default operation region handlers. These are the
> + * handlers that are defined by the ACPI specification to be
> + * "always accessible" -- namely, SystemMemory, SystemIO, and
> + * PCI_Config. This also means that no _REG methods need to be
> + * run for these address spaces. We need to have these handlers
> + * installed before any AML code can be executed, especially any
> + * module-level code (11/2015).
> + */
> + if (!AcpiGbl_GroupModuleLevelCode)
> {
> - /*
> - * Install the default operation region handlers. These are the
> - * handlers that are defined by the ACPI specification to be
> - * "always accessible" -- namely, SystemMemory, SystemIO, and
> - * PCI_Config. This also means that no _REG methods need to be
> - * run for these address spaces. We need to have these handlers
> - * installed before any AML code can be executed, especially any
> - * module-level code (11/2015).
> - */
> Status = AcpiEvInstallRegionHandlers ();
> if (ACPI_FAILURE (Status))
> {
> @@ -278,7 +259,6 @@ AcpiEnableSubsystem (
> }
> }
>
> -
> #if (!ACPI_REDUCED_HARDWARE)
>
> /* Enable ACPI mode */
> @@ -384,25 +364,6 @@ AcpiInitializeObjects (
> ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
>
>
> - /*
> - * Run all _REG methods
> - *
> - * Note: Any objects accessed by the _REG methods will be automatically
> - * initialized, even if they contain executable AML (see the call to
> - * AcpiNsInitializeObjects below).
> - */
> - if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT))
> - {
> - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
> - "[Init] Executing _REG OpRegion methods\n"));
> -
> - Status = AcpiEvInitializeOpRegions ();
> - if (ACPI_FAILURE (Status))
> - {
> - return_ACPI_STATUS (Status);
> - }
> - }
> -
> #ifdef ACPI_EXEC_APP
> /*
> * This call implements the "initialization file" option for AcpiExec.
> @@ -445,16 +406,15 @@ AcpiInitializeObjects (
> }
> }
>
> + AcpiGbl_NamespaceInitialized = TRUE;
> +
> /*
> - * Initialize all device objects in the namespace. This runs the device
> - * _STA and _INI methods.
> + * Initialize all device/region objects in the namespace. This runs
> + * the device _STA and _INI methods and region _REG methods.
> */
> - if (!(Flags & ACPI_NO_DEVICE_INIT))
> + if (!(Flags & (ACPI_NO_DEVICE_INIT | ACPI_NO_ADDRESS_SPACE_INIT)))
> {
> - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
> - "[Init] Initializing ACPI Devices\n"));
> -
> - Status = AcpiNsInitializeDevices ();
> + Status = AcpiNsInitializeDevices (Flags);
> if (ACPI_FAILURE (Status))
> {
> return_ACPI_STATUS (Status);
> diff --git a/src/acpica/source/include/acdisasm.h b/src/acpica/source/include/acdisasm.h
> index 732d8d3..f949a8b 100644
> --- a/src/acpica/source/include/acdisasm.h
> +++ b/src/acpica/source/include/acdisasm.h
> @@ -374,6 +374,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[];
> extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[];
> extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[];
> extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[];
> +extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest10[];
> extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[];
> extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[];
> extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[];
> diff --git a/src/acpica/source/include/acglobal.h b/src/acpica/source/include/acglobal.h
> index 3215d33..86e9eb9 100644
> --- a/src/acpica/source/include/acglobal.h
> +++ b/src/acpica/source/include/acglobal.h
> @@ -158,8 +158,6 @@ ACPI_GLOBAL (UINT8, AcpiGbl_IntegerBitWidth);
> ACPI_GLOBAL (UINT8, AcpiGbl_IntegerByteWidth);
> ACPI_GLOBAL (UINT8, AcpiGbl_IntegerNybbleWidth);
>
> -ACPI_INIT_GLOBAL (UINT8, AcpiGbl_GroupModuleLevelCode, FALSE);
> -
>
> /*****************************************************************************
> *
> @@ -242,7 +240,7 @@ ACPI_GLOBAL (UINT8, AcpiGbl_NextOwnerIdOffset);
>
> /* Initialization sequencing */
>
> -ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_RegMethodsEnabled, FALSE);
> +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_NamespaceInitialized, FALSE);
>
> /* Misc */
>
> diff --git a/src/acpica/source/include/aclocal.h b/src/acpica/source/include/aclocal.h
> index 5cadb26..383555a 100644
> --- a/src/acpica/source/include/aclocal.h
> +++ b/src/acpica/source/include/aclocal.h
> @@ -161,7 +161,7 @@ union acpi_parse_object;
> #define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */
>
> #define ACPI_MAX_MUTEX 5
> -#define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1
> +#define ACPI_NUM_MUTEX (ACPI_MAX_MUTEX+1)
>
>
> /* Lock structure for reader/writer interfaces */
> @@ -183,12 +183,12 @@ typedef struct acpi_rw_lock
> #define ACPI_LOCK_HARDWARE 1
>
> #define ACPI_MAX_LOCK 1
> -#define ACPI_NUM_LOCK ACPI_MAX_LOCK+1
> +#define ACPI_NUM_LOCK (ACPI_MAX_LOCK+1)
>
>
> /* This Thread ID means that the mutex is not in use (unlocked) */
>
> -#define ACPI_MUTEX_NOT_ACQUIRED (ACPI_THREAD_ID) -1
> +#define ACPI_MUTEX_NOT_ACQUIRED ((ACPI_THREAD_ID) -1)
>
> /* This Thread ID means an invalid thread ID */
>
> diff --git a/src/acpica/source/include/acnamesp.h b/src/acpica/source/include/acnamesp.h
> index ad0e27b..7141d51 100644
> --- a/src/acpica/source/include/acnamesp.h
> +++ b/src/acpica/source/include/acnamesp.h
> @@ -166,7 +166,7 @@ AcpiNsInitializeObjects (
>
> ACPI_STATUS
> AcpiNsInitializeDevices (
> - void);
> + UINT32 Flags);
>
>
> /*
> diff --git a/src/acpica/source/include/acoutput.h b/src/acpica/source/include/acoutput.h
> index 22c0106..6877044 100644
> --- a/src/acpica/source/include/acoutput.h
> +++ b/src/acpica/source/include/acoutput.h
> @@ -339,7 +339,7 @@
> #define ACPI_GET_FUNCTION_NAME _AcpiFunctionName
>
> /*
> - * The Name parameter should be the procedure name as a quoted string.
> + * The Name parameter should be the procedure name as a non-quoted string.
> * The function name is also used by the function exit macros below.
> * Note: (const char) is used to be compatible with the debug interfaces
> * and macros such as __FUNCTION__.
> diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h
> index 5f0d627..cad585b 100644
> --- a/src/acpica/source/include/acpixf.h
> +++ b/src/acpica/source/include/acpixf.h
> @@ -118,7 +118,7 @@
>
> /* Current ACPICA subsystem version in YYYYMMDD format */
>
> -#define ACPI_CA_VERSION 0x20160108
> +#define ACPI_CA_VERSION 0x20160212
>
> #include "acconfig.h"
> #include "actypes.h"
> @@ -264,9 +264,9 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE);
> ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
>
> /*
> - * Optionally allow default region handlers to be overridden.
> + * Optionally support group module level code.
> */
> -ACPI_INIT_GLOBAL (UINT8, AcpiGbl_OverrideDefaultRegionHandlers, FALSE);
> +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_GroupModuleLevelCode, FALSE);
>
> /*
> * Optionally use 32-bit FADT addresses if and when there is a conflict
> @@ -1244,11 +1244,9 @@ AcpiWarning (
> ...))
>
> ACPI_MSG_DEPENDENT_RETURN_VOID (
> -ACPI_PRINTF_LIKE(3)
> +ACPI_PRINTF_LIKE(1)
> void ACPI_INTERNAL_VAR_XFACE
> AcpiInfo (
> - const char *ModuleName,
> - UINT32 LineNumber,
> const char *Format,
> ...))
>
> diff --git a/src/acpica/source/include/acpredef.h b/src/acpica/source/include/acpredef.h
> index 413fa2a..95abf0a 100644
> --- a/src/acpica/source/include/acpredef.h
> +++ b/src/acpica/source/include/acpredef.h
> @@ -588,6 +588,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
> METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */
> PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0),
>
> + {{"_FIT", METHOD_0ARGS,
> + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, /* ACPI 6.0 */
> +
> {{"_FIX", METHOD_0ARGS,
> METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints) */
> PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0,0,0),
> @@ -1102,6 +1105,12 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
> {{"_WED", METHOD_1ARGS (ACPI_TYPE_INTEGER),
> METHOD_RETURNS (ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER)}},
>
> + {{"_WPC", METHOD_0ARGS,
> + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* ACPI 6.1 */
> +
> + {{"_WPP", METHOD_0ARGS,
> + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* ACPI 6.1 */
> +
> PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */
> };
> #else
> @@ -1176,7 +1185,7 @@ const ACPI_PREDEFINED_INFO AcpiGbl_ResourceNames[] =
> PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */
> };
>
> -static const ACPI_PREDEFINED_INFO AcpiGbl_ScopeNames[] = {
> +const ACPI_PREDEFINED_INFO AcpiGbl_ScopeNames[] = {
> {{"_GPE", 0, 0}},
> {{"_PR_", 0, 0}},
> {{"_SB_", 0, 0}},
> @@ -1185,7 +1194,7 @@ static const ACPI_PREDEFINED_INFO AcpiGbl_ScopeNames[] = {
> PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */
> };
> #else
> -extern const ACPI_PREDEFINED_INFO AcpiGbl_ResourceNames[];
> +extern const ACPI_PREDEFINED_INFO AcpiGbl_ResourceNames[];
> #endif
>
> #endif
> diff --git a/src/acpica/source/include/actbl.h b/src/acpica/source/include/actbl.h
> index 2e00273..6cc4dbf 100644
> --- a/src/acpica/source/include/actbl.h
> +++ b/src/acpica/source/include/actbl.h
> @@ -320,7 +320,7 @@ typedef struct acpi_table_facs
> /*******************************************************************************
> *
> * FADT - Fixed ACPI Description Table (Signature "FACP")
> - * Version 4
> + * Version 6
> *
> ******************************************************************************/
>
> diff --git a/src/acpica/source/include/actbl1.h b/src/acpica/source/include/actbl1.h
> index 68ec982..4e3f84c 100644
> --- a/src/acpica/source/include/actbl1.h
> +++ b/src/acpica/source/include/actbl1.h
> @@ -340,7 +340,8 @@ enum AcpiEinjActions
> ACPI_EINJ_CHECK_BUSY_STATUS = 6,
> ACPI_EINJ_GET_COMMAND_STATUS = 7,
> ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
> - ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */
> + ACPI_EINJ_GET_EXECUTE_TIMINGS = 9,
> + ACPI_EINJ_ACTION_RESERVED = 10, /* 10 and greater are reserved */
> ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
> };
>
> @@ -469,7 +470,8 @@ enum AcpiErstActions
> ACPI_ERST_GET_ERROR_RANGE = 13,
> ACPI_ERST_GET_ERROR_LENGTH = 14,
> ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
> - ACPI_ERST_ACTION_RESERVED = 16 /* 16 and greater are reserved */
> + ACPI_ERST_EXECUTE_TIMINGS = 16,
> + ACPI_ERST_ACTION_RESERVED = 17 /* 17 and greater are reserved */
> };
>
> /* Values for Instruction field above */
> @@ -561,7 +563,8 @@ enum AcpiHestTypes
> ACPI_HEST_TYPE_AER_ENDPOINT = 7,
> ACPI_HEST_TYPE_AER_BRIDGE = 8,
> ACPI_HEST_TYPE_GENERIC_ERROR = 9,
> - ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */
> + ACPI_HEST_TYPE_GENERIC_ERROR_V2 = 10,
> + ACPI_HEST_TYPE_RESERVED = 11 /* 11 and greater are reserved */
> };
>
>
> @@ -769,6 +772,27 @@ typedef struct acpi_hest_generic
> } ACPI_HEST_GENERIC;
>
>
> +/* 10: Generic Hardware Error Source, version 2 */
> +
> +typedef struct acpi_hest_generic_v2
> +{
> + ACPI_HEST_HEADER Header;
> + UINT16 RelatedSourceId;
> + UINT8 Reserved;
> + UINT8 Enabled;
> + UINT32 RecordsToPreallocate;
> + UINT32 MaxSectionsPerRecord;
> + UINT32 MaxRawDataLength;
> + ACPI_GENERIC_ADDRESS ErrorStatusAddress;
> + ACPI_HEST_NOTIFY Notify;
> + UINT32 ErrorBlockLength;
> + ACPI_GENERIC_ADDRESS ReadAckRegister;
> + UINT64 ReadAckPreserve;
> + UINT64 ReadAckWrite;
> +
> +} ACPI_HEST_GENERIC_V2;
> +
> +
> /* Generic Error Status block */
>
> typedef struct acpi_hest_generic_status
> @@ -802,6 +826,7 @@ typedef struct acpi_hest_generic_data
> UINT32 ErrorDataLength;
> UINT8 FruId[16];
> UINT8 FruText[20];
> + UINT64 TimeStamp;
>
> } ACPI_HEST_GENERIC_DATA;
>
> @@ -1259,6 +1284,7 @@ typedef struct acpi_nfit_memory_map
> #define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
> #define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
> #define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
> +#define ACPI_NFIT_MEM_MAP_FAILED (1<<6) /* 06: Mapping to SPA failed */
>
>
> /* 2: Interleave Structure */
> diff --git a/src/acpica/source/include/actypes.h b/src/acpica/source/include/actypes.h
> index 02ef5ce..5f85dd8 100644
> --- a/src/acpica/source/include/actypes.h
> +++ b/src/acpica/source/include/actypes.h
> @@ -714,7 +714,8 @@ typedef UINT64 ACPI_INTEGER;
> #define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C
> #define ACPI_NOTIFY_AFFINITY_UPDATE (UINT8) 0x0D
>
> -#define ACPI_NOTIFY_MAX 0x0D
> +#define ACPI_GENERIC_NOTIFY_MAX 0x0D
> +#define ACPI_SPECIFIC_NOTIFY_MAX 0x84
>
> /*
> * Types associated with ACPI names and objects. The first group of
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list