aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2015-04-09 23:08:47 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2015-04-09 23:08:47 +0000
commitd29c30140bd8ea81e0530ad3975c977891ab9275 (patch)
tree7a91c0da98a89b4b10beda84d027d2c779673064
parent2872953d4a9c9c4e0fc0b9ab37d0e962909625a0 (diff)
downloadsrc-vendor/acpica/20150408.tar.gz
src-vendor/acpica/20150408.zip
Import ACPICA 20150408.vendor/acpica/20150408
-rw-r--r--changes.txt100
-rw-r--r--generate/unix/Makefile.config7
-rw-r--r--generate/unix/acpidump/Makefile10
-rw-r--r--source/common/adfile.c10
-rw-r--r--source/common/adisasm.c95
-rw-r--r--source/common/dmtable.c136
-rw-r--r--source/common/dmtbdump.c100
-rw-r--r--source/common/dmtbinfo.c42
-rw-r--r--source/compiler/aslcodegen.c2
-rw-r--r--source/compiler/aslcompile.c12
-rw-r--r--source/compiler/aslcompiler.h8
-rw-r--r--source/compiler/asldefine.h1
-rw-r--r--source/compiler/aslfold.c706
-rw-r--r--source/compiler/asllisting.c5
-rw-r--r--source/compiler/aslmain.c1
-rw-r--r--source/compiler/aslmap.c2
-rw-r--r--source/compiler/aslmapenter.c10
-rw-r--r--source/compiler/asloptions.c5
-rw-r--r--source/compiler/aslrules.y53
-rw-r--r--source/compiler/aslstartup.c2
-rw-r--r--source/compiler/asltree.c199
-rw-r--r--source/compiler/asltypes.y2
-rw-r--r--source/compiler/aslutils.c9
-rw-r--r--source/compiler/aslwalks.c10
-rw-r--r--source/compiler/dtcompile.c17
-rw-r--r--source/compiler/dtcompiler.h20
-rw-r--r--source/compiler/dtio.c6
-rw-r--r--source/compiler/dttable.c35
-rw-r--r--source/compiler/dttemplate.h17
-rw-r--r--source/compiler/dtutils.c3
-rw-r--r--source/components/debugger/dbmethod.c4
-rw-r--r--source/components/debugger/dbxface.c13
-rw-r--r--source/components/disassembler/dmcstyle.c30
-rw-r--r--source/components/disassembler/dmopcode.c12
-rw-r--r--source/components/disassembler/dmwalk.c2
-rw-r--r--source/components/dispatcher/dsopcode.c6
-rw-r--r--source/components/dispatcher/dsutils.c9
-rw-r--r--source/components/events/evregion.c2
-rw-r--r--source/components/events/evxfevnt.c5
-rw-r--r--source/components/executer/exdump.c2
-rw-r--r--source/components/executer/exfldio.c4
-rw-r--r--source/components/executer/exoparg3.c13
-rw-r--r--source/components/executer/exregion.c13
-rw-r--r--source/components/hardware/hwgpe.c15
-rw-r--r--source/components/hardware/hwvalid.c12
-rw-r--r--source/components/namespace/nsdump.c6
-rw-r--r--source/components/parser/psopcode.c6
-rw-r--r--source/components/parser/psopinfo.c2
-rw-r--r--source/components/resources/rsaddr.c8
-rw-r--r--source/components/resources/rsdump.c279
-rw-r--r--source/components/resources/rsdumpinfo.c45
-rw-r--r--source/components/resources/rsxface.c10
-rw-r--r--source/components/tables/tbdata.c33
-rw-r--r--source/components/tables/tbinstal.c68
-rw-r--r--source/components/tables/tbprint.c18
-rw-r--r--source/components/tables/tbxfroot.c6
-rw-r--r--source/components/utilities/utaddress.c22
-rw-r--r--source/components/utilities/utbuffer.c9
-rw-r--r--source/components/utilities/utclib.c21
-rw-r--r--source/components/utilities/utglobal.c13
-rw-r--r--source/components/utilities/utmisc.c2
-rw-r--r--source/components/utilities/utosi.c1
-rw-r--r--source/components/utilities/utprint.c13
-rw-r--r--source/components/utilities/utstate.c38
-rw-r--r--source/components/utilities/utuuid.c2
-rw-r--r--source/include/acapps.h8
-rw-r--r--source/include/acdebug.h2
-rw-r--r--source/include/acdisasm.h20
-rw-r--r--source/include/acglobal.h9
-rw-r--r--source/include/aclocal.h2
-rw-r--r--source/include/acmacros.h13
-rw-r--r--source/include/acopcode.h2
-rw-r--r--source/include/acpixf.h4
-rw-r--r--source/include/acresrc.h4
-rw-r--r--source/include/acrestyp.h54
-rw-r--r--source/include/acstruct.h5
-rw-r--r--source/include/actables.h13
-rw-r--r--source/include/actbl2.h83
-rw-r--r--source/include/actypes.h46
-rw-r--r--source/include/acutils.h27
-rw-r--r--source/include/amlcode.h2
-rw-r--r--source/include/platform/acdragonfly.h130
-rw-r--r--source/include/platform/acdragonflyex.h84
-rw-r--r--source/include/platform/acenv.h1
-rw-r--r--source/include/platform/acnetbsd.h23
-rw-r--r--source/os_specific/service_layers/osbsdtbl.c (renamed from source/os_specific/service_layers/osfreebsdtbl.c)15
-rw-r--r--source/os_specific/service_layers/osefixf.c11
-rw-r--r--source/os_specific/service_layers/oslinuxtbl.c2
-rw-r--r--source/os_specific/service_layers/osunixmap.c2
-rw-r--r--source/tools/acpiexec/aemain.c9
-rw-r--r--source/tools/acpiexec/aeregion.c8
-rw-r--r--source/tools/acpiexec/aetables.c6
-rw-r--r--source/tools/acpihelp/ahamlops.c42
-rw-r--r--source/tools/acpihelp/ahaslops.c40
-rw-r--r--source/tools/acpinames/antables.c4
-rw-r--r--source/tools/acpisrc/astable.c7
-rw-r--r--source/tools/examples/extables.c2
97 files changed, 1836 insertions, 1213 deletions
diff --git a/changes.txt b/changes.txt
index 0469af08e1ba..850685bd9c6a 100644
--- a/changes.txt
+++ b/changes.txt
@@ -1,7 +1,77 @@
----------------------------------------
-04 February 2015. Summary of changes for version 20150204:
+08 April 2015. Summary of changes for version 20150408:
-This release is available at https://acpica.org/downloads
+
+1) ACPICA kernel-resident subsystem:
+
+Permanently set the return value for the _REV predefined name. It now
+returns 2 (was 5). This matches other ACPI implementations. _REV will be
+deprecated in the future, and is now defined to be 1 for ACPI 1.0, and 2
+for ACPI 2.0 and later. It should never be used to differentiate or
+identify operating systems.
+
+Added the "Windows 2015" string to the _OSI support. ACPICA will now
+return TRUE to a query with this string.
+
+Fixed several issues with the local version of the printf function.
+
+Added the C99 compiler option (-std=c99) to the Unix makefiles.
+
+ Current Release:
+ Non-Debug Version: 99.9K Code, 27.4K Data, 127.3K Total
+ Debug Version: 195.2K Code, 80.7K Data, 275.9K Total
+ Previous Release:
+ Non-Debug Version: 98.8K Code, 27.3K Data, 126.1K Total
+ Debug Version: 192.1K Code, 79.8K Data, 271.9K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Implemented an enhancement to the constant folding feature to
+transform the parse tree to a simple Store operation whenever possible:
+ Add (2, 3, X) ==> is converted to: Store (5, X)
+ X = 2 + 3 ==> is converted to: Store (5, X)
+
+Updated support for the SLIC table (Software Licensing Description Table)
+in both the Data Table compiler and the disassembler. The SLIC table
+support now conforms to "Microsoft Software Licensing Tables (SLIC and
+MSDM). November 29, 2011. Copyright 2011 Microsoft". Note: Any SLIC data
+following the ACPI header is now defined to be "Proprietary Data", and as
+such, can only be entered or displayed as a hex data block.
+
+Implemented full support for the MSDM table as described in the document
+above. Note: The format of MSDM is similar to SLIC. Any MSDM data
+following the ACPI header is defined to be "Proprietary Data", and can
+only be entered or displayed as a hex data block.
+
+Implemented the -Pn option for the iASL Table Compiler (was only
+implemented for the ASL compiler). This option disables the iASL
+preprocessor.
+
+Disassembler: For disassembly of Data Tables, added a comment field
+around the Ascii equivalent data that is emitted as part of the "Raw
+Table Data" block. This prevents the iASL Preprocessor from possible
+confusion if/when the table is compiled.
+
+Disassembler: Added an option (-df) to force the disassembler to assume
+that the table being disassembled contains valid AML. This feature is
+useful for disassembling AML files that contain ACPI signatures other
+than DSDT or SSDT (such as OEMx or other signatures).
+
+Changes for the EFI version of the tools:
+1) Fixed a build error/issue
+2) Fixed a cast warning
+
+iASL: Fixed a path issue with the __FILE__ operator by making the
+directory prefix optional within the internal SplitInputFilename
+function.
+
+Debugger: Removed some unused global variables.
+
+Tests: Updated the makefile for proper generation of the AAPITS suite.
+
+----------------------------------------
+04 February 2015. Summary of changes for version 20150204:
ACPICA kernel-resident subsystem:
@@ -14,24 +84,26 @@ Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix GPE storm issues.
A raw gpe handling mechanism was created to allow better handling of GPE
storms that aren't easily managed by the normal handler. The raw handler
allows disabling/renabling of the the GPE so that interrupt storms can be
-avoided in cases where events cannot be timely serviced. In this scenario,
-handlers should use the AcpiSetGpe() API to disable/enable the GPE. This API
-will leave the reference counts undisturbed, thereby preventing unintentional
-clearing of the GPE when the intent in only to temporarily disable it. Raw
-handlers allow enabling and disabling of a GPE by removing GPE register
-locking. As such, raw handlers much provide their own locks while using
-GPE API's to protect access to GPE data structures.
+avoided in cases where events cannot be timely serviced. In this
+scenario, handlers should use the AcpiSetGpe() API to disable/enable the
+GPE. This API will leave the reference counts undisturbed, thereby
+preventing unintentional clearing of the GPE when the intent in only to
+temporarily disable it. Raw handlers allow enabling and disabling of a
+GPE by removing GPE register locking. As such, raw handlers much provide
+their own locks while using GPE API's to protect access to GPE data
+structures.
Lv Zheng
Events: Always modify GPE registers under the GPE lock.
Applies GPE lock around AcpiFinishGpe() to protect access to GPE register
values. Reported as bug by joe.liu@apple.com.
-Unix makefiles: Separate option to disable optimizations and _FORTIFY_SOURCE.
-This change removes the _FORTIFY_SOURCE flag from the NOOPT disable option and
-creates a separate flag (NOFORTIFY) for this purpose. Some toolchains may
-define _FORTIFY_SOURCE which leads redefined errors when building ACPICA. This
-allows disabling the option without also having to disable optimazations.
+Unix makefiles: Separate option to disable optimizations and
+_FORTIFY_SOURCE. This change removes the _FORTIFY_SOURCE flag from the
+NOOPT disable option and creates a separate flag (NOFORTIFY) for this
+purpose. Some toolchains may define _FORTIFY_SOURCE which leads redefined
+errors when building ACPICA. This allows disabling the option without
+also having to disable optimazations.
David Box
Current Release:
diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config
index 9d8cb68b17f3..6ad84de44065 100644
--- a/generate/unix/Makefile.config
+++ b/generate/unix/Makefile.config
@@ -59,6 +59,10 @@ ifeq ($(UNAME_S), FreeBSD)
HOST = _FreeBSD
endif
+ifeq ($(UNAME_S), NetBSD)
+HOST = _NetBSD
+endif
+
ifeq ($(HOST), _APPLE)
INSTALL = cp
INSTALLFLAGS ?= -f
@@ -161,7 +165,7 @@ CFLAGS += \
# to -Wall are not automatically included in -Wall.
#
CWARNINGFLAGS = \
- -ansi\
+ -std=c99\
-Wall\
-Wbad-function-cast\
-Wdeclaration-after-statement\
@@ -241,4 +245,3 @@ MFLAGS= -P -I$(ASL_COMPILER)
LEX= flex
LFLAGS += -i -s
-
diff --git a/generate/unix/acpidump/Makefile b/generate/unix/acpidump/Makefile
index 64256ea7052d..8cf0014b3733 100644
--- a/generate/unix/acpidump/Makefile
+++ b/generate/unix/acpidump/Makefile
@@ -52,8 +52,16 @@ OBJECTS = \
# Per-host interfaces
#
ifeq ($(HOST), _FreeBSD)
+HOST_FAMILY = BSD
+endif
+
+ifeq ($(HOST), _NetBSD)
+HOST_FAMILY = BSD
+endif
+
+ifeq ($(HOST_FAMILY), BSD)
OBJECTS += \
- $(OBJDIR)/osfreebsdtbl.o
+ $(OBJDIR)/osbsdtbl.o
else
OBJECTS += \
$(OBJDIR)/oslinuxtbl.o
diff --git a/source/common/adfile.c b/source/common/adfile.c
index 69f68ca04c96..fc7c6b233d87 100644
--- a/source/common/adfile.c
+++ b/source/common/adfile.c
@@ -295,7 +295,10 @@ FlSplitInputPathname (
char *Filename;
- *OutDirectoryPath = NULL;
+ if (OutDirectoryPath)
+ {
+ *OutDirectoryPath = NULL;
+ }
if (!InputPath)
{
@@ -340,7 +343,10 @@ FlSplitInputPathname (
return (AE_NO_MEMORY);
}
- *OutDirectoryPath = DirectoryPath;
+ if (OutDirectoryPath)
+ {
+ *OutDirectoryPath = DirectoryPath;
+ }
if (OutFilename)
{
diff --git a/source/common/adisasm.c b/source/common/adisasm.c
index be5474a553e6..b04a352dddd9 100644
--- a/source/common/adisasm.c
+++ b/source/common/adisasm.c
@@ -64,6 +64,11 @@ AdCreateTableHeader (
char *Filename,
ACPI_TABLE_HEADER *Table);
+static ACPI_STATUS
+AdStoreTable (
+ ACPI_TABLE_HEADER *Table,
+ UINT32 *TableIndex);
+
/* Stubs for ASL compiler */
#ifndef ACPI_ASL_COMPILER
@@ -298,7 +303,7 @@ AdAmlDisassemble (
return (Status);
}
- if (!AcpiGbl_DbOpt_disasm)
+ if (!AcpiGbl_DbOpt_Disasm)
{
return (AE_OK);
}
@@ -337,7 +342,6 @@ AdAmlDisassemble (
{
fprintf (stderr, "Could not open output file %s\n", DisasmFilename);
Status = AE_ERROR;
- ACPI_FREE (DisasmFilename);
goto Cleanup;
}
@@ -346,9 +350,11 @@ AdAmlDisassemble (
*OutFilename = DisasmFilename;
- if (!AcpiUtIsAmlTable (Table))
+ /* ForceAmlDisassembly means to assume the table contains valid AML */
+
+ if (!AcpiGbl_ForceAmlDisassembly && !AcpiUtIsAmlTable (Table))
{
- AdDisassemblerHeader (Filename);
+ AdDisassemblerHeader (Filename, ACPI_IS_DATA_TABLE);
AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n",
Table->Signature);
AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] "
@@ -486,7 +492,7 @@ AdAmlDisassemble (
/* Optional displays */
- if (AcpiGbl_DbOpt_disasm)
+ if (AcpiGbl_DbOpt_Disasm)
{
/* This is the real disassembly */
@@ -515,7 +521,7 @@ AdAmlDisassemble (
Cleanup:
- if (Table && !AcpiUtIsAmlTable (Table))
+ if (Table && !AcpiGbl_ForceAmlDisassembly &&!AcpiUtIsAmlTable (Table))
{
ACPI_FREE (Table);
}
@@ -543,6 +549,7 @@ Cleanup:
* FUNCTION: AdDisassemblerHeader
*
* PARAMETERS: Filename - Input file for the table
+ * TableType - Either AML or DataTable
*
* RETURN: None
*
@@ -553,7 +560,8 @@ Cleanup:
void
AdDisassemblerHeader (
- char *Filename)
+ char *Filename,
+ UINT8 TableType)
{
time_t Timer;
@@ -565,17 +573,20 @@ AdDisassemblerHeader (
AcpiOsPrintf ("/*\n");
AcpiOsPrintf (ACPI_COMMON_HEADER (AML_DISASSEMBLER_NAME, " * "));
- if (AcpiGbl_CstyleDisassembly)
+ if (TableType == ACPI_IS_AML_TABLE)
{
- AcpiOsPrintf (
- " * Disassembling to symbolic ASL+ operators\n"
- " *\n");
- }
- else
- {
- AcpiOsPrintf (
- " * Disassembling to non-symbolic legacy ASL operators\n"
- " *\n");
+ if (AcpiGbl_CstyleDisassembly)
+ {
+ AcpiOsPrintf (
+ " * Disassembling to symbolic ASL+ operators\n"
+ " *\n");
+ }
+ else
+ {
+ AcpiOsPrintf (
+ " * Disassembling to non-symbolic legacy ASL operators\n"
+ " *\n");
+ }
}
AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer));
@@ -609,7 +620,7 @@ AdCreateTableHeader (
/*
* Print file header and dump original table header
*/
- AdDisassemblerHeader (Filename);
+ AdDisassemblerHeader (Filename, ACPI_IS_AML_TABLE);
AcpiOsPrintf (" * Original Table Header:\n");
AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature);
@@ -717,7 +728,7 @@ AdDisplayTables (
return (AE_NOT_EXIST);
}
- if (!AcpiGbl_DbOpt_verbose)
+ if (!AcpiGbl_DbOpt_Verbose)
{
AdCreateTableHeader (Filename, Table);
}
@@ -725,7 +736,7 @@ AdDisplayTables (
AcpiDmDisassemble (NULL, AcpiGbl_ParseOpRoot, ACPI_UINT32_MAX);
MpEmitMappingInfo ();
- if (AcpiGbl_DbOpt_verbose)
+ if (AcpiGbl_DbOpt_Verbose)
{
AcpiOsPrintf ("\n\nTable Header:\n");
AcpiUtDebugDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER),
@@ -740,6 +751,43 @@ AdDisplayTables (
}
+/*******************************************************************************
+ *
+ * FUNCTION: AdStoreTable
+ *
+ * PARAMETERS: Table - Table header
+ * TableIndex - Where the table index is returned
+ *
+ * RETURN: Status and table index.
+ *
+ * DESCRIPTION: Add an ACPI table to the global table list
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AdStoreTable (
+ ACPI_TABLE_HEADER *Table,
+ UINT32 *TableIndex)
+{
+ ACPI_STATUS Status;
+ ACPI_TABLE_DESC *TableDesc;
+
+
+ Status = AcpiTbGetNextTableDescriptor (TableIndex, &TableDesc);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Initialize added table */
+
+ AcpiTbInitTableDescriptor (TableDesc, ACPI_PTR_TO_PHYSADDR (Table),
+ ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, Table);
+ AcpiTbValidateTable (TableDesc);
+ return (AE_OK);
+}
+
+
/******************************************************************************
*
* FUNCTION: AdGetLocalTables
@@ -777,8 +825,7 @@ AdGetLocalTables (
/* Store DSDT in the Table Manager */
- Status = AcpiTbStoreTable (0, NewTable, NewTable->Length,
- 0, &TableIndex);
+ Status = AdStoreTable (NewTable, &TableIndex);
if (ACPI_FAILURE (Status))
{
fprintf (stderr, "Could not store DSDT\n");
@@ -871,9 +918,7 @@ AdParseTable (
if (LoadTable)
{
- Status = AcpiTbStoreTable ((ACPI_PHYSICAL_ADDRESS) Table, Table,
- Table->Length, ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL,
- &TableIndex);
+ Status = AdStoreTable (Table, &TableIndex);
if (ACPI_FAILURE (Status))
{
return (Status);
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
index 5092839b478e..2c3f95d3cc4f 100644
--- a/source/common/dmtable.c
+++ b/source/common/dmtable.c
@@ -241,13 +241,6 @@ static const char *AcpiDmPmttSubnames[] =
"Unknown SubTable Type" /* Reserved */
};
-static const char *AcpiDmSlicSubnames[] =
-{
- "Public Key Structure",
- "Windows Marker Structure",
- "Unknown SubTable Type" /* Reserved */
-};
-
static const char *AcpiDmSratSubnames[] =
{
"Processor Local APIC/SAPIC Affinity",
@@ -339,6 +332,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"},
{ACPI_SIG_MPST, AcpiDmTableInfoMpst, AcpiDmDumpMpst, DtCompileMpst, TemplateMpst, "Memory Power State Table"},
{ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"},
+ {ACPI_SIG_MSDM, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateMsdm, "Microsoft Data Management table"},
{ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr, "MID Timer Table"},
{ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct, "Platform Communications Channel Table"},
{ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt, "Platform Memory Topology Table"},
@@ -515,10 +509,20 @@ AcpiDmDumpDataTable (
}
else
{
- AcpiOsPrintf ("\n**** Unknown ACPI table type [%4.4s]\n\n",
+ AcpiOsPrintf ("\n**** Unknown ACPI table signature [%4.4s]\n\n",
Table->Signature);
- fprintf (stderr, "Unknown ACPI table signature [%4.4s], decoding header only\n",
+
+ fprintf (stderr, "Unknown ACPI table signature [%4.4s], ",
Table->Signature);
+
+ if (!AcpiGbl_ForceAmlDisassembly)
+ {
+ fprintf (stderr, "decoding ACPI table header only\n");
+ }
+ else
+ {
+ fprintf (stderr, "assuming table contains valid AML code\n");
+ }
}
}
else if (TableData->TableHandler)
@@ -686,6 +690,7 @@ AcpiDmDumpTable (
UINT32 ByteLength;
UINT8 Temp8;
UINT16 Temp16;
+ UINT32 Temp32;
UINT64 Value;
ACPI_DMTABLE_DATA *TableData;
const char *Name;
@@ -715,7 +720,8 @@ AcpiDmDumpTable (
if ((CurrentOffset >= TableLength) ||
(SubtableLength && (Info->Offset >= SubtableLength)))
{
- AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
+ AcpiOsPrintf (
+ "**** ACPI table terminates in the middle of a data structure! (dump table)\n");
return (AE_BAD_DATA);
}
@@ -760,7 +766,6 @@ AcpiDmDumpTable (
case ACPI_DMT_UINT32:
case ACPI_DMT_NAME4:
case ACPI_DMT_SIG:
- case ACPI_DMT_SLIC:
case ACPI_DMT_LPIT:
ByteLength = 4;
@@ -805,6 +810,12 @@ AcpiDmDumpTable (
ByteLength = 128;
break;
+ case ACPI_DMT_BUFFER:
+ case ACPI_DMT_RAW_BUFFER:
+
+ ByteLength = SubtableLength;
+ break;
+
case ACPI_DMT_STRING:
ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1;
@@ -838,7 +849,8 @@ AcpiDmDumpTable (
if (CurrentOffset + ByteLength > TableLength)
{
- AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
+ AcpiOsPrintf (
+ "**** ACPI table terminates in the middle of a data structure!\n");
return (AE_BAD_DATA);
}
@@ -1005,8 +1017,9 @@ AcpiDmDumpTable (
AcpiOsPrintf ("%2.2X", *Target);
Temp8 = AcpiDmGenerateChecksum (Table,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
+ ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
+ ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
+
if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum)
{
AcpiOsPrintf (
@@ -1032,7 +1045,7 @@ AcpiDmDumpTable (
Temp8 = ACPI_GAS_WIDTH_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, Temp8, AcpiDmGasAccessWidth[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGasAccessWidth[Temp8]);
break;
case ACPI_DMT_GAS:
@@ -1069,7 +1082,8 @@ AcpiDmDumpTable (
Temp16 = ACPI_DMAR_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
+ AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
+ AcpiDmDmarSubnames[Temp16]);
break;
case ACPI_DMT_DMAR_SCOPE:
@@ -1082,7 +1096,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmDmarScope[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmDmarScope[Temp8]);
break;
case ACPI_DMT_EINJACT:
@@ -1095,7 +1110,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_EINJ_ACTION_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjActions[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmEinjActions[Temp8]);
break;
case ACPI_DMT_EINJINST:
@@ -1108,7 +1124,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmEinjInstructions[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmEinjInstructions[Temp8]);
break;
case ACPI_DMT_ERSTACT:
@@ -1121,7 +1138,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_ERST_ACTION_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstActions[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmErstActions[Temp8]);
break;
case ACPI_DMT_ERSTINST:
@@ -1134,7 +1152,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_ERST_INSTRUCTION_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmErstInstructions[Temp8]);
break;
case ACPI_DMT_GTDT:
@@ -1147,7 +1166,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_GTDT_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGtdtSubnames[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmGtdtSubnames[Temp8]);
break;
case ACPI_DMT_HEST:
@@ -1160,12 +1180,15 @@ AcpiDmDumpTable (
Temp16 = ACPI_HEST_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmHestSubnames[Temp16]);
+ AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
+ AcpiDmHestSubnames[Temp16]);
break;
case ACPI_DMT_HESTNTFY:
- AcpiOsPrintf (STRING_FORMAT, "Hardware Error Notification Structure");
+ AcpiOsPrintf (STRING_FORMAT,
+ "Hardware Error Notification Structure");
+
AcpiDmDumpTable (TableLength, CurrentOffset, Target,
sizeof (ACPI_HEST_NOTIFY), AcpiDmTableInfoHestNotify);
AcpiOsPrintf ("\n");
@@ -1182,7 +1205,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_HEST_NOTIFY_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmHestNotifySubnames[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmHestNotifySubnames[Temp8]);
break;
case ACPI_DMT_MADT:
@@ -1195,7 +1219,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_MADT_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmMadtSubnames[Temp8]);
break;
case ACPI_DMT_PCCT:
@@ -1208,7 +1233,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_PCCT_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPcctSubnames[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmPcctSubnames[Temp8]);
break;
case ACPI_DMT_PMTT:
@@ -1221,20 +1247,20 @@ AcpiDmDumpTable (
Temp8 = ACPI_PMTT_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPmttSubnames[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmPmttSubnames[Temp8]);
break;
- case ACPI_DMT_SLIC:
-
- /* SLIC subtable types */
-
- Temp8 = *Target;
- if (Temp8 > ACPI_SLIC_TYPE_RESERVED)
- {
- Temp8 = ACPI_SLIC_TYPE_RESERVED;
- }
+ case ACPI_DMT_RAW_BUFFER:
+ /*
+ * Currently only used for SLIC table
+ */
+ AcpiOsPrintf ("/* Proprietary data structure */ ");
- AcpiOsPrintf (UINT32_FORMAT, *Target, AcpiDmSlicSubnames[Temp8]);
+ AcpiDmDumpBuffer (Table, sizeof (ACPI_TABLE_HEADER),
+ ByteLength, sizeof (ACPI_TABLE_HEADER),
+ "Licensing Data", TRUE);
+ AcpiOsPrintf ("\n");
break;
case ACPI_DMT_SRAT:
@@ -1247,7 +1273,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_SRAT_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmSratSubnames[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmSratSubnames[Temp8]);
break;
case ACPI_DMT_FADTPM:
@@ -1260,7 +1287,8 @@ AcpiDmDumpTable (
Temp8 = ACPI_FADT_PM_RESERVED;
}
- AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmFadtProfiles[Temp8]);
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmFadtProfiles[Temp8]);
break;
case ACPI_DMT_IVRS:
@@ -1295,26 +1323,14 @@ AcpiDmDumpTable (
/* LPIT subtable types */
- Temp8 = *Target;
- switch (Temp8)
+ Temp32 = ACPI_GET32 (Target);
+ if (Temp32 > ACPI_LPIT_TYPE_RESERVED)
{
- case ACPI_LPIT_TYPE_NATIVE_CSTATE:
-
- Name = AcpiDmLpitSubnames[0];
- break;
-
- case ACPI_LPIT_TYPE_SIMPLE_IO:
-
- Name = AcpiDmLpitSubnames[1];
- break;
-
- default:
-
- Name = AcpiDmLpitSubnames[2];
- break;
+ Temp32 = ACPI_LPIT_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT32_FORMAT, *Target, Name);
+ AcpiOsPrintf (UINT32_FORMAT, ACPI_GET32 (Target),
+ AcpiDmLpitSubnames[Temp32]);
break;
case ACPI_DMT_EXIT:
@@ -1331,8 +1347,10 @@ AcpiDmDumpTable (
if (TableOffset && !SubtableLength)
{
- /* If this table is not the main table, subtable must have valid length */
-
+ /*
+ * If this table is not the main table, the subtable must have a
+ * valid length
+ */
AcpiOsPrintf ("Invalid zero length subtable\n");
return (AE_BAD_DATA);
}
diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c
index 125e113e48a3..5ecb0ccc20a2 100644
--- a/source/common/dmtbdump.c
+++ b/source/common/dmtbdump.c
@@ -59,14 +59,6 @@ AcpiDmValidateFadtLength (
UINT32 Revision,
UINT32 Length);
-static void
-AcpiDmDumpBuffer (
- void *Table,
- UINT32 BufferOffset,
- UINT32 Length,
- UINT32 AbsoluteOffset,
- char *Header);
-
/*******************************************************************************
*
@@ -78,6 +70,7 @@ AcpiDmDumpBuffer (
* AbsoluteOffset - Offset of buffer in the main ACPI table
* Header - Name of the buffer field (printed on the
* first line only.)
+ * MultiLine - TRUE if a large, multi-line buffer
*
* RETURN: None
*
@@ -86,13 +79,14 @@ AcpiDmDumpBuffer (
*
******************************************************************************/
-static void
+void
AcpiDmDumpBuffer (
void *Table,
UINT32 BufferOffset,
UINT32 Length,
UINT32 AbsoluteOffset,
- char *Header)
+ char *Header,
+ BOOLEAN MultiLine)
{
UINT8 *Buffer;
UINT32 i;
@@ -110,10 +104,19 @@ AcpiDmDumpBuffer (
{
if (!(i % 16))
{
- AcpiOsPrintf ("\n");
- AcpiDmLineHeader (AbsoluteOffset,
- ((Length - i) > 16) ? 16 : (Length - i), Header);
- Header = NULL;
+ if (MultiLine)
+ {
+ /* Insert a backslash - line continuation character */
+
+ AcpiOsPrintf ("\\\n ");
+ }
+ else
+ {
+ AcpiOsPrintf ("\n");
+ AcpiDmLineHeader (AbsoluteOffset,
+ ((Length - i) > 16) ? 16 : (Length - i), Header);
+ Header = NULL;
+ }
}
AcpiOsPrintf ("%.02X ", *Buffer);
@@ -526,7 +529,7 @@ AcpiDmDumpAsf (
DataOffset++;
if (DataOffset > Table->Length)
{
- AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure!\n");
+ AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure! (ASF! table)\n");
return;
}
}
@@ -692,7 +695,7 @@ AcpiDmDumpCsrt (
InfoLength = SubSubTable->Length - SubSubOffset;
AcpiDmDumpBuffer (SubSubTable, SubSubOffset, InfoLength,
- Offset + SubOffset + SubSubOffset, "ResourceInfo");
+ Offset + SubOffset + SubSubOffset, "ResourceInfo", FALSE);
SubSubOffset += InfoLength;
/* Point to next sub-subtable */
@@ -812,7 +815,7 @@ AcpiDmDumpDbg2 (
if (SubTable->OemDataOffset)
{
AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
- Offset + SubTable->OemDataOffset, "OEM Data");
+ Offset + SubTable->OemDataOffset, "OEM Data", FALSE);
}
/* Point to next subtable */
@@ -2535,67 +2538,8 @@ void
AcpiDmDumpSlic (
ACPI_TABLE_HEADER *Table)
{
- ACPI_STATUS Status;
- UINT32 Offset = sizeof (ACPI_TABLE_SLIC);
- ACPI_SLIC_HEADER *SubTable;
- ACPI_DMTABLE_INFO *InfoTable;
-
-
- /* There is no main SLIC table, only subtables */
-
- SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, Table, Offset);
- while (Offset < Table->Length)
- {
- /* Common subtable header */
-
- AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- SubTable->Length, AcpiDmTableInfoSlicHdr);
- if (ACPI_FAILURE (Status))
- {
- return;
- }
-
- switch (SubTable->Type)
- {
- case ACPI_SLIC_TYPE_PUBLIC_KEY:
-
- InfoTable = AcpiDmTableInfoSlic0;
- break;
-
- case ACPI_SLIC_TYPE_WINDOWS_MARKER:
-
- InfoTable = AcpiDmTableInfoSlic1;
- break;
-
- default:
-
- AcpiOsPrintf ("\n**** Unknown SLIC subtable type 0x%X\n", SubTable->Type);
-
- /* Attempt to continue */
-
- if (!SubTable->Length)
- {
- AcpiOsPrintf ("Invalid zero length subtable\n");
- return;
- }
- goto NextSubTable;
- }
-
- AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
- SubTable->Length, InfoTable);
- if (ACPI_FAILURE (Status))
- {
- return;
- }
-
-NextSubTable:
- /* Point to next subtable */
-
- Offset += SubTable->Length;
- SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, SubTable, SubTable->Length);
- }
+ AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
+ Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
}
diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c
index 3c00a9a9da09..7377ed1c2f5d 100644
--- a/source/common/dmtbinfo.c
+++ b/source/common/dmtbinfo.c
@@ -200,9 +200,7 @@
#define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_HEADER,f)
#define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f)
#define ACPI_S3PT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f)
-#define ACPI_SLICH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_HEADER,f)
-#define ACPI_SLIC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_KEY,f)
-#define ACPI_SLIC1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_MARKER,f)
+#define ACPI_SLIC_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIC,f)
#define ACPI_SRATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
@@ -2043,42 +2041,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[] =
/*******************************************************************************
*
- * SLIC - Software Licensing Description Table. There is no common table, just
- * the standard ACPI header and then subtables.
+ * SLIC - Software Licensing Description Table. This table contains the standard
+ * ACPI header followed by proprietary data structures
*
******************************************************************************/
-/* Common Subtable header (one per Subtable) */
-
-ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[] =
-{
- {ACPI_DMT_SLIC, ACPI_SLICH_OFFSET (Type), "Subtable Type", 0},
- {ACPI_DMT_UINT32, ACPI_SLICH_OFFSET (Length), "Length", DT_LENGTH},
- ACPI_DMT_TERMINATOR
-};
-
-ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[] =
-{
- {ACPI_DMT_UINT8, ACPI_SLIC0_OFFSET (KeyType), "Key Type", 0},
- {ACPI_DMT_UINT8, ACPI_SLIC0_OFFSET (Version), "Version", 0},
- {ACPI_DMT_UINT16, ACPI_SLIC0_OFFSET (Reserved), "Reserved", 0},
- {ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (Algorithm), "Algorithm", 0},
- {ACPI_DMT_NAME4, ACPI_SLIC0_OFFSET (Magic), "Magic", 0},
- {ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (BitLength), "BitLength", 0},
- {ACPI_DMT_UINT32, ACPI_SLIC0_OFFSET (Exponent), "Exponent", 0},
- {ACPI_DMT_BUF128, ACPI_SLIC0_OFFSET (Modulus[0]), "Modulus", 0},
- ACPI_DMT_TERMINATOR
-};
+/* Single subtable, a proprietary format, so treat it as a buffer */
-ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[] =
+ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[] =
{
- {ACPI_DMT_UINT32, ACPI_SLIC1_OFFSET (Version), "Version", 0},
- {ACPI_DMT_NAME6, ACPI_SLIC1_OFFSET (OemId[0]), "Oem ID", 0},
- {ACPI_DMT_NAME8, ACPI_SLIC1_OFFSET (OemTableId[0]), "Oem Table ID", 0},
- {ACPI_DMT_NAME8, ACPI_SLIC1_OFFSET (WindowsFlag[0]), "Windows Flag", 0},
- {ACPI_DMT_UINT32, ACPI_SLIC1_OFFSET (SlicVersion), "SLIC Version", 0},
- {ACPI_DMT_BUF16, ACPI_SLIC1_OFFSET (Reserved[0]), "Reserved", 0},
- {ACPI_DMT_BUF128, ACPI_SLIC1_OFFSET (Signature[0]), "Signature", 0},
+ {ACPI_DMT_RAW_BUFFER, 0, "Software Licensing Structure", 0},
ACPI_DMT_TERMINATOR
};
@@ -2091,7 +2063,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[] =
{
- {ACPI_DMT_UINT64, ACPI_SLIT_OFFSET (LocalityCount), "Localities", 0},
+ {ACPI_DMT_UINT64, ACPI_SLIT_OFFSET (LocalityCount), "Localities", 0},
ACPI_DMT_TERMINATOR
};
diff --git a/source/compiler/aslcodegen.c b/source/compiler/aslcodegen.c
index 5bb79c8f9aef..38bf9cf237f6 100644
--- a/source/compiler/aslcodegen.c
+++ b/source/compiler/aslcodegen.c
@@ -460,7 +460,7 @@ CgWriteTableHeader (
/* Compiler version */
- TableHeader.AslCompilerRevision = ASL_REVISION;
+ TableHeader.AslCompilerRevision = ACPI_CA_VERSION;
/* Table length. Checksum zero for now, will rewrite later */
diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c
index 47ef107e1943..47f92b44e4df 100644
--- a/source/compiler/aslcompile.c
+++ b/source/compiler/aslcompile.c
@@ -195,8 +195,16 @@ CmDoCompile (
Event = UtBeginEvent ("Constant folding via AML interpreter");
DbgPrint (ASL_DEBUG_OUTPUT,
"\nInterpreting compile-time constant expressions\n\n");
- TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
- OpcAmlConstantWalk, NULL, NULL);
+
+ if (Gbl_FoldConstants)
+ {
+ TrWalkParseTree (RootNode, ASL_WALK_VISIT_DOWNWARD,
+ OpcAmlConstantWalk, NULL, NULL);
+ }
+ else
+ {
+ DbgPrint (ASL_PARSE_OUTPUT, " Optional folding disabled\n");
+ }
UtEndEvent (Event);
/* Update AML opcodes if necessary, after constant folding */
diff --git a/source/compiler/aslcompiler.h b/source/compiler/aslcompiler.h
index 38b2f23e9a7b..898d651b4ab8 100644
--- a/source/compiler/aslcompiler.h
+++ b/source/compiler/aslcompiler.h
@@ -686,6 +686,10 @@ TrAllocateNode (
UINT32 ParseOpcode);
void
+TrPrintNodeCompileFlags (
+ UINT32 Flags);
+
+void
TrReleaseNode (
ACPI_PARSE_OBJECT *Op);
@@ -705,6 +709,10 @@ TrCreateLeafNode (
UINT32 ParseOpcode);
ACPI_PARSE_OBJECT *
+TrCreateNullTarget (
+ void);
+
+ACPI_PARSE_OBJECT *
TrCreateAssignmentNode (
ACPI_PARSE_OBJECT *Target,
ACPI_PARSE_OBJECT *Source);
diff --git a/source/compiler/asldefine.h b/source/compiler/asldefine.h
index f639eccf6129..14307c1bfb23 100644
--- a/source/compiler/asldefine.h
+++ b/source/compiler/asldefine.h
@@ -48,7 +48,6 @@
/*
* Compiler versions and names
*/
-#define ASL_REVISION ACPI_CA_VERSION
#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler"
#define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler"
#define ASL_INVOCATION_NAME "iasl"
diff --git a/source/compiler/aslfold.c b/source/compiler/aslfold.c
index d1020bcac6ba..8c11860e6813 100644
--- a/source/compiler/aslfold.c
+++ b/source/compiler/aslfold.c
@@ -76,97 +76,125 @@ OpcUpdateIntegerNode (
ACPI_PARSE_OBJECT *Op,
UINT64 Value);
+static ACPI_STATUS
+TrTransformToStoreOp (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_WALK_STATE *WalkState);
+
+static ACPI_STATUS
+TrSimpleConstantReduction (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_WALK_STATE *WalkState);
+
+static void
+TrInstallReducedConstant (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_OPERAND_OBJECT *ObjDesc);
+
/*******************************************************************************
*
- * FUNCTION: OpcAmlEvaluationWalk1
+ * FUNCTION: OpcAmlConstantWalk
*
* PARAMETERS: ASL_WALK_CALLBACK
*
* RETURN: Status
*
- * DESCRIPTION: Descending callback for AML execution of constant subtrees
+ * DESCRIPTION: Reduce an Op and its subtree to a constant if possible
*
******************************************************************************/
-static ACPI_STATUS
-OpcAmlEvaluationWalk1 (
+ACPI_STATUS
+OpcAmlConstantWalk (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context)
{
- ACPI_WALK_STATE *WalkState = Context;
- ACPI_STATUS Status;
- ACPI_PARSE_OBJECT *OutOp;
+ ACPI_WALK_STATE *WalkState;
+ ACPI_STATUS Status = AE_OK;
- WalkState->Op = Op;
- WalkState->Opcode = Op->Common.AmlOpcode;
- WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
-
- /* Copy child pointer to Arg for compatibility with Interpreter */
+ if (Op->Asl.CompileFlags == 0)
+ {
+ return (AE_OK);
+ }
- if (Op->Asl.Child)
+ /*
+ * Only interested in subtrees that could possibly contain
+ * expressions that can be evaluated at this time
+ */
+ if ((!(Op->Asl.CompileFlags & NODE_COMPILE_TIME_CONST)) ||
+ (Op->Asl.CompileFlags & NODE_IS_TARGET))
{
- Op->Common.Value.Arg = Op->Asl.Child;
+ return (AE_OK);
}
- /* Call AML dispatcher */
+ /* Create a new walk state */
- Status = AcpiDsExecBeginOp (WalkState, &OutOp);
- if (ACPI_FAILURE (Status))
+ WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
+ if (!WalkState)
{
- AcpiOsPrintf ("Constant interpretation failed - %s\n",
- AcpiFormatException (Status));
+ return (AE_NO_MEMORY);
}
- return (Status);
-}
+ WalkState->NextOp = NULL;
+ WalkState->Params = NULL;
+ /*
+ * Examine the entire subtree -- all nodes must be constants
+ * or type 3/4/5 opcodes
+ */
+ Status = TrWalkParseTree (Op, ASL_WALK_VISIT_DOWNWARD,
+ OpcAmlCheckForConstant, NULL, WalkState);
-/*******************************************************************************
- *
- * FUNCTION: OpcAmlEvaluationWalk2
- *
- * PARAMETERS: ASL_WALK_CALLBACK
- *
- * RETURN: Status
- *
- * DESCRIPTION: Ascending callback for AML execution of constant subtrees
- *
- ******************************************************************************/
+ /*
+ * Did we find an entire subtree that contains all constants
+ * and type 3/4/5 opcodes?
+ */
+ switch (Status)
+ {
+ case AE_OK:
-static ACPI_STATUS
-OpcAmlEvaluationWalk2 (
- ACPI_PARSE_OBJECT *Op,
- UINT32 Level,
- void *Context)
-{
- ACPI_WALK_STATE *WalkState = Context;
- ACPI_STATUS Status;
+ /* Simple case, like Add(3,4) -> 7 */
+ Status = TrSimpleConstantReduction (Op, WalkState);
+ break;
- WalkState->Op = Op;
- WalkState->Opcode = Op->Common.AmlOpcode;
- WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
+ case AE_CTRL_RETURN_VALUE:
- /* Copy child pointer to Arg for compatibility with Interpreter */
+ /* More complex case, like Add(3,4,Local0) -> Store(7,Local0) */
- if (Op->Asl.Child)
- {
- Op->Common.Value.Arg = Op->Asl.Child;
- }
+ Status = TrTransformToStoreOp (Op, WalkState);
+ break;
- /* Call AML dispatcher */
+ case AE_TYPE:
+
+ AcpiDsDeleteWalkState (WalkState);
+ return (AE_OK);
+
+ default:
+ AcpiDsDeleteWalkState (WalkState);
+ break;
+ }
- Status = AcpiDsExecEndOp (WalkState);
if (ACPI_FAILURE (Status))
{
- AcpiOsPrintf ("Constant interpretation failed - %s\n",
- AcpiFormatException (Status));
+ DbgPrint (ASL_PARSE_OUTPUT, "Cannot resolve, %s\n",
+ AcpiFormatException (Status));
+
+ /* We could not resolve the subtree for some reason */
+
+ AslError (ASL_ERROR, ASL_MSG_CONSTANT_EVALUATION, Op,
+ (char *) AcpiFormatException (Status));
+
+ /* Set the subtree value to ZERO anyway. Eliminates further errors */
+
+ OpcUpdateIntegerNode (Op, 0);
}
- return (Status);
+ /* Abort the walk of this subtree, we are done with it */
+
+ return (AE_CTRL_DEPTH);
}
@@ -189,6 +217,7 @@ OpcAmlCheckForConstant (
void *Context)
{
ACPI_WALK_STATE *WalkState = Context;
+ ACPI_STATUS Status = AE_OK;
WalkState->Op = Op;
@@ -196,7 +225,20 @@ OpcAmlCheckForConstant (
WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
DbgPrint (ASL_PARSE_OUTPUT, "[%.4d] Opcode: %12.12s ",
- Op->Asl.LogicalLineNumber, Op->Asl.ParseOpName);
+ Op->Asl.LogicalLineNumber, Op->Asl.ParseOpName);
+
+ /*
+ * TBD: Ignore buffer constants for now. The problem is that these
+ * constants have been transformed into RAW_DATA at this point, from
+ * the parse tree transform process which currently happens before
+ * the constant folding process. We may need to defer this transform
+ * for buffer until after the constant folding.
+ */
+ if (WalkState->Opcode == AML_BUFFER_OP)
+ {
+ Status = AE_TYPE;
+ goto CleanupAndExit;
+ }
/*
* These opcodes do not appear in the OpcodeInfo table, but
@@ -207,50 +249,32 @@ OpcAmlCheckForConstant (
(WalkState->Opcode == AML_RAW_DATA_DWORD) ||
(WalkState->Opcode == AML_RAW_DATA_QWORD))
{
- WalkState->WalkType = ACPI_WALK_CONST_OPTIONAL;
- return (AE_TYPE);
+ DbgPrint (ASL_PARSE_OUTPUT, "RAW DATA");
+ Status = AE_TYPE;
+ goto CleanupAndExit;
}
+ /* Type 3/4/5 opcodes have the AML_CONSTANT flag set */
+
if (!(WalkState->OpInfo->Flags & AML_CONSTANT))
{
- /* The opcode is not a Type 3/4/5 opcode */
+ /* Not 3/4/5 opcode, but maybe can convert to STORE */
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
DbgPrint (ASL_PARSE_OUTPUT,
- "**** Valid Target, cannot reduce ****\n");
- }
- else
- {
- DbgPrint (ASL_PARSE_OUTPUT,
- "**** Not a Type 3/4/5 opcode ****\n");
+ "**** Valid Target, transform to Store ****\n");
+ return (AE_CTRL_RETURN_VALUE);
}
- if (WalkState->WalkType == ACPI_WALK_CONST_OPTIONAL)
- {
- /*
- * We are looking at at normal expression to see if it can be
- * reduced. It can't. No error
- */
- return (AE_TYPE);
- }
+ /* Expression cannot be reduced */
- /*
- * This is an expression that MUST reduce to a constant, and it
- * can't be reduced. This is an error
- */
- if (Op->Asl.CompileFlags & NODE_IS_TARGET)
- {
- AslError (ASL_ERROR, ASL_MSG_INVALID_TARGET, Op,
- Op->Asl.ParseOpName);
- }
- else
- {
- AslError (ASL_ERROR, ASL_MSG_INVALID_CONSTANT_OP, Op,
- Op->Asl.ParseOpName);
- }
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "**** Not a Type 3/4/5 opcode (%s) ****",
+ Op->Asl.ParseOpName);
- return (AE_TYPE);
+ Status = AE_TYPE;
+ goto CleanupAndExit;
}
/* Debug output */
@@ -259,250 +283,346 @@ OpcAmlCheckForConstant (
if (Op->Asl.CompileFlags & NODE_IS_TARGET)
{
- DbgPrint (ASL_PARSE_OUTPUT, " TARGET");
+ if (Op->Asl.ParseOpcode == PARSEOP_ZERO)
+ {
+ DbgPrint (ASL_PARSE_OUTPUT, "%-16s", " NULL TARGET");
+ }
+ else
+ {
+ DbgPrint (ASL_PARSE_OUTPUT, "%-16s", " VALID TARGET");
+ }
}
if (Op->Asl.CompileFlags & NODE_IS_TERM_ARG)
{
- DbgPrint (ASL_PARSE_OUTPUT, " TERMARG");
+ DbgPrint (ASL_PARSE_OUTPUT, "%-16s", " TERMARG");
}
+CleanupAndExit:
+
+ /* Dump the node compile flags also */
+
+ TrPrintNodeCompileFlags (Op->Asl.CompileFlags);
DbgPrint (ASL_PARSE_OUTPUT, "\n");
- return (AE_OK);
+ return (Status);
}
/*******************************************************************************
*
- * FUNCTION: OpcAmlConstantWalk
+ * FUNCTION: TrSimpleConstantReduction
*
- * PARAMETERS: ASL_WALK_CALLBACK
+ * PARAMETERS: Op - Parent operator to be transformed
+ * WalkState - Current walk state
*
* RETURN: Status
*
- * DESCRIPTION: Reduce an Op and its subtree to a constant if possible
+ * DESCRIPTION: Reduce an entire AML operation to a single constant. The
+ * operation must not have a target operand.
+ *
+ * Add (32,64) --> 96
*
******************************************************************************/
-ACPI_STATUS
-OpcAmlConstantWalk (
+static ACPI_STATUS
+TrSimpleConstantReduction (
ACPI_PARSE_OBJECT *Op,
- UINT32 Level,
- void *Context)
+ ACPI_WALK_STATE *WalkState)
{
- ACPI_WALK_STATE *WalkState;
- ACPI_STATUS Status = AE_OK;
- ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_PARSE_OBJECT *RootOp;
ACPI_PARSE_OBJECT *OriginalParentOp;
- UINT8 WalkType;
+ ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_STATUS Status;
- /*
- * Only interested in subtrees that could possibly contain
- * expressions that can be evaluated at this time
- */
- if ((!(Op->Asl.CompileFlags & NODE_COMPILE_TIME_CONST)) ||
- (Op->Asl.CompileFlags & NODE_IS_TARGET))
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "Simple subtree constant reduction, operator to constant\n");
+
+ /* Allocate a new temporary root for this subtree */
+
+ RootOp = TrAllocateNode (PARSEOP_INTEGER);
+ if (!RootOp)
{
- return (AE_OK);
+ return (AE_NO_MEMORY);
}
- /* Set the walk type based on the reduction used for this op */
+ RootOp->Common.AmlOpcode = AML_INT_EVAL_SUBTREE_OP;
- if (Op->Asl.CompileFlags & NODE_IS_TERM_ARG)
- {
- /* Op is a TermArg, constant folding is merely optional */
+ OriginalParentOp = Op->Common.Parent;
+ Op->Common.Parent = RootOp;
- if (!Gbl_FoldConstants)
- {
- return (AE_CTRL_DEPTH);
- }
+ /* Hand off the subtree to the AML interpreter */
- WalkType = ACPI_WALK_CONST_OPTIONAL;
- }
- else
- {
- /* Op is a DataObject, the expression MUST reduced to a constant */
+ WalkState->CallerReturnDesc = &ObjDesc;
+
+ Status = TrWalkParseTree (Op, ASL_WALK_VISIT_TWICE,
+ OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
+
+ /* Restore original parse tree */
+
+ Op->Common.Parent = OriginalParentOp;
- WalkType = ACPI_WALK_CONST_REQUIRED;
+ if (ACPI_FAILURE (Status))
+ {
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "Constant Subtree evaluation(1), %s\n",
+ AcpiFormatException (Status));
+ return (Status);
}
- /* Create a new walk state */
+ /* Get the final result */
- WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
- if (!WalkState)
+ Status = AcpiDsResultPop (&ObjDesc, WalkState);
+ if (ACPI_FAILURE (Status))
{
- return (AE_NO_MEMORY);
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "Constant Subtree evaluation(2), %s\n",
+ AcpiFormatException (Status));
+ return (Status);
}
- WalkState->NextOp = NULL;
- WalkState->Params = NULL;
- WalkState->WalkType = WalkType;
- WalkState->CallerReturnDesc = &ObjDesc;
+ TrInstallReducedConstant (Op, ObjDesc);
- /*
- * Examine the entire subtree -- all nodes must be constants
- * or type 3/4/5 opcodes
- */
- Status = TrWalkParseTree (Op, ASL_WALK_VISIT_DOWNWARD,
- OpcAmlCheckForConstant, NULL, WalkState);
+ UtSetParseOpName (Op);
+ Op->Asl.Child = NULL;
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrTransformToStoreOp
+ *
+ * PARAMETERS: Op - Parent operator to be transformed
+ * WalkState - Current walk state
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Transforms a single AML operation with a constant and target
+ * to a simple store operation:
+ *
+ * Add (32,64,DATA) --> Store (96,DATA)
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+TrTransformToStoreOp (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_WALK_STATE *WalkState)
+{
+ ACPI_PARSE_OBJECT *OriginalTarget;
+ ACPI_PARSE_OBJECT *NewTarget;
+ ACPI_PARSE_OBJECT *Child1;
+ ACPI_PARSE_OBJECT *Child2;
+ ACPI_OPERAND_OBJECT *ObjDesc;
+ ACPI_PARSE_OBJECT *NewParent;
+ ACPI_PARSE_OBJECT *OriginalParent;
+ ACPI_STATUS Status;
+
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "Reduction/Transform to StoreOp: Store(Constant, Target)\n");
+
+ /* Extract the operands */
+
+ Child1 = Op->Asl.Child;
+ Child2 = Child1->Asl.Next;
/*
- * Did we find an entire subtree that contains all constants and type 3/4/5
- * opcodes? (Only AE_OK or AE_TYPE returned from above)
+ * Special case for DIVIDE -- it has two targets. The first
+ * is for the remainder and if present, we will not attempt
+ * to reduce the expression.
*/
- if (Status == AE_TYPE)
+ if (Op->Asl.ParseOpcode == PARSEOP_DIVIDE)
{
- /* Subtree cannot be reduced to a constant */
-
- if (WalkState->WalkType == ACPI_WALK_CONST_OPTIONAL)
+ Child2 = Child2->Asl.Next;
+ if (Child2->Asl.ParseOpcode != PARSEOP_ZERO)
{
- AcpiDsDeleteWalkState (WalkState);
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "Cannot reduce DIVIDE - has two targets\n\n");
return (AE_OK);
}
+ }
+
+ /*
+ * Create a NULL (zero) target so that we can use the
+ * interpreter to evaluate the expression.
+ */
+ NewTarget = TrCreateNullTarget ();
+ NewTarget->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
- /* Don't descend any further, and use a default "constant" value */
+ /* Handle one-operand cases (NOT, TOBCD, etc.) */
- Status = AE_CTRL_DEPTH;
+ if (!Child2->Asl.Next)
+ {
+ Child2 = Child1;
}
- else
+
+ /* Link in new NULL target as the last operand */
+
+ OriginalTarget = Child2->Asl.Next;
+ Child2->Asl.Next = NewTarget;
+ NewTarget->Asl.Parent = OriginalTarget->Asl.Parent;
+
+ NewParent = TrAllocateNode (PARSEOP_INTEGER);
+ NewParent->Common.AmlOpcode = AML_INT_EVAL_SUBTREE_OP;
+
+ OriginalParent = Op->Common.Parent;
+ Op->Common.Parent = NewParent;
+
+ /* Hand off the subtree to the AML interpreter */
+
+ WalkState->CallerReturnDesc = &ObjDesc;
+
+ Status = TrWalkParseTree (Op, ASL_WALK_VISIT_TWICE,
+ OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
+ if (ACPI_FAILURE (Status))
{
- /* Subtree can be reduced */
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "Constant Subtree evaluation(3), %s\n",
+ AcpiFormatException (Status));
+ goto EvalError;
+ }
- /* Allocate a new temporary root for this subtree */
+ /* Get the final result */
- RootOp = TrAllocateNode (PARSEOP_INTEGER);
- if (!RootOp)
- {
- return (AE_NO_MEMORY);
- }
+ Status = AcpiDsResultPop (&ObjDesc, WalkState);
+ if (ACPI_FAILURE (Status))
+ {
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "Constant Subtree evaluation(4), %s\n",
+ AcpiFormatException (Status));
+ goto EvalError;
+ }
- RootOp->Common.AmlOpcode = AML_INT_EVAL_SUBTREE_OP;
+ /* Folded constant is in ObjDesc, store into Child1 */
- OriginalParentOp = Op->Common.Parent;
- Op->Common.Parent = RootOp;
+ TrInstallReducedConstant (Child1, ObjDesc);
- /* Hand off the subtree to the AML interpreter */
+ /* Convert operator to STORE */
- Status = TrWalkParseTree (Op, ASL_WALK_VISIT_TWICE,
- OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
- Op->Common.Parent = OriginalParentOp;
+ Op->Asl.ParseOpcode = PARSEOP_STORE;
+ Op->Asl.AmlOpcode = AML_STORE_OP;
+ UtSetParseOpName (Op);
+ Op->Common.Parent = OriginalParent;
- /* TBD: we really *should* release the RootOp node */
+ /* Truncate any subtree expressions, they have been evaluated */
- if (ACPI_SUCCESS (Status))
- {
- TotalFolds++;
+ Child1->Asl.Child = NULL;
+ Child2->Asl.Child = NULL;
- /* Get the final result */
+ /* First child is the folded constant */
- Status = AcpiDsResultPop (&ObjDesc, WalkState);
- }
+ /* Second child will be the target */
- /* Check for error from the ACPICA core */
+ Child1->Asl.Next = OriginalTarget;
+ return (AE_OK);
- if (ACPI_FAILURE (Status))
- {
- AslCoreSubsystemError (Op, Status,
- "Failure during constant evaluation", FALSE);
- }
- }
- if (ACPI_FAILURE (Status))
- {
- /* We could not resolve the subtree for some reason */
+EvalError:
- AslError (ASL_ERROR, ASL_MSG_CONSTANT_EVALUATION, Op,
- Op->Asl.ParseOpName);
+ /* Restore original links */
- /* Set the subtree value to ZERO anyway. Eliminates further errors */
+ Op->Common.Parent = OriginalParent;
+ Child2->Asl.Next = OriginalTarget;
+ return (Status);
+}
- OpcUpdateIntegerNode (Op, 0);
- }
- else
- {
- AslError (ASL_OPTIMIZATION, ASL_MSG_CONSTANT_FOLDED, Op,
- Op->Asl.ParseOpName);
-
- /*
- * Because we know we executed type 3/4/5 opcodes above, we know that
- * the result must be either an Integer, String, or Buffer.
- */
- switch (ObjDesc->Common.Type)
- {
- case ACPI_TYPE_INTEGER:
- OpcUpdateIntegerNode (Op, ObjDesc->Integer.Value);
+/*******************************************************************************
+ *
+ * FUNCTION: TrInstallReducedConstant
+ *
+ * PARAMETERS: Op - Parent operator to be transformed
+ * ObjDesc - Reduced constant to be installed
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Transform the original operator to a simple constant.
+ * Handles Integers, Strings, and Buffers.
+ *
+ ******************************************************************************/
+
+static void
+TrInstallReducedConstant (
+ ACPI_PARSE_OBJECT *Op,
+ ACPI_OPERAND_OBJECT *ObjDesc)
+{
+ ACPI_PARSE_OBJECT *RootOp;
- DbgPrint (ASL_PARSE_OUTPUT,
- "Constant expression reduced to (%s) %8.8X%8.8X\n",
- Op->Asl.ParseOpName,
- ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
- break;
- case ACPI_TYPE_STRING:
+ TotalFolds++;
+ AslError (ASL_OPTIMIZATION, ASL_MSG_CONSTANT_FOLDED, Op,
+ Op->Asl.ParseOpName);
- Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
- Op->Common.AmlOpcode = AML_STRING_OP;
- Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
- Op->Common.Value.String = ObjDesc->String.Pointer;
+ /*
+ * Because we know we executed type 3/4/5 opcodes above, we know that
+ * the result must be either an Integer, String, or Buffer.
+ */
+ switch (ObjDesc->Common.Type)
+ {
+ case ACPI_TYPE_INTEGER:
- DbgPrint (ASL_PARSE_OUTPUT,
- "Constant expression reduced to (STRING) %s\n",
- Op->Common.Value.String);
+ OpcUpdateIntegerNode (Op, ObjDesc->Integer.Value);
- break;
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "Constant expression reduced to (%s) %8.8X%8.8X\n\n",
+ Op->Asl.ParseOpName,
+ ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
+ break;
- case ACPI_TYPE_BUFFER:
+ case ACPI_TYPE_STRING:
- Op->Asl.ParseOpcode = PARSEOP_BUFFER;
- Op->Common.AmlOpcode = AML_BUFFER_OP;
- Op->Asl.CompileFlags = NODE_AML_PACKAGE;
- UtSetParseOpName (Op);
+ Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
+ Op->Common.AmlOpcode = AML_STRING_OP;
+ Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
+ Op->Common.Value.String = ObjDesc->String.Pointer;
- /* Child node is the buffer length */
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "Constant expression reduced to (STRING) %s\n\n",
+ Op->Common.Value.String);
- RootOp = TrAllocateNode (PARSEOP_INTEGER);
+ break;
- RootOp->Asl.AmlOpcode = AML_DWORD_OP;
- RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length;
- RootOp->Asl.Parent = Op;
+ case ACPI_TYPE_BUFFER:
- (void) OpcSetOptimalIntegerSize (RootOp);
+ Op->Asl.ParseOpcode = PARSEOP_BUFFER;
+ Op->Common.AmlOpcode = AML_BUFFER_OP;
+ Op->Asl.CompileFlags = NODE_AML_PACKAGE;
+ UtSetParseOpName (Op);
- Op->Asl.Child = RootOp;
- Op = RootOp;
- UtSetParseOpName (Op);
+ /* Child node is the buffer length */
- /* Peer to the child is the raw buffer data */
+ RootOp = TrAllocateNode (PARSEOP_INTEGER);
- RootOp = TrAllocateNode (PARSEOP_RAW_DATA);
- RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
- RootOp->Asl.AmlLength = ObjDesc->Buffer.Length;
- RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
- RootOp->Asl.Parent = Op->Asl.Parent;
+ RootOp->Asl.AmlOpcode = AML_DWORD_OP;
+ RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length;
+ RootOp->Asl.Parent = Op;
- Op->Asl.Next = RootOp;
- Op = RootOp;
+ (void) OpcSetOptimalIntegerSize (RootOp);
- DbgPrint (ASL_PARSE_OUTPUT,
- "Constant expression reduced to (BUFFER) length %X\n",
- ObjDesc->Buffer.Length);
- break;
+ Op->Asl.Child = RootOp;
+ Op = RootOp;
+ UtSetParseOpName (Op);
- default:
+ /* Peer to the child is the raw buffer data */
- printf ("Unsupported return type: %s\n",
- AcpiUtGetObjectTypeName (ObjDesc));
- break;
- }
- }
+ RootOp = TrAllocateNode (PARSEOP_RAW_DATA);
+ RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER;
+ RootOp->Asl.AmlLength = ObjDesc->Buffer.Length;
+ RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer;
+ RootOp->Asl.Parent = Op->Asl.Parent;
- UtSetParseOpName (Op);
- Op->Asl.Child = NULL;
+ Op->Asl.Next = RootOp;
+ Op = RootOp;
- AcpiDsDeleteWalkState (WalkState);
- return (AE_CTRL_DEPTH);
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "Constant expression reduced to (BUFFER) length %X\n\n",
+ ObjDesc->Buffer.Length);
+ break;
+
+ default:
+ break;
+ }
}
@@ -511,10 +631,11 @@ OpcAmlConstantWalk (
* FUNCTION: OpcUpdateIntegerNode
*
* PARAMETERS: Op - Current parse object
+ * Value - Value for the integer op
*
* RETURN: None
*
- * DESCRIPTION: Update node to the correct integer type.
+ * DESCRIPTION: Update node to the correct Integer type and value
*
******************************************************************************/
@@ -566,3 +687,98 @@ OpcUpdateIntegerNode (
Op->Asl.AmlLength = 0;
}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: OpcAmlEvaluationWalk1
+ *
+ * PARAMETERS: ASL_WALK_CALLBACK
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Descending callback for AML execution of constant subtrees
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+OpcAmlEvaluationWalk1 (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Level,
+ void *Context)
+{
+ ACPI_WALK_STATE *WalkState = Context;
+ ACPI_STATUS Status;
+ ACPI_PARSE_OBJECT *OutOp;
+
+
+ WalkState->Op = Op;
+ WalkState->Opcode = Op->Common.AmlOpcode;
+ WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
+
+ /* Copy child pointer to Arg for compatibility with Interpreter */
+
+ if (Op->Asl.Child)
+ {
+ Op->Common.Value.Arg = Op->Asl.Child;
+ }
+
+ /* Call AML dispatcher */
+
+ Status = AcpiDsExecBeginOp (WalkState, &OutOp);
+ if (ACPI_FAILURE (Status))
+ {
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "%s Constant interpretation failed (1) - %s\n",
+ Op->Asl.ParseOpName, AcpiFormatException (Status));
+ }
+
+ return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: OpcAmlEvaluationWalk2
+ *
+ * PARAMETERS: ASL_WALK_CALLBACK
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Ascending callback for AML execution of constant subtrees
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+OpcAmlEvaluationWalk2 (
+ ACPI_PARSE_OBJECT *Op,
+ UINT32 Level,
+ void *Context)
+{
+ ACPI_WALK_STATE *WalkState = Context;
+ ACPI_STATUS Status;
+
+
+ WalkState->Op = Op;
+ WalkState->Opcode = Op->Common.AmlOpcode;
+ WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
+
+ /* Copy child pointer to Arg for compatibility with Interpreter */
+
+ if (Op->Asl.Child)
+ {
+ Op->Common.Value.Arg = Op->Asl.Child;
+ }
+
+ /* Call AML dispatcher */
+
+ Status = AcpiDsExecEndOp (WalkState);
+ if (ACPI_FAILURE (Status))
+ {
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "%s: Constant interpretation failed (2) - %s\n",
+ Op->Asl.ParseOpName, AcpiFormatException (Status));
+ }
+
+ return (Status);
+}
diff --git a/source/compiler/asllisting.c b/source/compiler/asllisting.c
index 8e107507a2c1..34277459844e 100644
--- a/source/compiler/asllisting.c
+++ b/source/compiler/asllisting.c
@@ -270,7 +270,10 @@ LsTreeWriteWalk (
UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
- DbgPrint (ASL_TREE_OUTPUT, " (%.4X)\n", Op->Asl.ParseOpcode);
+ DbgPrint (ASL_TREE_OUTPUT, " (%.4X) Flags %8.8X",
+ Op->Asl.ParseOpcode, Op->Asl.CompileFlags);
+ TrPrintNodeCompileFlags (Op->Asl.CompileFlags);
+ DbgPrint (ASL_TREE_OUTPUT, "\n");
return (AE_OK);
}
diff --git a/source/compiler/aslmain.c b/source/compiler/aslmain.c
index 4b0848b85fa4..447b8cb5b5a7 100644
--- a/source/compiler/aslmain.c
+++ b/source/compiler/aslmain.c
@@ -187,6 +187,7 @@ Usage (
ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates");
ACPI_OPTION ("-dc <f1 f2 ...>", "Disassemble AML and immediately compile it");
ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)");
+ ACPI_OPTION ("-df", "Force disassembler to assume table contains valid AML");
ACPI_OPTION ("-dl", "Emit legacy ASL code only (no C-style operators)");
ACPI_OPTION ("-e <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
ACPI_OPTION ("-fe <file>", "Specify external symbol declaration file");
diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c
index 61873d718dfb..ade717389bf8 100644
--- a/source/compiler/aslmap.c
+++ b/source/compiler/aslmap.c
@@ -222,7 +222,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] =
/* EXTENDEDIO */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* EXTENDEDMEMORY */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0),
/* EXTENDEDSPACE */ OP_TABLE_ENTRY (AML_RAW_DATA_QWORD, 0, 0, ACPI_BTYPE_INTEGER),
-/* EXTERNAL */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0),
+/* EXTERNAL */ OP_TABLE_ENTRY (AML_EXTERNAL_OP, 0, 0, 0),
/* FATAL */ OP_TABLE_ENTRY (AML_FATAL_OP, 0, 0, 0),
/* FIELD */ OP_TABLE_ENTRY (AML_FIELD_OP, 0, NODE_AML_PACKAGE, 0),
/* FINDSETLEFTBIT */ OP_TABLE_ENTRY (AML_FIND_SET_LEFT_BIT_OP, 0, 0, ACPI_BTYPE_INTEGER),
diff --git a/source/compiler/aslmapenter.c b/source/compiler/aslmapenter.c
index ce726c4d4bd2..652871d860c3 100644
--- a/source/compiler/aslmapenter.c
+++ b/source/compiler/aslmapenter.c
@@ -216,6 +216,7 @@ MpCreateGpioInfo (
ACPI_GPIO_INFO *Info;
ACPI_GPIO_INFO *NextGpio;
ACPI_GPIO_INFO *PrevGpio;
+ char *Buffer;
/*
@@ -223,8 +224,8 @@ MpCreateGpioInfo (
* sorted by both source device name and then the pin number. There is
* one block per pin.
*/
- Info = ACPI_CAST_PTR (ACPI_GPIO_INFO,
- UtStringCacheCalloc (sizeof (ACPI_GPIO_INFO)));
+ Buffer = UtStringCacheCalloc (sizeof (ACPI_GPIO_INFO));
+ Info = ACPI_CAST_PTR (ACPI_GPIO_INFO, Buffer);
NextGpio = Gbl_GpioList;
PrevGpio = NULL;
@@ -293,14 +294,15 @@ MpCreateSerialInfo (
ACPI_SERIAL_INFO *Info;
ACPI_SERIAL_INFO *NextSerial;
ACPI_SERIAL_INFO *PrevSerial;
+ char *Buffer;
/*
* Allocate a new info block and insert it into the global Serial list
* sorted by both source device name and then the address.
*/
- Info = ACPI_CAST_PTR (ACPI_SERIAL_INFO,
- UtStringCacheCalloc (sizeof (ACPI_SERIAL_INFO)));
+ Buffer = UtStringCacheCalloc (sizeof (ACPI_SERIAL_INFO));
+ Info = ACPI_CAST_PTR (ACPI_SERIAL_INFO, Buffer);
NextSerial = Gbl_SerialList;
PrevSerial = NULL;
diff --git a/source/compiler/asloptions.c b/source/compiler/asloptions.c
index 514a3ee96f31..51aae7a41ae1 100644
--- a/source/compiler/asloptions.c
+++ b/source/compiler/asloptions.c
@@ -274,6 +274,11 @@ AslDoOptions (
break;
+ case 'f':
+
+ AcpiGbl_ForceAmlDisassembly = TRUE;
+ break;
+
case 'l': /* Use legacy ASL code (not ASL+) for disassembly */
Gbl_DoCompile = FALSE;
diff --git a/source/compiler/aslrules.y b/source/compiler/aslrules.y
index 67f0413d0726..dbe0882ca8b5 100644
--- a/source/compiler/aslrules.y
+++ b/source/compiler/aslrules.y
@@ -130,7 +130,7 @@ Expression
: PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
TermArg {$$ = TrLinkChildren ($<n>2,1,$3);}
| PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
- TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateLeafNode (PARSEOP_ZERO));}
+ TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateNullTarget ());}
| SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
{$$ = TrLinkChildren ($<n>3,1,$1);}
@@ -140,27 +140,27 @@ Expression
/* Binary operators: math and logical */
| TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
- TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
- TrCreateLeafNode (PARSEOP_ZERO));}
+ TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (),
+ TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
- TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));}
+ TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateNullTarget ());}
| TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);}
@@ -198,7 +198,7 @@ EqualsTerm
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
| TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
- TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO),
+ TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateNullTarget (),
TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));}
| TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
@@ -247,11 +247,10 @@ TermList
Term
: Object {}
- | Expression {}
| Type1Opcode {}
| Type2Opcode {}
- | Type2IntegerOpcode {}
- | Type2StringOpcode {}
+ | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
+ | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
| Type2BufferOpcode {}
| Type2BufferOrStringOpcode {}
| error {$$ = AslDoError(); yyclearin;}
@@ -332,7 +331,7 @@ NameSpaceModifier
| ScopeTerm {}
;
-UserTerm
+MethodInvocationTerm
: NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);}
ArgList ')' {$$ = TrLinkChildNode ($1,$4);}
;
@@ -355,8 +354,7 @@ Removed from TermArg due to reduce/reduce conflicts
*/
TermArg
- : Expression {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
- | Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
+ : Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
| DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
| NameString {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
| ArgTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
@@ -364,8 +362,8 @@ TermArg
;
Target
- : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);} /* Placeholder is a ZeroOp object */
- | ',' {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);} /* Placeholder is a ZeroOp object */
+ : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */
+ | ',' {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */
| ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);}
;
@@ -453,7 +451,7 @@ Type2Opcode
| EqualsTerm {}
| TimerTerm {}
| WaitTerm {}
- | UserTerm {}
+ | MethodInvocationTerm {}
;
/*
@@ -461,7 +459,8 @@ Type2Opcode
*/
Type2IntegerOpcode /* "Type3" opcodes */
- : AddTerm {}
+ : Expression {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
+ | AddTerm {}
| AndTerm {}
| DecTerm {}
| DivideTerm {}
@@ -507,7 +506,7 @@ Type2BufferOpcode /* "Type5" Opcodes */
;
Type2BufferOrStringOpcode
- : ConcatTerm {}
+ : ConcatTerm {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
| PrintfTerm {}
| FprintfTerm {}
| MidTerm {}
@@ -543,7 +542,7 @@ Type6Opcode
: RefOfTerm {}
| DerefOfTerm {}
| IndexTerm {}
- | UserTerm {}
+ | MethodInvocationTerm {}
;
IncludeTerm
@@ -1920,7 +1919,7 @@ SuperName
| DebugTerm {}
| Type6Opcode {}
-/* For ObjectType: SuperName except for UserTerm (method invocation) */
+/* For ObjectType: SuperName except for MethodInvocationTerm */
ObjectTypeName
: NameString {}
@@ -1931,7 +1930,7 @@ ObjectTypeName
| DerefOfTerm {}
| IndexTerm {}
-/* | UserTerm {} */ /* Caused reduce/reduce with Type6Opcode->UserTerm */
+/* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */
;
ArgTerm
diff --git a/source/compiler/aslstartup.c b/source/compiler/aslstartup.c
index dcea76d22158..b25dd32926f1 100644
--- a/source/compiler/aslstartup.c
+++ b/source/compiler/aslstartup.c
@@ -248,7 +248,7 @@ AslDoDisassembly (
/* This is where the disassembly happens */
- AcpiGbl_DbOpt_disasm = TRUE;
+ AcpiGbl_DbOpt_Disasm = TRUE;
Status = AdAmlDisassemble (AslToFile,
Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_OutputFilenamePrefix,
&Gbl_Files[ASL_FILE_INPUT].Filename);
diff --git a/source/compiler/asltree.c b/source/compiler/asltree.c
index b0efc9a738ed..c76720a4da99 100644
--- a/source/compiler/asltree.c
+++ b/source/compiler/asltree.c
@@ -55,10 +55,6 @@ static ACPI_PARSE_OBJECT *
TrGetNextNode (
void);
-static char *
-TrGetNodeFlagName (
- UINT32 Flags);
-
/*******************************************************************************
*
@@ -187,7 +183,7 @@ TrUpdateNode (
}
DbgPrint (ASL_PARSE_OUTPUT,
- "\nUpdateNode: Old - %s, New - %s\n\n",
+ "\nUpdateNode: Old - %s, New - %s\n",
UtGetOpName (Op->Asl.ParseOpcode),
UtGetOpName (ParseOpcode));
@@ -261,90 +257,140 @@ TrUpdateNode (
/*******************************************************************************
*
- * FUNCTION: TrGetNodeFlagName
+ * FUNCTION: TrPrintNodeCompileFlags
*
* PARAMETERS: Flags - Flags word to be decoded
*
- * RETURN: Name string. Always returns a valid string pointer.
+ * RETURN: None
*
- * DESCRIPTION: Decode a flags word
+ * DESCRIPTION: Decode a flags word to text. Displays all flags that are set.
*
******************************************************************************/
-static char *
-TrGetNodeFlagName (
+void
+TrPrintNodeCompileFlags (
UINT32 Flags)
{
+ UINT32 i;
+ UINT32 FlagBit = 1;
+ char *FlagName = NULL;
+
- switch (Flags)
+ for (i = 0; i < 32; i++)
{
- case NODE_VISITED:
+ switch (Flags & FlagBit)
+ {
+ case NODE_VISITED:
+
+ FlagName = "NODE_VISITED";
+ break;
+
+ case NODE_AML_PACKAGE:
- return ("NODE_VISITED");
+ FlagName = "NODE_AML_PACKAGE";
+ break;
+
+ case NODE_IS_TARGET:
+
+ FlagName = "NODE_IS_TARGET";
+ break;
+
+ case NODE_IS_RESOURCE_DESC:
- case NODE_AML_PACKAGE:
+ FlagName = "NODE_IS_RESOURCE_DESC";
+ break;
+
+ case NODE_IS_RESOURCE_FIELD:
+
+ FlagName = "NODE_IS_RESOURCE_FIELD";
+ break;
- return ("NODE_AML_PACKAGE");
+ case NODE_HAS_NO_EXIT:
- case NODE_IS_TARGET:
+ FlagName = "NODE_HAS_NO_EXIT";
+ break;
- return ("NODE_IS_TARGET");
+ case NODE_IF_HAS_NO_EXIT:
- case NODE_IS_RESOURCE_DESC:
+ FlagName = "NODE_IF_HAS_NO_EXIT";
+ break;
- return ("NODE_IS_RESOURCE_DESC");
+ case NODE_NAME_INTERNALIZED:
- case NODE_IS_RESOURCE_FIELD:
+ FlagName = "NODE_NAME_INTERNALIZED";
+ break;
- return ("NODE_IS_RESOURCE_FIELD");
+ case NODE_METHOD_NO_RETVAL:
- case NODE_HAS_NO_EXIT:
+ FlagName = "NODE_METHOD_NO_RETVAL";
+ break;
- return ("NODE_HAS_NO_EXIT");
+ case NODE_METHOD_SOME_NO_RETVAL:
- case NODE_IF_HAS_NO_EXIT:
+ FlagName = "NODE_METHOD_SOME_NO_RETVAL";
+ break;
- return ("NODE_IF_HAS_NO_EXIT");
+ case NODE_RESULT_NOT_USED:
- case NODE_NAME_INTERNALIZED:
+ FlagName = "NODE_RESULT_NOT_USED";
+ break;
- return ("NODE_NAME_INTERNALIZED");
+ case NODE_METHOD_TYPED:
- case NODE_METHOD_NO_RETVAL:
+ FlagName = "NODE_METHOD_TYPED";
+ break;
- return ("NODE_METHOD_NO_RETVAL");
+ case NODE_COMPILE_TIME_CONST:
- case NODE_METHOD_SOME_NO_RETVAL:
+ FlagName = "NODE_COMPILE_TIME_CONST";
+ break;
- return ("NODE_METHOD_SOME_NO_RETVAL");
+ case NODE_IS_TERM_ARG:
- case NODE_RESULT_NOT_USED:
+ FlagName = "NODE_IS_TERM_ARG";
+ break;
- return ("NODE_RESULT_NOT_USED");
+ case NODE_WAS_ONES_OP:
- case NODE_METHOD_TYPED:
+ FlagName = "NODE_WAS_ONES_OP";
+ break;
- return ("NODE_METHOD_TYPED");
+ case NODE_IS_NAME_DECLARATION:
- case NODE_COMPILE_TIME_CONST:
+ FlagName = "NODE_IS_NAME_DECLARATION";
+ break;
- return ("NODE_COMPILE_TIME_CONST");
+ case NODE_COMPILER_EMITTED:
- case NODE_IS_TERM_ARG:
+ FlagName = "NODE_COMPILER_EMITTED";
+ break;
- return ("NODE_IS_TERM_ARG");
+ case NODE_IS_DUPLICATE:
- case NODE_WAS_ONES_OP:
+ FlagName = "NODE_IS_DUPLICATE";
+ break;
- return ("NODE_WAS_ONES_OP");
+ case NODE_IS_RESOURCE_DATA:
- case NODE_IS_NAME_DECLARATION:
+ FlagName = "NODE_IS_RESOURCE_DATA";
+ break;
- return ("NODE_IS_NAME_DECLARATION");
+ case NODE_IS_NULL_RETURN:
- default:
+ FlagName = "NODE_IS_NULL_RETURN";
+ break;
- return ("Multiple Flags (or unknown flag) set");
+ default:
+ break;
+ }
+
+ if (FlagName)
+ {
+ DbgPrint (ASL_PARSE_OUTPUT, " %s", FlagName);
+ FlagName = NULL;
+ }
+
+ FlagBit <<= 1;
}
}
@@ -368,15 +414,17 @@ TrSetNodeFlags (
UINT32 Flags)
{
- DbgPrint (ASL_PARSE_OUTPUT,
- "\nSetNodeFlags: Op %p, %8.8X %s\n\n", Op, Flags,
- TrGetNodeFlagName (Flags));
-
if (!Op)
{
return (NULL);
}
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nSetNodeFlags: %s Op %p, %8.8X", Op->Asl.ParseOpName, Op, Flags);
+
+ TrPrintNodeCompileFlags (Flags);
+ DbgPrint (ASL_PARSE_OUTPUT, "\n\n");
+
Op->Asl.CompileFlags |= Flags;
return (Op);
}
@@ -588,7 +636,40 @@ TrCreateLeafNode (
DbgPrint (ASL_PARSE_OUTPUT,
"\nCreateLeafNode Ln/Col %u/%u NewNode %p Op %s\n\n",
- Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode));
+ Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode));
+
+ return (Op);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: TrCreateNullTarget
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Pointer to the new node. Aborts on allocation failure
+ *
+ * DESCRIPTION: Create a "null" target node. This is defined by the ACPI
+ * specification to be a zero AML opcode, and indicates that
+ * no target has been specified for the parent operation
+ *
+ ******************************************************************************/
+
+ACPI_PARSE_OBJECT *
+TrCreateNullTarget (
+ void)
+{
+ ACPI_PARSE_OBJECT *Op;
+
+
+ Op = TrAllocateNode (PARSEOP_ZERO);
+ Op->Asl.CompileFlags |= (NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);
+
+ DbgPrint (ASL_PARSE_OUTPUT,
+ "\nCreateNullTarget Ln/Col %u/%u NewNode %p Op %s\n",
+ Op->Asl.LineNumber, Op->Asl.Column, Op,
+ UtGetOpName (Op->Asl.ParseOpcode));
return (Op);
}
@@ -620,7 +701,6 @@ TrCreateConstantLeafNode (
time_t CurrentTime;
char *StaticTimeString;
char *TimeString;
- char *Path;
char *Filename;
@@ -647,7 +727,7 @@ TrCreateConstantLeafNode (
/* Get the simple filename from the full path */
- FlSplitInputPathname (Op->Asl.Filename, &Path, &Filename);
+ FlSplitInputPathname (Op->Asl.Filename, NULL, &Filename);
Op->Asl.Value.String = Filename;
break;
@@ -672,7 +752,7 @@ TrCreateConstantLeafNode (
}
DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X ",
+ "\nCreateConstantLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X \n",
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName (ParseOpcode),
ACPI_FORMAT_UINT64 (Op->Asl.Value.Integer));
return (Op);
@@ -813,7 +893,8 @@ TrCreateValuedLeafNode (
case PARSEOP_INTEGER:
- DbgPrint (ASL_PARSE_OUTPUT, "INTEGER");
+ DbgPrint (ASL_PARSE_OUTPUT, "INTEGER->%8.8X%8.8X",
+ ACPI_FORMAT_UINT64 (Value));
break;
default:
@@ -948,7 +1029,7 @@ TrCreateNode (
}
va_end(ap);
- DbgPrint (ASL_PARSE_OUTPUT, "\n\n");
+ DbgPrint (ASL_PARSE_OUTPUT, "\n");
return (Op);
}
@@ -1104,7 +1185,7 @@ TrLinkPeerNode (
DbgPrint (ASL_PARSE_OUTPUT,
- "\nLinkPeerNode: 1=%p (%s), 2=%p (%s)\n\n",
+ "\nLinkPeerNode: 1=%p (%s), 2=%p (%s)\n",
Op1, Op1 ? UtGetOpName(Op1->Asl.ParseOpcode) : NULL,
Op2, Op2 ? UtGetOpName(Op2->Asl.ParseOpcode) : NULL);
@@ -1130,7 +1211,7 @@ TrLinkPeerNode (
if (Op1 == Op2)
{
DbgPrint (ASL_DEBUG_OUTPUT,
- "\n\n************* Internal error, linking node to itself %p\n\n\n",
+ "\n************* Internal error, linking node to itself %p\n",
Op1);
AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Op1,
"Linking node to itself");
@@ -1214,7 +1295,7 @@ TrLinkPeerNodes (
}
va_end (ap);
- DbgPrint (ASL_PARSE_OUTPUT,"\n\n");
+ DbgPrint (ASL_PARSE_OUTPUT,"\n");
return (Start);
}
@@ -1241,7 +1322,7 @@ TrLinkChildNode (
DbgPrint (ASL_PARSE_OUTPUT,
- "\nLinkChildNode: Parent=%p (%s), Child=%p (%s)\n\n",
+ "\nLinkChildNode: Parent=%p (%s), Child=%p (%s)\n",
Op1, Op1 ? UtGetOpName(Op1->Asl.ParseOpcode): NULL,
Op2, Op2 ? UtGetOpName(Op2->Asl.ParseOpcode): NULL);
diff --git a/source/compiler/asltypes.y b/source/compiler/asltypes.y
index 3177d1d52a78..650b8561527b 100644
--- a/source/compiler/asltypes.y
+++ b/source/compiler/asltypes.y
@@ -74,7 +74,7 @@ NoEcho('
%type <n> Term
%type <n> TermArg
%type <n> TermList
-%type <n> UserTerm
+%type <n> MethodInvocationTerm
/* Type4Opcode is obsolete */
diff --git a/source/compiler/aslutils.c b/source/compiler/aslutils.c
index 519afbc04bf6..4d3edc059401 100644
--- a/source/compiler/aslutils.c
+++ b/source/compiler/aslutils.c
@@ -503,8 +503,13 @@ UtDisplaySummary (
if (Gbl_FileType != ASL_INPUT_TYPE_ASCII_DATA)
{
- FlPrintFile (FileId,
- ", %u Optimizations", Gbl_ExceptionCount[ASL_OPTIMIZATION]);
+ FlPrintFile (FileId, ", %u Optimizations",
+ Gbl_ExceptionCount[ASL_OPTIMIZATION]);
+
+ if (TotalFolds)
+ {
+ FlPrintFile (FileId, ", %u Constants Folded", TotalFolds);
+ }
}
FlPrintFile (FileId, "\n");
diff --git a/source/compiler/aslwalks.c b/source/compiler/aslwalks.c
index 7f78cafaab4c..bbc15c598a4f 100644
--- a/source/compiler/aslwalks.c
+++ b/source/compiler/aslwalks.c
@@ -252,6 +252,13 @@ AnOperandTypecheckWalkEnd (
}
return (AE_OK);
+ case AML_EXTERNAL_OP:
+ /*
+ * Not really a "runtime" opcode since it used by disassembler only.
+ * The parser will find any issues with the operands.
+ */
+ return (AE_OK);
+
default:
break;
@@ -388,9 +395,6 @@ AnOperandTypecheckWalkEnd (
break;
case PARSEOP_DEBUG:
-
- break;
-
case PARSEOP_REFOF:
case PARSEOP_INDEX:
default:
diff --git a/source/compiler/dtcompile.c b/source/compiler/dtcompile.c
index 1c4a7082425a..0b949191570d 100644
--- a/source/compiler/dtcompile.c
+++ b/source/compiler/dtcompile.c
@@ -102,13 +102,18 @@ DtDoCompile (
/* Preprocessor */
- Event = UtBeginEvent ("Preprocess input file");
- PrDoPreprocess ();
- UtEndEvent (Event);
-
- if (Gbl_PreprocessOnly)
+ if (Gbl_PreprocessFlag)
{
- return (AE_OK);
+ /* Preprocessor */
+
+ Event = UtBeginEvent ("Preprocess input file");
+ PrDoPreprocess ();
+ UtEndEvent (Event);
+
+ if (Gbl_PreprocessOnly)
+ {
+ return (AE_OK);
+ }
}
/*
diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h
index b14c4c716d05..c6097ff56524 100644
--- a/source/compiler/dtcompiler.h
+++ b/source/compiler/dtcompiler.h
@@ -85,15 +85,16 @@
*/
typedef struct dt_field
{
- char *Name; /* Field name (from name : value) */
- char *Value; /* Field value (from name : value) */
- struct dt_field *Next; /* Next field */
- struct dt_field *NextLabel; /* If field is a label, next label */
- UINT32 Line; /* Line number for this field */
- UINT32 ByteOffset; /* Offset in source file for field */
- UINT32 NameColumn; /* Start column for field name */
- UINT32 Column; /* Start column for field value */
- UINT32 TableOffset;/* Binary offset within ACPI table */
+ char *Name; /* Field name (from name : value) */
+ char *Value; /* Field value (from name : value) */
+ UINT32 StringLength;/* Length of Value */
+ struct dt_field *Next; /* Next field */
+ struct dt_field *NextLabel; /* If field is a label, next label */
+ UINT32 Line; /* Line number for this field */
+ UINT32 ByteOffset; /* Offset in source file for field */
+ UINT32 NameColumn; /* Start column for field name */
+ UINT32 Column; /* Start column for field value */
+ UINT32 TableOffset; /* Binary offset within ACPI table */
UINT8 Flags;
} DT_FIELD;
@@ -557,6 +558,7 @@ extern const unsigned char TemplateMcfg[];
extern const unsigned char TemplateMchi[];
extern const unsigned char TemplateMpst[];
extern const unsigned char TemplateMsct[];
+extern const unsigned char TemplateMsdm[];
extern const unsigned char TemplateMtmr[];
extern const unsigned char TemplatePcct[];
extern const unsigned char TemplatePmtt[];
diff --git a/source/compiler/dtio.c b/source/compiler/dtio.c
index f2f7c22478a4..98837d5c292c 100644
--- a/source/compiler/dtio.c
+++ b/source/compiler/dtio.c
@@ -375,6 +375,7 @@ DtParseLine (
Field->ByteOffset = Offset;
Field->NameColumn = NameColumn;
Field->Column = Column;
+ Field->StringLength = Length;
DtLinkField (Field);
}
@@ -414,6 +415,7 @@ DtGetNextLine (
int c;
+ ACPI_MEMSET (Gbl_CurrentLineBuffer, 0, Gbl_LineBufferSize);
for (i = 0; ;)
{
/*
@@ -939,11 +941,11 @@ DtDumpFieldList (
DbgPrint (ASL_DEBUG_OUTPUT, "\nField List:\n"
"LineNo ByteOff NameCol Column TableOff "
- "Flags %32s : %s\n\n", "Name", "Value");
+ "Flags %32s : %s\n\n", "Name", "Value");
while (Field)
{
DbgPrint (ASL_DEBUG_OUTPUT,
- "%.08X %.08X %.08X %.08X %.08X %.08X %32s : %s\n",
+ "%.08X %.08X %.08X %.08X %.08X %2.2X %32s : %s\n",
Field->Line, Field->ByteOffset, Field->NameColumn,
Field->Column, Field->TableOffset, Field->Flags,
Field->Name, Field->Value);
diff --git a/source/compiler/dttable.c b/source/compiler/dttable.c
index 20444fb9b6f2..438a3ed6c630 100644
--- a/source/compiler/dttable.c
+++ b/source/compiler/dttable.c
@@ -2240,15 +2240,11 @@ DtCompileSlic (
DT_SUBTABLE *Subtable;
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
- DT_FIELD *SubtableStart;
- ACPI_SLIC_HEADER *SlicHeader;
- ACPI_DMTABLE_INFO *InfoTable;
while (*PFieldList)
{
- SubtableStart = *PFieldList;
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlicHdr,
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlic,
&Subtable, TRUE);
if (ACPI_FAILURE (Status))
{
@@ -2258,35 +2254,6 @@ DtCompileSlic (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
-
- SlicHeader = ACPI_CAST_PTR (ACPI_SLIC_HEADER, Subtable->Buffer);
-
- switch (SlicHeader->Type)
- {
- case ACPI_SLIC_TYPE_PUBLIC_KEY:
-
- InfoTable = AcpiDmTableInfoSlic0;
- break;
-
- case ACPI_SLIC_TYPE_WINDOWS_MARKER:
-
- InfoTable = AcpiDmTableInfoSlic1;
- break;
-
- default:
-
- DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SLIC");
- return (AE_ERROR);
- }
-
- Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
DtPopSubtable ();
}
diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h
index 0398d696df20..39be761764ec 100644
--- a/source/compiler/dttemplate.h
+++ b/source/compiler/dttemplate.h
@@ -662,6 +662,23 @@ const unsigned char TemplateMchi[] =
0x00,0x00,0x00,0x00,0x00 /* 00000040 "....." */
};
+const unsigned char TemplateMsdm[] =
+{
+ 0x4D,0x53,0x44,0x4D,0x64,0x00,0x00,0x00, /* 00000000 "MSDMd..." */
+ 0x01,0x34,0x49,0x6E,0x74,0x65,0x6C,0x00, /* 00000008 ".4Intel." */
+ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
+ 0x03,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x04,0x02,0x15,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */
+ 0x0A,0x10,0x16,0x17,0x18,0x19,0x1A,0x1B, /* 00000028 "........" */
+ 0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x23, /* 00000030 ".... !"#" */
+ 0x24,0x25,0x26,0x27,0x10,0x0A,0x15,0x16, /* 00000038 "$%&'...." */
+ 0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E, /* 00000040 "........" */
+ 0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26, /* 00000048 ". !"#$%&" */
+ 0x16,0x15,0x0A,0x10,0x16,0x17,0x18,0x19, /* 00000050 "........" */
+ 0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21, /* 00000058 "...... !" */
+ 0x22,0x23,0x24,0x25 /* 00000060 ""#$%" */
+};
+
const unsigned char TemplateMpst[] =
{
0x4D,0x50,0x53,0x54,0xB6,0x00,0x00,0x00, /* 00000000 "MPST...." */
diff --git a/source/compiler/dtutils.c b/source/compiler/dtutils.c
index fbaa2be138fb..411ab0015470 100644
--- a/source/compiler/dtutils.c
+++ b/source/compiler/dtutils.c
@@ -364,6 +364,7 @@ DtGetFieldType (
break;
case ACPI_DMT_BUFFER:
+ case ACPI_DMT_RAW_BUFFER:
case ACPI_DMT_BUF7:
case ACPI_DMT_BUF10:
case ACPI_DMT_BUF16:
@@ -531,7 +532,6 @@ DtGetFieldLength (
case ACPI_DMT_UINT32:
case ACPI_DMT_NAME4:
- case ACPI_DMT_SLIC:
case ACPI_DMT_SIG:
case ACPI_DMT_LPIT:
@@ -588,6 +588,7 @@ DtGetFieldLength (
break;
case ACPI_DMT_BUFFER:
+ case ACPI_DMT_RAW_BUFFER:
Value = DtGetFieldValue (Field);
if (Value)
diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c
index 3ca1e98c7477..c658d6ade87a 100644
--- a/source/components/debugger/dbmethod.c
+++ b/source/components/debugger/dbmethod.c
@@ -394,9 +394,9 @@ AcpiDbDisassembleMethod (
/* Now we can disassemble the method */
- AcpiGbl_DbOpt_verbose = FALSE;
+ AcpiGbl_DbOpt_Verbose = FALSE;
AcpiDmDisassemble (NULL, Op, 0);
- AcpiGbl_DbOpt_verbose = TRUE;
+ AcpiGbl_DbOpt_Verbose = TRUE;
AcpiPsDeleteParseTree (Op);
diff --git a/source/components/debugger/dbxface.c b/source/components/debugger/dbxface.c
index 64b8402bb6ee..04b69adf97a2 100644
--- a/source/components/debugger/dbxface.c
+++ b/source/components/debugger/dbxface.c
@@ -422,11 +422,9 @@ AcpiDbInitialize (
AcpiGbl_DbConsoleDebugLevel = ACPI_NORMAL_DEFAULT | ACPI_LV_TABLES;
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
- AcpiGbl_DbOpt_tables = FALSE;
- AcpiGbl_DbOpt_disasm = FALSE;
- AcpiGbl_DbOpt_stats = FALSE;
- AcpiGbl_DbOpt_verbose = TRUE;
- AcpiGbl_DbOpt_ini_methods = TRUE;
+ AcpiGbl_DbOpt_Disasm = FALSE;
+ AcpiGbl_DbOpt_Verbose = TRUE;
+ AcpiGbl_DbOpt_NoIniMethods = FALSE;
AcpiGbl_DbBuffer = AcpiOsAllocate (ACPI_DEBUG_BUFFER_SIZE);
if (!AcpiGbl_DbBuffer)
@@ -474,10 +472,9 @@ AcpiDbInitialize (
}
}
- if (!AcpiGbl_DbOpt_verbose)
+ if (!AcpiGbl_DbOpt_Verbose)
{
- AcpiGbl_DbOpt_disasm = TRUE;
- AcpiGbl_DbOpt_stats = FALSE;
+ AcpiGbl_DbOpt_Disasm = TRUE;
}
return_ACPI_STATUS (AE_OK);
diff --git a/source/components/disassembler/dmcstyle.c b/source/components/disassembler/dmcstyle.c
index 1f1381969f57..71aef9b0e9fb 100644
--- a/source/components/disassembler/dmcstyle.c
+++ b/source/components/disassembler/dmcstyle.c
@@ -114,12 +114,20 @@ AcpiDmCheckForSymbolicOpcode (
Child1 = AcpiPsGetArg (Op, 0);
if (!Child1)
{
+ /* Parse tree may be confused or corrupted */
+
return (FALSE);
}
/* Get the second operand */
Child2 = Child1->Common.Next;
+ if (!Child2)
+ {
+ /* Parse tree may be confused or corrupted */
+
+ return (FALSE);
+ }
/* Setup the operator string for this opcode */
@@ -299,8 +307,16 @@ AcpiDmCheckForSymbolicOpcode (
/* Target is 3rd operand */
Target = Child2->Common.Next;
+
if (Op->Common.AmlOpcode == AML_DIVIDE_OP)
{
+ if (!Target)
+ {
+ /* Parse tree may be confused or corrupted */
+
+ return (FALSE);
+ }
+
/*
* Divide has an extra target operand (Remainder).
* If this extra target is specified, it cannot be converted
@@ -403,6 +419,13 @@ AcpiDmCheckForSymbolicOpcode (
/* Target is optional, 3rd operand */
Target = Child2->Common.Next;
+ if (!Target)
+ {
+ /* Parse tree may be confused or corrupted */
+
+ return (FALSE);
+ }
+
if (AcpiDmIsValidTarget (Target))
{
AcpiDmPromoteTarget (Op, Target);
@@ -423,6 +446,13 @@ AcpiDmCheckForSymbolicOpcode (
* source so that the target is processed first.
*/
Target = Child1->Common.Next;
+ if (!Target)
+ {
+ /* Parse tree may be confused or corrupted */
+
+ return (FALSE);
+ }
+
AcpiDmPromoteTarget (Op, Target);
if (!Target->Common.OperatorSymbol)
diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c
index bcd68dc4626c..d8ab1d51c758 100644
--- a/source/components/disassembler/dmopcode.c
+++ b/source/components/disassembler/dmopcode.c
@@ -852,18 +852,6 @@ AcpiDmDisassembleOneOp (
}
break;
- case AML_INT_STATICSTRING_OP:
-
- if (Op->Common.Value.String)
- {
- AcpiOsPrintf ("%s", Op->Common.Value.String);
- }
- else
- {
- AcpiOsPrintf ("\"<NULL STATIC STRING PTR>\"");
- }
- break;
-
case AML_INT_NAMEPATH_OP:
AcpiDmNamestring (Op->Common.Value.Name);
diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c
index 200da829fc10..6a8c505439f4 100644
--- a/source/components/disassembler/dmwalk.c
+++ b/source/components/disassembler/dmwalk.c
@@ -562,7 +562,7 @@ AcpiDmDescendingOp (
if (Op->Common.AmlOpcode != AML_INT_NAMEDFIELD_OP)
{
- if (AcpiGbl_DbOpt_verbose)
+ if (AcpiGbl_DbOpt_Verbose)
{
(void) AcpiPsDisplayObjectPathname (NULL, Op);
}
diff --git a/source/components/dispatcher/dsopcode.c b/source/components/dispatcher/dsopcode.c
index bec7e58b9800..afe1fe64d4ab 100644
--- a/source/components/dispatcher/dsopcode.c
+++ b/source/components/dispatcher/dsopcode.c
@@ -477,7 +477,7 @@ AcpiDsEvalRegionOperands (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
ObjDesc,
- ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
+ ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
ObjDesc->Region.Length));
/* Now the address and length are valid for this opregion */
@@ -579,12 +579,12 @@ AcpiDsEvalTableRegionOperands (
return_ACPI_STATUS (AE_NOT_EXIST);
}
- ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS) ACPI_TO_INTEGER (Table);
+ ObjDesc->Region.Address = ACPI_PTR_TO_PHYSADDR (Table);
ObjDesc->Region.Length = Table->Length;
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
ObjDesc,
- ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
+ ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
ObjDesc->Region.Length));
/* Now the address and length are valid for this opregion */
diff --git a/source/components/dispatcher/dsutils.c b/source/components/dispatcher/dsutils.c
index 76d3e82ebdc4..fadc7c5cebf9 100644
--- a/source/components/dispatcher/dsutils.c
+++ b/source/components/dispatcher/dsutils.c
@@ -599,6 +599,15 @@ AcpiDsCreateOperand (
ACPI_OPERAND_OBJECT, AcpiGbl_RootNode);
Status = AE_OK;
}
+ else if (ParentOp->Common.AmlOpcode == AML_EXTERNAL_OP)
+ {
+ /* TBD: May only be temporary */
+
+ ObjDesc = AcpiUtCreateStringObject ((ACPI_SIZE) NameLength);
+
+ ACPI_STRNCPY (ObjDesc->String.Pointer, NameString, NameLength);
+ Status = AE_OK;
+ }
else
{
/*
diff --git a/source/components/events/evregion.c b/source/components/events/evregion.c
index e578fb41390a..638950f5e90c 100644
--- a/source/components/events/evregion.c
+++ b/source/components/events/evregion.c
@@ -288,7 +288,7 @@ AcpiEvAddressSpaceDispatch (
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
"Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
&RegionObj->Region.Handler->AddressSpace, Handler,
- ACPI_FORMAT_NATIVE_UINT (Address),
+ ACPI_FORMAT_UINT64 (Address),
AcpiUtGetRegionName (RegionObj->Region.SpaceId)));
if (!(HandlerDesc->AddressSpace.HandlerFlags &
diff --git a/source/components/events/evxfevnt.c b/source/components/events/evxfevnt.c
index 81675ed2b6f3..fe46dfb993cb 100644
--- a/source/components/events/evxfevnt.c
+++ b/source/components/events/evxfevnt.c
@@ -401,7 +401,8 @@ AcpiGetEventStatus (
if (InByte)
{
- LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
+ LocalEventStatus |=
+ (ACPI_EVENT_FLAG_ENABLED | ACPI_EVENT_FLAG_ENABLE_SET);
}
/* Fixed event currently active? */
@@ -415,7 +416,7 @@ AcpiGetEventStatus (
if (InByte)
{
- LocalEventStatus |= ACPI_EVENT_FLAG_SET;
+ LocalEventStatus |= ACPI_EVENT_FLAG_STATUS_SET;
}
(*EventStatus) = LocalEventStatus;
diff --git a/source/components/executer/exdump.c b/source/components/executer/exdump.c
index 5ef4e39dae87..c76a1a4de36d 100644
--- a/source/components/executer/exdump.c
+++ b/source/components/executer/exdump.c
@@ -784,7 +784,7 @@ AcpiExDumpOperand (
else
{
AcpiOsPrintf (" base %8.8X%8.8X Length %X\n",
- ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
+ ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
ObjDesc->Region.Length);
}
break;
diff --git a/source/components/executer/exfldio.c b/source/components/executer/exfldio.c
index a1b71393584b..7e81d42b4b82 100644
--- a/source/components/executer/exfldio.c
+++ b/source/components/executer/exfldio.c
@@ -289,13 +289,13 @@ AcpiExAccessRegion (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_BFIELD,
- " Region [%s:%X], Width %X, ByteBase %X, Offset %X at %p\n",
+ " Region [%s:%X], Width %X, ByteBase %X, Offset %X at %8.8X%8.8X\n",
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
RgnDesc->Region.SpaceId,
ObjDesc->CommonField.AccessByteWidth,
ObjDesc->CommonField.BaseByteOffset,
FieldDatumByteOffset,
- ACPI_CAST_PTR (void, (RgnDesc->Region.Address + RegionOffset))));
+ ACPI_FORMAT_UINT64 (RgnDesc->Region.Address + RegionOffset)));
/* Invoke the appropriate AddressSpace/OpRegion handler */
diff --git a/source/components/executer/exoparg3.c b/source/components/executer/exoparg3.c
index 94293f78cb7a..5f83f10d7db7 100644
--- a/source/components/executer/exoparg3.c
+++ b/source/components/executer/exoparg3.c
@@ -125,7 +125,18 @@ AcpiExOpcode_3A_0T_0R (
/* Might return while OS is shutting down, just continue */
ACPI_FREE (Fatal);
- break;
+ goto Cleanup;
+
+ case AML_EXTERNAL_OP:
+ /*
+ * If the interpreter sees this opcode, just ignore it. The External
+ * 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.
+ */
+ Status = AE_OK;
+ goto Cleanup;
default:
diff --git a/source/components/executer/exregion.c b/source/components/executer/exregion.c
index 41512d953391..6fcfa0ffb6ff 100644
--- a/source/components/executer/exregion.c
+++ b/source/components/executer/exregion.c
@@ -175,8 +175,8 @@ AcpiExSystemMemorySpaceHandler (
* one page, which is similar to the original code that used a 4k
* maximum window.
*/
- PageBoundaryMapLength =
- ACPI_ROUND_UP (Address, ACPI_DEFAULT_PAGE_SIZE) - Address;
+ PageBoundaryMapLength = (ACPI_SIZE)
+ (ACPI_ROUND_UP (Address, ACPI_DEFAULT_PAGE_SIZE) - Address);
if (PageBoundaryMapLength == 0)
{
PageBoundaryMapLength = ACPI_DEFAULT_PAGE_SIZE;
@@ -189,13 +189,12 @@ AcpiExSystemMemorySpaceHandler (
/* Create a new mapping starting at the address given */
- MemInfo->MappedLogicalAddress = AcpiOsMapMemory (
- (ACPI_PHYSICAL_ADDRESS) Address, MapLength);
+ MemInfo->MappedLogicalAddress = AcpiOsMapMemory (Address, MapLength);
if (!MemInfo->MappedLogicalAddress)
{
ACPI_ERROR ((AE_INFO,
"Could not map memory at 0x%8.8X%8.8X, size %u",
- ACPI_FORMAT_NATIVE_UINT (Address), (UINT32) MapLength));
+ ACPI_FORMAT_UINT64 (Address), (UINT32) MapLength));
MemInfo->MappedLength = 0;
return_ACPI_STATUS (AE_NO_MEMORY);
}
@@ -215,7 +214,7 @@ AcpiExSystemMemorySpaceHandler (
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",
- BitWidth, Function, ACPI_FORMAT_NATIVE_UINT (Address)));
+ BitWidth, Function, ACPI_FORMAT_UINT64 (Address)));
/*
* Perform the memory read or write
@@ -338,7 +337,7 @@ AcpiExSystemIoSpaceHandler (
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"System-IO (width %u) R/W %u Address=%8.8X%8.8X\n",
- BitWidth, Function, ACPI_FORMAT_NATIVE_UINT (Address)));
+ BitWidth, Function, ACPI_FORMAT_UINT64 (Address)));
/* Decode the function parameter */
diff --git a/source/components/hardware/hwgpe.c b/source/components/hardware/hwgpe.c
index b61e92dbc4fc..2e616d4e4e12 100644
--- a/source/components/hardware/hwgpe.c
+++ b/source/components/hardware/hwgpe.c
@@ -280,6 +280,19 @@ AcpiHwGetGpeStatus (
LocalEventStatus |= ACPI_EVENT_FLAG_WAKE_ENABLED;
}
+ /* GPE currently enabled (enable bit == 1)? */
+
+ Status = AcpiHwRead (&InByte, &GpeRegisterInfo->EnableAddress);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ if (RegisterBit & InByte)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_ENABLE_SET;
+ }
+
/* GPE currently active (status bit == 1)? */
Status = AcpiHwRead (&InByte, &GpeRegisterInfo->StatusAddress);
@@ -290,7 +303,7 @@ AcpiHwGetGpeStatus (
if (RegisterBit & InByte)
{
- LocalEventStatus |= ACPI_EVENT_FLAG_SET;
+ LocalEventStatus |= ACPI_EVENT_FLAG_STATUS_SET;
}
/* Set return value */
diff --git a/source/components/hardware/hwvalid.c b/source/components/hardware/hwvalid.c
index e694b707637e..36a99bd79fe2 100644
--- a/source/components/hardware/hwvalid.c
+++ b/source/components/hardware/hwvalid.c
@@ -155,8 +155,8 @@ AcpiHwValidateIoRequest (
ByteWidth = ACPI_DIV_8 (BitWidth);
LastAddress = Address + ByteWidth - 1;
- ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Address %p LastAddress %p Length %X",
- ACPI_CAST_PTR (void, Address), ACPI_CAST_PTR (void, LastAddress),
+ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Address %8.8X%8.8X LastAddress %8.8X%8.8X Length %X",
+ ACPI_FORMAT_UINT64 (Address), ACPI_FORMAT_UINT64 (LastAddress),
ByteWidth));
/* Maximum 16-bit address in I/O space */
@@ -164,8 +164,8 @@ AcpiHwValidateIoRequest (
if (LastAddress > ACPI_UINT16_MAX)
{
ACPI_ERROR ((AE_INFO,
- "Illegal I/O port address/length above 64K: %p/0x%X",
- ACPI_CAST_PTR (void, Address), ByteWidth));
+ "Illegal I/O port address/length above 64K: %8.8X%8.8X/0x%X",
+ ACPI_FORMAT_UINT64 (Address), ByteWidth));
return_ACPI_STATUS (AE_LIMIT);
}
@@ -196,8 +196,8 @@ AcpiHwValidateIoRequest (
if (AcpiGbl_OsiData >= PortInfo->OsiDependency)
{
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
- "Denied AML access to port 0x%p/%X (%s 0x%.4X-0x%.4X)",
- ACPI_CAST_PTR (void, Address), ByteWidth, PortInfo->Name,
+ "Denied AML access to port 0x%8.8X%8.8X/%X (%s 0x%.4X-0x%.4X)",
+ ACPI_FORMAT_UINT64 (Address), ByteWidth, PortInfo->Name,
PortInfo->Start, PortInfo->End));
return_ACPI_STATUS (AE_AML_ILLEGAL_ADDRESS);
diff --git a/source/components/namespace/nsdump.c b/source/components/namespace/nsdump.c
index 5f9f2be7348b..bbaff7d95b18 100644
--- a/source/components/namespace/nsdump.c
+++ b/source/components/namespace/nsdump.c
@@ -313,9 +313,9 @@ AcpiNsDumpOneObject (
{
case ACPI_TYPE_PROCESSOR:
- AcpiOsPrintf ("ID %02X Len %02X Addr %p\n",
+ AcpiOsPrintf ("ID %02X Len %02X Addr %8.8X%8.8X\n",
ObjDesc->Processor.ProcId, ObjDesc->Processor.Length,
- ACPI_CAST_PTR (void, ObjDesc->Processor.Address));
+ ACPI_FORMAT_UINT64 (ObjDesc->Processor.Address));
break;
case ACPI_TYPE_DEVICE:
@@ -388,7 +388,7 @@ AcpiNsDumpOneObject (
if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
{
AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X\n",
- ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
+ ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
ObjDesc->Region.Length);
}
else
diff --git a/source/components/parser/psopcode.c b/source/components/parser/psopcode.c
index d2ca1cc05333..0376da55b8ef 100644
--- a/source/components/parser/psopcode.c
+++ b/source/components/parser/psopcode.c
@@ -333,7 +333,11 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] =
/* ACPI 5.0 opcodes */
/* 7F */ ACPI_OP ("-ConnectField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS),
-/* 80 */ ACPI_OP ("-ExtAccessField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0)
+/* 80 */ ACPI_OP ("-ExtAccessField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
+
+/* ACPI 6.0 opcodes */
+
+/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE,/* ? */ AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R)
/*! [End] no source code translation !*/
};
diff --git a/source/components/parser/psopinfo.c b/source/components/parser/psopinfo.c
index c8c22ff0d8dc..e3cd31f2e04e 100644
--- a/source/components/parser/psopinfo.c
+++ b/source/components/parser/psopinfo.c
@@ -226,7 +226,7 @@ const UINT8 AcpiGbl_ShortOpIndex[256] =
/* 8 9 A B C D E F */
/* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK,
/* 0x08 */ 0x03, _UNK, 0x04, 0x05, 0x06, 0x07, 0x6E, _UNK,
-/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, _UNK, _UNK, _UNK,
+/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, 0x81, _UNK, _UNK,
/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX,
diff --git a/source/components/resources/rsaddr.c b/source/components/resources/rsaddr.c
index b81b75c26806..0ec02ef793f5 100644
--- a/source/components/resources/rsaddr.c
+++ b/source/components/resources/rsaddr.c
@@ -77,7 +77,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertAddress16[5] =
* Address Translation Offset
* Address Length
*/
- {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Address16.Granularity),
+ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Address16.Address.Granularity),
AML_OFFSET (Address16.Granularity),
5},
@@ -117,7 +117,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertAddress32[5] =
* Address Translation Offset
* Address Length
*/
- {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.Address32.Granularity),
+ {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.Address32.Address.Granularity),
AML_OFFSET (Address32.Granularity),
5},
@@ -157,7 +157,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[5] =
* Address Translation Offset
* Address Length
*/
- {ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.Address64.Granularity),
+ {ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.Address64.Address.Granularity),
AML_OFFSET (Address64.Granularity),
5},
@@ -203,7 +203,7 @@ ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[5] =
* Address Length
* Type-Specific Attribute
*/
- {ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.ExtAddress64.Granularity),
+ {ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.ExtAddress64.Address.Granularity),
AML_OFFSET (ExtAddress64.Granularity),
6}
};
diff --git a/source/components/resources/rsdump.c b/source/components/resources/rsdump.c
index ac3bd4cc89c0..9b4ab99ee9ec 100644
--- a/source/components/resources/rsdump.c
+++ b/source/components/resources/rsdump.c
@@ -1,6 +1,6 @@
/*******************************************************************************
*
- * Module Name: rsdump - Functions to display the resource structures.
+ * Module Name: rsdump - AML debugger support for resource structures.
*
******************************************************************************/
@@ -48,8 +48,10 @@
#define _COMPONENT ACPI_RESOURCES
ACPI_MODULE_NAME ("rsdump")
-
-#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
+/*
+ * All functions in this module are used by the AML Debugger only
+ */
+#if defined(ACPI_DEBUGGER)
/* Local prototypes */
@@ -89,8 +91,8 @@ AcpiRsDumpByteList (
static void
AcpiRsDumpWordList (
- UINT16 Length,
- UINT16 *Data);
+ UINT16 Length,
+ UINT16 *Data);
static void
AcpiRsDumpDwordList (
@@ -99,8 +101,8 @@ AcpiRsDumpDwordList (
static void
AcpiRsDumpShortByteList (
- UINT8 Length,
- UINT8 *Data);
+ UINT8 Length,
+ UINT8 *Data);
static void
AcpiRsDumpResourceSource (
@@ -113,7 +115,133 @@ AcpiRsDumpAddressCommon (
static void
AcpiRsDumpDescriptor (
void *Resource,
- ACPI_RSDUMP_INFO *Table);
+ ACPI_RSDUMP_INFO *Table);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDumpResourceList
+ *
+ * PARAMETERS: ResourceList - Pointer to a resource descriptor list
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dispatches the structure to the correct dump routine.
+ *
+ ******************************************************************************/
+
+void
+AcpiRsDumpResourceList (
+ ACPI_RESOURCE *ResourceList)
+{
+ UINT32 Count = 0;
+ UINT32 Type;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Check if debug output enabled */
+
+ if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
+ {
+ return;
+ }
+
+ /* Walk list and dump all resource descriptors (END_TAG terminates) */
+
+ do
+ {
+ AcpiOsPrintf ("\n[%02X] ", Count);
+ Count++;
+
+ /* Validate Type before dispatch */
+
+ Type = ResourceList->Type;
+ if (Type > ACPI_RESOURCE_TYPE_MAX)
+ {
+ AcpiOsPrintf (
+ "Invalid descriptor type (%X) in resource list\n",
+ ResourceList->Type);
+ return;
+ }
+
+ /* Sanity check the length. It must not be zero, or we loop forever */
+
+ if (!ResourceList->Length)
+ {
+ AcpiOsPrintf (
+ "Invalid zero length descriptor in resource list\n");
+ return;
+ }
+
+ /* Dump the resource descriptor */
+
+ if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
+ {
+ AcpiRsDumpDescriptor (&ResourceList->Data,
+ AcpiGbl_DumpSerialBusDispatch[
+ ResourceList->Data.CommonSerialBus.Type]);
+ }
+ else
+ {
+ AcpiRsDumpDescriptor (&ResourceList->Data,
+ AcpiGbl_DumpResourceDispatch[Type]);
+ }
+
+ /* Point to the next resource structure */
+
+ ResourceList = ACPI_NEXT_RESOURCE (ResourceList);
+
+ /* Exit when END_TAG descriptor is reached */
+
+ } while (Type != ACPI_RESOURCE_TYPE_END_TAG);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiRsDumpIrqList
+ *
+ * PARAMETERS: RouteTable - Pointer to the routing table to dump.
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Print IRQ routing table
+ *
+ ******************************************************************************/
+
+void
+AcpiRsDumpIrqList (
+ UINT8 *RouteTable)
+{
+ ACPI_PCI_ROUTING_TABLE *PrtElement;
+ UINT8 Count;
+
+
+ ACPI_FUNCTION_ENTRY ();
+
+
+ /* Check if debug output enabled */
+
+ if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
+ {
+ return;
+ }
+
+ PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
+
+ /* Dump all table elements, Exit on zero length element */
+
+ for (Count = 0; PrtElement->Length; Count++)
+ {
+ AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
+ AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
+
+ PrtElement = ACPI_ADD_PTR (ACPI_PCI_ROUTING_TABLE,
+ PrtElement, PrtElement->Length);
+ }
+}
/*******************************************************************************
@@ -288,14 +416,16 @@ AcpiRsDumpDescriptor (
/*
* Common flags for all Address resources
*/
- AcpiRsDumpAddressCommon (ACPI_CAST_PTR (ACPI_RESOURCE_DATA, Target));
+ AcpiRsDumpAddressCommon (ACPI_CAST_PTR (
+ ACPI_RESOURCE_DATA, Target));
break;
case ACPI_RSD_SOURCE:
/*
* Optional ResourceSource for Address resources
*/
- AcpiRsDumpResourceSource (ACPI_CAST_PTR (ACPI_RESOURCE_SOURCE, Target));
+ AcpiRsDumpResourceSource (ACPI_CAST_PTR (
+ ACPI_RESOURCE_SOURCE, Target));
break;
default:
@@ -399,131 +529,6 @@ AcpiRsDumpAddressCommon (
/*******************************************************************************
*
- * FUNCTION: AcpiRsDumpResourceList
- *
- * PARAMETERS: ResourceList - Pointer to a resource descriptor list
- *
- * RETURN: None
- *
- * DESCRIPTION: Dispatches the structure to the correct dump routine.
- *
- ******************************************************************************/
-
-void
-AcpiRsDumpResourceList (
- ACPI_RESOURCE *ResourceList)
-{
- UINT32 Count = 0;
- UINT32 Type;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- /* Check if debug output enabled */
-
- if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
- {
- return;
- }
-
- /* Walk list and dump all resource descriptors (END_TAG terminates) */
-
- do
- {
- AcpiOsPrintf ("\n[%02X] ", Count);
- Count++;
-
- /* Validate Type before dispatch */
-
- Type = ResourceList->Type;
- if (Type > ACPI_RESOURCE_TYPE_MAX)
- {
- AcpiOsPrintf (
- "Invalid descriptor type (%X) in resource list\n",
- ResourceList->Type);
- return;
- }
-
- /* Sanity check the length. It must not be zero, or we loop forever */
-
- if (!ResourceList->Length)
- {
- AcpiOsPrintf (
- "Invalid zero length descriptor in resource list\n");
- return;
- }
-
- /* Dump the resource descriptor */
-
- if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
- {
- AcpiRsDumpDescriptor (&ResourceList->Data,
- AcpiGbl_DumpSerialBusDispatch[ResourceList->Data.CommonSerialBus.Type]);
- }
- else
- {
- AcpiRsDumpDescriptor (&ResourceList->Data,
- AcpiGbl_DumpResourceDispatch[Type]);
- }
-
- /* Point to the next resource structure */
-
- ResourceList = ACPI_NEXT_RESOURCE (ResourceList);
-
- /* Exit when END_TAG descriptor is reached */
-
- } while (Type != ACPI_RESOURCE_TYPE_END_TAG);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiRsDumpIrqList
- *
- * PARAMETERS: RouteTable - Pointer to the routing table to dump.
- *
- * RETURN: None
- *
- * DESCRIPTION: Print IRQ routing table
- *
- ******************************************************************************/
-
-void
-AcpiRsDumpIrqList (
- UINT8 *RouteTable)
-{
- ACPI_PCI_ROUTING_TABLE *PrtElement;
- UINT8 Count;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- /* Check if debug output enabled */
-
- if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
- {
- return;
- }
-
- PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
-
- /* Dump all table elements, Exit on zero length element */
-
- for (Count = 0; PrtElement->Length; Count++)
- {
- AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
- AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
-
- PrtElement = ACPI_ADD_PTR (ACPI_PCI_ROUTING_TABLE,
- PrtElement, PrtElement->Length);
- }
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiRsOut*
*
* PARAMETERS: Title - Name of the resource field
@@ -620,8 +625,8 @@ AcpiRsDumpByteList (
static void
AcpiRsDumpShortByteList (
- UINT8 Length,
- UINT8 *Data)
+ UINT8 Length,
+ UINT8 *Data)
{
UINT8 i;
diff --git a/source/components/resources/rsdumpinfo.c b/source/components/resources/rsdumpinfo.c
index ad6a27529421..157ba79d485a 100644
--- a/source/components/resources/rsdumpinfo.c
+++ b/source/components/resources/rsdumpinfo.c
@@ -161,11 +161,12 @@ ACPI_RSDUMP_INFO AcpiRsDumpAddress16[8] =
{
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress16), "16-Bit WORD Address Space",NULL},
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
- {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Granularity), "Granularity", NULL},
- {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Minimum), "Address Minimum", NULL},
- {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Maximum), "Address Maximum", NULL},
- {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.TranslationOffset), "Translation Offset", NULL},
- {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.AddressLength), "Address Length", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.Granularity), "Granularity", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.Minimum), "Address Minimum", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.Maximum), "Address Maximum", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.TranslationOffset),
+ "Translation Offset", NULL},
+ {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Address.AddressLength), "Address Length", NULL},
{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address16.ResourceSource), NULL, NULL}
};
@@ -173,11 +174,12 @@ ACPI_RSDUMP_INFO AcpiRsDumpAddress32[8] =
{
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress32), "32-Bit DWORD Address Space", NULL},
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
- {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Granularity), "Granularity", NULL},
- {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Minimum), "Address Minimum", NULL},
- {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Maximum), "Address Maximum", NULL},
- {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.TranslationOffset), "Translation Offset", NULL},
- {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.AddressLength), "Address Length", NULL},
+ {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.Granularity), "Granularity", NULL},
+ {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.Minimum), "Address Minimum", NULL},
+ {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.Maximum), "Address Maximum", NULL},
+ {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.TranslationOffset),
+ "Translation Offset", NULL},
+ {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Address.AddressLength), "Address Length", NULL},
{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address32.ResourceSource), NULL, NULL}
};
@@ -185,11 +187,12 @@ ACPI_RSDUMP_INFO AcpiRsDumpAddress64[8] =
{
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress64), "64-Bit QWORD Address Space", NULL},
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
- {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Granularity), "Granularity", NULL},
- {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Minimum), "Address Minimum", NULL},
- {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Maximum), "Address Maximum", NULL},
- {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.TranslationOffset), "Translation Offset", NULL},
- {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.AddressLength), "Address Length", NULL},
+ {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.Granularity), "Granularity", NULL},
+ {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.Minimum), "Address Minimum", NULL},
+ {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.Maximum), "Address Maximum", NULL},
+ {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.TranslationOffset),
+ "Translation Offset", NULL},
+ {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Address.AddressLength), "Address Length", NULL},
{ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address64.ResourceSource), NULL, NULL}
};
@@ -197,11 +200,13 @@ ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[8] =
{
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtAddress64), "64-Bit Extended Address Space", NULL},
{ACPI_RSD_ADDRESS, 0, NULL, NULL},
- {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Granularity), "Granularity", NULL},
- {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Minimum), "Address Minimum", NULL},
- {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Maximum), "Address Maximum", NULL},
- {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TranslationOffset), "Translation Offset", NULL},
- {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.AddressLength), "Address Length", NULL},
+ {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.Granularity), "Granularity", NULL},
+ {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.Minimum), "Address Minimum", NULL},
+ {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.Maximum), "Address Maximum", NULL},
+ {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.TranslationOffset),
+ "Translation Offset", NULL},
+ {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Address.AddressLength),
+ "Address Length", NULL},
{ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TypeSpecific), "Type-Specific Attribute", NULL}
};
diff --git a/source/components/resources/rsxface.c b/source/components/resources/rsxface.c
index f4c3a24e33eb..cb64c1d08f7e 100644
--- a/source/components/resources/rsxface.c
+++ b/source/components/resources/rsxface.c
@@ -61,11 +61,11 @@
ACPI_COPY_FIELD(Out, In, MinAddressFixed); \
ACPI_COPY_FIELD(Out, In, MaxAddressFixed); \
ACPI_COPY_FIELD(Out, In, Info); \
- ACPI_COPY_FIELD(Out, In, Granularity); \
- ACPI_COPY_FIELD(Out, In, Minimum); \
- ACPI_COPY_FIELD(Out, In, Maximum); \
- ACPI_COPY_FIELD(Out, In, TranslationOffset); \
- ACPI_COPY_FIELD(Out, In, AddressLength); \
+ ACPI_COPY_FIELD(Out, In, Address.Granularity); \
+ ACPI_COPY_FIELD(Out, In, Address.Minimum); \
+ ACPI_COPY_FIELD(Out, In, Address.Maximum); \
+ ACPI_COPY_FIELD(Out, In, Address.TranslationOffset); \
+ ACPI_COPY_FIELD(Out, In, Address.AddressLength); \
ACPI_COPY_FIELD(Out, In, ResourceSource);
diff --git a/source/components/tables/tbdata.c b/source/components/tables/tbdata.c
index c8b8a793f7cc..5c1cfe40d9f2 100644
--- a/source/components/tables/tbdata.c
+++ b/source/components/tables/tbdata.c
@@ -121,7 +121,8 @@ AcpiTbAcquireTable (
case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
- Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, TableDesc->Address);
+ Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER,
+ ACPI_PHYSADDR_TO_PTR (TableDesc->Address));
break;
default:
@@ -227,7 +228,8 @@ AcpiTbAcquireTempTable (
case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
- TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, Address);
+ TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER,
+ ACPI_PHYSADDR_TO_PTR (Address));
if (!TableHeader)
{
return (AE_NO_MEMORY);
@@ -437,11 +439,11 @@ AcpiTbVerifyTempTable (
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
- "%4.4s " ACPI_PRINTF_UINT
+ "%4.4s 0x%8.8X%8.8X"
" Attempted table install failed",
AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ?
TableDesc->Signature.Ascii : "????",
- ACPI_FORMAT_TO_UINT (TableDesc->Address)));
+ ACPI_FORMAT_UINT64 (TableDesc->Address)));
goto InvalidateAndExit;
}
}
@@ -529,21 +531,24 @@ AcpiTbResizeRootTableList (
/*******************************************************************************
*
- * FUNCTION: AcpiTbGetNextRootIndex
+ * FUNCTION: AcpiTbGetNextTableDescriptor
*
* PARAMETERS: TableIndex - Where table index is returned
+ * TableDesc - Where table descriptor is returned
*
- * RETURN: Status and table index.
+ * RETURN: Status and table index/descriptor.
*
* DESCRIPTION: Allocate a new ACPI table entry to the global table list
*
******************************************************************************/
ACPI_STATUS
-AcpiTbGetNextRootIndex (
- UINT32 *TableIndex)
+AcpiTbGetNextTableDescriptor (
+ UINT32 *TableIndex,
+ ACPI_TABLE_DESC **TableDesc)
{
ACPI_STATUS Status;
+ UINT32 i;
/* Ensure that there is room for the table in the Root Table List */
@@ -558,8 +563,18 @@ AcpiTbGetNextRootIndex (
}
}
- *TableIndex = AcpiGbl_RootTableList.CurrentTableCount;
+ i = AcpiGbl_RootTableList.CurrentTableCount;
AcpiGbl_RootTableList.CurrentTableCount++;
+
+ if (TableIndex)
+ {
+ *TableIndex = i;
+ }
+ if (TableDesc)
+ {
+ *TableDesc = &AcpiGbl_RootTableList.Tables[i];
+ }
+
return (AE_OK);
}
diff --git a/source/components/tables/tbinstal.c b/source/components/tables/tbinstal.c
index 6def2545a9aa..e2c6833c36f6 100644
--- a/source/components/tables/tbinstal.c
+++ b/source/components/tables/tbinstal.c
@@ -201,8 +201,8 @@ AcpiTbInstallFixedTable (
ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
if (ACPI_FAILURE (Status))
{
- ACPI_ERROR ((AE_INFO, "Could not acquire table length at %p",
- ACPI_CAST_PTR (void, Address)));
+ ACPI_ERROR ((AE_INFO, "Could not acquire table length at %8.8X%8.8X",
+ ACPI_FORMAT_UINT64 (Address)));
return_ACPI_STATUS (Status);
}
@@ -268,8 +268,8 @@ AcpiTbInstallStandardTable (
Status = AcpiTbAcquireTempTable (&NewTableDesc, Address, Flags);
if (ACPI_FAILURE (Status))
{
- ACPI_ERROR ((AE_INFO, "Could not acquire table length at %p",
- ACPI_CAST_PTR (void, Address)));
+ ACPI_ERROR ((AE_INFO, "Could not acquire table length at %8.8X%8.8X",
+ ACPI_FORMAT_UINT64 (Address)));
return_ACPI_STATUS (Status);
}
@@ -281,8 +281,8 @@ AcpiTbInstallStandardTable (
AcpiGbl_DisableSsdtTableInstall &&
ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT))
{
- ACPI_INFO ((AE_INFO, "Ignoring installation of %4.4s at %p",
- NewTableDesc.Signature.Ascii, ACPI_CAST_PTR (void, Address)));
+ ACPI_INFO ((AE_INFO, "Ignoring installation of %4.4s at %8.8X%8.8X",
+ NewTableDesc.Signature.Ascii, ACPI_FORMAT_UINT64 (Address)));
goto ReleaseAndExit;
}
@@ -368,7 +368,6 @@ AcpiTbInstallStandardTable (
*/
AcpiTbUninstallTable (&NewTableDesc);
*TableIndex = i;
- (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
return_ACPI_STATUS (AE_OK);
}
}
@@ -376,7 +375,7 @@ AcpiTbInstallStandardTable (
/* Add the table to the global root table list */
- Status = AcpiTbGetNextRootIndex (&i);
+ Status = AcpiTbGetNextTableDescriptor (&i, NULL);
if (ACPI_FAILURE (Status))
{
goto ReleaseAndExit;
@@ -459,11 +458,11 @@ FinishOverride:
return;
}
- ACPI_INFO ((AE_INFO, "%4.4s " ACPI_PRINTF_UINT
- " %s table override, new table: " ACPI_PRINTF_UINT,
+ ACPI_INFO ((AE_INFO, "%4.4s 0x%8.8X%8.8X"
+ " %s table override, new table: 0x%8.8X%8.8X",
OldTableDesc->Signature.Ascii,
- ACPI_FORMAT_TO_UINT (OldTableDesc->Address),
- OverrideType, ACPI_FORMAT_TO_UINT (NewTableDesc.Address)));
+ ACPI_FORMAT_UINT64 (OldTableDesc->Address),
+ OverrideType, ACPI_FORMAT_UINT64 (NewTableDesc.Address)));
/* We can now uninstall the original table */
@@ -485,49 +484,6 @@ FinishOverride:
/*******************************************************************************
*
- * FUNCTION: AcpiTbStoreTable
- *
- * PARAMETERS: Address - Table address
- * Table - Table header
- * Length - Table length
- * Flags - Install flags
- * TableIndex - Where the table index is returned
- *
- * RETURN: Status and table index.
- *
- * DESCRIPTION: Add an ACPI table to the global table list
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiTbStoreTable (
- ACPI_PHYSICAL_ADDRESS Address,
- ACPI_TABLE_HEADER *Table,
- UINT32 Length,
- UINT8 Flags,
- UINT32 *TableIndex)
-{
- ACPI_STATUS Status;
- ACPI_TABLE_DESC *TableDesc;
-
-
- Status = AcpiTbGetNextRootIndex (TableIndex);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
- /* Initialize added table */
-
- TableDesc = &AcpiGbl_RootTableList.Tables[*TableIndex];
- AcpiTbInitTableDescriptor (TableDesc, Address, Flags, Table);
- TableDesc->Pointer = Table;
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiTbUninstallTable
*
* PARAMETERS: TableDesc - Table descriptor
@@ -558,7 +514,7 @@ AcpiTbUninstallTable (
if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) ==
ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL)
{
- ACPI_FREE (ACPI_CAST_PTR (void, TableDesc->Address));
+ ACPI_FREE (ACPI_PHYSADDR_TO_PTR (TableDesc->Address));
}
TableDesc->Address = ACPI_PTR_TO_PHYSADDR (NULL);
diff --git a/source/components/tables/tbprint.c b/source/components/tables/tbprint.c
index d214fd7c0abe..48d8d50d461c 100644
--- a/source/components/tables/tbprint.c
+++ b/source/components/tables/tbprint.c
@@ -144,18 +144,12 @@ AcpiTbPrintTableHeader (
ACPI_TABLE_HEADER LocalHeader;
- /*
- * The reason that we use ACPI_PRINTF_UINT and ACPI_FORMAT_TO_UINT is to
- * support both 32-bit and 64-bit hosts/addresses in a consistent manner.
- * The %p specifier does not emit uniform output on all hosts. On some,
- * leading zeros are not supported.
- */
if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_FACS))
{
/* FACS only has signature and length fields */
- ACPI_INFO ((AE_INFO, "%-4.4s " ACPI_PRINTF_UINT " %06X",
- Header->Signature, ACPI_FORMAT_TO_UINT (Address),
+ ACPI_INFO ((AE_INFO, "%-4.4s 0x%8.8X%8.8X %06X",
+ Header->Signature, ACPI_FORMAT_UINT64 (Address),
Header->Length));
}
else if (ACPI_VALIDATE_RSDP_SIG (Header->Signature))
@@ -166,8 +160,8 @@ AcpiTbPrintTableHeader (
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE);
AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE);
- ACPI_INFO ((AE_INFO, "RSDP " ACPI_PRINTF_UINT " %06X (v%.2d %-6.6s)",
- ACPI_FORMAT_TO_UINT (Address),
+ ACPI_INFO ((AE_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,
ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision,
@@ -180,9 +174,9 @@ AcpiTbPrintTableHeader (
AcpiTbCleanupTableHeader (&LocalHeader, Header);
ACPI_INFO ((AE_INFO,
- "%-4.4s " ACPI_PRINTF_UINT
+ "%-4.4s 0x%8.8X%8.8X"
" %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)",
- LocalHeader.Signature, ACPI_FORMAT_TO_UINT (Address),
+ LocalHeader.Signature, ACPI_FORMAT_UINT64 (Address),
LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId,
LocalHeader.OemTableId, LocalHeader.OemRevision,
LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision));
diff --git a/source/components/tables/tbxfroot.c b/source/components/tables/tbxfroot.c
index 01a8e4ada692..92ace5cb02be 100644
--- a/source/components/tables/tbxfroot.c
+++ b/source/components/tables/tbxfroot.c
@@ -158,7 +158,7 @@ AcpiTbValidateRsdp (
ACPI_STATUS
AcpiFindRootPointer (
- ACPI_SIZE *TableAddress)
+ ACPI_PHYSICAL_ADDRESS *TableAddress)
{
UINT8 *TablePtr;
UINT8 *MemRover;
@@ -218,7 +218,7 @@ AcpiFindRootPointer (
PhysicalAddress += (UINT32) ACPI_PTR_DIFF (MemRover, TablePtr);
- *TableAddress = PhysicalAddress;
+ *TableAddress = (ACPI_PHYSICAL_ADDRESS) PhysicalAddress;
return_ACPI_STATUS (AE_OK);
}
}
@@ -249,7 +249,7 @@ AcpiFindRootPointer (
PhysicalAddress = (UINT32)
(ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF (MemRover, TablePtr));
- *TableAddress = PhysicalAddress;
+ *TableAddress = (ACPI_PHYSICAL_ADDRESS) PhysicalAddress;
return_ACPI_STATUS (AE_OK);
}
diff --git a/source/components/utilities/utaddress.c b/source/components/utilities/utaddress.c
index 0a7bafba098a..2ebdea47e830 100644
--- a/source/components/utilities/utaddress.c
+++ b/source/components/utilities/utaddress.c
@@ -117,10 +117,10 @@ AcpiUtAddAddressRange (
AcpiGbl_AddressRangeList[SpaceId] = RangeInfo;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
- "\nAdded [%4.4s] address range: 0x%p-0x%p\n",
+ "\nAdded [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n",
AcpiUtGetNodeName (RangeInfo->RegionNode),
- ACPI_CAST_PTR (void, Address),
- ACPI_CAST_PTR (void, RangeInfo->EndAddress)));
+ ACPI_FORMAT_UINT64 (Address),
+ ACPI_FORMAT_UINT64 (RangeInfo->EndAddress)));
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (AE_OK);
@@ -179,10 +179,10 @@ AcpiUtRemoveAddressRange (
}
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
- "\nRemoved [%4.4s] address range: 0x%p-0x%p\n",
+ "\nRemoved [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n",
AcpiUtGetNodeName (RangeInfo->RegionNode),
- ACPI_CAST_PTR (void, RangeInfo->StartAddress),
- ACPI_CAST_PTR (void, RangeInfo->EndAddress)));
+ ACPI_FORMAT_UINT64 (RangeInfo->StartAddress),
+ ACPI_FORMAT_UINT64 (RangeInfo->EndAddress)));
ACPI_FREE (RangeInfo);
return_VOID;
@@ -266,12 +266,12 @@ AcpiUtCheckAddressRange (
Pathname = AcpiNsGetExternalPathname (RangeInfo->RegionNode);
ACPI_WARNING ((AE_INFO,
- "%s range 0x%p-0x%p conflicts with OpRegion 0x%p-0x%p (%s)",
+ "%s range 0x%8.8X%8.8X-0x%8.8X%8.8X conflicts with OpRegion 0x%8.8X%8.8X-0x%8.8X%8.8X (%s)",
AcpiUtGetRegionName (SpaceId),
- ACPI_CAST_PTR (void, Address),
- ACPI_CAST_PTR (void, EndAddress),
- ACPI_CAST_PTR (void, RangeInfo->StartAddress),
- ACPI_CAST_PTR (void, RangeInfo->EndAddress),
+ ACPI_FORMAT_UINT64 (Address),
+ ACPI_FORMAT_UINT64 (EndAddress),
+ ACPI_FORMAT_UINT64 (RangeInfo->StartAddress),
+ ACPI_FORMAT_UINT64 (RangeInfo->EndAddress),
Pathname));
ACPI_FREE (Pathname);
}
diff --git a/source/components/utilities/utbuffer.c b/source/components/utilities/utbuffer.c
index e677cf1c8fc6..cf99b769922e 100644
--- a/source/components/utilities/utbuffer.c
+++ b/source/components/utilities/utbuffer.c
@@ -158,6 +158,15 @@ AcpiUtDumpBuffer (
return;
}
+ /*
+ * Add comment characters so rest of line is ignored when
+ * compiled
+ */
+ if (j == 0)
+ {
+ AcpiOsPrintf ("// ");
+ }
+
BufChar = Buffer[(ACPI_SIZE) i + j];
if (ACPI_IS_PRINT (BufChar))
{
diff --git a/source/components/utilities/utclib.c b/source/components/utilities/utclib.c
index 8cc04f2cc1c3..e68634b18bbb 100644
--- a/source/components/utilities/utclib.c
+++ b/source/components/utilities/utclib.c
@@ -475,28 +475,25 @@ AcpiUtStrstr (
char *String1,
char *String2)
{
- char *String;
+ UINT32 Length;
- if (AcpiUtStrlen (String2) > AcpiUtStrlen (String1))
+ Length = AcpiUtStrlen (String2);
+ if (!Length)
{
- return (NULL);
+ return (String1);
}
- /* Walk entire string, comparing the letters */
-
- for (String = String1; *String2; )
+ while (AcpiUtStrlen (String1) >= Length)
{
- if (*String2 != *String)
+ if (AcpiUtMemcmp (String1, String2, Length) == 0)
{
- return (NULL);
+ return (String1);
}
-
- String2++;
- String++;
+ String1++;
}
- return (String1);
+ return (NULL);
}
diff --git a/source/components/utilities/utglobal.c b/source/components/utilities/utglobal.c
index 207faf8bbc25..fc5e3b917fee 100644
--- a/source/components/utilities/utglobal.c
+++ b/source/components/utilities/utglobal.c
@@ -111,12 +111,19 @@ const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] =
{"_SB_", ACPI_TYPE_DEVICE, NULL},
{"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL},
{"_TZ_", ACPI_TYPE_DEVICE, NULL},
- {"_REV", ACPI_TYPE_INTEGER, (char *) ACPI_CA_SUPPORT_LEVEL},
+ /*
+ * March, 2015:
+ * The _REV object is in the process of being deprecated, because
+ * other ACPI implementations permanently return 2. Thus, it
+ * has little or no value. Return 2 for compatibility with
+ * other ACPI implementations.
+ */
+ {"_REV", ACPI_TYPE_INTEGER, ACPI_CAST_PTR (char, 2)},
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
- {"_GL_", ACPI_TYPE_MUTEX, (char *) 1},
+ {"_GL_", ACPI_TYPE_MUTEX, ACPI_CAST_PTR (char, 1)},
#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
- {"_OSI", ACPI_TYPE_METHOD, (char *) 1},
+ {"_OSI", ACPI_TYPE_METHOD, ACPI_CAST_PTR (char, 1)},
#endif
/* Table terminator */
diff --git a/source/components/utilities/utmisc.c b/source/components/utilities/utmisc.c
index 08b72bc098aa..d482ad58782a 100644
--- a/source/components/utilities/utmisc.c
+++ b/source/components/utilities/utmisc.c
@@ -84,6 +84,7 @@ AcpiUtIsPciRootBridge (
}
+#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP)
/*******************************************************************************
*
* FUNCTION: AcpiUtIsAmlTable
@@ -114,6 +115,7 @@ AcpiUtIsAmlTable (
return (FALSE);
}
+#endif
/*******************************************************************************
diff --git a/source/components/utilities/utosi.c b/source/components/utilities/utosi.c
index 43a3f49cc82a..f2c1adf70c34 100644
--- a/source/components/utilities/utosi.c
+++ b/source/components/utilities/utosi.c
@@ -105,6 +105,7 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
{"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
{"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */
{"Windows 2013", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
+ {"Windows 2015", NULL, 0, ACPI_OSI_WIN_10}, /* Windows 10 - Added 03/2015 */
/* Feature Group Strings */
diff --git a/source/components/utilities/utprint.c b/source/components/utilities/utprint.c
index 4a0d98aed38f..ffb5e6ad24d1 100644
--- a/source/components/utilities/utprint.c
+++ b/source/components/utilities/utprint.c
@@ -442,11 +442,11 @@ AcpiUtVsnprintf (
const char *Format,
va_list Args)
{
- UINT8 Base = 10;
- UINT8 Type = 0;
- INT32 Width = -1;
- INT32 Precision = -1;
- char Qualifier = 0;
+ UINT8 Base;
+ UINT8 Type;
+ INT32 Width;
+ INT32 Precision;
+ char Qualifier;
UINT64 Number;
char *Pos;
char *End;
@@ -468,6 +468,9 @@ AcpiUtVsnprintf (
continue;
}
+ Type = 0;
+ Base = 10;
+
/* Process sign */
do
diff --git a/source/components/utilities/utstate.c b/source/components/utilities/utstate.c
index ed75a2110b01..49fc8e9b8df1 100644
--- a/source/components/utilities/utstate.c
+++ b/source/components/utilities/utstate.c
@@ -50,44 +50,6 @@
/*******************************************************************************
*
- * FUNCTION: AcpiUtCreatePkgStateAndPush
- *
- * PARAMETERS: Object - Object to be added to the new state
- * Action - Increment/Decrement
- * StateList - List the state will be added to
- *
- * RETURN: Status
- *
- * DESCRIPTION: Create a new state and push it
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiUtCreatePkgStateAndPush (
- void *InternalObject,
- void *ExternalObject,
- UINT16 Index,
- ACPI_GENERIC_STATE **StateList)
-{
- ACPI_GENERIC_STATE *State;
-
-
- ACPI_FUNCTION_ENTRY ();
-
-
- State = AcpiUtCreatePkgState (InternalObject, ExternalObject, Index);
- if (!State)
- {
- return (AE_NO_MEMORY);
- }
-
- AcpiUtPushGenericState (StateList, State);
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiUtPushGenericState
*
* PARAMETERS: ListHead - Head of the state stack
diff --git a/source/components/utilities/utuuid.c b/source/components/utilities/utuuid.c
index 1572f5f98284..7ad4b27ef756 100644
--- a/source/components/utilities/utuuid.c
+++ b/source/components/utilities/utuuid.c
@@ -48,6 +48,7 @@
ACPI_MODULE_NAME ("utuuid")
+#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
/*
* UUID support functions.
*
@@ -99,3 +100,4 @@ AcpiUtConvertStringToUuid (
AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i] + 1]);
}
}
+#endif
diff --git a/source/include/acapps.h b/source/include/acapps.h
index d699a1fad00f..7c4880a12d22 100644
--- a/source/include/acapps.h
+++ b/source/include/acapps.h
@@ -69,15 +69,15 @@
/* Macros for signons and file headers */
#define ACPI_COMMON_SIGNON(UtilityName) \
- "\n%s\n%s version %8.8X%s [%s]\n%s\n\n", \
+ "\n%s\n%s version %8.8X%s\n%s\n\n", \
ACPICA_NAME, \
- UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
+ UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \
ACPICA_COPYRIGHT
#define ACPI_COMMON_HEADER(UtilityName, Prefix) \
- "%s%s\n%s%s version %8.8X%s [%s]\n%s%s\n%s\n", \
+ "%s%s\n%s%s version %8.8X%s\n%s%s\n%s\n", \
Prefix, ACPICA_NAME, \
- Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
+ Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \
Prefix, ACPICA_COPYRIGHT, \
Prefix
diff --git a/source/include/acdebug.h b/source/include/acdebug.h
index f6305759a1d7..23464d66ac41 100644
--- a/source/include/acdebug.h
+++ b/source/include/acdebug.h
@@ -77,7 +77,7 @@ typedef struct acpi_db_execute_walk
#define PARAM_LIST(pl) pl
-#define DBTEST_OUTPUT_LEVEL(lvl) if (AcpiGbl_DbOpt_verbose)
+#define DBTEST_OUTPUT_LEVEL(lvl) if (AcpiGbl_DbOpt_Verbose)
#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
AcpiOsPrintf PARAM_LIST(fp);}
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index 7c41e34d7369..f394bd0415ef 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -129,6 +129,7 @@ typedef enum
/* Types used only for the Data Table Compiler */
ACPI_DMT_BUFFER,
+ ACPI_DMT_RAW_BUFFER, /* Large, multiple line buffer */
ACPI_DMT_DEVICE_PATH,
ACPI_DMT_LABEL,
ACPI_DMT_PCI_PATH,
@@ -351,9 +352,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[];
-extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[];
-extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[];
-extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[];
@@ -422,6 +421,15 @@ AcpiDmLineHeader2 (
* dmtbdump
*/
void
+AcpiDmDumpBuffer (
+ void *Table,
+ UINT32 BufferOffset,
+ UINT32 Length,
+ UINT32 AbsoluteOffset,
+ char *Header,
+ BOOLEAN MultiLine);
+
+void
AcpiDmDumpAsf (
ACPI_TABLE_HEADER *Table);
@@ -996,6 +1004,10 @@ AcpiDmCloseOperator (
*/
void
AdDisassemblerHeader (
- char *Filename);
+ char *Filename,
+ UINT8 TableType);
+
+#define ACPI_IS_AML_TABLE 0
+#define ACPI_IS_DATA_TABLE 1
#endif /* __ACDISASM_H__ */
diff --git a/source/include/acglobal.h b/source/include/acglobal.h
index 9b6e936ca6ac..ab2fc26b9a18 100644
--- a/source/include/acglobal.h
+++ b/source/include/acglobal.h
@@ -310,9 +310,10 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_O
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE);
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE);
-ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_disasm);
-ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_verbose);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_Disasm);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_Verbose);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods);
ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods);
ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList);
@@ -325,9 +326,7 @@ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateThreads, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE);
-ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_tables);
-ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_stats);
-ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_ini_methods);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoIniMethods);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOutputToFile);
ACPI_GLOBAL (char *, AcpiGbl_DbBuffer);
diff --git a/source/include/aclocal.h b/source/include/aclocal.h
index 5f9b0f3076fd..9729930614db 100644
--- a/source/include/aclocal.h
+++ b/source/include/aclocal.h
@@ -54,7 +54,7 @@ typedef UINT32 ACPI_MUTEX_HANDLE;
/* Total number of aml opcodes defined */
-#define AML_NUM_OPCODES 0x81
+#define AML_NUM_OPCODES 0x82
/* Forward declarations */
diff --git a/source/include/acmacros.h b/source/include/acmacros.h
index b23d175221d0..35d53f660780 100644
--- a/source/include/acmacros.h
+++ b/source/include/acmacros.h
@@ -64,23 +64,12 @@
#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (UINT64) (val))
/*
- * printf() format helpers. These macros are workarounds for the difficulties
+ * printf() format helper. This macros is a workaround for the difficulties
* with emitting 64-bit integers and 64-bit pointers with the same code
* for both 32-bit and 64-bit hosts.
*/
#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i)
-#if ACPI_MACHINE_WIDTH == 64
-#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i)
-#define ACPI_FORMAT_TO_UINT(i) ACPI_FORMAT_UINT64(i)
-#define ACPI_PRINTF_UINT "0x%8.8X%8.8X"
-
-#else
-#define ACPI_FORMAT_NATIVE_UINT(i) 0, (UINT32) (i)
-#define ACPI_FORMAT_TO_UINT(i) (UINT32) (i)
-#define ACPI_PRINTF_UINT "0x%8.8X"
-#endif
-
/*
* Macros for moving data around to/from buffers that are possibly unaligned.
diff --git a/source/include/acopcode.h b/source/include/acopcode.h
index f4ba55d3cc21..9432d61106c1 100644
--- a/source/include/acopcode.h
+++ b/source/include/acopcode.h
@@ -112,6 +112,7 @@
#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA)
#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST)
#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME)
+#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_BYTEDATA)
#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG)
#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST)
#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
@@ -245,6 +246,7 @@
#define ARGI_DWORD_OP ARGI_INVALID_OPCODE
#define ARGI_ELSE_OP ARGI_INVALID_OPCODE
#define ARGI_EVENT_OP ARGI_INVALID_OPCODE
+#define ARGI_EXTERNAL_OP ARGI_LIST3 (ARGI_STRING, ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
diff --git a/source/include/acpixf.h b/source/include/acpixf.h
index 5769a767a93d..04ae5cda21d0 100644
--- a/source/include/acpixf.h
+++ b/source/include/acpixf.h
@@ -46,7 +46,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20150204
+#define ACPI_CA_VERSION 0x20150408
#include "acconfig.h"
#include "actypes.h"
@@ -503,7 +503,7 @@ AcpiReallocateRootTable (
ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiFindRootPointer (
- ACPI_SIZE *RsdpAddress))
+ ACPI_PHYSICAL_ADDRESS *RsdpAddress))
ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
diff --git a/source/include/acresrc.h b/source/include/acresrc.h
index 61bedc4d7038..d3f740a112af 100644
--- a/source/include/acresrc.h
+++ b/source/include/acresrc.h
@@ -352,8 +352,9 @@ AcpiRsSetResourceLength (
/*
- * rsdump
+ * rsdump - Debugger support
*/
+#ifdef ACPI_DEBUGGER
void
AcpiRsDumpResourceList (
ACPI_RESOURCE *Resource);
@@ -361,6 +362,7 @@ AcpiRsDumpResourceList (
void
AcpiRsDumpIrqList (
UINT8 *RouteTable);
+#endif
/*
diff --git a/source/include/acrestyp.h b/source/include/acrestyp.h
index 971dd7210328..d69545131e62 100644
--- a/source/include/acrestyp.h
+++ b/source/include/acrestyp.h
@@ -345,6 +345,36 @@ typedef struct acpi_resource_source
UINT8 MaxAddressFixed; \
ACPI_RESOURCE_ATTRIBUTE Info;
+typedef struct acpi_address16_attribute
+{
+ UINT16 Granularity;
+ UINT16 Minimum;
+ UINT16 Maximum;
+ UINT16 TranslationOffset;
+ UINT16 AddressLength;
+
+} ACPI_ADDRESS16_ATTRIBUTE;
+
+typedef struct acpi_address32_attribute
+{
+ UINT32 Granularity;
+ UINT32 Minimum;
+ UINT32 Maximum;
+ UINT32 TranslationOffset;
+ UINT32 AddressLength;
+
+} ACPI_ADDRESS32_ATTRIBUTE;
+
+typedef struct acpi_address64_attribute
+{
+ UINT64 Granularity;
+ UINT64 Minimum;
+ UINT64 Maximum;
+ UINT64 TranslationOffset;
+ UINT64 AddressLength;
+
+} ACPI_ADDRESS64_ATTRIBUTE;
+
typedef struct acpi_resource_address
{
ACPI_RESOURCE_ADDRESS_COMMON
@@ -354,11 +384,7 @@ typedef struct acpi_resource_address
typedef struct acpi_resource_address16
{
ACPI_RESOURCE_ADDRESS_COMMON
- UINT16 Granularity;
- UINT16 Minimum;
- UINT16 Maximum;
- UINT16 TranslationOffset;
- UINT16 AddressLength;
+ ACPI_ADDRESS16_ATTRIBUTE Address;
ACPI_RESOURCE_SOURCE ResourceSource;
} ACPI_RESOURCE_ADDRESS16;
@@ -366,11 +392,7 @@ typedef struct acpi_resource_address16
typedef struct acpi_resource_address32
{
ACPI_RESOURCE_ADDRESS_COMMON
- UINT32 Granularity;
- UINT32 Minimum;
- UINT32 Maximum;
- UINT32 TranslationOffset;
- UINT32 AddressLength;
+ ACPI_ADDRESS32_ATTRIBUTE Address;
ACPI_RESOURCE_SOURCE ResourceSource;
} ACPI_RESOURCE_ADDRESS32;
@@ -378,11 +400,7 @@ typedef struct acpi_resource_address32
typedef struct acpi_resource_address64
{
ACPI_RESOURCE_ADDRESS_COMMON
- UINT64 Granularity;
- UINT64 Minimum;
- UINT64 Maximum;
- UINT64 TranslationOffset;
- UINT64 AddressLength;
+ ACPI_ADDRESS64_ATTRIBUTE Address;
ACPI_RESOURCE_SOURCE ResourceSource;
} ACPI_RESOURCE_ADDRESS64;
@@ -391,11 +409,7 @@ typedef struct acpi_resource_extended_address64
{
ACPI_RESOURCE_ADDRESS_COMMON
UINT8 RevisionID;
- UINT64 Granularity;
- UINT64 Minimum;
- UINT64 Maximum;
- UINT64 TranslationOffset;
- UINT64 AddressLength;
+ ACPI_ADDRESS64_ATTRIBUTE Address;
UINT64 TypeSpecific;
} ACPI_RESOURCE_EXTENDED_ADDRESS64;
diff --git a/source/include/acstruct.h b/source/include/acstruct.h
index 1de614ff5320..547921b34b40 100644
--- a/source/include/acstruct.h
+++ b/source/include/acstruct.h
@@ -69,11 +69,6 @@
#define ACPI_WALK_METHOD 0x01
#define ACPI_WALK_METHOD_RESTART 0x02
-/* Flags for iASL compiler only */
-
-#define ACPI_WALK_CONST_REQUIRED 0x10
-#define ACPI_WALK_CONST_OPTIONAL 0x20
-
typedef struct acpi_walk_state
{
diff --git a/source/include/actables.h b/source/include/actables.h
index bc1574ddca98..3eb02d34a151 100644
--- a/source/include/actables.h
+++ b/source/include/actables.h
@@ -70,8 +70,9 @@ AcpiTbScanMemoryForRsdp (
* tbdata - table data structure management
*/
ACPI_STATUS
-AcpiTbGetNextRootIndex (
- UINT32 *TableIndex);
+AcpiTbGetNextTableDescriptor (
+ UINT32 *TableIndex,
+ ACPI_TABLE_DESC **TableDesc);
void
AcpiTbInitTableDescriptor (
@@ -173,14 +174,6 @@ AcpiTbInstallStandardTable (
BOOLEAN Override,
UINT32 *TableIndex);
-ACPI_STATUS
-AcpiTbStoreTable (
- ACPI_PHYSICAL_ADDRESS Address,
- ACPI_TABLE_HEADER *Table,
- UINT32 Length,
- UINT8 Flags,
- UINT32 *TableIndex);
-
void
AcpiTbUninstallTable (
ACPI_TABLE_DESC *TableDesc);
diff --git a/source/include/actbl2.h b/source/include/actbl2.h
index 2251af8e0547..0dd988b6586a 100644
--- a/source/include/actbl2.h
+++ b/source/include/actbl2.h
@@ -75,6 +75,7 @@
#define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
+#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */
#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
@@ -979,7 +980,8 @@ typedef struct acpi_lpit_header
enum AcpiLpitType
{
ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
- ACPI_LPIT_TYPE_SIMPLE_IO = 0x01
+ ACPI_LPIT_TYPE_SIMPLE_IO = 0x01,
+ ACPI_LPIT_TYPE_RESERVED = 0x02 /* 2 and above are reserved */
};
/* Masks for Flags field above */
@@ -1084,6 +1086,24 @@ typedef struct acpi_table_mchi
/*******************************************************************************
*
+ * MSDM - Microsoft Data Management table
+ *
+ * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
+ * November 29, 2011. Copyright 2011 Microsoft
+ *
+ ******************************************************************************/
+
+/* Basic MSDM table is only the common ACPI header */
+
+typedef struct acpi_table_msdm
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+
+} ACPI_TABLE_MSDM;
+
+
+/*******************************************************************************
+ *
* MTMR - MID Timer Table
* Version 1
*
@@ -1113,10 +1133,9 @@ typedef struct acpi_mtmr_entry
/*******************************************************************************
*
* SLIC - Software Licensing Description Table
- * Version 1
*
- * Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems",
- * Copyright 2006
+ * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
+ * November 29, 2011. Copyright 2011 Microsoft
*
******************************************************************************/
@@ -1129,62 +1148,6 @@ typedef struct acpi_table_slic
} ACPI_TABLE_SLIC;
-/* Common SLIC subtable header */
-
-typedef struct acpi_slic_header
-{
- UINT32 Type;
- UINT32 Length;
-
-} ACPI_SLIC_HEADER;
-
-/* Values for Type field above */
-
-enum AcpiSlicType
-{
- ACPI_SLIC_TYPE_PUBLIC_KEY = 0,
- ACPI_SLIC_TYPE_WINDOWS_MARKER = 1,
- ACPI_SLIC_TYPE_RESERVED = 2 /* 2 and greater are reserved */
-};
-
-
-/*
- * SLIC Subtables, correspond to Type in ACPI_SLIC_HEADER
- */
-
-/* 0: Public Key Structure */
-
-typedef struct acpi_slic_key
-{
- ACPI_SLIC_HEADER Header;
- UINT8 KeyType;
- UINT8 Version;
- UINT16 Reserved;
- UINT32 Algorithm;
- char Magic[4];
- UINT32 BitLength;
- UINT32 Exponent;
- UINT8 Modulus[128];
-
-} ACPI_SLIC_KEY;
-
-
-/* 1: Windows Marker Structure */
-
-typedef struct acpi_slic_marker
-{
- ACPI_SLIC_HEADER Header;
- UINT32 Version;
- char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
- char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
- char WindowsFlag[8];
- UINT32 SlicVersion;
- UINT8 Reserved[16];
- UINT8 Signature[128];
-
-} ACPI_SLIC_MARKER;
-
-
/*******************************************************************************
*
* SPCR - Serial Port Console Redirection table
diff --git a/source/include/actypes.h b/source/include/actypes.h
index c6f2170ce89b..79ae3103e735 100644
--- a/source/include/actypes.h
+++ b/source/include/actypes.h
@@ -201,9 +201,29 @@ typedef int INT32;
typedef INT32 ACPI_NATIVE_INT;
typedef UINT32 ACPI_SIZE;
+
+#ifdef ACPI_32BIT_PHYSICAL_ADDRESS
+
+/*
+ * OSPMs can define this to shrink the size of the structures for 32-bit
+ * none PAE environment. ASL compiler may always define this to generate
+ * 32-bit OSPM compliant tables.
+ */
typedef UINT32 ACPI_IO_ADDRESS;
typedef UINT32 ACPI_PHYSICAL_ADDRESS;
+#else /* ACPI_32BIT_PHYSICAL_ADDRESS */
+
+/*
+ * It is reported that, after some calculations, the physical addresses can
+ * wrap over the 32-bit boundary on 32-bit PAE environment.
+ * https://bugzilla.kernel.org/show_bug.cgi?id=87971
+ */
+typedef UINT64 ACPI_IO_ADDRESS;
+typedef UINT64 ACPI_PHYSICAL_ADDRESS;
+
+#endif /* ACPI_32BIT_PHYSICAL_ADDRESS */
+
#define ACPI_MAX_PTR ACPI_UINT32_MAX
#define ACPI_SIZE_MAX ACPI_UINT32_MAX
@@ -720,23 +740,26 @@ typedef UINT32 ACPI_EVENT_TYPE;
* The encoding of ACPI_EVENT_STATUS is illustrated below.
* Note that a set bit (1) indicates the property is TRUE
* (e.g. if bit 0 is set then the event is enabled).
- * +-------------+-+-+-+-+
- * | Bits 31:4 |3|2|1|0|
- * +-------------+-+-+-+-+
- * | | | | |
- * | | | | +- Enabled?
- * | | | +--- Enabled for wake?
- * | | +----- Set?
- * | +------- Has a handler?
- * +------------- <Reserved>
+ * +-------------+-+-+-+-+-+
+ * | Bits 31:5 |4|3|2|1|0|
+ * +-------------+-+-+-+-+-+
+ * | | | | | |
+ * | | | | | +- Enabled?
+ * | | | | +--- Enabled for wake?
+ * | | | +----- Status bit set?
+ * | | +------- Enable bit set?
+ * | +--------- Has a handler?
+ * +--------------- <Reserved>
*/
typedef UINT32 ACPI_EVENT_STATUS;
#define ACPI_EVENT_FLAG_DISABLED (ACPI_EVENT_STATUS) 0x00
#define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01
#define ACPI_EVENT_FLAG_WAKE_ENABLED (ACPI_EVENT_STATUS) 0x02
-#define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x04
-#define ACPI_EVENT_FLAG_HAS_HANDLER (ACPI_EVENT_STATUS) 0x08
+#define ACPI_EVENT_FLAG_STATUS_SET (ACPI_EVENT_STATUS) 0x04
+#define ACPI_EVENT_FLAG_ENABLE_SET (ACPI_EVENT_STATUS) 0x08
+#define ACPI_EVENT_FLAG_HAS_HANDLER (ACPI_EVENT_STATUS) 0x10
+#define ACPI_EVENT_FLAG_SET ACPI_EVENT_FLAG_STATUS_SET
/* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
@@ -1344,6 +1367,7 @@ typedef struct acpi_memory_list
#define ACPI_OSI_WIN_VISTA_SP2 0x0A
#define ACPI_OSI_WIN_7 0x0B
#define ACPI_OSI_WIN_8 0x0C
+#define ACPI_OSI_WIN_10 0x0D
/* Definitions of file IO */
diff --git a/source/include/acutils.h b/source/include/acutils.h
index b302dbebb3ed..e95fc3837063 100644
--- a/source/include/acutils.h
+++ b/source/include/acutils.h
@@ -723,6 +723,12 @@ const ACPI_PREDEFINED_INFO *
AcpiUtMatchPredefinedMethod (
char *Name);
+void
+AcpiUtGetExpectedReturnTypes (
+ char *Buffer,
+ UINT32 ExpectedBtypes);
+
+#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
const ACPI_PREDEFINED_INFO *
AcpiUtMatchResourceName (
char *Name);
@@ -733,15 +739,11 @@ AcpiUtDisplayPredefinedMethod (
const ACPI_PREDEFINED_INFO *ThisName,
BOOLEAN MultiLine);
-void
-AcpiUtGetExpectedReturnTypes (
- char *Buffer,
- UINT32 ExpectedBtypes);
-
UINT32
AcpiUtGetResourceBitWidth (
char *Buffer,
UINT16 Types);
+#endif
/*
@@ -782,13 +784,6 @@ AcpiUtCreateUpdateStateAndPush (
UINT16 Action,
ACPI_GENERIC_STATE **StateList);
-ACPI_STATUS
-AcpiUtCreatePkgStateAndPush (
- void *InternalObject,
- void *ExternalObject,
- UINT16 Index,
- ACPI_GENERIC_STATE **StateList);
-
ACPI_GENERIC_STATE *
AcpiUtCreateControlState (
void);
@@ -827,9 +822,11 @@ BOOLEAN
AcpiUtIsPciRootBridge (
char *Id);
+#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP)
BOOLEAN
AcpiUtIsAmlTable (
ACPI_TABLE_HEADER *Table);
+#endif
ACPI_STATUS
AcpiUtWalkPackageTree (
@@ -918,6 +915,7 @@ void
AcpiUtStrupr (
char *SrcString);
+#ifdef ACPI_ASL_COMPILER
void
AcpiUtStrlwr (
char *SrcString);
@@ -926,6 +924,7 @@ int
AcpiUtStricmp (
char *String1,
char *String2);
+#endif
ACPI_STATUS
AcpiUtStrtoul64 (
@@ -938,9 +937,11 @@ AcpiUtPrintString (
char *String,
UINT16 MaxLength);
+#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP
void
UtConvertBackslashes (
char *Pathname);
+#endif
BOOLEAN
AcpiUtValidAcpiName (
@@ -1187,9 +1188,11 @@ AcpiUtFilePrintf (
/*
* utuuid -- UUID support functions
*/
+#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
void
AcpiUtConvertStringToUuid (
char *InString,
UINT8 *UuidBuffer);
+#endif
#endif /* _ACUTILS_H */
diff --git a/source/include/amlcode.h b/source/include/amlcode.h
index 03530b9d8050..d56f6d91f118 100644
--- a/source/include/amlcode.h
+++ b/source/include/amlcode.h
@@ -65,6 +65,7 @@
#define AML_PACKAGE_OP (UINT16) 0x12
#define AML_VAR_PACKAGE_OP (UINT16) 0x13 /* ACPI 2.0 */
#define AML_METHOD_OP (UINT16) 0x14
+#define AML_EXTERNAL_OP (UINT16) 0x15 /* ACPI 6.0 */
#define AML_DUAL_NAME_PREFIX (UINT16) 0x2e
#define AML_MULTI_NAME_PREFIX_OP (UINT16) 0x2f
#define AML_NAME_CHAR_SUBSEQ (UINT16) 0x30
@@ -209,7 +210,6 @@
#define AML_INT_RESERVEDFIELD_OP (UINT16) 0x0031
#define AML_INT_ACCESSFIELD_OP (UINT16) 0x0032
#define AML_INT_BYTELIST_OP (UINT16) 0x0033
-#define AML_INT_STATICSTRING_OP (UINT16) 0x0034
#define AML_INT_METHODCALL_OP (UINT16) 0x0035
#define AML_INT_RETURN_VALUE_OP (UINT16) 0x0036
#define AML_INT_EVAL_SUBTREE_OP (UINT16) 0x0037
diff --git a/source/include/platform/acdragonfly.h b/source/include/platform/acdragonfly.h
new file mode 100644
index 000000000000..8fcc5125b377
--- /dev/null
+++ b/source/include/platform/acdragonfly.h
@@ -0,0 +1,130 @@
+/******************************************************************************
+ *
+ * Name: acdragonfly.h - OS specific for DragonFly BSD
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACDRAGONFLY_H_
+#define __ACDRAGONFLY_H_
+
+#include <platform/acgcc.h> /* DragonFly uses GCC */
+#include <sys/types.h>
+
+#ifdef __LP64__
+#define ACPI_MACHINE_WIDTH 64
+#else
+#define ACPI_MACHINE_WIDTH 32
+#define ACPI_USE_NATIVE_DIVIDE
+#endif
+
+#define ACPI_UINTPTR_T uintptr_t
+#define COMPILER_DEPENDENT_INT64 int64_t
+#define COMPILER_DEPENDENT_UINT64 uint64_t
+
+#define ACPI_USE_DO_WHILE_0
+#define ACPI_USE_SYSTEM_CLIBRARY
+
+#ifdef _KERNEL
+
+#include "opt_acpi.h"
+#include <sys/ctype.h>
+#include <sys/systm.h>
+#include <machine/acpica_machdep.h>
+#include <stdarg.h>
+
+#ifdef ACPI_DEBUG
+#define ACPI_DEBUG_OUTPUT /* enable debug output */
+#ifdef DEBUGGER_THREADING
+#undef DEBUGGER_THREADING
+#endif /* DEBUGGER_THREADING */
+#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED /* integrated with DDB */
+#if 0 /* XXX */
+#include "opt_ddb.h"
+#ifdef DDB
+#define ACPI_DEBUGGER
+#endif /* DDB */
+#define ACPI_DISASSEMBLER
+#endif
+#endif
+
+#ifdef ACPI_DEBUG_CACHE
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseObject
+#define AcpiOsReleaseObject(Cache, Object) \
+ _AcpiOsReleaseObject((Cache), (Object), __func__, __LINE__)
+#endif
+
+#ifdef ACPI_DEBUG_LOCKS
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireLock
+#define AcpiOsAcquireLock(Handle) \
+ _AcpiOsAcquireLock((Handle), __func__, __LINE__)
+#endif
+
+#ifdef ACPI_DEBUG_MEMMAP
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory
+#define AcpiOsMapMemory(Where, Length) \
+ _AcpiOsMapMemory((Where), (Length), __func__, __LINE__)
+
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory
+#define AcpiOsUnmapMemory(LogicalAddress, Size) \
+ _AcpiOsUnmapMemory((LogicalAddress), (Size), __func__, __LINE__)
+#endif
+
+/* XXX TBI */
+#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitEventsComplete
+#define AcpiOsWaitEventsComplete()
+
+#define USE_NATIVE_ALLOCATE_ZEROED
+
+#define ACPI_SPINLOCK struct acpi_spinlock *
+struct acpi_spinlock;
+
+#define ACPI_CACHE_T struct acpicache
+struct acpicache;
+
+#else /* _KERNEL */
+
+#define ACPI_USE_STANDARD_HEADERS
+
+#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) ACPI_TO_INTEGER (pthread))
+#define ACPI_FLUSH_CPU_CACHE()
+
+#endif /* _KERNEL */
+
+#endif /* __ACDRAGONFLY_H_ */
diff --git a/source/include/platform/acdragonflyex.h b/source/include/platform/acdragonflyex.h
new file mode 100644
index 000000000000..df4902f98180
--- /dev/null
+++ b/source/include/platform/acdragonflyex.h
@@ -0,0 +1,84 @@
+/******************************************************************************
+ *
+ * Name: acdragonflyex.h - Extra OS specific defines, etc. for DragonFly BSD
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2015, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions, and the following disclaimer,
+ * without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ * substantially similar to the "NO WARRANTY" disclaimer below
+ * ("Disclaimer") and any redistribution must be conditioned upon
+ * including a substantially similar Disclaimer requirement for further
+ * binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ * of any contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#ifndef __ACDRAGONFLYEX_H__
+#define __ACDRAGONFLYEX_H__
+
+#ifdef _KERNEL
+
+#ifdef ACPI_DEBUG_CACHE
+ACPI_STATUS
+_AcpiOsReleaseObject (
+ ACPI_CACHE_T *Cache,
+ void *Object,
+ const char *func,
+ int line);
+#endif
+
+#ifdef ACPI_DEBUG_LOCKS
+ACPI_CPU_FLAGS
+_AcpiOsAcquireLock (
+ ACPI_SPINLOCK Spin,
+ const char *func,
+ int line);
+#endif
+
+#ifdef ACPI_DEBUG_MEMMAP
+void *
+_AcpiOsMapMemory (
+ ACPI_PHYSICAL_ADDRESS Where,
+ ACPI_SIZE Length,
+ const char *caller,
+ int line);
+
+void
+_AcpiOsUnmapMemory (
+ void *LogicalAddress,
+ ACPI_SIZE Length,
+ const char *caller,
+ int line);
+#endif
+
+#endif /* _KERNEL */
+
+#endif /* __ACDRAGONFLYEX_H__ */
diff --git a/source/include/platform/acenv.h b/source/include/platform/acenv.h
index 8319714b9421..d390b85b9d55 100644
--- a/source/include/platform/acenv.h
+++ b/source/include/platform/acenv.h
@@ -77,6 +77,7 @@
#define ACPI_LARGE_NAMESPACE_NODE
#define ACPI_DATA_TABLE_DISASSEMBLY
#define ACPI_SINGLE_THREADED
+#define ACPI_32BIT_PHYSICAL_ADDRESS
#endif
/* AcpiExec configuration. Multithreaded with full AML debugger */
diff --git a/source/include/platform/acnetbsd.h b/source/include/platform/acnetbsd.h
index 8e6499647b10..587196001cbf 100644
--- a/source/include/platform/acnetbsd.h
+++ b/source/include/platform/acnetbsd.h
@@ -48,6 +48,10 @@
#include "acgcc.h"
+#define ACPI_UINTPTR_T uintptr_t
+#define ACPI_USE_LOCAL_CACHE
+#define ACPI_CAST_PTHREAD_T(x) ((ACPI_THREAD_ID) ACPI_TO_INTEGER (x))
+
#ifdef _LP64
#define ACPI_MACHINE_WIDTH 64
#else
@@ -57,8 +61,10 @@
#define COMPILER_DEPENDENT_INT64 int64_t
#define COMPILER_DEPENDENT_UINT64 uint64_t
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(_STANDALONE)
+#ifdef _KERNEL_OPT
#include "opt_acpi.h" /* collect build-time options here */
+#endif /* _KERNEL_OPT */
#include <sys/param.h>
#include <sys/systm.h>
@@ -88,26 +94,19 @@
#endif /* DDB */
#endif /* ACPI_DEBUG */
-static __inline int
-isprint(int ch)
-{
- return(isspace(ch) || isascii(ch));
-}
-
-#else /* _KERNEL */
+#else /* defined(_KERNEL) || defined(_STANDALONE) */
#include <ctype.h>
+#include <stdint.h>
/* Not building kernel code, so use libc */
#define ACPI_USE_STANDARD_HEADERS
#define __cli()
#define __sti()
+#define __cdecl
-/* XXX */
-#define __inline inline
-
-#endif /* _KERNEL */
+#endif /* defined(_KERNEL) || defined(_STANDALONE) */
/* Always use NetBSD code over our local versions */
#define ACPI_USE_SYSTEM_CLIBRARY
diff --git a/source/os_specific/service_layers/osfreebsdtbl.c b/source/os_specific/service_layers/osbsdtbl.c
index a0f1c4e82bf5..846eba29a30a 100644
--- a/source/os_specific/service_layers/osfreebsdtbl.c
+++ b/source/os_specific/service_layers/osbsdtbl.c
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * Module Name: osfreebsdtbl - FreeBSD OSL for obtaining ACPI tables
+ * Module Name: osbsdtbl - BSD OSL for obtaining ACPI tables
*
*****************************************************************************/
@@ -43,14 +43,16 @@
#include "acpidump.h"
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#include <kenv.h>
+#endif
#include <unistd.h>
#include <sys/param.h>
#include <sys/sysctl.h>
#define _COMPONENT ACPI_OS_SERVICES
- ACPI_MODULE_NAME ("osfreebsdtbl")
+ ACPI_MODULE_NAME ("osbsdtbl")
/* Local prototypes */
@@ -78,9 +80,12 @@ OslGetTableViaRoot (
/* Hints for RSDP */
-
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#define SYSTEM_KENV "hint.acpi.0.rsdp"
#define SYSTEM_SYSCTL "machdep.acpi_root"
+#elif defined(__NetBSD__)
+#define SYSTEM_SYSCTL "hw.acpi.root"
+#endif
/* Initialization flags */
@@ -371,7 +376,9 @@ static ACPI_STATUS
OslTableInitialize (
void)
{
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
char Buffer[32];
+#endif
ACPI_TABLE_HEADER *MappedTable;
UINT8 *TableAddress;
UINT8 *RsdpAddress;
@@ -395,10 +402,12 @@ OslTableInitialize (
{
Address = Gbl_RsdpBase;
}
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
else if (kenv (KENV_GET, SYSTEM_KENV, Buffer, sizeof (Buffer)) > 0)
{
Address = ACPI_STRTOUL (Buffer, NULL, 0);
}
+#endif
if (!Address)
{
if (sysctlbyname (SYSTEM_SYSCTL, &Address, &Length, NULL, 0) != 0)
diff --git a/source/os_specific/service_layers/osefixf.c b/source/os_specific/service_layers/osefixf.c
index 32e3dd3a84fb..b9b85c59aaf5 100644
--- a/source/os_specific/service_layers/osefixf.c
+++ b/source/os_specific/service_layers/osefixf.c
@@ -45,6 +45,9 @@
#include "accommon.h"
#include "acapps.h"
+#define _COMPONENT ACPI_OS_SERVICES
+ ACPI_MODULE_NAME ("osefixf")
+
/* Local definitions */
@@ -141,7 +144,7 @@ static ACPI_PHYSICAL_ADDRESS
AcpiEfiGetRsdpViaGuid (
EFI_GUID *Guid)
{
- unsigned long Address = 0;
+ ACPI_PHYSICAL_ADDRESS Address = 0;
int i;
@@ -149,13 +152,13 @@ AcpiEfiGetRsdpViaGuid (
{
if (AcpiEfiCompareGuid (&ST->ConfigurationTable[i].VendorGuid, Guid))
{
- Address = (ACPI_PHYSICAL_ADDRESS)
- ST->ConfigurationTable[i].VendorTable;
+ Address = ACPI_PTR_TO_PHYSADDR (
+ ST->ConfigurationTable[i].VendorTable);
break;
}
}
- return ((ACPI_PHYSICAL_ADDRESS) (Address));
+ return (Address);
}
diff --git a/source/os_specific/service_layers/oslinuxtbl.c b/source/os_specific/service_layers/oslinuxtbl.c
index a2dbea3ab3d6..e090a3c94559 100644
--- a/source/os_specific/service_layers/oslinuxtbl.c
+++ b/source/os_specific/service_layers/oslinuxtbl.c
@@ -1319,7 +1319,7 @@ OslTableNameFromFile (
if (isdigit ((int) Filename[ACPI_NAME_SIZE]))
{
- sscanf (&Filename[ACPI_NAME_SIZE], "%d", Instance);
+ sscanf (&Filename[ACPI_NAME_SIZE], "%u", Instance);
}
else if (strlen (Filename) != ACPI_NAME_SIZE)
{
diff --git a/source/os_specific/service_layers/osunixmap.c b/source/os_specific/service_layers/osunixmap.c
index c4323aba3327..95993b2667ad 100644
--- a/source/os_specific/service_layers/osunixmap.c
+++ b/source/os_specific/service_layers/osunixmap.c
@@ -166,6 +166,6 @@ AcpiOsUnmapMemory (
PageSize = AcpiOsGetPageSize ();
- Offset = (ACPI_PHYSICAL_ADDRESS) Where % PageSize;
+ Offset = ACPI_TO_INTEGER (Where) % PageSize;
munmap ((UINT8 *) Where - Offset, (Length + Offset));
}
diff --git a/source/tools/acpiexec/aemain.c b/source/tools/acpiexec/aemain.c
index 75ceaac3f25b..026e5fb9ae39 100644
--- a/source/tools/acpiexec/aemain.c
+++ b/source/tools/acpiexec/aemain.c
@@ -216,7 +216,7 @@ AeDoOptions (
case 'i':
- AcpiGbl_DbOpt_ini_methods = FALSE;
+ AcpiGbl_DbOpt_NoIniMethods = TRUE;
break;
case 'o':
@@ -323,7 +323,6 @@ AeDoOptions (
case 'g':
- AcpiGbl_DbOpt_tables = TRUE;
AcpiGbl_DbFilename = NULL;
break;
@@ -352,8 +351,7 @@ AeDoOptions (
case 'o':
- AcpiGbl_DbOpt_disasm = TRUE;
- AcpiGbl_DbOpt_stats = TRUE;
+ AcpiGbl_DbOpt_Disasm = TRUE;
break;
case 'r':
@@ -468,7 +466,6 @@ main (
goto EnterDebugger;
}
- AcpiGbl_DbOpt_tables = TRUE;
AcpiGbl_CstyleDisassembly = FALSE; /* Not supported for AcpiExec */
TableCount = 0;
@@ -542,7 +539,7 @@ main (
/* Setup initialization flags for ACPICA */
InitFlags = (ACPI_NO_HANDLER_INIT | ACPI_NO_ACPI_ENABLE);
- if (!AcpiGbl_DbOpt_ini_methods)
+ if (AcpiGbl_DbOpt_NoIniMethods)
{
InitFlags |= (ACPI_NO_DEVICE_INIT | ACPI_NO_OBJECT_INIT);
}
diff --git a/source/tools/acpiexec/aeregion.c b/source/tools/acpiexec/aeregion.c
index 1e732b74245e..e1a450c3673c 100644
--- a/source/tools/acpiexec/aeregion.c
+++ b/source/tools/acpiexec/aeregion.c
@@ -687,8 +687,8 @@ AeRegionHandler (
{
/* Right overlap */
- RegionElement->Length = BaseAddress -
- RegionAddress + Length;
+ RegionElement->Length = (UINT32) (BaseAddress -
+ RegionAddress + Length);
BufferResize = TRUE;
}
@@ -699,8 +699,8 @@ AeRegionHandler (
/* Left overlap */
RegionElement->Address = BaseAddress;
- RegionElement->Length = RegionAddress -
- BaseAddress + RegionElement->Length;
+ RegionElement->Length = (UINT32) (RegionAddress -
+ BaseAddress + RegionElement->Length);
BufferResize = TRUE;
}
diff --git a/source/tools/acpiexec/aetables.c b/source/tools/acpiexec/aetables.c
index cb2c05ba5ab3..88726a23920a 100644
--- a/source/tools/acpiexec/aetables.c
+++ b/source/tools/acpiexec/aetables.c
@@ -335,7 +335,7 @@ AeBuildLocalTables (
* Use the external FADT, but we must update the DSDT/FACS addresses
* as well as the checksum
*/
- ExternalFadt->Dsdt = DsdtAddress;
+ ExternalFadt->Dsdt = (UINT32) DsdtAddress;
if (!AcpiGbl_ReducedHardware)
{
ExternalFadt->Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
@@ -362,7 +362,7 @@ AeBuildLocalTables (
else if (AcpiGbl_UseHwReducedFadt)
{
ACPI_MEMCPY (&LocalFADT, HwReducedFadtCode, sizeof (ACPI_TABLE_FADT));
- LocalFADT.Dsdt = DsdtAddress;
+ LocalFADT.Dsdt = (UINT32) DsdtAddress;
LocalFADT.XDsdt = DsdtAddress;
LocalFADT.Header.Checksum = 0;
@@ -558,5 +558,5 @@ AcpiOsGetRootPointer (
void)
{
- return ((ACPI_PHYSICAL_ADDRESS) &LocalRSDP);
+ return (ACPI_PTR_TO_PHYSADDR (&LocalRSDP));
}
diff --git a/source/tools/acpihelp/ahamlops.c b/source/tools/acpihelp/ahamlops.c
index c3344bf00893..8d54887f7275 100644
--- a/source/tools/acpihelp/ahamlops.c
+++ b/source/tools/acpihelp/ahamlops.c
@@ -112,7 +112,7 @@ const AH_AML_OPCODE AmlOpcodeInfo[] =
{0x5B1F, 0x5B1F, "0x5B1F", "LoadTableOp", "TermObject", "TermArg TermArg TermArg TermArg TermArg TermArg", NULL,
"DefLoadTable := LoadTableOp TermArg TermArg TermArg TermArg TermArg TermArg"},
{0x5B20, 0x5B20, "0x5B20", "LoadOp", "TermObject", "NameString SuperName", NULL,
- "DefLoad := LoadOp NameString DDBHandleObject"},
+ "DefLoad := LoadOp NameString DdbHandleObject"},
{0x5B21, 0x5B21, "0x5B21", "StallOp", "TermObject", "TermArg", NULL,
"DefStall := StallOp UsecTime"},
{0x5B22, 0x5B22, "0x5B22", "SleepOp", "TermObject", "TermArg", NULL,
@@ -127,12 +127,12 @@ const AH_AML_OPCODE AmlOpcodeInfo[] =
"DefReset := ResetOp EventObject"},
{0x5B27, 0x5B27, "0x5B27", "ReleaseOp", "TermObject", "SuperName", NULL,
"DefRelease := ReleaseOp MutexObject"},
- {0x5B28, 0x5B28, "0x5B28", "FromBCDOp", "TermObject", "TermArg Target", NULL,
- "DefFromBCD := FromBCDOp BCDValue Target"},
- {0x5B29, 0x5B29, "0x5B29", "ToBCD", "TermObject", "TermArg Target", NULL,
- "DefToBCD := ToBCDOp Operand Target"},
+ {0x5B28, 0x5B28, "0x5B28", "FromBcdOp", "TermObject", "TermArg Target", NULL,
+ "DefFromBcd := FromBcdOp BcdValue Target"},
+ {0x5B29, 0x5B29, "0x5B29", "ToBcd", "TermObject", "TermArg Target", NULL,
+ "DefToBcd := ToBcdOp Operand Target"},
{0x5B2A, 0x5B2A, "0x5B2A", "UnloadOp", "TermObject", "SuperName", NULL,
- "DefUnload := UnloadOp DDBHandleObject"},
+ "DefUnload := UnloadOp DdbHandleObject"},
{0x5B30, 0x5B30, "0x5B30", "RevisionOp", "DataObject", NULL, NULL,
NULL},
{0x5B31, 0x5B31, "0x5B31", "DebugOp", "DebugObject", NULL, NULL,
@@ -148,7 +148,7 @@ const AH_AML_OPCODE AmlOpcodeInfo[] =
{0x5B82, 0x5B82, "0x5B82", "DeviceOp", "TermObject", "NameString", "ObjectList",
"DefDevice := DeviceOp PkgLength NameString ObjectList"},
{0x5B83, 0x5B83, "0x5B83", "ProcessorOp", "TermObject", "NameString ByteData DWordData ByteData", "ObjectList",
- "DefProcessor := ProcessorOp PkgLength NameString ProcID PblkAddr PblkLen ObjectList"},
+ "DefProcessor := ProcessorOp PkgLength NameString ProcId PblkAddr PblkLen ObjectList"},
{0x5B84, 0x5B84, "0x5B84", "PowerResOp", "TermObject", "NameString ByteData WordData", "ObjectList",
"DefPowerRes := PowerResOp PkgLength NameString SystemLevel ResourceOrder ObjectList"},
{0x5B85, 0x5B85, "0x5B85", "ThermalZoneOp", "TermObject", "NameString", "ObjectList",
@@ -226,13 +226,13 @@ const AH_AML_OPCODE AmlOpcodeInfo[] =
{0x7B, 0x7B, "0x7B", "AndOp", "TermObject", "TermArg TermArg Target", NULL,
"DefAnd := AndOp Operand Operand Target"},
{0x7C, 0x7C, "0x7C", "NandOp", "TermObject", "TermArg TermArg Target", NULL,
- "DefNAnd := NandOp Operand Operand Target"},
+ "DefNand := NandOp Operand Operand Target"},
{0x7D, 0x7D, "0x7D", "OrOp", "TermObject", "TermArg TermArg Target", NULL,
"DefOr := OrOp Operand Operand Target"},
{0x7E, 0x7E, "0x7E", "NorOp", "TermObject", "TermArg TermArg Target", NULL,
- "DefNOr := NorOp Operand Operand Target"},
+ "DefNor := NorOp Operand Operand Target"},
{0x7F, 0x7F, "0x7F", "XorOp", "TermObject", "TermArg TermArg Target", NULL,
- "DefXOr := XorOp Operand Operand Target"},
+ "DefXor := XorOp Operand Operand Target"},
{0x80, 0x80, "0x80", "NotOp", "TermObject", "TermArg Target", NULL,
"DefNot := NotOp Operand Target"},
{0x81, 0x81, "0x81", "FindSetLeftBitOp", "TermObject", "TermArg Target", NULL,
@@ -266,23 +266,23 @@ const AH_AML_OPCODE AmlOpcodeInfo[] =
{0x8F, 0x8F, "0x8F", "CreateQWordFieldOp", "TermObject", "TermArg TermArg NameString", NULL,
"DefCreateQWordField := CreateQWordFieldOp SourceBuff ByteIndex NameString"},
{0x90, 0x90, "0x90", "LAndOp", "TermObject", "TermArg TermArg", NULL,
- "DefLAnd := LandOp Operand Operand"},
+ "DefLAnd := LAndOp Operand Operand"},
{0x91, 0x91, "0x91", "LOrOp", "TermObject", "TermArg TermArg", NULL,
- "DefLOr := LorOp Operand Operand"},
+ "DefLOr := LOrOp Operand Operand"},
{0x92, 0x92, "0x92", "LNotOp", "TermObject", "TermArg", NULL,
- "DefLNot := LnotOp Operand"},
+ "DefLNot := LNotOp Operand"},
{0x9293, 0x9293, "0x9293", "LNotEqualOp", "TermObject", "TermArg TermArg", NULL,
- "DefLNotEqual := LnotEqualOp Operand Operand"},
+ "DefLNotEqual := LNotEqualOp Operand Operand"},
{0x9294, 0x9294, "0x9294", "LLessEqualOp", "TermObject", "TermArg TermArg", NULL,
- "DefLLessEqual := LlessEqualOp Operand Operand"},
+ "DefLLessEqual := LLessEqualOp Operand Operand"},
{0x9295, 0x9295, "0x9295", "LGreaterEqualOp", "TermObject", "TermArg TermArg", NULL,
- "DefLGreaterEqual := LgreaterEqualOp Operand Operand"},
+ "DefLGreaterEqual := LGreaterEqualOp Operand Operand"},
{0x93, 0x93, "0x93", "LEqualOp", "TermObject", "TermArg TermArg", NULL,
- "DefLEqual := LequalOp Operand Operand"},
+ "DefLEqual := LEqualOp Operand Operand"},
{0x94, 0x94, "0x94", "LGreaterOp", "TermObject", "TermArg TermArg", NULL,
- "DefLGreater := LgreaterOp Operand Operand"},
+ "DefLGreater := LGreaterOp Operand Operand"},
{0x95, 0x95, "0x95", "LLessOp", "TermObject", "TermArg TermArg", NULL,
- "DefLLess := LlessOp Operand Operand"},
+ "DefLLess := LLessOp Operand Operand"},
{0x96, 0x96, "0x96", "ToBufferOp", "TermObject", "TermArg Target", NULL,
"DefToBuffer := ToBufferOp Operand Target"},
{0x97, 0x97, "0x97", "ToDecimalStringOp", "TermObject", "TermArg Target", NULL,
@@ -307,8 +307,8 @@ const AH_AML_OPCODE AmlOpcodeInfo[] =
"DefElse := Nothing | <ElseOp PkgLength TermList>"},
{0xA2, 0xA2, "0xA2", "WhileOp", "TermObject", "TermArg", "TermList",
"DefWhile := WhileOp PkgLength Predicate TermList"},
- {0xA3, 0xA3, "0xA3", "NoopOp", "TermObject", NULL, NULL,
- "DefNoop := NoopOp"},
+ {0xA3, 0xA3, "0xA3", "NoOpOp", "TermObject", NULL, NULL,
+ "DefNoOp := NoOpOp"},
{0xA4, 0xA4, "0xA4", "ReturnOp", "TermObject", "TermArg", NULL,
"DefReturn := ReturnOp ArgObject"},
{0xA5, 0xA5, "0xA5", "BreakOp", "TermObject", NULL, NULL,
diff --git a/source/tools/acpihelp/ahaslops.c b/source/tools/acpihelp/ahaslops.c
index dca885a3f996..2c20e4283054 100644
--- a/source/tools/acpihelp/ahaslops.c
+++ b/source/tools/acpihelp/ahaslops.c
@@ -116,15 +116,15 @@ const AH_ASL_OPERATOR AslOperatorInfo[] =
"Declare a bus/device object"},
{"Divide", "(Dividend, Divisor, Remainder, Result) => Integer",
"Integer Divide"},
- {"DMA", "(DmaTypeKeyword, BusMasterKeyword, XferTypeKeyword, "
+ {"Dma", "(DmaTypeKeyword, BusMasterKeyword, XferTypeKeyword, "
"DescriptorName) {DmaChannelList} => Buffer",
"DMA Resource Descriptor macro"},
- {"DWordIO", "(ResourceTypeKeyword, MinKeyword, MaxKeyword, "
+ {"DWordIo", "(ResourceTypeKeyword, MinKeyword, MaxKeyword, "
"DecodeKeyword, RangeTypeKeyword, AddressGranularity, "
"AddressMinimum, AddressMaximum, AddressTranslation, "
"RangeLength, ResourceSourceIndex, "
"ResourceSource, DescriptorName, TypeKeyword, TranslationKeyword)",
- "DWord IO Resource Descriptor macro"},
+ "DWord I/O Resource Descriptor macro"},
{"DWordMemory", "(ResourceTypeKeyword, DecodeKeyword, MinKeyword, "
"MaxKeyword, MemTypeKeyword, ReadWriteKeyword, "
"AddressGranularity, AddressMinimum, AddressMaximum, AddressTranslation, "
@@ -137,7 +137,7 @@ const AH_ASL_OPERATOR AslOperatorInfo[] =
"AddressTranslation, RangeLength, "
"ResourceSourceIndex, ResourceSource, DescriptorName)",
"DWord Space Resource Descriptor macro"},
- {"EISAID", "(EisaIdString) => DWordConst",
+ {"EisaId", "(EisaIdString) => DWordConst",
"EISA ID String to Integer conversion macro"},
{"Else", "{TermList}",
"Alternate conditional execution"},
@@ -147,11 +147,11 @@ const AH_ASL_OPERATOR AslOperatorInfo[] =
"End Dependent Function Resource Descriptor macro"},
{"Event", "(EventName)",
"Declare an event synchronization object"},
- {"ExtendedIO", "(ResourceTypeKeyword, MinKeyword, MaxKeyword, "
+ {"ExtendedIo", "(ResourceTypeKeyword, MinKeyword, MaxKeyword, "
"DecodeKeyword, RangeTypeKeyword, AddressGranularity, "
"AddressMinimum, AddressMaximum, AddressTranslation, RangeLength, "
"TypeSpecificAttributes, DescriptorName, TypeKeyword, TranslationKeyword)",
- "Extended IO Resource Descriptor macro"},
+ "Extended I/O Resource Descriptor macro"},
{"ExtendedMemory", "(ResourceTypeKeyword, DecodeKeyword, MinKeyword, "
"MaxKeyword, MemTypeKeyword, ReadWriteKeyword, "
"AddressGranularity, AddressMinimum, AddressMaximum, AddressTranslation, "
@@ -174,11 +174,11 @@ const AH_ASL_OPERATOR AslOperatorInfo[] =
"Index of first least significant bit set"},
{"FindSetRightBit", "(Source, Result) => Integer",
"Index of first most significant bit set"},
- {"FixedDMA", "(DmaRequestLine, Channel, TransferWidthKeyword, DescriptorName) => Buffer",
+ {"FixedDma", "(DmaRequestLine, Channel, TransferWidthKeyword, DescriptorName) => Buffer",
"Fixed DMA Resource Descriptor macro"},
- {"FixedIO", "(AddressBase, RangeLength, DescriptorName) => Buffer",
+ {"FixedIo", "(AddressBase, RangeLength, DescriptorName) => Buffer",
"Fixed I/O Resource Descriptor macro"},
- {"FromBCD", "(BCDValue, Result) => Integer",
+ {"FromBcd", "(BcdValue, Result) => Integer",
"Convert from BCD to numeric"},
{"Function", "(FunctionName, ReturnType, ParameterTypes) {TermList}",
"Declare control method"},
@@ -213,13 +213,13 @@ const AH_ASL_OPERATOR AslOperatorInfo[] =
"ShareTypeKeyword, ResourceSourceIndex, "
"ResourceSource, DescriptorName) {InterruptList} => Buffer",
"Interrupt Resource Descriptor macro"},
- {"IO", "(IoDecodeKeyword, AddressMin, AddressMax, AddressAlignment, "
+ {"Io", "(IoDecodeKeyword, AddressMin, AddressMax, AddressAlignment, "
"RangeLength, DescriptorName) => Buffer",
- "IO Resource Descriptor macro"},
- {"IRQ", "(InterruptTypeKeyword, InterruptLevelKeyword, ShareTypeKeyword, "
+ "I/O Resource Descriptor macro"},
+ {"Irq", "(InterruptTypeKeyword, InterruptLevelKeyword, ShareTypeKeyword, "
"DescriptorName) {InterruptList} => Buffer",
"Interrupt Resource Descriptor macro"},
- {"IRQNoFlags", "(DescriptorName) {InterruptList} => Buffer",
+ {"IrqNoFlags", "(DescriptorName) {InterruptList} => Buffer",
"Short Interrupt Resource Descriptor macro"},
{"LAnd", "(Source1, Source2) => Boolean",
"Logical And"},
@@ -299,12 +299,12 @@ const AH_ASL_OPERATOR AslOperatorInfo[] =
"Declare a power resource object"},
{"Processor", "(ProcessorName, ProcessorID, PBlockAddress, PblockLength) {ObjectList}",
"Declare a processor package"},
- {"QWordIO", "(ResourceTypeKeyword, MinKeyword, MaxKeyword, DecodeKeyword, "
+ {"QWordIo", "(ResourceTypeKeyword, MinKeyword, MaxKeyword, DecodeKeyword, "
"RangeTypeKeyword, AddressGranularity, "
"AddressMinimum, AddressMaximum, AddressTranslation, RangeLength, "
"ResourceSourceIndex, ResourceSource, DescriptorName, TypeKeyword, "
"TranslationKeyword)",
- "QWord IO Resource Descriptor macro"},
+ "QWord I/O Resource Descriptor macro"},
{"QWordMemory", "(ResourceTypeKeyword, DecodeKeyword, MinKeyword, MaxKeyword, "
"MemTypeKeyword, ReadWriteKeyword, "
"AddressGranularity, AddressMinimum, AddressMaximum, AddressTranslation, "
@@ -369,7 +369,7 @@ const AH_ASL_OPERATOR AslOperatorInfo[] =
"Declare a thermal zone package"},
{"Timer", "=> Integer",
"Get 64-bit timer value"},
- {"ToBCD", "(Value, Result) => Integer",
+ {"ToBcd", "(Value, Result) => Integer",
"Convert Integer to BCD"},
{"ToBuffer", "(Data, Result) => Buffer",
"Convert data type to buffer"},
@@ -381,7 +381,7 @@ const AH_ASL_OPERATOR AslOperatorInfo[] =
"Convert data type to integer"},
{"ToString", "(Source, Length, Result) => String",
"Copy ASCII string from buffer"},
- {"ToUUID", "(AsciiString) => Buffer",
+ {"ToUuid", "(AsciiString) => Buffer",
"Convert Ascii string to UUID"},
{"UartSerialBus", "(ConnectionSpeed, ByteLengthKeyword, StopBitsKeyword, "
"LinesInUse, EndianKeyword, ParityKeyword, "
@@ -406,18 +406,18 @@ const AH_ASL_OPERATOR AslOperatorInfo[] =
"AddressMaximum, AddressTranslation, RangeLength, ResourceSourceIndex, "
"ResourceSource, DescriptorName)",
"Word Bus number Resource Descriptor macro"},
- {"WordIO", "(ResourceTypeKeyword, MinKeyword, MaxKeyword, DecodeKeyword, "
+ {"WordIo", "(ResourceTypeKeyword, MinKeyword, MaxKeyword, DecodeKeyword, "
"RangeTypeKeyword, AddressGranularity, "
"AddressMinimum, AddressMaximum, AddressTranslation, RangeLength, "
"ResourceSourceIndex, ResourceSource, DescriptorName, TypeKeyword, "
"TranslationKeyword)",
- "Word IO Resource Descriptor macro"},
+ "Word I/O Resource Descriptor macro"},
{"WordSpace", "(ResourceType, ResourceTypeKeyword, DecodeKeyword, MinKeyword, "
"MaxKeyword, TypeSpecificFlags, "
"AddressGranularity, AddressMinimum, AddressMaximum, AddressTranslation, "
"RangeLength, ResourceSourceIndex, ResourceSource, DescriptorName)",
"Word Space Resource Descriptor macro"},
- {"XOr", "(Source1, Source2, Result) => Integer",
+ {"Xor", "(Source1, Source2, Result) => Integer",
"Integer Bitwise Xor"},
{"Zero", "=> Integer",
"Constant Zero object (0)"},
diff --git a/source/tools/acpinames/antables.c b/source/tools/acpinames/antables.c
index 35320e7c50b0..59922fe1760e 100644
--- a/source/tools/acpinames/antables.c
+++ b/source/tools/acpinames/antables.c
@@ -198,7 +198,7 @@ AeBuildLocalTables (
* Use the external FADT, but we must update the DSDT/FACS addresses
* as well as the checksum
*/
- ExternalFadt->Dsdt = DsdtAddress;
+ ExternalFadt->Dsdt = (UINT32) DsdtAddress;
ExternalFadt->Facs = ACPI_PTR_TO_PHYSADDR (&LocalFACS);
if (ExternalFadt->Header.Length > ACPI_PTR_DIFF (&ExternalFadt->XDsdt, ExternalFadt))
@@ -296,5 +296,5 @@ AcpiOsGetRootPointer (
void)
{
- return ((ACPI_PHYSICAL_ADDRESS) &LocalRSDP);
+ return (ACPI_PTR_TO_PHYSADDR (&LocalRSDP));
}
diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c
index 336242769bc7..d98b08ecf246 100644
--- a/source/tools/acpisrc/astable.c
+++ b/source/tools/acpisrc/astable.c
@@ -172,6 +172,9 @@ ACPI_STRING_TABLE LinuxDataTypes[] = {
ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
+ {"ACPI_ADDRESS16_ATTRIBUTE", SRC_TYPE_STRUCT},
+ {"ACPI_ADDRESS32_ATTRIBUTE", SRC_TYPE_STRUCT},
+ {"ACPI_ADDRESS64_ATTRIBUTE", SRC_TYPE_STRUCT},
{"ACPI_ADDRESS_RANGE", SRC_TYPE_STRUCT},
{"ACPI_ADR_SPACE_HANDLER", SRC_TYPE_SIMPLE},
{"ACPI_ADR_SPACE_SETUP", SRC_TYPE_SIMPLE},
@@ -521,6 +524,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_TABLE_MCHI", SRC_TYPE_STRUCT},
{"ACPI_TABLE_MPST", SRC_TYPE_STRUCT},
{"ACPI_TABLE_MSCT", SRC_TYPE_STRUCT},
+ {"ACPI_TABLE_MSDM", SRC_TYPE_STRUCT},
{"ACPI_TABLE_PCCT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_RSDP", SRC_TYPE_STRUCT},
{"ACPI_TABLE_RSDT", SRC_TYPE_STRUCT},
@@ -631,9 +635,6 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_RSDP_EXTENSION", SRC_TYPE_STRUCT},
{"ACPI_S3PT_RESUME", SRC_TYPE_STRUCT},
{"ACPI_S3PT_SUSPEND", SRC_TYPE_STRUCT},
- {"ACPI_SLIC_HEADER", SRC_TYPE_STRUCT},
- {"ACPI_SLIC_KEY", SRC_TYPE_STRUCT},
- {"ACPI_SLIC_MARKER", SRC_TYPE_STRUCT},
{"ACPI_SRAT_CPU_AFFINITY", SRC_TYPE_STRUCT},
{"ACPI_SRAT_HEADER", SRC_TYPE_STRUCT},
{"ACPI_SRAT_MEM_AFFINITY", SRC_TYPE_STRUCT},
diff --git a/source/tools/examples/extables.c b/source/tools/examples/extables.c
index 054f62ef59a1..6ab3293237ed 100644
--- a/source/tools/examples/extables.c
+++ b/source/tools/examples/extables.c
@@ -235,7 +235,7 @@ AcpiOsGetRootPointer (
void)
{
- return ((ACPI_PHYSICAL_ADDRESS) RsdpCode);
+ return (ACPI_PTR_TO_PHYSADDR (RsdpCode));
}