summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generate/efi/Makefile.config6
-rwxr-xr-xgenerate/msvc2017/AcpiDump.vcxproj3
-rwxr-xr-xgenerate/msvc2017/AcpiDump.vcxproj.filters3
-rwxr-xr-xgenerate/msvc2017/AcpiExec.vcxproj1
-rwxr-xr-xgenerate/msvc2017/AcpiExec.vcxproj.filters3
-rwxr-xr-xgenerate/msvc2017/AcpiHelp.vcxproj.user2
-rwxr-xr-xgenerate/msvc2017/AcpiSubsystem.vcxproj1
-rwxr-xr-xgenerate/msvc2017/AcpiSubsystem.vcxproj.filters3
-rwxr-xr-xgenerate/msvc2017/AslCompiler.vcxproj1
-rwxr-xr-xgenerate/msvc2017/AslCompiler.vcxproj.filters3
-rwxr-xr-xgenerate/msvc2017/AslCompiler.vcxproj.user5
-rwxr-xr-xgenerate/msvc2017/Examples.vcxproj1
-rwxr-xr-xgenerate/msvc2017/Examples.vcxproj.filters3
-rw-r--r--generate/unix/Makefile.config5
-rw-r--r--generate/unix/acpidump/Makefile1
-rw-r--r--generate/unix/acpiexamples/Makefile1
-rw-r--r--generate/unix/acpiexec/Makefile1
-rw-r--r--generate/unix/iasl/Makefile23
-rw-r--r--source/common/acfileio.c131
-rw-r--r--source/common/adisasm.c4
-rw-r--r--source/common/ahtable.c2
-rw-r--r--source/common/ahuuids.c3
-rw-r--r--source/common/dmtable.c109
-rw-r--r--source/common/dmtables.c2
-rw-r--r--source/common/dmtbdump.c4
-rw-r--r--source/common/dmtbdump1.c205
-rw-r--r--source/common/dmtbdump2.c100
-rw-r--r--source/common/dmtbinfo1.c110
-rw-r--r--source/common/dmtbinfo2.c32
-rw-r--r--source/common/dmtbinfo3.c17
-rw-r--r--source/compiler/aslcodegen.c75
-rw-r--r--source/compiler/aslcompile.c12
-rw-r--r--source/compiler/aslerror.c1
-rw-r--r--source/compiler/aslhelp.c1
-rw-r--r--source/compiler/asloptions.c30
-rw-r--r--source/compiler/aslpredef.c2
-rw-r--r--source/compiler/aslstartup.c2
-rw-r--r--source/compiler/dtcompile.c42
-rw-r--r--source/compiler/dtcompiler.h8
-rw-r--r--source/compiler/dtio.c2
-rw-r--r--source/compiler/dttable1.c127
-rw-r--r--source/compiler/dttable2.c169
-rw-r--r--source/compiler/dttemplate.h63
-rw-r--r--source/compiler/dtutils.c3
-rw-r--r--source/components/events/evregion.c8
-rw-r--r--source/components/executer/exfield.c6
-rw-r--r--source/components/executer/exserial.c6
-rw-r--r--source/components/executer/exsystem.c12
-rw-r--r--source/components/tables/tbdata.c2
-rw-r--r--source/components/tables/tbfadt.c2
-rw-r--r--source/components/tables/tbprint.c90
-rw-r--r--source/components/tables/tbutils.c2
-rw-r--r--source/components/tables/tbxfroot.c32
-rw-r--r--source/components/utilities/utcksum.c335
-rw-r--r--source/components/utilities/utstring.c10
-rw-r--r--source/include/acconfig.h2
-rw-r--r--source/include/acdisasm.h19
-rw-r--r--source/include/acglobal.h1
-rw-r--r--source/include/actables.h10
-rw-r--r--source/include/actbinfo.h10
-rw-r--r--source/include/actbl1.h179
-rw-r--r--source/include/actbl2.h21
-rw-r--r--source/include/actypes.h6
-rw-r--r--source/include/acutils.h25
-rw-r--r--source/include/acuuid.h3
-rw-r--r--source/tools/acpidump/apdump.c4
-rw-r--r--source/tools/acpiexec/aetables.c10
-rw-r--r--source/tools/acpihelp/ahmain.c2
-rw-r--r--source/tools/acpisrc/astable.c3
-rw-r--r--source/tools/acpixtract/acpixtract.c2
-rw-r--r--source/tools/examples/extables.c8
71 files changed, 1814 insertions, 318 deletions
diff --git a/generate/efi/Makefile.config b/generate/efi/Makefile.config
index ada0be211..da49657bd 100644
--- a/generate/efi/Makefile.config
+++ b/generate/efi/Makefile.config
@@ -150,7 +150,6 @@ CWARNINGFLAGS = \
-Wall\
-Wbad-function-cast\
-Wdeclaration-after-statement\
- -Werror\
-Wformat=2\
-Wmissing-declarations\
-Wmissing-prototypes\
@@ -162,6 +161,11 @@ CWARNINGFLAGS = \
-Wmissing-parameter-type\
-Wold-style-declaration\
-Wtype-limits
+
+ifneq ($(NOWERROR),TRUE)
+CWARNINGFLAGS += -Werror
+endif
+
#
# Extra warning flags (for possible future use)
#
diff --git a/generate/msvc2017/AcpiDump.vcxproj b/generate/msvc2017/AcpiDump.vcxproj
index a187bc887..80e3bb804 100755
--- a/generate/msvc2017/AcpiDump.vcxproj
+++ b/generate/msvc2017/AcpiDump.vcxproj
@@ -122,7 +122,7 @@
<WarningLevel>Level4</WarningLevel>
<MinimalRebuild>false</MinimalRebuild>
<StringPooling>true</StringPooling>
- <AdditionalIncludeDirectories>..\..\source\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\source\include;%(AdditionalIncludeDirectories);..\..\source\compiler</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;WIN32;_CONSOLE;__STDC__;ACPI_DUMP_APP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerListingLocation>.\AcpiDumpDebug\</AssemblerListingLocation>
<PrecompiledHeaderOutputFile>.\AcpiDumpDebug\AcpiDump.pch</PrecompiledHeaderOutputFile>
@@ -169,6 +169,7 @@
<ClCompile Include="..\..\source\components\tables\tbxfroot.c" />
<ClCompile Include="..\..\source\components\utilities\utascii.c" />
<ClCompile Include="..\..\source\components\utilities\utbuffer.c" />
+ <ClCompile Include="..\..\source\components\utilities\utcksum.c" />
<ClCompile Include="..\..\source\components\utilities\utdebug.c" />
<ClCompile Include="..\..\source\components\utilities\utexcep.c" />
<ClCompile Include="..\..\source\components\utilities\utglobal.c" />
diff --git a/generate/msvc2017/AcpiDump.vcxproj.filters b/generate/msvc2017/AcpiDump.vcxproj.filters
index 9879a1992..d2cd7ab53 100755
--- a/generate/msvc2017/AcpiDump.vcxproj.filters
+++ b/generate/msvc2017/AcpiDump.vcxproj.filters
@@ -95,6 +95,9 @@
<ClCompile Include="..\..\source\components\utilities\utstrsuppt.c">
<Filter>Source Files\Utils</Filter>
</ClCompile>
+ <ClCompile Include="..\..\source\components\utilities\utcksum.c">
+ <Filter>Source Files\Utils</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\source\tools\acpidump\acpidump.h">
diff --git a/generate/msvc2017/AcpiExec.vcxproj b/generate/msvc2017/AcpiExec.vcxproj
index 18bd754ea..38d408a80 100755
--- a/generate/msvc2017/AcpiExec.vcxproj
+++ b/generate/msvc2017/AcpiExec.vcxproj
@@ -333,6 +333,7 @@
<ClCompile Include="..\..\source\components\utilities\utascii.c" />
<ClCompile Include="..\..\source\components\utilities\utbuffer.c" />
<ClCompile Include="..\..\source\components\utilities\utcache.c" />
+ <ClCompile Include="..\..\source\components\utilities\utcksum.c" />
<ClCompile Include="..\..\source\components\utilities\utcopy.c" />
<ClCompile Include="..\..\source\components\utilities\utdebug.c" />
<ClCompile Include="..\..\source\components\utilities\utdecode.c" />
diff --git a/generate/msvc2017/AcpiExec.vcxproj.filters b/generate/msvc2017/AcpiExec.vcxproj.filters
index f5c21d6ed..d33668d31 100755
--- a/generate/msvc2017/AcpiExec.vcxproj.filters
+++ b/generate/msvc2017/AcpiExec.vcxproj.filters
@@ -670,6 +670,9 @@
<ClCompile Include="..\..\source\components\dispatcher\dspkginit.c">
<Filter>Source Files\Dispatcher</Filter>
</ClCompile>
+ <ClCompile Include="..\..\source\components\utilities\utcksum.c">
+ <Filter>Source Files\Utilities</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\source\include\acapps.h">
diff --git a/generate/msvc2017/AcpiHelp.vcxproj.user b/generate/msvc2017/AcpiHelp.vcxproj.user
index 6a1316d1e..4b435fa14 100755
--- a/generate/msvc2017/AcpiHelp.vcxproj.user
+++ b/generate/msvc2017/AcpiHelp.vcxproj.user
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <LocalDebuggerCommandArguments>-x 0xb9</LocalDebuggerCommandArguments>
+ <LocalDebuggerCommandArguments>-v</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project> \ No newline at end of file
diff --git a/generate/msvc2017/AcpiSubsystem.vcxproj b/generate/msvc2017/AcpiSubsystem.vcxproj
index a509bcdcd..8cceab524 100755
--- a/generate/msvc2017/AcpiSubsystem.vcxproj
+++ b/generate/msvc2017/AcpiSubsystem.vcxproj
@@ -299,6 +299,7 @@
<ClCompile Include="..\..\source\components\utilities\utalloc.c" />
<ClCompile Include="..\..\source\components\utilities\utbuffer.c" />
<ClCompile Include="..\..\source\components\utilities\utcache.c" />
+ <ClCompile Include="..\..\source\components\utilities\utcksum.c" />
<ClCompile Include="..\..\source\components\utilities\utclib.c" />
<ClCompile Include="..\..\source\components\utilities\utcopy.c" />
<ClCompile Include="..\..\source\components\utilities\utdebug.c" />
diff --git a/generate/msvc2017/AcpiSubsystem.vcxproj.filters b/generate/msvc2017/AcpiSubsystem.vcxproj.filters
index 8062a4e14..af7d9583d 100755
--- a/generate/msvc2017/AcpiSubsystem.vcxproj.filters
+++ b/generate/msvc2017/AcpiSubsystem.vcxproj.filters
@@ -592,6 +592,9 @@
<ClCompile Include="..\..\source\common\cmfsize.c">
<Filter>Source Files\Common</Filter>
</ClCompile>
+ <ClCompile Include="..\..\source\components\utilities\utcksum.c">
+ <Filter>Source Files\Utilities</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\source\include\acbuffer.h">
diff --git a/generate/msvc2017/AslCompiler.vcxproj b/generate/msvc2017/AslCompiler.vcxproj
index e2179615c..5738c630b 100755
--- a/generate/msvc2017/AslCompiler.vcxproj
+++ b/generate/msvc2017/AslCompiler.vcxproj
@@ -355,6 +355,7 @@
<ClCompile Include="..\..\source\components\utilities\utascii.c" />
<ClCompile Include="..\..\source\components\utilities\utbuffer.c" />
<ClCompile Include="..\..\source\components\utilities\utcache.c" />
+ <ClCompile Include="..\..\source\components\utilities\utcksum.c" />
<ClCompile Include="..\..\source\components\utilities\utcopy.c" />
<ClCompile Include="..\..\source\components\utilities\utdebug.c" />
<ClCompile Include="..\..\source\components\utilities\utdecode.c" />
diff --git a/generate/msvc2017/AslCompiler.vcxproj.filters b/generate/msvc2017/AslCompiler.vcxproj.filters
index 50382e707..76dfdb0b5 100755
--- a/generate/msvc2017/AslCompiler.vcxproj.filters
+++ b/generate/msvc2017/AslCompiler.vcxproj.filters
@@ -688,6 +688,9 @@
<ClCompile Include="dtcompilerparser.y.c">
<Filter>Source Files\Intermediate</Filter>
</ClCompile>
+ <ClCompile Include="..\..\source\components\utilities\utcksum.c">
+ <Filter>Source Files\Utilities</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\source\compiler\aslcompiler.h">
diff --git a/generate/msvc2017/AslCompiler.vcxproj.user b/generate/msvc2017/AslCompiler.vcxproj.user
index d178a92a6..c6140842d 100755
--- a/generate/msvc2017/AslCompiler.vcxproj.user
+++ b/generate/msvc2017/AslCompiler.vcxproj.user
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <LocalDebuggerCommandArguments>
- </LocalDebuggerCommandArguments>
- <LocalDebuggerWorkingDirectory>$(ProjectDir)</LocalDebuggerWorkingDirectory>
+ <LocalDebuggerCommandArguments>-d -ds cdat cdat.aml</LocalDebuggerCommandArguments>
+ <LocalDebuggerWorkingDirectory>C:\0acpi-bugs\CDAT</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project> \ No newline at end of file
diff --git a/generate/msvc2017/Examples.vcxproj b/generate/msvc2017/Examples.vcxproj
index 3f6338aa7..8977e41cd 100755
--- a/generate/msvc2017/Examples.vcxproj
+++ b/generate/msvc2017/Examples.vcxproj
@@ -250,6 +250,7 @@
<ClCompile Include="..\..\source\components\utilities\utascii.c" />
<ClCompile Include="..\..\source\components\utilities\utbuffer.c" />
<ClCompile Include="..\..\source\components\utilities\utcache.c" />
+ <ClCompile Include="..\..\source\components\utilities\utcksum.c" />
<ClCompile Include="..\..\source\components\utilities\utclib.c" />
<ClCompile Include="..\..\source\components\utilities\utcopy.c" />
<ClCompile Include="..\..\source\components\utilities\utdebug.c" />
diff --git a/generate/msvc2017/Examples.vcxproj.filters b/generate/msvc2017/Examples.vcxproj.filters
index 083cce82d..dbb3d9f50 100755
--- a/generate/msvc2017/Examples.vcxproj.filters
+++ b/generate/msvc2017/Examples.vcxproj.filters
@@ -435,6 +435,9 @@
<ClCompile Include="..\..\source\components\dispatcher\dspkginit.c">
<Filter>Source Files\Dispatcher</Filter>
</ClCompile>
+ <ClCompile Include="..\..\source\components\utilities\utcksum.c">
+ <Filter>Source Files\Utilities</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\source\tools\examples\examples.h">
diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config
index b46634367..0deeb1411 100644
--- a/generate/unix/Makefile.config
+++ b/generate/unix/Makefile.config
@@ -203,7 +203,6 @@ CWARNINGFLAGS = \
-Wall\
-Wbad-function-cast\
-Wdeclaration-after-statement\
- -Werror\
-Wformat=2\
-Wmissing-declarations\
-Wmissing-prototypes\
@@ -213,6 +212,10 @@ CWARNINGFLAGS = \
-Wpointer-arith\
-Wundef
+ifneq ($(NOWERROR),TRUE)
+CWARNINGFLAGS += -Werror
+endif
+
#
# Common gcc 4+ warning flags
#
diff --git a/generate/unix/acpidump/Makefile b/generate/unix/acpidump/Makefile
index 292eec712..ac6ee9b6d 100644
--- a/generate/unix/acpidump/Makefile
+++ b/generate/unix/acpidump/Makefile
@@ -40,6 +40,7 @@ OBJECTS = \
$(OBJDIR)/tbxfroot.o\
$(OBJDIR)/utascii.o\
$(OBJDIR)/utbuffer.o\
+ $(OBJDIR)/utcksum.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utexcep.o\
$(OBJDIR)/utglobal.o\
diff --git a/generate/unix/acpiexamples/Makefile b/generate/unix/acpiexamples/Makefile
index 0f23c88de..5a3d508f8 100644
--- a/generate/unix/acpiexamples/Makefile
+++ b/generate/unix/acpiexamples/Makefile
@@ -135,6 +135,7 @@ OBJECTS = \
$(OBJDIR)/utascii.o\
$(OBJDIR)/utbuffer.o\
$(OBJDIR)/utcache.o\
+ $(OBJDIR)/utcksum.o\
$(OBJDIR)/utcopy.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
diff --git a/generate/unix/acpiexec/Makefile b/generate/unix/acpiexec/Makefile
index 660afa939..389455a6f 100644
--- a/generate/unix/acpiexec/Makefile
+++ b/generate/unix/acpiexec/Makefile
@@ -210,6 +210,7 @@ OBJECTS = \
$(OBJDIR)/utascii.o\
$(OBJDIR)/utbuffer.o\
$(OBJDIR)/utcache.o\
+ $(OBJDIR)/utcksum.o\
$(OBJDIR)/utcopy.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile
index 47ea73cab..8fde63d46 100644
--- a/generate/unix/iasl/Makefile
+++ b/generate/unix/iasl/Makefile
@@ -221,6 +221,7 @@ OBJECTS = \
$(OBJDIR)/utascii.o\
$(OBJDIR)/utbuffer.o\
$(OBJDIR)/utcache.o\
+ $(OBJDIR)/utcksum.o\
$(OBJDIR)/utcopy.o\
$(OBJDIR)/utdebug.o\
$(OBJDIR)/utdecode.o\
@@ -290,6 +291,12 @@ CFLAGS += \
-I$(ASL_COMPILER)\
-I$(OBJDIR)
+ifeq ($(NOWERROR),TRUE)
+WERROR_FLAGS=
+else
+WERROR_FLAGS=-Werror
+endif
+
#
# Common Rules
#
@@ -360,32 +367,32 @@ $(OBJDIR)/prparserparse.c $(OBJDIR)/prparser.y.h : $(ASL_COMPILER)/prparse
#
$(OBJDIR)/aslcompilerlex.o : $(OBJDIR)/aslcompilerlex.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) -Wall $(WERROR_FLAGS) -o$@ $<
$(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) -Wall $(WERROR_FLAGS) -o$@ $<
$(OBJDIR)/dtcompilerparserlex.o : $(OBJDIR)/dtcompilerparserlex.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) -Wall $(WERROR_FLAGS) -o$@ $<
$(OBJDIR)/dtcompilerparserparse.o : $(OBJDIR)/dtcompilerparserparse.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) -Wall $(WERROR_FLAGS) -o$@ $<
$(OBJDIR)/dtparserlex.o : $(OBJDIR)/dtparserlex.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) -Wall $(WERROR_FLAGS) -o$@ $<
$(OBJDIR)/dtparserparse.o : $(OBJDIR)/dtparserparse.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) -Wall $(WERROR_FLAGS) -o$@ $<
$(OBJDIR)/prparserlex.o : $(OBJDIR)/prparserlex.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) -Wall $(WERROR_FLAGS) -o$@ $<
$(OBJDIR)/prparserparse.o : $(OBJDIR)/prparserparse.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) -Wall $(WERROR_FLAGS) -o$@ $<
diff --git a/source/common/acfileio.c b/source/common/acfileio.c
index 7c624f5d3..77f7337a3 100644
--- a/source/common/acfileio.c
+++ b/source/common/acfileio.c
@@ -387,16 +387,36 @@ AcGetOneTableFromFile (
ACPI_TABLE_HEADER TableHeader;
ACPI_TABLE_HEADER *Table;
INT32 Count;
- long TableOffset;
-
+ UINT32 TableLength;
+ UINT32 HeaderLength;
+ long TableOffset = 0;
*ReturnTable = NULL;
/* Get the table header to examine signature and length */
+ /*
+ * Special handling for the CDAT table (both the Length field
+ * and the Checksum field are not in the standard positions).
+ * (The table header is non-standard).
+ */
+ if (AcpiGbl_CDAT)
+ {
+ HeaderLength = sizeof (ACPI_TABLE_CDAT);
+ }
+ else
+ {
+ HeaderLength = sizeof (ACPI_TABLE_HEADER);
+ }
+
+ Status = AcValidateTableHeader (File, TableOffset);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
TableOffset = ftell (File);
- Count = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), File);
- if (Count != sizeof (ACPI_TABLE_HEADER))
+ Count = fread (&TableHeader, 1, HeaderLength, File);
+ if (Count != (INT32) HeaderLength)
{
return (AE_CTRL_TERMINATE);
}
@@ -405,12 +425,6 @@ AcGetOneTableFromFile (
{
/* Validate the table signature/header (limited ASCII chars) */
- Status = AcValidateTableHeader (File, TableOffset);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
-
/*
* Table must be an AML table (DSDT/SSDT).
* Used for iASL -e option only.
@@ -425,9 +439,22 @@ AcGetOneTableFromFile (
}
}
+ /*
+ * Special handling for the CDAT table (both the Length field
+ * and the Checksum field are not in the standard positions).
+ */
+ if (AcpiGbl_CDAT)
+ {
+ TableLength = ACPI_CAST_PTR (ACPI_TABLE_CDAT, &TableHeader)->Length;
+ }
+ else
+ {
+ TableLength = TableHeader.Length;
+ }
+
/* Allocate a buffer for the entire table */
- Table = AcpiOsAllocate ((ACPI_SIZE) TableHeader.Length);
+ Table = AcpiOsAllocate ((ACPI_SIZE) TableLength);
if (!Table)
{
return (AE_NO_MEMORY);
@@ -436,22 +463,31 @@ AcGetOneTableFromFile (
/* Read the entire ACPI table, including header */
fseek (File, TableOffset, SEEK_SET);
-
- Count = fread (Table, 1, TableHeader.Length, File);
+ Count = fread (Table, 1, TableLength, File);
/*
* Checks for data table headers happen later in the execution. Only verify
* for Aml tables at this point in the code.
*/
- if (GetOnlyAmlTables && Count != (INT32) TableHeader.Length)
+ if (GetOnlyAmlTables && Count != (INT32) TableLength)
{
Status = AE_ERROR;
goto ErrorExit;
}
- /* Validate the checksum (just issue a warning) */
+ /*
+ * Validate the checksum (just issue a warning if incorrect).
+ * Note: CDAT is special cased here because the table does
+ * not have the checksum field in the standard position.
+ */
+ if (AcpiGbl_CDAT)
+ {
+ Status = AcpiUtVerifyCdatChecksum ((ACPI_TABLE_CDAT *) Table, TableLength);
+ } else
+ {
+ Status = AcpiUtVerifyChecksum (Table, TableLength);
+ }
- Status = AcpiTbVerifyChecksum (Table, TableHeader.Length);
if (ACPI_FAILURE (Status))
{
Status = AcCheckTextModeCorruption (Table);
@@ -540,6 +576,8 @@ AcValidateTableHeader (
long TableOffset)
{
ACPI_TABLE_HEADER TableHeader;
+ ACPI_TABLE_CDAT *CdatTableHeader = ACPI_CAST_PTR (ACPI_TABLE_CDAT, &TableHeader);
+ UINT32 HeaderLength;
ACPI_SIZE Actual;
long OriginalOffset;
UINT32 FileSize;
@@ -548,6 +586,16 @@ AcValidateTableHeader (
ACPI_FUNCTION_TRACE (AcValidateTableHeader);
+ /* Determine the type of table header */
+
+ if (AcpiGbl_CDAT)
+ {
+ HeaderLength = sizeof (ACPI_TABLE_CDAT);
+ }
+ else
+ {
+ HeaderLength = sizeof (ACPI_TABLE_HEADER);
+ }
/* Read a potential table header */
@@ -556,41 +604,76 @@ AcValidateTableHeader (
{
fprintf (stderr, "SEEK error\n");
}
- Actual = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), File);
+ Actual = fread (&TableHeader, 1, HeaderLength, File);
if (fseek (File, OriginalOffset, SEEK_SET))
{
fprintf (stderr, "SEEK error\n");
}
- if (Actual < sizeof (ACPI_TABLE_HEADER))
+ if (Actual < HeaderLength)
{
fprintf (stderr,
"Could not read entire table header: Actual %u, Requested %u\n",
- (UINT32) Actual, (UINT32) sizeof (ACPI_TABLE_HEADER));
+ (UINT32) Actual, HeaderLength);
return (AE_ERROR);
}
/* Validate the signature (limited ASCII chars) */
- if (!AcpiUtValidNameseg (TableHeader.Signature))
+ if (!AcpiGbl_CDAT && !AcpiUtValidNameseg (TableHeader.Signature))
{
+ /*
+ * The "-ds cdat" option was not used, and the signature is not valid.
+ *
+ * For CDAT we are assuming that there should be at least one non-ASCII
+ * byte in the (normally) 4-character Signature field (at least the
+ * high-order byte should be zero). Otherwise, this is OK.
+ */
+ fprintf (stderr,
+ "\nTable appears to be a CDAT table, which has no signature.\n"
+ "If this is in fact a CDAT table, use the -ds option on the\n"
+ "command line to specify the table type (signature):\n"
+ "\"iasl -d -ds CDAT <file>\" or \"iasl -ds CDAT -T CDAT\"\n\n");
+
return (AE_BAD_SIGNATURE);
}
/* Validate table length against bytes remaining in the file */
FileSize = CmGetFileSize (File);
- if (TableHeader.Length > (UINT32) (FileSize - TableOffset))
+ if (!AcpiGbl_CDAT)
+ {
+ /* Standard ACPI table header */
+
+ if (TableHeader.Length > (UINT32) (FileSize - TableOffset))
+ {
+ fprintf (stderr, "Table [%4.4s] is too long for file - "
+ "needs: 0x%.2X, remaining in file: 0x%.2X\n",
+ TableHeader.Signature, TableHeader.Length,
+ (UINT32) (FileSize - TableOffset));
+ return (AE_BAD_HEADER);
+ }
+ }
+ else if (CdatTableHeader->Length > (UINT32) (FileSize - TableOffset))
{
- fprintf (stderr, "Table [%4.4s] is too long for file - "
+ /* Special header for CDAT table */
+
+ fprintf (stderr, "Table [CDAT] is too long for file - "
"needs: 0x%.2X, remaining in file: 0x%.2X\n",
- TableHeader.Signature, TableHeader.Length,
+ CdatTableHeader->Length,
(UINT32) (FileSize - TableOffset));
return (AE_BAD_HEADER);
}
+ /* For CDAT table, there are no ASCII fields in the header, we are done */
+
+ if (AcpiGbl_CDAT)
+ {
+ return (AE_OK);
+ }
+
/*
- * These fields must be ASCII: OemId, OemTableId, AslCompilerId.
+ * These standard fields must be ASCII: OemId, OemTableId, AslCompilerId.
* We allow a NULL terminator in OemId and OemTableId.
*/
for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
diff --git a/source/common/adisasm.c b/source/common/adisasm.c
index ecb984858..49338e741 100644
--- a/source/common/adisasm.c
+++ b/source/common/adisasm.c
@@ -476,13 +476,13 @@ AdDisassembleOneTable (
/* This is a "Data Table" (non-AML table) */
AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n",
- Table->Signature);
+ AcpiGbl_CDAT ? (char *) AcpiGbl_CDAT : Table->Signature);
AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] "
"FieldName : FieldValue (in hex)\n */\n\n");
AcpiDmDumpDataTable (Table);
fprintf (stderr, "Acpi Data Table [%4.4s] decoded\n",
- Table->Signature);
+ AcpiGbl_CDAT ? (char *) AcpiGbl_CDAT : Table->Signature);
if (File)
{
diff --git a/source/common/ahtable.c b/source/common/ahtable.c
index bff8ae790..418621b66 100644
--- a/source/common/ahtable.c
+++ b/source/common/ahtable.c
@@ -206,6 +206,8 @@ const AH_TABLE AcpiGbl_SupportedTables[] =
{ACPI_SIG_BERT, "Boot Error Record Table"},
{ACPI_SIG_BGRT, "Boot Graphics Resource Table"},
{ACPI_SIG_BOOT, "Simple Boot Flag Table"},
+ {ACPI_SIG_CCEL, "CC-Event Log Table"},
+ {ACPI_SIG_CDAT, "Coherent Device Attribute Table"},
{ACPI_SIG_CEDT, "CXL Early Discovery Table"},
{ACPI_SIG_CPEP, "Corrected Platform Error Polling Table"},
{ACPI_SIG_CSRT, "Core System Resource Table"},
diff --git a/source/common/ahuuids.c b/source/common/ahuuids.c
index 909698c57..dcf0c4bbb 100644
--- a/source/common/ahuuids.c
+++ b/source/common/ahuuids.c
@@ -209,6 +209,9 @@ const AH_UUID Gbl_AcpiUuids[] =
{"Hierarchical Data Extension", UUID_HIERARCHICAL_DATA_EXTENSION},
{"ARM Coresight Graph", UUID_CORESIGHT_GRAPH},
{"USB4 Capabilities", UUID_USB4_CAPABILITIES},
+ {"First Function ID for _DSM", UUID_1ST_FUNCTION_ID},
+ {"Second Function ID for _DSM", UUID_2ND_FUNCTION_ID},
+
{NULL, NULL}
};
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
index b67848cfd..9b95ecc74 100644
--- a/source/common/dmtable.c
+++ b/source/common/dmtable.c
@@ -234,6 +234,17 @@ static const char *AcpiDmAsfSubnames[] =
"Unknown Subtable Type" /* Reserved */
};
+static const char *AcpiDmCdatSubnames[] =
+{
+ "Device Scoped Memory Affinity Structure (DSMAS)",
+ "Device scoped Latency and Bandwidth Information Structure (DSLBIS)",
+ "Device Scoped Memory Side Cache Information Structure (DSMSCIS)",
+ "Device Scoped Initiator Structure (DSIS)",
+ "Device Scoped EFI Memory Type Structure (DSEMTS)",
+ "Switch Scoped Latency and Bandwidth Information Structure (SSLBIS)",
+ "Unknown Subtable Type" /* Reserved */
+};
+
static const char *AcpiDmCedtSubnames[] =
{
"CXL Host Bridge Structure",
@@ -665,6 +676,8 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
{ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert},
{ACPI_SIG_BGRT, AcpiDmTableInfoBgrt, NULL, NULL, TemplateBgrt},
{ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot},
+ {ACPI_SIG_CCEL, AcpiDmTableInfoCcel, NULL, NULL, TemplateCcel},
+ {ACPI_SIG_CDAT, NULL, AcpiDmDumpCdat, NULL, TemplateCdat},
{ACPI_SIG_CEDT, NULL, AcpiDmDumpCedt, DtCompileCedt, TemplateCedt},
{ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep},
{ACPI_SIG_CSRT, NULL, AcpiDmDumpCsrt, DtCompileCsrt, TemplateCsrt},
@@ -731,44 +744,6 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] =
/*******************************************************************************
*
- * FUNCTION: AcpiDmGenerateChecksum
- *
- * PARAMETERS: Table - Pointer to table to be checksummed
- * Length - Length of the table
- * OriginalChecksum - Value of the checksum field
- *
- * RETURN: 8 bit checksum of buffer
- *
- * DESCRIPTION: Computes an 8 bit checksum of the table.
- *
- ******************************************************************************/
-
-UINT8
-AcpiDmGenerateChecksum (
- void *Table,
- UINT32 Length,
- UINT8 OriginalChecksum)
-{
- UINT8 Checksum;
-
-
- /* Sum the entire table as-is */
-
- Checksum = AcpiTbChecksum ((UINT8 *) Table, Length);
-
- /* Subtract off the existing checksum value in the table */
-
- Checksum = (UINT8) (Checksum - OriginalChecksum);
-
- /* Compute the final checksum */
-
- Checksum = (UINT8) (0 - Checksum);
- return (Checksum);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiDmGetTableData
*
* PARAMETERS: Signature - ACPI signature (4 chars) to match
@@ -841,7 +816,7 @@ AcpiDmDumpDataTable (
/*
* Handle tables that don't use the common ACPI table header structure.
- * Currently, these are the FACS, RSDP, and S3PT.
+ * Currently, these are the FACS, RSDP, S3PT and CDAT.
*/
if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS))
{
@@ -861,6 +836,28 @@ AcpiDmDumpDataTable (
{
Length = AcpiDmDumpS3pt (Table);
}
+ else if (!AcpiUtValidNameseg (Table->Signature))
+ {
+ /*
+ * For CDAT we are assuming that there should be at least one non-ASCII
+ * byte in the (normally) 4-character Signature field (at least the
+ * high-order byte should be zero).
+ */
+ if (AcpiGbl_CDAT)
+ {
+ /*
+ * Invalid signature and <-ds CDAT> was specified on the command line.
+ * Therefore, we have a CDAT table.
+ */
+ AcpiDmDumpCdat (Table);
+ }
+ else
+ {
+ fprintf (stderr, "Table has an invalid signature\n");
+ }
+
+ return;
+ }
else
{
/*
@@ -984,7 +981,7 @@ AcpiDmLineHeader (
{
if (ByteLength)
{
- AcpiOsPrintf ("[%3.3Xh %4.4d% 4d] %28s : ",
+ AcpiOsPrintf ("[%3.3Xh %4.4u %3.3Xh] %27s : ",
Offset, Offset, ByteLength, Name);
}
else
@@ -1026,12 +1023,12 @@ AcpiDmLineHeader2 (
{
if (ByteLength)
{
- AcpiOsPrintf ("[%3.3Xh %4.4d %3d] %24s %3d : ",
+ AcpiOsPrintf ("[%3.3Xh %4.4u %3.3Xh] %24s %3d : ",
Offset, Offset, ByteLength, Name, Value);
}
else
{
- AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s %3d : ",
+ AcpiOsPrintf ("[%3.3Xh %4.4u ] %24s %3d : ",
Offset, Offset, Name, Value);
}
}
@@ -1113,7 +1110,8 @@ AcpiDmDumpTable (
{
AcpiOsPrintf (
"/**** ACPI table terminates "
- "in the middle of a data structure! (dump table) */\n");
+ "in the middle of a data structure! (dump table) \n"
+ "CurrentOffset: %X, TableLength: %X ***/", CurrentOffset, TableLength);
return (AE_BAD_DATA);
}
@@ -1147,6 +1145,7 @@ AcpiDmDumpTable (
case ACPI_DMT_AEST_XFACE:
case ACPI_DMT_AEST_XRUPT:
case ACPI_DMT_ASF:
+ case ACPI_DMT_CDAT:
case ACPI_DMT_HESTNTYP:
case ACPI_DMT_FADTPM:
case ACPI_DMT_EINJACT:
@@ -1529,7 +1528,7 @@ AcpiDmDumpTable (
/* Checksum, display and validate */
AcpiOsPrintf ("%2.2X", *Target);
- Temp8 = AcpiDmGenerateChecksum (Table,
+ Temp8 = AcpiUtGenerateChecksum (Table,
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length,
ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum);
@@ -1675,6 +1674,20 @@ AcpiDmDumpTable (
AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmAsfSubnames[Temp16]);
break;
+ case ACPI_DMT_CDAT:
+
+ /* CDAT subtable types */
+
+ Temp8 = *Target;
+ if (Temp8 > ACPI_CDAT_TYPE_RESERVED)
+ {
+ Temp8 = ACPI_CDAT_TYPE_RESERVED;
+ }
+
+ AcpiOsPrintf (UINT8_FORMAT, *Target,
+ AcpiDmCdatSubnames[Temp8]);
+ break;
+
case ACPI_DMT_CEDT:
/* CEDT subtable types */
@@ -2024,15 +2037,15 @@ AcpiDmDumpTable (
case ACPI_DMT_PHAT:
- /* PMTT subtable types */
+ /* PHAT subtable types */
- Temp16 = *Target;
+ Temp16 = ACPI_GET16 (Target);
if (Temp16 > ACPI_PHAT_TYPE_RESERVED)
{
Temp16 = ACPI_PHAT_TYPE_RESERVED;
}
- AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16(Target),
+ AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target),
AcpiDmPhatSubnames[Temp16]);
break;
@@ -2076,7 +2089,7 @@ AcpiDmDumpTable (
break;
}
- AcpiDmDumpUnicode (Table, CurrentOffset, ByteLength);
+ AcpiDmDumpUnicode (Table, 0, ByteLength);
break;
case ACPI_DMT_RAW_BUFFER:
diff --git a/source/common/dmtables.c b/source/common/dmtables.c
index 6f42bcb3b..7ade78685 100644
--- a/source/common/dmtables.c
+++ b/source/common/dmtables.c
@@ -296,7 +296,7 @@ AdCreateTableHeader (
AcpiOsPrintf ("\n * Checksum 0x%2.2X", Table->Checksum);
- Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Table->Length);
+ Checksum = AcpiUtChecksum (ACPI_CAST_PTR (UINT8, Table), Table->Length);
if (Checksum)
{
AcpiOsPrintf (" **** Incorrect checksum, should be 0x%2.2X",
diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c
index b4faf6831..dc1745d5d 100644
--- a/source/common/dmtbdump.c
+++ b/source/common/dmtbdump.c
@@ -384,7 +384,7 @@ AcpiDmDumpRsdp (
/* Validate the first checksum */
- Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON),
+ Checksum = AcpiUtGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON),
Rsdp->Checksum);
if (Checksum != Rsdp->Checksum)
{
@@ -405,7 +405,7 @@ AcpiDmDumpRsdp (
/* Validate the extended checksum over entire RSDP */
- Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP),
+ Checksum = AcpiUtGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP),
Rsdp->ExtendedChecksum);
if (Checksum != Rsdp->ExtendedChecksum)
{
diff --git a/source/common/dmtbdump1.c b/source/common/dmtbdump1.c
index 13662611e..ae5f0f862 100644
--- a/source/common/dmtbdump1.c
+++ b/source/common/dmtbdump1.c
@@ -153,6 +153,7 @@
#include "accommon.h"
#include "acdisasm.h"
#include "actables.h"
+#include "aslcompiler.h"
/* This module used for application-level code only */
@@ -608,6 +609,192 @@ AcpiDmDumpAsf (
}
}
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiDmDumpCdat
+ *
+ * PARAMETERS: InTable - A CDAT table
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Format the contents of a CDAT. This table type consists
+ * of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpCdat (
+ ACPI_TABLE_HEADER *InTable)
+{
+ ACPI_TABLE_CDAT *Table = ACPI_CAST_PTR (ACPI_TABLE_CDAT, InTable);
+ ACPI_STATUS Status;
+ ACPI_CDAT_HEADER *Subtable;
+ ACPI_TABLE_CDAT *CdatTable = ACPI_CAST_PTR (ACPI_TABLE_CDAT, Table);
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT32 Length = CdatTable->Length;
+ UINT32 Offset = sizeof (ACPI_TABLE_CDAT);
+ UINT32 SubtableLength;
+ UINT32 SubtableType;
+ INT32 EntriesLength;
+
+
+ /* Main table */
+
+ Status = AcpiDmDumpTable (Offset, 0, CdatTable, 0,
+ AcpiDmTableInfoCdatTableHdr);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, sizeof (ACPI_TABLE_CDAT));
+ while (Offset < Table->Length)
+ {
+ /* Dump the common subtable header */
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "0) HeaderOffset: %X\n", Offset);
+ AcpiOsPrintf ("\n");
+ Status = AcpiDmDumpTable (Length, Offset, Subtable,
+ sizeof (ACPI_CDAT_HEADER), AcpiDmTableInfoCdatHeader);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ /* Point past the common subtable header, decode the subtable type */
+
+ Offset += sizeof (ACPI_CDAT_HEADER);
+ SubtableType = Subtable->Type;
+
+ switch (Subtable->Type)
+ {
+ case ACPI_CDAT_TYPE_DSMAS:
+ Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
+ SubtableLength = sizeof (ACPI_CDAT_DSMAS);
+
+ InfoTable = AcpiDmTableInfoCdat0;
+ break;
+
+ case ACPI_CDAT_TYPE_DSLBIS:
+ Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
+ SubtableLength = sizeof (ACPI_CDAT_DSLBIS);
+ DbgPrint (ASL_DEBUG_OUTPUT, "1) Offset: %X\n", Offset);
+
+ InfoTable = AcpiDmTableInfoCdat1;
+ break;
+
+ case ACPI_CDAT_TYPE_DSMSCIS:
+ Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
+ SubtableLength = sizeof (ACPI_CDAT_DSMSCIS);
+
+ InfoTable = AcpiDmTableInfoCdat2;
+ break;
+
+ case ACPI_CDAT_TYPE_DSIS:
+ DbgPrint (ASL_DEBUG_OUTPUT, "2) Offset: %X ", Offset);
+ SubtableLength = sizeof (ACPI_CDAT_DSIS);
+ DbgPrint (ASL_DEBUG_OUTPUT, "1) input pointer: %p\n", Table);
+ Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
+ DbgPrint (ASL_DEBUG_OUTPUT, "1) output pointers: %p, %p, Offset: %X\n",
+ Table, Subtable, Offset);
+ DbgPrint (ASL_DEBUG_OUTPUT, "3) Offset: %X\n", Offset);
+
+ InfoTable = AcpiDmTableInfoCdat3;
+ break;
+
+ case ACPI_CDAT_TYPE_DSEMTS:
+ Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
+ SubtableLength = sizeof (ACPI_CDAT_DSEMTS);
+
+ InfoTable = AcpiDmTableInfoCdat4;
+ break;
+
+ case ACPI_CDAT_TYPE_SSLBIS:
+ SubtableLength = Subtable->Length;
+
+ InfoTable = AcpiDmTableInfoCdat5;
+ Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
+ break;
+
+ default:
+ fprintf (stderr, "ERROR: Unknown SubtableType: %X\n", Subtable->Type);
+ return;
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "SubtableType: %X, Length: %X Actual "
+ "Length: %X Offset: %X tableptr: %p\n", SubtableType,
+ Subtable->Length, SubtableLength, Offset, Table);
+
+ /*
+ * Do the subtable-specific fields
+ */
+ Status = AcpiDmDumpTable (Length, Offset, Subtable, Offset, InfoTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "Subtable Type: %X, Offset: %X, SubtableLength: %X\n",
+ SubtableType, Offset, SubtableLength);
+
+ /* Additional sub-subtables, dependent on the main subtable type */
+
+ switch (SubtableType)
+ {
+ case ACPI_CDAT_TYPE_SSLBIS:
+ Offset += sizeof (ACPI_CDAT_SSLBIS);
+ Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table,
+ Offset);
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "Case SSLBIS, Offset: %X, SubtableLength: %X "
+ "Subtable->Length %X\n", Offset, SubtableLength, Subtable->Length);
+
+ /* Generate the total length of all the SSLBE entries */
+
+ EntriesLength = SubtableLength - sizeof (ACPI_CDAT_HEADER) -
+ sizeof (ACPI_CDAT_SSLBIS);
+ DbgPrint (ASL_DEBUG_OUTPUT, "EntriesLength: %X, Offset: %X, Table->Length: %X\n",
+ EntriesLength, Offset, Table->Length);
+
+ /* Do each of the SSLBE Entries */
+
+ while ((EntriesLength > 0) && (Offset < Table->Length))
+ {
+ AcpiOsPrintf ("\n");
+
+ Status = AcpiDmDumpTable (Length, Offset, Subtable, Offset,
+ AcpiDmTableInfoCdatEntries);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ EntriesLength -= sizeof (ACPI_CDAT_SSLBE);
+ Offset += sizeof (ACPI_CDAT_SSLBE);
+ Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
+ }
+
+ SubtableLength = 0;
+ break;
+
+ default:
+ break;
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "Offset: %X, Subtable Length: %X\n",
+ Offset, SubtableLength);
+
+ /* Point to next subtable */
+
+ Offset += SubtableLength;
+ Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
+ }
+
+ return;
+}
+
+
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpCedt
@@ -651,12 +838,14 @@ AcpiDmDumpCedt (
case ACPI_CEDT_TYPE_CHBS:
Status = AcpiDmDumpTable (Length, Offset, Subtable,
Subtable->Length, AcpiDmTableInfoCedt0);
- if (ACPI_FAILURE (Status)) {
+ if (ACPI_FAILURE (Status))
+ {
return;
}
break;
- case ACPI_CEDT_TYPE_CFMWS: {
+ case ACPI_CEDT_TYPE_CFMWS:
+ {
ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable;
unsigned int i, max = 0x01 << (ptr->InterleaveWays);
@@ -664,18 +853,22 @@ AcpiDmDumpCedt (
Status = AcpiDmDumpTable (Length, Offset, Subtable,
Subtable->Length, AcpiDmTableInfoCedt1);
- if (ACPI_FAILURE (Status)) {
+ if (ACPI_FAILURE (Status))
+ {
return;
}
/* Now, print out any interleave targets beyond the first. */
- for (i = 1; i < max; i++) {
- unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET(ACPI_CEDT_CFMWS, InterleaveTargets);
+ for (i = 1; i < max; i++)
+ {
+ unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveTargets);
unsigned int *trg = &(ptr->InterleaveTargets[i]);
+
Status = AcpiDmDumpTable (Length, loc_offset, trg,
Subtable->Length, AcpiDmTableInfoCedt1_te);
- if (ACPI_FAILURE (Status)) {
+ if (ACPI_FAILURE (Status))
+ {
return;
}
}
diff --git a/source/common/dmtbdump2.c b/source/common/dmtbdump2.c
index c50a6a247..3fb4d531e 100644
--- a/source/common/dmtbdump2.c
+++ b/source/common/dmtbdump2.c
@@ -149,6 +149,7 @@
*
*****************************************************************************/
+#include <wchar.h>
#include "acpi.h"
#include "accommon.h"
#include "acdisasm.h"
@@ -2104,9 +2105,12 @@ AcpiDmDumpPhat (
UINT32 RecordCount;
UINT32 Length = Table->Length;
UINT32 Offset = sizeof (ACPI_TABLE_PHAT);
+ UINT32 OriginalOffset;
UINT32 SubtableLength;
UINT32 PathLength;
UINT32 VendorLength;
+ UINT16 RecordType;
+ const wchar_t *WideString;
Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Table, sizeof (ACPI_TABLE_PHAT));
@@ -2116,58 +2120,93 @@ AcpiDmDumpPhat (
/* Common subtable header */
AcpiOsPrintf ("\n");
- Status = AcpiDmDumpTable (Length, 0, Subtable,
+ Status = AcpiDmDumpTable (Length, Offset, Subtable,
sizeof (ACPI_PHAT_HEADER), AcpiDmTableInfoPhatHdr);
if (ACPI_FAILURE (Status))
{
return;
}
+ DbgPrint (ASL_DEBUG_OUTPUT, "\n/* %u, Subtable->Type %X */\n",
+ __LINE__, Subtable->Type);
+
switch (Subtable->Type)
{
case ACPI_PHAT_TYPE_FW_VERSION_DATA:
InfoTable = AcpiDmTableInfoPhat0;
- SubtableLength = sizeof (ACPI_PHAT_VERSION_DATA);
+ SubtableLength = Offset += sizeof (ACPI_PHAT_VERSION_DATA);
break;
case ACPI_PHAT_TYPE_FW_HEALTH_DATA:
InfoTable = AcpiDmTableInfoPhat1;
- SubtableLength = sizeof (ACPI_PHAT_HEALTH_DATA);
+ SubtableLength = Offset += sizeof (ACPI_PHAT_TYPE_FW_HEALTH_DATA);
break;
default:
- AcpiOsPrintf ("\n**** Unknown PHAT subtable type 0x%X\n\n",
+ DbgPrint (ASL_DEBUG_OUTPUT, "\n**** Unknown PHAT subtable type 0x%X\n\n",
Subtable->Type);
return;
}
- Status = AcpiDmDumpTable (Length, 0, Subtable,
+ Status = AcpiDmDumpTable (Length, SubtableLength, Subtable,
SubtableLength, InfoTable);
if (ACPI_FAILURE (Status))
{
return;
}
+ OriginalOffset = Offset;
switch (Subtable->Type)
{
case ACPI_PHAT_TYPE_FW_VERSION_DATA:
VersionData = ACPI_CAST_PTR (ACPI_PHAT_VERSION_DATA, Subtable);
RecordCount = VersionData->ElementCount;
- while (RecordCount)
+ RecordType = *ACPI_CAST_PTR (UINT8, Subtable);
+
+ /*
+ * Skip past a zero-valued block (not part of the ACPI PHAT specification).
+ * First, check for a zero length record and a zero element count
+ */
+ if (!VersionData->Header.Length && !VersionData->ElementCount)
{
- Status = AcpiDmDumpTable (Length, Offset,
- ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_VERSION_DATA)),
+ while (RecordType == 0)
+ {
+ Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Table, Offset);
+ RecordType = *ACPI_CAST_PTR (UINT8, Subtable);
+ RecordCount = VersionData->ElementCount;
+ Offset += 1;
+ }
+
+ Offset -= 1;
+ AcpiOsPrintf ("\n/* Warning: Block of zeros found above starting at Offset %X Length %X */\n"
+ "/* (not compliant to PHAT specification -- ignoring block) */\n",
+ OriginalOffset - 12, Offset - OriginalOffset + 12);
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "/* %u, RecordCount: %X, Offset %X, SubtableLength %X */\n",
+ __LINE__, RecordCount, Offset, SubtableLength);
+
+ /* Emit each of the version elements */
+
+ while (RecordCount && VersionData->Header.Length)
+ {
+ AcpiOsPrintf ("\n/* Version Element #%Xh Offset %Xh */\n\n",
+ VersionData->ElementCount - RecordCount + 1, Offset);
+
+ Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Table, Offset);
+ Status = AcpiDmDumpTable (Length, Offset, Subtable,
sizeof (ACPI_PHAT_VERSION_ELEMENT), AcpiDmTableInfoPhat0a);
if (ACPI_FAILURE (Status))
{
return;
}
+ Offset += sizeof (ACPI_PHAT_VERSION_ELEMENT);
RecordCount--;
}
@@ -2175,24 +2214,48 @@ AcpiDmDumpPhat (
case ACPI_PHAT_TYPE_FW_HEALTH_DATA:
- /* account for the null terminator */
+ /*
+ * Get the length of the Device Path (UEFI wide string).
+ * Include the wide null terminator (+2),
+ */
+ WideString = ACPI_ADD_PTR (wchar_t, Subtable,
+ sizeof (ACPI_PHAT_HEALTH_DATA));
+
+ PathLength = (wcslen (WideString) * 2) + 2;
+ DbgPrint (ASL_DEBUG_OUTPUT, "/* %u, PathLength %X, Offset %X, Table->Length %X */\n",
+ __LINE__, PathLength, Offset, Length);
- PathLength = strlen (ACPI_ADD_PTR (char, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA))) + 1;
Status = AcpiDmDumpTable (Length, Offset,
ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA)),
PathLength, AcpiDmTableInfoPhat1a);
+ Offset += PathLength;
if (ACPI_FAILURE (Status))
{
return;
}
- /* Get vendor data - data length is the remaining subtable length */
+ /* Get Device-Specific Data - length of which is the remaining subtable length. */
VendorLength =
Subtable->Length - sizeof (ACPI_PHAT_HEALTH_DATA) - PathLength;
- Status = AcpiDmDumpTable (Length, 0,
- ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA) + PathLength),
- VendorLength, AcpiDmTableInfoPhat1b);
+ DbgPrint (ASL_DEBUG_OUTPUT, "%u, Subtable->Length %X, VendorLength %X, Offset %X PathLength: %X\n",
+ __LINE__, Subtable->Length, VendorLength, Offset, PathLength);
+
+ if (VendorLength)
+ {
+ /* Point past the Device Path, Compile the Device-Specific Data */
+
+ Status = AcpiDmDumpTable (Length, Offset,
+ ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable, sizeof (ACPI_PHAT_HEALTH_DATA) + PathLength),
+ VendorLength, AcpiDmTableInfoPhat1b);
+ if (ACPI_FAILURE (Status))
+ {
+ return;
+ }
+
+ Offset += VendorLength;
+ }
+
if (ACPI_FAILURE (Status))
{
return;
@@ -2208,9 +2271,12 @@ AcpiDmDumpPhat (
/* Next subtable */
- Offset += Subtable->Length;
- Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Subtable,
- Subtable->Length);
+ DbgPrint (ASL_DEBUG_OUTPUT, "/* %u, Bottom of main loop: Offset %X, "
+ "Subtable->Length %X, Table->Length %X */\n",
+ __LINE__, Offset, Subtable->Length, Table->Length);
+
+ Subtable = ACPI_ADD_PTR (ACPI_PHAT_HEADER, Table,
+ Offset);
}
}
diff --git a/source/common/dmtbinfo1.c b/source/common/dmtbinfo1.c
index d6a94bfc1..9afed4d6a 100644
--- a/source/common/dmtbinfo1.c
+++ b/source/common/dmtbinfo1.c
@@ -494,6 +494,116 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] =
ACPI_DMT_TERMINATOR
};
+/*******************************************************************************
+ *
+ * CDAT - Coherent Device Attribute Table
+ *
+ ******************************************************************************/
+
+ /* Table header (not ACPI-compliant) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCdatTableHdr[] =
+{
+ {ACPI_DMT_UINT32, ACPI_CDAT_OFFSET (Length), "CDAT Table Length", DT_LENGTH},
+ {ACPI_DMT_UINT8, ACPI_CDAT_OFFSET (Revision), "Revision", 0},
+ {ACPI_DMT_UINT8, ACPI_CDAT_OFFSET (Checksum), "Checksum", 0},
+ {ACPI_DMT_UINT48, ACPI_CDAT_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_CDAT_OFFSET (Sequence), "Sequence", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Common subtable header */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCdatHeader[] =
+{
+ {ACPI_DMT_CDAT, ACPI_CDATH_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT8, ACPI_CDATH_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_CDATH_OFFSET (Length), "Length", DT_LENGTH},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Subtable 0: Device Scoped Memory Affinity Structure (DSMAS) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCdat0[] =
+{
+ {ACPI_DMT_UINT8, ACPI_CDAT0_OFFSET (DsmadHandle), "DSMAD Handle", 0},
+ {ACPI_DMT_UINT8, ACPI_CDAT0_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT16, ACPI_CDAT0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_CDAT0_OFFSET (DpaBaseAddress), "DPA Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_CDAT0_OFFSET (DpaLength), "DPA Length", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Subtable 1: Device scoped Latency and Bandwidth Information Structure (DSLBIS) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCdat1[] =
+{
+ {ACPI_DMT_UINT8, ACPI_CDAT1_OFFSET (Handle), "Handle", 0},
+ {ACPI_DMT_UINT8, ACPI_CDAT1_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_CDAT1_OFFSET (DataType), "Data Type", 0},
+ {ACPI_DMT_UINT8, ACPI_CDAT1_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_CDAT1_OFFSET (EntryBaseUnit), "Entry Base Unit", 0},
+ {ACPI_DMT_UINT16, ACPI_CDAT1_OFFSET (Entry[0]), "Entry0", 0},
+ {ACPI_DMT_UINT16, ACPI_CDAT1_OFFSET (Entry[1]), "Entry1", 0},
+ {ACPI_DMT_UINT16, ACPI_CDAT1_OFFSET (Entry[2]), "Entry2", 0},
+ {ACPI_DMT_UINT16, ACPI_CDAT1_OFFSET (Reserved2), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Subtable 2: Device Scoped Memory Side Cache Information Structure (DSMSCIS) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCdat2[] =
+{
+ {ACPI_DMT_UINT8, ACPI_CDAT2_OFFSET (DsmasHandle), "DSMAS Handle", 0},
+ {ACPI_DMT_UINT24, ACPI_CDAT2_OFFSET (Reserved[3]), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_CDAT2_OFFSET (SideCacheSize), "Side Cache Size", 0},
+ {ACPI_DMT_UINT32, ACPI_CDAT2_OFFSET (CacheAttributes), "Cache Attributes", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Subtable 3: Device Scoped Initiator Structure (DSIS) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCdat3[] =
+{
+ {ACPI_DMT_UINT8, ACPI_CDAT3_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_CDAT3_OFFSET (Handle), "Handle", 0},
+ {ACPI_DMT_UINT16, ACPI_CDAT3_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Subtable 4: Device Scoped EFI Memory Type Structure (DSEMTS) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCdat4[] =
+{
+ {ACPI_DMT_UINT8, ACPI_CDAT4_OFFSET (DsmasHandle), "DSMAS Handle", 0},
+ {ACPI_DMT_UINT8, ACPI_CDAT4_OFFSET (MemoryType), "Memory Type", 0},
+ {ACPI_DMT_UINT16, ACPI_CDAT4_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_CDAT4_OFFSET (DpaOffset), "DPA Offset", 0},
+ {ACPI_DMT_UINT64, ACPI_CDAT4_OFFSET (RangeLength), "DPA Range Length", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Subtable 5: Switch Scoped Latency and Bandwidth Information Structure (SSLBIS) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCdat5[] =
+{
+ {ACPI_DMT_UINT8, ACPI_CDAT5_OFFSET (DataType), "Data Type", 0},
+ {ACPI_DMT_UINT24, ACPI_CDAT5_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_CDAT5_OFFSET (EntryBaseUnit), "Entry Base Unit", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+/* Switch Scoped Latency and Bandwidth Entry (SSLBE) (For subtable 5 above) */
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCdatEntries[] =
+{
+ {ACPI_DMT_UINT16, ACPI_CDATE_OFFSET (PortxId), "Port X Id", 0},
+ {ACPI_DMT_UINT16, ACPI_CDATE_OFFSET (PortyId), "Port Y Id", 0},
+ {ACPI_DMT_UINT16, ACPI_CDATE_OFFSET (LatencyOrBandwidth), "Latency or Bandwidth", 0},
+ {ACPI_DMT_UINT16, ACPI_CDATE_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
+};
+
/*******************************************************************************
*
diff --git a/source/common/dmtbinfo2.c b/source/common/dmtbinfo2.c
index 2c7d81785..6ea3bdb05 100644
--- a/source/common/dmtbinfo2.c
+++ b/source/common/dmtbinfo2.c
@@ -1652,11 +1652,13 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPdtt0[] =
*
******************************************************************************/
+/* Common subtable header */
+
ACPI_DMTABLE_INFO AcpiDmTableInfoPhatHdr[] =
{
- {ACPI_DMT_PHAT, ACPI_PHATH_OFFSET (Type), "Subtable Type", 0},
- {ACPI_DMT_UINT16, ACPI_PHATH_OFFSET (Length), "Length", 0},
- {ACPI_DMT_UINT8, ACPI_PHATH_OFFSET (Revision), "Revision", 0},
+ {ACPI_DMT_PHAT, ACPI_PHATH_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT16, ACPI_PHATH_OFFSET (Length), "Length", DT_LENGTH},
+ {ACPI_DMT_UINT8, ACPI_PHATH_OFFSET (Revision), "Revision", 0},
ACPI_DMT_TERMINATOR
};
@@ -1664,16 +1666,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPhatHdr[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoPhat0[] =
{
- {ACPI_DMT_UINT24, ACPI_PHAT0_OFFSET (Reserved), "Reserved", 0},
- {ACPI_DMT_UINT32, ACPI_PHAT0_OFFSET (ElementCount), "Element Count", 0},
+ {ACPI_DMT_UINT24, ACPI_PHAT0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_PHAT0_OFFSET (ElementCount), "Element Count", 0},
ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoPhat0a[] =
{
- {ACPI_DMT_UUID, ACPI_PHAT0A_OFFSET (Guid), "GUID", 0},
- {ACPI_DMT_UINT64, ACPI_PHAT0A_OFFSET (VersionValue), "Version Value", 0},
- {ACPI_DMT_UINT32, ACPI_PHAT0A_OFFSET (ProducerId), "Producer ID", 0},
+ {ACPI_DMT_UUID, ACPI_PHAT0A_OFFSET (Guid), "GUID", 0},
+ {ACPI_DMT_UINT64, ACPI_PHAT0A_OFFSET (VersionValue), "Version Value", 0},
+ {ACPI_DMT_UINT32, ACPI_PHAT0A_OFFSET (ProducerId), "Producer ID", 0},
ACPI_DMT_TERMINATOR
};
@@ -1681,22 +1683,22 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPhat0a[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoPhat1[] =
{
- {ACPI_DMT_UINT16, ACPI_PHAT1_OFFSET (Reserved), "Reserved", 0},
- {ACPI_DMT_UINT8, ACPI_PHAT1_OFFSET (Health), "Health", 0},
- {ACPI_DMT_UUID, ACPI_PHAT1_OFFSET (DeviceGuid), "Device GUID", 0},
- {ACPI_DMT_UINT32, ACPI_PHAT1_OFFSET (DeviceSpecificOffset), "Device specific offset", 0},
+ {ACPI_DMT_UINT16, ACPI_PHAT1_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_PHAT1_OFFSET (Health), "Health", 0},
+ {ACPI_DMT_UUID, ACPI_PHAT1_OFFSET (DeviceGuid), "Device GUID", 0},
+ {ACPI_DMT_UINT32, ACPI_PHAT1_OFFSET (DeviceSpecificOffset), "Device-Specific Offset", 0},
ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoPhat1a[] =
{
- {ACPI_DMT_STRING, 0, "Namepath", 0},
+ {ACPI_DMT_UNICODE, 0, "Device Path", 0},
ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoPhat1b[] =
{
- {ACPI_DMT_RAW_BUFFER, 0, "Vendor Data", 0},
+ {ACPI_DMT_RAW_BUFFER, 0, "Device-Specific Data", DT_OPTIONAL},
ACPI_DMT_TERMINATOR
};
@@ -1895,7 +1897,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoPrmtHandler[] =
{ACPI_DMT_UINT16, ACPI_PRMT1_OFFSET (Length), "Length", 0},
{ACPI_DMT_UUID, ACPI_PRMT1_OFFSET (HandlerGuid[0]), "Handler GUID", 0},
{ACPI_DMT_UINT64, ACPI_PRMT1_OFFSET (HandlerAddress), "Handler address", 0},
- {ACPI_DMT_UINT64, ACPI_PRMT1_OFFSET (StaticDataBufferAddress),"Satic Data Address", 0},
+ {ACPI_DMT_UINT64, ACPI_PRMT1_OFFSET (StaticDataBufferAddress),"Static Data Address", 0},
{ACPI_DMT_UINT64, ACPI_PRMT1_OFFSET (AcpiParamBufferAddress), "ACPI Parameter Address", 0},
ACPI_DMT_NEW_LINE,
ACPI_DMT_TERMINATOR
diff --git a/source/common/dmtbinfo3.c b/source/common/dmtbinfo3.c
index fa698d2f4..b8ddb7aad 100644
--- a/source/common/dmtbinfo3.c
+++ b/source/common/dmtbinfo3.c
@@ -192,6 +192,23 @@
/*******************************************************************************
*
+ * CCEL - CC-Event Log Table
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO AcpiDmTableInfoCcel[] =
+{
+ {ACPI_DMT_UINT8, ACPI_CCEL_OFFSET (CCType), "CC Type", 0},
+ {ACPI_DMT_UINT8, ACPI_CCEL_OFFSET (CCSubType), "CC Sub Type", 0},
+ {ACPI_DMT_UINT32, ACPI_CCEL_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_CCEL_OFFSET (LogAreaMinimumLength), "Log Area Minimum Length", 0},
+ {ACPI_DMT_UINT64, ACPI_CCEL_OFFSET (LogAreaStartAddress), "Log Area Start Address", 0},
+ ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
* SLIC - Software Licensing Description Table. This table contains the standard
* ACPI header followed by proprietary data structures
*
diff --git a/source/compiler/aslcodegen.c b/source/compiler/aslcodegen.c
index 6ae3a0aa2..a0c67424d 100644
--- a/source/compiler/aslcodegen.c
+++ b/source/compiler/aslcodegen.c
@@ -153,6 +153,7 @@
#include "aslcompiler.y.h"
#include "amlcode.h"
#include "acconvert.h"
+#include "actbinfo.h"
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslcodegen")
@@ -181,6 +182,10 @@ static void
CgUpdateHeader (
ACPI_PARSE_OBJECT *Op);
+static void
+CgUpdateCdatHeader (
+ ACPI_PARSE_OBJECT *Op);
+
/*******************************************************************************
*
@@ -207,7 +212,14 @@ CgGenerateAmlOutput (
CgAmlWriteWalk, NULL, NULL);
DbgPrint (ASL_TREE_OUTPUT, ASL_PARSE_TREE_HEADER2);
- CgUpdateHeader (AslGbl_CurrentDB);
+ if (AcpiGbl_CDAT)
+ {
+ CgUpdateCdatHeader (AslGbl_CurrentDB);
+ }
+ else
+ {
+ CgUpdateHeader (AslGbl_CurrentDB);
+ }
}
@@ -658,6 +670,67 @@ CgWriteTableHeader (
/*******************************************************************************
*
+ * FUNCTION: CgUpdateCdatHeader
+ *
+ * PARAMETERS: Op - Op for the Definition Block
+ *
+ * RETURN: None.
+ *
+ * DESCRIPTION: Complete the ACPI table by calculating the checksum and
+ * re-writing the header for the input definition block
+ *
+ ******************************************************************************/
+
+static void
+CgUpdateCdatHeader (
+ ACPI_PARSE_OBJECT *Op)
+{
+ signed char Sum;
+ UINT32 i;
+ UINT32 Length;
+ UINT8 FileByte;
+ UINT8 Checksum;
+
+
+ /* Calculate the checksum over the entire definition block */
+
+ Sum = 0;
+ Length = sizeof (ACPI_TABLE_CDAT) + Op->Asl.AmlSubtreeLength;
+ FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset);
+
+ for (i = 0; i < Length; i++)
+ {
+ if (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1) != AE_OK)
+ {
+ AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL,
+ "Table length is greater than size of the input file");
+ return;
+ }
+
+ Sum = (signed char) (Sum + FileByte);
+ }
+
+ Checksum = (UINT8) (0 - Sum);
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "Computed checksum = %X\n", Checksum);
+
+ /* Re-write the checksum byte */
+
+ FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset +
+ ACPI_CDAT_OFFSET (Checksum));
+
+ FlWriteFile (ASL_FILE_AML_OUTPUT, &Checksum, 1);
+
+ /*
+ * Seek to the end of the file. This is done to support multiple file
+ * compilation. Doing this simplifies other parts of the codebase because
+ * it eliminates the need to seek for a different starting place.
+ */
+ FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset + Length);
+}
+
+/*******************************************************************************
+ *
* FUNCTION: CgUpdateHeader
*
* PARAMETERS: Op - Op for the Definition Block
diff --git a/source/compiler/aslcompile.c b/source/compiler/aslcompile.c
index c17e219c1..f97cd9d82 100644
--- a/source/compiler/aslcompile.c
+++ b/source/compiler/aslcompile.c
@@ -241,7 +241,7 @@ CmDoCompile (
if (AslGbl_SyntaxError)
{
- fprintf (stderr,
+ AslError (ASL_ERROR, ASL_MSG_SYNTAX, NULL,
"Compiler aborting due to parser-detected syntax error(s)\n");
/* Flag this error in the FileNode for compilation summary */
@@ -250,6 +250,8 @@ CmDoCompile (
FileNode->ParserErrorDetected = TRUE;
AslGbl_ParserErrorDetected = TRUE;
LsDumpParseTree ();
+ AePrintErrorLog(ASL_FILE_STDERR);
+
goto ErrorExit;
}
@@ -267,6 +269,8 @@ CmDoCompile (
goto ErrorExit;
}
+ AePrintErrorLog(ASL_FILE_STDERR);
+
/* Flush out any remaining source after parse tree is complete */
Event = UtBeginEvent ("Flush source input");
@@ -283,10 +287,13 @@ CmDoCompile (
LsDumpParseTree ();
+ AslGbl_ParserErrorDetected = FALSE;
+ AslGbl_SyntaxError = FALSE;
UtEndEvent (Event);
UtEndEvent (FullCompile);
- return (AE_OK);
+ AslGbl_ParserErrorDetected = FALSE;
+ AslGbl_SyntaxError = FALSE;
ErrorExit:
UtEndEvent (FullCompile);
return (AE_ERROR);
@@ -919,7 +926,6 @@ CmCleanupAndExit (
ASL_MAX_ERROR_COUNT);
}
- AslGbl_ExceptionCount[ASL_ERROR] = 0;
UtDisplaySummary (ASL_FILE_STDOUT);
/*
diff --git a/source/compiler/aslerror.c b/source/compiler/aslerror.c
index a0ebe7b34..3a61bc6e5 100644
--- a/source/compiler/aslerror.c
+++ b/source/compiler/aslerror.c
@@ -1033,7 +1033,6 @@ AslLogNewError (
exit(1);
}
- AslGbl_ExceptionCount[ASL_ERROR] = 0;
return;
}
diff --git a/source/compiler/aslhelp.c b/source/compiler/aslhelp.c
index d83d41e3d..1cdbf8a76 100644
--- a/source/compiler/aslhelp.c
+++ b/source/compiler/aslhelp.c
@@ -262,6 +262,7 @@ Usage (
ACPI_OPTION ("", " (Obtain DSDT from current system if no input file)");
ACPI_OPTION ("-df", "Force disassembler to assume table contains valid AML");
ACPI_OPTION ("-dl", "Emit legacy ASL code only (no C-style operators)");
+ ACPI_OPTION ("-ds <signature(4)>", "Specify a table signature(4) (CDAT table only)");
ACPI_OPTION ("-e <f1 f2 ...>", "Include ACPI table(s) for external symbol resolution");
ACPI_OPTION ("-fe <file>", "Specify external symbol declaration file");
ACPI_OPTION ("-in", "Ignore NoOp opcodes");
diff --git a/source/compiler/asloptions.c b/source/compiler/asloptions.c
index 2808650e3..37484f79b 100644
--- a/source/compiler/asloptions.c
+++ b/source/compiler/asloptions.c
@@ -152,6 +152,7 @@
#include "aslcompiler.h"
#include "acapps.h"
#include "acdisasm.h"
+#include "acglobal.h"
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("asloption")
@@ -176,7 +177,7 @@ AslDoResponseFile (
#define ASL_TOKEN_SEPARATORS " \t\n"
-#define ASL_SUPPORTED_OPTIONS "@:a:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^q^r:s|t|T+G^v^w|x:z"
+#define ASL_SUPPORTED_OPTIONS "@:a:b|c|d^D:e:f^gh^i|I:l^m:no|p:P^q^r:s|:t|T+G^v^w|x:z"
/*******************************************************************************
@@ -270,7 +271,7 @@ AslDoOptions (
BOOLEAN IsResponseFile)
{
ACPI_STATUS Status;
- UINT32 j;
+ INT32 j;
/* Get the command line options */
@@ -366,7 +367,6 @@ AslDoOptions (
{
return (-1);
}
-
AslGbl_PruneType = (UINT8) strtoul (AcpiGbl_Optarg, NULL, 0);
break;
@@ -445,6 +445,28 @@ AslDoOptions (
AcpiGbl_CstyleDisassembly = FALSE;
break;
+ case 's': /* Specify table signature (Only supported for CDAT table) */
+
+ /* Get the required argument */
+
+ if (AcpiGetoptArgument (argc, argv))
+ {
+ return (-1);
+ }
+
+ /* Check for exact string "CDAT" (upper or lower case) */
+
+ AcpiGbl_CDAT = ACPI_CAST_PTR (char, &AcpiGbl_Optarg);
+ if (AcpiUtStricmp (AcpiGbl_Optarg, ACPI_SIG_CDAT))
+ {
+ printf ("\nUnknown table signature: %s\n", AcpiGbl_Optarg);
+ return (-1);
+ }
+
+ AcpiGbl_CDAT = malloc (5);
+ AcpiUtSafeStrncpy ((char *) AcpiGbl_CDAT, ACPI_SIG_CDAT, 5);
+ break;
+
default:
printf ("Unknown option: -d%s\n", AcpiGbl_Optarg);
@@ -837,7 +859,7 @@ AslDoOptions (
AslGbl_HexOutputFlag = HEX_OUTPUT_C;
break;
- case 'p': /* data table flex/bison prototype */
+ case 'p': /* data table flex/bison prototype */
AslGbl_DtLexBisonPrototype = TRUE;
break;
diff --git a/source/compiler/aslpredef.c b/source/compiler/aslpredef.c
index c52295ee8..2804e12da 100644
--- a/source/compiler/aslpredef.c
+++ b/source/compiler/aslpredef.c
@@ -563,7 +563,7 @@ ApCheckForPredefinedName (
if (Name[0] == 0)
{
AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
- "zero length name found");
+ "Zero length name found");
}
/* All reserved names are prefixed with a single underscore */
diff --git a/source/compiler/aslstartup.c b/source/compiler/aslstartup.c
index 45462adf9..9542a79d3 100644
--- a/source/compiler/aslstartup.c
+++ b/source/compiler/aslstartup.c
@@ -317,7 +317,7 @@ AslDetectSourceFileType (
else
{
fprintf (stderr,
- "Binary file does not contain a valid ACPI table\n");
+ "Binary file does not contain a valid standard ACPI table\n");
}
Type = ASL_INPUT_TYPE_BINARY;
diff --git a/source/compiler/dtcompile.c b/source/compiler/dtcompile.c
index 89eb937d5..11fcb8b9a 100644
--- a/source/compiler/dtcompile.c
+++ b/source/compiler/dtcompile.c
@@ -452,6 +452,48 @@ DtCompileDataTable (
}
/*
+ * If the first field is named "CDAT Table Length" (not "Signature"),
+ * assume that we have a CDAT table (whose table header does not have
+ * a signature). Instead, the TableLength field is where the
+ * signature would (normally) be.
+ */
+ else if (!strcmp ((*FieldList)->Name, "CDAT Table Length"))
+ {
+ /* No longer true: (However, use this technique in the disassembler)
+ * We are assuming that there
+ * should be at least one non-ASCII byte in the 4-character
+ * Signature field, (At least the high-order byte should be zero).
+ */
+ Status = DtCompileTable (FieldList, AcpiDmTableInfoCdatTableHdr,
+ &AslGbl_RootTable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Compile the CDAT */
+
+ DtPushSubtable (AslGbl_RootTable);
+ Status = DtCompileCdat ((void **) FieldList);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /*
+ * Set the overall table length and the table checksum.
+ * The entire compiled table (including the CDAT table header with
+ * the table length and checksum) is in AslGbl_RootTable->Buffer.
+ */
+ DtSetTableLength ();
+ DtSetTableChecksum (&ACPI_CAST_PTR (ACPI_TABLE_CDAT, AslGbl_RootTable->Buffer)->Checksum);
+
+ DtDumpFieldList (RootField);
+ DtDumpSubtableList ();
+ return (AE_OK);
+ }
+
+ /*
* All other tables must use the common ACPI table header. Insert the
* current iASL IDs (name, version), and compile the header now.
*/
diff --git a/source/compiler/dtcompiler.h b/source/compiler/dtcompiler.h
index 3b3683cc6..e85ca5397 100644
--- a/source/compiler/dtcompiler.h
+++ b/source/compiler/dtcompiler.h
@@ -578,7 +578,7 @@ DtCompileAsf (
void **PFieldList);
ACPI_STATUS
-DtCompileCpep (
+DtCompileCdat (
void **PFieldList);
ACPI_STATUS
@@ -586,6 +586,10 @@ DtCompileCedt (
void **PFieldList);
ACPI_STATUS
+DtCompileCpep (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileCsrt (
void **PFieldList);
@@ -773,6 +777,8 @@ extern const unsigned char TemplateBoot[];
extern const unsigned char TemplateBdat[];
extern const unsigned char TemplateBert[];
extern const unsigned char TemplateBgrt[];
+extern const unsigned char TemplateCcel[];
+extern const unsigned char TemplateCdat[];
extern const unsigned char TemplateCedt[];
extern const unsigned char TemplateCpep[];
extern const unsigned char TemplateCsrt[];
diff --git a/source/compiler/dtio.c b/source/compiler/dtio.c
index 1a00424c6..9ec18cd1e 100644
--- a/source/compiler/dtio.c
+++ b/source/compiler/dtio.c
@@ -952,7 +952,7 @@ DtDumpBuffer (
UINT8 BufChar;
- FlPrintFile (FileId, "Output: [%3.3Xh %4.4d %3d] ",
+ FlPrintFile (FileId, "Output: [%3.3Xh %4.4d %3.3Xh] ",
Offset, Offset, Length);
i = 0;
diff --git a/source/compiler/dttable1.c b/source/compiler/dttable1.c
index aa200a3ef..dc25e9b9f 100644
--- a/source/compiler/dttable1.c
+++ b/source/compiler/dttable1.c
@@ -657,6 +657,133 @@ DtCompileAsf (
/******************************************************************************
*
+ * FUNCTION: DtCompileCdat
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile CDAT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileCdat (
+ void **List)
+{
+ ACPI_STATUS Status = AE_OK;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ ACPI_CDAT_HEADER *CdatHeader;
+ ACPI_DMTABLE_INFO *InfoTable = NULL;
+ DT_FIELD *SubtableStart;
+
+
+ /* Walk the parse tree.
+ *
+ * Note: Main table consists of only the CDAT table header
+ * (This is not the standard ACPI table header, however)--
+ * Followed by some number of subtables.
+ */
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+
+ /* Compile the expected CDAT Subtable header */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCdatHeader,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ CdatHeader = ACPI_CAST_PTR (ACPI_CDAT_HEADER, Subtable->Buffer);
+
+ /* Decode the subtable by type */
+
+ switch (CdatHeader->Type)
+ {
+ case ACPI_CDAT_TYPE_DSMAS:
+ InfoTable = AcpiDmTableInfoCdat0;
+ break;
+
+ case ACPI_CDAT_TYPE_DSLBIS:
+ InfoTable = AcpiDmTableInfoCdat1;
+ break;
+
+ case ACPI_CDAT_TYPE_DSMSCIS:
+ InfoTable = AcpiDmTableInfoCdat2;
+ break;
+
+ case ACPI_CDAT_TYPE_DSIS:
+ InfoTable = AcpiDmTableInfoCdat3;
+ break;
+
+ case ACPI_CDAT_TYPE_DSEMTS:
+ InfoTable = AcpiDmTableInfoCdat4;
+ break;
+
+ case ACPI_CDAT_TYPE_SSLBIS:
+ InfoTable = AcpiDmTableInfoCdat5;
+ break;
+
+ default:
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "CDAT");
+ }
+
+ /* Compile the CDAT subtable */
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ switch (CdatHeader->Type)
+ {
+ /* Multiple entries supported for this type */
+
+ case ACPI_CDAT_TYPE_SSLBIS:
+
+ /*
+ * Check for multiple SSLBEs
+ */
+ while (*PFieldList && !AcpiUtStricmp ((*PFieldList)->Name, "Port X ID"))
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoCdatEntries, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ /* Pop off the CDAT Subtable header subtree */
+
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompileCedt
*
* PARAMETERS: List - Current field list pointer
diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c
index 1798a963e..59d578f91 100644
--- a/source/compiler/dttable2.c
+++ b/source/compiler/dttable2.c
@@ -825,6 +825,7 @@ DtCompileNhlt (
ACPI_NHLT_FORMATS_CONFIG *FormatsConfig;
ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_D *ConfigSpecific;
ACPI_NHLT_DEVICE_INFO_COUNT *DeviceInfo;
+ ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B *Terminator;
/* Main table */
@@ -1088,7 +1089,7 @@ DtCompileNhlt (
* some non documeneted structure(s) yet to be processed. First, get
* the count of such structure(s).
*/
- if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length")))
+ if (*PFieldList && !(strcmp ((const char *) (*PFieldList)->Name, "Device Info struct count")))
{
/* Get the count of non documented structures */
@@ -1124,9 +1125,8 @@ DtCompileNhlt (
DtInsertSubtable (ParentTable, Subtable);
} /* for (j = 0; j < LinuxSpecificCount; j++) */
-
/* Undocumented data at the end of endpoint */
- if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length")))
+ if (*PFieldList && !(strcmp ((const char *) (*PFieldList)->Name, "Bytes")))
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt7b,
&Subtable);
@@ -1148,7 +1148,7 @@ DtCompileNhlt (
* All Endpoint Descriptors are completed.
* Do the table terminator specific config (not in NHLT spec, optional)
*/
- if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length")))
+ if (*PFieldList && !(strcmp ((const char *) (*PFieldList)->Name, "Capabilities Size")))
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt5b,
&Subtable);
@@ -1160,15 +1160,20 @@ DtCompileNhlt (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt3a,
- &Subtable);
- if (ACPI_FAILURE (Status))
+ Terminator = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B, Subtable->Buffer);
+
+ if (Terminator->CapabilitiesSize)
{
- return (Status);
- }
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt3a,
+ &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ }
}
return (AE_OK);
@@ -1369,19 +1374,30 @@ DtCompilePhat (
ACPI_PHAT_HEADER *PhatHeader;
ACPI_DMTABLE_INFO *Info;
ACPI_PHAT_VERSION_DATA *VersionData;
+ UINT32 DeviceDataLength;
UINT32 RecordCount;
+ DT_FIELD *DataOffsetField;
+ DT_FIELD *DevicePathField;
+ UINT32 TableOffset = 0;
+ UINT32 DataOffsetValue;
+ UINT32 i;
- /* The table consist of subtables */
+ /* The table consists of subtables */
while (*PFieldList)
{
+ /* Compile the common subtable header */
+
Status = DtCompileTable (PFieldList, AcpiDmTableInfoPhatHdr, &Subtable);
if (ACPI_FAILURE (Status))
{
return (Status);
}
+ TableOffset += Subtable->Length;
+ DbgPrint (ASL_DEBUG_OUTPUT, "0 Subtable->Length: %X\n", Subtable->Length);
+
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
@@ -1392,12 +1408,66 @@ DtCompilePhat (
{
case ACPI_PHAT_TYPE_FW_VERSION_DATA:
+ /* Compile the middle portion of the Firmware Version Data */
+
Info = AcpiDmTableInfoPhat0;
PhatHeader->Length = sizeof (ACPI_PHAT_VERSION_DATA);
+ DataOffsetField = NULL;
break;
case ACPI_PHAT_TYPE_FW_HEALTH_DATA:
+ DbgPrint (ASL_DEBUG_OUTPUT, "1 Offset: %X, Name: \"%s\" Length: %X\n",
+ (*PFieldList)->TableOffset, (*PFieldList)->Name, Subtable->Length);
+
+ DataOffsetField = *PFieldList;
+
+ /* Walk the field list to get to the "Device-specific data Offset" field */
+
+ TableOffset = sizeof (ACPI_PHAT_HEALTH_DATA);
+ for (i = 0; i < 3; i++)
+ {
+ DataOffsetField = DataOffsetField->Next;
+ DbgPrint (ASL_DEBUG_OUTPUT, "2 Offset: %X, Name: \"%s\" Length: %X Value: %s:\n",
+ TableOffset, DataOffsetField->Name, DataOffsetField->StringLength, DataOffsetField->Value);
+ }
+
+ /* Convert DataOffsetField->Value (a char * string) to an integer value */
+
+ sscanf (DataOffsetField->Value, "%X", &DataOffsetValue);
+
+ /*
+ * Get the next field (Device Path):
+ * DataOffsetField points to "Device-Specific Offset", next field is
+ * "Device Path".
+ */
+ DevicePathField = DataOffsetField->Next;
+
+ /* Compute the size of the input ASCII string as a unicode string (*2 + 2) */
+
+ DevicePathField->StringLength = (strlen ((const char *) DevicePathField->Value) * 2) + 2;
+ TableOffset += DevicePathField->StringLength;
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "3 Offset: %X, Length: %X devicepathLength: %X\n",
+ TableOffset, Subtable->Length, DevicePathField->StringLength);
+
+ /* Set the DataOffsetField to the current TableOffset */
+ /* Must set the DataOffsetField here (not later) */
+
+ if (DataOffsetValue != 0)
+ {
+ snprintf (DataOffsetField->Value, Subtable->Length, "%X", TableOffset);
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "4 Offset: %X, Length: %X\n", TableOffset, Subtable->Length);
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "5 TableOffset: %X, DataOffsetField->StringLength: "
+ "%X DevicePathField Length: %X DevicePathField->Value: %s, DataOffsetField->Value: %s DataOffsetField->ByteOffset %X\n",
+ TableOffset, DataOffsetField->StringLength, DevicePathField->StringLength,
+ DevicePathField->Value, DataOffsetField->Value, DataOffsetField->ByteOffset);
+
+ /* Compile the middle portion of the Health Data Record */
+
Info = AcpiDmTableInfoPhat1;
PhatHeader->Length = sizeof (ACPI_PHAT_HEALTH_DATA);
break;
@@ -1406,16 +1476,19 @@ DtCompilePhat (
DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, *PFieldList, "PHAT");
return (AE_ERROR);
-
- break;
}
+ /* Compile either the Version Data or the Health Data */
+
Status = DtCompileTable (PFieldList, Info, &Subtable);
if (ACPI_FAILURE (Status))
{
return (Status);
}
+ DbgPrint (ASL_DEBUG_OUTPUT, "6 Offset: %X, Name: \"%s\" SubtableLength: %X\n",
+ TableOffset /* - StartTableOffset*/, (*PFieldList)->Name, Subtable->Length);
+
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
@@ -1427,6 +1500,8 @@ DtCompilePhat (
(Subtable->Buffer - sizeof (ACPI_PHAT_HEADER)));
RecordCount = VersionData->ElementCount;
+ /* Compile all of the Version Elements */
+
while (RecordCount)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoPhat0a,
@@ -1435,17 +1510,29 @@ DtCompilePhat (
{
return (Status);
}
+
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
+ TableOffset += Subtable->Length;
RecordCount--;
PhatHeader->Length += sizeof (ACPI_PHAT_VERSION_ELEMENT);
}
+
+ DtPopSubtable ();
break;
case ACPI_PHAT_TYPE_FW_HEALTH_DATA:
- /* Compile device path */
+ /* Compile the Device Path */
+
+ DeviceDataLength = Subtable->Length;
+ TableOffset += Subtable->Length;
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "7 Device Path Length: %X FieldName: \"%s\" FieldLength: "
+ "%s FieldValue: %s SubtableLength: %X TableOffset: %X\n", DeviceDataLength,
+ (*PFieldList)->Name, DataOffsetField->Value, (*PFieldList)->Value,
+ Subtable->Length, TableOffset);
Status = DtCompileTable (PFieldList, AcpiDmTableInfoPhat1a, &Subtable);
if (ACPI_FAILURE (Status))
@@ -1455,20 +1542,58 @@ DtCompilePhat (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
+ /* *PFieldList will be null if previous field was at the end-of-ParseTree (EOF) */
+
+ if (!*PFieldList)
+ {
+ DbgPrint (ASL_DEBUG_OUTPUT, "8 Exit on end-of-ParseTree\n");
+ return (AE_OK);
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "9 Device Data Length: %X FieldName: \"%s"
+ " TableOffset: %X FieldLength: %X Field Value: %s SubtableLength: %X\n",
+ DeviceDataLength, (*PFieldList)->Name, TableOffset,
+ (*PFieldList)->StringLength, (*PFieldList)->Value, Subtable->Length);
+
PhatHeader->Length += (UINT16) Subtable->Length;
- /* Compile vendor specific data */
+ /* Convert DataOffsetField->Value (a hex char * string) to an integer value */
- Status = DtCompileTable (PFieldList, AcpiDmTableInfoPhat1b, &Subtable);
- if (ACPI_FAILURE (Status))
+ sscanf (DataOffsetField->Value, "%X", &DataOffsetValue);
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "10 Device-Specific Offset: %X Table Offset: %X\n",
+ DataOffsetValue, TableOffset);
+ if (DataOffsetValue != 0)
{
- return (Status);
+ /* Compile Device-Specific Data - only if the Data Offset is non-zero */
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoPhat1b, &Subtable);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DbgPrint (ASL_DEBUG_OUTPUT, "11 Subtable: %p Table Offset: %X\n",
+ Subtable, TableOffset);
+ if (Subtable)
+ {
+ DbgPrint (ASL_DEBUG_OUTPUT, "12 Device Specific Offset: "
+ "%X FieldName \"%s\" SubtableLength %X\n",
+ DeviceDataLength, DataOffsetField->Name, Subtable->Length);
+
+ DeviceDataLength += Subtable->Length;
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ PhatHeader->Length += (UINT16) Subtable->Length;
+ }
}
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
- PhatHeader->Length += (UINT16) Subtable->Length;
+ DtPopSubtable ();
+ DbgPrint (ASL_DEBUG_OUTPUT, "13 FieldName: \"%s\" FieldLength: %X Field Value: %s\n",
+ DataOffsetField->Name, DataOffsetField->StringLength, DataOffsetField->Value);
break;
default:
diff --git a/source/compiler/dttemplate.h b/source/compiler/dttemplate.h
index ad5af7074..3ab99978a 100644
--- a/source/compiler/dttemplate.h
+++ b/source/compiler/dttemplate.h
@@ -341,6 +341,17 @@ const unsigned char TemplateBoot[] =
0x28,0x05,0x10,0x20,0x00,0x00,0x00,0x00 /* 00000020 "(.. ...." */
};
+const unsigned char TemplateCcel[] =
+{
+ 0x43,0x43,0x45,0x4C,0x38,0x00,0x00,0x00, /* 00000000 "CCEL8..." */
+ 0x04,0x1C,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
+ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x30,0x09,0x21,0x20,0x00,0x00,0x00,0x00, /* 00000020 "0.! ...." */
+ 0xEF,0xCD,0xAB,0x78,0x56,0x34,0x12,0x00, /* 00000028 "...xV4.." */
+ 0x78,0x56,0x34,0x12,0xEF,0xCD,0xAB,0x00 /* 00000030 "xV4....." */
+};
+
const unsigned char TemplateCedt[] =
{
0x43,0x45,0x44,0x54,0x9c,0x01,0x00,0x00, /* 00000000 "CEDT...." */
@@ -397,6 +408,39 @@ const unsigned char TemplateCedt[] =
0x03,0x5e,0xba,0x00 /* 00000198 ".^.." */
};
+const unsigned char TemplateCdat[] =
+{
+ 0xE4,0x00,0x00,0x00,0x01,0x0C,0x00,0x00, /* 00000000 "........" */
+ 0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00, /* 00000008 "........" */
+ 0x03,0x00,0x08,0x00,0x04,0x56,0x00,0x00, /* 00000010 ".....V.." */
+ 0x00,0x00,0x18,0x00,0xEF,0x01,0x00,0x00, /* 00000018 "........" */
+ 0x89,0x67,0x45,0x23,0x01,0x00,0x00,0x00, /* 00000020 ".gE#...." */
+ 0xAB,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */
+ 0x03,0x00,0x08,0x00,0x04,0x56,0x00,0x00, /* 00000030 ".....V.." */
+ 0x01,0x00,0x18,0x00,0x44,0x04,0x64,0x00, /* 00000038 "....D.d." */
+ 0xCD,0xAB,0x89,0x67,0x45,0x23,0x01,0x00, /* 00000040 "...gE#.." */
+ 0x33,0x22,0x44,0x33,0x55,0x44,0x00,0x00, /* 00000048 "3"D3UD.." */
+ 0x02,0x00,0x14,0x00,0x99,0x00,0x00,0x00, /* 00000050 "........" */
+ 0x00,0x00,0x00,0x00,0x78,0x56,0x34,0x12, /* 00000058 "....xV4." */
+ 0x55,0x55,0x44,0x44,0x04,0x00,0x18,0x00, /* 00000060 "UUDD...." */
+ 0x88,0x32,0x00,0x00,0x77,0x77,0x77,0x77, /* 00000068 ".2..wwww" */
+ 0x11,0x11,0x11,0x11,0x88,0x88,0x88,0x88, /* 00000070 "........" */
+ 0x22,0x22,0x22,0x22,0x05,0x00,0x20,0x00, /* 00000078 """"".. ." */
+ 0x04,0x00,0x00,0x00,0x44,0x44,0x44,0x44, /* 00000080 "....DDDD" */
+ 0x33,0x33,0x33,0x33,0x44,0x44,0x55,0x55, /* 00000088 "3333DDUU" */
+ 0x66,0x66,0x00,0x00,0x77,0x77,0x88,0x88, /* 00000090 "ff..ww.." */
+ 0x99,0x99,0x00,0x00,0x05,0x00,0x18,0x00, /* 00000098 "........" */
+ 0x04,0x00,0x00,0x00,0x22,0x22,0x22,0x22, /* 000000A0 "....""""" */
+ 0x11,0x11,0x11,0x11,0x34,0x12,0x56,0x78, /* 000000A8 "....4.Vx" */
+ 0x11,0x11,0x00,0x00,0x05,0x00,0x30,0x00, /* 000000B0 "......0." */
+ 0x08,0x00,0x00,0x00,0x66,0x66,0x66,0x66, /* 000000B8 "....ffff" */
+ 0x55,0x55,0x55,0x55,0x44,0x44,0x55,0x55, /* 000000C0 "UUUUDDUU" */
+ 0x66,0x66,0x00,0x00,0x77,0x77,0x88,0x88, /* 000000C8 "ff..ww.." */
+ 0x99,0x99,0x00,0x00,0xAA,0xAA,0xBB,0xBB, /* 000000D0 "........" */
+ 0xCC,0xCC,0x00,0x00,0x55,0x55,0x44,0x44, /* 000000D8 "....UUDD" */
+ 0x33,0x33,0x00,0x00 /* 000000E0 "33.." */
+};
+
const unsigned char TemplateCpep[] =
{
0x43,0x50,0x45,0x50,0x34,0x00,0x00,0x00, /* 00000000 "CPEP4..." */
@@ -1430,20 +1474,27 @@ const unsigned char TemplatePdtt[] =
const unsigned char TemplatePhat [] =
{
- 0x50,0x48,0x41,0x54,0x6F,0x00,0x00,0x00, /* 00000000 "PHATo..." */
- 0x01,0xC7,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x50,0x48,0x41,0x54,0xA2,0x00,0x00,0x00, /* 00000000 "PHAT...." */
+ 0x01,0xCA,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */
0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
- 0x05,0x01,0x21,0x20,0x00,0x00,0x28,0x00, /* 00000020 "..! ..(." */
+ 0x31,0x03,0x22,0x20,0x00,0x00,0x28,0x00, /* 00000020 "1." ..(." */
0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000028 "........" */
0x30,0x05,0xAF,0x91,0x86,0x5D,0x0E,0x47, /* 00000030 "0....].G" */
0xA6,0xB0,0x0A,0x2D,0xB9,0x40,0x82,0x49, /* 00000038 "...-.@.I" */
0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01, /* 00000040 "........" */
- 0x0C,0x0B,0x0A,0x09,0x01,0x00,0x23,0x00, /* 00000048 "......#." */
+ 0x0C,0x0B,0x0A,0x09,0x01,0x00,0x2E,0x00, /* 00000048 "........" */
0x00,0x00,0x00,0x00,0x30,0x05,0xAF,0x91, /* 00000050 "....0..." */
0x86,0x5D,0x0E,0x47,0xA6,0xB0,0x0A,0x2D, /* 00000058 ".].G...-" */
- 0xB9,0x40,0x82,0x49,0x00,0x00,0x00,0x00, /* 00000060 ".@.I...." */
- 0x61,0x73,0x64,0x66,0x00,0xFF,0x11 /* 00000068 "asdf..." */
+ 0xB9,0x40,0x82,0x49,0x2A,0x00,0x00,0x00, /* 00000060 ".@.I*..." */
+ 0x41,0x00,0x42,0x00,0x43,0x00,0x44,0x00, /* 00000068 "A.B.C.D." */
+ 0x45,0x00,0x46,0x00,0x00,0x00,0x01,0x02, /* 00000070 "E.F....." */
+ 0x03,0x04,0x00,0x00,0x28,0x00,0x00,0x00, /* 00000078 "....(..." */
+ 0x00,0x00,0x01,0x00,0x00,0x00,0x30,0x05, /* 00000080 "......0." */
+ 0xAF,0x91,0x86,0x5D,0x0E,0x47,0xA6,0xB0, /* 00000088 "...].G.." */
+ 0x0A,0x2D,0xB9,0x40,0x82,0x49,0x08,0x07, /* 00000090 ".-.@.I.." */
+ 0x06,0x05,0x04,0x03,0x02,0x01,0x0C,0x0B, /* 00000098 "........" */
+ 0x0A,0x09 /* 000000A0 ".." */
};
const unsigned char TemplatePmtt[] =
diff --git a/source/compiler/dtutils.c b/source/compiler/dtutils.c
index e950763e7..45bff3df5 100644
--- a/source/compiler/dtutils.c
+++ b/source/compiler/dtutils.c
@@ -601,6 +601,7 @@ DtGetFieldLength (
case ACPI_DMT_AEST_XFACE:
case ACPI_DMT_AEST_XRUPT:
case ACPI_DMT_ASF:
+ case ACPI_DMT_CDAT:
case ACPI_DMT_HESTNTYP:
case ACPI_DMT_FADTPM:
case ACPI_DMT_EINJACT:
@@ -800,7 +801,7 @@ DtSum (
UINT8 *Sum = ReturnValue;
- Checksum = AcpiTbChecksum (Subtable->Buffer, Subtable->Length);
+ Checksum = AcpiUtChecksum (Subtable->Buffer, Subtable->Length);
*Sum = (UINT8) (*Sum + Checksum);
}
diff --git a/source/components/events/evregion.c b/source/components/events/evregion.c
index 6cf77791f..fb0cc4361 100644
--- a/source/components/events/evregion.c
+++ b/source/components/events/evregion.c
@@ -329,6 +329,14 @@ AcpiEvAddressSpaceDispatch (
Ctx->SubspaceId = (UINT8) RegionObj->Region.Address;
}
+ if (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE)
+ {
+ ACPI_FFH_INFO *Ctx = HandlerDesc->AddressSpace.Context;
+
+ Ctx->Length = RegionObj->Region.Length;
+ Ctx->Offset = RegionObj->Region.Address;
+ }
+
/*
* We must exit the interpreter because the region setup will
* potentially execute control methods (for example, the _REG method
diff --git a/source/components/executer/exfield.c b/source/components/executer/exfield.c
index 2834e7b38..4175b8eed 100644
--- a/source/components/executer/exfield.c
+++ b/source/components/executer/exfield.c
@@ -296,7 +296,8 @@ AcpiExReadDataFromField (
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI ||
- ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT))
+ ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT ||
+ ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE))
{
/* SMBus, GSBus, IPMI serial */
@@ -469,7 +470,8 @@ AcpiExWriteDataToField (
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI ||
- ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT))
+ ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_PLATFORM_RT ||
+ ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE))
{
/* SMBus, GSBus, IPMI serial */
diff --git a/source/components/executer/exserial.c b/source/components/executer/exserial.c
index 4dfd65992..c92a895ad 100644
--- a/source/components/executer/exserial.c
+++ b/source/components/executer/exserial.c
@@ -484,6 +484,12 @@ AcpiExWriteSerialBus (
Function = ACPI_WRITE;
break;
+ case ACPI_ADR_SPACE_FIXED_HARDWARE:
+
+ BufferLength = ACPI_FFH_INPUT_BUFFER_SIZE;
+ Function = ACPI_WRITE;
+ break;
+
default:
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
}
diff --git a/source/components/executer/exsystem.c b/source/components/executer/exsystem.c
index 62768bcf0..44d3a00ba 100644
--- a/source/components/executer/exsystem.c
+++ b/source/components/executer/exsystem.c
@@ -339,18 +339,6 @@ AcpiExSystemDoSleep (
AcpiExExitInterpreter ();
/*
- * Warn users about excessive sleep times, so ASL code can be improved to
- * use polling or similar techniques.
- */
- if (HowLongMs > 10)
- {
- ACPI_WARNING ((AE_INFO,
- "Firmware issue: Excessive sleep time (0x%8.8X%8.8X ms > 10 ms)"
- " in ACPI Control Method",
- ACPI_FORMAT_UINT64 (HowLongMs)));
- }
-
- /*
* For compatibility with other ACPI implementations and to prevent
* accidental deep sleeps, limit the sleep time to something reasonable.
*/
diff --git a/source/components/tables/tbdata.c b/source/components/tables/tbdata.c
index 5e4f7ca74..d974d951b 100644
--- a/source/components/tables/tbdata.c
+++ b/source/components/tables/tbdata.c
@@ -724,7 +724,7 @@ AcpiTbVerifyTempTable (
{
/* Verify the checksum */
- Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
+ Status = AcpiUtVerifyChecksum (TableDesc->Pointer, TableDesc->Length);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c
index 7ae35f190..97876614b 100644
--- a/source/components/tables/tbfadt.c
+++ b/source/components/tables/tbfadt.c
@@ -472,7 +472,7 @@ AcpiTbParseFadt (
* Validate the FADT checksum before we copy the table. Ignore
* checksum error as we want to try to get the DSDT and FACS.
*/
- (void) AcpiTbVerifyChecksum (Table, Length);
+ (void) AcpiUtVerifyChecksum (Table, Length);
/* Create a local copy of the FADT in common ACPI 2.0+ format */
diff --git a/source/components/tables/tbprint.c b/source/components/tables/tbprint.c
index 0b53e7373..cdad69af4 100644
--- a/source/components/tables/tbprint.c
+++ b/source/components/tables/tbprint.c
@@ -152,6 +152,8 @@
#include "acpi.h"
#include "accommon.h"
#include "actables.h"
+#include "acdisasm.h"
+#include "acutils.h"
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME ("tbprint")
@@ -192,7 +194,7 @@ AcpiTbFixString (
while (Length && *String)
{
- if (!isprint ((int) *String))
+ if (!isprint ((int) (UINT8) *String))
{
*String = '?';
}
@@ -293,89 +295,3 @@ AcpiTbPrintTableHeader (
}
}
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbValidateChecksum
- *
- * PARAMETERS: Table - ACPI table to verify
- * Length - Length of entire table
- *
- * RETURN: Status
- *
- * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns
- * exception on bad checksum.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiTbVerifyChecksum (
- ACPI_TABLE_HEADER *Table,
- UINT32 Length)
-{
- UINT8 Checksum;
-
-
- /*
- * FACS/S3PT:
- * They are the odd tables, have no standard ACPI header and no checksum
- */
-
- if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT) ||
- ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS))
- {
- return (AE_OK);
- }
-
- /* Compute the checksum on the table */
-
- Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Length);
-
- /* Checksum ok? (should be zero) */
-
- if (Checksum)
- {
- ACPI_BIOS_WARNING ((AE_INFO,
- "Incorrect checksum in table [%4.4s] - 0x%2.2X, "
- "should be 0x%2.2X",
- Table->Signature, Table->Checksum,
- (UINT8) (Table->Checksum - Checksum)));
-
-#if (ACPI_CHECKSUM_ABORT)
- return (AE_BAD_CHECKSUM);
-#endif
- }
-
- return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiTbChecksum
- *
- * PARAMETERS: Buffer - Pointer to memory region to be checked
- * Length - Length of this memory region
- *
- * RETURN: Checksum (UINT8)
- *
- * DESCRIPTION: Calculates circular checksum of memory region.
- *
- ******************************************************************************/
-
-UINT8
-AcpiTbChecksum (
- UINT8 *Buffer,
- UINT32 Length)
-{
- UINT8 Sum = 0;
- UINT8 *End = Buffer + Length;
-
-
- while (Buffer < End)
- {
- Sum = (UINT8) (Sum + *(Buffer++));
- }
-
- return (Sum);
-}
diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c
index d2a30dc38..5188d26da 100644
--- a/source/components/tables/tbutils.c
+++ b/source/components/tables/tbutils.c
@@ -471,7 +471,7 @@ AcpiTbParseRootTable (
/* Validate the root table checksum */
- Status = AcpiTbVerifyChecksum (Table, Length);
+ Status = AcpiUtVerifyChecksum (Table, Length);
if (ACPI_FAILURE (Status))
{
AcpiOsUnmapMemory (Table, Length);
diff --git a/source/components/tables/tbxfroot.c b/source/components/tables/tbxfroot.c
index bb90f6059..97cb65c79 100644
--- a/source/components/tables/tbxfroot.c
+++ b/source/components/tables/tbxfroot.c
@@ -227,7 +227,7 @@ AcpiTbValidateRsdp (
/* Check the standard checksum */
- if (AcpiTbChecksum ((UINT8 *) Rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0)
+ if (AcpiUtChecksum ((UINT8 *) Rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0)
{
return (AE_BAD_CHECKSUM);
}
@@ -235,7 +235,7 @@ AcpiTbValidateRsdp (
/* Check extended checksum if table version >= 2 */
if ((Rsdp->Revision >= 2) &&
- (AcpiTbChecksum ((UINT8 *) Rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0))
+ (AcpiUtChecksum ((UINT8 *) Rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0))
{
return (AE_BAD_CHECKSUM);
}
@@ -271,6 +271,7 @@ AcpiFindRootPointer (
UINT8 *TablePtr;
UINT8 *MemRover;
UINT32 PhysicalAddress;
+ UINT32 EbdaWindowSize;
ACPI_FUNCTION_TRACE (AcpiFindRootPointer);
@@ -299,27 +300,40 @@ AcpiFindRootPointer (
/* EBDA present? */
- if (PhysicalAddress > 0x400)
+ /*
+ * Check that the EBDA pointer from memory is sane and does not point
+ * above valid low memory
+ */
+ if (PhysicalAddress > 0x400 &&
+ PhysicalAddress < 0xA0000)
{
/*
- * 1b) Search EBDA paragraphs (EBDA is required to be a
- * minimum of 1K length)
+ * Calculate the scan window size
+ * The EBDA is not guaranteed to be larger than a KiB and in case
+ * that it is smaller, the scanning function would leave the low
+ * memory and continue to the VGA range.
+ */
+ EbdaWindowSize = ACPI_MIN(ACPI_EBDA_WINDOW_SIZE,
+ 0xA0000 - PhysicalAddress);
+
+ /*
+ * 1b) Search EBDA paragraphs
*/
TablePtr = AcpiOsMapMemory (
(ACPI_PHYSICAL_ADDRESS) PhysicalAddress,
- ACPI_EBDA_WINDOW_SIZE);
+ EbdaWindowSize);
if (!TablePtr)
{
ACPI_ERROR ((AE_INFO,
"Could not map memory at 0x%8.8X for length %u",
- PhysicalAddress, ACPI_EBDA_WINDOW_SIZE));
+ PhysicalAddress, EbdaWindowSize));
return_ACPI_STATUS (AE_NO_MEMORY);
}
MemRover = AcpiTbScanMemoryForRsdp (
- TablePtr, ACPI_EBDA_WINDOW_SIZE);
- AcpiOsUnmapMemory (TablePtr, ACPI_EBDA_WINDOW_SIZE);
+ TablePtr, EbdaWindowSize);
+ AcpiOsUnmapMemory (TablePtr, EbdaWindowSize);
if (MemRover)
{
diff --git a/source/components/utilities/utcksum.c b/source/components/utilities/utcksum.c
new file mode 100644
index 000000000..b8ea869ba
--- /dev/null
+++ b/source/components/utilities/utcksum.c
@@ -0,0 +1,335 @@
+/******************************************************************************
+ *
+ * Module Name: utcksum - Support generating table checksums
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2022, Intel Corp.
+ * All rights reserved.
+ *
+ * 2. License
+ *
+ * 2.1. This is your license from Intel Corp. under its intellectual property
+ * rights. You may have additional license terms from the party that provided
+ * you this software, covering your right to use that party's intellectual
+ * property rights.
+ *
+ * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
+ * copy of the source code appearing in this file ("Covered Code") an
+ * irrevocable, perpetual, worldwide license under Intel's copyrights in the
+ * base code distributed originally by Intel ("Original Intel Code") to copy,
+ * make derivatives, distribute, use and display any portion of the Covered
+ * Code in any form, with the right to sublicense such rights; and
+ *
+ * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
+ * license (with the right to sublicense), under only those claims of Intel
+ * patents that are infringed by the Original Intel Code, to make, use, sell,
+ * offer to sell, and import the Covered Code and derivative works thereof
+ * solely to the minimum extent necessary to exercise the above copyright
+ * license, and in no event shall the patent license extend to any additions
+ * to or modifications of the Original Intel Code. No other license or right
+ * is granted directly or by implication, estoppel or otherwise;
+ *
+ * The above copyright and patent license is granted only if the following
+ * conditions are met:
+ *
+ * 3. Conditions
+ *
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification with rights to further distribute source must include
+ * the above Copyright Notice, the above License, this list of Conditions,
+ * and the following Disclaimer and Export Compliance provision. In addition,
+ * Licensee must cause all Covered Code to which Licensee contributes to
+ * contain a file documenting the changes Licensee made to create that Covered
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
+ * must include a prominent statement that the modification is derived,
+ * directly or indirectly, from Original Intel Code.
+ *
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * Redistribution of source code of any substantial portion of the Covered
+ * Code or modification without rights to further distribute source must
+ * include the following Disclaimer and Export Compliance provision in the
+ * documentation and/or other materials provided with distribution. In
+ * addition, Licensee may not authorize further sublicense of source of any
+ * portion of the Covered Code, and must include terms to the effect that the
+ * license from Licensee to its licensee is limited to the intellectual
+ * property embodied in the software Licensee provides to its licensee, and
+ * not to intellectual property embodied in modifications its licensee may
+ * make.
+ *
+ * 3.3. Redistribution of Executable. Redistribution in executable form of any
+ * substantial portion of the Covered Code or modification must reproduce the
+ * above Copyright Notice, and the following Disclaimer and Export Compliance
+ * provision in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3.4. Intel retains all right, title, and interest in and to the Original
+ * Intel Code.
+ *
+ * 3.5. Neither the name Intel nor any other trademark owned or controlled by
+ * Intel shall be used in advertising or otherwise to promote the sale, use or
+ * other dealings in products derived from or relating to the Covered Code
+ * without prior written authorization from Intel.
+ *
+ * 4. Disclaimer and Export Compliance
+ *
+ * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
+ * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
+ * PARTICULAR PURPOSE.
+ *
+ * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
+ * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
+ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
+ * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
+ * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
+ * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
+ * LIMITED REMEDY.
+ *
+ * 4.3. Licensee shall not export, either directly or indirectly, any of this
+ * software or system incorporating such software without first obtaining any
+ * required license or other approval from the U. S. Department of Commerce or
+ * any other agency or department of the United States Government. In the
+ * event Licensee exports any such software from the United States or
+ * re-exports any such software from a foreign destination, Licensee shall
+ * ensure that the distribution and export/re-export of the software is in
+ * compliance with all laws, regulations, orders, or other restrictions of the
+ * U.S. Export Administration Regulations. Licensee agrees that neither it nor
+ * any of its subsidiaries will export/re-export any technical data, process,
+ * software, or service, directly or indirectly, to any country for which the
+ * United States government or any agency thereof requires an export license,
+ * other governmental approval, or letter of assurance, without first obtaining
+ * such license, approval or letter.
+ *
+ *****************************************************************************
+ *
+ * Alternatively, you may choose to be licensed under the terms of the
+ * following license:
+ *
+ * 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.
+ *
+ * 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 MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * 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 DAMAGE.
+ *
+ * Alternatively, you may choose to be licensed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ *****************************************************************************/
+
+#include "acpi.h"
+#include "accommon.h"
+#include "acdisasm.h"
+#include "acutils.h"
+
+
+/* This module used for application-level code only */
+
+#define _COMPONENT ACPI_CA_DISASSEMBLER
+ ACPI_MODULE_NAME ("utcksum")
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtVerifyChecksum
+ *
+ * PARAMETERS: Table - ACPI table to verify
+ * Length - Length of entire table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns
+ * exception on bad checksum.
+ * Note: We don't have to check for a CDAT here, since CDAT is
+ * not in the RSDT/XSDT, and the CDAT table is never installed
+ * via ACPICA.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtVerifyChecksum (
+ ACPI_TABLE_HEADER *Table,
+ UINT32 Length)
+{
+ UINT8 Checksum;
+
+
+ /*
+ * FACS/S3PT:
+ * They are the odd tables, have no standard ACPI header and no checksum
+ */
+ if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT) ||
+ ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_FACS))
+ {
+ return (AE_OK);
+ }
+
+ /* Compute the checksum on the table */
+
+ Length = Table->Length;
+ Checksum = AcpiUtGenerateChecksum (ACPI_CAST_PTR (UINT8, Table), Length, Table->Checksum);
+
+ /* Computed checksum matches table? */
+
+ if (Checksum != Table->Checksum)
+ {
+ ACPI_BIOS_WARNING ((AE_INFO,
+ "Incorrect checksum in table [%4.4s] - 0x%2.2X, "
+ "should be 0x%2.2X",
+ Table->Signature, Table->Checksum,
+ Table->Checksum - Checksum));
+
+#if (ACPI_CHECKSUM_ABORT)
+ return (AE_BAD_CHECKSUM);
+#endif
+ }
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtVerifyCdatChecksum
+ *
+ * PARAMETERS: Table - CDAT ACPI table to verify
+ * Length - Length of entire table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Verifies that the CDAT table checksums to zero. Optionally
+ * returns an exception on bad checksum.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtVerifyCdatChecksum (
+ ACPI_TABLE_CDAT *CdatTable,
+ UINT32 Length)
+{
+ UINT8 Checksum;
+
+
+ /* Compute the checksum on the table */
+
+ Checksum = AcpiUtGenerateChecksum (ACPI_CAST_PTR (UINT8, CdatTable),
+ CdatTable->Length, CdatTable->Checksum);
+
+ /* Computed checksum matches table? */
+
+ if (Checksum != CdatTable->Checksum)
+ {
+ ACPI_BIOS_WARNING ((AE_INFO,
+ "Incorrect checksum in table [%4.4s] - 0x%2.2X, "
+ "should be 0x%2.2X",
+ AcpiGbl_CDAT, CdatTable->Checksum, Checksum));
+
+#if (ACPI_CHECKSUM_ABORT)
+ return (AE_BAD_CHECKSUM);
+#endif
+ }
+
+ CdatTable->Checksum = Checksum;
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtGenerateChecksum
+ *
+ * PARAMETERS: Table - Pointer to table to be checksummed
+ * Length - Length of the table
+ * OriginalChecksum - Value of the checksum field
+ *
+ * RETURN: 8 bit checksum of buffer
+ *
+ * DESCRIPTION: Computes an 8 bit checksum of the table.
+ *
+ ******************************************************************************/
+
+UINT8
+AcpiUtGenerateChecksum (
+ void *Table,
+ UINT32 Length,
+ UINT8 OriginalChecksum)
+{
+ UINT8 Checksum;
+
+
+ /* Sum the entire table as-is */
+
+ Checksum = AcpiUtChecksum ((UINT8 *) Table, Length);
+
+ /* Subtract off the existing checksum value in the table */
+
+ Checksum = (UINT8) (Checksum - OriginalChecksum);
+
+ /* Compute and return the final checksum */
+
+ Checksum = (UINT8) (0 - Checksum);
+ return (Checksum);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiUtChecksum
+ *
+ * PARAMETERS: Buffer - Pointer to memory region to be checked
+ * Length - Length of this memory region
+ *
+ * RETURN: Checksum (UINT8)
+ *
+ * DESCRIPTION: Calculates circular checksum of memory region.
+ *
+ ******************************************************************************/
+
+UINT8
+AcpiUtChecksum (
+ UINT8 *Buffer,
+ UINT32 Length)
+{
+ UINT8 Sum = 0;
+ UINT8 *End = Buffer + Length;
+
+
+ while (Buffer < End)
+ {
+ Sum = (UINT8) (Sum + *(Buffer++));
+ }
+
+ return (Sum);
+}
diff --git a/source/components/utilities/utstring.c b/source/components/utilities/utstring.c
index 5af4c4d36..770f30787 100644
--- a/source/components/utilities/utstring.c
+++ b/source/components/utilities/utstring.c
@@ -308,7 +308,7 @@ AcpiUtRepairName (
return;
}
- ACPI_COPY_NAMESEG (&OriginalName, Name);
+ ACPI_COPY_NAMESEG (&OriginalName, &Name[0]);
/* Check each character in the name */
@@ -321,10 +321,10 @@ AcpiUtRepairName (
/*
* Replace a bad character with something printable, yet technically
- * still invalid. This prevents any collisions with existing "good"
+ * "odd". This prevents any collisions with existing "good"
* names in the namespace.
*/
- Name[i] = '*';
+ Name[i] = '_';
FoundBadChar = TRUE;
}
@@ -335,8 +335,8 @@ AcpiUtRepairName (
if (!AcpiGbl_EnableInterpreterSlack)
{
ACPI_WARNING ((AE_INFO,
- "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]",
- OriginalName, Name));
+ "Invalid character(s) in name (0x%.8X) %p, repaired: [%4.4s]",
+ OriginalName, Name, &Name[0]));
}
else
{
diff --git a/source/include/acconfig.h b/source/include/acconfig.h
index 8ba7dc284..04f7f4f0c 100644
--- a/source/include/acconfig.h
+++ b/source/include/acconfig.h
@@ -335,6 +335,8 @@
#define ACPI_PRM_INPUT_BUFFER_SIZE 26
+#define ACPI_FFH_INPUT_BUFFER_SIZE 256
+
/* _SxD and _SxW control methods */
#define ACPI_NUM_SxD_METHODS 4
diff --git a/source/include/acdisasm.h b/source/include/acdisasm.h
index 352417cbb..47ce0b15b 100644
--- a/source/include/acdisasm.h
+++ b/source/include/acdisasm.h
@@ -260,6 +260,7 @@ typedef enum
ACPI_DMT_AEST_XRUPT,
ACPI_DMT_AGDI,
ACPI_DMT_ASF,
+ ACPI_DMT_CDAT,
ACPI_DMT_CEDT,
ACPI_DMT_DMAR,
ACPI_DMT_DMAR_SCOPE,
@@ -402,6 +403,16 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoBdat[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCcel[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdatTableHdr[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdatHeader[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat0[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat1[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat2[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat3[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat4[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdat5[];
+extern ACPI_DMTABLE_INFO AcpiDmTableInfoCdatEntries[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedtHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCedt1[];
@@ -748,6 +759,14 @@ AcpiDmDumpAsf (
ACPI_TABLE_HEADER *Table);
void
+AcpiDmDumpCcel (
+ ACPI_TABLE_HEADER *Table);
+
+void
+AcpiDmDumpCdat (
+ ACPI_TABLE_HEADER *Table);
+
+void
AcpiDmDumpCedt (
ACPI_TABLE_HEADER *Table);
diff --git a/source/include/acglobal.h b/source/include/acglobal.h
index b8831b467..1850d94be 100644
--- a/source/include/acglobal.h
+++ b/source/include/acglobal.h
@@ -167,6 +167,7 @@ ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList);
ACPI_GLOBAL (ACPI_TABLE_HEADER *, AcpiGbl_DSDT);
ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader);
+ACPI_INIT_GLOBAL (char *, AcpiGbl_CDAT, NULL);
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_DsdtIndex, ACPI_INVALID_TABLE_INDEX);
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FacsIndex, ACPI_INVALID_TABLE_INDEX);
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_XFacsIndex, ACPI_INVALID_TABLE_INDEX);
diff --git a/source/include/actables.h b/source/include/actables.h
index 40b79a47c..e9b070f91 100644
--- a/source/include/actables.h
+++ b/source/include/actables.h
@@ -345,16 +345,6 @@ AcpiTbPrintTableHeader(
ACPI_PHYSICAL_ADDRESS Address,
ACPI_TABLE_HEADER *Header);
-UINT8
-AcpiTbChecksum (
- UINT8 *Buffer,
- UINT32 Length);
-
-ACPI_STATUS
-AcpiTbVerifyChecksum (
- ACPI_TABLE_HEADER *Table,
- UINT32 Length);
-
void
AcpiTbCheckDsdtHeader (
void);
diff --git a/source/include/actbinfo.h b/source/include/actbinfo.h
index 633f7349b..7ce3c21e5 100644
--- a/source/include/actbinfo.h
+++ b/source/include/actbinfo.h
@@ -161,6 +161,7 @@
#define ACPI_BERT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BERT,f)
#define ACPI_BGRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BGRT,f)
#define ACPI_BOOT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BOOT,f)
+#define ACPI_CCEL_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CCEL,f)
#define ACPI_CPEP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CPEP,f)
#define ACPI_DBG2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBG2,f)
#define ACPI_DBGP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBGP,f)
@@ -233,6 +234,15 @@
#define ACPI_ASF2a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f)
#define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f)
#define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
+#define ACPI_CDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CDAT,f)
+#define ACPI_CDATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_HEADER,f)
+#define ACPI_CDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_DSMAS,f)
+#define ACPI_CDAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_DSLBIS,f)
+#define ACPI_CDAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_DSMSCIS,f)
+#define ACPI_CDAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_DSIS,f)
+#define ACPI_CDAT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_DSEMTS,f)
+#define ACPI_CDAT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_SSLBIS,f)
+#define ACPI_CDATE_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CDAT_SSLBE,f)
#define ACPI_CEDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_HEADER, f)
#define ACPI_CEDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CHBS, f)
#define ACPI_CEDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CEDT_CFMWS, f)
diff --git a/source/include/actbl1.h b/source/include/actbl1.h
index 3de78b0d8..340b636b5 100644
--- a/source/include/actbl1.h
+++ b/source/include/actbl1.h
@@ -189,6 +189,7 @@
#define ACPI_SIG_HMAT "HMAT" /* Heterogeneous Memory Attributes Table */
#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
#define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */
+#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table*/
#define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
#define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
@@ -494,12 +495,154 @@ typedef struct acpi_table_boot
} ACPI_TABLE_BOOT;
+
+/*******************************************************************************
+ *
+ * CDAT - Coherent Device Attribute Table
+ * Version 1
+ *
+ * Conforms to the "Coherent Device Attribute Table (CDAT) Specification
+ " (Revision 1.01, October 2020.)
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_cdat
+{
+ UINT32 Length; /* Length of table in bytes, including this header */
+ UINT8 Revision; /* ACPI Specification minor version number */
+ UINT8 Checksum; /* To make sum of entire table == 0 */
+ UINT8 Reserved[6];
+ UINT32 Sequence; /* Used to detect runtime CDAT table changes */
+
+} ACPI_TABLE_CDAT;
+
+
+/* CDAT common subtable header */
+
+typedef struct acpi_cdat_header
+{
+ UINT8 Type;
+ UINT8 Reserved;
+ UINT16 Length;
+
+} ACPI_CDAT_HEADER;
+
+/* Values for Type field above */
+
+enum AcpiCdatType
+{
+ ACPI_CDAT_TYPE_DSMAS = 0,
+ ACPI_CDAT_TYPE_DSLBIS = 1,
+ ACPI_CDAT_TYPE_DSMSCIS = 2,
+ ACPI_CDAT_TYPE_DSIS = 3,
+ ACPI_CDAT_TYPE_DSEMTS = 4,
+ ACPI_CDAT_TYPE_SSLBIS = 5,
+ ACPI_CDAT_TYPE_RESERVED = 6 /* 6 through 0xFF are reserved */
+};
+
+
+/* Subtable 0: Device Scoped Memory Affinity Structure (DSMAS) */
+
+typedef struct acpi_cadt_dsmas
+{
+ UINT8 DsmadHandle;
+ UINT8 Flags;
+ UINT16 Reserved;
+ UINT64 DpaBaseAddress;
+ UINT64 DpaLength;
+
+} ACPI_CDAT_DSMAS;
+
+/* Flags for subtable above */
+
+#define ACPI_CEDT_DSMAS_NON_VOLATILE (1 << 2)
+
+
+/* Subtable 1: Device scoped Latency and Bandwidth Information Structure (DSLBIS) */
+
+typedef struct acpi_cdat_dslbis
+{
+ UINT8 Handle;
+ UINT8 Flags; /* If Handle matches a DSMAS handle, the definition of this field matches
+ * Flags field in HMAT System Locality Latency */
+ UINT8 DataType;
+ UINT8 Reserved;
+ UINT64 EntryBaseUnit;
+ UINT16 Entry[3];
+ UINT16 Reserved2;
+
+} ACPI_CDAT_DSLBIS;
+
+
+/* Subtable 2: Device Scoped Memory Side Cache Information Structure (DSMSCIS) */
+
+typedef struct acpi_cdat_dsmscis
+{
+ UINT8 DsmasHandle;
+ UINT8 Reserved[3];
+ UINT64 SideCacheSize;
+ UINT32 CacheAttributes;
+
+} ACPI_CDAT_DSMSCIS;
+
+
+/* Subtable 3: Device Scoped Initiator Structure (DSIS) */
+
+typedef struct acpi_cdat_dsis
+{
+ UINT8 Flags;
+ UINT8 Handle;
+ UINT16 Reserved;
+
+} ACPI_CDAT_DSIS;
+
+/* Flags for above subtable */
+
+#define ACPI_CDAT_DSIS_MEM_ATTACHED (1 << 0)
+
+
+/* Subtable 4: Device Scoped EFI Memory Type Structure (DSEMTS) */
+
+typedef struct acpi_cdat_dsemts
+{
+ UINT8 DsmasHandle;
+ UINT8 MemoryType;
+ UINT16 Reserved;
+ UINT64 DpaOffset;
+ UINT64 RangeLength;
+
+} ACPI_CDAT_DSEMTS;
+
+
+/* Subtable 5: Switch Scoped Latency and Bandwidth Information Structure (SSLBIS) */
+
+typedef struct acpi_cdat_sslbis
+{
+ UINT8 DataType;
+ UINT8 Reserved[3];
+ UINT64 EntryBaseUnit;
+
+} ACPI_CDAT_SSLBIS;
+
+
+/* Sub-subtable for above, SslbeEntries field */
+
+typedef struct acpi_cdat_sslbe
+{
+ UINT16 PortxId;
+ UINT16 PortyId;
+ UINT16 LatencyOrBandwidth;
+ UINT16 Reserved;
+
+} ACPI_CDAT_SSLBE;
+
+
/*******************************************************************************
*
* CEDT - CXL Early Discovery Table
* Version 1
*
- * Conforms to the "CXL Early Discovery Table" (CXL 2.0)
+ * Conforms to the "CXL Early Discovery Table" (CXL 2.0, October 2020)
*
******************************************************************************/
@@ -525,7 +668,9 @@ enum AcpiCedtType
{
ACPI_CEDT_TYPE_CHBS = 0,
ACPI_CEDT_TYPE_CFMWS = 1,
- ACPI_CEDT_TYPE_RESERVED = 2,
+ ACPI_CEDT_TYPE_CXIMS = 2,
+ ACPI_CEDT_TYPE_RDPAS = 3,
+ ACPI_CEDT_TYPE_RESERVED = 4,
};
/* Values for version field above */
@@ -583,6 +728,7 @@ typedef struct acpi_cedt_cfmws_target_element
/* Values for Interleave Arithmetic field above */
#define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO (0)
+#define ACPI_CEDT_CFMWS_ARITHMETIC_XOR (1)
/* Values for Restrictions field above */
@@ -592,6 +738,35 @@ typedef struct acpi_cedt_cfmws_target_element
#define ACPI_CEDT_CFMWS_RESTRICT_PMEM (1<<3)
#define ACPI_CEDT_CFMWS_RESTRICT_FIXED (1<<4)
+/* 2: CXL XOR Interleave Math Structure */
+
+struct acpi_cedt_cxims {
+ ACPI_CEDT_HEADER Header;
+ UINT16 Reserved1;
+ UINT8 Hbig;
+ UINT8 NrXormaps;
+ UINT64 XormapList[];
+};
+
+/* 3: CXL RCEC Downstream Port Association Structure */
+
+struct acpi_cedt_rdpas {
+ ACPI_CEDT_HEADER Header;
+ UINT8 Reserved1;
+ UINT16 Length;
+ UINT16 Segment;
+ UINT16 Bdf;
+ UINT8 Protocol;
+ UINT64 Address;
+};
+
+/* Masks for bdf field above */
+#define ACPI_CEDT_RDPAS_BUS_MASK 0xff00
+#define ACPI_CEDT_RDPAS_DEVICE_MASK 0x00f8
+#define ACPI_CEDT_RDPAS_FUNCTION_MASK 0x0007
+
+#define ACPI_CEDT_RDPAS_PROTOCOL_IO (0)
+#define ACPI_CEDT_RDPAS_PROTOCOL_CACHEMEM (1)
/*******************************************************************************
*
diff --git a/source/include/actbl2.h b/source/include/actbl2.h
index 1460d3d01..74d292581 100644
--- a/source/include/actbl2.h
+++ b/source/include/actbl2.h
@@ -171,6 +171,8 @@
#define ACPI_SIG_AGDI "AGDI" /* Arm Generic Diagnostic Dump and Reset Device Interface */
#define ACPI_SIG_APMT "APMT" /* Arm Performance Monitoring Unit table */
#define ACPI_SIG_BDAT "BDAT" /* BIOS Data ACPI Table */
+#define ACPI_SIG_CCEL "CCEL" /* CC Event Log Table */
+#define ACPI_SIG_CDAT "CDAT" /* Coherent Device Attribute Table */
#define ACPI_SIG_IORT "IORT" /* IO Remapping Table */
#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
#define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
@@ -178,7 +180,6 @@
#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
#define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
-#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
#define ACPI_SIG_NHLT "NHLT" /* Non HD Audio Link Table */
@@ -521,6 +522,24 @@ typedef struct acpi_table_bdat
} ACPI_TABLE_BDAT;
+/*******************************************************************************
+ *
+ * CCEL - CC-Event Log
+ * From: "Guest-Host-Communication Interface (GHCI) for Intel
+ * Trust Domain Extensions (Intel TDX)". Feb 2022
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_ccel
+{
+ ACPI_TABLE_HEADER Header; /* Common ACPI table header */
+ UINT8 CCType;
+ UINT8 CCSubType;
+ UINT16 Reserved;
+ UINT64 LogAreaMinimumLength;
+ UINT64 LogAreaStartAddress;
+
+} ACPI_TABLE_CCEL;
/*******************************************************************************
*
diff --git a/source/include/actypes.h b/source/include/actypes.h
index fff6c1659..92da002ab 100644
--- a/source/include/actypes.h
+++ b/source/include/actypes.h
@@ -1336,6 +1336,12 @@ typedef struct acpi_pcc_info {
UINT8 *InternalBuffer;
} ACPI_PCC_INFO;
+/* Special Context data for FFH Opregion (ACPI 6.5) */
+
+typedef struct acpi_ffh_info {
+ UINT64 Offset;
+ UINT64 Length;
+} ACPI_FFH_INFO;
typedef
ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) (
diff --git a/source/include/acutils.h b/source/include/acutils.h
index f23ee559b..a0e7953b1 100644
--- a/source/include/acutils.h
+++ b/source/include/acutils.h
@@ -318,6 +318,31 @@ AcpiUtCheckAndRepairAscii (
/*
+ * utcksum - Checksum utilities
+ */
+UINT8
+AcpiUtGenerateChecksum (
+ void *Table,
+ UINT32 Length,
+ UINT8 OriginalChecksum);
+
+UINT8
+AcpiUtChecksum (
+ UINT8 *Buffer,
+ UINT32 Length);
+
+ACPI_STATUS
+AcpiUtVerifyCdatChecksum (
+ ACPI_TABLE_CDAT *CdatTable,
+ UINT32 Length);
+
+ACPI_STATUS
+AcpiUtVerifyChecksum (
+ ACPI_TABLE_HEADER *Table,
+ UINT32 Length);
+
+
+/*
* utnonansi - Non-ANSI C library functions
*/
void
diff --git a/source/include/acuuid.h b/source/include/acuuid.h
index bc41fa40b..2ab07bb39 100644
--- a/source/include/acuuid.h
+++ b/source/include/acuuid.h
@@ -211,5 +211,6 @@
#define UUID_HIERARCHICAL_DATA_EXTENSION "dbb8e3e6-5886-4ba6-8795-1319f52a966b"
#define UUID_CORESIGHT_GRAPH "3ecbc8b6-1d0e-4fb3-8107-e627f805c6cd"
#define UUID_USB4_CAPABILITIES "23a0d13a-26ab-486c-9c5f-0ffa525a575a"
-
+#define UUID_1ST_FUNCTION_ID "893f00a6-660c-494e-bcfd-3043f4fb67c0"
+#define UUID_2ND_FUNCTION_ID "107ededd-d381-4fd7-8da9-08e9a6c79644"
#endif /* __ACUUID_H__ */
diff --git a/source/tools/acpidump/apdump.c b/source/tools/acpidump/apdump.c
index d66832d1a..0cf8d00ab 100644
--- a/source/tools/acpidump/apdump.c
+++ b/source/tools/acpidump/apdump.c
@@ -234,7 +234,9 @@ ApIsValidChecksum (
}
else
{
- Status = AcpiTbVerifyChecksum (Table, Table->Length);
+ /* We don't have to check for a CDAT here, since CDAT is not in the RSDT/XSDT */
+
+ Status = AcpiUtVerifyChecksum (Table, Table->Length);
}
if (ACPI_FAILURE (Status))
diff --git a/source/tools/acpiexec/aetables.c b/source/tools/acpiexec/aetables.c
index 97f4fb73a..c758084ce 100644
--- a/source/tools/acpiexec/aetables.c
+++ b/source/tools/acpiexec/aetables.c
@@ -267,7 +267,7 @@ AeInitializeTableHeader (
/* Set the checksum, must set to zero first */
Header->Checksum = 0;
- Header->Checksum = (UINT8) -AcpiTbChecksum (
+ Header->Checksum = (UINT8) -AcpiUtChecksum (
(void *) Header, Header->Length);
}
@@ -420,7 +420,7 @@ AeBuildLocalTables (
AeInitializeTableHeader ((void *) LocalXSDT, ACPI_SIG_XSDT, XsdtSize);
LocalRSDP.Checksum = 0;
- LocalRSDP.Checksum = (UINT8) -AcpiTbChecksum (
+ LocalRSDP.Checksum = (UINT8) -AcpiUtChecksum (
(void *) &LocalRSDP, ACPI_RSDP_CHECKSUM_LENGTH);
if (!DsdtAddress)
@@ -471,7 +471,7 @@ AeBuildLocalTables (
/* Complete the external FADT with the checksum */
ExternalFadt->Header.Checksum = 0;
- ExternalFadt->Header.Checksum = (UINT8) -AcpiTbChecksum (
+ ExternalFadt->Header.Checksum = (UINT8) -AcpiUtChecksum (
(void *) ExternalFadt, ExternalFadt->Header.Length);
}
else if (AcpiGbl_UseHwReducedFadt)
@@ -551,7 +551,7 @@ AeBuildLocalTables (
LocalTEST.Length = sizeof (ACPI_TABLE_HEADER);
LocalTEST.Checksum = 0;
- LocalTEST.Checksum = (UINT8) -AcpiTbChecksum (
+ LocalTEST.Checksum = (UINT8) -AcpiUtChecksum (
(void *) &LocalTEST, LocalTEST.Length);
/*
@@ -565,7 +565,7 @@ AeBuildLocalTables (
LocalBADTABLE.Length = sizeof (ACPI_TABLE_HEADER);
LocalBADTABLE.Checksum = 0;
- LocalBADTABLE.Checksum = (UINT8) -AcpiTbChecksum (
+ LocalBADTABLE.Checksum = (UINT8) -AcpiUtChecksum (
(void *) &LocalBADTABLE, LocalBADTABLE.Length);
}
diff --git a/source/tools/acpihelp/ahmain.c b/source/tools/acpihelp/ahmain.c
index 808a8edaf..6570cbc66 100644
--- a/source/tools/acpihelp/ahmain.c
+++ b/source/tools/acpihelp/ahmain.c
@@ -160,7 +160,7 @@ AhDisplayUsage (
void);
#define AH_UTILITY_NAME "ACPI Help Utility"
-#define AH_SUPPORTED_OPTIONS "adeghikmopstuvx^"
+#define AH_SUPPORTED_OPTIONS "adeghikmopstuv^x"
#if defined ACPI_OPTION
diff --git a/source/tools/acpisrc/astable.c b/source/tools/acpisrc/astable.c
index e9298c599..d2da8e301 100644
--- a/source/tools/acpisrc/astable.c
+++ b/source/tools/acpisrc/astable.c
@@ -648,12 +648,12 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_TABLE_BERT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_BGRT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_BOOT", SRC_TYPE_STRUCT},
+ {"ACPI_TABLE_CCEL", SRC_TYPE_STRUCT},
{"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_CPEP", SRC_TYPE_STRUCT},
{"ACPI_TABLE_CSRT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DBG2", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DBGP", SRC_TYPE_STRUCT},
- {"ACPI_TABLE_CEDT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DMAR", SRC_TYPE_STRUCT},
{"ACPI_TABLE_DRTM", SRC_TYPE_STRUCT},
{"ACPI_TABLE_ECDT", SRC_TYPE_STRUCT},
@@ -886,7 +886,6 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_PHAT_HEADER", SRC_TYPE_STRUCT},
{"ACPI_PHAT_VERSION_DATA", SRC_TYPE_STRUCT},
{"ACPI_PHAT_VERSION_ELEMENT", SRC_TYPE_STRUCT},
- {"ACPI_PHAT_VERSION_ELEMENT", SRC_TYPE_STRUCT},
{"ACPI_PHAT_HEALTH_DATA", SRC_TYPE_STRUCT},
{"ACPI_PMTT_CONTROLLER", SRC_TYPE_STRUCT},
{"ACPI_PMTT_HEADER", SRC_TYPE_STRUCT},
diff --git a/source/tools/acpixtract/acpixtract.c b/source/tools/acpixtract/acpixtract.c
index 480e20e80..30bb06e5b 100644
--- a/source/tools/acpixtract/acpixtract.c
+++ b/source/tools/acpixtract/acpixtract.c
@@ -561,7 +561,7 @@ AxListAllTables (
FILE *InputFile;
unsigned char Header[48];
UINT32 ByteCount = 0;
- UINT32 ThisLineByteCount;
+ INT32 ThisLineByteCount;
unsigned int State = AX_STATE_FIND_HEADER;
diff --git a/source/tools/examples/extables.c b/source/tools/examples/extables.c
index 9f2bcc108..8633788ea 100644
--- a/source/tools/examples/extables.c
+++ b/source/tools/examples/extables.c
@@ -315,19 +315,19 @@ ExInitializeAcpiTables (
/* Set new checksums for the modified tables */
Rsdp->Checksum = 0;
- Rsdp->Checksum = (UINT8) -AcpiTbChecksum (
+ Rsdp->Checksum = (UINT8) -AcpiUtChecksum (
(void *) RsdpCode, ACPI_RSDP_CHECKSUM_LENGTH);
Rsdt->Header.Checksum = 0;
- Rsdt->Header.Checksum = (UINT8) -AcpiTbChecksum (
+ Rsdt->Header.Checksum = (UINT8) -AcpiUtChecksum (
(void *) Rsdt, Rsdt->Header.Length);
Xsdt->Header.Checksum = 0;
- Xsdt->Header.Checksum = (UINT8) -AcpiTbChecksum (
+ Xsdt->Header.Checksum = (UINT8) -AcpiUtChecksum (
(void *) Xsdt, Xsdt->Header.Length);
Fadt->Header.Checksum = 0;
- Fadt->Header.Checksum = (UINT8) -AcpiTbChecksum (
+ Fadt->Header.Checksum = (UINT8) -AcpiUtChecksum (
(void *) Fadt, Fadt->Header.Length);
}