aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2014-04-25 16:53:42 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2014-04-25 16:53:42 +0000
commit6b8f78e0a6a7880856440b372097482adb326592 (patch)
tree643f58d38011b3076bfc6a234d83f22c69487b8c
parent7c6f304a2eb855cf2d71ca0638d4f3c72f436fcd (diff)
downloadsrc-6b8f78e0a6a7880856440b372097482adb326592.tar.gz
src-6b8f78e0a6a7880856440b372097482adb326592.zip
Import ACPICA 20140424.vendor/acpica/20140424
Notes
Notes: svn path=/vendor-sys/acpica/dist/; revision=264919 svn path=/vendor-sys/acpica/20140424/; revision=264920; tag=vendor/acpica/20140424
-rw-r--r--changes.txt67
-rw-r--r--generate/unix/Makefile.config12
-rw-r--r--generate/unix/iasl/Makefile1
-rw-r--r--source/common/adisasm.c1
-rw-r--r--source/common/ahpredef.c2
-rw-r--r--source/common/dmtable.c34
-rw-r--r--source/common/dmtbdump.c193
-rw-r--r--source/common/dmtbinfo.c57
-rw-r--r--source/compiler/aslanalyze.c48
-rw-r--r--source/compiler/aslcompiler.h29
-rw-r--r--source/compiler/aslerror.c159
-rw-r--r--source/compiler/aslmessages.c407
-rw-r--r--source/compiler/aslmessages.h269
-rw-r--r--source/compiler/aslmethod.c23
-rw-r--r--source/compiler/aslprepkg.c12
-rw-r--r--source/compiler/asltypes.h2
-rw-r--r--source/compiler/dtcompiler.h11
-rw-r--r--source/compiler/dttable.c83
-rw-r--r--source/compiler/dttemplate.h27
-rw-r--r--source/compiler/dtutils.c7
-rw-r--r--source/compiler/preprocess.h2
-rw-r--r--source/compiler/prutils.c2
-rw-r--r--source/components/debugger/dbcmds.c27
-rw-r--r--source/components/debugger/dbinput.c4
-rw-r--r--source/components/events/evgpe.c12
-rw-r--r--source/components/events/evgpeblk.c28
-rw-r--r--source/components/events/evgpeinit.c8
-rw-r--r--source/components/events/evxfgpe.c3
-rw-r--r--source/components/hardware/hwpci.c13
-rw-r--r--source/components/resources/rscreate.c12
-rw-r--r--source/components/tables/tbfadt.c50
-rw-r--r--source/components/tables/tbutils.c123
-rw-r--r--source/components/utilities/utglobal.c30
-rw-r--r--source/components/utilities/utobject.c2
-rw-r--r--source/components/utilities/utxferror.c4
-rw-r--r--source/include/acdisasm.h8
-rw-r--r--source/include/acevents.h5
-rw-r--r--source/include/acglobal.h143
-rw-r--r--source/include/aclocal.h7
-rw-r--r--source/include/acnames.h1
-rw-r--r--source/include/acpixf.h518
-rw-r--r--source/include/acpredef.h4
-rw-r--r--source/include/actbl1.h4
-rw-r--r--source/include/actbl2.h83
-rw-r--r--source/include/actypes.h35
-rw-r--r--source/include/platform/aclinux.h33
-rw-r--r--source/os_specific/service_layers/oslinuxtbl.c111
-rw-r--r--source/os_specific/service_layers/osunixxf.c23
-rw-r--r--source/tools/acpidump/acpidump.h22
-rw-r--r--source/tools/acpidump/apmain.c16
-rw-r--r--source/tools/acpiexec/aeexec.c8
-rw-r--r--source/tools/acpiexec/aehandlers.c2
-rw-r--r--source/tools/acpiexec/aetables.c6
-rw-r--r--source/tools/acpisrc/astable.c9
54 files changed, 1901 insertions, 901 deletions
diff --git a/changes.txt b/changes.txt
index ab9cb551e791..e93fc4dc7b14 100644
--- a/changes.txt
+++ b/changes.txt
@@ -1,4 +1,71 @@
----------------------------------------
+24 April 2014. Summary of changes for version 20140424:
+
+1) ACPICA kernel-resident subsystem:
+
+Implemented support to skip/ignore NULL address entries in the RSDT/XSDT.
+Some of these tables are known to contain a trailing NULL entry. Lv
+Zheng.
+
+Removed an extraneous error message for the case where there are a large
+number of system GPEs (> 124). This was the "32-bit FADT register is too
+long to convert to GAS struct" message, which is irrelevant for GPEs
+since the GPEx_BLK_LEN fields of the FADT are always used instead of the
+(limited capacity) GAS bit length. Also, several changes to ensure proper
+support for GPE numbers > 255, where some "GPE number" fields were 8-bits
+internally.
+
+Implemented and deployed additional configuration support for the public
+ACPICA external interfaces. Entire classes of interfaces can now be
+easily modified or configured out, replaced by stubbed inline functions
+by default. Lv Zheng.
+
+Moved all public ACPICA runtime configuration globals to the public
+ACPICA external interface file for convenience. Also, removed some
+obsolete/unused globals. See the file acpixf.h. Lv Zheng.
+
+Documentation: Added a new section to the ACPICA reference describing the
+maximum number of GPEs that can be supported by the FADT-defined GPEs in
+block zero and one. About 1200 total. See section 4.4.1 of the ACPICA
+reference.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and
+has a much larger code and data size.
+
+ Current Release:
+ Non-Debug Version: 96.8K Code, 27.2K Data, 124.0K Total
+ Debug Version: 189.5K Code, 79.7K Data, 269.2K Total
+ Previous Release:
+ Non-Debug Version: 97.0K Code, 27.2K Data, 124.2K Total
+ Debug Version: 189.7K Code, 79.5K Data, 269.2K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL and disassembler: Add full support for the LPIT table (Low Power
+Idle Table). Includes support in the disassembler, data table compiler,
+and template generator.
+
+AcpiDump utility:
+1) Add option to force the use of the RSDT (over the XSDT).
+2) Improve validation of the RSDP signature (use 8 chars instead of 4).
+
+iASL: Add check for predefined packages that are too large. For
+predefined names that contain subpackages, check if each subpackage is
+too large. (Check for too small already exists.)
+
+Debugger: Updated the GPE command (which simulates a GPE by executing the
+GPE code paths in ACPICA). The GPE device is now optional, and defaults
+to the GPE 0/1 FADT-defined blocks.
+
+Unix application OSL: Update line-editing support. Add additional error
+checking and take care not to reset terminal attributes on exit if they
+were never set. This should help guarantee that the terminal is always
+left in the previous state on program exit.
+
+----------------------------------------
25 March 2014. Summary of changes for version 20140325:
1) ACPICA kernel-resident subsystem:
diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config
index b640d659c2ab..8d41399cdfb0 100644
--- a/generate/unix/Makefile.config
+++ b/generate/unix/Makefile.config
@@ -46,6 +46,18 @@ COMPILEOBJ = $(CC) -c $(CFLAGS) $(OPT_CFLAGS) -o $@ $<
LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS)
PREFIX ?= /usr
INSTALLDIR = $(PREFIX)/bin
+UNAME_S := $(shell uname -s)
+
+#
+# Host detection and configuration
+#
+ifeq ($(UNAME_S), Darwin) # Mac OS X
+HOST = _APPLE
+endif
+
+ifeq ($(UNAME_S), FreeBSD)
+HOST = _FreeBSD
+endif
ifeq ($(HOST), _APPLE)
INSTALL = cp
diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile
index f0662b7c88b1..8cc8d814b727 100644
--- a/generate/unix/iasl/Makefile
+++ b/generate/unix/iasl/Makefile
@@ -64,6 +64,7 @@ OBJECTS = \
$(OBJDIR)/asllookup.o\
$(OBJDIR)/aslmain.o\
$(OBJDIR)/aslmap.o\
+ $(OBJDIR)/aslmessages.o\
$(OBJDIR)/aslmethod.o\
$(OBJDIR)/aslnamesp.o\
$(OBJDIR)/asloffset.o\
diff --git a/source/common/adisasm.c b/source/common/adisasm.c
index 7ca162362929..292b4720da98 100644
--- a/source/common/adisasm.c
+++ b/source/common/adisasm.c
@@ -357,6 +357,7 @@ AdAmlDisassemble (
{
fprintf (stderr, "Could not open output file %s\n", DisasmFilename);
Status = AE_ERROR;
+ ACPI_FREE (DisasmFilename);
goto Cleanup;
}
diff --git a/source/common/ahpredef.c b/source/common/ahpredef.c
index b1d393f6a924..bc407b08e8f6 100644
--- a/source/common/ahpredef.c
+++ b/source/common/ahpredef.c
@@ -172,6 +172,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_LID", "Lid Status", "Returns the open/closed status of the lid on a mobile system"),
AH_PREDEF ("_LIN", "Lines In Use", "Handshake lines, Resource Descriptor field"),
AH_PREDEF ("_LL_", "Low Level", "Interrupt polarity, Resource Descriptor field"),
+ AH_PREDEF ("_LPD", "Low Power Dependencies", "Returns a list of dependencies for low power idle entry"),
AH_PREDEF ("_MAF", "Maximum Address Fixed", "Resource Descriptor field"),
AH_PREDEF ("_MAT", "Multiple APIC Table Entry", "Returns a list of MADT APIC structure entries"),
AH_PREDEF ("_MAX", "Maximum Base Address", "Resource Descriptor field"),
@@ -216,6 +217,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_PR3", "Power Resources for D3hot", "Returns a list of dependent power resources to enter state D3hot"),
AH_PREDEF ("_PRE", "Power Resources for Enumeration", "Returns a list of dependent power resources to enumerate devices on a bus"),
AH_PREDEF ("_PRL", "Power Source Redundancy List", "Returns a list of power source devices in the same redundancy grouping"),
+ AH_PREDEF ("_PRP", "Device Properties", "Returns a list of device property information"),
AH_PREDEF ("_PRS", "Possible Resource Settings", "Returns a list of a device's possible resource settings"),
AH_PREDEF ("_PRT", "PCI Routing Table", "Returns a list of PCI interrupt mappings"),
AH_PREDEF ("_PRW", "Power Resources for Wake", "Returns a list of dependent power resources for waking"),
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
index 1ac7421c4a10..384f7955e867 100644
--- a/source/common/dmtable.c
+++ b/source/common/dmtable.c
@@ -241,6 +241,12 @@ static const char *AcpiDmIvrsSubnames[] =
"Unknown SubTable Type" /* Reserved */
};
+static const char *AcpiDmLpitSubnames[] =
+{
+ "Native C-state Idle Structure",
+ "Simple I/O Idle Structure",
+ "Unknown SubTable Type" /* Reserved */
+};
#define ACPI_FADT_PM_RESERVED 9
@@ -304,6 +310,7 @@ ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"},
{ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"},
{ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"},
+ {ACPI_SIG_LPIT, NULL, AcpiDmDumpLpit, DtCompileLpit, TemplateLpit, "Low Power Idle Table"},
{ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table (MADT)"},
{ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"},
{ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"},
@@ -729,6 +736,7 @@ AcpiDmDumpTable (
case ACPI_DMT_NAME4:
case ACPI_DMT_SIG:
case ACPI_DMT_SLIC:
+ case ACPI_DMT_LPIT:
ByteLength = 4;
break;
@@ -1232,6 +1240,32 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT8_FORMAT, *Target, Name);
break;
+ case ACPI_DMT_LPIT:
+
+ /* LPIT subtable types */
+
+ Temp8 = *Target;
+ switch (Temp8)
+ {
+ 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;
+ }
+
+ AcpiOsPrintf (UINT32_FORMAT, *Target, Name);
+ break;
+
case ACPI_DMT_EXIT:
return (AE_OK);
diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c
index 44e3904bb428..8d52ce36e8de 100644
--- a/source/common/dmtbdump.c
+++ b/source/common/dmtbdump.c
@@ -419,12 +419,12 @@ AcpiDmDumpAsf (
UINT8 Type;
- /* No main table, only sub-tables */
+ /* No main table, only subtables */
SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
@@ -479,7 +479,7 @@ AcpiDmDumpAsf (
default:
- AcpiOsPrintf ("\n**** Unknown ASF sub-table type 0x%X\n", SubTable->Header.Type);
+ AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", SubTable->Header.Type);
return;
}
@@ -541,7 +541,7 @@ AcpiDmDumpAsf (
AcpiOsPrintf ("\n");
- /* Point to next sub-table */
+ /* Point to next subtable */
if (!SubTable->Header.Length)
{
@@ -586,7 +586,7 @@ AcpiDmDumpCpep (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
while (Offset < Table->Length)
@@ -599,7 +599,7 @@ AcpiDmDumpCpep (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Header.Length;
SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable,
@@ -638,7 +638,7 @@ AcpiDmDumpCsrt (
/* The main table only contains the ACPI header, thus already handled */
- /* Sub-tables (Resource Groups) */
+ /* Subtables (Resource Groups) */
SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
while (Offset < Table->Length)
@@ -702,7 +702,7 @@ AcpiDmDumpCsrt (
SubSubTable->Length);
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
@@ -746,7 +746,7 @@ AcpiDmDumpDbg2 (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
while (Offset < Table->Length)
@@ -815,7 +815,7 @@ AcpiDmDumpDbg2 (
Offset + SubTable->OemDataOffset, "OEM Data");
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
@@ -861,12 +861,12 @@ AcpiDmDumpDmar (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
@@ -905,7 +905,7 @@ AcpiDmDumpDmar (
default:
- AcpiOsPrintf ("\n**** Unknown DMAR sub-table type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", SubTable->Type);
return;
}
@@ -956,7 +956,7 @@ AcpiDmDumpDmar (
ScopeTable, ScopeTable->Length);
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, SubTable->Length);
@@ -995,7 +995,7 @@ AcpiDmDumpEinj (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
while (Offset < Table->Length)
@@ -1008,7 +1008,7 @@ AcpiDmDumpEinj (
return;
}
- /* Point to next sub-table (each subtable is of fixed length) */
+ /* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_WHEA_HEADER);
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
@@ -1048,7 +1048,7 @@ AcpiDmDumpErst (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
while (Offset < Table->Length)
@@ -1061,7 +1061,7 @@ AcpiDmDumpErst (
return;
}
- /* Point to next sub-table (each subtable is of fixed length) */
+ /* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_WHEA_HEADER);
SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
@@ -1096,12 +1096,12 @@ AcpiDmDumpFpdt (
/* There is no main table (other than the standard ACPI header) */
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
@@ -1125,7 +1125,7 @@ AcpiDmDumpFpdt (
default:
- AcpiOsPrintf ("\n**** Unknown FPDT sub-table type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", SubTable->Type);
/* Attempt to continue */
@@ -1145,7 +1145,7 @@ AcpiDmDumpFpdt (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length);
@@ -1188,7 +1188,7 @@ AcpiDmDumpHest (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
while (Offset < Table->Length)
@@ -1246,7 +1246,7 @@ AcpiDmDumpHest (
/* Cannot continue on unknown type - no length */
- AcpiOsPrintf ("\n**** Unknown HEST sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n", SubTable->Type);
return;
}
@@ -1284,7 +1284,7 @@ AcpiDmDumpHest (
}
}
- /* Point to next sub-table */
+ /* Point to next subtable */
SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength);
}
@@ -1327,12 +1327,12 @@ AcpiDmDumpIvrs (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -1358,7 +1358,7 @@ AcpiDmDumpIvrs (
default:
- AcpiOsPrintf ("\n**** Unknown IVRS sub-table type 0x%X\n",
+ AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n",
SubTable->Type);
/* Attempt to continue */
@@ -1461,7 +1461,7 @@ AcpiDmDumpIvrs (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length);
@@ -1471,6 +1471,85 @@ NextSubTable:
/*******************************************************************************
*
+ * FUNCTION: AcpiDmDumpLpit
+ *
+ * PARAMETERS: Table - A LPIT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a LPIT. This table type consists
+ * of an open-ended number of subtables. Note: There are no
+ * entries in the main table. An LPIT consists of the table
+ * header and then subtables only.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpLpit (
+ ACPI_TABLE_HEADER *Table)
+{
+ ACPI_STATUS Status;
+ ACPI_LPIT_HEADER *SubTable;
+ UINT32 Length = Table->Length;
+ UINT32 Offset = sizeof (ACPI_TABLE_LPIT);
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 SubTableLength;
+
+
+ /* Subtables */
+
+ SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset);
+ while (Offset < Table->Length)
+ {
+ /* Common subtable header */
+
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ switch (SubTable->Type)
+ {
+ case ACPI_LPIT_TYPE_NATIVE_CSTATE:
+
+ InfoTable = AcpiDmTableInfoLpit0;
+ SubTableLength = sizeof (ACPI_LPIT_NATIVE);
+ break;
+
+ case ACPI_LPIT_TYPE_SIMPLE_IO:
+
+ InfoTable = AcpiDmTableInfoLpit1;
+ SubTableLength = sizeof (ACPI_LPIT_IO);
+ break;
+
+ default:
+
+ /* Cannot continue on unknown type - no length */
+
+ AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n", SubTable->Type);
+ return;
+ }
+
+ Status = AcpiDmDumpTable (Length, Offset, SubTable,
+ SubTableLength, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+ AcpiOsPrintf ("\n");
+
+ /* Point to next subtable */
+
+ Offset += SubTableLength;
+ SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, SubTable, SubTableLength);
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiDmDumpMadt
*
* PARAMETERS: Table - A MADT table
@@ -1501,12 +1580,12 @@ AcpiDmDumpMadt (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset, SubTable,
@@ -1585,7 +1664,7 @@ AcpiDmDumpMadt (
default:
- AcpiOsPrintf ("\n**** Unknown MADT sub-table type 0x%X\n\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", SubTable->Type);
/* Attempt to continue */
@@ -1605,7 +1684,7 @@ AcpiDmDumpMadt (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
@@ -1642,7 +1721,7 @@ AcpiDmDumpMcfg (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
while (Offset < Table->Length)
@@ -1662,7 +1741,7 @@ AcpiDmDumpMcfg (
return;
}
- /* Point to next sub-table (each subtable is of fixed length) */
+ /* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_MCFG_ALLOCATION);
SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable,
@@ -1844,12 +1923,12 @@ AcpiDmDumpMsct (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -1859,7 +1938,7 @@ AcpiDmDumpMsct (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_MSCT_PROXIMITY);
SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY));
@@ -1896,12 +1975,12 @@ AcpiDmDumpMtmr (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -1911,7 +1990,7 @@ AcpiDmDumpMtmr (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_MTMR_ENTRY);
SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable, sizeof (ACPI_MTMR_ENTRY));
@@ -2232,7 +2311,7 @@ AcpiDmDumpS3pt (
SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, S3ptTable, Offset);
while (Offset < S3ptTable->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
@@ -2256,7 +2335,7 @@ AcpiDmDumpS3pt (
default:
- AcpiOsPrintf ("\n**** Unknown S3PT sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n", SubTable->Type);
/* Attempt to continue */
@@ -2277,7 +2356,7 @@ AcpiDmDumpS3pt (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, SubTable, SubTable->Length);
@@ -2314,7 +2393,7 @@ AcpiDmDumpSlic (
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2338,7 +2417,7 @@ AcpiDmDumpSlic (
default:
- AcpiOsPrintf ("\n**** Unknown SLIC sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown SLIC subtable type 0x%X\n", SubTable->Type);
/* Attempt to continue */
@@ -2359,7 +2438,7 @@ AcpiDmDumpSlic (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_SLIC_HEADER, SubTable, SubTable->Length);
@@ -2475,12 +2554,12 @@ AcpiDmDumpSrat (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2508,7 +2587,7 @@ AcpiDmDumpSrat (
break;
default:
- AcpiOsPrintf ("\n**** Unknown SRAT sub-table type 0x%X\n", SubTable->Type);
+ AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", SubTable->Type);
/* Attempt to continue */
@@ -2529,7 +2608,7 @@ AcpiDmDumpSrat (
}
NextSubTable:
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += SubTable->Length;
SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
@@ -2566,12 +2645,12 @@ AcpiDmDumpVrtc (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2581,7 +2660,7 @@ AcpiDmDumpVrtc (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_VRTC_ENTRY);
SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable, sizeof (ACPI_VRTC_ENTRY));
@@ -2618,12 +2697,12 @@ AcpiDmDumpWdat (
return;
}
- /* Sub-tables */
+ /* Subtables */
SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
while (Offset < Table->Length)
{
- /* Common sub-table header */
+ /* Common subtable header */
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
@@ -2633,7 +2712,7 @@ AcpiDmDumpWdat (
return;
}
- /* Point to next sub-table */
+ /* Point to next subtable */
Offset += sizeof (ACPI_WDAT_ENTRY);
SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY));
diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c
index 13c9a5966258..577dca731c68 100644
--- a/source/common/dmtbinfo.c
+++ b/source/common/dmtbinfo.c
@@ -158,6 +158,9 @@
#define ACPI_IVRS8A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f)
#define ACPI_IVRS8B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f)
#define ACPI_IVRS8C_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f)
+#define ACPI_LPITH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_HEADER,f)
+#define ACPI_LPIT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_NATIVE,f)
+#define ACPI_LPIT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_IO,f)
#define ACPI_MADT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f)
#define ACPI_MADT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_APIC,f)
#define ACPI_MADT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f)
@@ -213,6 +216,7 @@
#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o)
#define ACPI_SRAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o)
#define ACPI_GTDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o)
+#define ACPI_LPITH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_LPIT_HEADER,f,o)
#define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_MADT,f,o)
#define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC,f,o)
#define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f,o)
@@ -1307,6 +1311,59 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[] =
/*******************************************************************************
*
+ * LPIT - Low Power Idle Table
+ *
+ ******************************************************************************/
+
+/* Main table consists only of the standard ACPI table header */
+
+/* Common Subtable header (one per Subtable) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[] =
+{
+ {ACPI_DMT_LPIT, ACPI_LPITH_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT32, ACPI_LPITH_OFFSET (Length), "Length", DT_LENGTH},
+ {ACPI_DMT_UINT16, ACPI_LPITH_OFFSET (UniqueId), "Unique ID", 0},
+ {ACPI_DMT_UINT16, ACPI_LPITH_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_LPITH_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_LPITH_FLAG_OFFSET (Flags, 0), "State Disabled", 0},
+ {ACPI_DMT_FLAG1, ACPI_LPITH_FLAG_OFFSET (Flags, 0), "No Counter", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* LPIT Subtables */
+
+/* 0: Native C-state */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[] =
+{
+ {ACPI_DMT_GAS, ACPI_LPIT0_OFFSET (EntryTrigger), "Entry Trigger", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT0_OFFSET (Residency), "Residency", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT0_OFFSET (Latency), "Latency", 0},
+ {ACPI_DMT_GAS, ACPI_LPIT0_OFFSET (ResidencyCounter), "Residency Counter", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT0_OFFSET (CounterFrequency), "Counter Frequency", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* 1: Simple I/O */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[] =
+{
+ {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (EntryTrigger), "Entry Trigger", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (TriggerAction), "Trigger Action", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (TriggerValue), "Trigger Value", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (TriggerMask), "Trigger Mask", 0},
+ {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (MinimumIdleState), "Minimum Idle State", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (Residency), "Residency", 0},
+ {ACPI_DMT_UINT32, ACPI_LPIT1_OFFSET (Latency), "Latency", 0},
+ {ACPI_DMT_GAS, ACPI_LPIT1_OFFSET (ResidencyCounter), "Residency Counter", 0},
+ {ACPI_DMT_UINT64, ACPI_LPIT1_OFFSET (CounterFrequency), "Counter Frequency", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
* MADT - Multiple APIC Description Table and subtables
*
******************************************************************************/
diff --git a/source/compiler/aslanalyze.c b/source/compiler/aslanalyze.c
index 112c1213986d..940f220b940a 100644
--- a/source/compiler/aslanalyze.c
+++ b/source/compiler/aslanalyze.c
@@ -569,3 +569,51 @@ ApCheckRegMethod (
AslError (ASL_WARNING, ASL_MSG_NO_REGION, Op, NULL);
}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: ApFindNameInScope
+ *
+ * PARAMETERS: Name - Name to search for
+ * Op - Current parse op
+ *
+ * RETURN: TRUE if name found in the same scope as Op.
+ *
+ * DESCRIPTION: Determine if a name appears in the same scope as Op, as either
+ * a Method() or a Name().
+ *
+ ******************************************************************************/
+
+BOOLEAN
+ApFindNameInScope (
+ char *Name,
+ ACPI_PARSE_OBJECT *Op)
+{
+ ACPI_PARSE_OBJECT *Next;
+ ACPI_PARSE_OBJECT *Parent;
+
+
+ /* Get the start of the current scope */
+
+ Parent = Op->Asl.Parent;
+ Next = Parent->Asl.Child;
+
+ /* Search entire scope for a match to the name */
+
+ while (Next)
+ {
+ if ((Next->Asl.ParseOpcode == PARSEOP_METHOD) ||
+ (Next->Asl.ParseOpcode == PARSEOP_NAME))
+ {
+ if (ACPI_COMPARE_NAME (Name, Next->Asl.NameSeg))
+ {
+ return (TRUE);
+ }
+ }
+
+ Next = Next->Asl.Next;
+ }
+
+ return (FALSE);
+}
diff --git a/source/compiler/aslcompiler.h b/source/compiler/aslcompiler.h
index 526dfb88e566..1f94245a4476 100644
--- a/source/compiler/aslcompiler.h
+++ b/source/compiler/aslcompiler.h
@@ -275,6 +275,11 @@ void
ApCheckRegMethod (
ACPI_PARSE_OBJECT *Op);
+BOOLEAN
+ApFindNameInScope (
+ char *Name,
+ ACPI_PARSE_OBJECT *Op);
+
/*
* aslerror - error handling/reporting
@@ -286,7 +291,7 @@ AslAbort (
void
AslError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
ACPI_PARSE_OBJECT *Op,
char *ExtraMessage);
@@ -297,7 +302,7 @@ AslDisableException (
BOOLEAN
AslIsExceptionDisabled (
UINT8 Level,
- UINT8 MessageId);
+ UINT16 MessageId);
void
AslCoreSubsystemError (
@@ -313,7 +318,7 @@ AslCompilererror(
void
AslCommonError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 CurrentLineNumber,
UINT32 LogicalLineNumber,
UINT32 LogicalByteOffset,
@@ -324,7 +329,7 @@ AslCommonError (
void
AslCommonError2 (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 LineNumber,
UINT32 Column,
char *SourceLine,
@@ -439,6 +444,22 @@ OpcAmlConstantWalk (
/*
+ * aslmessages - exception strings
+ */
+const char *
+AeDecodeMessageId (
+ UINT16 MessageId);
+
+const char *
+AeDecodeExceptionLevel (
+ UINT8 Level);
+
+UINT16
+AeBuildFullExceptionCode (
+ UINT8 Level,
+ UINT16 MessageId);
+
+/*
* asloffset - generate C offset file for BIOS support
*/
ACPI_STATUS
diff --git a/source/compiler/aslerror.c b/source/compiler/aslerror.c
index 1fcb97efccf2..14ca99d02ba1 100644
--- a/source/compiler/aslerror.c
+++ b/source/compiler/aslerror.c
@@ -41,7 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define ASL_EXCEPTIONS
#include "aslcompiler.h"
#define _COMPONENT ACPI_COMPILER
@@ -204,7 +203,7 @@ AePrintException (
int Actual;
size_t RActual;
UINT32 MsgLength;
- char *MainMessage;
+ const char *MainMessage;
char *ExtraMessage;
UINT32 SourceColumn;
UINT32 ErrorColumn;
@@ -399,109 +398,93 @@ AePrintException (
}
}
- /* NULL message ID, just print the raw message */
+ /* If a NULL message ID, just print the raw message */
if (Enode->MessageId == 0)
{
fprintf (OutputFile, "%s\n", Enode->Message);
+ return;
}
- else
- {
- /* Decode the message ID */
- if (Gbl_VerboseErrors)
- {
- fprintf (OutputFile, "%s %4.4d -",
- AslErrorLevel[Enode->Level],
- Enode->MessageId + ((Enode->Level+1) * 1000));
- }
- else /* IDE case */
- {
- fprintf (OutputFile, "%s %4.4d:",
- AslErrorLevelIde[Enode->Level],
- Enode->MessageId + ((Enode->Level+1) * 1000));
- }
+ /* Decode the message ID */
- MainMessage = AslMessages[Enode->MessageId];
- ExtraMessage = Enode->Message;
+ fprintf (OutputFile, "%s %4.4d -",
+ AeDecodeExceptionLevel (Enode->Level),
+ AeBuildFullExceptionCode (Enode->Level, Enode->MessageId));
- if (Enode->LineNumber)
- {
- /* Main message: try to use string from AslMessages first */
+ MainMessage = AeDecodeMessageId (Enode->MessageId);
+ ExtraMessage = Enode->Message;
- if (!MainMessage)
- {
- MainMessage = "";
- }
+ /* If a NULL line number, just print the decoded message */
- MsgLength = strlen (MainMessage);
- if (MsgLength == 0)
- {
- /* Use the secondary/extra message as main message */
+ if (!Enode->LineNumber)
+ {
+ fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
+ return;
+ }
- MainMessage = Enode->Message;
- if (!MainMessage)
- {
- MainMessage = "";
- }
+ MsgLength = strlen (MainMessage);
+ if (MsgLength == 0)
+ {
+ /* Use the secondary/extra message as main message */
- MsgLength = strlen (MainMessage);
- ExtraMessage = NULL;
- }
+ MainMessage = Enode->Message;
+ if (!MainMessage)
+ {
+ MainMessage = "";
+ }
- if (Gbl_VerboseErrors && !PrematureEOF)
- {
- if (Total >= 256)
- {
- fprintf (OutputFile, " %s",
- MainMessage);
- }
- else
- {
- SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
- ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
+ MsgLength = strlen (MainMessage);
+ ExtraMessage = NULL;
+ }
- if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
- {
- fprintf (OutputFile, "%*s%s",
- (int) ((SourceColumn - 1) - ErrorColumn),
- MainMessage, " ^ ");
- }
- else
- {
- fprintf (OutputFile, "%*s %s",
- (int) ((SourceColumn - ErrorColumn) + 1), "^",
- MainMessage);
- }
- }
+ if (Gbl_VerboseErrors && !PrematureEOF)
+ {
+ if (Total >= 256)
+ {
+ fprintf (OutputFile, " %s",
+ MainMessage);
+ }
+ else
+ {
+ SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2;
+ ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1;
+
+ if ((MsgLength + ErrorColumn) < (SourceColumn - 1))
+ {
+ fprintf (OutputFile, "%*s%s",
+ (int) ((SourceColumn - 1) - ErrorColumn),
+ MainMessage, " ^ ");
}
else
{
- fprintf (OutputFile, " %s", MainMessage);
+ fprintf (OutputFile, "%*s %s",
+ (int) ((SourceColumn - ErrorColumn) + 1), "^",
+ MainMessage);
}
+ }
+ }
+ else
+ {
+ fprintf (OutputFile, " %s", MainMessage);
+ }
- /* Print the extra info message if present */
+ /* Print the extra info message if present */
- if (ExtraMessage)
- {
- fprintf (OutputFile, " (%s)", ExtraMessage);
- }
+ if (ExtraMessage)
+ {
+ fprintf (OutputFile, " (%s)", ExtraMessage);
+ }
- if (PrematureEOF)
- {
- fprintf (OutputFile, " and premature End-Of-File");
- }
+ if (PrematureEOF)
+ {
+ fprintf (OutputFile, " and premature End-Of-File");
+ }
- fprintf (OutputFile, "\n");
- if (Gbl_VerboseErrors)
- {
- fprintf (OutputFile, "\n");
- }
- }
- else
- {
- fprintf (OutputFile, " %s %s\n\n", MainMessage, ExtraMessage);
- }
+ fprintf (OutputFile, "\n");
+ if (Gbl_VerboseErrors)
+ {
+ fprintf (OutputFile, "\n");
}
}
@@ -556,7 +539,7 @@ AePrintErrorLog (
void
AslCommonError2 (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 LineNumber,
UINT32 Column,
char *SourceLine,
@@ -642,7 +625,7 @@ AslCommonError2 (
void
AslCommonError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 CurrentLineNumber,
UINT32 LogicalLineNumber,
UINT32 LogicalByteOffset,
@@ -776,7 +759,7 @@ AslDisableException (
BOOLEAN
AslIsExceptionDisabled (
UINT8 Level,
- UINT8 MessageId)
+ UINT16 MessageId)
{
UINT32 EncodedMessageId;
UINT32 i;
@@ -801,7 +784,7 @@ AslIsExceptionDisabled (
* Ignore this warning/remark if it has been disabled by
* the user (-vw option)
*/
- EncodedMessageId = MessageId + ((Level + 1) * 1000);
+ EncodedMessageId = AeBuildFullExceptionCode (Level, MessageId);
for (i = 0; i < Gbl_DisabledMessagesIndex; i++)
{
/* Simple implementation via fixed array */
@@ -840,7 +823,7 @@ AslIsExceptionDisabled (
void
AslError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
ACPI_PARSE_OBJECT *Op,
char *ExtraMessage)
{
diff --git a/source/compiler/aslmessages.c b/source/compiler/aslmessages.c
new file mode 100644
index 000000000000..c9d196f17022
--- /dev/null
+++ b/source/compiler/aslmessages.c
@@ -0,0 +1,407 @@
+/******************************************************************************
+ *
+ * Module Name: aslmessages.c - Compiler error/warning message strings
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, 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.
+ */
+
+#include "aslcompiler.h"
+
+#define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslmessages")
+
+
+/*
+ * Strings for message reporting levels, must match error
+ * type string tables in aslmessages.c
+ */
+const char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
+ "Optimize",
+ "Remark ",
+ "Warning ",
+ "Warning ",
+ "Warning ",
+ "Error "
+};
+
+/* All lowercase versions for IDEs */
+
+const char *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
+ "optimize",
+ "remark ",
+ "warning ",
+ "warning ",
+ "warning ",
+ "error "
+};
+
+
+/*
+ * Actual message strings for each compiler message ID. There are currently
+ * three distinct blocks of error messages (so that they can be expanded
+ * individually):
+ * Main ASL compiler
+ * Data Table compiler
+ * Preprocessor
+ *
+ * NOTE1: These tables must match the enum list of message IDs in the file
+ * aslmessages.h exactly.
+ *
+ * NOTE2: With the introduction of the -vw option to disable specific messages,
+ * new messages should only be added to the end of this list, so that values
+ * for existing messages are not disturbed.
+ */
+
+/* ASL compiler */
+
+const char *AslCompilerMsgs [] =
+{
+/* The zeroth message is reserved */ "",
+/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value",
+/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
+/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
+/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
+/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments",
+/* ASL_MSG_ARG_INIT */ "Method argument is not initialized",
+/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset",
+/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero",
+/* ASL_MSG_CLOSE */ "Could not close file",
+/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error",
+/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name",
+/* ASL_MSG_CONNECTION_MISSING */ "A Connection operator is required for this field SpaceId",
+/* ASL_MSG_CONNECTION_INVALID */ "Invalid OpRegion SpaceId for use of Connection operator",
+/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression",
+/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced",
+/* ASL_MSG_CORE_EXCEPTION */ "From ACPICA Subsystem",
+/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file",
+/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename",
+/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",
+/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)",
+/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)",
+/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified",
+/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list",
+/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached",
+/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode",
+/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)",
+/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)",
+/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)",
+/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size",
+/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit",
+/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit",
+/* ASL_MSG_GPE_NAME_CONFLICT */ "Name conflicts with a previous GPE method",
+/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters",
+/* ASL_MSG_HID_PREFIX */ "_HID prefix must be all uppercase or decimal digits",
+/* ASL_MSG_HID_SUFFIX */ "_HID suffix must be all hex digits",
+/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file",
+/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file",
+/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
+/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode",
+/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)",
+/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)",
+/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
+/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
+/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)",
+/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
+/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence",
+/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
+/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
+/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window",
+/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window",
+/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max",
+/* ASL_MSG_INVALID_OPERAND */ "Invalid operand",
+/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value",
+/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value",
+/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL",
+/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression",
+/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)",
+/* ASL_MSG_INVALID_TYPE */ "Invalid type",
+/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
+/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)",
+/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk",
+/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length",
+/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length",
+/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file",
+/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename",
+/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized",
+/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method",
+/* ASL_MSG_LONG_LINE */ "Splitting long input line",
+/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure",
+/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list",
+/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list",
+/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct",
+/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types",
+/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope",
+/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized",
+/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop",
+/* ASL_MSG_NESTED_COMMENT */ "Nested comment found",
+/* ASL_MSG_NO_CASES */ "No Case statements under Switch",
+/* ASL_MSG_NO_REGION */ "_REG has no corresponding Operation Region",
+/* ASL_MSG_NO_RETVAL */ "Called method returns no value",
+/* ASL_MSG_NO_WHILE */ "No enclosing While statement",
+/* ASL_MSG_NON_ASCII */ "Invalid characters found in file",
+/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero",
+/* ASL_MSG_NOT_EXIST */ "Object does not exist",
+/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope",
+/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke",
+/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only",
+/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope",
+/* ASL_MSG_NOT_REFERENCED */ "Object is not referenced",
+/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag",
+/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string",
+/* ASL_MSG_OPEN */ "Could not open file",
+/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file",
+/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename",
+/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero",
+/* ASL_MSG_PREPROCESSOR_FILENAME */ "Could not create preprocessor filename",
+/* ASL_MSG_READ */ "Could not read file",
+/* ASL_MSG_RECURSION */ "Recursive method call",
+/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access",
+/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access",
+/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments",
+/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments",
+/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method",
+/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value",
+/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name",
+/* ASL_MSG_RESERVED_PACKAGE_LENGTH */ "Invalid package length for reserved name",
+/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value",
+/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name",
+/* ASL_MSG_RESERVED_WORD */ "Use of reserved name",
+/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target",
+/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)",
+/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)",
+/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)",
+/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect",
+/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value",
+/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed",
+/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator",
+/* ASL_MSG_SEEK */ "Could not seek file",
+/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized",
+/* ASL_MSG_SERIALIZED_REQUIRED */ "Control Method should be made Serialized",
+/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)",
+/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value",
+/* ASL_MSG_STRING_LENGTH */ "String literal too long",
+/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
+/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15",
+/* ASL_MSG_SYNTAX */ "",
+/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature",
+/* ASL_MSG_TAG_LARGER */ "ResourceTag larger than Field",
+/* ASL_MSG_TAG_SMALLER */ "ResourceTag smaller than Field",
+/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed",
+/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)",
+/* ASL_MSG_TRUNCATION */ "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
+/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name",
+/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable",
+/* ASL_MSG_UNSUPPORTED */ "Unsupported feature",
+/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case",
+/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
+/* ASL_MSG_WRITE */ "Could not write file",
+/* ASL_MSG_RANGE */ "Constant out of range",
+/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer",
+/* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency"
+};
+
+/* Table compiler */
+
+const char *AslTableCompilerMsgs [] =
+{
+/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
+/* ASL_MSG_DIVIDE_BY_ZERO */ "Expression contains divide-by-zero",
+/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
+/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
+/* ASL_MSG_INVALID_EXPRESSION */ "Invalid expression",
+/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
+/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
+/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents",
+/* ASL_MSG_RESERVED_VALUE */ "Reserved field",
+/* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined",
+/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
+/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
+/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero"
+};
+
+/* Preprocessor */
+
+const char *AslPreprocessorMsgs [] =
+{
+/* ASL_MSG_DIRECTIVE_SYNTAX */ "Invalid directive syntax",
+/* ASL_MSG_ENDIF_MISMATCH */ "Mismatched #endif",
+/* ASL_MSG_ERROR_DIRECTIVE */ "#error",
+/* ASL_MSG_EXISTING_NAME */ "Name is already defined",
+/* ASL_MSG_INVALID_INVOCATION */ "Invalid macro invocation",
+/* ASL_MSG_MACRO_SYNTAX */ "Invalid macro syntax",
+/* ASL_MSG_TOO_MANY_ARGUMENTS */ "Too many macro arguments",
+/* ASL_MSG_UNKNOWN_DIRECTIVE */ "Unknown directive",
+/* ASL_MSG_UNKNOWN_PRAGMA */ "Unknown pragma",
+/* ASL_MSG_WARNING_DIRECTIVE */ "#warning"
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AeDecodeMessageId
+ *
+ * PARAMETERS: MessageId - ASL message ID (exception code) to be
+ * formatted. Possibly fully encoded.
+ *
+ * RETURN: A string containing the exception message text.
+ *
+ * DESCRIPTION: This function validates and translates an ASL message ID into
+ * an ASCII string.
+ *
+ ******************************************************************************/
+
+const char *
+AeDecodeMessageId (
+ UINT16 MessageId)
+{
+ UINT32 Index;
+ const char **MessageTable;
+
+
+ /* Main ASL Compiler messages */
+
+ if (MessageId <= ASL_MSG_MAIN_COMPILER_END)
+ {
+ MessageTable = AslCompilerMsgs;
+ Index = MessageId;
+
+ if (Index >= ACPI_ARRAY_LENGTH (AslCompilerMsgs))
+ {
+ return ("[Unknown ASL Compiler exception ID]");
+ }
+ }
+
+ /* Data Table Compiler messages */
+
+ else if (MessageId <= ASL_MSG_TABLE_COMPILER_END)
+ {
+ MessageTable = AslTableCompilerMsgs;
+ Index = MessageId - ASL_MSG_TABLE_COMPILER;
+
+ if (Index >= ACPI_ARRAY_LENGTH (AslTableCompilerMsgs))
+ {
+ return ("[Unknown Table Compiler exception ID]");
+ }
+ }
+
+ /* Preprocessor messages */
+
+ else if (MessageId <= ASL_MSG_PREPROCESSOR_END)
+ {
+ MessageTable = AslPreprocessorMsgs;
+ Index = MessageId - ASL_MSG_PREPROCESSOR;
+
+ if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs))
+ {
+ return ("[Unknown Preprocesor exception ID]");
+ }
+ }
+
+ /* Everything else is unknown */
+
+ else
+ {
+ return ("[Unknown exception/component ID]");
+ }
+
+ return (MessageTable[Index]);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AeDecodeExceptionLevel
+ *
+ * PARAMETERS: Level - The ASL error level to be decoded
+ *
+ * RETURN: A string containing the error level text
+ *
+ * DESCRIPTION: This function validates and translates an ASL error level into
+ * an ASCII string.
+ *
+ ******************************************************************************/
+
+const char *
+AeDecodeExceptionLevel (
+ UINT8 Level)
+{
+ /* Range check on Level */
+
+ if (Level >= ACPI_ARRAY_LENGTH (AslErrorLevel))
+ {
+ return ("Unknown exception level");
+ }
+
+ /* Differentiate the string type to be used (IDE is all lower case) */
+
+ if (Gbl_VerboseErrors)
+ {
+ return (AslErrorLevel[Level]);
+ }
+
+ return (AslErrorLevelIde[Level]);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AeBuildFullExceptionCode
+ *
+ * PARAMETERS: Level - ASL error level
+ * MessageId - ASL exception code to be formatted
+ *
+ * RETURN: Fully encoded exception code
+ *
+ * DESCRIPTION: Build the full exception code from the error level and the
+ * actual message ID.
+ *
+ ******************************************************************************/
+
+UINT16
+AeBuildFullExceptionCode (
+ UINT8 Level,
+ UINT16 MessageId)
+{
+
+ /*
+ * Error level is in the thousands slot (error/warning/remark, etc.)
+ * Error codes are 0 - 999
+ */
+ return (((Level + 1) * 1000) + MessageId);
+}
diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h
index 181838380908..48ebcbfc321f 100644
--- a/source/compiler/aslmessages.h
+++ b/source/compiler/aslmessages.h
@@ -41,11 +41,12 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ASLMESSAGES_H
#define __ASLMESSAGES_H
+/* These values must match error type string tables in aslmessages.c */
+
typedef enum
{
ASL_OPTIMIZATION = 0,
@@ -58,43 +59,41 @@ typedef enum
} ASL_MESSAGE_TYPES;
-#ifdef ASL_EXCEPTIONS
-/* Strings for message reporting levels, must match values above */
+#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings for types above */
-const char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
- "Optimize",
- "Remark ",
- "Warning ",
- "Warning ",
- "Warning ",
- "Error "
-};
+/*
+ * Exception code blocks, 0 - 999
+ * Available for new exception blocks: 600 - 999
+ */
+#define ASL_MSG_MAIN_COMPILER 0 /* 0 - 299 */
+#define ASL_MSG_MAIN_COMPILER_END 299
-/* All lowercase versions for IDEs */
+#define ASL_MSG_TABLE_COMPILER 300 /* 300 - 499 */
+#define ASL_MSG_TABLE_COMPILER_END 499
-const char *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
- "optimize",
- "remark ",
- "warning ",
- "warning ",
- "warning ",
- "error "
-};
+#define ASL_MSG_PREPROCESSOR 500 /* 500 - 599 */
+#define ASL_MSG_PREPROCESSOR_END 599
-#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */
-#endif
/*
- * Values for all compiler messages.
+ * Values (message IDs) for all compiler messages. There are currently
+ * three distinct blocks of error messages (so that they can be expanded
+ * individually):
+ * Main ASL compiler
+ * Data Table compiler
+ * Preprocessor
+ *
+ * NOTE1: This list must match the tables of message strings in the file
+ * aslmessages.c exactly.
*
- * NOTE: With the introduction of the -vw option to disable specific messages,
- * new messages should only be added to the end of this list, so that values
- * for existing messages are not disturbed.
+ * NOTE2: With the introduction of the -vw option to disable specific
+ * messages, new messages should only be added to the end of these
+ * lists, so that values for existing messages are not disturbed.
*/
typedef enum
{
- ASL_MSG_RESERVED = 0,
+ ASL_MSG_RESERVED = ASL_MSG_MAIN_COMPILER,
ASL_MSG_ALIGNMENT,
ASL_MSG_ALPHANUMERIC_STRING,
@@ -236,23 +235,11 @@ typedef enum
ASL_MSG_WRITE,
ASL_MSG_RANGE,
ASL_MSG_BUFFER_ALLOCATION,
+ ASL_MSG_MISSING_DEPENDENCY,
- /* These messages are used by the Preprocessor only */
+ /* These messages are used by the Data Table compiler only */
- ASL_MSG_DIRECTIVE_SYNTAX,
- ASL_MSG_ENDIF_MISMATCH,
- ASL_MSG_ERROR_DIRECTIVE,
- ASL_MSG_EXISTING_NAME,
- ASL_MSG_INVALID_INVOCATION,
- ASL_MSG_MACRO_SYNTAX,
- ASL_MSG_TOO_MANY_ARGUMENTS,
- ASL_MSG_UNKNOWN_DIRECTIVE,
- ASL_MSG_UNKNOWN_PRAGMA,
- ASL_MSG_WARNING_DIRECTIVE,
-
- /* These messages are used by the data table compiler only */
-
- ASL_MSG_BUFFER_ELEMENT,
+ ASL_MSG_BUFFER_ELEMENT = ASL_MSG_TABLE_COMPILER,
ASL_MSG_DIVIDE_BY_ZERO,
ASL_MSG_FLAG_VALUE,
ASL_MSG_INTEGER_SIZE,
@@ -264,194 +251,22 @@ typedef enum
ASL_MSG_UNKNOWN_LABEL,
ASL_MSG_UNKNOWN_SUBTABLE,
ASL_MSG_UNKNOWN_TABLE,
- ASL_MSG_ZERO_VALUE
-
-} ASL_MESSAGE_IDS;
+ ASL_MSG_ZERO_VALUE,
+ /* These messages are used by the Preprocessor only */
-#ifdef ASL_EXCEPTIONS
-
-/*
- * Actual message strings for each compiler message.
- *
- * NOTE: With the introduction of the -vw option to disable specific messages,
- * new messages should only be added to the end of this list, so that values
- * for existing messages are not disturbed.
- */
-char *AslMessages [] =
-{
-/* The zeroth message is reserved */ "",
-/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value",
-/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
-/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
-/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
-/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments",
-/* ASL_MSG_ARG_INIT */ "Method argument is not initialized",
-/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset",
-/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero",
-/* ASL_MSG_CLOSE */ "Could not close file",
-/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error",
-/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name",
-/* ASL_MSG_CONNECTION_MISSING */ "A Connection operator is required for this field SpaceId",
-/* ASL_MSG_CONNECTION_INVALID */ "Invalid OpRegion SpaceId for use of Connection operator",
-/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression",
-/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced",
-/* ASL_MSG_CORE_EXCEPTION */ "From ACPICA Subsystem",
-/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file",
-/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename",
-/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",\
-/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)",
-/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)",
-/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified",
-/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list",
-/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached",
-/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode",
-/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)",
-/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)",
-/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)",
-/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size",
-/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit",
-/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit",
-/* ASL_MSG_GPE_NAME_CONFLICT */ "Name conflicts with a previous GPE method",
-/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters",
-/* ASL_MSG_HID_PREFIX */ "_HID prefix must be all uppercase or decimal digits",
-/* ASL_MSG_HID_SUFFIX */ "_HID suffix must be all hex digits",
-/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file",
-/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file",
-/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
-/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode",
-/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)",
-/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)",
-/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
-/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
-/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)",
-/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
-/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence",
-/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
-/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
-/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window",
-/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window",
-/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max",
-/* ASL_MSG_INVALID_OPERAND */ "Invalid operand",
-/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value",
-/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value",
-/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL",
-/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression",
-/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)",
-/* ASL_MSG_INVALID_TYPE */ "Invalid type",
-/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
-/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)",
-/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk",
-/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length",
-/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length",
-/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file",
-/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename",
-/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized",
-/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method",
-/* ASL_MSG_LONG_LINE */ "Splitting long input line",
-/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure",
-/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list",
-/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list",
-/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct",
-/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types",
-/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope",
-/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized",
-/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop",
-/* ASL_MSG_NESTED_COMMENT */ "Nested comment found",
-/* ASL_MSG_NO_CASES */ "No Case statements under Switch",
-/* ASL_MSG_NO_REGION */ "_REG has no corresponding Operation Region",
-/* ASL_MSG_NO_RETVAL */ "Called method returns no value",
-/* ASL_MSG_NO_WHILE */ "No enclosing While statement",
-/* ASL_MSG_NON_ASCII */ "Invalid characters found in file",
-/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero",
-/* ASL_MSG_NOT_EXIST */ "Object does not exist",
-/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope",
-/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke",
-/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only",
-/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope",
-/* ASL_MSG_NOT_REFERENCED */ "Object is not referenced",
-/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag",
-/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string",
-/* ASL_MSG_OPEN */ "Could not open file",
-/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file",
-/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename",
-/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero",
-/* ASL_MSG_PREPROCESSOR_FILENAME */ "Could not create preprocessor filename",
-/* ASL_MSG_READ */ "Could not read file",
-/* ASL_MSG_RECURSION */ "Recursive method call",
-/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access",
-/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access",
-/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments",
-/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments",
-/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method",
-/* ASL_MSG_RESERVED_NO_RETURN_VAL */ "Reserved method should not return a value",
-/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name",
-/* ASL_MSG_RESERVED_PACKAGE_LENGTH */ "Invalid package length for reserved name",
-/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value",
-/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name",
-/* ASL_MSG_RESERVED_WORD */ "Use of reserved name",
-/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target",
-/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)",
-/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)",
-/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)",
-/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect",
-/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value",
-/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed",
-/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator",
-/* ASL_MSG_SEEK */ "Could not seek file",
-/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized",
-/* ASL_MSG_SERIALIZED_REQUIRED */ "Control Method should be made Serialized",
-/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)",
-/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value",
-/* ASL_MSG_STRING_LENGTH */ "String literal too long",
-/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
-/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15",
-/* ASL_MSG_SYNTAX */ "",
-/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature",
-/* ASL_MSG_TAG_LARGER */ "ResourceTag larger than Field",
-/* ASL_MSG_TAG_SMALLER */ "ResourceTag smaller than Field",
-/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed",
-/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)",
-/* ASL_MSG_TRUNCATION */ "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
-/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name",
-/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable",
-/* ASL_MSG_UNSUPPORTED */ "Unsupported feature",
-/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case",
-/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)",
-/* ASL_MSG_WRITE */ "Could not write file",
-/* ASL_MSG_RANGE */ "Constant out of range",
-/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer",
-
-/* Preprocessor */
-
-/* ASL_MSG_DIRECTIVE_SYNTAX */ "Invalid directive syntax",
-/* ASL_MSG_ENDIF_MISMATCH */ "Mismatched #endif",
-/* ASL_MSG_ERROR_DIRECTIVE */ "#error",
-/* ASL_MSG_EXISTING_NAME */ "Name is already defined",
-/* ASL_MSG_INVALID_INVOCATION */ "Invalid macro invocation",
-/* ASL_MSG_MACRO_SYNTAX */ "Invalid macro syntax",
-/* ASL_MSG_TOO_MANY_ARGUMENTS */ "Too many macro arguments",
-/* ASL_MSG_UNKNOWN_DIRECTIVE */ "Unknown directive",
-/* ASL_MSG_UNKNOWN_PRAGMA */ "Unknown pragma",
-/* ASL_MSG_WARNING_DIRECTIVE */ "#warning",
-
-/* Table compiler */
+ ASL_MSG_DIRECTIVE_SYNTAX = ASL_MSG_PREPROCESSOR,
+ ASL_MSG_ENDIF_MISMATCH,
+ ASL_MSG_ERROR_DIRECTIVE,
+ ASL_MSG_EXISTING_NAME,
+ ASL_MSG_INVALID_INVOCATION,
+ ASL_MSG_MACRO_SYNTAX,
+ ASL_MSG_TOO_MANY_ARGUMENTS,
+ ASL_MSG_UNKNOWN_DIRECTIVE,
+ ASL_MSG_UNKNOWN_PRAGMA,
+ ASL_MSG_WARNING_DIRECTIVE,
-/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
-/* ASL_MSG_DIVIDE_BY_ZERO */ "Expression contains divide-by-zero",
-/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
-/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
-/* ASL_MSG_INVALID_EXPRESSION */ "Invalid expression",
-/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
-/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
-/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents",
-/* ASL_MSG_RESERVED_VALUE */ "Reserved field",
-/* ASL_MSG_UNKNOWN_LABEL */ "Label is undefined",
-/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
-/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
-/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero"
-};
+} ASL_MESSAGE_IDS;
-#endif /* ASL_EXCEPTIONS */
#endif /* __ASLMESSAGES_H */
diff --git a/source/compiler/aslmethod.c b/source/compiler/aslmethod.c
index 36db96f2e01a..9b0a7a1a13a8 100644
--- a/source/compiler/aslmethod.c
+++ b/source/compiler/aslmethod.c
@@ -108,7 +108,18 @@ MtMethodAnalysisWalkBegin (
WalkInfo->MethodStack = MethodInfo;
- /* Get the name node, ignored here */
+ /* Special handling for _PRP, must have a _HID also */
+
+ if (!ACPI_STRCMP (METHOD_NAME__PRP, Op->Asl.NameSeg))
+ {
+ if (!ApFindNameInScope (METHOD_NAME__HID, Op))
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_PRP requires _HID in same scope");
+ }
+ }
+
+ /* Get the name node */
Next = Op->Asl.Child;
@@ -412,6 +423,16 @@ MtMethodAnalysisWalkBegin (
AnCheckId (Next, ASL_TYPE_CID);
}
}
+
+ else if (!ACPI_STRCMP (METHOD_NAME__PRP, Op->Asl.NameSeg))
+ {
+ if (!ApFindNameInScope (METHOD_NAME__HID, Op))
+ {
+ AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+ "_PRP requires _HID in same scope");
+ }
+ }
+
break;
default:
diff --git a/source/compiler/aslprepkg.c b/source/compiler/aslprepkg.c
index c05d19016ce3..b4f96955def5 100644
--- a/source/compiler/aslprepkg.c
+++ b/source/compiler/aslprepkg.c
@@ -467,6 +467,12 @@ ApCheckPackageList (
Count, ExpectedCount);
break;
}
+ if (Count > ExpectedCount)
+ {
+ ApPackageTooLarge (PredefinedName, SubPackageOp,
+ Count, ExpectedCount);
+ break;
+ }
ApCheckPackageElements (PredefinedName, Op,
Package->RetInfo.ObjectType1, Package->RetInfo.Count1,
@@ -503,6 +509,12 @@ ApCheckPackageList (
Count, ExpectedCount);
break;
}
+ if (Count > ExpectedCount)
+ {
+ ApPackageTooLarge (PredefinedName, SubPackageOp,
+ Count, ExpectedCount);
+ break;
+ }
/* Check each object/type combination */
diff --git a/source/compiler/asltypes.h b/source/compiler/asltypes.h
index a98ac120985e..7e297d3b6721 100644
--- a/source/compiler/asltypes.h
+++ b/source/compiler/asltypes.h
@@ -196,7 +196,7 @@ typedef struct asl_error_msg
char *Filename;
char *SourceLine;
UINT32 FilenameLength;
- UINT8 MessageId;
+ UINT16 MessageId;
UINT8 Level;
} ASL_ERROR_MSG;
diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h
index 846e9c2f5e54..db5d306d2110 100644
--- a/source/compiler/dtcompiler.h
+++ b/source/compiler/dtcompiler.h
@@ -321,20 +321,20 @@ DtWalkTableTree (
void
DtError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
void
DtNameError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
void
DtFatal (
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage);
@@ -428,6 +428,10 @@ DtCompileIvrs (
void **PFieldList);
ACPI_STATUS
+DtCompileLpit (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileMadt (
void **PFieldList);
@@ -519,6 +523,7 @@ extern const unsigned char TemplateGtdt[];
extern const unsigned char TemplateHest[];
extern const unsigned char TemplateHpet[];
extern const unsigned char TemplateIvrs[];
+extern const unsigned char TemplateLpit[];
extern const unsigned char TemplateMadt[];
extern const unsigned char TemplateMcfg[];
extern const unsigned char TemplateMchi[];
diff --git a/source/compiler/dttable.c b/source/compiler/dttable.c
index 4fa1588bc077..c341bf20e449 100644
--- a/source/compiler/dttable.c
+++ b/source/compiler/dttable.c
@@ -454,7 +454,7 @@ DtCompileCsrt (
UINT32 GroupLength;
- /* Sub-tables (Resource Groups) */
+ /* Subtables (Resource Groups) */
while (*PFieldList)
{
@@ -1304,6 +1304,87 @@ DtCompileIvrs (
/******************************************************************************
*
+ * FUNCTION: DtCompileLpit
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile LPIT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileLpit (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_DMTABLE_INFO *InfoTable;
+ ACPI_LPIT_HEADER *LpitHeader;
+
+
+ /* Note: Main table consists only of the standard ACPI table header */
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+
+ /* LPIT Subtable header */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoLpitHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ LpitHeader = ACPI_CAST_PTR (ACPI_LPIT_HEADER, Subtable->Buffer);
+
+ switch (LpitHeader->Type)
+ {
+ case ACPI_LPIT_TYPE_NATIVE_CSTATE:
+
+ InfoTable = AcpiDmTableInfoLpit0;
+ break;
+
+ case ACPI_LPIT_TYPE_SIMPLE_IO:
+
+ InfoTable = AcpiDmTableInfoLpit1;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "LPIT");
+ return (AE_ERROR);
+ }
+
+ /* LPIT Subtable */
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompileMadt
*
* PARAMETERS: List - Current field list pointer
diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h
index 84da13a1319e..4c8ba08490e2 100644
--- a/source/compiler/dttemplate.h
+++ b/source/compiler/dttemplate.h
@@ -548,6 +548,33 @@ const unsigned char TemplateIvrs[] =
0x00,0x00,0x00,0x00 /* 000000B8 "...." */
};
+const unsigned char TemplateLpit[] =
+{
+ 0x4C,0x50,0x49,0x54,0xB4,0x00,0x00,0x00, /* 00000000 "LPIT...." */
+ 0x01,0x20,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ". INTEL " */
+ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x25,0x03,0x14,0x20,0x00,0x00,0x00,0x00, /* 00000020 "%.. ...." */
+ 0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "8......." */
+ 0x00,0x00,0x00,0x00,0x7F,0x01,0x02,0x00, /* 00000030 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x00,0x20,0x00,0x03,0x00,0x00,0x00,0x00, /* 00000048 ". ......" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000058 "........" */
+ 0x58,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000060 "X......." */
+ 0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 00000068 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x02, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
+ 0x00,0x08,0x00,0x01,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
+ 0x00,0x00,0x00,0x00 /* 000000B0 "...." */
+};
+
/* MADT with ACPI 5.0 subtables */
const unsigned char TemplateMadt[] =
diff --git a/source/compiler/dtutils.c b/source/compiler/dtutils.c
index d394aff1575f..281bfb3725a2 100644
--- a/source/compiler/dtutils.c
+++ b/source/compiler/dtutils.c
@@ -77,7 +77,7 @@ DtSum (
void
DtError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@@ -124,7 +124,7 @@ DtError (
void
DtNameError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@@ -177,7 +177,7 @@ DtNameError (
void
DtFatal (
- UINT8 MessageId,
+ UINT16 MessageId,
DT_FIELD *FieldObject,
char *ExtraMessage)
{
@@ -533,6 +533,7 @@ DtGetFieldLength (
case ACPI_DMT_NAME4:
case ACPI_DMT_SLIC:
case ACPI_DMT_SIG:
+ case ACPI_DMT_LPIT:
ByteLength = 4;
break;
diff --git a/source/compiler/preprocess.h b/source/compiler/preprocess.h
index 56ba500e8278..532203474af4 100644
--- a/source/compiler/preprocess.h
+++ b/source/compiler/preprocess.h
@@ -257,7 +257,7 @@ PrGetNextToken (
void
PrError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 Column);
void
diff --git a/source/compiler/prutils.c b/source/compiler/prutils.c
index ff735fc29590..d8b7d45c5d39 100644
--- a/source/compiler/prutils.c
+++ b/source/compiler/prutils.c
@@ -149,7 +149,7 @@ PrGetNextToken (
void
PrError (
UINT8 Level,
- UINT8 MessageId,
+ UINT16 MessageId,
UINT32 Column)
{
#if 0
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c
index e9774cdebe67..d9aa2e7aa1c3 100644
--- a/source/components/debugger/dbcmds.c
+++ b/source/components/debugger/dbcmds.c
@@ -339,7 +339,7 @@ AcpiDbDisplayTableInfo (
/* Header */
- AcpiOsPrintf ("Idx ID Status Type Sig Address Len Header\n");
+ AcpiOsPrintf ("Idx ID Status Type TableHeader (Sig, Address, Length)\n");
/* Walk the entire root table list */
@@ -366,22 +366,22 @@ AcpiDbDisplayTableInfo (
{
case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL:
- AcpiOsPrintf ("External virtual ");
+ AcpiOsPrintf ("External/virtual ");
break;
case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL:
- AcpiOsPrintf ("Internal physical ");
+ AcpiOsPrintf ("Internal/physical ");
break;
case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL:
- AcpiOsPrintf ("Internal virtual ");
+ AcpiOsPrintf ("Internal/virtual ");
break;
default:
- AcpiOsPrintf ("INVALID ");
+ AcpiOsPrintf ("INVALID TYPE ");
break;
}
@@ -1187,14 +1187,25 @@ AcpiDbGenerateGpe (
char *GpeArg,
char *BlockArg)
{
- UINT32 BlockNumber;
+ UINT32 BlockNumber = 0;
UINT32 GpeNumber;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
- GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
- BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
+ GpeNumber = ACPI_STRTOUL (GpeArg, NULL, 0);
+ /*
+ * If no block arg, or block arg == 0 or 1, use the FADT-defined
+ * GPE blocks.
+ */
+ if (BlockArg)
+ {
+ BlockNumber = ACPI_STRTOUL (BlockArg, NULL, 0);
+ if (BlockNumber == 1)
+ {
+ BlockNumber = 0;
+ }
+ }
GpeEventInfo = AcpiEvGetGpeEventInfo (ACPI_TO_POINTER (BlockNumber),
GpeNumber);
diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c
index a6c79f644daa..88fbb9475246 100644
--- a/source/components/debugger/dbinput.c
+++ b/source/components/debugger/dbinput.c
@@ -181,7 +181,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands[] =
{"EXIT", 0},
{"FIND", 1},
{"GO", 0},
- {"GPE", 2},
+ {"GPE", 1},
{"GPES", 0},
{"HANDLERS", 0},
{"HELP", 0},
@@ -305,7 +305,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] =
{0, "\nHardware Related Commands:", "\n"},
{1, " Event <F|G> <Value>", "Generate AcpiEvent (Fixed/GPE)\n"},
- {1, " Gpe <GpeNum> <GpeBlock>", "Simulate a GPE\n"},
+ {1, " Gpe <GpeNum> [GpeBlockDevice]", "Simulate a GPE\n"},
{1, " Gpes", "Display info on all GPEs\n"},
{1, " Sci", "Generate an SCI\n"},
{1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"},
diff --git a/source/components/events/evgpe.c b/source/components/events/evgpe.c
index 75e37049eb71..c31f0b385197 100644
--- a/source/components/events/evgpe.c
+++ b/source/components/events/evgpe.c
@@ -432,7 +432,7 @@ AcpiEvGpeDetect (
GpeRegisterInfo->EnableForWake))
{
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Ignore disabled registers for GPE%02X-GPE%02X: "
+ "Ignore disabled registers for GPE %02X-%02X: "
"RunEnable=%02X, WakeEnable=%02X\n",
GpeRegisterInfo->BaseGpeNumber,
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
@@ -458,7 +458,7 @@ AcpiEvGpeDetect (
}
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
- "Read registers for GPE%02X-GPE%02X: Status=%02X, Enable=%02X, "
+ "Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, "
"RunEnable=%02X, WakeEnable=%02X\n",
GpeRegisterInfo->BaseGpeNumber,
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
@@ -771,7 +771,7 @@ AcpiEvGpeDispatch (
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to clear GPE%02X", GpeNumber));
+ "Unable to clear GPE %02X", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
}
@@ -789,7 +789,7 @@ AcpiEvGpeDispatch (
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to disable GPE%02X", GpeNumber));
+ "Unable to disable GPE %02X", GpeNumber));
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
}
@@ -829,7 +829,7 @@ AcpiEvGpeDispatch (
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "Unable to queue handler for GPE%02X - event disabled",
+ "Unable to queue handler for GPE %02X - event disabled",
GpeNumber));
}
break;
@@ -841,7 +841,7 @@ AcpiEvGpeDispatch (
* a GPE to be enabled if it has no handler or method.
*/
ACPI_ERROR ((AE_INFO,
- "No handler or method for GPE%02X, disabling event",
+ "No handler or method for GPE %02X, disabling event",
GpeNumber));
break;
}
diff --git a/source/components/events/evgpeblk.c b/source/components/events/evgpeblk.c
index a5122f9503db..f0db7eed8ba3 100644
--- a/source/components/events/evgpeblk.c
+++ b/source/components/events/evgpeblk.c
@@ -282,17 +282,17 @@ AcpiEvCreateGpeInfoBlocks (
{
/* Init the RegisterInfo for this GPE register (8 GPEs) */
- ThisRegister->BaseGpeNumber = (UINT8) (GpeBlock->BlockBaseNumber +
- (i * ACPI_GPE_REGISTER_WIDTH));
+ ThisRegister->BaseGpeNumber = (UINT16)
+ (GpeBlock->BlockBaseNumber + (i * ACPI_GPE_REGISTER_WIDTH));
ThisRegister->StatusAddress.Address =
- GpeBlock->BlockAddress.Address + i;
+ GpeBlock->Address + i;
ThisRegister->EnableAddress.Address =
- GpeBlock->BlockAddress.Address + i + GpeBlock->RegisterCount;
+ GpeBlock->Address + i + GpeBlock->RegisterCount;
- ThisRegister->StatusAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
- ThisRegister->EnableAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
+ ThisRegister->StatusAddress.SpaceId = GpeBlock->SpaceId;
+ ThisRegister->EnableAddress.SpaceId = GpeBlock->SpaceId;
ThisRegister->StatusAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
ThisRegister->EnableAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
ThisRegister->StatusAddress.BitOffset = 0;
@@ -365,9 +365,10 @@ ErrorExit:
ACPI_STATUS
AcpiEvCreateGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
- ACPI_GENERIC_ADDRESS *GpeBlockAddress,
+ UINT64 Address,
+ UINT8 SpaceId,
UINT32 RegisterCount,
- UINT8 GpeBlockBaseNumber,
+ UINT16 GpeBlockBaseNumber,
UINT32 InterruptNumber,
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock)
{
@@ -394,15 +395,14 @@ AcpiEvCreateGpeBlock (
/* Initialize the new GPE block */
+ GpeBlock->Address = Address;
+ GpeBlock->SpaceId = SpaceId;
GpeBlock->Node = GpeDevice;
GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
GpeBlock->Initialized = FALSE;
GpeBlock->RegisterCount = RegisterCount;
GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;
- ACPI_MEMCPY (&GpeBlock->BlockAddress, GpeBlockAddress,
- sizeof (ACPI_GENERIC_ADDRESS));
-
/*
* Create the RegisterInfo and EventInfo sub-structures
* Note: disables and clears all GPEs in the block
@@ -445,11 +445,11 @@ AcpiEvCreateGpeBlock (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
- " Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X\n",
+ " Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X%s\n",
(UINT32) GpeBlock->BlockBaseNumber,
(UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
- GpeDevice->Name.Ascii, GpeBlock->RegisterCount,
- InterruptNumber));
+ GpeDevice->Name.Ascii, GpeBlock->RegisterCount, InterruptNumber,
+ InterruptNumber == AcpiGbl_FADT.SciInterrupt ? " (SCI)" : ""));
/* Update global count of currently available GPEs */
diff --git a/source/components/events/evgpeinit.c b/source/components/events/evgpeinit.c
index 622c13d427c8..6251b36f4d7a 100644
--- a/source/components/events/evgpeinit.c
+++ b/source/components/events/evgpeinit.c
@@ -139,7 +139,9 @@ AcpiEvGpeInitialize (
/* Install GPE Block 0 */
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
- &AcpiGbl_FADT.XGpe0Block, RegisterCount0, 0,
+ AcpiGbl_FADT.XGpe0Block.Address,
+ AcpiGbl_FADT.XGpe0Block.SpaceId,
+ RegisterCount0, 0,
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
if (ACPI_FAILURE (Status))
@@ -177,7 +179,9 @@ AcpiEvGpeInitialize (
/* Install GPE Block 1 */
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
- &AcpiGbl_FADT.XGpe1Block, RegisterCount1,
+ AcpiGbl_FADT.XGpe1Block.Address,
+ AcpiGbl_FADT.XGpe1Block.SpaceId,
+ RegisterCount1,
AcpiGbl_FADT.Gpe1Base,
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
diff --git a/source/components/events/evxfgpe.c b/source/components/events/evxfgpe.c
index 1ef191604f61..73164e1d04b1 100644
--- a/source/components/events/evxfgpe.c
+++ b/source/components/events/evxfgpe.c
@@ -809,7 +809,8 @@ AcpiInstallGpeBlock (
* For user-installed GPE Block Devices, the GpeBlockBaseNumber
* is always zero
*/
- Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
+ Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress->Address,
+ GpeBlockAddress->SpaceId, RegisterCount,
0, InterruptNumber, &GpeBlock);
if (ACPI_FAILURE (Status))
{
diff --git a/source/components/hardware/hwpci.c b/source/components/hardware/hwpci.c
index 08e5ecc18903..86017ed4d47a 100644
--- a/source/components/hardware/hwpci.c
+++ b/source/components/hardware/hwpci.c
@@ -161,11 +161,12 @@ AcpiHwDerivePciId (
/* Walk the list, updating the PCI device/function/bus numbers */
Status = AcpiHwProcessPciList (PciId, ListHead);
- }
- /* Always delete the list */
+ /* Delete the list */
+
+ AcpiHwDeletePciList (ListHead);
+ }
- AcpiHwDeletePciList (ListHead);
return_ACPI_STATUS (Status);
}
@@ -213,6 +214,9 @@ AcpiHwBuildPciList (
Status = AcpiGetParent (CurrentDevice, &ParentDevice);
if (ACPI_FAILURE (Status))
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (Status);
}
@@ -227,6 +231,9 @@ AcpiHwBuildPciList (
ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE));
if (!ListElement)
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (AE_NO_MEMORY);
}
diff --git a/source/components/resources/rscreate.c b/source/components/resources/rscreate.c
index c72dbc3584f5..bac2f88f57f4 100644
--- a/source/components/resources/rscreate.c
+++ b/source/components/resources/rscreate.c
@@ -77,6 +77,10 @@ AcpiBufferToResource (
void *Resource;
void *CurrentResourcePtr;
+
+ ACPI_FUNCTION_TRACE (AcpiBufferToResource);
+
+
/*
* Note: we allow AE_AML_NO_RESOURCE_END_TAG, since an end tag
* is not required here.
@@ -92,7 +96,7 @@ AcpiBufferToResource (
}
if (ACPI_FAILURE (Status))
{
- return (Status);
+ return_ACPI_STATUS (Status);
}
/* Allocate a buffer for the converted resource */
@@ -101,7 +105,7 @@ AcpiBufferToResource (
CurrentResourcePtr = Resource;
if (!Resource)
{
- return (AE_NO_MEMORY);
+ return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Perform the AML-to-Resource conversion */
@@ -121,9 +125,11 @@ AcpiBufferToResource (
*ResourcePtr = Resource;
}
- return (Status);
+ return_ACPI_STATUS (Status);
}
+ACPI_EXPORT_SYMBOL (AcpiBufferToResource)
+
/*******************************************************************************
*
diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c
index 789161dfc765..22c09d22bd9a 100644
--- a/source/components/tables/tbfadt.c
+++ b/source/components/tables/tbfadt.c
@@ -58,7 +58,8 @@ AcpiTbInitGenericAddress (
UINT8 SpaceId,
UINT8 ByteWidth,
UINT64 Address,
- char *RegisterName);
+ char *RegisterName,
+ UINT8 Flags);
static void
AcpiTbConvertFadt (
@@ -84,13 +85,14 @@ typedef struct acpi_fadt_info
UINT16 Address32;
UINT16 Length;
UINT8 DefaultLength;
- UINT8 Type;
+ UINT8 Flags;
} ACPI_FADT_INFO;
#define ACPI_FADT_OPTIONAL 0
#define ACPI_FADT_REQUIRED 1
#define ACPI_FADT_SEPARATE_LENGTH 2
+#define ACPI_FADT_GPE_REGISTER 4
static ACPI_FADT_INFO FadtInfoTable[] =
{
@@ -141,14 +143,14 @@ static ACPI_FADT_INFO FadtInfoTable[] =
ACPI_FADT_OFFSET (Gpe0Block),
ACPI_FADT_OFFSET (Gpe0BlockLength),
0,
- ACPI_FADT_SEPARATE_LENGTH},
+ ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER},
{"Gpe1Block",
ACPI_FADT_OFFSET (XGpe1Block),
ACPI_FADT_OFFSET (Gpe1Block),
ACPI_FADT_OFFSET (Gpe1BlockLength),
0,
- ACPI_FADT_SEPARATE_LENGTH}
+ ACPI_FADT_SEPARATE_LENGTH | ACPI_FADT_GPE_REGISTER}
};
#define ACPI_FADT_INFO_ENTRIES \
@@ -212,21 +214,31 @@ AcpiTbInitGenericAddress (
UINT8 SpaceId,
UINT8 ByteWidth,
UINT64 Address,
- char *RegisterName)
+ char *RegisterName,
+ UINT8 Flags)
{
UINT8 BitWidth;
- /* Bit width field in the GAS is only one byte long, 255 max */
-
+ /*
+ * Bit width field in the GAS is only one byte long, 255 max.
+ * Check for BitWidth overflow in GAS.
+ */
BitWidth = (UINT8) (ByteWidth * 8);
-
- if (ByteWidth > 31) /* (31*8)=248 */
+ if (ByteWidth > 31) /* (31*8)=248, (32*8)=256 */
{
- ACPI_ERROR ((AE_INFO,
- "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
- "to convert to GAS struct - 255 bits max, truncating",
- RegisterName, ByteWidth, (ByteWidth * 8)));
+ /*
+ * No error for GPE blocks, because we do not use the BitWidth
+ * for GPEs, the legacy length (ByteWidth) is used instead to
+ * allow for a large number of GPEs.
+ */
+ if (!(Flags & ACPI_FADT_GPE_REGISTER))
+ {
+ ACPI_ERROR ((AE_INFO,
+ "%s - 32-bit FADT register is too long (%u bytes, %u bits) "
+ "to convert to GAS struct - 255 bits max, truncating",
+ RegisterName, ByteWidth, (ByteWidth * 8)));
+ }
BitWidth = 255;
}
@@ -492,6 +504,7 @@ AcpiTbConvertFadt (
ACPI_GENERIC_ADDRESS *Address64;
UINT32 Address32;
UINT8 Length;
+ UINT8 Flags;
UINT32 i;
@@ -556,6 +569,7 @@ AcpiTbConvertFadt (
&AcpiGbl_FADT, FadtInfoTable[i].Length);
Name = FadtInfoTable[i].Name;
+ Flags = FadtInfoTable[i].Flags;
/*
* Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
@@ -592,7 +606,7 @@ AcpiTbConvertFadt (
ACPI_ADR_SPACE_SYSTEM_IO,
*ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
FadtInfoTable[i].Length),
- (UINT64) Address32, Name);
+ (UINT64) Address32, Name, Flags);
}
else if (Address64->Address != (UINT64) Address32)
{
@@ -613,7 +627,7 @@ AcpiTbConvertFadt (
ACPI_ADR_SPACE_SYSTEM_IO,
*ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
FadtInfoTable[i].Length),
- (UINT64) Address32, Name);
+ (UINT64) Address32, Name, Flags);
}
}
}
@@ -634,7 +648,7 @@ AcpiTbConvertFadt (
Name, ACPI_MUL_8 (Length), Address64->BitWidth));
}
- if (FadtInfoTable[i].Type & ACPI_FADT_REQUIRED)
+ if (FadtInfoTable[i].Flags & ACPI_FADT_REQUIRED)
{
/*
* Field is required (PM1aEvent, PM1aControl).
@@ -648,7 +662,7 @@ AcpiTbConvertFadt (
Name, ACPI_FORMAT_UINT64 (Address64->Address), Length));
}
}
- else if (FadtInfoTable[i].Type & ACPI_FADT_SEPARATE_LENGTH)
+ else if (FadtInfoTable[i].Flags & ACPI_FADT_SEPARATE_LENGTH)
{
/*
* Field is optional (PM2Control, GPE0, GPE1) AND has its own
@@ -755,7 +769,7 @@ AcpiTbSetupFadtRegisters (
Source64->SpaceId, Pm1RegisterByteWidth,
Source64->Address +
(FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth),
- "PmRegisters");
+ "PmRegisters", 0);
}
}
}
diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c
index fc580f6b0e1f..4b207d9369ce 100644
--- a/source/components/tables/tbutils.c
+++ b/source/components/tables/tbutils.c
@@ -53,10 +53,6 @@
/* Local prototypes */
-static ACPI_STATUS
-AcpiTbValidateXsdt (
- ACPI_PHYSICAL_ADDRESS Address);
-
static ACPI_PHYSICAL_ADDRESS
AcpiTbGetRootTableEntry (
UINT8 *TableEntry,
@@ -276,92 +272,6 @@ AcpiTbGetRootTableEntry (
/*******************************************************************************
*
- * FUNCTION: AcpiTbValidateXsdt
- *
- * PARAMETERS: Address - Physical address of the XSDT (from RSDP)
- *
- * RETURN: Status. AE_OK if the table appears to be valid.
- *
- * DESCRIPTION: Validate an XSDT to ensure that it is of minimum size and does
- * not contain any NULL entries. A problem that is seen in the
- * field is that the XSDT exists, but is actually useless because
- * of one or more (or all) NULL entries.
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiTbValidateXsdt (
- ACPI_PHYSICAL_ADDRESS XsdtAddress)
-{
- ACPI_TABLE_HEADER *Table;
- UINT8 *NextEntry;
- ACPI_PHYSICAL_ADDRESS Address;
- UINT32 Length;
- UINT32 EntryCount;
- ACPI_STATUS Status;
- UINT32 i;
-
-
- /* Get the XSDT length */
-
- Table = AcpiOsMapMemory (XsdtAddress, sizeof (ACPI_TABLE_HEADER));
- if (!Table)
- {
- return (AE_NO_MEMORY);
- }
-
- Length = Table->Length;
- AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER));
-
- /*
- * Minimum XSDT length is the size of the standard ACPI header
- * plus one physical address entry
- */
- if (Length < (sizeof (ACPI_TABLE_HEADER) + ACPI_XSDT_ENTRY_SIZE))
- {
- return (AE_INVALID_TABLE_LENGTH);
- }
-
- /* Map the entire XSDT */
-
- Table = AcpiOsMapMemory (XsdtAddress, Length);
- if (!Table)
- {
- return (AE_NO_MEMORY);
- }
-
- /* Get the number of entries and pointer to first entry */
-
- Status = AE_OK;
- NextEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER));
- EntryCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) /
- ACPI_XSDT_ENTRY_SIZE);
-
- /* Validate each entry (physical address) within the XSDT */
-
- for (i = 0; i < EntryCount; i++)
- {
- Address = AcpiTbGetRootTableEntry (NextEntry, ACPI_XSDT_ENTRY_SIZE);
- if (!Address)
- {
- /* Detected a NULL entry, XSDT is invalid */
-
- Status = AE_NULL_ENTRY;
- break;
- }
-
- NextEntry += ACPI_XSDT_ENTRY_SIZE;
- }
-
- /* Unmap table */
-
- AcpiOsUnmapMemory (Table, Length);
- return (Status);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiTbParseRootTable
*
* PARAMETERS: Rsdp - Pointer to the RSDP
@@ -435,25 +345,6 @@ AcpiTbParseRootTable (
*/
AcpiOsUnmapMemory (Rsdp, sizeof (ACPI_TABLE_RSDP));
- /*
- * If it is present and used, validate the XSDT for access/size
- * and ensure that all table entries are at least non-NULL
- */
- if (TableEntrySize == ACPI_XSDT_ENTRY_SIZE)
- {
- Status = AcpiTbValidateXsdt (Address);
- if (ACPI_FAILURE (Status))
- {
- ACPI_BIOS_WARNING ((AE_INFO, "XSDT is invalid (%s), using RSDT",
- AcpiFormatException (Status)));
-
- /* Fall back to the RSDT */
-
- Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->RsdtPhysicalAddress;
- TableEntrySize = ACPI_RSDT_ENTRY_SIZE;
- }
- }
-
/* Map the RSDT/XSDT table header to get the full table length */
Table = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER));
@@ -512,8 +403,16 @@ AcpiTbParseRootTable (
{
/* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */
- Status = AcpiTbInstallStandardTable (
- AcpiTbGetRootTableEntry (TableEntry, TableEntrySize),
+ Address = AcpiTbGetRootTableEntry (TableEntry, TableEntrySize);
+
+ /* Skip NULL entries in RSDT/XSDT */
+
+ if (!Address)
+ {
+ goto NextTable;
+ }
+
+ Status = AcpiTbInstallStandardTable (Address,
ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, FALSE, TRUE, &TableIndex);
if (ACPI_SUCCESS (Status) &&
@@ -523,6 +422,8 @@ AcpiTbParseRootTable (
AcpiTbParseFadt (TableIndex);
}
+NextTable:
+
TableEntry += TableEntrySize;
}
diff --git a/source/components/utilities/utglobal.c b/source/components/utilities/utglobal.c
index 0b029c8825a1..c89d414fa5d8 100644
--- a/source/components/utilities/utglobal.c
+++ b/source/components/utilities/utglobal.c
@@ -58,31 +58,6 @@
*
******************************************************************************/
-/* Debug output control masks */
-
-#ifdef ACPI_DEBUG_OUTPUT
-UINT32 AcpiDbgLevel = ACPI_DEBUG_DEFAULT;
-#else
-UINT32 AcpiDbgLevel = ACPI_NORMAL_DEFAULT;
-#endif
-
-UINT32 AcpiDbgLayer = ACPI_COMPONENT_DEFAULT;
-
-/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
-
-ACPI_TABLE_FADT AcpiGbl_FADT;
-UINT32 AcpiGbl_TraceFlags;
-ACPI_NAME AcpiGbl_TraceMethodName;
-BOOLEAN AcpiGbl_SystemAwakeAndRunning;
-UINT32 AcpiCurrentGpeCount;
-
-/*
- * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
- * that the ACPI hardware is no longer required. A flag in the FADT indicates
- * a reduced HW machine, and that flag is duplicated here for convenience.
- */
-BOOLEAN AcpiGbl_ReducedHardware;
-
/* Various state name strings */
const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] =
@@ -310,7 +285,6 @@ AcpiUtInitGlobals (
AcpiGbl_AcpiHardwarePresent = TRUE;
AcpiGbl_LastOwnerIdIndex = 0;
AcpiGbl_NextOwnerIdOffset = 0;
- AcpiGbl_TraceMethodName = 0;
AcpiGbl_TraceDbgLevel = 0;
AcpiGbl_TraceDbgLayer = 0;
AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
@@ -351,9 +325,7 @@ AcpiUtInitGlobals (
AcpiGbl_DisableMemTracking = FALSE;
#endif
-#ifdef ACPI_DEBUGGER
- AcpiGbl_DbTerminateThreads = FALSE;
-#endif
+ ACPI_DEBUGGER_EXEC (AcpiGbl_DbTerminateThreads = FALSE);
return_ACPI_STATUS (AE_OK);
}
diff --git a/source/components/utilities/utobject.c b/source/components/utilities/utobject.c
index 7990ef19b41f..263ba59caf89 100644
--- a/source/components/utilities/utobject.c
+++ b/source/components/utilities/utobject.c
@@ -400,7 +400,7 @@ AcpiUtValidInternalObject (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "%p is not not an ACPI operand obj [%s]\n",
+ "%p is not an ACPI operand obj [%s]\n",
Object, AcpiUtGetDescriptorName (Object)));
break;
}
diff --git a/source/components/utilities/utxferror.c b/source/components/utilities/utxferror.c
index 4a065370356a..48dd79c2c58c 100644
--- a/source/components/utilities/utxferror.c
+++ b/source/components/utilities/utxferror.c
@@ -56,6 +56,8 @@
* tools/applications.
*/
+#ifndef ACPI_NO_ERROR_MESSAGES /* Entire module */
+
/*******************************************************************************
*
* FUNCTION: AcpiError
@@ -290,3 +292,5 @@ AcpiBiosWarning (
}
ACPI_EXPORT_SYMBOL (AcpiBiosWarning)
+
+#endif /* ACPI_NO_ERROR_MESSAGES */
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index ae1fdf8ab3aa..7de84acc1a49 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -146,6 +146,7 @@ typedef enum
ACPI_DMT_HESTNTFY,
ACPI_DMT_HESTNTYP,
ACPI_DMT_IVRS,
+ ACPI_DMT_LPIT,
ACPI_DMT_MADT,
ACPI_DMT_PCCT,
ACPI_DMT_PMTT,
@@ -283,6 +284,9 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[];
@@ -449,6 +453,10 @@ AcpiDmDumpIvrs (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpLpit (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpMadt (
ACPI_TABLE_HEADER *Table);
diff --git a/source/include/acevents.h b/source/include/acevents.h
index 3db603534a6b..43c1d7cc5fd6 100644
--- a/source/include/acevents.h
+++ b/source/include/acevents.h
@@ -144,9 +144,10 @@ AcpiEvFinishGpe (
ACPI_STATUS
AcpiEvCreateGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
- ACPI_GENERIC_ADDRESS *GpeBlockAddress,
+ UINT64 Address,
+ UINT8 SpaceId,
UINT32 RegisterCount,
- UINT8 GpeBlockBaseNumber,
+ UINT16 GpeBlockBaseNumber,
UINT32 InterruptNumber,
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock);
diff --git a/source/include/acglobal.h b/source/include/acglobal.h
index f33b720d0db9..06225c1247f2 100644
--- a/source/include/acglobal.h
+++ b/source/include/acglobal.h
@@ -45,146 +45,14 @@
#define __ACGLOBAL_H__
-/*
- * Ensure that the globals are actually defined and initialized only once.
- *
- * The use of these macros allows a single list of globals (here) in order
- * to simplify maintenance of the code.
- */
-#ifdef DEFINE_ACPI_GLOBALS
-#define ACPI_GLOBAL(type,name) \
- extern type name; \
- type name
-
-#define ACPI_INIT_GLOBAL(type,name,value) \
- type name=value
-
-#else
-#define ACPI_GLOBAL(type,name) \
- extern type name
-
-#define ACPI_INIT_GLOBAL(type,name,value) \
- extern type name
-#endif
-
-
-#ifdef DEFINE_ACPI_GLOBALS
-
-/* Public globals, available from outside ACPICA subsystem */
-
/*****************************************************************************
*
- * Runtime configuration (static defaults that can be overriden at runtime)
+ * Globals related to the ACPI tables
*
****************************************************************************/
-/*
- * Enable "slack" in the AML interpreter? Default is FALSE, and the
- * interpreter strictly follows the ACPI specification. Setting to TRUE
- * allows the interpreter to ignore certain errors and/or bad AML constructs.
- *
- * Currently, these features are enabled by this flag:
- *
- * 1) Allow "implicit return" of last value in a control method
- * 2) Allow access beyond the end of an operation region
- * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
- * 4) Allow ANY object type to be a source operand for the Store() operator
- * 5) Allow unresolved references (invalid target name) in package objects
- * 6) Enable warning messages for behavior that is not ACPI spec compliant
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableInterpreterSlack, FALSE);
-
-/*
- * Automatically serialize all methods that create named objects? Default
- * is TRUE, meaning that all NonSerialized methods are scanned once at
- * table load time to determine those that create named objects. Methods
- * that create named objects are marked Serialized in order to prevent
- * possible run-time problems if they are entered by more than one thread.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_AutoSerializeMethods, TRUE);
-
-/*
- * Create the predefined _OSI method in the namespace? Default is TRUE
- * because ACPICA is fully compatible with other ACPI implementations.
- * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CreateOsiMethod, TRUE);
+/* Master list of all ACPI tables that were found in the RSDT/XSDT */
-/*
- * Optionally use default values for the ACPI register widths. Set this to
- * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_UseDefaultRegisterWidths, TRUE);
-
-/*
- * Optionally enable output from the AML Debug Object.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableAmlDebugObject, FALSE);
-
-/*
- * Optionally copy the entire DSDT to local memory (instead of simply
- * mapping it.) There are some BIOSs that corrupt or replace the original
- * DSDT, creating the need for this option. Default is FALSE, do not copy
- * the DSDT.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE);
-
-/*
- * Optionally ignore an XSDT if present and use the RSDT instead.
- * Although the ACPI specification requires that an XSDT be used instead
- * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
- * some machines. Default behavior is to use the XSDT if present.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
-
-/*
- * Optionally use 32-bit FADT addresses if and when there is a conflict
- * (address mismatch) between the 32-bit and 64-bit versions of the
- * address. Although ACPICA adheres to the ACPI specification which
- * requires the use of the corresponding 64-bit address if it is non-zero,
- * some machines have been found to have a corrupted non-zero 64-bit
- * address. Default is FALSE, do not favor the 32-bit addresses.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE);
-
-/*
- * Optionally truncate I/O addresses to 16 bits. Provides compatibility
- * with other ACPI implementations. NOTE: During ACPICA initialization,
- * this value is set to TRUE if any Windows OSI strings have been
- * requested by the BIOS.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_TruncateIoAddresses, FALSE);
-
-/*
- * Disable runtime checking and repair of values returned by control methods.
- * Use only if the repair is causing a problem on a particular machine.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE);
-
-/*
- * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
- * This can be useful for debugging ACPI problems on some machines.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE);
-
-/*
- * We keep track of the latest version of Windows that has been requested by
- * the BIOS.
- */
-ACPI_INIT_GLOBAL (UINT8, AcpiGbl_OsiData, 0);
-
-#endif /* DEFINE_ACPI_GLOBALS */
-
-
-/*****************************************************************************
- *
- * ACPI Table globals
- *
- ****************************************************************************/
-
-/*
- * Master list of all ACPI tables that were found in the RSDT/XSDT.
- */
ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList);
/* DSDT information. Used to check for DSDT corruption */
@@ -284,7 +152,6 @@ ACPI_GLOBAL (ACPI_EXCEPTION_HANDLER, AcpiGbl_ExceptionHandler);
ACPI_GLOBAL (ACPI_INIT_HANDLER, AcpiGbl_InitHandler);
ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler);
ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext);
-ACPI_GLOBAL (ACPI_WALK_STATE *, AcpiGbl_BreakpointWalk);
ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler);
ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList);
@@ -301,7 +168,6 @@ ACPI_GLOBAL (BOOLEAN, AcpiGbl_RegMethodsExecuted);
/* Misc */
ACPI_GLOBAL (UINT32, AcpiGbl_OriginalMode);
-ACPI_GLOBAL (UINT32, AcpiGbl_RsdpOriginalLocation);
ACPI_GLOBAL (UINT32, AcpiGbl_NsLookupCount);
ACPI_GLOBAL (UINT32, AcpiGbl_PsFindCount);
ACPI_GLOBAL (UINT16, AcpiGbl_Pm1EnableRegisterSave);
@@ -489,11 +355,6 @@ ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc);
ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes);
ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects);
-ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfParseTree);
-ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfMethodTrees);
-ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfNodeEntries);
-ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfAcpiObjects);
-
#endif /* ACPI_DEBUGGER */
diff --git a/source/include/aclocal.h b/source/include/aclocal.h
index 50a4a8e92383..3fcfe1fcb509 100644
--- a/source/include/aclocal.h
+++ b/source/include/aclocal.h
@@ -516,9 +516,9 @@ typedef struct acpi_gpe_register_info
{
ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */
ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */
+ UINT16 BaseGpeNumber; /* Base GPE number for this register */
UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */
UINT8 EnableForRun; /* GPEs to keep enabled when running */
- UINT8 BaseGpeNumber; /* Base GPE number for this register */
} ACPI_GPE_REGISTER_INFO;
@@ -534,10 +534,11 @@ typedef struct acpi_gpe_block_info
struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */
ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */
ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */
- ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */
+ UINT64 Address; /* Base address of the block */
UINT32 RegisterCount; /* Number of register pairs in block */
UINT16 GpeCount; /* Number of individual GPEs in block */
- UINT8 BlockBaseNumber;/* Base GPE number for this block */
+ UINT16 BlockBaseNumber;/* Base GPE number for this block */
+ UINT8 SpaceId;
BOOLEAN Initialized; /* TRUE if this block is initialized */
} ACPI_GPE_BLOCK_INFO;
diff --git a/source/include/acnames.h b/source/include/acnames.h
index f5daaceb2f81..3db143cbbdaa 100644
--- a/source/include/acnames.h
+++ b/source/include/acnames.h
@@ -55,6 +55,7 @@
#define METHOD_NAME__HID "_HID"
#define METHOD_NAME__INI "_INI"
#define METHOD_NAME__PLD "_PLD"
+#define METHOD_NAME__PRP "_PRP"
#define METHOD_NAME__PRS "_PRS"
#define METHOD_NAME__PRT "_PRT"
#define METHOD_NAME__PRW "_PRW"
diff --git a/source/include/acpixf.h b/source/include/acpixf.h
index 0b010470d0f9..53d2c1fd0ed4 100644
--- a/source/include/acpixf.h
+++ b/source/include/acpixf.h
@@ -41,64 +41,249 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-
#ifndef __ACXFACE_H__
#define __ACXFACE_H__
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20140325
+#define ACPI_CA_VERSION 0x20140424
#include "acconfig.h"
#include "actypes.h"
#include "actbl.h"
#include "acbuffer.h"
+
+/*****************************************************************************
+ *
+ * Macros used for ACPICA globals and configuration
+ *
+ ****************************************************************************/
+
+/*
+ * Ensure that global variables are defined and initialized only once.
+ *
+ * The use of these macros allows for a single list of globals (here)
+ * in order to simplify maintenance of the code.
+ */
+#ifdef DEFINE_ACPI_GLOBALS
+#define ACPI_GLOBAL(type,name) \
+ extern type name; \
+ type name
+
+#define ACPI_INIT_GLOBAL(type,name,value) \
+ type name=value
+
+#else
+#ifndef ACPI_GLOBAL
+#define ACPI_GLOBAL(type,name) \
+ extern type name
+#endif
+
+#ifndef ACPI_INIT_GLOBAL
+#define ACPI_INIT_GLOBAL(type,name,value) \
+ extern type name
+#endif
+#endif
+
+/*
+ * These macros configure the various ACPICA interfaces. They are
+ * useful for generating stub inline functions for features that are
+ * configured out of the current kernel or ACPICA application.
+ */
+#ifndef ACPI_EXTERNAL_RETURN_STATUS
+#define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_OK
+#define ACPI_EXTERNAL_RETURN_OK(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_VOID
+#define ACPI_EXTERNAL_RETURN_VOID(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_UINT32
+#define ACPI_EXTERNAL_RETURN_UINT32(Prototype) \
+ Prototype;
+#endif
+
+#ifndef ACPI_EXTERNAL_RETURN_PTR
+#define ACPI_EXTERNAL_RETURN_PTR(Prototype) \
+ Prototype;
+#endif
+
+
+/*****************************************************************************
+ *
+ * Public globals and runtime configuration options
+ *
+ ****************************************************************************/
+
+/*
+ * Enable "slack mode" of the AML interpreter? Default is FALSE, and the
+ * interpreter strictly follows the ACPI specification. Setting to TRUE
+ * allows the interpreter to ignore certain errors and/or bad AML constructs.
+ *
+ * Currently, these features are enabled by this flag:
+ *
+ * 1) Allow "implicit return" of last value in a control method
+ * 2) Allow access beyond the end of an operation region
+ * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
+ * 4) Allow ANY object type to be a source operand for the Store() operator
+ * 5) Allow unresolved references (invalid target name) in package objects
+ * 6) Enable warning messages for behavior that is not ACPI spec compliant
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableInterpreterSlack, FALSE);
+
+/*
+ * Automatically serialize all methods that create named objects? Default
+ * is TRUE, meaning that all NonSerialized methods are scanned once at
+ * table load time to determine those that create named objects. Methods
+ * that create named objects are marked Serialized in order to prevent
+ * possible run-time problems if they are entered by more than one thread.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_AutoSerializeMethods, TRUE);
+
+/*
+ * Create the predefined _OSI method in the namespace? Default is TRUE
+ * because ACPICA is fully compatible with other ACPI implementations.
+ * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CreateOsiMethod, TRUE);
+
+/*
+ * Optionally use default values for the ACPI register widths. Set this to
+ * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_UseDefaultRegisterWidths, TRUE);
+
+/*
+ * Optionally enable output from the AML Debug Object.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableAmlDebugObject, FALSE);
+
+/*
+ * Optionally copy the entire DSDT to local memory (instead of simply
+ * mapping it.) There are some BIOSs that corrupt or replace the original
+ * DSDT, creating the need for this option. Default is FALSE, do not copy
+ * the DSDT.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE);
+
+/*
+ * Optionally ignore an XSDT if present and use the RSDT instead.
+ * Although the ACPI specification requires that an XSDT be used instead
+ * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
+ * some machines. Default behavior is to use the XSDT if present.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
+
+/*
+ * Optionally use 32-bit FADT addresses if and when there is a conflict
+ * (address mismatch) between the 32-bit and 64-bit versions of the
+ * address. Although ACPICA adheres to the ACPI specification which
+ * requires the use of the corresponding 64-bit address if it is non-zero,
+ * some machines have been found to have a corrupted non-zero 64-bit
+ * address. Default is FALSE, do not favor the 32-bit addresses.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE);
+
+/*
+ * Optionally truncate I/O addresses to 16 bits. Provides compatibility
+ * with other ACPI implementations. NOTE: During ACPICA initialization,
+ * this value is set to TRUE if any Windows OSI strings have been
+ * requested by the BIOS.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_TruncateIoAddresses, FALSE);
+
+/*
+ * Disable runtime checking and repair of values returned by control methods.
+ * Use only if the repair is causing a problem on a particular machine.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE);
+
/*
- * Globals that are publically available
+ * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
+ * This can be useful for debugging ACPI problems on some machines.
*/
-extern UINT32 AcpiCurrentGpeCount;
-extern ACPI_TABLE_FADT AcpiGbl_FADT;
-extern BOOLEAN AcpiGbl_SystemAwakeAndRunning;
-extern BOOLEAN AcpiGbl_ReducedHardware; /* ACPI 5.0 */
-extern UINT8 AcpiGbl_OsiData;
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE);
-/* Runtime configuration of debug print levels */
+/*
+ * We keep track of the latest version of Windows that has been requested by
+ * the BIOS. ACPI 5.0.
+ */
+ACPI_INIT_GLOBAL (UINT8, AcpiGbl_OsiData, 0);
-extern UINT32 AcpiDbgLevel;
-extern UINT32 AcpiDbgLayer;
+/*
+ * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
+ * that the ACPI hardware is no longer required. A flag in the FADT indicates
+ * a reduced HW machine, and that flag is duplicated here for convenience.
+ */
+ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ReducedHardware, FALSE);
-/* ACPICA runtime options */
+/*
+ * This mechanism is used to trace a specified AML method. The method is
+ * traced each time it is executed.
+ */
+ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceFlags, 0);
+ACPI_INIT_GLOBAL (ACPI_NAME, AcpiGbl_TraceMethodName, 0);
-extern UINT8 AcpiGbl_AutoSerializeMethods;
-extern UINT8 AcpiGbl_CopyDsdtLocally;
-extern UINT8 AcpiGbl_CreateOsiMethod;
-extern UINT8 AcpiGbl_DisableAutoRepair;
-extern UINT8 AcpiGbl_DisableSsdtTableInstall;
-extern UINT8 AcpiGbl_DoNotUseXsdt;
-extern UINT8 AcpiGbl_EnableAmlDebugObject;
-extern UINT8 AcpiGbl_EnableInterpreterSlack;
-extern UINT32 AcpiGbl_TraceFlags;
-extern ACPI_NAME AcpiGbl_TraceMethodName;
-extern UINT8 AcpiGbl_TruncateIoAddresses;
-extern UINT8 AcpiGbl_Use32BitFadtAddresses;
-extern UINT8 AcpiGbl_UseDefaultRegisterWidths;
+/*
+ * Runtime configuration of debug output control masks. We want the debug
+ * switches statically initialized so they are already set when the debugger
+ * is entered.
+ */
+#ifdef ACPI_DEBUG_OUTPUT
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_DEBUG_DEFAULT);
+#else
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_NORMAL_DEFAULT);
+#endif
+ACPI_INIT_GLOBAL (UINT32, AcpiDbgLayer, ACPI_COMPONENT_DEFAULT);
+
+/*
+ * Other miscellaneous globals
+ */
+ACPI_GLOBAL (ACPI_TABLE_FADT, AcpiGbl_FADT);
+ACPI_GLOBAL (UINT32, AcpiCurrentGpeCount);
+ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning);
+/*****************************************************************************
+ *
+ * ACPICA public interface configuration.
+ *
+ * Interfaces that are configured out of the ACPICA build are replaced
+ * by inlined stubs by default.
+ *
+ ****************************************************************************/
+
/*
- * Hardware-reduced prototypes. All interfaces that use these macros will
- * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
+ * Hardware-reduced prototypes (default: Not hardware reduced).
+ *
+ * All ACPICA hardware-related interfaces that use these macros will be
+ * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
* is set to TRUE.
+ *
+ * Note: This static build option for reduced hardware is intended to
+ * reduce ACPICA code size if desired or necessary. However, even if this
+ * option is not specified, the runtime behavior of ACPICA is dependent
+ * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set,
+ * the flag will enable similar behavior -- ACPICA will not attempt
+ * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.)
*/
#if (!ACPI_REDUCED_HARDWARE)
#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_STATUS(Prototype)
#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_OK(Prototype)
#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
- Prototype;
+ ACPI_EXTERNAL_RETURN_VOID(Prototype)
#else
#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
@@ -114,29 +299,76 @@ extern UINT8 AcpiGbl_UseDefaultRegisterWidths;
/*
+ * Error message prototypes (default: error messages enabled).
+ *
+ * All interfaces related to error and warning messages
+ * will be configured out of the ACPICA build if the
+ * ACPI_NO_ERROR_MESSAGE flag is defined.
+ */
+#ifndef ACPI_NO_ERROR_MESSAGES
+#define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_NO_ERROR_MESSAGES */
+
+
+/*
+ * Debugging output prototypes (default: no debug output).
+ *
+ * All interfaces related to debug output messages
+ * will be configured out of the ACPICA build unless the
+ * ACPI_DEBUG_OUTPUT flag is defined.
+ */
+#ifdef ACPI_DEBUG_OUTPUT
+#define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
+ Prototype;
+
+#else
+#define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+
+#endif /* ACPI_DEBUG_OUTPUT */
+
+
+/*****************************************************************************
+ *
+ * ACPICA public interface prototypes
+ *
+ ****************************************************************************/
+
+/*
* Initialization
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeTables (
ACPI_TABLE_DESC *InitialStorage,
UINT32 InitialTableCount,
- BOOLEAN AllowResize);
+ BOOLEAN AllowResize))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeSubsystem (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnableSubsystem (
- UINT32 Flags);
+ UINT32 Flags))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInitializeObjects (
- UINT32 Flags);
+ UINT32 Flags))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiTerminate (
- void);
+ void))
/*
@@ -152,114 +384,136 @@ ACPI_STATUS
AcpiDisable (
void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiSubsystemStatus (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetSystemInfo (
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetStatistics (
- ACPI_STATISTICS *Stats);
+ ACPI_STATISTICS *Stats))
+ACPI_EXTERNAL_RETURN_PTR (
const char *
AcpiFormatException (
- ACPI_STATUS Exception);
+ ACPI_STATUS Exception))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiPurgeCachedObjects (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInterface (
- ACPI_STRING InterfaceName);
+ ACPI_STRING InterfaceName))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveInterface (
- ACPI_STRING InterfaceName);
+ ACPI_STRING InterfaceName))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiUpdateInterfaces (
- UINT8 Action);
+ UINT8 Action))
+ACPI_EXTERNAL_RETURN_UINT32 (
UINT32
AcpiCheckAddressRange (
ACPI_ADR_SPACE_TYPE SpaceId,
ACPI_PHYSICAL_ADDRESS Address,
ACPI_SIZE Length,
- BOOLEAN Warn);
+ BOOLEAN Warn))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDecodePldBuffer (
UINT8 *InBuffer,
ACPI_SIZE Length,
- ACPI_PLD_INFO **ReturnBuffer);
+ ACPI_PLD_INFO **ReturnBuffer))
/*
* ACPI table load/unload interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallTable (
ACPI_PHYSICAL_ADDRESS Address,
- BOOLEAN Physical);
+ BOOLEAN Physical))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLoadTable (
- ACPI_TABLE_HEADER *Table);
+ ACPI_TABLE_HEADER *Table))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiUnloadParentTable (
- ACPI_HANDLE Object);
+ ACPI_HANDLE Object))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLoadTables (
- void);
+ void))
/*
* ACPI table manipulation interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReallocateRootTable (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiFindRootPointer (
- ACPI_SIZE *RsdpAddress);
+ ACPI_SIZE *RsdpAddress))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTableHeader (
ACPI_STRING Signature,
UINT32 Instance,
- ACPI_TABLE_HEADER *OutTableHeader);
+ ACPI_TABLE_HEADER *OutTableHeader))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTable (
ACPI_STRING Signature,
UINT32 Instance,
- ACPI_TABLE_HEADER **OutTable);
+ ACPI_TABLE_HEADER **OutTable))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetTableByIndex (
UINT32 TableIndex,
- ACPI_TABLE_HEADER **OutTable);
+ ACPI_TABLE_HEADER **OutTable))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallTableHandler (
ACPI_TABLE_HANDLER Handler,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveTableHandler (
- ACPI_TABLE_HANDLER Handler);
+ ACPI_TABLE_HANDLER Handler))
/*
* Namespace and name interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkNamespace (
ACPI_OBJECT_TYPE Type,
@@ -268,104 +522,119 @@ AcpiWalkNamespace (
ACPI_WALK_CALLBACK DescendingCallback,
ACPI_WALK_CALLBACK AscendingCallback,
void *Context,
- void **ReturnValue);
+ void **ReturnValue))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetDevices (
char *HID,
ACPI_WALK_CALLBACK UserFunction,
void *Context,
- void **ReturnValue);
+ void **ReturnValue))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetName (
ACPI_HANDLE Object,
UINT32 NameType,
- ACPI_BUFFER *RetPathPtr);
+ ACPI_BUFFER *RetPathPtr))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetHandle (
ACPI_HANDLE Parent,
ACPI_STRING Pathname,
- ACPI_HANDLE *RetHandle);
+ ACPI_HANDLE *RetHandle))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiAttachData (
ACPI_HANDLE Object,
ACPI_OBJECT_HANDLER Handler,
- void *Data);
+ void *Data))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDetachData (
ACPI_HANDLE Object,
- ACPI_OBJECT_HANDLER Handler);
+ ACPI_OBJECT_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetData (
ACPI_HANDLE Object,
ACPI_OBJECT_HANDLER Handler,
- void **Data);
+ void **Data))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiDebugTrace (
char *Name,
UINT32 DebugLevel,
UINT32 DebugLayer,
- UINT32 Flags);
+ UINT32 Flags))
/*
* Object manipulation and enumeration
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEvaluateObject (
ACPI_HANDLE Object,
ACPI_STRING Pathname,
ACPI_OBJECT_LIST *ParameterObjects,
- ACPI_BUFFER *ReturnObjectBuffer);
+ ACPI_BUFFER *ReturnObjectBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEvaluateObjectTyped (
ACPI_HANDLE Object,
ACPI_STRING Pathname,
ACPI_OBJECT_LIST *ExternalParams,
ACPI_BUFFER *ReturnBuffer,
- ACPI_OBJECT_TYPE ReturnType);
+ ACPI_OBJECT_TYPE ReturnType))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetObjectInfo (
ACPI_HANDLE Object,
- ACPI_DEVICE_INFO **ReturnBuffer);
+ ACPI_DEVICE_INFO **ReturnBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallMethod (
- UINT8 *Buffer);
+ UINT8 *Buffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetNextObject (
ACPI_OBJECT_TYPE Type,
ACPI_HANDLE Parent,
ACPI_HANDLE Child,
- ACPI_HANDLE *OutHandle);
+ ACPI_HANDLE *OutHandle))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetType (
ACPI_HANDLE Object,
- ACPI_OBJECT_TYPE *OutType);
+ ACPI_OBJECT_TYPE *OutType))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetParent (
ACPI_HANDLE Object,
- ACPI_HANDLE *OutHandle);
+ ACPI_HANDLE *OutHandle))
/*
* Handler interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInitializationHandler (
ACPI_INIT_HANDLER Handler,
- UINT32 Function);
+ UINT32 Function))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
@@ -413,40 +682,46 @@ AcpiRemoveGpeHandler (
UINT32 GpeNumber,
ACPI_GPE_HANDLER Address))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
ACPI_NOTIFY_HANDLER Handler,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveNotifyHandler (
ACPI_HANDLE Device,
UINT32 HandlerType,
- ACPI_NOTIFY_HANDLER Handler);
+ ACPI_NOTIFY_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallAddressSpaceHandler (
ACPI_HANDLE Device,
ACPI_ADR_SPACE_TYPE SpaceId,
ACPI_ADR_SPACE_HANDLER Handler,
ACPI_ADR_SPACE_SETUP Setup,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRemoveAddressSpaceHandler (
ACPI_HANDLE Device,
ACPI_ADR_SPACE_TYPE SpaceId,
- ACPI_ADR_SPACE_HANDLER Handler);
+ ACPI_ADR_SPACE_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallExceptionHandler (
- ACPI_EXCEPTION_HANDLER Handler);
+ ACPI_EXCEPTION_HANDLER Handler))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiInstallInterfaceHandler (
- ACPI_INTERFACE_HANDLER Handler);
+ ACPI_INTERFACE_HANDLER Handler))
/*
@@ -467,16 +742,18 @@ AcpiReleaseGlobalLock (
/*
* Interfaces to AML mutex objects
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiAcquireMutex (
ACPI_HANDLE Handle,
ACPI_STRING Pathname,
- UINT16 Timeout);
+ UINT16 Timeout))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReleaseMutex (
ACPI_HANDLE Handle,
- ACPI_STRING Pathname);
+ ACPI_STRING Pathname))
/*
@@ -604,79 +881,92 @@ ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) (
ACPI_RESOURCE *Resource,
void *Context);
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetVendorResource (
ACPI_HANDLE Device,
char *Name,
ACPI_VENDOR_UUID *Uuid,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetCurrentResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetPossibleResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetEventResources (
ACPI_HANDLE DeviceHandle,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkResourceBuffer (
ACPI_BUFFER *Buffer,
ACPI_WALK_RESOURCE_CALLBACK UserFunction,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWalkResources (
ACPI_HANDLE Device,
char *Name,
ACPI_WALK_RESOURCE_CALLBACK UserFunction,
- void *Context);
+ void *Context))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiSetCurrentResources (
ACPI_HANDLE Device,
- ACPI_BUFFER *InBuffer);
+ ACPI_BUFFER *InBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetIrqRoutingTable (
ACPI_HANDLE Device,
- ACPI_BUFFER *RetBuffer);
+ ACPI_BUFFER *RetBuffer))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiResourceToAddress64 (
ACPI_RESOURCE *Resource,
- ACPI_RESOURCE_ADDRESS64 *Out);
+ ACPI_RESOURCE_ADDRESS64 *Out))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiBufferToResource (
UINT8 *AmlBuffer,
UINT16 AmlBufferLength,
- ACPI_RESOURCE **ResourcePtr);
+ ACPI_RESOURCE **ResourcePtr))
/*
* Hardware (ACPI device) interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiReset (
- void);
+ void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiRead (
UINT64 *Value,
- ACPI_GENERIC_ADDRESS *Reg);
+ ACPI_GENERIC_ADDRESS *Reg))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiWrite (
UINT64 Value,
- ACPI_GENERIC_ADDRESS *Reg);
+ ACPI_GENERIC_ADDRESS *Reg))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
@@ -694,32 +984,37 @@ AcpiWriteBitRegister (
/*
* Sleep/Wake interfaces
*/
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiGetSleepTypeData (
UINT8 SleepState,
UINT8 *Slp_TypA,
- UINT8 *Slp_TypB);
+ UINT8 *Slp_TypB))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepStatePrep (
- UINT8 SleepState);
+ UINT8 SleepState))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepState (
- UINT8 SleepState);
+ UINT8 SleepState))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiEnterSleepStateS4bios (
void))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLeaveSleepStatePrep (
- UINT8 SleepState);
+ UINT8 SleepState))
+ACPI_EXTERNAL_RETURN_STATUS (
ACPI_STATUS
AcpiLeaveSleepState (
- UINT8 SleepState);
+ UINT8 SleepState))
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
@@ -758,14 +1053,16 @@ AcpiGetTimerDuration (
/*
* Error/Warning output
*/
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiError (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(4)
void ACPI_INTERNAL_VAR_XFACE
AcpiException (
@@ -773,46 +1070,49 @@ AcpiException (
UINT32 LineNumber,
ACPI_STATUS Status,
const char *Format,
- ...);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiWarning (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiInfo (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiBiosError (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...);
+ ...))
+ACPI_MSG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
AcpiBiosWarning (
const char *ModuleName,
UINT32 LineNumber,
const char *Format,
- ...);
+ ...))
/*
* Debug output
*/
-#ifdef ACPI_DEBUG_OUTPUT
-
+ACPI_DBG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(6)
void ACPI_INTERNAL_VAR_XFACE
AcpiDebugPrint (
@@ -822,8 +1122,9 @@ AcpiDebugPrint (
const char *ModuleName,
UINT32 ComponentId,
const char *Format,
- ...);
+ ...))
+ACPI_DBG_DEPENDENT_RETURN_VOID (
ACPI_PRINTF_LIKE(6)
void ACPI_INTERNAL_VAR_XFACE
AcpiDebugPrintRaw (
@@ -833,7 +1134,6 @@ AcpiDebugPrintRaw (
const char *ModuleName,
UINT32 ComponentId,
const char *Format,
- ...);
-#endif
+ ...))
#endif /* __ACXFACE_H__ */
diff --git a/source/include/acpredef.h b/source/include/acpredef.h
index e5caaf650ae5..d7af2db26974 100644
--- a/source/include/acpredef.h
+++ b/source/include/acpredef.h
@@ -580,6 +580,10 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
{{"_LID", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
+ {{"_LPD", METHOD_0ARGS,
+ METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(rev), n Pkg (2 Int) */
+ PACKAGE_INFO (ACPI_PTYPE2_REV_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0),
+
{{"_MAT", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index ace4da91d878..fe47a73c9943 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -780,7 +780,7 @@ enum AcpiMadtType
/*
- * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
+ * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
*/
/* 0: Processor Local APIC */
@@ -1078,7 +1078,7 @@ enum AcpiSratType
};
/*
- * SRAT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
+ * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
*/
/* 0: Processor Local APIC/SAPIC Affinity */
diff --git a/source/include/actbl2.h b/source/include/actbl2.h
index ae46ad8d8124..df6692f4054f 100644
--- a/source/include/actbl2.h
+++ b/source/include/actbl2.h
@@ -72,6 +72,7 @@
#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
#define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */
#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
+#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_MTMR "MTMR" /* MID Timer table */
@@ -521,7 +522,7 @@ typedef struct acpi_dmar_pci_path
/*
- * DMAR Sub-tables, correspond to Type in ACPI_DMAR_HEADER
+ * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
*/
/* 0: Hardware Unit Definition */
@@ -934,7 +935,83 @@ typedef struct acpi_ivrs_memory
/*******************************************************************************
*
- * MCFG - PCI Memory Mapped Configuration table and sub-table
+ * LPIT - Low Power Idle Table
+ *
+ * Conforms to "ACPI Low Power Idle Table (LPIT) and _LPD Proposal (DRAFT)"
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_lpit
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+
+} ACPI_TABLE_LPIT;
+
+
+/* LPIT subtable header */
+
+typedef struct acpi_lpit_header
+{
+ UINT32 Type; /* Subtable type */
+ UINT32 Length; /* Subtable length */
+ UINT16 UniqueId;
+ UINT16 Reserved;
+ UINT32 Flags;
+
+} ACPI_LPIT_HEADER;
+
+/* Values for subtable Type above */
+
+enum AcpiLpitType
+{
+ ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
+ ACPI_LPIT_TYPE_SIMPLE_IO = 0x01
+};
+
+/* Masks for Flags field above */
+
+#define ACPI_LPIT_STATE_DISABLED (1)
+#define ACPI_LPIT_NO_COUNTER (1<<1)
+
+/*
+ * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
+ */
+
+/* 0x00: Native C-state instruction based LPI structure */
+
+typedef struct acpi_lpit_native
+{
+ ACPI_LPIT_HEADER Header;
+ ACPI_GENERIC_ADDRESS EntryTrigger;
+ UINT32 Residency;
+ UINT32 Latency;
+ ACPI_GENERIC_ADDRESS ResidencyCounter;
+ UINT64 CounterFrequency;
+
+} ACPI_LPIT_NATIVE;
+
+
+/* 0x01: Simple I/O based LPI structure */
+
+typedef struct acpi_lpit_io
+{
+ ACPI_LPIT_HEADER Header;
+ ACPI_GENERIC_ADDRESS EntryTrigger;
+ UINT32 TriggerAction;
+ UINT64 TriggerValue;
+ UINT64 TriggerMask;
+ ACPI_GENERIC_ADDRESS MinimumIdleState;
+ UINT32 Residency;
+ UINT32 Latency;
+ ACPI_GENERIC_ADDRESS ResidencyCounter;
+ UINT64 CounterFrequency;
+
+} ACPI_LPIT_IO;
+
+
+/*******************************************************************************
+ *
+ * MCFG - PCI Memory Mapped Configuration table and subtable
* Version 1
*
* Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
@@ -1058,7 +1135,7 @@ enum AcpiSlicType
/*
- * SLIC Sub-tables, correspond to Type in ACPI_SLIC_HEADER
+ * SLIC Subtables, correspond to Type in ACPI_SLIC_HEADER
*/
/* 0: Public Key Structure */
diff --git a/source/include/actypes.h b/source/include/actypes.h
index 4a6e492fc95f..7a8d5c5c3b4b 100644
--- a/source/include/actypes.h
+++ b/source/include/actypes.h
@@ -55,8 +55,6 @@
#error ACPI_MACHINE_WIDTH not defined
#endif
-/*! [Begin] no source code translation */
-
/*
* Data type ranges
* Note: These macros are designed to be compiler independent as well as
@@ -124,13 +122,15 @@
*
******************************************************************************/
+#ifndef ACPI_USE_SYSTEM_INTTYPES
+
typedef unsigned char BOOLEAN;
typedef unsigned char UINT8;
typedef unsigned short UINT16;
typedef COMPILER_DEPENDENT_UINT64 UINT64;
typedef COMPILER_DEPENDENT_INT64 INT64;
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
/*
* Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
@@ -151,12 +151,12 @@ typedef COMPILER_DEPENDENT_INT64 INT64;
#if ACPI_MACHINE_WIDTH == 64
-/*! [Begin] no source code translation (keep the typedefs as-is) */
+#ifndef ACPI_USE_SYSTEM_INTTYPES
typedef unsigned int UINT32;
typedef int INT32;
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
typedef INT64 ACPI_NATIVE_INT;
@@ -190,12 +190,12 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS;
#elif ACPI_MACHINE_WIDTH == 32
-/*! [Begin] no source code translation (keep the typedefs as-is) */
+#ifndef ACPI_USE_SYSTEM_INTTYPES
typedef unsigned int UINT32;
typedef int INT32;
-/*! [End] no source code translation !*/
+#endif /* ACPI_USE_SYSTEM_INTTYPES */
typedef INT32 ACPI_NATIVE_INT;
@@ -334,6 +334,15 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
*
******************************************************************************/
+#ifdef ACPI_NO_MEM_ALLOCATIONS
+
+#define ACPI_ALLOCATE(a) NULL
+#define ACPI_ALLOCATE_ZEROED(a) NULL
+#define ACPI_FREE(a)
+#define ACPI_MEM_TRACKING(a)
+
+#else /* ACPI_NO_MEM_ALLOCATIONS */
+
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
/*
* Memory allocation tracking (used by AcpiExec to detect memory leaks)
@@ -355,6 +364,8 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
+#endif /* ACPI_NO_MEM_ALLOCATIONS */
+
/******************************************************************************
*
@@ -954,9 +965,19 @@ typedef struct acpi_object_list
* Miscellaneous common Data Structures used by the interfaces
*/
#define ACPI_NO_BUFFER 0
+
+#ifdef ACPI_NO_MEM_ALLOCATIONS
+
+#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (0)
+#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (0)
+
+#else /* ACPI_NO_MEM_ALLOCATIONS */
+
#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) /* Let ACPICA allocate buffer */
#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) /* For internal use only (enables tracking) */
+#endif /* ACPI_NO_MEM_ALLOCATIONS */
+
typedef struct acpi_buffer
{
ACPI_SIZE Length; /* Length in bytes of the buffer */
diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h
index 994c9415a42d..a57f7f00db32 100644
--- a/source/include/platform/aclinux.h
+++ b/source/include/platform/aclinux.h
@@ -53,6 +53,8 @@
#ifdef __KERNEL__
+#define ACPI_USE_SYSTEM_INTTYPES
+
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/ctype.h>
@@ -66,6 +68,37 @@
#endif
#include <asm/acpi.h>
+#ifndef CONFIG_ACPI
+
+/* External globals for __KERNEL__, stubs is needed */
+
+#define ACPI_GLOBAL(t,a)
+#define ACPI_INIT_GLOBAL(t,a,b)
+
+/* Generating stubs for configurable ACPICA macros */
+
+#define ACPI_NO_MEM_ALLOCATIONS
+
+/* Generating stubs for configurable ACPICA functions */
+
+#define ACPI_NO_ERROR_MESSAGES
+#undef ACPI_DEBUG_OUTPUT
+
+/* External interface for __KERNEL__, stub is needed */
+
+#define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \
+ static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);}
+#define ACPI_EXTERNAL_RETURN_OK(Prototype) \
+ static ACPI_INLINE Prototype {return(AE_OK);}
+#define ACPI_EXTERNAL_RETURN_VOID(Prototype) \
+ static ACPI_INLINE Prototype {return;}
+#define ACPI_EXTERNAL_RETURN_UINT32(Prototype) \
+ static ACPI_INLINE Prototype {return(0);}
+#define ACPI_EXTERNAL_RETURN_PTR(Prototype) \
+ static ACPI_INLINE Prototype {return(NULL);}
+
+#endif /* CONFIG_ACPI */
+
/* Host-dependent types and defines for in-kernel ACPICA */
#define ACPI_MACHINE_WIDTH BITS_PER_LONG
diff --git a/source/os_specific/service_layers/oslinuxtbl.c b/source/os_specific/service_layers/oslinuxtbl.c
index f6e94c061235..aee929e0ee91 100644
--- a/source/os_specific/service_layers/oslinuxtbl.c
+++ b/source/os_specific/service_layers/oslinuxtbl.c
@@ -593,6 +593,34 @@ OslLoadRsdp (
/******************************************************************************
*
+ * FUNCTION: OslCanUseXsdt
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: TRUE if XSDT is allowed to be used.
+ *
+ * DESCRIPTION: This function collects logic that can be used to determine if
+ * XSDT should be used instead of RSDT.
+ *
+ *****************************************************************************/
+
+static BOOLEAN
+OslCanUseXsdt (
+ void)
+{
+ if (Gbl_Revision && !AcpiGbl_DoNotUseXsdt)
+ {
+ return (TRUE);
+ }
+ else
+ {
+ return (FALSE);
+ }
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: OslTableInitialize
*
* PARAMETERS: None
@@ -628,7 +656,7 @@ OslTableInitialize (
/* Get XSDT from memory */
- if (Gbl_Rsdp.Revision)
+ if (Gbl_Rsdp.Revision && !Gbl_DoNotDumpXsdt)
{
if (Gbl_Xsdt)
{
@@ -778,7 +806,7 @@ OslListBiosTables (
UINT32 i;
- if (Gbl_Revision)
+ if (OslCanUseXsdt ())
{
ItemSize = sizeof (UINT64);
TableData = ACPI_CAST8 (Gbl_Xsdt) + sizeof (ACPI_TABLE_HEADER);
@@ -799,7 +827,7 @@ OslListBiosTables (
for (i = 0; i < NumberOfTables; ++i, TableData += ItemSize)
{
- if (Gbl_Revision)
+ if (OslCanUseXsdt ())
{
TableAddress =
(ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST64 (TableData));
@@ -810,6 +838,13 @@ OslListBiosTables (
(ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST32 (TableData));
}
+ /* Skip NULL entries in RSDT/XSDT */
+
+ if (!TableAddress)
+ {
+ continue;
+ }
+
Status = OslMapTable (TableAddress, NULL, &MappedTable);
if (ACPI_FAILURE (Status))
{
@@ -933,7 +968,7 @@ OslGetBiosTable (
}
else /* Case for a normal ACPI table */
{
- if (Gbl_Revision)
+ if (OslCanUseXsdt ())
{
ItemSize = sizeof (UINT64);
TableData = ACPI_CAST8 (Gbl_Xsdt) + sizeof (ACPI_TABLE_HEADER);
@@ -954,7 +989,7 @@ OslGetBiosTable (
for (i = 0; i < NumberOfTables; ++i, TableData += ItemSize)
{
- if (Gbl_Revision)
+ if (OslCanUseXsdt ())
{
TableAddress =
(ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST64 (TableData));
@@ -965,6 +1000,13 @@ OslGetBiosTable (
(ACPI_PHYSICAL_ADDRESS) (*ACPI_CAST32 (TableData));
}
+ /* Skip NULL entries in RSDT/XSDT */
+
+ if (!TableAddress)
+ {
+ continue;
+ }
+
Status = OslMapTable (TableAddress, NULL, &MappedTable);
if (ACPI_FAILURE (Status))
{
@@ -1133,11 +1175,21 @@ OslMapTable (
/* If specified, signature must match */
- if (Signature &&
- !ACPI_COMPARE_NAME (Signature, MappedTable->Signature))
+ if (Signature)
{
- AcpiOsUnmapMemory (MappedTable, sizeof (ACPI_TABLE_HEADER));
- return (AE_BAD_SIGNATURE);
+ if (ACPI_VALIDATE_RSDP_SIG (Signature))
+ {
+ if (!ACPI_VALIDATE_RSDP_SIG (MappedTable->Signature))
+ {
+ AcpiOsUnmapMemory (MappedTable, sizeof (ACPI_TABLE_HEADER));
+ return (AE_BAD_SIGNATURE);
+ }
+ }
+ else if (!ACPI_COMPARE_NAME (Signature, MappedTable->Signature))
+ {
+ AcpiOsUnmapMemory (MappedTable, sizeof (ACPI_TABLE_HEADER));
+ return (AE_BAD_SIGNATURE);
+ }
}
/* Map the entire table */
@@ -1268,7 +1320,6 @@ OslReadTableFromFile (
ACPI_TABLE_HEADER *LocalTable = NULL;
UINT32 TableLength;
INT32 Count;
- UINT32 Total = 0;
ACPI_STATUS Status = AE_OK;
@@ -1295,13 +1346,24 @@ OslReadTableFromFile (
/* If signature is specified, it must match the table */
- if (Signature &&
- !ACPI_COMPARE_NAME (Signature, Header.Signature))
+ if (Signature)
{
- fprintf (stderr, "Incorrect signature: Expecting %4.4s, found %4.4s\n",
- Signature, Header.Signature);
- Status = AE_BAD_SIGNATURE;
- goto Exit;
+ if (ACPI_VALIDATE_RSDP_SIG (Signature))
+ {
+ if (!ACPI_VALIDATE_RSDP_SIG (Header.Signature)) {
+ fprintf (stderr, "Incorrect RSDP signature: found %8.8s\n",
+ Header.Signature);
+ Status = AE_BAD_SIGNATURE;
+ goto Exit;
+ }
+ }
+ else if (!ACPI_COMPARE_NAME (Signature, Header.Signature))
+ {
+ fprintf (stderr, "Incorrect signature: Expecting %4.4s, found %4.4s\n",
+ Signature, Header.Signature);
+ Status = AE_BAD_SIGNATURE;
+ goto Exit;
+ }
}
TableLength = ApGetTableLength (&Header);
@@ -1325,18 +1387,13 @@ OslReadTableFromFile (
fseek (TableFile, FileOffset, SEEK_SET);
- while (!feof (TableFile) && Total < TableLength)
+ Count = fread (LocalTable, 1, TableLength, TableFile);
+ if (Count != TableLength)
{
- Count = fread (LocalTable, 1, TableLength-Total, TableFile);
- if (Count < 0)
- {
- fprintf (stderr, "%4.4s: Could not read table content\n",
- Header.Signature);
- Status = AE_INVALID_TABLE_LENGTH;
- goto Exit;
- }
-
- Total += Count;
+ fprintf (stderr, "%4.4s: Could not read table content\n",
+ Header.Signature);
+ Status = AE_INVALID_TABLE_LENGTH;
+ goto Exit;
}
/* Validate checksum */
diff --git a/source/os_specific/service_layers/osunixxf.c b/source/os_specific/service_layers/osunixxf.c
index 224f345599eb..dd151eee9551 100644
--- a/source/os_specific/service_layers/osunixxf.c
+++ b/source/os_specific/service_layers/osunixxf.c
@@ -93,6 +93,7 @@ typedef void* (*PTHREAD_CALLBACK) (void *);
#include <termios.h>
struct termios OriginalTermAttributes;
+int TermAttributesWereSet = 0;
ACPI_STATUS
AcpiUtReadLine (
@@ -146,7 +147,7 @@ OsEnterLineEditMode (
if (tcgetattr (STDIN_FILENO, &OriginalTermAttributes))
{
- fprintf (stderr, "Could not get/set terminal attributes!\n");
+ fprintf (stderr, "Could not get terminal attributes!\n");
return;
}
@@ -159,16 +160,32 @@ OsEnterLineEditMode (
LocalTermAttributes.c_cc[VMIN] = 1;
LocalTermAttributes.c_cc[VTIME] = 0;
- tcsetattr (STDIN_FILENO, TCSANOW, &LocalTermAttributes);
+ if (tcsetattr (STDIN_FILENO, TCSANOW, &LocalTermAttributes))
+ {
+ fprintf (stderr, "Could not set terminal attributes!\n");
+ return;
+ }
+
+ TermAttributesWereSet = 1;
}
+
static void
OsExitLineEditMode (
void)
{
+
+ if (!TermAttributesWereSet)
+ {
+ return;
+ }
+
/* Set terminal attributes back to the original values */
- tcsetattr (STDIN_FILENO, TCSANOW, &OriginalTermAttributes);
+ if (tcsetattr (STDIN_FILENO, TCSANOW, &OriginalTermAttributes))
+ {
+ fprintf (stderr, "Could not restore terminal attributes!\n");
+ }
}
diff --git a/source/tools/acpidump/acpidump.h b/source/tools/acpidump/acpidump.h
index 4b0f01c11f48..1064eb4c6cf3 100644
--- a/source/tools/acpidump/acpidump.h
+++ b/source/tools/acpidump/acpidump.h
@@ -41,14 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#include "acpi.h"
-#include "accommon.h"
-#include "actables.h"
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/stat.h>
/*
* Global variables. Defined in main.c only, externed in all other files
@@ -56,11 +48,21 @@
#ifdef _DECLARE_GLOBALS
#define EXTERN
#define INIT_GLOBAL(a,b) a=b
+#define DEFINE_ACPI_GLOBALS 1
#else
#define EXTERN extern
#define INIT_GLOBAL(a,b) a
#endif
+#include "acpi.h"
+#include "accommon.h"
+#include "actables.h"
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/stat.h>
+
/* Globals */
@@ -68,6 +70,7 @@ EXTERN BOOLEAN INIT_GLOBAL (Gbl_SummaryMode, FALSE);
EXTERN BOOLEAN INIT_GLOBAL (Gbl_VerboseMode, FALSE);
EXTERN BOOLEAN INIT_GLOBAL (Gbl_BinaryMode, FALSE);
EXTERN BOOLEAN INIT_GLOBAL (Gbl_DumpCustomizedTables, FALSE);
+EXTERN BOOLEAN INIT_GLOBAL (Gbl_DoNotDumpXsdt, FALSE);
EXTERN FILE INIT_GLOBAL (*Gbl_OutputFile, NULL);
EXTERN char INIT_GLOBAL (*Gbl_OutputFilename, NULL);
EXTERN UINT64 INIT_GLOBAL (Gbl_RsdpBase, 0);
@@ -75,10 +78,7 @@ EXTERN UINT64 INIT_GLOBAL (Gbl_RsdpBase, 0);
/* Globals required for use with ACPICA modules */
#ifdef _DECLARE_GLOBALS
-UINT8 AcpiGbl_EnableInterpreterSlack = FALSE;
UINT8 AcpiGbl_IntegerByteWidth = 8;
-UINT32 AcpiDbgLevel = 0;
-UINT32 AcpiDbgLayer = 0;
#endif
/* Action table used to defer requested options */
diff --git a/source/tools/acpidump/apmain.c b/source/tools/acpidump/apmain.c
index a16f5830dd91..8929b0fb0ff7 100644
--- a/source/tools/acpidump/apmain.c
+++ b/source/tools/acpidump/apmain.c
@@ -92,7 +92,7 @@ UINT32 CurrentAction = 0;
#define AP_UTILITY_NAME "ACPI Binary Table Dump Utility"
-#define AP_SUPPORTED_OPTIONS "?a:bcf:hn:o:r:svz"
+#define AP_SUPPORTED_OPTIONS "?a:bcf:hn:o:r:svxz"
/******************************************************************************
@@ -124,6 +124,8 @@ ApDisplayUsage (
ACPI_OPTION ("-a <Address>", "Get table via a physical address");
ACPI_OPTION ("-f <BinaryFile>", "Get table via a binary file");
ACPI_OPTION ("-n <Signature>", "Get table via a name/signature");
+ ACPI_OPTION ("-x", "Do not use but dump XSDT");
+ ACPI_OPTION ("-x -x", "Do not use or dump XSDT");
printf (
"\n"
@@ -234,6 +236,18 @@ ApDoOptions (
Gbl_SummaryMode = TRUE;
continue;
+ case 'x': /* Do not use XSDT */
+
+ if (!AcpiGbl_DoNotUseXsdt)
+ {
+ AcpiGbl_DoNotUseXsdt = TRUE;
+ }
+ else
+ {
+ Gbl_DoNotDumpXsdt = TRUE;
+ }
+ continue;
+
case 'v': /* Revision/version */
printf (ACPI_COMMON_SIGNON (AP_UTILITY_NAME));
diff --git a/source/tools/acpiexec/aeexec.c b/source/tools/acpiexec/aeexec.c
index 4bf11ccdc0a7..4cad99bdd0df 100644
--- a/source/tools/acpiexec/aeexec.c
+++ b/source/tools/acpiexec/aeexec.c
@@ -765,13 +765,15 @@ AeMiscellaneousTests (
AE_CHECK_OK (AcpiEnableGpe, Status);
- Status = AcpiInstallGpeHandler (NULL, 0x62, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
+ /* GPE block 1 */
+
+ Status = AcpiInstallGpeHandler (NULL, 101, ACPI_GPE_LEVEL_TRIGGERED, AeGpeHandler, NULL);
AE_CHECK_OK (AcpiInstallGpeHandler, Status);
- Status = AcpiEnableGpe (NULL, 0x62);
+ Status = AcpiEnableGpe (NULL, 101);
AE_CHECK_OK (AcpiEnableGpe, Status);
- Status = AcpiDisableGpe (NULL, 0x62);
+ Status = AcpiDisableGpe (NULL, 101);
AE_CHECK_OK (AcpiDisableGpe, Status);
AfInstallGpeBlock ();
diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c
index ee2d2cf4fa3f..5ad24e980c5a 100644
--- a/source/tools/acpiexec/aehandlers.c
+++ b/source/tools/acpiexec/aehandlers.c
@@ -551,7 +551,7 @@ AeGpeHandler (
ACPI_NAMESPACE_NODE *DeviceNode = (ACPI_NAMESPACE_NODE *) GpeDevice;
- AcpiOsPrintf ("[AcpiExec] GPE Handler received GPE%02X (GPE block %4.4s)\n",
+ AcpiOsPrintf ("[AcpiExec] GPE Handler received GPE %02X (GPE block %4.4s)\n",
GpeNumber, GpeDevice ? DeviceNode->Name.Ascii : "FADT");
return (ACPI_REENABLE_GPE);
diff --git a/source/tools/acpiexec/aetables.c b/source/tools/acpiexec/aetables.c
index 67559af45ed1..e873b484d958 100644
--- a/source/tools/acpiexec/aetables.c
+++ b/source/tools/acpiexec/aetables.c
@@ -392,12 +392,12 @@ AeBuildLocalTables (
/* Miscellaneous FADT fields */
- LocalFADT.Gpe0BlockLength = 16;
+ LocalFADT.Gpe0BlockLength = 0x08;
LocalFADT.Gpe0Block = 0x00001234;
- LocalFADT.Gpe1BlockLength = 6;
+ LocalFADT.Gpe1BlockLength = 0x80;
LocalFADT.Gpe1Block = 0x00005678;
- LocalFADT.Gpe1Base = 96;
+ LocalFADT.Gpe1Base = 100;
LocalFADT.Pm1EventLength = 4;
LocalFADT.Pm1aEventBlock = 0x00001aaa;
diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c
index 0073128b631a..9e127a4942b6 100644
--- a/source/tools/acpisrc/astable.c
+++ b/source/tools/acpisrc/astable.c
@@ -646,6 +646,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"AH_AML_OPCODE", SRC_TYPE_STRUCT},
{"AH_ASL_OPERATOR", SRC_TYPE_STRUCT},
{"AH_ASL_KEYWORD", SRC_TYPE_STRUCT},
+ {"AH_DEVICE_ID", SRC_TYPE_STRUCT},
{"AH_PREDEFINED_NAME", SRC_TYPE_STRUCT},
/* AcpiXtract utility */
@@ -728,11 +729,19 @@ ACPI_STRING_TABLE LinuxSpecialStrings[] = {
ACPI_IDENTIFIER_TABLE LinuxSpecialMacros[] = {
+ {"ACPI_DBG_DEPENDENT_RETURN_VOID"},
{"ACPI_EXPORT_SYMBOL"},
{"ACPI_EXPORT_SYMBOL_INIT"},
+ {"ACPI_EXTERNAL_RETURN_OK"},
+ {"ACPI_EXTERNAL_RETURN_PTR"},
+ {"ACPI_EXTERNAL_RETURN_STATUS"},
+ {"ACPI_EXTERNAL_RETURN_UINT32"},
+ {"ACPI_EXTERNAL_RETURN_VOID"},
{"ACPI_HW_DEPENDENT_RETURN_OK"},
{"ACPI_HW_DEPENDENT_RETURN_STATUS"},
{"ACPI_HW_DEPENDENT_RETURN_VOID"},
+ {"ACPI_MSG_DEPENDENT_RETURN_VOID"},
+
{NULL}
};