aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2010-05-28 18:46:48 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2010-05-28 18:46:48 +0000
commitf2bf96d30fe08965ffd53a28099131ac030e43d5 (patch)
tree2429d13f44367948f54b059645bd882e2e28f2d4
parent5b663f0c698a9ecf7e562f7f7f730d056e499b5f (diff)
downloadsrc-f2bf96d30fe08965ffd53a28099131ac030e43d5.tar.gz
src-f2bf96d30fe08965ffd53a28099131ac030e43d5.zip
Import ACPICA 20100528.vendor/acpica/20100528
Notes
Notes: svn path=/vendor-sys/acpica/dist/; revision=208625 svn path=/vendor-sys/acpica/20100528/; revision=208626; tag=vendor/acpica/20100528
-rw-r--r--changes.txt87
-rw-r--r--common/adisasm.c9
-rw-r--r--common/adwalk.c2
-rw-r--r--common/dmextern.c4
-rw-r--r--common/dmrestag.c7
-rw-r--r--common/dmtable.c69
-rw-r--r--common/dmtbdump.c2
-rw-r--r--common/dmtbinfo.c1192
-rw-r--r--compiler/Makefile8
-rw-r--r--compiler/aslanalyze.c2
-rw-r--r--compiler/aslcompile.c65
-rw-r--r--compiler/aslcompiler.h21
-rw-r--r--compiler/aslcompiler.l2
-rw-r--r--compiler/aslcompiler.y2
-rw-r--r--compiler/asldefine.h7
-rw-r--r--compiler/aslerror.c2
-rw-r--r--compiler/aslfiles.c8
-rw-r--r--compiler/aslglobal.h7
-rw-r--r--compiler/asllookup.c4
-rw-r--r--compiler/aslmain.c16
-rw-r--r--compiler/aslopt.c2
-rw-r--r--compiler/aslpredef.c6
-rw-r--r--compiler/aslstartup.c185
-rw-r--r--compiler/asltransform.c2
-rw-r--r--compiler/asltree.c12
-rw-r--r--compiler/asltypes.h35
-rw-r--r--compiler/aslutils.c56
-rw-r--r--compiler/dtcompile.c614
-rw-r--r--compiler/dtcompiler.h455
-rw-r--r--compiler/dtfield.c543
-rw-r--r--compiler/dtio.c512
-rw-r--r--compiler/dtsubtable.c400
-rw-r--r--compiler/dttable.c1399
-rw-r--r--compiler/dtutils.c894
-rw-r--r--debugger/dbcmds.c16
-rw-r--r--debugger/dbdisply.c6
-rw-r--r--debugger/dbexec.c2
-rw-r--r--debugger/dbfileio.c2
-rw-r--r--debugger/dbhistry.c2
-rw-r--r--debugger/dbinput.c2
-rw-r--r--debugger/dbutils.c2
-rw-r--r--disassembler/dmobject.c6
-rw-r--r--disassembler/dmopcode.c8
-rw-r--r--disassembler/dmresrc.c2
-rw-r--r--dispatcher/dsinit.c16
-rw-r--r--dispatcher/dsmethod.c15
-rw-r--r--dispatcher/dsmthdat.c16
-rw-r--r--dispatcher/dsopcode.c6
-rw-r--r--dispatcher/dsutils.c4
-rw-r--r--events/evgpeutil.c1
-rw-r--r--events/evrgnini.c10
-rw-r--r--executer/exdump.c6
-rw-r--r--executer/exfldio.c94
-rw-r--r--executer/exprep.c105
-rw-r--r--executer/exregion.c6
-rw-r--r--executer/exsystem.c9
-rw-r--r--hardware/hwsleep.c2
-rw-r--r--hardware/hwvalid.c14
-rw-r--r--include/acconfig.h4
-rw-r--r--include/acdisasm.h29
-rw-r--r--include/acexcep.h2
-rw-r--r--include/acglobal.h9
-rw-r--r--include/aclocal.h5
-rw-r--r--include/acnamesp.h9
-rw-r--r--include/acobject.h16
-rw-r--r--include/acpixf.h3
-rw-r--r--include/acpredef.h9
-rw-r--r--include/acstruct.h32
-rw-r--r--include/actbl2.h8
-rw-r--r--namespace/nsaccess.c8
-rw-r--r--namespace/nsalloc.c98
-rw-r--r--namespace/nsdump.c2
-rw-r--r--namespace/nsinit.c30
-rw-r--r--namespace/nsnames.c4
-rw-r--r--namespace/nsparse.c2
-rw-r--r--namespace/nsrepair2.c7
-rw-r--r--namespace/nssearch.c15
-rw-r--r--namespace/nsutils.c125
-rw-r--r--namespace/nswalk.c16
-rw-r--r--namespace/nsxfobj.c2
-rw-r--r--os_specific/service_layers/oswinxf.c8
-rw-r--r--tools/acpiexec/aehandlers.c4
-rw-r--r--tools/acpiexec/aemain.c127
-rw-r--r--tools/acpisrc/asconvrt.c10
-rw-r--r--tools/acpisrc/asfile.c6
-rw-r--r--tools/acpixtract/acpixtract.c2
-rw-r--r--utilities/utglobal.c3
-rw-r--r--utilities/uttrack.c21
88 files changed, 6372 insertions, 1227 deletions
diff --git a/changes.txt b/changes.txt
index fed0395e61ae..a99ed32bfcfb 100644
--- a/changes.txt
+++ b/changes.txt
@@ -1,4 +1,91 @@
----------------------------------------
+28 May 2010. Summary of changes for version 20100528:
+
+This release is available at www.acpica.org/downloads
+
+Note: The ACPI 4.0a specification was released on April 5, 2010 and is
+available at www.acpi.info. This is primarily an errata release.
+
+1) ACPI CA Core Subsystem:
+
+Undefined ACPI tables: We are looking for the definitions for the following
+ACPI tables that have been seen in the field: ATKG, IEIT, GSCI.
+
+Implemented support to enable multi-byte transfers for Embedded Controller
+(EC) operation regions. Previously, the maximum data size passed to the EC
+operation region handler was a single byte. There are often EC Fields larger
+than one byte that need to be transferred, and it is useful for the EC driver
+to lock these as a single transaction. This change enables single transfers
+larger than 8 bits. This effectively changes the access to the EC space from
+ByteAcc to AnyAcc, and will probably require changes to the host OS Embedded
+Controller driver to enable 16/32/64/256-bit transfers in addition to 8-bit
+transfers. Alexey Starikovskiy, Lin Ming
+
+Implemented a performance enhancement for namespace search and access. This
+change enhances the performance of namespace searches and walks by adding a
+backpointer to the parent in each namespace node. On large namespaces, this
+change can improve overall ACPI performance by up to 9X. Adding a pointer to
+each namespace node increases the overall size of the internal namespace by
+about 5%, since each namespace entry usually consists of both a namespace
+node and an ACPI operand object. However, this is the first growth of the
+namespace in ten years. ACPICA bugzilla 817. Alexey Starikovskiy.
+
+Implemented a performance optimization that reduces the number of namespace
+walks. On control method exit, only walk the namespace if the method is known
+to have created namespace objects outside of its local scope. Previously, the
+entire namespace was traversed on each control method exit. This change can
+improve overall ACPI performance by up to 3X. Alexey Starikovskiy, Bob Moore.
+
+Added support to truncate I/O addresses to 16 bits for Windows compatibility.
+Some ASL code has been seen in the field that inadvertently has bits set
+above bit 15. This feature is optional and is enabled if the BIOS requests
+any Windows OSI strings. It can also be enabled by the host OS. Matthew
+Garrett, Bob Moore.
+
+Added support to limit the maximum time for the ASL Sleep() operator. To
+prevent accidental deep sleeps, limit the maximum time that Sleep() will
+actually sleep. Configurable, the default maximum is two seconds. ACPICA
+bugzilla 854.
+
+Added run-time validation support for the _WDG and_WED Microsoft predefined
+methods. These objects are defined by "Windows Instrumentation", and are not
+part of the ACPI spec. ACPICA BZ 860.
+
+Expanded all statistic counters used during namespace and device
+initialization from 16 to 32 bits in order to support very large namespaces.
+
+Replaced all instances of %d in printf format specifiers with %u since nearly
+all integers in ACPICA are unsigned.
+
+Fixed the exception namestring for AE_WAKE_ONLY_GPE. Was incorrectly returned
+as AE_NO_HANDLER.
+
+Example Code and Data Size: These are the sizes for the OS-independent
+acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The
+debug version of the code includes the debug output trace mechanism and has a
+much larger code and data size.
+
+ Previous Release:
+ Non-Debug Version: 88.4K Code, 18.8K Data, 107.2K Total
+ Debug Version: 164.2K Code, 51.5K Data, 215.7K Total
+ Current Release:
+ Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total
+ Debug Version: 164.1K Code, 51.5K Data, 215.6K Total
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Added compiler support for the _WDG and_WED Microsoft predefined
+methods. These objects are defined by "Windows Instrumentation", and are not
+part of the ACPI spec. ACPICA BZ 860.
+
+AcpiExec: added option to disable the memory tracking mechanism. The -dt
+option will disable the tracking mechanism, which improves performance
+considerably.
+
+AcpiExec: Restructured the command line options into -d (disable) and -e
+(enable) options.
+
+----------------------------------------
28 April 2010. Summary of changes for version 20100428:
1) ACPI CA Core Subsystem:
diff --git a/common/adisasm.c b/common/adisasm.c
index eced93d536bc..5c55f5c33149 100644
--- a/common/adisasm.c
+++ b/common/adisasm.c
@@ -502,7 +502,7 @@ AdAmlDisassemble (
if (AcpiDmGetExternalMethodCount ())
{
fprintf (stderr,
- "\nFound %d external control methods, reparsing with new information\n",
+ "\nFound %u external control methods, reparsing with new information\n",
AcpiDmGetExternalMethodCount ());
/*
@@ -515,10 +515,11 @@ AdAmlDisassemble (
AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
+ AcpiGbl_RootNodeStruct.Parent = NULL;
AcpiGbl_RootNodeStruct.Child = NULL;
AcpiGbl_RootNodeStruct.Peer = NULL;
AcpiGbl_RootNodeStruct.Object = NULL;
- AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST;
+ AcpiGbl_RootNodeStruct.Flags = 0;
Status = AcpiNsRootInitialize ();
AcpiDmAddExternalsToNamespace ();
@@ -706,7 +707,7 @@ AdCreateTableHeader (
/* Open the ASL definition block */
AcpiOsPrintf (
- "DefinitionBlock (\"%s\", \"%4.4s\", %hd, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
+ "DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n",
NewFilename, Table->Signature, Table->Revision,
Table->OemId, Table->OemTableId, Table->OemRevision);
@@ -1018,7 +1019,7 @@ AdGetLocalTables (
* is architecture-dependent.
*/
NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize;
- AcpiOsPrintf ("There are %d tables defined in the %4.4s\n\n",
+ AcpiOsPrintf ("There are %u tables defined in the %4.4s\n\n",
NumTables, NewTable->Signature);
/* Get the FADT */
diff --git a/common/adwalk.c b/common/adwalk.c
index 09411faeec0e..b07053329cda 100644
--- a/common/adwalk.c
+++ b/common/adwalk.c
@@ -537,7 +537,7 @@ AcpiDmFindOrphanDescending (
}
ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp);
- AcpiOsPrintf ("/* A-CHILDREN: %d Actual %d */\n", ArgCount, AcpiDmCountChildren (Op));
+ AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n", ArgCount, AcpiDmCountChildren (Op));
if (ArgCount < 1)
{
diff --git a/common/dmextern.c b/common/dmextern.c
index ab46b6979348..d264fa58e17e 100644
--- a/common/dmextern.c
+++ b/common/dmextern.c
@@ -252,7 +252,7 @@ AcpiDmNormalizeParentPrefix (
Node = Op->Common.Node;
while (Node && (*Path == (UINT8) AML_PARENT_PREFIX))
{
- Node = AcpiNsGetParentNode (Node);
+ Node = Node->Parent;
Path++;
}
@@ -629,7 +629,7 @@ AcpiDmEmitExternals (
if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD)
{
- AcpiOsPrintf (") // %d Arguments\n",
+ AcpiOsPrintf (") // %u Arguments\n",
AcpiGbl_ExternalList->Value);
}
else
diff --git a/common/dmrestag.c b/common/dmrestag.c
index 97f6c476e575..e1f340d54f14 100644
--- a/common/dmrestag.c
+++ b/common/dmrestag.c
@@ -549,13 +549,6 @@ AcpiDmGetResourceNode (
return (Node);
}
- /* List is circular, this flag marks the end */
-
- if (Node->Flags & ANOBJ_END_OF_PEER_LIST)
- {
- return (NULL);
- }
-
Node = Node->Peer;
}
diff --git a/common/dmtable.c b/common/dmtable.c
index 057194d551de..49b8bb071768 100644
--- a/common/dmtable.c
+++ b/common/dmtable.c
@@ -117,6 +117,7 @@
#include "accommon.h"
#include "acdisasm.h"
#include "actables.h"
+#include "dtcompiler.h"
/* This module used for application-level code only */
@@ -125,10 +126,6 @@
/* Local Prototypes */
-static ACPI_DMTABLE_DATA *
-AcpiDmGetTableData (
- char *Signature);
-
static void
AcpiDmCheckAscii (
UINT8 *Target,
@@ -247,37 +244,37 @@ static const char *AcpiDmFadtProfiles[] =
static ACPI_DMTABLE_DATA AcpiDmTableData[] =
{
- {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, "Alert Standard Format table"},
- {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, "Simple Boot Flag Table"},
- {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, "Boot Error Record Table"},
- {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, "Corrected Platform Error Polling table"},
- {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, "Debug Port table"},
- {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, "DMA Remapping table"},
- {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, "Embedded Controller Boot Resources Table"},
- {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, "Error Injection table"},
- {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, "Error Record Serialization Table"},
- {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, "Fixed ACPI Description Table"},
- {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, "Hardware Error Source Table"},
- {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, "High Precision Event Timer table"},
- {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, "I/O Virtualization Reporting Structure"},
- {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, "Multiple APIC Description Table"},
- {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, "Memory Mapped Configuration table"},
- {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, "Management Controller Host Interface table"},
- {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, "Maximum System Characteristics Table"},
- {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, "Root System Description Table"},
- {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, "Smart Battery Specification Table"},
- {ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, "Software Licensing Description Table"},
- {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, "System Locality Information Table"},
- {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, "Serial Port Console Redirection table"},
- {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, "Server Platform Management Interface table"},
- {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, "System Resource Affinity Table"},
- {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, "Trusted Computing Platform Alliance table"},
- {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, "UEFI Boot Optimization Table"},
- {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, "Windows ACPI Emulated Devices Table"},
- {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, "Watchdog Action Table"},
- {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, "Watchdog Resource Table"},
- {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, "Extended System Description Table"},
- {NULL, NULL, NULL, NULL}
+ {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, "Alert Standard Format table"},
+ {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, "Simple Boot Flag Table"},
+ {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, "Boot Error Record Table"},
+ {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, "Corrected Platform Error Polling table"},
+ {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, "Debug Port table"},
+ {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, "DMA Remapping table"},
+ {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, "Embedded Controller Boot Resources Table"},
+ {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, "Error Injection table"},
+ {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, "Error Record Serialization Table"},
+ {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, "Fixed ACPI Description Table"},
+ {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, "Hardware Error Source Table"},
+ {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, "High Precision Event Timer table"},
+ {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, "I/O Virtualization Reporting Structure"},
+ {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, "Multiple APIC Description Table"},
+ {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, "Memory Mapped Configuration table"},
+ {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, "Management Controller Host Interface table"},
+ {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, "Maximum System Characteristics Table"},
+ {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, "Root System Description Table"},
+ {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, "Smart Battery Specification Table"},
+ {ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, NULL, "Software Licensing Description Table"},
+ {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, "System Locality Information Table"},
+ {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, "Serial Port Console Redirection table"},
+ {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, "Server Platform Management Interface table"},
+ {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, "System Resource Affinity Table"},
+ {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, "Trusted Computing Platform Alliance table"},
+ {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, NULL, "UEFI Boot Optimization Table"},
+ {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, "Windows ACPI Emulated Devices Table"},
+ {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, "Watchdog Action Table"},
+ {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, "Watchdog Resource Table"},
+ {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, "Extended System Description Table"},
+ {NULL, NULL, NULL, NULL, NULL}
};
@@ -328,7 +325,7 @@ AcpiTbGenerateChecksum (
*
******************************************************************************/
-static ACPI_DMTABLE_DATA *
+ACPI_DMTABLE_DATA *
AcpiDmGetTableData (
char *Signature)
{
diff --git a/common/dmtbdump.c b/common/dmtbdump.c
index af7ee6712af6..a929f0ff858e 100644
--- a/common/dmtbdump.c
+++ b/common/dmtbdump.c
@@ -1174,7 +1174,7 @@ AcpiDmDumpMcfg (
{
if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
{
- AcpiOsPrintf ("Warning: there are %d invalid trailing bytes\n",
+ AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
return;
}
diff --git a/common/dmtbinfo.c b/common/dmtbinfo.c
index 5c7ecb8e26dd..a978a94f1b67 100644
--- a/common/dmtbinfo.c
+++ b/common/dmtbinfo.c
@@ -230,6 +230,11 @@
#define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o)
#define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o)
+/*
+ * Required terminator for all tables below
+ */
+#define ACPI_DMT_TERMINATOR {ACPI_DMT_EXIT, 0, NULL, 0}
+
/*
* ACPI Table Information, used to dump formatted ACPI tables
@@ -245,16 +250,16 @@
ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[] =
{
- {ACPI_DMT_SIG, ACPI_HDR_OFFSET (Signature[0]), "Signature"},
- {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (Length), "Table Length"},
- {ACPI_DMT_UINT8, ACPI_HDR_OFFSET (Revision), "Revision"},
- {ACPI_DMT_CHKSUM, ACPI_HDR_OFFSET (Checksum), "Checksum"},
- {ACPI_DMT_NAME6, ACPI_HDR_OFFSET (OemId[0]), "Oem ID"},
- {ACPI_DMT_NAME8, ACPI_HDR_OFFSET (OemTableId[0]), "Oem Table ID"},
- {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (OemRevision), "Oem Revision"},
- {ACPI_DMT_NAME4, ACPI_HDR_OFFSET (AslCompilerId[0]), "Asl Compiler ID"},
- {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (AslCompilerRevision), "Asl Compiler Revision"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_SIG, ACPI_HDR_OFFSET (Signature[0]), "Signature", 0},
+ {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (Length), "Table Length", DT_LENGTH},
+ {ACPI_DMT_UINT8, ACPI_HDR_OFFSET (Revision), "Revision", 0},
+ {ACPI_DMT_CHKSUM, ACPI_HDR_OFFSET (Checksum), "Checksum", 0},
+ {ACPI_DMT_NAME6, ACPI_HDR_OFFSET (OemId[0]), "Oem ID", 0},
+ {ACPI_DMT_NAME8, ACPI_HDR_OFFSET (OemTableId[0]), "Oem Table ID", 0},
+ {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (OemRevision), "Oem Revision", 0},
+ {ACPI_DMT_NAME4, ACPI_HDR_OFFSET (AslCompilerId[0]), "Asl Compiler ID", 0},
+ {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (AslCompilerRevision), "Asl Compiler Revision", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -266,12 +271,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoGas[] =
{
- {ACPI_DMT_SPACEID, ACPI_GAS_OFFSET (SpaceId), "Space ID"},
- {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitWidth), "Bit Width"},
- {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitOffset), "Bit Offset"},
- {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (AccessWidth), "Access Width"},
- {ACPI_DMT_UINT64, ACPI_GAS_OFFSET (Address), "Address"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_SPACEID, ACPI_GAS_OFFSET (SpaceId), "Space ID", 0},
+ {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitWidth), "Bit Width", 0},
+ {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitOffset), "Bit Offset", 0},
+ {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (AccessWidth), "Access Width", 0},
+ {ACPI_DMT_UINT64, ACPI_GAS_OFFSET (Address), "Address", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -283,23 +288,23 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoGas[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[] =
{
- {ACPI_DMT_NAME8, ACPI_RSDP_OFFSET (Signature[0]), "Signature"},
- {ACPI_DMT_UINT8, ACPI_RSDP_OFFSET (Checksum), "Checksum"},
- {ACPI_DMT_NAME6, ACPI_RSDP_OFFSET (OemId[0]), "Oem ID"},
- {ACPI_DMT_UINT8, ACPI_RSDP_OFFSET (Revision), "Revision"},
- {ACPI_DMT_UINT32, ACPI_RSDP_OFFSET (RsdtPhysicalAddress), "RSDT Address"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_NAME8, ACPI_RSDP_OFFSET (Signature[0]), "Signature", 0},
+ {ACPI_DMT_UINT8, ACPI_RSDP_OFFSET (Checksum), "Checksum", 0},
+ {ACPI_DMT_NAME6, ACPI_RSDP_OFFSET (OemId[0]), "Oem ID", 0},
+ {ACPI_DMT_UINT8, ACPI_RSDP_OFFSET (Revision), "Revision", 0},
+ {ACPI_DMT_UINT32, ACPI_RSDP_OFFSET (RsdtPhysicalAddress), "RSDT Address", 0},
+ ACPI_DMT_TERMINATOR
};
/* ACPI 2.0+ Extensions */
ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[] =
{
- {ACPI_DMT_UINT32, ACPI_RSDP_OFFSET (Length), "Length"},
- {ACPI_DMT_UINT64, ACPI_RSDP_OFFSET (XsdtPhysicalAddress), "XSDT Address"},
- {ACPI_DMT_UINT8, ACPI_RSDP_OFFSET (ExtendedChecksum), "Extended Checksum"},
- {ACPI_DMT_UINT24, ACPI_RSDP_OFFSET (Reserved[0]), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_RSDP_OFFSET (Length), "Length", DT_LENGTH},
+ {ACPI_DMT_UINT64, ACPI_RSDP_OFFSET (XsdtPhysicalAddress), "XSDT Address", 0},
+ {ACPI_DMT_UINT8, ACPI_RSDP_OFFSET (ExtendedChecksum), "Extended Checksum", 0},
+ {ACPI_DMT_UINT24, ACPI_RSDP_OFFSET (Reserved[0]), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -311,20 +316,20 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[] =
{
- {ACPI_DMT_NAME4, ACPI_FACS_OFFSET (Signature[0]), "Signature"},
- {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (Length), "Length"},
- {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (HardwareSignature), "Hardware Signature"},
- {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (FirmwareWakingVector), "32 Firmware Waking Vector"},
- {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (GlobalLock), "Global Lock"},
- {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (Flags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_FACS_FLAG_OFFSET (Flags,0), "S4BIOS Support Present"},
- {ACPI_DMT_FLAG1, ACPI_FACS_FLAG_OFFSET (Flags,0), "64-bit Wake Supported (V2)"},
- {ACPI_DMT_UINT64, ACPI_FACS_OFFSET (XFirmwareWakingVector), "64 Firmware Waking Vector"},
- {ACPI_DMT_UINT8, ACPI_FACS_OFFSET (Version), "Version"},
- {ACPI_DMT_UINT24, ACPI_FACS_OFFSET (Reserved[0]), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (OspmFlags), "OspmFlags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_FACS_FLAG_OFFSET (OspmFlags,0), "64-bit Wake Env Required (V2)"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_NAME4, ACPI_FACS_OFFSET (Signature[0]), "Signature", 0},
+ {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (Length), "Length", DT_LENGTH},
+ {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (HardwareSignature), "Hardware Signature", 0},
+ {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (FirmwareWakingVector), "32 Firmware Waking Vector", 0},
+ {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (GlobalLock), "Global Lock", 0},
+ {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_FACS_FLAG_OFFSET (Flags,0), "S4BIOS Support Present", 0},
+ {ACPI_DMT_FLAG1, ACPI_FACS_FLAG_OFFSET (Flags,0), "64-bit Wake Supported (V2)", 0},
+ {ACPI_DMT_UINT64, ACPI_FACS_OFFSET (XFirmwareWakingVector), "64 Firmware Waking Vector", 0},
+ {ACPI_DMT_UINT8, ACPI_FACS_OFFSET (Version), "Version", 0},
+ {ACPI_DMT_UINT24, ACPI_FACS_OFFSET (Reserved[0]), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_FACS_OFFSET (OspmFlags), "OspmFlags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_FACS_FLAG_OFFSET (OspmFlags,0), "64-bit Wake Env Required (V2)", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -338,113 +343,113 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[] =
{
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Facs), "FACS Address"},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Dsdt), "DSDT Address"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Model), "Model"},
- {ACPI_DMT_FADTPM, ACPI_FADT_OFFSET (PreferredProfile), "PM Profile"},
- {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (SciInterrupt), "SCI Interrupt"},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (SmiCommand), "SMI Command Port"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (AcpiEnable), "ACPI Enable Value"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (AcpiDisable), "ACPI Disable Value"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (S4BiosRequest), "S4BIOS Command"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (PstateControl), "P-State Control"},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Pm1aEventBlock), "PM1A Event Block Address"},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Pm1bEventBlock), "PM1B Event Block Address"},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Pm1aControlBlock), "PM1A Control Block Address"},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Pm1bControlBlock), "PM1B Control Block Address"},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Pm2ControlBlock), "PM2 Control Block Address"},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (PmTimerBlock), "PM Timer Block Address"},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Gpe0Block), "GPE0 Block Address"},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Gpe1Block), "GPE1 Block Address"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Pm1EventLength), "PM1 Event Block Length"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Pm1ControlLength), "PM1 Control Block Length"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Pm2ControlLength), "PM2 Control Block Length"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (PmTimerLength), "PM Timer Block Length"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Gpe0BlockLength), "GPE0 Block Length"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Gpe1BlockLength), "GPE1 Block Length"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Gpe1Base), "GPE1 Base Offset"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (CstControl), "_CST Support"},
- {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (C2Latency), "C2 Latency"},
- {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (C3Latency), "C3 Latency"},
- {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (FlushSize), "CPU Cache Size"},
- {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (FlushStride), "Cache Flush Stride"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (DutyOffset), "Duty Cycle Offset"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (DutyWidth), "Duty Cycle Width"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (DayAlarm), "RTC Day Alarm Index"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MonthAlarm), "RTC Month Alarm Index"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Century), "RTC Century Index"},
- {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (BootFlags), "Boot Flags (decoded below)"},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Facs), "FACS Address", 0},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Dsdt), "DSDT Address", DT_NON_ZERO},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Model), "Model", 0},
+ {ACPI_DMT_FADTPM, ACPI_FADT_OFFSET (PreferredProfile), "PM Profile", 0},
+ {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (SciInterrupt), "SCI Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (SmiCommand), "SMI Command Port", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (AcpiEnable), "ACPI Enable Value", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (AcpiDisable), "ACPI Disable Value", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (S4BiosRequest), "S4BIOS Command", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (PstateControl), "P-State Control", 0},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Pm1aEventBlock), "PM1A Event Block Address", 0},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Pm1bEventBlock), "PM1B Event Block Address", 0},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Pm1aControlBlock), "PM1A Control Block Address", 0},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Pm1bControlBlock), "PM1B Control Block Address", 0},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Pm2ControlBlock), "PM2 Control Block Address", 0},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (PmTimerBlock), "PM Timer Block Address", 0},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Gpe0Block), "GPE0 Block Address", 0},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Gpe1Block), "GPE1 Block Address", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Pm1EventLength), "PM1 Event Block Length", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Pm1ControlLength), "PM1 Control Block Length", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Pm2ControlLength), "PM2 Control Block Length", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (PmTimerLength), "PM Timer Block Length", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Gpe0BlockLength), "GPE0 Block Length", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Gpe1BlockLength), "GPE1 Block Length", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Gpe1Base), "GPE1 Base Offset", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (CstControl), "_CST Support", 0},
+ {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (C2Latency), "C2 Latency", 0},
+ {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (C3Latency), "C3 Latency", 0},
+ {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (FlushSize), "CPU Cache Size", 0},
+ {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (FlushStride), "Cache Flush Stride", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (DutyOffset), "Duty Cycle Offset", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (DutyWidth), "Duty Cycle Width", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (DayAlarm), "RTC Day Alarm Index", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (MonthAlarm), "RTC Month Alarm Index", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Century), "RTC Century Index", 0},
+ {ACPI_DMT_UINT16, ACPI_FADT_OFFSET (BootFlags), "Boot Flags (decoded below)", DT_FLAG},
/* Boot Architecture Flags byte 0 */
- {ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "Legacy Devices Supported (V2)"},
- {ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "8042 Present on ports 60/64 (V2)"},
- {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "VGA Not Present (V4)"},
- {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "MSI Not Supported (V4)"},
- {ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "PCIe ASPM Not Supported (V4)"},
+ {ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "Legacy Devices Supported (V2)", 0},
+ {ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "8042 Present on ports 60/64 (V2)", 0},
+ {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "VGA Not Present (V4)", 0},
+ {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "MSI Not Supported (V4)", 0},
+ {ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "PCIe ASPM Not Supported (V4)", 0},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Flags), "Flags (decoded below)"},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
/* Flags byte 0 */
- {ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET (Flags,0), "WBINVD instruction is operational (V1)"},
- {ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET (Flags,0), "WBINVD flushes all caches (V1)"},
- {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (Flags,0), "All CPUs support C1 (V1)"},
- {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (Flags,0), "C2 works on MP system (V1)"},
- {ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (Flags,0), "Control Method Power Button (V1)"},
- {ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (Flags,0), "Control Method Sleep Button (V1)"},
- {ACPI_DMT_FLAG6, ACPI_FADT_FLAG_OFFSET (Flags,0), "RTC wake not in fixed reg space (V1)"},
- {ACPI_DMT_FLAG7, ACPI_FADT_FLAG_OFFSET (Flags,0), "RTC can wake system from S4 (V1)"},
+ {ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET (Flags,0), "WBINVD instruction is operational (V1)", 0},
+ {ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET (Flags,0), "WBINVD flushes all caches (V1)", 0},
+ {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (Flags,0), "All CPUs support C1 (V1)", 0},
+ {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (Flags,0), "C2 works on MP system (V1)", 0},
+ {ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (Flags,0), "Control Method Power Button (V1)", 0},
+ {ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (Flags,0), "Control Method Sleep Button (V1)", 0},
+ {ACPI_DMT_FLAG6, ACPI_FADT_FLAG_OFFSET (Flags,0), "RTC wake not in fixed reg space (V1)", 0},
+ {ACPI_DMT_FLAG7, ACPI_FADT_FLAG_OFFSET (Flags,0), "RTC can wake system from S4 (V1)", 0},
/* Flags byte 1 */
- {ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET (Flags,1), "32-bit PM Timer (V1)"},
- {ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET (Flags,1), "Docking Supported (V1)"},
- {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (Flags,1), "Reset Register Supported (V2)"},
- {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (Flags,1), "Sealed Case (V3)"},
- {ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (Flags,1), "Headless - No Video (V3)"},
- {ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (Flags,1), "Use native instr after SLP_TYPx (V3)"},
- {ACPI_DMT_FLAG6, ACPI_FADT_FLAG_OFFSET (Flags,1), "PCIEXP_WAK Bits Supported (V4)"},
- {ACPI_DMT_FLAG7, ACPI_FADT_FLAG_OFFSET (Flags,1), "Use Platform Timer (V4)"},
+ {ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET (Flags,1), "32-bit PM Timer (V1)", 0},
+ {ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET (Flags,1), "Docking Supported (V1)", 0},
+ {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (Flags,1), "Reset Register Supported (V2)", 0},
+ {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (Flags,1), "Sealed Case (V3)", 0},
+ {ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (Flags,1), "Headless - No Video (V3)", 0},
+ {ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (Flags,1), "Use native instr after SLP_TYPx (V3)", 0},
+ {ACPI_DMT_FLAG6, ACPI_FADT_FLAG_OFFSET (Flags,1), "PCIEXP_WAK Bits Supported (V4)", 0},
+ {ACPI_DMT_FLAG7, ACPI_FADT_FLAG_OFFSET (Flags,1), "Use Platform Timer (V4)", 0},
/* Flags byte 2 */
- {ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET (Flags,2), "RTC_STS valid on S4 wake (V4)"},
- {ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET (Flags,2), "Remote Power-on capable (V4)"},
- {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Cluster Model (V4)"},
- {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Physical Destination Mode (V4)"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_FLAG0, ACPI_FADT_FLAG_OFFSET (Flags,2), "RTC_STS valid on S4 wake (V4)", 0},
+ {ACPI_DMT_FLAG1, ACPI_FADT_FLAG_OFFSET (Flags,2), "Remote Power-on capable (V4)", 0},
+ {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Cluster Model (V4)", 0},
+ {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Physical Destination Mode (V4)", 0},
+ ACPI_DMT_TERMINATOR
};
/* ACPI 1.0 MS Extensions (FADT version 2) */
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[] =
{
- {ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset"},
- {ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0},
+ {ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
/* ACPI 2.0+ Extensions (FADT version 3+) */
ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] =
{
- {ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register"},
- {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset"},
- {ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved"},
- {ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XFacs), "FACS Address"},
- {ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XDsdt), "DSDT Address"},
- {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1aEventBlock), "PM1A Event Block"},
- {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1bEventBlock), "PM1B Event Block"},
- {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1aControlBlock), "PM1A Control Block"},
- {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1bControlBlock), "PM1B Control Block"},
- {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm2ControlBlock), "PM2 Control Block"},
- {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPmTimerBlock), "PM Timer Block"},
- {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XGpe0Block), "GPE0 Block"},
- {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XGpe1Block), "GPE1 Block"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_GAS, ACPI_FADT_OFFSET (ResetRegister), "Reset Register", 0},
+ {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (ResetValue), "Value to cause reset", 0},
+ {ACPI_DMT_UINT24, ACPI_FADT_OFFSET (Reserved4[0]), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XFacs), "FACS Address", 0},
+ {ACPI_DMT_UINT64, ACPI_FADT_OFFSET (XDsdt), "DSDT Address", 0},
+ {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1aEventBlock), "PM1A Event Block", 0},
+ {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1bEventBlock), "PM1B Event Block", 0},
+ {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1aControlBlock), "PM1A Control Block", 0},
+ {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm1bControlBlock), "PM1B Control Block", 0},
+ {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPm2ControlBlock), "PM2 Control Block", 0},
+ {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XPmTimerBlock), "PM Timer Block", 0},
+ {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XGpe0Block), "GPE0 Block", 0},
+ {ACPI_DMT_GAS, ACPI_FADT_OFFSET (XGpe1Block), "GPE1 Block", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -462,97 +467,97 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[] =
{
- {ACPI_DMT_ASF, ACPI_ASF0_OFFSET (Header.Type), "Subtable Type"},
- {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (Header.Reserved), "Reserved"},
- {ACPI_DMT_UINT16, ACPI_ASF0_OFFSET (Header.Length), "Length"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_ASF, ACPI_ASF0_OFFSET (Header.Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (Header.Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_ASF0_OFFSET (Header.Length), "Length", DT_LENGTH},
+ ACPI_DMT_TERMINATOR
};
/* 0: ASF Information */
ACPI_DMTABLE_INFO AcpiDmTableInfoAsf0[] =
{
- {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinResetValue), "Minimum Reset Value"},
- {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinPollInterval), "Minimum Polling Interval"},
- {ACPI_DMT_UINT16, ACPI_ASF0_OFFSET (SystemId), "System ID"},
- {ACPI_DMT_UINT32, ACPI_ASF0_OFFSET (MfgId), "Manufacturer ID"},
- {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (Flags), "Flags"},
- {ACPI_DMT_UINT24, ACPI_ASF0_OFFSET (Reserved2[0]), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinResetValue), "Minimum Reset Value", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (MinPollInterval), "Minimum Polling Interval", 0},
+ {ACPI_DMT_UINT16, ACPI_ASF0_OFFSET (SystemId), "System ID", 0},
+ {ACPI_DMT_UINT32, ACPI_ASF0_OFFSET (MfgId), "Manufacturer ID", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF0_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT24, ACPI_ASF0_OFFSET (Reserved2[0]), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
/* 1: ASF Alerts */
ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1[] =
{
- {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (AssertMask), "AssertMask"},
- {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (DeassertMask), "DeassertMask"},
- {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (Alerts), "Alert Count"},
- {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (DataLength), "Alert Data Length"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (AssertMask), "AssertMask", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (DeassertMask), "DeassertMask", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (Alerts), "Alert Count", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1_OFFSET (DataLength), "Alert Data Length", 0},
+ ACPI_DMT_TERMINATOR
};
/* 1a: ASF Alert data */
ACPI_DMTABLE_INFO AcpiDmTableInfoAsf1a[] =
{
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Address), "Address"},
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Command), "Command"},
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Mask), "Mask"},
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Value), "Value"},
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SensorType), "SensorType"},
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Type), "Type"},
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Offset), "Offset"},
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SourceType), "SourceType"},
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Severity), "Severity"},
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SensorNumber), "SensorNumber"},
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Entity), "Entity"},
- {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Instance), "Instance"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Address), "Address", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Command), "Command", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Mask), "Mask", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Value), "Value", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SensorType), "SensorType", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Type), "Type", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Offset), "Offset", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SourceType), "SourceType", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Severity), "Severity", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (SensorNumber), "SensorNumber", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Entity), "Entity", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF1a_OFFSET (Instance), "Instance", 0},
+ ACPI_DMT_TERMINATOR
};
/* 2: ASF Remote Control */
ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2[] =
{
- {ACPI_DMT_UINT8, ACPI_ASF2_OFFSET (Controls), "Control Count"},
- {ACPI_DMT_UINT8, ACPI_ASF2_OFFSET (DataLength), "Control Data Length"},
- {ACPI_DMT_UINT16, ACPI_ASF2_OFFSET (Reserved2), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_ASF2_OFFSET (Controls), "Control Count", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF2_OFFSET (DataLength), "Control Data Length", 0},
+ {ACPI_DMT_UINT16, ACPI_ASF2_OFFSET (Reserved2), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
/* 2a: ASF Control data */
ACPI_DMTABLE_INFO AcpiDmTableInfoAsf2a[] =
{
- {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Function), "Function"},
- {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Address), "Address"},
- {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Command), "Command"},
- {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Value), "Value"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Function), "Function", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Address), "Address", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Command), "Command", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF2a_OFFSET (Value), "Value", 0},
+ ACPI_DMT_TERMINATOR
};
/* 3: ASF RMCP Boot Options */
ACPI_DMTABLE_INFO AcpiDmTableInfoAsf3[] =
{
- {ACPI_DMT_UINT56, ACPI_ASF3_OFFSET (Capabilities[0]), "Capabilites"},
- {ACPI_DMT_UINT8, ACPI_ASF3_OFFSET (CompletionCode), "Completion Code"},
- {ACPI_DMT_UINT32, ACPI_ASF3_OFFSET (EnterpriseId), "Enterprise ID"},
- {ACPI_DMT_UINT8, ACPI_ASF3_OFFSET (Command), "Command"},
- {ACPI_DMT_UINT16, ACPI_ASF3_OFFSET (Parameter), "Parameter"},
- {ACPI_DMT_UINT16, ACPI_ASF3_OFFSET (BootOptions), "Boot Options"},
- {ACPI_DMT_UINT16, ACPI_ASF3_OFFSET (OemParameters), "Oem Parameters"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT56, ACPI_ASF3_OFFSET (Capabilities[0]), "Capabilities", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF3_OFFSET (CompletionCode), "Completion Code", 0},
+ {ACPI_DMT_UINT32, ACPI_ASF3_OFFSET (EnterpriseId), "Enterprise ID", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF3_OFFSET (Command), "Command", 0},
+ {ACPI_DMT_UINT16, ACPI_ASF3_OFFSET (Parameter), "Parameter", 0},
+ {ACPI_DMT_UINT16, ACPI_ASF3_OFFSET (BootOptions), "Boot Options", 0},
+ {ACPI_DMT_UINT16, ACPI_ASF3_OFFSET (OemParameters), "Oem Parameters", 0},
+ ACPI_DMT_TERMINATOR
};
/* 4: ASF Address */
ACPI_DMTABLE_INFO AcpiDmTableInfoAsf4[] =
{
- {ACPI_DMT_UINT8, ACPI_ASF4_OFFSET (EpromAddress), "Eprom Address"},
- {ACPI_DMT_UINT8, ACPI_ASF4_OFFSET (Devices), "Device Count"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_ASF4_OFFSET (EpromAddress), "Eprom Address", 0},
+ {ACPI_DMT_UINT8, ACPI_ASF4_OFFSET (Devices), "Device Count", DT_COUNT},
+ ACPI_DMT_TERMINATOR
};
@@ -564,9 +569,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoAsf4[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoBert[] =
{
- {ACPI_DMT_UINT32, ACPI_BERT_OFFSET (RegionLength), "Boot Error Region Length"},
- {ACPI_DMT_UINT64, ACPI_BERT_OFFSET (Address), "Boot Error Region Address"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_BERT_OFFSET (RegionLength), "Boot Error Region Length", 0},
+ {ACPI_DMT_UINT64, ACPI_BERT_OFFSET (Address), "Boot Error Region Address", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -578,9 +583,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBert[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] =
{
- {ACPI_DMT_UINT8, ACPI_BOOT_OFFSET (CmosIndex), "Boot Register Index"},
- {ACPI_DMT_UINT24, ACPI_BOOT_OFFSET (Reserved[0]), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_BOOT_OFFSET (CmosIndex), "Boot Register Index", 0},
+ {ACPI_DMT_UINT24, ACPI_BOOT_OFFSET (Reserved[0]), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -592,18 +597,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[] =
{
- {ACPI_DMT_UINT64, ACPI_CPEP_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT64, ACPI_CPEP_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[] =
{
- {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Type), "Subtable Type"},
- {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Length), "Length"},
- {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Id), "Processor ID"},
- {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Eid), "Processor EID"},
- {ACPI_DMT_UINT32, ACPI_CPEP0_OFFSET (Interval), "Polling Interval"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Header.Length), "Length", DT_LENGTH},
+ {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Id), "Processor ID", 0},
+ {ACPI_DMT_UINT8, ACPI_CPEP0_OFFSET (Eid), "Processor EID", 0},
+ {ACPI_DMT_UINT32, ACPI_CPEP0_OFFSET (Interval), "Polling Interval", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -615,10 +620,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[] =
{
- {ACPI_DMT_UINT8, ACPI_DBGP_OFFSET (Type), "Interface Type"},
- {ACPI_DMT_UINT24, ACPI_DBGP_OFFSET (Reserved[0]), "Reserved"},
- {ACPI_DMT_GAS, ACPI_DBGP_OFFSET (DebugPort), "Debug Port Register"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_DBGP_OFFSET (Type), "Interface Type", 0},
+ {ACPI_DMT_UINT24, ACPI_DBGP_OFFSET (Reserved[0]), "Reserved", 0},
+ {ACPI_DMT_GAS, ACPI_DBGP_OFFSET (DebugPort), "Debug Port Register", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -630,30 +635,30 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[] =
{
- {ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Width), "Host Address Width"},
- {ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Flags), "Flags"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Width), "Host Address Width", 0},
+ {ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Flags), "Flags", 0},
+ ACPI_DMT_TERMINATOR
};
/* Common Subtable header (one per Subtable) */
ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[] =
{
- {ACPI_DMT_DMAR, ACPI_DMAR0_OFFSET (Header.Type), "Subtable Type"},
- {ACPI_DMT_UINT16, ACPI_DMAR0_OFFSET (Header.Length), "Length"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_DMAR, ACPI_DMAR0_OFFSET (Header.Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT16, ACPI_DMAR0_OFFSET (Header.Length), "Length", DT_LENGTH},
+ ACPI_DMT_TERMINATOR
};
/* Common device scope entry */
ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] =
{
- {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EntryType), "Device Scope Entry Type"},
- {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Length), "Entry Length"},
- {ACPI_DMT_UINT16, ACPI_DMARS_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EnumerationId), "Enumeration ID"},
- {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Bus), "PCI Bus Number"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EntryType), "Device Scope Entry Type", 0},
+ {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Length), "Entry Length", DT_LENGTH},
+ {ACPI_DMT_UINT16, ACPI_DMARS_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EnumerationId), "Enumeration ID", 0},
+ {ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Bus), "PCI Bus Number", 0},
+ ACPI_DMT_TERMINATOR
};
/* DMAR Subtables */
@@ -662,42 +667,42 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[] =
{
- {ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Flags), "Flags"},
- {ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT16, ACPI_DMAR0_OFFSET (Segment), "PCI Segment Number"},
- {ACPI_DMT_UINT64, ACPI_DMAR0_OFFSET (Address), "Register Base Address"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_DMAR0_OFFSET (Segment), "PCI Segment Number", 0},
+ {ACPI_DMT_UINT64, ACPI_DMAR0_OFFSET (Address), "Register Base Address", 0},
+ ACPI_DMT_TERMINATOR
};
/* 1: Reserved Memory Definition */
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[] =
{
- {ACPI_DMT_UINT16, ACPI_DMAR1_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT16, ACPI_DMAR1_OFFSET (Segment), "PCI Segment Number"},
- {ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (BaseAddress), "Base Address"},
- {ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (EndAddress), "End Address (limit)"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_DMAR1_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_DMAR1_OFFSET (Segment), "PCI Segment Number", 0},
+ {ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (EndAddress), "End Address (limit)", 0},
+ ACPI_DMT_TERMINATOR
};
/* 2: Root Port ATS Capability Definition */
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[] =
{
- {ACPI_DMT_UINT8, ACPI_DMAR2_OFFSET (Flags), "Flags"},
- {ACPI_DMT_UINT8, ACPI_DMAR2_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT16, ACPI_DMAR2_OFFSET (Segment), "PCI Segment Number"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_DMAR2_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_DMAR2_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_DMAR2_OFFSET (Segment), "PCI Segment Number", 0},
+ ACPI_DMT_TERMINATOR
};
/* 3: Remapping Hardware Static Affinity Structure */
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] =
{
- {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT64, ACPI_DMAR3_OFFSET (BaseAddress), "Base Address"},
- {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (ProximityDomain), "Proximity Domain"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_DMAR3_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT32, ACPI_DMAR3_OFFSET (ProximityDomain), "Proximity Domain", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -709,12 +714,12 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[] =
{
- {ACPI_DMT_GAS, ACPI_ECDT_OFFSET (Control), "Command/Status Register"},
- {ACPI_DMT_GAS, ACPI_ECDT_OFFSET (Data), "Data Register"},
- {ACPI_DMT_UINT32, ACPI_ECDT_OFFSET (Uid), "UID"},
- {ACPI_DMT_UINT8, ACPI_ECDT_OFFSET (Gpe), "GPE Number"},
- {ACPI_DMT_STRING, ACPI_ECDT_OFFSET (Id[0]), "Namepath"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_GAS, ACPI_ECDT_OFFSET (Control), "Command/Status Register", 0},
+ {ACPI_DMT_GAS, ACPI_ECDT_OFFSET (Data), "Data Register", 0},
+ {ACPI_DMT_UINT32, ACPI_ECDT_OFFSET (Uid), "UID", 0},
+ {ACPI_DMT_UINT8, ACPI_ECDT_OFFSET (Gpe), "GPE Number", 0},
+ {ACPI_DMT_STRING, ACPI_ECDT_OFFSET (Id[0]), "Namepath", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -726,23 +731,23 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[] =
{
- {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (HeaderLength), "Injection Header Length"},
- {ACPI_DMT_UINT8, ACPI_EINJ_OFFSET (Flags), "Flags"},
- {ACPI_DMT_UINT24, ACPI_EINJ_OFFSET (Reserved[0]), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Entries), "Injection Entry Count"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (HeaderLength), "Injection Header Length", DT_LENGTH},
+ {ACPI_DMT_UINT8, ACPI_EINJ_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT24, ACPI_EINJ_OFFSET (Reserved[0]), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Entries), "Injection Entry Count", 0},
+ ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[] =
{
- {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Action), "Action"},
- {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Instruction), "Instruction"},
- {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Flags), "Flags"},
- {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_GAS, ACPI_EINJ0_OFFSET (RegisterRegion), "Register Region"},
- {ACPI_DMT_UINT64, ACPI_EINJ0_OFFSET (Value), "Value"},
- {ACPI_DMT_UINT64, ACPI_EINJ0_OFFSET (Mask), "Mask"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Action), "Action", 0},
+ {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Instruction), "Instruction", 0},
+ {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_GAS, ACPI_EINJ0_OFFSET (RegisterRegion), "Register Region", 0},
+ {ACPI_DMT_UINT64, ACPI_EINJ0_OFFSET (Value), "Value", 0},
+ {ACPI_DMT_UINT64, ACPI_EINJ0_OFFSET (Mask), "Mask", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -754,10 +759,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoErst[] =
{
- {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (HeaderLength), "Serialization Header Length"},
- {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (Entries), "Instruction Entry Count"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (HeaderLength), "Serialization Header Length", DT_LENGTH},
+ {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (Entries), "Instruction Entry Count", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -769,31 +774,31 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoErst[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoHest[] =
{
- {ACPI_DMT_UINT32, ACPI_HEST_OFFSET (ErrorSourceCount), "Error Source Count"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_HEST_OFFSET (ErrorSourceCount), "Error Source Count", 0},
+ ACPI_DMT_TERMINATOR
};
/* Common HEST structures for subtables */
#define ACPI_DM_HEST_HEADER \
- {ACPI_DMT_HEST, ACPI_HEST0_OFFSET (Header.Type), "Subtable Type"}, \
- {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Header.SourceId), "Source Id"}
+ {ACPI_DMT_HEST, ACPI_HEST0_OFFSET (Header.Type), "Subtable Type", 0}, \
+ {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Header.SourceId), "Source Id", 0}
#define ACPI_DM_HEST_AER \
- {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved1), "Reserved"}, \
- {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags"}, \
- {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled"}, \
- {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreallocate), "Records To Preallocate"}, \
- {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record"}, \
- {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus"}, \
- {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device"}, \
- {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function"}, \
- {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl"}, \
- {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved2), "Reserved"}, \
- {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableMask), "Uncorrectable Mask"}, \
- {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableSeverity), "Uncorrectable Severity"}, \
- {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableMask), "Correctable Mask"}, \
- {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedCapabilities), "Advanced Capabilities"}
+ {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved1), "Reserved", 0}, \
+ {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags", 0}, \
+ {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled", 0}, \
+ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreallocate), "Records To Preallocate", 0}, \
+ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record", 0}, \
+ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.Bus), "Bus", 0}, \
+ {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Device), "Device", 0}, \
+ {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Function), "Function", 0}, \
+ {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.DeviceControl), "DeviceControl", 0}, \
+ {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved2), "Reserved", 0}, \
+ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableMask), "Uncorrectable Mask", 0}, \
+ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.UncorrectableSeverity), "Uncorrectable Severity", 0}, \
+ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.CorrectableMask), "Correctable Mask", 0}, \
+ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.AdvancedCapabilities), "Advanced Capabilities", 0}
/* HEST Subtables */
@@ -803,16 +808,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] =
{
ACPI_DM_HEST_HEADER,
- {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved"},
- {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags"},
- {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled"},
- {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate"},
- {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"},
- {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalCapabilityData), "Global Capability Data"},
- {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalControlData), "Global Control Data"},
- {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (NumHardwareBanks), "Num Hardware Banks"},
- {ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0},
+ {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalCapabilityData), "Global Capability Data", 0},
+ {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalControlData), "Global Control Data", 0},
+ {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0},
+ {ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
/* 1: IA32 Corrected Machine Check */
@@ -820,15 +825,15 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] =
{
ACPI_DM_HEST_HEADER,
- {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved"},
- {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags"},
- {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled"},
- {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate"},
- {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"},
- {ACPI_DMT_HESTNTFY, ACPI_HEST1_OFFSET (Notify), "Notify"},
- {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (NumHardwareBanks), "Num Hardware Banks"},
- {ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0},
+ {ACPI_DMT_HESTNTFY, ACPI_HEST1_OFFSET (Notify), "Notify", 0},
+ {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0},
+ {ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
/* 2: IA32 Non-Maskable Interrupt */
@@ -836,11 +841,11 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoHest2[] =
{
ACPI_DM_HEST_HEADER,
- {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (RecordsToPreallocate), "Records To Preallocate"},
- {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"},
- {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxRawDataLength), "Max Raw Data Length"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST2_OFFSET (MaxRawDataLength), "Max Raw Data Length", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -850,8 +855,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[] =
{
ACPI_DM_HEST_HEADER,
ACPI_DM_HEST_AER,
- {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (RootErrorCommand), "Root Error Command"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (RootErrorCommand), "Root Error Command", 0},
+ ACPI_DMT_TERMINATOR
};
/* 7: PCI Express AER (AER Endpoint) */
@@ -860,7 +865,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest7[] =
{
ACPI_DM_HEST_HEADER,
ACPI_DM_HEST_AER,
- {ACPI_DMT_EXIT, 0, NULL}
+ ACPI_DMT_TERMINATOR
};
/* 8: PCI Express/PCI-X Bridge AER */
@@ -869,10 +874,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[] =
{
ACPI_DM_HEST_HEADER,
ACPI_DM_HEST_AER,
- {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (UncorrectableMask2), "2nd Uncorrectable Mask"},
- {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (UncorrectableSeverity2), "2nd Uncorrectable Severity"},
- {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (AdvancedCapabilities2), "2nd Advanced Capabilities"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (UncorrectableMask2), "2nd Uncorrectable Mask", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (UncorrectableSeverity2), "2nd Uncorrectable Severity", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST8_OFFSET (AdvancedCapabilities2), "2nd Advanced Capabilities", 0},
+ ACPI_DMT_TERMINATOR
};
/* 9: Generic Hardware Error Source */
@@ -880,30 +885,30 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHest8[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[] =
{
ACPI_DM_HEST_HEADER,
- {ACPI_DMT_UINT16, ACPI_HEST9_OFFSET (RelatedSourceId), "Related Source Id"},
- {ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (Enabled), "Enabled"},
- {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (RecordsToPreallocate), "Records To Preallocate"},
- {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record"},
- {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (MaxRawDataLength), "Max Raw Data Length"},
- {ACPI_DMT_GAS, ACPI_HEST9_OFFSET (ErrorStatusAddress), "Error Status Address"},
- {ACPI_DMT_HESTNTFY, ACPI_HEST9_OFFSET (Notify), "Notify"},
- {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (ErrorBlockLength), "Error Status Block Length"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_HEST9_OFFSET (RelatedSourceId), "Related Source Id", 0},
+ {ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_HEST9_OFFSET (Enabled), "Enabled", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (MaxRawDataLength), "Max Raw Data Length", 0},
+ {ACPI_DMT_GAS, ACPI_HEST9_OFFSET (ErrorStatusAddress), "Error Status Address", 0},
+ {ACPI_DMT_HESTNTFY, ACPI_HEST9_OFFSET (Notify), "Notify", 0},
+ {ACPI_DMT_UINT32, ACPI_HEST9_OFFSET (ErrorBlockLength), "Error Status Block Length", 0},
+ ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[] =
{
- {ACPI_DMT_HESTNTYP, ACPI_HESTN_OFFSET (Type), "Notify Type"},
- {ACPI_DMT_UINT8, ACPI_HESTN_OFFSET (Length), "Notify Length"},
- {ACPI_DMT_UINT16, ACPI_HESTN_OFFSET (ConfigWriteEnable), "Configuration Write Enable"},
- {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (PollInterval), "PollInterval"},
- {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (Vector), "Vector"},
- {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (PollingThresholdValue), "Polling Threshold Value"},
- {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (PollingThresholdWindow), "Polling Threshold Window"},
- {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (ErrorThresholdValue), "Error Threshold Value"},
- {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (ErrorThresholdWindow), "Error Threshold Window"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_HESTNTYP, ACPI_HESTN_OFFSET (Type), "Notify Type", 0},
+ {ACPI_DMT_UINT8, ACPI_HESTN_OFFSET (Length), "Notify Length", DT_LENGTH},
+ {ACPI_DMT_UINT16, ACPI_HESTN_OFFSET (ConfigWriteEnable), "Configuration Write Enable", 0},
+ {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (PollInterval), "PollInterval", 0},
+ {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (Vector), "Vector", 0},
+ {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (PollingThresholdValue), "Polling Threshold Value", 0},
+ {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (PollingThresholdWindow), "Polling Threshold Window", 0},
+ {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (ErrorThresholdValue), "Error Threshold Value", 0},
+ {ACPI_DMT_UINT32, ACPI_HESTN_OFFSET (ErrorThresholdWindow), "Error Threshold Window", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -913,16 +918,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[] =
*/
ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[] =
{
- {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (BankNumber), "Bank Number"},
- {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (ClearStatusOnInit), "Clear Status On Init"},
- {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (StatusFormat), "Status Format"},
- {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (ControlRegister), "Control Register"},
- {ACPI_DMT_UINT64, ACPI_HESTB_OFFSET (ControlData), "Control Data"},
- {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (StatusRegister), "Status Register"},
- {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (AddressRegister), "Address Register"},
- {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (MiscRegister), "Misc Register"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (BankNumber), "Bank Number", 0},
+ {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (ClearStatusOnInit), "Clear Status On Init", 0},
+ {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (StatusFormat), "Status Format", 0},
+ {ACPI_DMT_UINT8, ACPI_HESTB_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (ControlRegister), "Control Register", 0},
+ {ACPI_DMT_UINT64, ACPI_HESTB_OFFSET (ControlData), "Control Data", 0},
+ {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (StatusRegister), "Status Register", 0},
+ {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (AddressRegister), "Address Register", 0},
+ {ACPI_DMT_UINT32, ACPI_HESTB_OFFSET (MiscRegister), "Misc Register", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -934,14 +939,14 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[] =
{
- {ACPI_DMT_UINT32, ACPI_HPET_OFFSET (Id), "Hardware Block ID"},
- {ACPI_DMT_GAS, ACPI_HPET_OFFSET (Address), "Timer Block Register"},
- {ACPI_DMT_UINT8, ACPI_HPET_OFFSET (Sequence), "Sequence Number"},
- {ACPI_DMT_UINT16, ACPI_HPET_OFFSET (MinimumTick), "Minimum Clock Ticks"},
- {ACPI_DMT_UINT8, ACPI_HPET_OFFSET (Flags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_HPET_FLAG_OFFSET (Flags,0), "4K Page Protect"},
- {ACPI_DMT_FLAG1, ACPI_HPET_FLAG_OFFSET (Flags,0), "64K Page Protect"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_HPET_OFFSET (Id), "Hardware Block ID", 0},
+ {ACPI_DMT_GAS, ACPI_HPET_OFFSET (Address), "Timer Block Register", 0},
+ {ACPI_DMT_UINT8, ACPI_HPET_OFFSET (Sequence), "Sequence Number", 0},
+ {ACPI_DMT_UINT16, ACPI_HPET_OFFSET (MinimumTick), "Minimum Clock Ticks", 0},
+ {ACPI_DMT_UINT8, ACPI_HPET_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_HPET_FLAG_OFFSET (Flags,0), "4K Page Protect", 0},
+ {ACPI_DMT_FLAG1, ACPI_HPET_FLAG_OFFSET (Flags,0), "64K Page Protect", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -953,20 +958,20 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[] =
{
- {ACPI_DMT_UINT32, ACPI_IVRS_OFFSET (Info), "Virtualization Info"},
- {ACPI_DMT_UINT64, ACPI_IVRS_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_IVRS_OFFSET (Info), "Virtualization Info", 0},
+ {ACPI_DMT_UINT64, ACPI_IVRS_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
/* Common Subtable header (one per Subtable) */
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHdr[] =
{
- {ACPI_DMT_IVRS, ACPI_IVRSH_OFFSET (Type), "Subtable Type"},
- {ACPI_DMT_UINT8, ACPI_IVRSH_OFFSET (Flags), "Flags"},
- {ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (Length), "Length"},
- {ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (DeviceId), "DeviceId"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_IVRS, ACPI_IVRSH_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT8, ACPI_IVRSH_OFFSET (Flags), "Flags", 0},
+ {ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (Length), "Length", DT_LENGTH},
+ {ACPI_DMT_UINT16, ACPI_IVRSH_OFFSET (DeviceId), "DeviceId", 0},
+ ACPI_DMT_TERMINATOR
};
/* IVRS subtables */
@@ -975,38 +980,38 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrsHdr[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[] =
{
- {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (CapabilityOffset), "Capability Offset"},
- {ACPI_DMT_UINT64, ACPI_IVRS0_OFFSET (BaseAddress), "Base Address"},
- {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (PciSegmentGroup), "PCI Segment Group"},
- {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (Info), "Virtualization Info"},
- {ACPI_DMT_UINT32, ACPI_IVRS0_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (CapabilityOffset), "Capability Offset", 0},
+ {ACPI_DMT_UINT64, ACPI_IVRS0_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (PciSegmentGroup), "PCI Segment Group", 0},
+ {ACPI_DMT_UINT16, ACPI_IVRS0_OFFSET (Info), "Virtualization Info", 0},
+ {ACPI_DMT_UINT32, ACPI_IVRS0_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
/* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition (IVMD) Block */
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[] =
{
- {ACPI_DMT_UINT16, ACPI_IVRS1_OFFSET (AuxData), "Auxiliary Data"},
- {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (StartAddress), "Start Address"},
- {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (MemoryLength), "Memory Length"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_IVRS1_OFFSET (AuxData), "Auxiliary Data", 0},
+ {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (StartAddress), "Start Address", 0},
+ {ACPI_DMT_UINT64, ACPI_IVRS1_OFFSET (MemoryLength), "Memory Length", 0},
+ ACPI_DMT_TERMINATOR
};
/* Device entry header for IVHD block */
#define ACPI_DMT_IVRS_DE_HEADER \
- {ACPI_DMT_UINT8, ACPI_IVRSD_OFFSET (Type), "Entry Type"}, \
- {ACPI_DMT_UINT16, ACPI_IVRSD_OFFSET (Id), "Device ID"}, \
- {ACPI_DMT_UINT8, ACPI_IVRSD_OFFSET (DataSetting), "Data Setting"}
+ {ACPI_DMT_UINT8, ACPI_IVRSD_OFFSET (Type), "Entry Type", 0}, \
+ {ACPI_DMT_UINT16, ACPI_IVRSD_OFFSET (Id), "Device ID", 0}, \
+ {ACPI_DMT_UINT8, ACPI_IVRSD_OFFSET (DataSetting), "Data Setting", 0}
/* 4-byte device entry */
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4[] =
{
ACPI_DMT_IVRS_DE_HEADER,
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_EXIT, 0, NULL, 0},
};
/* 8-byte device entry */
@@ -1014,10 +1019,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs4[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a[] =
{
ACPI_DMT_IVRS_DE_HEADER,
- {ACPI_DMT_UINT8, ACPI_IVRS8A_OFFSET (Reserved1), "Reserved"},
- {ACPI_DMT_UINT16, ACPI_IVRS8A_OFFSET (UsedId), "Source Used Device ID"},
- {ACPI_DMT_UINT8, ACPI_IVRS8A_OFFSET (Reserved2), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_IVRS8A_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_IVRS8A_OFFSET (UsedId), "Source Used Device ID", 0},
+ {ACPI_DMT_UINT8, ACPI_IVRS8A_OFFSET (Reserved2), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
/* 8-byte device entry */
@@ -1025,8 +1030,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8a[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8b[] =
{
ACPI_DMT_IVRS_DE_HEADER,
- {ACPI_DMT_UINT32, ACPI_IVRS8B_OFFSET (ExtendedData), "Extended Data"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_IVRS8B_OFFSET (ExtendedData), "Extended Data", 0},
+ ACPI_DMT_TERMINATOR
};
/* 8-byte device entry */
@@ -1034,10 +1039,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8b[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[] =
{
ACPI_DMT_IVRS_DE_HEADER,
- {ACPI_DMT_UINT8, ACPI_IVRS8C_OFFSET (Handle), "Handle"},
- {ACPI_DMT_UINT16, ACPI_IVRS8C_OFFSET (UsedId), "Source Used Device ID"},
- {ACPI_DMT_UINT8, ACPI_IVRS8C_OFFSET (Variety), "Variety"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_IVRS8C_OFFSET (Handle), "Handle", 0},
+ {ACPI_DMT_UINT16, ACPI_IVRS8C_OFFSET (UsedId), "Source Used Device ID", 0},
+ {ACPI_DMT_UINT8, ACPI_IVRS8C_OFFSET (Variety), "Variety", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1049,19 +1054,19 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs8c[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt[] =
{
- {ACPI_DMT_UINT32, ACPI_MADT_OFFSET (Address), "Local Apic Address"},
- {ACPI_DMT_UINT32, ACPI_MADT_OFFSET (Flags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_MADT_FLAG_OFFSET (Flags,0), "PC-AT Compatibility"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_MADT_OFFSET (Address), "Local Apic Address", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_MADT_FLAG_OFFSET (Flags,0), "PC-AT Compatibility", 0},
+ ACPI_DMT_TERMINATOR
};
/* Common Subtable header (one per Subtable) */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[] =
{
- {ACPI_DMT_MADT, ACPI_MADTH_OFFSET (Type), "Subtable Type"},
- {ACPI_DMT_UINT8, ACPI_MADTH_OFFSET (Length), "Length"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_MADT, ACPI_MADTH_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT8, ACPI_MADTH_OFFSET (Length), "Length", DT_LENGTH},
+ ACPI_DMT_TERMINATOR
};
/* MADT Subtables */
@@ -1070,135 +1075,135 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt0[] =
{
- {ACPI_DMT_UINT8, ACPI_MADT0_OFFSET (ProcessorId), "Processor ID"},
- {ACPI_DMT_UINT8, ACPI_MADT0_OFFSET (Id), "Local Apic ID"},
- {ACPI_DMT_UINT32, ACPI_MADT0_OFFSET (LapicFlags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_MADT0_FLAG_OFFSET (LapicFlags,0), "Processor Enabled"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_MADT0_OFFSET (ProcessorId), "Processor ID", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT0_OFFSET (Id), "Local Apic ID", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT0_OFFSET (LapicFlags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_MADT0_FLAG_OFFSET (LapicFlags,0), "Processor Enabled", 0},
+ ACPI_DMT_TERMINATOR
};
/* 1: IO APIC */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt1[] =
{
- {ACPI_DMT_UINT8, ACPI_MADT1_OFFSET (Id), "I/O Apic ID"},
- {ACPI_DMT_UINT8, ACPI_MADT1_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_MADT1_OFFSET (Address), "Address"},
- {ACPI_DMT_UINT32, ACPI_MADT1_OFFSET (GlobalIrqBase), "Interrupt"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_MADT1_OFFSET (Id), "I/O Apic ID", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT1_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT1_OFFSET (Address), "Address", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT1_OFFSET (GlobalIrqBase), "Interrupt", 0},
+ ACPI_DMT_TERMINATOR
};
/* 2: Interrupt Override */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt2[] =
{
- {ACPI_DMT_UINT8, ACPI_MADT2_OFFSET (Bus), "Bus"},
- {ACPI_DMT_UINT8, ACPI_MADT2_OFFSET (SourceIrq), "Source"},
- {ACPI_DMT_UINT32, ACPI_MADT2_OFFSET (GlobalIrq), "Interrupt"},
- {ACPI_DMT_UINT16, ACPI_MADT2_OFFSET (IntiFlags), "Flags (decoded below)"},
- {ACPI_DMT_FLAGS0, ACPI_MADT2_FLAG_OFFSET (IntiFlags,0), "Polarity"},
- {ACPI_DMT_FLAGS2, ACPI_MADT2_FLAG_OFFSET (IntiFlags,0), "Trigger Mode"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_MADT2_OFFSET (Bus), "Bus", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT2_OFFSET (SourceIrq), "Source", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT2_OFFSET (GlobalIrq), "Interrupt", 0},
+ {ACPI_DMT_UINT16, ACPI_MADT2_OFFSET (IntiFlags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAGS0, ACPI_MADT2_FLAG_OFFSET (IntiFlags,0), "Polarity", 0},
+ {ACPI_DMT_FLAGS2, ACPI_MADT2_FLAG_OFFSET (IntiFlags,0), "Trigger Mode", 0},
+ ACPI_DMT_TERMINATOR
};
/* 3: NMI Sources */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt3[] =
{
- {ACPI_DMT_UINT16, ACPI_MADT3_OFFSET (IntiFlags), "Flags (decoded below)"},
- {ACPI_DMT_FLAGS0, ACPI_MADT3_FLAG_OFFSET (IntiFlags,0), "Polarity"},
- {ACPI_DMT_FLAGS2, ACPI_MADT3_FLAG_OFFSET (IntiFlags,0), "Trigger Mode"},
- {ACPI_DMT_UINT32, ACPI_MADT3_OFFSET (GlobalIrq), "Interrupt"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_MADT3_OFFSET (IntiFlags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAGS0, ACPI_MADT3_FLAG_OFFSET (IntiFlags,0), "Polarity", 0},
+ {ACPI_DMT_FLAGS2, ACPI_MADT3_FLAG_OFFSET (IntiFlags,0), "Trigger Mode", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT3_OFFSET (GlobalIrq), "Interrupt", 0},
+ ACPI_DMT_TERMINATOR
};
/* 4: Local APIC NMI */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt4[] =
{
- {ACPI_DMT_UINT8, ACPI_MADT4_OFFSET (ProcessorId), "Processor ID"},
- {ACPI_DMT_UINT16, ACPI_MADT4_OFFSET (IntiFlags), "Flags (decoded below)"},
- {ACPI_DMT_FLAGS0, ACPI_MADT4_FLAG_OFFSET (IntiFlags,0), "Polarity"},
- {ACPI_DMT_FLAGS2, ACPI_MADT4_FLAG_OFFSET (IntiFlags,0), "Trigger Mode"},
- {ACPI_DMT_UINT8, ACPI_MADT4_OFFSET (Lint), "Interrupt Input LINT"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_MADT4_OFFSET (ProcessorId), "Processor ID", 0},
+ {ACPI_DMT_UINT16, ACPI_MADT4_OFFSET (IntiFlags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAGS0, ACPI_MADT4_FLAG_OFFSET (IntiFlags,0), "Polarity", 0},
+ {ACPI_DMT_FLAGS2, ACPI_MADT4_FLAG_OFFSET (IntiFlags,0), "Trigger Mode", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT4_OFFSET (Lint), "Interrupt Input LINT", 0},
+ ACPI_DMT_TERMINATOR
};
/* 5: Address Override */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt5[] =
{
- {ACPI_DMT_UINT16, ACPI_MADT5_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT64, ACPI_MADT5_OFFSET (Address), "APIC Address"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_MADT5_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT5_OFFSET (Address), "APIC Address", 0},
+ ACPI_DMT_TERMINATOR
};
/* 6: I/O Sapic */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt6[] =
{
- {ACPI_DMT_UINT8, ACPI_MADT6_OFFSET (Id), "I/O Sapic ID"},
- {ACPI_DMT_UINT8, ACPI_MADT6_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_MADT6_OFFSET (GlobalIrqBase), "Interrupt Base"},
- {ACPI_DMT_UINT64, ACPI_MADT6_OFFSET (Address), "Address"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_MADT6_OFFSET (Id), "I/O Sapic ID", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT6_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT6_OFFSET (GlobalIrqBase), "Interrupt Base", 0},
+ {ACPI_DMT_UINT64, ACPI_MADT6_OFFSET (Address), "Address", 0},
+ ACPI_DMT_TERMINATOR
};
/* 7: Local Sapic */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt7[] =
{
- {ACPI_DMT_UINT8, ACPI_MADT7_OFFSET (ProcessorId), "Processor ID"},
- {ACPI_DMT_UINT8, ACPI_MADT7_OFFSET (Id), "Local Sapic ID"},
- {ACPI_DMT_UINT8, ACPI_MADT7_OFFSET (Eid), "Local Sapic EID"},
- {ACPI_DMT_UINT24, ACPI_MADT7_OFFSET (Reserved[0]), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_MADT7_OFFSET (LapicFlags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_MADT7_FLAG_OFFSET (LapicFlags,0), "Processor Enabled"},
- {ACPI_DMT_UINT32, ACPI_MADT7_OFFSET (Uid), "Processor UID"},
- {ACPI_DMT_STRING, ACPI_MADT7_OFFSET (UidString[0]), "Processor UID String"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_MADT7_OFFSET (ProcessorId), "Processor ID", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT7_OFFSET (Id), "Local Sapic ID", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT7_OFFSET (Eid), "Local Sapic EID", 0},
+ {ACPI_DMT_UINT24, ACPI_MADT7_OFFSET (Reserved[0]), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT7_OFFSET (LapicFlags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_MADT7_FLAG_OFFSET (LapicFlags,0), "Processor Enabled", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT7_OFFSET (Uid), "Processor UID", 0},
+ {ACPI_DMT_STRING, ACPI_MADT7_OFFSET (UidString[0]), "Processor UID String", 0},
+ ACPI_DMT_TERMINATOR
};
/* 8: Platform Interrupt Source */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt8[] =
{
- {ACPI_DMT_UINT16, ACPI_MADT8_OFFSET (IntiFlags), "Flags (decoded below)"},
- {ACPI_DMT_FLAGS0, ACPI_MADT8_FLAG_OFFSET (IntiFlags,0), "Polarity"},
- {ACPI_DMT_FLAGS2, ACPI_MADT8_FLAG_OFFSET (IntiFlags,0), "Trigger Mode"},
- {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (Type), "InterruptType"},
- {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (Id), "Processor ID"},
- {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (Eid), "Processor EID"},
- {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (IoSapicVector), "I/O Sapic Vector"},
- {ACPI_DMT_UINT32, ACPI_MADT8_OFFSET (GlobalIrq), "Interrupt"},
- {ACPI_DMT_UINT32, ACPI_MADT8_OFFSET (Flags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_MADT8_OFFSET (Flags), "CPEI Override"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_MADT8_OFFSET (IntiFlags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAGS0, ACPI_MADT8_FLAG_OFFSET (IntiFlags,0), "Polarity", 0},
+ {ACPI_DMT_FLAGS2, ACPI_MADT8_FLAG_OFFSET (IntiFlags,0), "Trigger Mode", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (Type), "InterruptType", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (Id), "Processor ID", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (Eid), "Processor EID", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT8_OFFSET (IoSapicVector), "I/O Sapic Vector", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT8_OFFSET (GlobalIrq), "Interrupt", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT8_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_MADT8_OFFSET (Flags), "CPEI Override", 0},
+ ACPI_DMT_TERMINATOR
};
/* 9: Processor Local X2_APIC (ACPI 4.0) */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[] =
{
- {ACPI_DMT_UINT16, ACPI_MADT9_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_MADT9_OFFSET (LocalApicId), "Processor x2Apic ID"},
- {ACPI_DMT_UINT32, ACPI_MADT9_OFFSET (LapicFlags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_MADT9_FLAG_OFFSET (LapicFlags,0), "Processor Enabled"},
- {ACPI_DMT_UINT32, ACPI_MADT9_OFFSET (Uid), "Processor UID"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_MADT9_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT9_OFFSET (LocalApicId), "Processor x2Apic ID", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT9_OFFSET (LapicFlags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_MADT9_FLAG_OFFSET (LapicFlags,0), "Processor Enabled", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT9_OFFSET (Uid), "Processor UID", 0},
+ ACPI_DMT_TERMINATOR
};
/* 10: Local X2_APIC NMI (ACPI 4.0) */
ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[] =
{
- {ACPI_DMT_UINT16, ACPI_MADT10_OFFSET (IntiFlags), "Flags (decoded below)"},
- {ACPI_DMT_FLAGS0, ACPI_MADT10_FLAG_OFFSET (IntiFlags,0), "Polarity"},
- {ACPI_DMT_FLAGS2, ACPI_MADT10_FLAG_OFFSET (IntiFlags,0), "Trigger Mode"},
- {ACPI_DMT_UINT32, ACPI_MADT10_OFFSET (Uid), "Processor UID"},
- {ACPI_DMT_UINT8, ACPI_MADT10_OFFSET (Lint), "Interrupt Input LINT"},
- {ACPI_DMT_UINT24, ACPI_MADT10_OFFSET (Reserved[0]), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_MADT10_OFFSET (IntiFlags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAGS0, ACPI_MADT10_FLAG_OFFSET (IntiFlags,0), "Polarity", 0},
+ {ACPI_DMT_FLAGS2, ACPI_MADT10_FLAG_OFFSET (IntiFlags,0), "Trigger Mode", 0},
+ {ACPI_DMT_UINT32, ACPI_MADT10_OFFSET (Uid), "Processor UID", 0},
+ {ACPI_DMT_UINT8, ACPI_MADT10_OFFSET (Lint), "Interrupt Input LINT", 0},
+ {ACPI_DMT_UINT24, ACPI_MADT10_OFFSET (Reserved[0]), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1210,18 +1215,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[] =
{
- {ACPI_DMT_UINT64, ACPI_MCFG_OFFSET (Reserved[0]), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT64, ACPI_MCFG_OFFSET (Reserved[0]), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[] =
{
- {ACPI_DMT_UINT64, ACPI_MCFG0_OFFSET (Address), "Base Address"},
- {ACPI_DMT_UINT16, ACPI_MCFG0_OFFSET (PciSegment), "Segment Group Number"},
- {ACPI_DMT_UINT8, ACPI_MCFG0_OFFSET (StartBusNumber), "Start Bus Number"},
- {ACPI_DMT_UINT8, ACPI_MCFG0_OFFSET (EndBusNumber), "End Bus Number"},
- {ACPI_DMT_UINT32, ACPI_MCFG0_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT64, ACPI_MCFG0_OFFSET (Address), "Base Address", 0},
+ {ACPI_DMT_UINT16, ACPI_MCFG0_OFFSET (PciSegment), "Segment Group Number", 0},
+ {ACPI_DMT_UINT8, ACPI_MCFG0_OFFSET (StartBusNumber), "Start Bus Number", 0},
+ {ACPI_DMT_UINT8, ACPI_MCFG0_OFFSET (EndBusNumber), "End Bus Number", 0},
+ {ACPI_DMT_UINT32, ACPI_MCFG0_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1233,19 +1238,19 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[] =
{
- {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (InterfaceType), "Interface Type"},
- {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (Protocol), "Protocol"},
- {ACPI_DMT_UINT64, ACPI_MCHI_OFFSET (ProtocolData), "Protocol Data"},
- {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (InterruptType), "Interrupt Type"},
- {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (Gpe), "Gpe"},
- {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciDeviceFlag), "Pci Device Flag"},
- {ACPI_DMT_UINT32, ACPI_MCHI_OFFSET (GlobalInterrupt), "Global Interrupt"},
- {ACPI_DMT_GAS, ACPI_MCHI_OFFSET (ControlRegister), "Control Register"},
- {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciSegment), "Pci Segment"},
- {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciBus), "Pci Bus"},
- {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciDevice), "Pci Device"},
- {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciFunction), "Pci Function"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (InterfaceType), "Interface Type", 0},
+ {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (Protocol), "Protocol", 0},
+ {ACPI_DMT_UINT64, ACPI_MCHI_OFFSET (ProtocolData), "Protocol Data", 0},
+ {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (InterruptType), "Interrupt Type", 0},
+ {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (Gpe), "Gpe", 0},
+ {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciDeviceFlag), "Pci Device Flag", 0},
+ {ACPI_DMT_UINT32, ACPI_MCHI_OFFSET (GlobalInterrupt), "Global Interrupt", 0},
+ {ACPI_DMT_GAS, ACPI_MCHI_OFFSET (ControlRegister), "Control Register", 0},
+ {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciSegment), "Pci Segment", 0},
+ {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciBus), "Pci Bus", 0},
+ {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciDevice), "Pci Device", 0},
+ {ACPI_DMT_UINT8, ACPI_MCHI_OFFSET (PciFunction), "Pci Function", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1257,24 +1262,24 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[] =
{
- {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (ProximityOffset), "Proximity Offset"},
- {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (MaxProximityDomains), "Max Proximity Domains"},
- {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (MaxClockDomains), "Max Clock Domains"},
- {ACPI_DMT_UINT64, ACPI_MSCT_OFFSET (MaxAddress), "Max Physical Address"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (ProximityOffset), "Proximity Offset", 0},
+ {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (MaxProximityDomains), "Max Proximity Domains", 0},
+ {ACPI_DMT_UINT32, ACPI_MSCT_OFFSET (MaxClockDomains), "Max Clock Domains", 0},
+ {ACPI_DMT_UINT64, ACPI_MSCT_OFFSET (MaxAddress), "Max Physical Address", 0},
+ ACPI_DMT_TERMINATOR
};
/* Subtable - Maximum Proximity Domain Information. Version 1 */
ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[] =
{
- {ACPI_DMT_UINT8, ACPI_MSCT0_OFFSET (Revision), "Revision"},
- {ACPI_DMT_UINT8, ACPI_MSCT0_OFFSET (Length), "Length"},
- {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (RangeStart), "Domain Range Start"},
- {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (RangeEnd), "Domain Range End"},
- {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (ProcessorCapacity), "Processor Capacity"},
- {ACPI_DMT_UINT64, ACPI_MSCT0_OFFSET (MemoryCapacity), "Memory Capacity"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_MSCT0_OFFSET (Revision), "Revision", 0},
+ {ACPI_DMT_UINT8, ACPI_MSCT0_OFFSET (Length), "Length", DT_LENGTH},
+ {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (RangeStart), "Domain Range Start", 0},
+ {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (RangeEnd), "Domain Range End", 0},
+ {ACPI_DMT_UINT32, ACPI_MSCT0_OFFSET (ProcessorCapacity), "Processor Capacity", 0},
+ {ACPI_DMT_UINT64, ACPI_MSCT0_OFFSET (MemoryCapacity), "Memory Capacity", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1286,22 +1291,23 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[] =
{
- {ACPI_DMT_UINT32, ACPI_SBST_OFFSET (WarningLevel), "Warning Level"},
- {ACPI_DMT_UINT32, ACPI_SBST_OFFSET (LowLevel), "Low Level"},
- {ACPI_DMT_UINT32, ACPI_SBST_OFFSET (CriticalLevel), "Critical Level"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_SBST_OFFSET (WarningLevel), "Warning Level", 0},
+ {ACPI_DMT_UINT32, ACPI_SBST_OFFSET (LowLevel), "Low Level", 0},
+ {ACPI_DMT_UINT32, ACPI_SBST_OFFSET (CriticalLevel), "Critical Level", 0},
+ ACPI_DMT_TERMINATOR
};
/*******************************************************************************
*
- * SLIC - Software Licensing Description Table. NOT FULLY IMPLEMENTED
+ * SLIC - Software Licensing Description Table. NOT FULLY IMPLEMENTED, do not
+ * have the table definition.
*
******************************************************************************/
ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[] =
{
- {ACPI_DMT_EXIT, 0, NULL}
+ ACPI_DMT_TERMINATOR
};
@@ -1313,8 +1319,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[] =
{
- {ACPI_DMT_UINT64, ACPI_SLIT_OFFSET (LocalityCount), "Localities"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT64, ACPI_SLIT_OFFSET (LocalityCount), "Localities", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1326,27 +1332,27 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[] =
{
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (InterfaceType), "Interface Type"},
- {ACPI_DMT_UINT24, ACPI_SPCR_OFFSET (Reserved[0]), "Reserved"},
- {ACPI_DMT_GAS, ACPI_SPCR_OFFSET (SerialPort), "Serial Port Register"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (InterruptType), "Interrupt Type"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PcInterrupt), "PCAT-compatible IRQ"},
- {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (Interrupt), "Interrupt"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (BaudRate), "Baud Rate"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (Parity), "Parity"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (StopBits), "Stop Bits"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (FlowControl), "Flow Control"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (TerminalType), "Terminal Type"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (Reserved2), "Reserved"},
- {ACPI_DMT_UINT16, ACPI_SPCR_OFFSET (PciDeviceId), "PCI Device ID"},
- {ACPI_DMT_UINT16, ACPI_SPCR_OFFSET (PciVendorId), "PCI Vendor ID"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciBus), "PCI Bus"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciDevice), "PCI Device"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciFunction), "PCI Function"},
- {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (PciFlags), "PCI Flags"},
- {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciSegment), "PCI Segment"},
- {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (Reserved2), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (InterfaceType), "Interface Type", 0},
+ {ACPI_DMT_UINT24, ACPI_SPCR_OFFSET (Reserved[0]), "Reserved", 0},
+ {ACPI_DMT_GAS, ACPI_SPCR_OFFSET (SerialPort), "Serial Port Register", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (InterruptType), "Interrupt Type", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PcInterrupt), "PCAT-compatible IRQ", 0},
+ {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (Interrupt), "Interrupt", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (BaudRate), "Baud Rate", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (Parity), "Parity", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (StopBits), "Stop Bits", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (FlowControl), "Flow Control", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (TerminalType), "Terminal Type", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (Reserved2), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_SPCR_OFFSET (PciDeviceId), "PCI Device ID", 0},
+ {ACPI_DMT_UINT16, ACPI_SPCR_OFFSET (PciVendorId), "PCI Vendor ID", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciBus), "PCI Bus", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciDevice), "PCI Device", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciFunction), "PCI Function", 0},
+ {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (PciFlags), "PCI Flags", 0},
+ {ACPI_DMT_UINT8, ACPI_SPCR_OFFSET (PciSegment), "PCI Segment", 0},
+ {ACPI_DMT_UINT32, ACPI_SPCR_OFFSET (Reserved2), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1358,21 +1364,21 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] =
{
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type"},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT16, ACPI_SPMI_OFFSET (SpecRevision), "IPMI Spec Version"},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterruptType), "Interrupt Type"},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (GpeNumber), "GPE Number"},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved1), "Reserved"},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciDeviceFlag), "PCI Device Flag"},
- {ACPI_DMT_UINT32, ACPI_SPMI_OFFSET (Interrupt), "Interrupt"},
- {ACPI_DMT_GAS, ACPI_SPMI_OFFSET (IpmiRegister), "IPMI Register"},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciSegment), "PCI Segment"},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciBus), "PCI Bus"},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciDevice), "PCI Device"},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciFunction), "PCI Function"},
- {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved2), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterfaceType), "Interface Type", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT16, ACPI_SPMI_OFFSET (SpecRevision), "IPMI Spec Version", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (InterruptType), "Interrupt Type", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (GpeNumber), "GPE Number", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciDeviceFlag), "PCI Device Flag", 0},
+ {ACPI_DMT_UINT32, ACPI_SPMI_OFFSET (Interrupt), "Interrupt", 0},
+ {ACPI_DMT_GAS, ACPI_SPMI_OFFSET (IpmiRegister), "IPMI Register", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciSegment), "PCI Segment", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciBus), "PCI Bus", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciDevice), "PCI Device", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (PciFunction), "PCI Function", 0},
+ {ACPI_DMT_UINT8, ACPI_SPMI_OFFSET (Reserved2), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1384,18 +1390,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat[] =
{
- {ACPI_DMT_UINT32, ACPI_SRAT_OFFSET (TableRevision), "Table Revision"},
- {ACPI_DMT_UINT64, ACPI_SRAT_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_SRAT_OFFSET (TableRevision), "Table Revision", 0},
+ {ACPI_DMT_UINT64, ACPI_SRAT_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
/* Common Subtable header (one per Subtable) */
ACPI_DMTABLE_INFO AcpiDmTableInfoSratHdr[] =
{
- {ACPI_DMT_SRAT, ACPI_SRATH_OFFSET (Type), "Subtable Type"},
- {ACPI_DMT_UINT8, ACPI_SRATH_OFFSET (Length), "Length"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_SRAT, ACPI_SRATH_OFFSET (Type), "Subtable Type", 0},
+ {ACPI_DMT_UINT8, ACPI_SRATH_OFFSET (Length), "Length", DT_LENGTH},
+ ACPI_DMT_TERMINATOR
};
/* SRAT Subtables */
@@ -1404,45 +1410,45 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSratHdr[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[] =
{
- {ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (ProximityDomainLo), "Proximity Domain Low(8)"},
- {ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (ApicId), "Apic ID"},
- {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (Flags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_SRAT0_FLAG_OFFSET (Flags,0), "Enabled"},
- {ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (LocalSapicEid), "Local Sapic EID"},
- {ACPI_DMT_UINT24, ACPI_SRAT0_OFFSET (ProximityDomainHi[0]), "Proximity Domain High(24)"},
- {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (ProximityDomainLo), "Proximity Domain Low(8)", 0},
+ {ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (ApicId), "Apic ID", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_SRAT0_FLAG_OFFSET (Flags,0), "Enabled", 0},
+ {ACPI_DMT_UINT8, ACPI_SRAT0_OFFSET (LocalSapicEid), "Local Sapic EID", 0},
+ {ACPI_DMT_UINT24, ACPI_SRAT0_OFFSET (ProximityDomainHi[0]), "Proximity Domain High(24)", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT0_OFFSET (Reserved), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
/* 1: Memory Affinity */
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[] =
{
- {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (ProximityDomain), "Proximity Domain"},
- {ACPI_DMT_UINT16, ACPI_SRAT1_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (BaseAddress), "Base Address"},
- {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Length), "Address Length"},
- {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Reserved1), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Flags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Enabled"},
- {ACPI_DMT_FLAG1, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Hot Pluggable"},
- {ACPI_DMT_FLAG2, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Non-Volatile"},
- {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Reserved2), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (ProximityDomain), "Proximity Domain", 0},
+ {ACPI_DMT_UINT16, ACPI_SRAT1_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (BaseAddress), "Base Address", 0},
+ {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Length), "Address Length", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Reserved1), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Enabled", 0},
+ {ACPI_DMT_FLAG1, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Hot Pluggable", 0},
+ {ACPI_DMT_FLAG2, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Non-Volatile", 0},
+ {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Reserved2), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
{
- {ACPI_DMT_UINT16, ACPI_SRAT2_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ProximityDomain), "Proximity Domain"},
- {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ApicId), "Apic ID"},
- {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Flags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_SRAT2_FLAG_OFFSET (Flags,0), "Enabled"},
- {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ClockDomain), "Clock Domain"},
- {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Reserved2), "Reserved"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_SRAT2_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ProximityDomain), "Proximity Domain", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ApicId), "Apic ID", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_SRAT2_FLAG_OFFSET (Flags,0), "Enabled", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ClockDomain), "Clock Domain", 0},
+ {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Reserved2), "Reserved", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1454,10 +1460,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] =
{
- {ACPI_DMT_UINT16, ACPI_TCPA_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_TCPA_OFFSET (MaxLogLength), "Max Event Log Length"},
- {ACPI_DMT_UINT64, ACPI_TCPA_OFFSET (LogAddress), "Event Log Address"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT16, ACPI_TCPA_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_TCPA_OFFSET (MaxLogLength), "Max Event Log Length", 0},
+ {ACPI_DMT_UINT64, ACPI_TCPA_OFFSET (LogAddress), "Event Log Address", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1469,9 +1475,9 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[] =
{
- {ACPI_DMT_BUF16, ACPI_UEFI_OFFSET (Identifier[0]), "UUID Identifier"},
- {ACPI_DMT_UINT16, ACPI_UEFI_OFFSET (DataOffset), "Data Offset"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_BUF16, ACPI_UEFI_OFFSET (Identifier[0]), "UUID Identifier", 0},
+ {ACPI_DMT_UINT16, ACPI_UEFI_OFFSET (DataOffset), "Data Offset", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1483,10 +1489,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[] =
{
- {ACPI_DMT_UINT32, ACPI_WAET_OFFSET (Flags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_WAET_OFFSET (Flags), "RTC needs no INT ack"},
- {ACPI_DMT_FLAG1, ACPI_WAET_OFFSET (Flags), "PM timer, one read only"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_WAET_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_WAET_OFFSET (Flags), "RTC needs no INT ack", 0},
+ {ACPI_DMT_FLAG1, ACPI_WAET_OFFSET (Flags), "PM timer, one read only", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1498,34 +1504,34 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[] =
{
- {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (HeaderLength), "Header Length"},
- {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciSegment), "PCI Segment"},
- {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciBus), "PCI Bus"},
- {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciDevice), "PCI Device"},
- {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciFunction), "PCI Function"},
- {ACPI_DMT_UINT24, ACPI_WDAT_OFFSET (Reserved[0]), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (TimerPeriod), "Timer Period"},
- {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (MaxCount), "Max Count"},
- {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (MinCount), "Min Count"},
- {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (Flags), "Flags (decoded below)"},
- {ACPI_DMT_FLAG0, ACPI_WDAT_OFFSET (Flags), "Enabled"},
- {ACPI_DMT_FLAG7, ACPI_WDAT_OFFSET (Flags), "Stopped When Asleep"},
- {ACPI_DMT_UINT24, ACPI_WDAT_OFFSET (Reserved2[0]), "Reserved"},
- {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (Entries), "Watchdog Entry Count"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (HeaderLength), "Header Length", DT_LENGTH},
+ {ACPI_DMT_UINT16, ACPI_WDAT_OFFSET (PciSegment), "PCI Segment", 0},
+ {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciBus), "PCI Bus", 0},
+ {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciDevice), "PCI Device", 0},
+ {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (PciFunction), "PCI Function", 0},
+ {ACPI_DMT_UINT24, ACPI_WDAT_OFFSET (Reserved[0]), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (TimerPeriod), "Timer Period", 0},
+ {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (MaxCount), "Max Count", 0},
+ {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (MinCount), "Min Count", 0},
+ {ACPI_DMT_UINT8, ACPI_WDAT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
+ {ACPI_DMT_FLAG0, ACPI_WDAT_OFFSET (Flags), "Enabled", 0},
+ {ACPI_DMT_FLAG7, ACPI_WDAT_OFFSET (Flags), "Stopped When Asleep", 0},
+ {ACPI_DMT_UINT24, ACPI_WDAT_OFFSET (Reserved2[0]), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_WDAT_OFFSET (Entries), "Watchdog Entry Count", 0},
+ ACPI_DMT_TERMINATOR
};
/* WDAT Subtables - Watchdog Instruction Entries */
ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[] =
{
- {ACPI_DMT_UINT8, ACPI_WDAT0_OFFSET (Action), "Watchdog Action"},
- {ACPI_DMT_UINT8, ACPI_WDAT0_OFFSET (Instruction), "Instruction"},
- {ACPI_DMT_UINT16, ACPI_WDAT0_OFFSET (Reserved), "Reserved"},
- {ACPI_DMT_GAS, ACPI_WDAT0_OFFSET (RegisterRegion), "Register Region"},
- {ACPI_DMT_UINT32, ACPI_WDAT0_OFFSET (Value), "Value"},
- {ACPI_DMT_UINT32, ACPI_WDAT0_OFFSET (Mask), "Register Mask"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_UINT8, ACPI_WDAT0_OFFSET (Action), "Watchdog Action", 0},
+ {ACPI_DMT_UINT8, ACPI_WDAT0_OFFSET (Instruction), "Instruction", 0},
+ {ACPI_DMT_UINT16, ACPI_WDAT0_OFFSET (Reserved), "Reserved", 0},
+ {ACPI_DMT_GAS, ACPI_WDAT0_OFFSET (RegisterRegion), "Register Region", 0},
+ {ACPI_DMT_UINT32, ACPI_WDAT0_OFFSET (Value), "Value", 0},
+ {ACPI_DMT_UINT32, ACPI_WDAT0_OFFSET (Mask), "Register Mask", 0},
+ ACPI_DMT_TERMINATOR
};
@@ -1537,16 +1543,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[] =
{
- {ACPI_DMT_GAS, ACPI_WDRT_OFFSET (ControlRegister), "Control Register"},
- {ACPI_DMT_GAS, ACPI_WDRT_OFFSET (CountRegister), "Count Register"},
- {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (PciDeviceId), "PCI Device ID"},
- {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (PciVendorId), "PCI Vendor ID"},
- {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciBus), "PCI Bus"},
- {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciDevice), "PCI Device"},
- {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciFunction), "PCI Function"},
- {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciSegment), "PCI Segment"},
- {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (MaxCount), "Max Count"},
- {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (Units), "Counter Units"},
- {ACPI_DMT_EXIT, 0, NULL}
+ {ACPI_DMT_GAS, ACPI_WDRT_OFFSET (ControlRegister), "Control Register", 0},
+ {ACPI_DMT_GAS, ACPI_WDRT_OFFSET (CountRegister), "Count Register", 0},
+ {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (PciDeviceId), "PCI Device ID", 0},
+ {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (PciVendorId), "PCI Vendor ID", 0},
+ {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciBus), "PCI Bus", 0},
+ {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciDevice), "PCI Device", 0},
+ {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciFunction), "PCI Function", 0},
+ {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (PciSegment), "PCI Segment", 0},
+ {ACPI_DMT_UINT16, ACPI_WDRT_OFFSET (MaxCount), "Max Count", 0},
+ {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (Units), "Counter Units", 0},
+ ACPI_DMT_TERMINATOR
};
diff --git a/compiler/Makefile b/compiler/Makefile
index 2bdd0d31d264..6b6ac5c5105d 100644
--- a/compiler/Makefile
+++ b/compiler/Makefile
@@ -32,6 +32,12 @@ SRCS= \
asltransform.c \
asltree.c \
aslutils.c \
+ dtcompile.c \
+ dtfield.c \
+ dtio.c \
+ dtsubtable.c \
+ dttable.c \
+ dtutils.c \
../common/getopt.c \
../utilities/utalloc.c \
../utilities/utcache.c \
@@ -119,7 +125,7 @@ SRCS= \
../osunixxf.c
NOMAN= YES
-CFLAGS+= -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include
+CFLAGS+= -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include -I../compiler
#YACC= yacc
YACC= bison
diff --git a/compiler/aslanalyze.c b/compiler/aslanalyze.c
index 19440c875c3b..9679d904c8cf 100644
--- a/compiler/aslanalyze.c
+++ b/compiler/aslanalyze.c
@@ -531,7 +531,7 @@ AnGetBtype (
if (!Node)
{
DbgPrint (ASL_DEBUG_OUTPUT,
- "No attached Nsnode: [%s] at line %d name [%s], ignoring typecheck\n",
+ "No attached Nsnode: [%s] at line %u name [%s], ignoring typecheck\n",
Op->Asl.ParseOpName, Op->Asl.LineNumber,
Op->Asl.ExternalName);
return ACPI_UINT32_MAX;
diff --git a/compiler/aslcompile.c b/compiler/aslcompile.c
index d6cb8adc7387..56663b571247 100644
--- a/compiler/aslcompile.c
+++ b/compiler/aslcompile.c
@@ -127,10 +127,6 @@ static void
CmFlushSourceCode (
void);
-static ACPI_STATUS
-FlCheckForAscii (
- ASL_FILE_INFO *FileInfo);
-
void
FlConsumeAnsiComment (
ASL_FILE_INFO *FileInfo,
@@ -433,7 +429,7 @@ FlConsumeNewComment (
*
******************************************************************************/
-static ACPI_STATUS
+ACPI_STATUS
FlCheckForAscii (
ASL_FILE_INFO *FileInfo)
{
@@ -543,31 +539,6 @@ CmDoCompile (
FullCompile = UtBeginEvent ("*** Total Compile time ***");
Event = UtBeginEvent ("Open input and output files");
-
- /* Open the required input and output files */
-
- Status = FlOpenInputFile (Gbl_Files[ASL_FILE_INPUT].Filename);
- if (ACPI_FAILURE (Status))
- {
- AePrintErrorLog (ASL_FILE_STDERR);
- return -1;
- }
-
- /* Check for 100% ASCII source file (comments are ignored) */
-
- Status = FlCheckForAscii (&Gbl_Files[ASL_FILE_INPUT]);
- if (ACPI_FAILURE (Status))
- {
- AePrintErrorLog (ASL_FILE_STDERR);
- return -1;
- }
-
- Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
- if (ACPI_FAILURE (Status))
- {
- AePrintErrorLog (ASL_FILE_STDERR);
- return -1;
- }
UtEndEvent (Event);
/* Build the parse tree */
@@ -888,19 +859,24 @@ CmCleanupAndExit (
if (Gbl_NsLookupCount)
{
- DbgPrint (ASL_DEBUG_OUTPUT, "\n\nMiscellaneous compile statistics\n\n");
- DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %d\n", "Total Namespace searches",
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "\n\nMiscellaneous compile statistics\n\n");
+
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%32s : %u\n", "Total Namespace searches",
Gbl_NsLookupCount);
- DbgPrint (ASL_DEBUG_OUTPUT, "%32s : %d usec\n", "Time per search",
- ((UINT32) (AslGbl_Events[AslGbl_NamespaceEvent].EndTime -
- AslGbl_Events[AslGbl_NamespaceEvent].StartTime) /
- 10) / Gbl_NsLookupCount);
- }
+ DbgPrint (ASL_DEBUG_OUTPUT,
+ "%32s : %u usec\n", "Time per search", ((UINT32)
+ (AslGbl_Events[AslGbl_NamespaceEvent].EndTime -
+ AslGbl_Events[AslGbl_NamespaceEvent].StartTime) / 10) /
+ Gbl_NsLookupCount);
+ }
if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
{
- printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT);
+ printf ("\nMaximum error count (%u) exceeded\n",
+ ASL_MAX_ERROR_COUNT);
}
UtDisplaySummary (ASL_FILE_STDOUT);
@@ -914,9 +890,15 @@ CmCleanupAndExit (
/* Delete AML file if there are errors */
- if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors))
+ if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) &&
+ Gbl_Files[ASL_FILE_AML_OUTPUT].Handle)
{
- remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename);
+ if (remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename))
+ {
+ printf ("%s: ",
+ Gbl_Files[ASL_FILE_AML_OUTPUT].Filename);
+ perror ("Could not delete AML file");
+ }
}
/*
@@ -928,8 +910,9 @@ CmCleanupAndExit (
{
if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename))
{
- printf ("Could not remove SRC file, %s\n",
+ printf ("%s: ",
Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
+ perror ("Could not delete SRC file");
}
}
}
diff --git a/compiler/aslcompiler.h b/compiler/aslcompiler.h
index 804713b00d97..02adaa4764f2 100644
--- a/compiler/aslcompiler.h
+++ b/compiler/aslcompiler.h
@@ -222,6 +222,10 @@ void
CmCleanupAndExit (
void);
+ACPI_STATUS
+FlCheckForAscii (
+ ASL_FILE_INFO *FileInfo);
+
/*
* aslanalyze - semantic analysis
@@ -426,6 +430,16 @@ CgGenerateAmlOutput (
/*
+ * aslfile
+ */
+void
+FlOpenFile (
+ UINT32 FileId,
+ char *Filename,
+ char *Mode);
+
+
+/*
* asllength - calculate/adjust AML package lengths
*/
ACPI_STATUS
@@ -1003,5 +1017,12 @@ RsDoWordBusNumberDescriptor (
ACPI_PARSE_OBJECT *Op,
UINT32 CurrentByteOffset);
+/*
+ * Entry to data table compiler subsystem
+ */
+ACPI_STATUS
+DtDoCompile(
+ void);
+
#endif /* __ASLCOMPILER_H */
diff --git a/compiler/aslcompiler.l b/compiler/aslcompiler.l
index dd0473c75717..574eb9037598 100644
--- a/compiler/aslcompiler.l
+++ b/compiler/aslcompiler.l
@@ -725,7 +725,7 @@ InsertLineBuffer (
* Warning if we have split a long source line.
* <Probably overkill>
*/
- sprintf (MsgBuffer, "Max %d", ASL_LINE_BUFFER_SIZE);
+ sprintf (MsgBuffer, "Max %u", ASL_LINE_BUFFER_SIZE);
AslCommonError (ASL_WARNING, ASL_MSG_LONG_LINE,
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_CurrentLineOffset, Gbl_CurrentColumn,
diff --git a/compiler/aslcompiler.y b/compiler/aslcompiler.y
index 3c12a3dfc344..a77dc1b1b9ce 100644
--- a/compiler/aslcompiler.y
+++ b/compiler/aslcompiler.y
@@ -3164,7 +3164,7 @@ AslLocalAllocate (unsigned int Size)
void *Mem;
- DbgPrint (ASL_PARSE_OUTPUT, "\nAslLocalAllocate: Expanding Stack to %d\n\n", Size);
+ DbgPrint (ASL_PARSE_OUTPUT, "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
Mem = ACPI_ALLOCATE_ZEROED (Size);
if (!Mem)
diff --git a/compiler/asldefine.h b/compiler/asldefine.h
index cff4ecf410e4..a146f77f01a1 100644
--- a/compiler/asldefine.h
+++ b/compiler/asldefine.h
@@ -184,6 +184,13 @@
#define FILE_SUFFIX_C_INCLUDE "h"
+/* Types for input files */
+
+#define ASL_INPUT_TYPE_BINARY 0
+#define ASL_INPUT_TYPE_ASCII_ASL 1
+#define ASL_INPUT_TYPE_ASCII_DATA 2
+
+
/* Misc */
#define ASL_EXTERNAL_METHOD 255
diff --git a/compiler/aslerror.c b/compiler/aslerror.c
index f90df3807f72..4b9a04fa57cf 100644
--- a/compiler/aslerror.c
+++ b/compiler/aslerror.c
@@ -525,7 +525,7 @@ AslCommonError (
Gbl_ExceptionCount[Level]++;
if (Gbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
{
- printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT);
+ printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT);
Gbl_SourceLine = 0;
Gbl_NextError = Gbl_ErrorLog;
diff --git a/compiler/aslfiles.c b/compiler/aslfiles.c
index 8f498a1b9df7..c9f87f7f1310 100644
--- a/compiler/aslfiles.c
+++ b/compiler/aslfiles.c
@@ -122,12 +122,6 @@
/* Local prototypes */
-static void
-FlOpenFile (
- UINT32 FileId,
- char *Filename,
- char *Mode);
-
FILE *
FlOpenIncludeWithPrefix (
char *PrefixDir,
@@ -212,7 +206,7 @@ FlFileError (
*
******************************************************************************/
-static void
+void
FlOpenFile (
UINT32 FileId,
char *Filename,
diff --git a/compiler/aslglobal.h b/compiler/aslglobal.h
index 85bb3e2d9e6b..6df7466af333 100644
--- a/compiler/aslglobal.h
+++ b/compiler/aslglobal.h
@@ -145,7 +145,7 @@ extern const ASL_MAPPING_ENTRY AslKeywordMapping[];
extern char *AslCompilertext;
extern char HexLookup[];
-#define ASL_LINE_BUFFER_SIZE 512
+#define ASL_LINE_BUFFER_SIZE 1024
#define ASL_MSG_BUFFER_SIZE 4096
#define HEX_TABLE_LINE_SIZE 8
#define HEX_LISTING_LINE_SIZE 8
@@ -196,6 +196,8 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFl
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayOptimizations, FALSE);
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_WarningLevel, ASL_WARNING);
+ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseOriginalCompilerId, FALSE);
+ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DataTableCompilerAvailable, FALSE);
#define HEX_OUTPUT_NONE 0
@@ -223,6 +225,7 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HasIncludeFiles, FALSE)
/* Statistics */
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_InputByteCount, 0);
+ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_InputFieldCount, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NsLookupCount, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalKeywords, 0);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalNamedObjects, 0);
@@ -247,6 +250,8 @@ ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheLast, NULL);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
ASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode;
+ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_FileType, 0);
+ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Signature, NULL);
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0);
diff --git a/compiler/asllookup.c b/compiler/asllookup.c
index 2c1253d2d4b6..7cc723240603 100644
--- a/compiler/asllookup.c
+++ b/compiler/asllookup.c
@@ -216,7 +216,7 @@ LsDoOneNamespaceObject (
Gbl_NumNamespaceObjects++;
- FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5d [%d] %*s %4.4s - %s",
+ FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%5u [%u] %*s %4.4s - %s",
Gbl_NumNamespaceObjects, Level, (Level * 3), " ",
&Node->Name,
AcpiUtGetTypeName (Node->Type));
@@ -1245,7 +1245,7 @@ LkNamespaceLocateBegin (
*/
if (PassedArgs != Node->Value)
{
- sprintf (MsgBuffer, "%s requires %d", Op->Asl.ExternalName,
+ sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName,
Node->Value);
if (PassedArgs < Node->Value)
diff --git a/compiler/aslmain.c b/compiler/aslmain.c
index 42127c096185..406f67b2a9fa 100644
--- a/compiler/aslmain.c
+++ b/compiler/aslmain.c
@@ -167,7 +167,7 @@ AslDoResponseFile (
#define ASL_TOKEN_SEPARATORS " \t\n"
-#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:v:w:x:"
+#define ASL_SUPPORTED_OPTIONS "@:2b:c:d^e:fgh^i^I:l^no:p:r:s:t:v:w:x:yz"
/*******************************************************************************
@@ -268,6 +268,8 @@ HelpMessage (
printf (" -n Parse only, no output generation\n");
printf (" -ot Display compile times\n");
printf (" -x<level> Set debug level for trace output\n");
+ printf (" -y Temporary: Enable data table compiler\n");
+ printf (" -z Do not insert new compiler ID for DataTables\n");
}
@@ -831,6 +833,18 @@ AslDoOptions (
break;
+ case 'y':
+
+ Gbl_DataTableCompilerAvailable = TRUE;
+ break;
+
+
+ case 'z':
+
+ Gbl_UseOriginalCompilerId = TRUE;
+ break;
+
+
default:
return (-1);
diff --git a/compiler/aslopt.c b/compiler/aslopt.c
index 6f0b756c0f81..19bbb1237d07 100644
--- a/compiler/aslopt.c
+++ b/compiler/aslopt.c
@@ -339,7 +339,7 @@ OptBuildShortestPath (
}
}
- ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " COMMON: %d",
+ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " COMMON: %u",
NumCommonSegments));
/* There must be at least 1 common NameSeg in order to optimize */
diff --git a/compiler/aslpredef.c b/compiler/aslpredef.c
index ae1b77381480..49056edd180e 100644
--- a/compiler/aslpredef.c
+++ b/compiler/aslpredef.c
@@ -251,7 +251,7 @@ ApCheckForPredefinedMethod (
if (MethodInfo->NumArguments != 0)
{
- sprintf (MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0);
+ sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0);
AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
MsgBuffer);
@@ -274,7 +274,7 @@ ApCheckForPredefinedMethod (
if ((MethodInfo->NumArguments != RequiredArgsCurrent) &&
(MethodInfo->NumArguments != RequiredArgsOld))
{
- sprintf (MsgBuffer, "%4.4s requires %d",
+ sprintf (MsgBuffer, "%4.4s requires %u",
PredefinedNames[Index].Info.Name, RequiredArgsCurrent);
if (MethodInfo->NumArguments > RequiredArgsCurrent)
@@ -731,7 +731,7 @@ ApDisplayReservedNames (
ThisName = PredefinedNames;
while (ThisName->Info.Name[0])
{
- printf ("%4.4s Requires %d arguments, ",
+ printf ("%4.4s Requires %u arguments, ",
ThisName->Info.Name, ThisName->Info.ParamCount & 0x0F);
if (ThisName->Info.ExpectedBtypes)
diff --git a/compiler/aslstartup.c b/compiler/aslstartup.c
index ea61c9e392a4..2588ccbdf8dd 100644
--- a/compiler/aslstartup.c
+++ b/compiler/aslstartup.c
@@ -140,6 +140,10 @@ AsDoWildcard (
char *DirectoryPathname,
char *FileSpecifier);
+UINT8
+AslDetectSourceFileType (
+ ASL_FILE_INFO *Info);
+
/*******************************************************************************
*
@@ -167,10 +171,13 @@ AslInitializeGlobals (
Gbl_CurrentLineNumber = 1;
Gbl_LogicalLineNumber = 1;
Gbl_CurrentLineOffset = 0;
+ Gbl_InputFieldCount = 0;
Gbl_LineBufPtr = Gbl_CurrentLineBuffer;
Gbl_ErrorLog = NULL;
Gbl_NextError = NULL;
+ Gbl_Signature = NULL;
+ Gbl_FileType = 0;
AslGbl_NextEvent = 0;
for (i = 0; i < ASL_NUM_REPORT_LEVELS; i++)
@@ -179,6 +186,7 @@ AslInitializeGlobals (
}
Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = NULL;
+ Gbl_Files[ASL_FILE_AML_OUTPUT].Handle = NULL;
}
@@ -259,6 +267,77 @@ AsDoWildcard (
/*******************************************************************************
*
+ * FUNCTION: AslDetectSourceFileType
+ *
+ * PARAMETERS: Info - Name/Handle for the file (must be open)
+ *
+ * RETURN: File Type
+ *
+ * DESCRIPTION: Determine the type of the input file. Either binary (contains
+ * non-ASCII characters), ASL file, or an ACPI Data Table file.
+ *
+ ******************************************************************************/
+
+UINT8
+AslDetectSourceFileType (
+ ASL_FILE_INFO *Info)
+{
+ char *FileChar;
+ UINT8 Type;
+ ACPI_STATUS Status;
+
+
+ /* Check for 100% ASCII source file (comments are ignored) */
+
+ Status = FlCheckForAscii (Info);
+ if (ACPI_FAILURE (Status))
+ {
+ printf ("Non-ascii input file - %s\n", Info->Filename);
+ Type = ASL_INPUT_TYPE_BINARY;
+ goto Cleanup;
+ }
+
+ /*
+ * File is ASCII. Determine if this is an ASL file or an ACPI data
+ * table file.
+ */
+ while (fgets (Gbl_CurrentLineBuffer, ASL_LINE_BUFFER_SIZE, Info->Handle))
+ {
+ /* Uppercase the buffer for caseless compare */
+
+ FileChar = Gbl_CurrentLineBuffer;
+ while (*FileChar)
+ {
+ *FileChar = (char) toupper ((int) *FileChar);
+ FileChar++;
+ }
+
+ /* Presence of "DefinitionBlock" indicates actual ASL code */
+
+ if (strstr (Gbl_CurrentLineBuffer, "DEFINITIONBLOCK"))
+ {
+ /* Appears to be an ASL file */
+
+ Type = ASL_INPUT_TYPE_ASCII_ASL;
+ goto Cleanup;
+ }
+ }
+
+ /* Not an ASL source file, default to a data table source file */
+
+ Type = ASL_INPUT_TYPE_ASCII_DATA;
+
+Cleanup:
+
+ /* Must seek back to the start of the file */
+
+ fseek (Info->Handle, 0, SEEK_SET);
+ return (Type);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AslDoOneFile
*
* PARAMETERS: Filename - Name of the file
@@ -287,7 +366,7 @@ AslDoOneFile (
*/
if (Gbl_DisasmFlag || Gbl_GetAllTables)
{
- /* ACPI CA subsystem initialization */
+ /* ACPICA subsystem initialization */
Status = AdInitialize ();
if (ACPI_FAILURE (Status))
@@ -330,23 +409,89 @@ AslDoOneFile (
AcpiOsPrintf ("\nCompiling \"%s\"\n",
Gbl_Files[ASL_FILE_INPUT].Filename);
}
+ else
+ {
+ Gbl_Files[ASL_FILE_INPUT].Filename = NULL;
+ return (AE_OK);
+ }
}
/*
- * ASL Compilation (Optional)
+ * Open the input file. Here, this should be an ASCII source file,
+ * either an ASL file or a Data Table file
+ */
+ Status = FlOpenInputFile (Gbl_Files[ASL_FILE_INPUT].Filename);
+ if (ACPI_FAILURE (Status))
+ {
+ AePrintErrorLog (ASL_FILE_STDERR);
+ return (AE_ERROR);
+ }
+
+ /* Determine input file type */
+
+ Gbl_FileType = AslDetectSourceFileType (&Gbl_Files[ASL_FILE_INPUT]);
+ if (Gbl_FileType == ASL_INPUT_TYPE_BINARY)
+ {
+ return (AE_ERROR);
+ }
+
+ /*
+ * If -p not specified, we will use the input filename as the
+ * output filename prefix
+ */
+ if (Gbl_UseDefaultAmlFilename)
+ {
+ Gbl_OutputFilenamePrefix = Gbl_Files[ASL_FILE_INPUT].Filename;
+ }
+
+ /* Open the optional output files (listings, etc.) */
+
+ Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
+ if (ACPI_FAILURE (Status))
+ {
+ AePrintErrorLog (ASL_FILE_STDERR);
+ return (AE_ERROR);
+ }
+
+ /*
+ * Compilation of ASL source versus DataTable source uses different
+ * compiler subsystems
*/
- if (Gbl_DoCompile)
+ switch (Gbl_FileType)
{
+ /*
+ * Data Table Compilation
+ */
+ case ASL_INPUT_TYPE_ASCII_DATA:
+
/*
- * If -p not specified, we will use the input filename as the
- * output filename prefix
+ * Require use of command-line option to enable the data table
+ * compiler -- for now, until development of the compiler is
+ * complete.
*/
- if (Gbl_UseDefaultAmlFilename)
+ if (!Gbl_DataTableCompilerAvailable)
+ {
+ printf ("Data Table Compiler is not available yet\n");
+ return (AE_SUPPORT);
+ }
+
+ Status = DtDoCompile ();
+
+ if (Gbl_Signature)
{
- Gbl_OutputFilenamePrefix = Gbl_Files[ASL_FILE_INPUT].Filename;
+ ACPI_FREE (Gbl_Signature);
+ Gbl_Signature = NULL;
}
+ AeClearErrorLog ();
+ return (Status);
+
+ /*
+ * ASL Compilation (Optional)
+ */
+ case ASL_INPUT_TYPE_ASCII_ASL:
- /* ACPI CA subsystem initialization (Must be re-initialized) */
+
+ /* ACPICA subsystem initialization */
Status = AdInitialize ();
if (ACPI_FAILURE (Status))
@@ -367,9 +512,17 @@ AslDoOneFile (
}
AeClearErrorLog ();
- }
+ return (AE_OK);
+
+ case ASL_INPUT_TYPE_BINARY:
- return (AE_OK);
+ AePrintErrorLog (ASL_FILE_STDERR);
+ return (AE_ERROR);
+
+ default:
+ printf ("Unknown file type %X\n", Gbl_FileType);
+ return (AE_ERROR);
+ }
}
@@ -391,7 +544,7 @@ ACPI_STATUS
AslDoOnePathname (
char *Pathname)
{
- ACPI_STATUS Status;
+ ACPI_STATUS Status = AE_OK;
char **FileList;
char *Filename;
char *FullPathname;
@@ -427,11 +580,9 @@ AslDoOnePathname (
Gbl_OutputFilenamePrefix = FullPathname;
}
- Status = AslDoOneFile (FullPathname);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
+ /* Save status from all compiles */
+
+ Status |= AslDoOneFile (FullPathname);
ACPI_FREE (FullPathname);
ACPI_FREE (*FileList);
@@ -441,6 +592,6 @@ AslDoOnePathname (
ACPI_FREE (Gbl_DirectoryPath);
ACPI_FREE (Filename);
- return (AE_OK);
+ return (Status);
}
diff --git a/compiler/asltransform.c b/compiler/asltransform.c
index 5327a907231c..5613c349794a 100644
--- a/compiler/asltransform.c
+++ b/compiler/asltransform.c
@@ -674,7 +674,7 @@ TrDoSwitch (
{
/* Unknown peer opcode */
- AcpiOsPrintf ("Unknown parse opcode for switch statement: %s (%d)\n",
+ AcpiOsPrintf ("Unknown parse opcode for switch statement: %s (%u)\n",
Next->Asl.ParseOpName, Next->Asl.ParseOpcode);
}
}
diff --git a/compiler/asltree.c b/compiler/asltree.c
index 1167f51bec71..e1af074598df 100644
--- a/compiler/asltree.c
+++ b/compiler/asltree.c
@@ -466,7 +466,7 @@ TrCreateLeafNode (
Op = TrAllocateNode (ParseOpcode);
DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateLeafNode Ln/Col %d/%d NewNode %p Op %s\n\n",
+ "\nCreateLeafNode Ln/Col %u/%u NewNode %p Op %s\n\n",
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode));
return Op;
@@ -498,7 +498,7 @@ TrCreateValuedLeafNode (
Op = TrAllocateNode (ParseOpcode);
DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateValuedLeafNode Ln/Col %d/%d NewNode %p Op %s Value %8.8X%8.8X ",
+ "\nCreateValuedLeafNode Ln/Col %u/%u NewNode %p Op %s Value %8.8X%8.8X ",
Op->Asl.LineNumber, Op->Asl.Column, Op, UtGetOpName(ParseOpcode),
ACPI_FORMAT_UINT64 (Value));
Op->Asl.Value.Integer = Value;
@@ -575,7 +575,7 @@ TrCreateNode (
Op = TrAllocateNode (ParseOpcode);
DbgPrint (ASL_PARSE_OUTPUT,
- "\nCreateNode Ln/Col %d/%d NewParent %p Child %d Op %s ",
+ "\nCreateNode Ln/Col %u/%u NewParent %p Child %u Op %s ",
Op->Asl.LineNumber, Op->Asl.Column, Op, NumChildren, UtGetOpName(ParseOpcode));
/* Some extra debug output based on the parse opcode */
@@ -694,7 +694,7 @@ TrLinkChildren (
TrSetEndLineNumber (Op);
DbgPrint (ASL_PARSE_OUTPUT,
- "\nLinkChildren Line [%d to %d] NewParent %p Child %d Op %s ",
+ "\nLinkChildren Line [%u to %u] NewParent %p Child %u Op %s ",
Op->Asl.LineNumber, Op->Asl.EndLine,
Op, NumChildren, UtGetOpName(Op->Asl.ParseOpcode));
@@ -882,7 +882,7 @@ TrLinkPeerNodes (
DbgPrint (ASL_PARSE_OUTPUT,
- "\nLinkPeerNodes: (%d) ", NumPeers);
+ "\nLinkPeerNodes: (%u) ", NumPeers);
va_start (ap, NumPeers);
This = va_arg (ap, ACPI_PARSE_OBJECT *);
@@ -893,7 +893,7 @@ TrLinkPeerNodes (
*/
for (i = 0; i < (NumPeers -1); i++)
{
- DbgPrint (ASL_PARSE_OUTPUT, "%d=%p ", (i+1), This);
+ DbgPrint (ASL_PARSE_OUTPUT, "%u=%p ", (i+1), This);
while (This->Asl.Next)
{
diff --git a/compiler/asltypes.h b/compiler/asltypes.h
index 815763499d51..f4e5f4625258 100644
--- a/compiler/asltypes.h
+++ b/compiler/asltypes.h
@@ -279,11 +279,17 @@ typedef struct asl_listing_node
/* Callback interface for a parse tree walk */
+/*
+ * TBD - another copy of this is in adisasm.h, fix
+ */
+#ifndef ASL_WALK_CALLBACK_DEFINED
typedef
ACPI_STATUS (*ASL_WALK_CALLBACK) (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context);
+#define ASL_WALK_CALLBACK_DEFINED
+#endif
typedef struct asl_event_info
@@ -429,14 +435,24 @@ typedef enum
ASL_MSG_INVALID_GRANULARITY,
ASL_MSG_INVALID_GRAN_FIXED,
ASL_MSG_INVALID_ACCESS_SIZE,
- ASL_MSG_INVALID_ADDR_FLAGS
+ ASL_MSG_INVALID_ADDR_FLAGS,
+ ASL_MSG_INVALID_FIELD_NAME,
+ ASL_MSG_INTEGER_SIZE,
+ ASL_MSG_INVALID_HEX_INTEGER,
+ ASL_MSG_BUFFER_ELEMENT,
+ ASL_MSG_RESERVED_VALUE,
+ ASL_MSG_FLAG_VALUE,
+ ASL_MSG_ZERO_VALUE,
+ ASL_MSG_UNKNOWN_TABLE,
+ ASL_MSG_UNKNOWN_SUBTABLE,
+ ASL_MSG_OEM_TABLE
} ASL_MESSAGE_IDS;
#ifdef ASL_EXCEPTIONS
char *AslMessages [] = {
-/* The zeroth message is resesrved */ "",
+/* The zeroth message is reserved */ "",
/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric",
/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator",
/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments",
@@ -558,7 +574,20 @@ char *AslMessages [] = {
/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one",
/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max",
/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)",
-/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags"
+/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags",
+
+/* These messages are used by the data table compiler only */
+
+/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name",
+/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target",
+/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant",
+/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list",
+/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero",
+/* ASL_MSG_FLAG_VALUE */ "Flag value is too large",
+/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero",
+/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature",
+/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type",
+/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents"
};
diff --git a/compiler/aslutils.c b/compiler/aslutils.c
index 01db90a3066c..e8d61babc785 100644
--- a/compiler/aslutils.c
+++ b/compiler/aslutils.c
@@ -214,6 +214,8 @@ UtLocalCalloc (
Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
Gbl_InputByteCount, Gbl_CurrentColumn,
Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
+
+ CmCleanupAndExit ();
exit (1);
}
@@ -523,33 +525,57 @@ UtDisplaySummary (
CompilerId, (UINT32) ACPI_CA_VERSION, __DATE__);
}
- /* Input/Output summary */
-
- FlPrintFile (FileId,
- "ASL Input: %s - %d lines, %d bytes, %d keywords\n",
- Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber,
- Gbl_InputByteCount, TotalKeywords);
-
- /* AML summary */
+ if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
+ {
+ FlPrintFile (FileId,
+ "Table Input: %s - %u lines, %u bytes, %u fields\n",
+ Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber,
+ Gbl_InputByteCount, Gbl_InputFieldCount);
- if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors))
+ if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors))
+ {
+ FlPrintFile (FileId,
+ "Binary Output: %s - %u bytes\n\n",
+ Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength);
+ }
+ }
+ else
{
+ /* Input/Output summary */
+
FlPrintFile (FileId,
- "AML Output: %s - %d bytes, %d named objects, %d executable opcodes\n\n",
- Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength,
- TotalNamedObjects, TotalExecutableOpcodes);
+ "ASL Input: %s - %u lines, %u bytes, %u keywords\n",
+ Gbl_Files[ASL_FILE_INPUT].Filename, Gbl_CurrentLineNumber,
+ Gbl_InputByteCount, TotalKeywords);
+
+ /* AML summary */
+
+ if ((Gbl_ExceptionCount[ASL_ERROR] == 0) || (Gbl_IgnoreErrors))
+ {
+ FlPrintFile (FileId,
+ "AML Output: %s - %u bytes, %u named objects, %u executable opcodes\n\n",
+ Gbl_Files[ASL_FILE_AML_OUTPUT].Filename, Gbl_TableLength,
+ TotalNamedObjects, TotalExecutableOpcodes);
+ }
}
/* Error summary */
FlPrintFile (FileId,
- "Compilation complete. %d Errors, %d Warnings, %d Remarks, %d Optimizations\n",
+ "Compilation complete. %u Errors, %u Warnings, %u Remarks",
Gbl_ExceptionCount[ASL_ERROR],
Gbl_ExceptionCount[ASL_WARNING] +
Gbl_ExceptionCount[ASL_WARNING2] +
Gbl_ExceptionCount[ASL_WARNING3],
- Gbl_ExceptionCount[ASL_REMARK],
- Gbl_ExceptionCount[ASL_OPTIMIZATION]);
+ Gbl_ExceptionCount[ASL_REMARK]);
+
+ if (Gbl_FileType != ASL_INPUT_TYPE_ASCII_DATA)
+ {
+ FlPrintFile (FileId,
+ ", %u Optimizations", Gbl_ExceptionCount[ASL_OPTIMIZATION]);
+ }
+
+ FlPrintFile (FileId, "\n");
}
diff --git a/compiler/dtcompile.c b/compiler/dtcompile.c
new file mode 100644
index 000000000000..351d9cc83f35
--- /dev/null
+++ b/compiler/dtcompile.c
@@ -0,0 +1,614 @@
+/******************************************************************************
+ *
+ * Module Name: dtcompile.c - Front-end for data table compiler
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2010, 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.
+ *
+ *****************************************************************************/
+
+#define __DTCOMPILE_C__
+#define _DECLARE_DT_GLOBALS
+
+#include "aslcompiler.h"
+#include "dtcompiler.h"
+
+#define _COMPONENT DT_COMPILER
+ ACPI_MODULE_NAME ("dtcompile")
+
+static char VersionString[9];
+
+
+/* Local prototypes */
+
+static void
+DtInitialize (
+ void);
+
+static ACPI_STATUS
+DtCompileDataTable (
+ DT_FIELD **Field);
+
+static void
+DtInsertCompilerIds (
+ DT_FIELD *FieldList);
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtDoCompile
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Main entry point for the data table compiler.
+ *
+ * Note: Assumes Gbl_Files[ASL_FILE_INPUT] is initialized and the file is
+ * open at seek offset zero.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtDoCompile (
+ void)
+{
+ ACPI_STATUS Status;
+ UINT8 Event;
+ DT_FIELD *FieldList;
+
+
+ /* Initialize globals */
+
+ DtInitialize ();
+
+ /*
+ * Scan the input file (file is already open) and
+ * build the parse tree
+ */
+ Event = UtBeginEvent ("Scan and parse input file");
+ FieldList = DtScanFile (Gbl_Files[ASL_FILE_INPUT].Handle);
+ UtEndEvent (Event);
+
+ /* Did the parse tree get successfully constructed? */
+
+ if (!FieldList)
+ {
+ /* TBD: temporary error message. Msgs should come from function above */
+
+ DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL,
+ "Could not parse input file");
+ return (AE_ERROR);
+ }
+
+ Event = UtBeginEvent ("Compile parse tree");
+
+ /*
+ * Compile the parse tree
+ */
+ Status = DtCompileDataTable (&FieldList);
+ UtEndEvent (Event);
+
+ DtFreeFieldList ();
+
+ if (ACPI_FAILURE (Status))
+ {
+ /* TBD: temporary error message. Msgs should come from function above */
+
+ DtError (ASL_ERROR, ASL_MSG_SYNTAX, NULL,
+ "Could not compile input file");
+ goto CleanupAndExit;
+ }
+
+ /* Create/open the binary output file */
+
+ Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = NULL;
+ Status = FlOpenAmlOutputFile (Gbl_OutputFilenamePrefix);
+ if (ACPI_FAILURE (Status))
+ {
+ goto CleanupAndExit;
+ }
+
+ /* Write the binary, then the optional hex file */
+
+ DtOutputBinary (Gbl_RootTable);
+ LsDoHexOutput ();
+
+CleanupAndExit:
+
+ CmCleanupAndExit ();
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtInitialize
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Initialize data table compiler globals. Enables multiple
+ * compiles per invocation.
+ *
+ *****************************************************************************/
+
+static void
+DtInitialize (
+ void)
+{
+
+ Gbl_FieldList = NULL;
+ Gbl_RootTable = NULL;
+ Gbl_SubtableStack = NULL;
+
+ sprintf (VersionString, "%X", (UINT32) ACPI_CA_VERSION);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtInsertCompilerIds
+ *
+ * PARAMETERS: FieldList - Current field list pointer
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Insert the IDs (Name, Version) of the current compiler into
+ * the original ACPI table header.
+ *
+ *****************************************************************************/
+
+static void
+DtInsertCompilerIds (
+ DT_FIELD *FieldList)
+{
+ DT_FIELD *Next;
+ UINT32 i;
+
+
+ /*
+ * Don't insert current compiler ID if requested. Used for compiler
+ * debug/validation only.
+ */
+ if (Gbl_UseOriginalCompilerId)
+ {
+ return;
+ }
+
+ /* Walk to the Compiler fields at the end of the header */
+
+ Next = FieldList;
+ for (i = 0; i < 7; i++)
+ {
+ Next = Next->Next;
+ }
+
+ Next->Value = CompilerCreatorId;
+ Next->Flags = DT_FIELD_NOT_ALLOCATED;
+
+ Next = Next->Next;
+ Next->Value = VersionString;
+ Next->Flags = DT_FIELD_NOT_ALLOCATED;
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileDataTable
+ *
+ * PARAMETERS: FieldList - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Entry point to compile one data table
+ *
+ *****************************************************************************/
+
+static ACPI_STATUS
+DtCompileDataTable (
+ DT_FIELD **FieldList)
+{
+ ACPI_DMTABLE_DATA *TableData;
+ DT_SUBTABLE *Subtable;
+ char *Signature;
+ ACPI_TABLE_HEADER *AcpiTableHeader;
+ ACPI_STATUS Status;
+
+
+ /* Verify that we at least have a table signature and save it */
+
+ Signature = DtGetFieldValue (*FieldList, "Signature");
+ if (!Signature)
+ {
+ DtError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, *FieldList, NULL);
+ return (AE_ERROR);
+ }
+
+ Gbl_Signature = UtLocalCalloc (ACPI_STRLEN (Signature) + 1);
+ strcpy (Gbl_Signature, Signature);
+
+ /*
+ * Handle tables that don't use the common ACPI table header structure.
+ * Currently, these are the FACS and RSDP. Also check for an OEMx table,
+ * these tables have user-defined contents.
+ */
+ if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS))
+ {
+ Status = DtCompileFacs (FieldList);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtSetTableLength ();
+ return (Status);
+ }
+ else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_RSDP))
+ {
+ Status = DtCompileRsdp (FieldList);
+ return (Status);
+ }
+ else if (!ACPI_STRNCMP (Signature, "OEM", 3))
+ {
+ DtFatal (ASL_MSG_OEM_TABLE, *FieldList, Signature);
+ return (AE_ERROR);
+ }
+
+ /*
+ * All other tables must use the common ACPI table header. Insert the
+ * current iASL IDs (name, version), and compile the header now.
+ */
+ DtInsertCompilerIds (*FieldList);
+
+ Status = DtCompileTable (FieldList, AcpiDmTableInfoHeader,
+ &Gbl_RootTable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtPushSubtable (Gbl_RootTable);
+
+ /* Match signature and dispatch appropriately */
+
+ TableData = AcpiDmGetTableData (Signature);
+ if (!TableData)
+ {
+ DtFatal (ASL_MSG_UNKNOWN_TABLE, *FieldList, Signature);
+ return (AE_ERROR);
+ }
+
+ if (TableData->CmTableHandler)
+ {
+ /* Complex table, has a handler */
+
+ Status = TableData->CmTableHandler ((void **) FieldList);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ }
+ else if (TableData->TableInfo)
+ {
+ /* Simple table, just walk the info table */
+
+ Subtable = NULL;
+ Status = DtCompileTable (FieldList, TableData->TableInfo,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (Gbl_RootTable, Subtable);
+ DtPopSubtable ();
+ }
+ else
+ {
+ DtFatal (ASL_MSG_COMPILER_INTERNAL, *FieldList,
+ "Missing table dispatch info");
+ return (AE_ERROR);
+ }
+
+ /* Set the final table length and then the checksum */
+
+ DtSetTableLength ();
+ AcpiTableHeader = ACPI_CAST_PTR (
+ ACPI_TABLE_HEADER, Gbl_RootTable->Buffer);
+ DtSetTableChecksum (&AcpiTableHeader->Checksum);
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileTable
+ *
+ * PARAMETERS: Field - Current field list pointer
+ * Info - Info table for this ACPI table
+ * RetSubtable - Compile result of table
+ * Required - If this subtable must exist
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile a subtable
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileTable (
+ DT_FIELD **Field,
+ ACPI_DMTABLE_INFO *Info,
+ DT_SUBTABLE **RetSubtable,
+ BOOLEAN Required)
+{
+ DT_FIELD *LocalField;
+ UINT32 Length;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *InlineSubtable;
+ UINT32 FieldLength = 0;
+ UINT8 FieldType;
+ UINT8 *Buffer;
+ UINT8 *FlagBuffer = NULL;
+ UINT32 FlagBitPosition = 0;
+ ACPI_STATUS Status;
+
+
+ if (!Field || !*Field)
+ {
+ return (AE_BAD_PARAMETER);
+ }
+
+ Length = DtGetSubtableLength (*Field, Info);
+ Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
+
+ Subtable->Buffer = UtLocalCalloc (Length);
+ Subtable->Length = Length;
+ Subtable->TotalLength = Length;
+ Buffer = Subtable->Buffer;
+
+ LocalField = *Field;
+
+ /*
+ * Main loop walks the info table for this ACPI table or subtable
+ */
+ for (; Info->Name; Info++)
+ {
+ if (!LocalField)
+ {
+ sprintf (MsgBuffer, "Found NULL field - Field name \"%s\" needed",
+ Info->Name);
+ DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer);
+ Status = AE_BAD_DATA;
+ goto Error;
+ }
+
+ /* Does input field name match what is expected? */
+
+ if (ACPI_STRCMP (LocalField->Name, Info->Name))
+ {
+ /*
+ * If Required = TRUE, the subtable must exist.
+ * If Required = FALSE, the subtable is optional
+ * (For example, AcpiDmTableInfoDmarScope in DMAR table is
+ * optional)
+ */
+ if (Required)
+ {
+ sprintf (MsgBuffer, "Expected \"%s\"", Info->Name);
+ DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
+ LocalField, MsgBuffer);
+ }
+ else
+ {
+ Status = AE_NOT_FOUND;
+ goto Error;
+ }
+ }
+
+ FieldLength = DtGetFieldLength (LocalField, Info);
+ FieldType = DtGetFieldType (Info);
+ Gbl_InputFieldCount++;
+
+ switch (FieldType)
+ {
+ case DT_FIELD_TYPE_FLAGS_INTEGER:
+ /*
+ * Start of the definition of a flags field.
+ * This master flags integer starts at value zero, in preparation
+ * to compile and insert the flag fields from the individual bits
+ */
+ LocalField = LocalField->Next;
+ *Field = LocalField;
+
+ FlagBitPosition = 0;
+ FlagBuffer = Buffer;
+ break;
+
+ case DT_FIELD_TYPE_FLAG:
+
+ /* Individual Flag field, can be multiple bits */
+
+ if (FlagBuffer)
+ {
+ FlagBitPosition = DtCompileFlag (FlagBuffer,
+ LocalField, Info, FlagBitPosition);
+ }
+ else
+ {
+ /* TBD - this is an internal error */
+ }
+
+ LocalField = LocalField->Next;
+ *Field = LocalField;
+ break;
+
+ case DT_FIELD_TYPE_INLINE_SUBTABLE:
+ /*
+ * Recursion (one level max): compile GAS (Generic Address)
+ * or Notify in-line subtable
+ */
+ LocalField = LocalField->Next;
+ *Field = LocalField;
+
+ if (Info->Opcode == ACPI_DMT_GAS)
+ {
+ Status = DtCompileTable (Field, AcpiDmTableInfoGas,
+ &InlineSubtable, TRUE);
+ }
+ else
+ {
+ Status = DtCompileTable (Field, AcpiDmTableInfoHestNotify,
+ &InlineSubtable, TRUE);
+ }
+
+ if (ACPI_FAILURE (Status))
+ {
+ goto Error;
+ }
+
+ ACPI_MEMCPY (Buffer, InlineSubtable->Buffer, FieldLength);
+ ACPI_FREE (InlineSubtable->Buffer);
+ ACPI_FREE (InlineSubtable);
+ LocalField = *Field;
+ break;
+
+ default:
+
+ /* Normal case for most field types (Integer, String, etc.) */
+
+ DtCompileOneField (Buffer, LocalField,
+ FieldLength, FieldType, Info->Flags);
+ LocalField = LocalField->Next;
+
+ if (Info->Flags & DT_LENGTH)
+ {
+ /* Field is an Integer that will contain a subtable length */
+
+ Subtable->LengthField = Buffer;
+ Subtable->SizeOfLengthField = FieldLength;
+ }
+ break;
+ }
+
+ Buffer += FieldLength;
+ }
+
+ *Field = LocalField;
+ *RetSubtable = Subtable;
+ return (AE_OK);
+
+Error:
+ ACPI_FREE (Subtable->Buffer);
+ ACPI_FREE (Subtable);
+ return (Status);
+}
diff --git a/compiler/dtcompiler.h b/compiler/dtcompiler.h
new file mode 100644
index 000000000000..75d641190882
--- /dev/null
+++ b/compiler/dtcompiler.h
@@ -0,0 +1,455 @@
+/******************************************************************************
+ *
+ * Module Name: dtcompiler.h - header for data table compiler
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2010, 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.
+ *
+ *****************************************************************************/
+
+#define __DTCOMPILER_H__
+
+#ifndef _DTCOMPILER
+#define _DTCOMPILER
+
+#include <stdio.h>
+#include "acdisasm.h"
+
+
+#undef DT_EXTERN
+
+#ifdef _DECLARE_DT_GLOBALS
+#define DT_EXTERN
+#define DT_INIT_GLOBAL(a,b) (a)=(b)
+#else
+#define DT_EXTERN extern
+#define DT_INIT_GLOBAL(a,b) (a)
+#endif
+
+
+/* Types for individual fields (one per input line) */
+
+#define DT_FIELD_TYPE_STRING 0
+#define DT_FIELD_TYPE_INTEGER 1
+#define DT_FIELD_TYPE_BUFFER 2
+#define DT_FIELD_TYPE_PCI_PATH 3
+#define DT_FIELD_TYPE_FLAG 4
+#define DT_FIELD_TYPE_FLAGS_INTEGER 5
+#define DT_FIELD_TYPE_INLINE_SUBTABLE 6
+
+
+/*
+ * Structure used for each individual field within an ACPI table
+ */
+typedef struct dt_field
+{
+ char *Name;
+ char *Value;
+ struct dt_field *Next;
+ UINT32 Line; /* Line number for this field */
+ UINT32 ByteOffset; /* Offset in source file for field */
+ UINT32 NameColumn; /* Start column for field name */
+ UINT32 Column; /* Start column for field value */
+ UINT8 Flags;
+
+} DT_FIELD;
+
+/* Flags for above */
+
+#define DT_FIELD_NOT_ALLOCATED 1
+
+
+/*
+ * Structure used for individual subtables within an ACPI table
+ */
+typedef struct dt_subtable
+{
+ struct dt_subtable *Parent;
+ struct dt_subtable *Child;
+ struct dt_subtable *Peer;
+ struct dt_subtable *StackTop;
+ UINT8 *Buffer;
+ UINT8 *LengthField;
+ UINT32 Length;
+ UINT32 TotalLength;
+ UINT32 SizeOfLengthField;
+ UINT8 Flags;
+
+} DT_SUBTABLE;
+
+
+/*
+ * Globals
+ */
+
+/* List of all field names and values from the input source */
+
+DT_EXTERN DT_FIELD DT_INIT_GLOBAL (*Gbl_FieldList, NULL);
+
+/* List of all compiled tables and subtables */
+
+DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_RootTable, NULL);
+
+/* Stack for subtables */
+
+DT_EXTERN DT_SUBTABLE DT_INIT_GLOBAL (*Gbl_SubtableStack, NULL);
+
+
+/* dtcompiler - main module */
+
+ACPI_STATUS
+DtCompileTable (
+ DT_FIELD **Field,
+ ACPI_DMTABLE_INFO *Info,
+ DT_SUBTABLE **RetSubtable,
+ BOOLEAN Required);
+
+
+/* dtio - binary and text input/output */
+
+DT_FIELD *
+DtScanFile (
+ FILE *Handle);
+
+void
+DtOutputBinary (
+ DT_SUBTABLE *RootTable);
+
+
+/* dtsubtable - compile subtables */
+
+void
+DtCreateSubtable (
+ UINT8 *Buffer,
+ UINT32 Length,
+ DT_SUBTABLE **RetSubtable);
+
+UINT32
+DtGetSubtableLength (
+ DT_FIELD *Field,
+ ACPI_DMTABLE_INFO *Info);
+
+void
+DtSetSubtableLength (
+ DT_SUBTABLE *Subtable);
+
+void
+DtPushSubtable (
+ DT_SUBTABLE *Subtable);
+
+void
+DtPopSubtable (
+ void);
+
+DT_SUBTABLE *
+DtPeekSubtable (
+ void);
+
+void
+DtInsertSubtable (
+ DT_SUBTABLE *ParentTable,
+ DT_SUBTABLE *Subtable);
+
+DT_SUBTABLE *
+DtGetNextSubtable (
+ DT_SUBTABLE *ParentTable,
+ DT_SUBTABLE *ChildTable);
+
+DT_SUBTABLE *
+DtGetParentSubtable (
+ DT_SUBTABLE *Subtable);
+
+
+/* dtfield - Compile individual fields within a table */
+
+void
+DtCompileOneField (
+ UINT8 *Buffer,
+ DT_FIELD *Field,
+ UINT32 ByteLength,
+ UINT8 Type,
+ UINT8 Flags);
+
+void
+DtCompileInteger (
+ UINT8 *Buffer,
+ DT_FIELD *Field,
+ UINT32 ByteLength,
+ UINT8 Flags);
+
+UINT32
+DtCompileBuffer (
+ UINT8 *Buffer,
+ char *Value,
+ DT_FIELD *Field,
+ UINT32 ByteLength);
+
+UINT32
+DtCompileFlag (
+ UINT8 *Buffer,
+ DT_FIELD *Field,
+ ACPI_DMTABLE_INFO *Info,
+ UINT32 BitPosition);
+
+
+/* dtutils - Miscellaneous utilities */
+
+typedef
+void (*DT_WALK_CALLBACK) (
+ DT_SUBTABLE *Subtable,
+ void *Context,
+ void *ReturnValue);
+
+void
+DtWalkTableTree (
+ DT_SUBTABLE *StartTable,
+ DT_WALK_CALLBACK UserFunction,
+ void *Context,
+ void *ReturnValue);
+
+void
+DtError (
+ UINT8 Level,
+ UINT8 MessageId,
+ DT_FIELD *FieldObject,
+ char *ExtraMessage);
+
+void
+DtNameError (
+ UINT8 Level,
+ UINT8 MessageId,
+ DT_FIELD *FieldObject,
+ char *ExtraMessage);
+
+void
+DtFatal (
+ UINT8 MessageId,
+ DT_FIELD *FieldObject,
+ char *ExtraMessage);
+
+ACPI_STATUS
+DtStrtoul64 (
+ char *String,
+ UINT64 *ReturnInteger);
+
+UINT32
+DtGetFileSize (
+ FILE *Handle);
+
+char*
+DtGetFieldValue (
+ DT_FIELD *Field,
+ char *Name);
+
+UINT8
+DtGetFieldType (
+ ACPI_DMTABLE_INFO *Info);
+
+UINT32
+DtGetBufferLength (
+ char *Buffer);
+
+UINT32
+DtGetFieldLength (
+ DT_FIELD *Field,
+ ACPI_DMTABLE_INFO *Info);
+
+void
+DtSetTableChecksum (
+ UINT8 *ChecksumPointer);
+
+void
+DtSetTableLength(
+ void);
+
+void
+DtFreeFieldList (
+ void);
+
+
+/* dttable - individual table compilation */
+
+ACPI_STATUS
+DtCompileFacs (
+ DT_FIELD **PFieldList);
+
+ACPI_STATUS
+DtCompileRsdp (
+ DT_FIELD **PFieldList);
+
+ACPI_STATUS
+DtCompileAsf (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileCpep (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileDmar (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileEinj (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileErst (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileFadt (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileHest (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileIvrs (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileMadt (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileMcfg (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileMsct (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileRsdt (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileSlit (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileSrat (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileWdat (
+ void **PFieldList);
+
+ACPI_STATUS
+DtCompileXsdt (
+ void **PFieldList);
+
+
+/* Debug */
+
+#define MYDEBUG printf
+
+#endif
diff --git a/compiler/dtfield.c b/compiler/dtfield.c
new file mode 100644
index 000000000000..d3f32a44152d
--- /dev/null
+++ b/compiler/dtfield.c
@@ -0,0 +1,543 @@
+/******************************************************************************
+ *
+ * Module Name: dtfield.c - Code generation for individual source fields
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2010, 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.
+ *
+ *****************************************************************************/
+
+#define __DTFIELD_C__
+
+#include "aslcompiler.h"
+#include "dtcompiler.h"
+
+#define _COMPONENT DT_COMPILER
+ ACPI_MODULE_NAME ("dtfield")
+
+
+/* Local prototypes */
+
+static void
+DtCompileString (
+ UINT8 *Buffer,
+ DT_FIELD *Field,
+ UINT32 ByteLength);
+
+static char *
+DtPciPathToBuffer (
+ char *PciPath);
+
+static void
+DtCompilePciPath (
+ UINT8 *Buffer,
+ char *StringValue,
+ DT_FIELD *Field,
+ UINT32 ByteLength);
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileOneField
+ *
+ * PARAMETERS: Buffer - Output buffer
+ * Field - Field to be compiled
+ * ByteLength - Byte length of the field
+ * Type - Field type
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Compile a field value to binary
+ *
+ *****************************************************************************/
+
+void
+DtCompileOneField (
+ UINT8 *Buffer,
+ DT_FIELD *Field,
+ UINT32 ByteLength,
+ UINT8 Type,
+ UINT8 Flags)
+{
+
+ switch (Type)
+ {
+ case DT_FIELD_TYPE_INTEGER:
+ DtCompileInteger (Buffer, Field, ByteLength, Flags);
+ break;
+
+ case DT_FIELD_TYPE_STRING:
+ DtCompileString (Buffer, Field, ByteLength);
+ break;
+
+ case DT_FIELD_TYPE_BUFFER:
+ DtCompileBuffer (Buffer, Field->Value, Field, ByteLength);
+ break;
+
+ case DT_FIELD_TYPE_PCI_PATH:
+ DtCompilePciPath (Buffer, Field->Value, Field, ByteLength);
+ break;
+
+ default:
+ DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid field type");
+ break;
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileString
+ *
+ * PARAMETERS: Buffer - Output buffer
+ * Field - String to be copied to buffer
+ * ByteLength - Maximum length of string
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Copy string to the buffer
+ *
+ *****************************************************************************/
+
+static void
+DtCompileString (
+ UINT8 *Buffer,
+ DT_FIELD *Field,
+ UINT32 ByteLength)
+{
+ UINT32 Length;
+
+
+ Length = ACPI_STRLEN (Field->Value);
+
+ /* Check if the string is too long for the field */
+
+ if (Length > ByteLength)
+ {
+ sprintf (MsgBuffer, "Maximum %u characters", ByteLength);
+ DtError (ASL_ERROR, ASL_MSG_STRING_LENGTH, Field, MsgBuffer);
+ Length = ByteLength;
+ }
+
+ /* If input string is shorter than ByteLength, pad with blanks */
+
+ ACPI_MEMSET (Buffer, 0x20, ByteLength);
+ ACPI_MEMCPY (Buffer, Field->Value, Length);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileInteger
+ *
+ * PARAMETERS: Buffer - Output buffer
+ * Field - Field obj with Integer to be compiled
+ * ByteLength - Byte length of the integer
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Compile an integer
+ *
+ *****************************************************************************/
+
+void
+DtCompileInteger (
+ UINT8 *Buffer,
+ DT_FIELD *Field,
+ UINT32 ByteLength,
+ UINT8 Flags)
+{
+ UINT64 Value = 0;
+ UINT64 MaxValue;
+ UINT8 *Hex;
+ char *Message = NULL;
+ ACPI_STATUS Status;
+ int i;
+
+
+ /* Byte length must be in range 1-8 */
+
+ if ((ByteLength > 8) || (ByteLength == 0))
+ {
+ DtFatal (ASL_MSG_COMPILER_INTERNAL, Field,
+ "Invalid internal Byte length");
+ return;
+ }
+
+ /* Convert string to an actual integer */
+
+ Status = DtStrtoul64 (Field->Value, &Value);
+ if (ACPI_FAILURE (Status))
+ {
+ if (Status == AE_LIMIT)
+ {
+ Message = "Constant larger than 64 bits";
+ }
+ else if (Status == AE_BAD_CHARACTER)
+ {
+ Message = "Invalid character in constant";
+ }
+
+ DtError (ASL_ERROR, ASL_MSG_INVALID_HEX_INTEGER, Field, Message);
+ goto Exit;
+ }
+
+ /* Ensure that reserved fields are set to zero */
+ /* TBD: should we set to zero, or just make this an ERROR? */
+ /* TBD: Probably better to use a flag */
+
+ if (!ACPI_STRCMP (Field->Name, "Reserved") &&
+ (Value != 0))
+ {
+ DtError (ASL_WARNING, ASL_MSG_RESERVED_VALUE, Field,
+ "Setting to zero");
+ Value = 0;
+ }
+
+ /* Check if the value must be non-zero */
+
+ if ((Value == 0) && (Flags & DT_NON_ZERO))
+ {
+ DtError (ASL_ERROR, ASL_MSG_ZERO_VALUE, Field, NULL);
+ }
+
+ /*
+ * Generate the maximum value for the data type (ByteLength)
+ * Note: construct chosen for maximum portability
+ */
+ MaxValue = ((UINT64) (-1)) >> (64 - (ByteLength * 8));
+
+ /* Validate that the input value is within range of the target */
+
+ if (Value > MaxValue)
+ {
+ sprintf (MsgBuffer, "Maximum %u bytes", ByteLength);
+ DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer);
+ }
+
+ /*
+ * TBD: hard code for ASF! Capabilites field.
+ *
+ * This field is actually a buffer, not a 56-bit integer --
+ * so, the ordering is reversed. Something should be fixed
+ * so we don't need this code.
+ */
+ if (ByteLength == 7)
+ {
+ Hex = ACPI_CAST_PTR (UINT8, &Value);
+ for (i = 6; i >= 0; i--)
+ {
+ Buffer[i] = *Hex;
+ Hex++;
+ }
+ return;
+ }
+
+Exit:
+ ACPI_MEMCPY (Buffer, &Value, ByteLength);
+ return;
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtPciPathToBuffer
+ *
+ * PARAMETERS: PciPath - DMAR "PCI Path" field
+ *
+ * RETURN: Strings of PCI path
+ *
+ * DESCRIPTION: Remove brackets and comma from DMAR "PCI Path" string, for
+ * example: [1D, 01] ==> 1D 01
+ *
+ *****************************************************************************/
+
+static char *
+DtPciPathToBuffer (
+ char *PciPath)
+{
+ char *Buffer;
+
+
+ Buffer = UtLocalCalloc (6);
+
+ Buffer[0] = PciPath[1];
+ Buffer[1] = PciPath[2];
+ Buffer[2] = ' ';
+ Buffer[3] = PciPath[5];
+ Buffer[4] = PciPath[6];
+
+ return (Buffer);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileBuffer
+ *
+ * PARAMETERS: Buffer - Output buffer
+ * StringValue - Integer list to be compiled
+ * Field - Current field object
+ * ByteLength - Byte length of the integer list
+ *
+ * RETURN: Count of remaining data in the input list
+ *
+ * DESCRIPTION: Compile and pack an integer list, for example
+ * "AA 1F 20 3B" ==> Buffer[] = {0xAA,0x1F,0x20,0x3B}
+ *
+ *****************************************************************************/
+
+UINT32
+DtCompileBuffer (
+ UINT8 *Buffer,
+ char *StringValue,
+ DT_FIELD *Field,
+ UINT32 ByteLength)
+{
+ ACPI_STATUS Status;
+ char Hex[3];
+ UINT64 Value;
+ UINT32 i;
+ UINT32 Count;
+
+
+ Count = ACPI_STRLEN (StringValue) / 3 + 1;
+
+ Hex[2] = 0;
+ for (i = 0; i < Count; i++)
+ {
+ Hex[0] = StringValue[0];
+ Hex[1] = StringValue[1];
+
+ /* Convert one hex byte */
+
+ Value = 0;
+ Status = DtStrtoul64 (Hex, &Value);
+ if (ACPI_FAILURE (Status))
+ {
+ DtError (ASL_ERROR, ASL_MSG_BUFFER_ELEMENT, Field, MsgBuffer);
+ return (ByteLength - Count);
+ }
+
+ Buffer[i] = (UINT8) Value;
+ StringValue += 3;
+ }
+
+ return (ByteLength - Count);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompilePciPath
+ *
+ * PARAMETERS: Buffer - Output buffer
+ * StringValue - DMAR pci path string
+ * ByteLength - Byte length of DMAR pci path string, 2
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Compile DMAR PCI path string to binary
+ *
+ *****************************************************************************/
+
+static void
+DtCompilePciPath (
+ UINT8 *Buffer,
+ char *StringValue,
+ DT_FIELD *Field,
+ UINT32 ByteLength)
+{
+ char *PciPathBuffer;
+
+
+ /* Parse path to simple hex digits, then convert to binary */
+
+ PciPathBuffer = DtPciPathToBuffer (StringValue);
+
+ DtCompileBuffer (Buffer, PciPathBuffer, Field, ByteLength);
+ ACPI_FREE (PciPathBuffer);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileFlag
+ *
+ * PARAMETERS: Buffer - Output buffer
+ * Field - Field to be compiled
+ * Info - Flag info
+ * BitPosition - Flag bit position
+ *
+ * RETURN: Next flag bit position
+ *
+ * DESCRIPTION: Compile a flag
+ *
+ *****************************************************************************/
+
+UINT32
+DtCompileFlag (
+ UINT8 *Buffer,
+ DT_FIELD *Field,
+ ACPI_DMTABLE_INFO *Info,
+ UINT32 BitPosition)
+{
+ UINT64 Value = 0;
+ UINT32 BitLength = 1;
+ ACPI_STATUS Status;
+
+
+ Status = DtStrtoul64 (Field->Value, &Value);
+ if (ACPI_FAILURE (Status))
+ {
+ DtError (ASL_ERROR, ASL_MSG_INVALID_HEX_INTEGER, Field, NULL);
+ }
+
+ switch (Info->Opcode)
+ {
+ case ACPI_DMT_FLAG0:
+ case ACPI_DMT_FLAG1:
+ case ACPI_DMT_FLAG2:
+ case ACPI_DMT_FLAG3:
+ case ACPI_DMT_FLAG4:
+ case ACPI_DMT_FLAG5:
+ case ACPI_DMT_FLAG6:
+ case ACPI_DMT_FLAG7:
+
+ BitLength = 1;
+ break;
+
+ case ACPI_DMT_FLAGS0:
+ case ACPI_DMT_FLAGS2:
+
+ BitLength = 2;
+ break;
+
+ default:
+
+ DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid flag opcode");
+ break;
+ }
+
+ /* Check range of the input flag value */
+
+ if (Value >= ((UINT64) 1 << BitLength))
+ {
+ sprintf (MsgBuffer, "Maximum %u bit", BitLength);
+ DtError (ASL_ERROR, ASL_MSG_FLAG_VALUE, Field, MsgBuffer);
+ Value = 0;
+ }
+
+ /* Insert the flag, return next flag bit position */
+
+ Buffer += ACPI_DIV_8 (BitPosition);
+ *Buffer |= (UINT8) (Value << ACPI_MOD_8 (BitPosition));
+
+ return (BitPosition + BitLength);
+}
diff --git a/compiler/dtio.c b/compiler/dtio.c
new file mode 100644
index 000000000000..469cea60917d
--- /dev/null
+++ b/compiler/dtio.c
@@ -0,0 +1,512 @@
+/******************************************************************************
+ *
+ * Module Name: dtio.c - File I/O support for data table compiler
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2010, 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.
+ *
+ *****************************************************************************/
+
+#define __DTIO_C__
+
+#include "aslcompiler.h"
+#include "dtcompiler.h"
+
+#define _COMPONENT DT_COMPILER
+ ACPI_MODULE_NAME ("dtio")
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtIsComment
+ *
+ * PARAMETERS: Line - Current source code line
+ *
+ * RETURN: TRUE if comment, FALSE otherwise
+ *
+ * DESCRIPTION: Detect a comment in the source module
+ *
+ *****************************************************************************/
+
+/* TBD: Temporary: very simple code to detect comments */
+
+static int
+DtIsComment(
+ char *Line)
+{
+
+ if (!ACPI_STRNCMP (Line, "/*", 2) ||
+ !ACPI_STRNCMP (Line, " *", 2))
+ {
+ return 1;
+ }
+
+ return 0;
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtTrim
+ *
+ * PARAMETERS: String - Current source code line to trim
+ *
+ * RETURN: Trimmed line. Must be freed by caller.
+ *
+ * DESCRIPTION: Trim left and right spaces
+ *
+ *****************************************************************************/
+
+static char *
+DtTrim (
+ char *String)
+{
+ char *Start;
+ char *End;
+ char *ReturnString;
+ ACPI_SIZE Length;
+
+
+ /* Skip lines that start with a space */
+
+ if (!ACPI_STRCMP (String, " "))
+ {
+ ReturnString = UtLocalCalloc (1);
+ return (ReturnString);
+ }
+
+ /* Setup pointers to start and end of input string */
+
+ Start = String;
+ End = String + ACPI_STRLEN (String) - 1;
+
+ /* Find first non-whitespace character */
+
+ while ((Start <= End) && ((*Start == ' ') || (*Start == '\t')))
+ {
+ Start++;
+ }
+
+ /* Find last non-space character */
+
+ while (End >= Start)
+ {
+ if (*End == '\r' || *End == '\n')
+ {
+ End--;
+ continue;
+ }
+
+ if (*End != ' ')
+ {
+ break;
+ }
+
+ End--;
+ }
+
+ /* Remove any quotes around the string */
+
+ if (*Start == '\"')
+ {
+ Start++;
+ }
+ if (*End == '\"')
+ {
+ End--;
+ }
+
+ /* Create the trimmed return string */
+
+ Length = ACPI_PTR_DIFF (End, Start) + 1;
+ ReturnString = UtLocalCalloc (Length + 1);
+ if (ACPI_STRLEN (Start))
+ {
+ ACPI_STRNCPY (ReturnString, Start, Length);
+ }
+
+ ReturnString[Length] = 0;
+ return (ReturnString);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtLinkField
+ *
+ * PARAMETERS: Field - New field object to link
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Link one field name and value to the list
+ *
+ *****************************************************************************/
+
+static void
+DtLinkField (
+ DT_FIELD *Field)
+{
+ DT_FIELD *Prev;
+ DT_FIELD *Next;
+
+
+ Prev = Next = Gbl_FieldList;
+
+ while (Next)
+ {
+ Prev = Next;
+ Next = Next->Next;
+ }
+
+ if (Prev)
+ {
+ Prev->Next = Field;
+ }
+ else
+ {
+ Gbl_FieldList = Field;
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtParseLine
+ *
+ * PARAMETERS: LineBuffer - Current source code line
+ * Line - Current line number in the source
+ * Offset - Current byte offset of the line
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Parse one source line
+ *
+ *****************************************************************************/
+
+static void
+DtParseLine (
+ char *LineBuffer,
+ UINT32 Line,
+ UINT32 Offset)
+{
+ char *Start;
+ char *End;
+ char *TmpName;
+ char *TmpValue;
+ char *Name;
+ char *Value;
+ char *Colon;
+ UINT32 Length;
+ DT_FIELD *Field;
+ UINT32 Column;
+ UINT32 NameColumn;
+
+
+ if (!LineBuffer || DtIsComment (LineBuffer))
+ {
+ return;
+ }
+
+ Colon = strchr (LineBuffer, ':');
+ if (!Colon || *(Colon - 1) != ' ')
+ {
+ return;
+ }
+
+ Start = LineBuffer;
+ End = Colon;
+
+ while (Start < Colon)
+ {
+ if (*Start == ' ')
+ {
+ Start++;
+ continue;
+ }
+
+ /* Found left bracket, go to the right bracket */
+
+ if (*Start == '[')
+ {
+ while (Start < Colon && *Start != ']')
+ {
+ Start++;
+ }
+
+ if (Start == Colon)
+ {
+ MYDEBUG ("ERROR: right bracket reaches colon position\n");
+ break;
+ }
+
+ Start++;
+ continue;
+ }
+
+ break;
+ }
+
+ /*
+ * There are two column values. One for the field name,
+ * and one for the field value.
+ */
+ Column = ACPI_PTR_DIFF (Colon, LineBuffer) + 3;
+ NameColumn = ACPI_PTR_DIFF (Start, LineBuffer) + 1;
+
+ Length = ACPI_PTR_DIFF (End, Start);
+
+ TmpName = UtLocalCalloc (Length + 1);
+ ACPI_STRNCPY (TmpName, Start, Length);
+ Name = DtTrim (TmpName);
+ ACPI_FREE (TmpName);
+
+ Start = End = (Colon + 1);
+
+ while (*End)
+ {
+ /* Found left quotation, go to the right quotation and break */
+
+ if (*End == '"')
+ {
+ End++;
+ while (*End && *End != '"')
+ {
+ End++;
+ }
+
+ End++;
+ break;
+ }
+
+ if (*End == '(' ||
+ *End == '<' ||
+ *End == '/')
+ {
+ break;
+ }
+
+ End++;
+ }
+
+ Length = ACPI_PTR_DIFF (End, Start);
+ TmpValue = UtLocalCalloc (Length + 1);
+ ACPI_STRNCPY (TmpValue, Start, Length);
+ Value = DtTrim (TmpValue);
+ ACPI_FREE (TmpValue);
+
+ if (Name && Value)
+ {
+ Field = UtLocalCalloc (sizeof (DT_FIELD));
+ Field->Name = Name;
+ Field->Value = Value;
+ Field->Line = Line;
+ Field->ByteOffset = Offset;
+ Field->NameColumn = NameColumn;
+ Field->Column = Column;
+
+ DtLinkField (Field);
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtScanFile
+ *
+ * PARAMETERS: Handle - Open file handle for the source file
+ *
+ * RETURN: Pointer to start of the constructed parse tree.
+ *
+ * DESCRIPTION: Scan source file, link all field name and value
+ * to the global parse tree: Gbl_FieldList
+ *
+ *****************************************************************************/
+
+DT_FIELD *
+DtScanFile (
+ FILE *Handle)
+{
+ UINT32 Line = 0;
+ UINT32 Offset = 0;
+
+
+ /* Get the file size */
+
+ Gbl_InputByteCount = DtGetFileSize (Handle);
+
+ /* Scan line-by-line */
+
+ while (fgets (Gbl_CurrentLineBuffer, ASL_LINE_BUFFER_SIZE, Handle))
+ {
+ Line++;
+ Gbl_CurrentLineNumber++;
+ DtParseLine (Gbl_CurrentLineBuffer, Line, Offset);
+
+ Offset = (UINT32) ftell (Handle);
+ }
+
+ return (Gbl_FieldList);
+}
+
+
+/*
+ * Output functions
+ */
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtWriteBinary
+ *
+ * PARAMETERS: DT_WALK_CALLBACK
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Write one subtable of a binary ACPI table
+ *
+ *****************************************************************************/
+
+static void
+DtWriteBinary (
+ DT_SUBTABLE *Subtable,
+ void *Context,
+ void *ReturnValue)
+{
+
+ FlWriteFile (ASL_FILE_AML_OUTPUT, Subtable->Buffer, Subtable->Length);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtOutputBinary
+ *
+ * PARAMETERS:
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Write entire binary ACPI table (result of compilation)
+ *
+ *****************************************************************************/
+
+void
+DtOutputBinary (
+ DT_SUBTABLE *RootTable)
+{
+
+ if (!RootTable)
+ {
+ return;
+ }
+
+ /* Walk the entire parse tree, emitting the binary data */
+
+ DtWalkTableTree (RootTable, DtWriteBinary, NULL, NULL);
+ Gbl_TableLength = DtGetFileSize (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+}
diff --git a/compiler/dtsubtable.c b/compiler/dtsubtable.c
new file mode 100644
index 000000000000..9bbb4b463c19
--- /dev/null
+++ b/compiler/dtsubtable.c
@@ -0,0 +1,400 @@
+/******************************************************************************
+ *
+ * Module Name: dtsubtable.c - handling of subtables within ACPI tables
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2010, 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.
+ *
+ *****************************************************************************/
+
+#define __DTSUBTABLE_C__
+
+#include "aslcompiler.h"
+#include "dtcompiler.h"
+
+#define _COMPONENT DT_COMPILER
+ ACPI_MODULE_NAME ("dtsubtable")
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCreateSubtable
+ *
+ * PARAMETERS: Buffer - Input buffer
+ * Length - Buffer length
+ * RetSubtable - Returned newly created subtable
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Create a subtable that is not listed with ACPI_DMTABLE_INFO
+ * For example, FACS has 24 bytes reserved at the end
+ * and it's not listed at AcpiDmTableInfoFacs
+ *
+ *****************************************************************************/
+
+void
+DtCreateSubtable (
+ UINT8 *Buffer,
+ UINT32 Length,
+ DT_SUBTABLE **RetSubtable)
+{
+ DT_SUBTABLE *Subtable;
+
+
+ Subtable = UtLocalCalloc (sizeof (DT_SUBTABLE));
+
+ /* Create a new buffer for the subtable data */
+
+ Subtable->Buffer = UtLocalCalloc (Length);
+ ACPI_MEMCPY (Subtable->Buffer, Buffer, Length);
+
+ Subtable->Length = Length;
+ Subtable->TotalLength = Length;
+
+ *RetSubtable = Subtable;
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtInsertSubtable
+ *
+ * PARAMETERS: ParentTable - The Parent of the new subtable
+ * Subtable - The new subtable to insert
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Insert the new subtable to the parent table
+ *
+ *****************************************************************************/
+
+void
+DtInsertSubtable (
+ DT_SUBTABLE *ParentTable,
+ DT_SUBTABLE *Subtable)
+{
+ DT_SUBTABLE *ChildTable;
+
+
+ Subtable->Peer = NULL;
+ Subtable->Parent = ParentTable;
+
+ /* Link the new entry into the child list */
+
+ if (!ParentTable->Child)
+ {
+ ParentTable->Child = Subtable;
+ }
+ else
+ {
+ /* Walk to the end of the child list */
+
+ ChildTable = ParentTable->Child;
+ while (ChildTable->Peer)
+ {
+ ChildTable = ChildTable->Peer;
+ }
+
+ /* Add new subtable at the end of the child list */
+
+ ChildTable->Peer = Subtable;
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtPushSubtable
+ *
+ * PARAMETERS: Subtable - Subtable to push
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Push a subtable onto a subtable stack
+ *
+ *****************************************************************************/
+
+void
+DtPushSubtable (
+ DT_SUBTABLE *Subtable)
+{
+
+ Subtable->StackTop = Gbl_SubtableStack;
+ Gbl_SubtableStack = Subtable;
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtPopSubtable
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Pop a subtable from a subtable stack. Uses global SubtableStack
+ *
+ *****************************************************************************/
+
+void
+DtPopSubtable (
+ void)
+{
+ DT_SUBTABLE *Subtable;
+
+
+ Subtable = Gbl_SubtableStack;
+
+ if (Subtable)
+ {
+ Gbl_SubtableStack = Subtable->StackTop;
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtPeekSubtable
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: The subtable on top of stack
+ *
+ * DESCRIPTION: Get the subtable on top of stack
+ *
+ *****************************************************************************/
+
+DT_SUBTABLE *
+DtPeekSubtable (
+ void)
+{
+
+ return (Gbl_SubtableStack);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtGetNextSubtable
+ *
+ * PARAMETERS: ParentTable - Parent table whose children we are
+ * getting
+ * ChildTable - Previous child that was found.
+ * The NEXT child will be returned
+ *
+ * RETURN: Pointer to the NEXT child or NULL if none is found.
+ *
+ * DESCRIPTION: Return the next peer subtable within the tree.
+ *
+ *****************************************************************************/
+
+DT_SUBTABLE *
+DtGetNextSubtable (
+ DT_SUBTABLE *ParentTable,
+ DT_SUBTABLE *ChildTable)
+{
+ ACPI_FUNCTION_ENTRY ();
+
+
+ if (!ChildTable)
+ {
+ /* It's really the parent's _scope_ that we want */
+
+ return (ParentTable->Child);
+ }
+
+ /* Otherwise just return the next peer (NULL if at end-of-list) */
+
+ return (ChildTable->Peer);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtGetParentSubtable
+ *
+ * PARAMETERS: Subtable - Current subtable
+ *
+ * RETURN: Parent of the given subtable
+ *
+ * DESCRIPTION: Get the parent of the given subtable in the tree
+ *
+ *****************************************************************************/
+
+DT_SUBTABLE *
+DtGetParentSubtable (
+ DT_SUBTABLE *Subtable)
+{
+
+ if (!Subtable)
+ {
+ return (NULL);
+ }
+
+ return (Subtable->Parent);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtGetSubtableLength
+ *
+ * PARAMETERS: Field - Current field list pointer
+ * Info - Data table info
+ *
+ * RETURN: Subtable length
+ *
+ * DESCRIPTION: Get length of bytes needed to compile the subtable
+ *
+ *****************************************************************************/
+
+UINT32
+DtGetSubtableLength (
+ DT_FIELD *Field,
+ ACPI_DMTABLE_INFO *Info)
+{
+ UINT32 ByteLength = 0;
+
+
+ /* Walk entire Info table; Null name terminates */
+
+ for (; Info->Name; Info++)
+ {
+ ByteLength += DtGetFieldLength (Field, Info);
+ }
+
+ return (ByteLength);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtSetSubtableLength
+ *
+ * PARAMETERS: Subtable - Subtable
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Set length of the subtable into its length field
+ *
+ *****************************************************************************/
+
+void
+DtSetSubtableLength (
+ DT_SUBTABLE *Subtable)
+{
+
+ if (!Subtable->LengthField)
+ {
+ return;
+ }
+
+ ACPI_MEMCPY (Subtable->LengthField, &Subtable->TotalLength,
+ Subtable->SizeOfLengthField);
+}
diff --git a/compiler/dttable.c b/compiler/dttable.c
new file mode 100644
index 000000000000..2ab6b9ef6612
--- /dev/null
+++ b/compiler/dttable.c
@@ -0,0 +1,1399 @@
+/******************************************************************************
+ *
+ * Module Name: dttable.c - handling for specific ACPI tables
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2010, 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.
+ *
+ *****************************************************************************/
+
+#define __DTTABLE_C__
+
+/* Compile all complex data tables */
+
+#include "aslcompiler.h"
+#include "dtcompiler.h"
+
+#define _COMPONENT DT_COMPILER
+ ACPI_MODULE_NAME ("dttable")
+
+
+/* TBD: merge these into dmtbinfo.c? */
+
+static ACPI_DMTABLE_INFO TableInfoAsfAddress[] =
+{
+ {ACPI_DMT_BUFFER, 0, "Addresses", 0},
+ {ACPI_DMT_EXIT, 0, NULL, 0}
+};
+
+static ACPI_DMTABLE_INFO TableInfoDmarPciPath[] =
+{
+ {ACPI_DMT_PCI_PATH, 0, "PCI Path", 0},
+ {ACPI_DMT_EXIT, 0, NULL, 0}
+};
+
+
+/* TBD: move to acmacros.h */
+
+#define ACPI_SUB_PTR(t, a, b) \
+ ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b)))
+
+
+/* Local prototypes */
+
+static ACPI_STATUS
+DtCompileTwoSubtables (
+ void **List,
+ ACPI_DMTABLE_INFO *TableInfo1,
+ ACPI_DMTABLE_INFO *TableInfo2);
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileTwoSubtables
+ *
+ * PARAMETERS: List - Current field list pointer
+ * TableInfo1 - Info table 1
+ * TableInfo1 - Info table 2
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile tables with a header and one or more same subtables.
+ * Include CPEP, EINJ, ERST, MCFG, MSCT, WDAT
+ *
+ *****************************************************************************/
+
+static ACPI_STATUS
+DtCompileTwoSubtables (
+ void **List,
+ ACPI_DMTABLE_INFO *TableInfo1,
+ ACPI_DMTABLE_INFO *TableInfo2)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+
+
+ Status = DtCompileTable (PFieldList, TableInfo1, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, TableInfo2, &Subtable, FALSE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileFacs
+ *
+ * PARAMETERS: PFieldList - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile FACS.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileFacs (
+ DT_FIELD **PFieldList)
+{
+ DT_SUBTABLE *Subtable;
+ UINT8 *ReservedBuffer;
+ ACPI_STATUS Status;
+ UINT32 ReservedSize;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFacs,
+ &Gbl_RootTable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ /* Large FACS reserved area at the end of the table */
+
+ ReservedSize = (UINT32) sizeof (((ACPI_TABLE_FACS *) NULL)->Reserved1);
+ ReservedBuffer = UtLocalCalloc (ReservedSize);
+
+ DtCreateSubtable (ReservedBuffer, ReservedSize, &Subtable);
+
+ ACPI_FREE (ReservedBuffer);
+ DtInsertSubtable (Gbl_RootTable, Subtable);
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileRsdp
+ *
+ * PARAMETERS: PFieldList - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile RSDP.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileRsdp (
+ DT_FIELD **PFieldList)
+{
+ DT_SUBTABLE *Subtable;
+ ACPI_TABLE_RSDP *Table;
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp1,
+ &Gbl_RootTable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ Table = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Gbl_RootTable->Buffer);
+ DtSetTableChecksum (&Table->Checksum);
+
+ if (Table->Revision > 0)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoRsdp2,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (Gbl_RootTable, Subtable);
+ DtSetTableChecksum (&Table->ExtendedChecksum);
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileAsf
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile ASF!.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileAsf (
+ void **List)
+{
+ ACPI_ASF_INFO *AsfTable;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ ACPI_DMTABLE_INFO *InfoTable;
+ ACPI_DMTABLE_INFO *DataInfoTable = NULL;
+ UINT32 DataCount = 0;
+ ACPI_STATUS Status;
+ UINT32 i;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoAsfHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ AsfTable = ACPI_CAST_PTR (ACPI_ASF_INFO, Subtable->Buffer);
+
+ switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
+ {
+ case ACPI_ASF_TYPE_INFO:
+ InfoTable = AcpiDmTableInfoAsf0;
+ break;
+
+ case ACPI_ASF_TYPE_ALERT:
+ InfoTable = AcpiDmTableInfoAsf1;
+ break;
+
+ case ACPI_ASF_TYPE_CONTROL:
+ InfoTable = AcpiDmTableInfoAsf2;
+ break;
+
+ case ACPI_ASF_TYPE_BOOT:
+ InfoTable = AcpiDmTableInfoAsf3;
+ break;
+
+ case ACPI_ASF_TYPE_ADDRESS:
+ InfoTable = AcpiDmTableInfoAsf4;
+ break;
+
+ default:
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
+ {
+ case ACPI_ASF_TYPE_INFO:
+ DataInfoTable = NULL;
+ break;
+
+ case ACPI_ASF_TYPE_ALERT:
+ DataInfoTable = AcpiDmTableInfoAsf1a;
+ DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT,
+ ACPI_SUB_PTR (UINT8, Subtable->Buffer,
+ sizeof (ACPI_ASF_HEADER)))->Alerts;
+ break;
+
+ case ACPI_ASF_TYPE_CONTROL:
+ DataInfoTable = AcpiDmTableInfoAsf2a;
+ DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE,
+ ACPI_SUB_PTR (UINT8, Subtable->Buffer,
+ sizeof (ACPI_ASF_HEADER)))->Controls;
+ break;
+
+ case ACPI_ASF_TYPE_BOOT:
+ DataInfoTable = NULL;
+ break;
+
+ case ACPI_ASF_TYPE_ADDRESS:
+ DataInfoTable = TableInfoAsfAddress;
+ DataCount = ACPI_CAST_PTR (ACPI_ASF_ADDRESS,
+ ACPI_SUB_PTR (UINT8, Subtable->Buffer,
+ sizeof (ACPI_ASF_HEADER)))->Devices;
+ break;
+
+ default:
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
+ return (AE_ERROR);
+ }
+
+ if (DataInfoTable)
+ {
+ switch (AsfTable->Header.Type & 0x7F)
+ {
+ case ACPI_ASF_TYPE_ADDRESS:
+
+ while (DataCount > 0)
+ {
+ Status = DtCompileTable (PFieldList, DataInfoTable,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ DataCount = DataCount - Subtable->Length;
+ }
+ break;
+
+ default:
+
+ for (i = 0; i < DataCount; i++)
+ {
+ Status = DtCompileTable (PFieldList, DataInfoTable,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ break;
+ }
+ }
+
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileCpep
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile CPEP.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileCpep (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoCpep, AcpiDmTableInfoCpep0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileDmar
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile DMAR.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileDmar (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_DMTABLE_INFO *InfoTable;
+ ACPI_DMAR_HEADER *DmarHeader;
+ UINT8 *ReservedBuffer;
+ UINT32 ReservedSize;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* DMAR Reserved area */
+
+ ReservedSize = (UINT32) sizeof (((ACPI_TABLE_DMAR *) NULL)->Reserved);
+ ReservedBuffer = UtLocalCalloc (ReservedSize);
+
+ DtCreateSubtable (ReservedBuffer, ReservedSize, &Subtable);
+
+ ACPI_FREE (ReservedBuffer);
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ /* DMAR Header */
+
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer);
+
+ switch (DmarHeader->Type)
+ {
+ case ACPI_DMAR_TYPE_HARDWARE_UNIT:
+ InfoTable = AcpiDmTableInfoDmar0;
+ break;
+ case ACPI_DMAR_TYPE_RESERVED_MEMORY:
+ InfoTable = AcpiDmTableInfoDmar1;
+ break;
+ case ACPI_DMAR_TYPE_ATSR:
+ InfoTable = AcpiDmTableInfoDmar2;
+ break;
+ case ACPI_DMAR_HARDWARE_AFFINITY:
+ InfoTable = AcpiDmTableInfoDmar3;
+ break;
+ default:
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
+ return (AE_ERROR);
+ }
+
+ /* DMAR Subtable */
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /* Optional Device Scope subtables */
+
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope,
+ &Subtable, FALSE);
+ if (Status == AE_NOT_FOUND)
+ {
+ break;
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ /* Optional PCI Paths */
+
+ while (*PFieldList)
+ {
+ Status = DtCompileTable (PFieldList, TableInfoDmarPciPath,
+ &Subtable, FALSE);
+ if (Status == AE_NOT_FOUND)
+ {
+ DtPopSubtable ();
+ break;
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ }
+
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileEinj
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile EINJ.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileEinj (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoEinj, AcpiDmTableInfoEinj0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileErst
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile ERST.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileErst (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoErst, AcpiDmTableInfoEinj0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileFadt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile FADT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileFadt (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ ACPI_TABLE_HEADER *Table;
+ UINT8 Revision;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt1,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer);
+ Revision = Table->Revision;
+
+ if (Revision == 2)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt2,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ else if (Revision >= 2)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoFadt3,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileHest
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile HEST.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileHest (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_DMTABLE_INFO *InfoTable;
+ UINT16 Type;
+ UINT32 BankCount;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoHest,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ /* Get subtable type */
+
+ SubtableStart = *PFieldList;
+ DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0);
+
+ switch (Type)
+ {
+ case ACPI_HEST_TYPE_IA32_CHECK:
+ InfoTable = AcpiDmTableInfoHest0;
+ break;
+
+ case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
+ InfoTable = AcpiDmTableInfoHest1;
+ break;
+
+ case ACPI_HEST_TYPE_IA32_NMI:
+ InfoTable = AcpiDmTableInfoHest2;
+ break;
+
+ case ACPI_HEST_TYPE_AER_ROOT_PORT:
+ InfoTable = AcpiDmTableInfoHest6;
+ break;
+
+ case ACPI_HEST_TYPE_AER_ENDPOINT:
+ InfoTable = AcpiDmTableInfoHest7;
+ break;
+
+ case ACPI_HEST_TYPE_AER_BRIDGE:
+ InfoTable = AcpiDmTableInfoHest8;
+ break;
+
+ case ACPI_HEST_TYPE_GENERIC_ERROR:
+ InfoTable = AcpiDmTableInfoHest9;
+ break;
+
+ default:
+ /* Cannot continue on unknown type */
+
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HEST");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+
+ /*
+ * Additional subtable data - IA32 Error Bank(s)
+ */
+ BankCount = 0;
+ switch (Type)
+ {
+ case ACPI_HEST_TYPE_IA32_CHECK:
+ BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
+ Subtable->Buffer))->NumHardwareBanks;
+ break;
+
+ case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
+ BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
+ Subtable->Buffer))->NumHardwareBanks;
+ break;
+
+ default:
+ break;
+ }
+
+ while (BankCount)
+ {
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoHestBank,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ BankCount--;
+ }
+ }
+
+ return AE_OK;
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileIvrs
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile IVRS.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileIvrs (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_DMTABLE_INFO *InfoTable;
+ ACPI_IVRS_HEADER *IvrsHeader;
+ UINT8 EntryType;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrs,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ IvrsHeader = ACPI_CAST_PTR (ACPI_IVRS_HEADER, Subtable->Buffer);
+
+ switch (IvrsHeader->Type)
+ {
+ case ACPI_IVRS_TYPE_HARDWARE:
+ InfoTable = AcpiDmTableInfoIvrs0;
+ break;
+
+ case ACPI_IVRS_TYPE_MEMORY1:
+ case ACPI_IVRS_TYPE_MEMORY2:
+ case ACPI_IVRS_TYPE_MEMORY3:
+ InfoTable = AcpiDmTableInfoIvrs1;
+ break;
+
+ default:
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IVRS");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE)
+ {
+ while (*PFieldList &&
+ !ACPI_STRCMP ((*PFieldList)->Name, "Entry Type"))
+ {
+ SubtableStart = *PFieldList;
+ DtCompileInteger (&EntryType, *PFieldList, 1, 0);
+
+ switch (EntryType)
+ {
+ /* 4-byte device entries */
+
+ case ACPI_IVRS_TYPE_PAD4:
+ case ACPI_IVRS_TYPE_ALL:
+ case ACPI_IVRS_TYPE_SELECT:
+ case ACPI_IVRS_TYPE_START:
+ case ACPI_IVRS_TYPE_END:
+
+ InfoTable = AcpiDmTableInfoIvrs4;
+ break;
+
+ /* 8-byte entries, type A */
+
+ case ACPI_IVRS_TYPE_ALIAS_SELECT:
+ case ACPI_IVRS_TYPE_ALIAS_START:
+
+ InfoTable = AcpiDmTableInfoIvrs8a;
+ break;
+
+ /* 8-byte entries, type B */
+
+ case ACPI_IVRS_TYPE_PAD8:
+ case ACPI_IVRS_TYPE_EXT_SELECT:
+ case ACPI_IVRS_TYPE_EXT_START:
+
+ InfoTable = AcpiDmTableInfoIvrs8b;
+ break;
+
+ /* 8-byte entries, type C */
+
+ case ACPI_IVRS_TYPE_SPECIAL:
+
+ InfoTable = AcpiDmTableInfoIvrs8c;
+ break;
+
+ default:
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart,
+ "IVRS Device Entry");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+ }
+
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileMadt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile MADT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileMadt (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SUBTABLE_HEADER *MadtHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadt,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadtHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ MadtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+
+ switch (MadtHeader->Type)
+ {
+ case ACPI_MADT_TYPE_LOCAL_APIC:
+ InfoTable = AcpiDmTableInfoMadt0;
+ break;
+ case ACPI_MADT_TYPE_IO_APIC:
+ InfoTable = AcpiDmTableInfoMadt1;
+ break;
+ case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
+ InfoTable = AcpiDmTableInfoMadt2;
+ break;
+ case ACPI_MADT_TYPE_NMI_SOURCE:
+ InfoTable = AcpiDmTableInfoMadt3;
+ break;
+ case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
+ InfoTable = AcpiDmTableInfoMadt4;
+ break;
+ case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
+ InfoTable = AcpiDmTableInfoMadt5;
+ break;
+ case ACPI_MADT_TYPE_IO_SAPIC:
+ InfoTable = AcpiDmTableInfoMadt6;
+ break;
+ case ACPI_MADT_TYPE_LOCAL_SAPIC:
+ InfoTable = AcpiDmTableInfoMadt7;
+ break;
+ case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
+ InfoTable = AcpiDmTableInfoMadt8;
+ break;
+ case ACPI_MADT_TYPE_LOCAL_X2APIC:
+ InfoTable = AcpiDmTableInfoMadt9;
+ break;
+ case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
+ InfoTable = AcpiDmTableInfoMadt10;
+ break;
+ default:
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileMcfg
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile MCFG.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileMcfg (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoMcfg, AcpiDmTableInfoMcfg0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileMsct
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile MSCT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileMsct (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoMsct, AcpiDmTableInfoMsct0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileRsdt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile RSDT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileRsdt (
+ void **List)
+{
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD *FieldList = *(DT_FIELD **) List;
+ UINT32 Address;
+
+
+ ParentTable = DtPeekSubtable ();
+
+ while (FieldList)
+ {
+ DtCompileInteger ((UINT8 *) &Address, FieldList, 4, DT_NON_ZERO);
+
+ DtCreateSubtable ((UINT8 *) &Address, 4, &Subtable);
+ DtInsertSubtable (ParentTable, Subtable);
+ FieldList = FieldList->Next;
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileSlit
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile SLIT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileSlit (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *FieldList;
+ UINT32 Localities;
+ UINT8 *LocalityBuffer;
+ UINT32 RemainingData;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
+ LocalityBuffer = UtLocalCalloc (Localities);
+
+ FieldList = *PFieldList;
+ while (FieldList)
+ {
+ /* Handle multiple-line buffer */
+
+ RemainingData = Localities;
+ while (RemainingData && FieldList)
+ {
+ RemainingData = DtCompileBuffer (
+ LocalityBuffer + (Localities - RemainingData),
+ FieldList->Value, FieldList, RemainingData);
+ FieldList = FieldList->Next;
+ }
+
+ DtCreateSubtable (LocalityBuffer, Localities, &Subtable);
+ DtInsertSubtable (ParentTable, Subtable);
+ }
+
+ ACPI_FREE (LocalityBuffer);
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileSrat
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile SRAT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileSrat (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SUBTABLE_HEADER *SratHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+
+
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSrat,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSratHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ SratHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+
+ switch (SratHeader->Type)
+ {
+ case ACPI_SRAT_TYPE_CPU_AFFINITY:
+ InfoTable = AcpiDmTableInfoSrat0;
+ break;
+ case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
+ InfoTable = AcpiDmTableInfoSrat1;
+ break;
+ case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
+ InfoTable = AcpiDmTableInfoSrat2;
+ break;
+ default:
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileWdat
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile WDAT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileWdat (
+ void **List)
+{
+ ACPI_STATUS Status;
+
+
+ Status = DtCompileTwoSubtables (List,
+ AcpiDmTableInfoWdat, AcpiDmTableInfoWdat0);
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompileXsdt
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile XSDT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileXsdt (
+ void **List)
+{
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD *FieldList = *(DT_FIELD **) List;
+ UINT64 Address;
+
+ ParentTable = DtPeekSubtable ();
+
+ while (FieldList)
+ {
+ DtCompileInteger ((UINT8 *) &Address, FieldList, 8, DT_NON_ZERO);
+
+ DtCreateSubtable ((UINT8 *) &Address, 8, &Subtable);
+ DtInsertSubtable (ParentTable, Subtable);
+ FieldList = FieldList->Next;
+ }
+
+ return (AE_OK);
+}
diff --git a/compiler/dtutils.c b/compiler/dtutils.c
new file mode 100644
index 000000000000..c3a4a85cd094
--- /dev/null
+++ b/compiler/dtutils.c
@@ -0,0 +1,894 @@
+/******************************************************************************
+ *
+ * Module Name: dtutils.c - Utility routines for the data table compiler
+ *
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * 1. Copyright Notice
+ *
+ * Some or all of this work - Copyright (c) 1999 - 2010, 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.
+ *
+ *****************************************************************************/
+
+#define __DTUTILS_C__
+
+#include "aslcompiler.h"
+#include "dtcompiler.h"
+#include "actables.h"
+
+#define _COMPONENT DT_COMPILER
+ ACPI_MODULE_NAME ("dtutils")
+
+/* Local prototypes */
+
+static void
+DtSum (
+ DT_SUBTABLE *Subtable,
+ void *Context,
+ void *ReturnValue);
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtError
+ *
+ * PARAMETERS: Level - Seriousness (Warning/error, etc.)
+ * MessageId - Index into global message buffer
+ * Op - Parse node where error happened
+ * ExtraMessage - additional error message
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Common error interface for data table compiler
+ *
+ *****************************************************************************/
+
+void
+DtError (
+ UINT8 Level,
+ UINT8 MessageId,
+ DT_FIELD *FieldObject,
+ char *ExtraMessage)
+{
+
+ switch (Level)
+ {
+ case ASL_WARNING2:
+ case ASL_WARNING3:
+ if (Gbl_WarningLevel < Level)
+ {
+ return;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (FieldObject)
+ {
+ AslCommonError (Level, MessageId,
+ FieldObject->Line,
+ FieldObject->Line,
+ FieldObject->ByteOffset,
+ FieldObject->Column,
+ Gbl_Files[ASL_FILE_INPUT].Filename, ExtraMessage);
+ }
+ else
+ {
+ AslCommonError (Level, MessageId, 0,
+ 0, 0, 0, 0, ExtraMessage);
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtNameError
+ *
+ * PARAMETERS: Level - Seriousness (Warning/error, etc.)
+ * MessageId - Index into global message buffer
+ * Op - Parse node where error happened
+ * ExtraMessage - additional error message
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Error interface for named objects
+ *
+ *****************************************************************************/
+
+void
+DtNameError (
+ UINT8 Level,
+ UINT8 MessageId,
+ DT_FIELD *FieldObject,
+ char *ExtraMessage)
+{
+
+ switch (Level)
+ {
+ case ASL_WARNING2:
+ case ASL_WARNING3:
+ if (Gbl_WarningLevel < Level)
+ {
+ return;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (FieldObject)
+ {
+ AslCommonError (Level, MessageId,
+ FieldObject->Line,
+ FieldObject->Line,
+ FieldObject->ByteOffset,
+ FieldObject->NameColumn,
+ Gbl_Files[ASL_FILE_INPUT].Filename, ExtraMessage);
+ }
+ else
+ {
+ AslCommonError (Level, MessageId, 0,
+ 0, 0, 0, 0, ExtraMessage);
+ }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: DtFatal
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Dump the error log and abort the compiler. Used for serious
+ * compile or I/O errors
+ *
+ ******************************************************************************/
+
+void
+DtFatal (
+ UINT8 MessageId,
+ DT_FIELD *FieldObject,
+ char *ExtraMessage)
+{
+
+ DtError (ASL_ERROR, MessageId, FieldObject, ExtraMessage);
+
+ CmCleanupAndExit ();
+ exit (1);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtStrtoul64
+ *
+ * PARAMETERS: String - Null terminated string
+ * ReturnInteger - Where the converted integer is returned
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Simple conversion of a string hex integer constant to unsigned
+ * value. Assumes no leading "0x" for the constant.
+ *
+ * Portability note: The reason this function exists is because a 64-bit
+ * sscanf is not available in all environments.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtStrtoul64 (
+ char *String,
+ UINT64 *ReturnInteger)
+{
+ char *ThisChar = String;
+ UINT32 ThisDigit;
+ UINT64 ReturnValue = 0;
+ int DigitCount = 0;
+
+
+ /* Skip over any white space in the buffer */
+
+ while ((*ThisChar == ' ') || (*ThisChar == '\t'))
+ {
+ ThisChar++;
+ }
+
+ /* Skip leading zeros */
+
+ while ((*ThisChar) == '0')
+ {
+ ThisChar++;
+ }
+
+ /* Convert character-by-character */
+
+ while (*ThisChar)
+ {
+ if (ACPI_IS_DIGIT (*ThisChar))
+ {
+ /* Convert ASCII 0-9 to Decimal value */
+
+ ThisDigit = ((UINT8) *ThisChar) - '0';
+ }
+ else /* Letter */
+ {
+ ThisDigit = (UINT32) ACPI_TOUPPER (*ThisChar);
+ if (!ACPI_IS_XDIGIT ((char) ThisDigit))
+ {
+ /* Not A-F */
+
+ return (AE_BAD_CHARACTER);
+ }
+
+ /* Convert ASCII Hex char (A-F) to value */
+
+ ThisDigit = (ThisDigit - 'A') + 10;
+ }
+
+ /* Insert the 4-bit hex digit */
+
+ ReturnValue <<= 4;
+ ReturnValue += ThisDigit;
+
+ ThisChar++;
+ DigitCount++;
+ if (DigitCount > 16)
+ {
+ /* Value is too large (> 64 bits/8 bytes/16 hex digits) */
+
+ return (AE_LIMIT);
+ }
+ }
+
+ *ReturnInteger = ReturnValue;
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtGetFileSize
+ *
+ * PARAMETERS: Handle - Open file handler
+ *
+ * RETURN: Current file size
+ *
+ * DESCRIPTION: Get the current size of a file. Seek to the EOF and get the
+ * offset. Seek back to the original location.
+ *
+ *****************************************************************************/
+
+UINT32
+DtGetFileSize (
+ FILE *Handle)
+{
+ int CurrentOffset;
+ int LastOffset;
+
+
+ CurrentOffset = ftell (Handle);
+ fseek (Handle, 0, SEEK_END);
+ LastOffset = ftell (Handle);
+ fseek (Handle, CurrentOffset, SEEK_SET);
+
+ return ((UINT32) LastOffset);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtGetFieldValue
+ *
+ * PARAMETERS: Field - Current field list pointer
+ * Name - Field name
+ *
+ * RETURN: Field value
+ *
+ * DESCRIPTION: Get field value
+ *
+ *****************************************************************************/
+
+char *
+DtGetFieldValue (
+ DT_FIELD *Field,
+ char *Name)
+{
+
+ /* Search the field list for the name */
+
+ while (Field)
+ {
+ if (!ACPI_STRCMP (Name, Field->Name))
+ {
+ return (Field->Value);
+ }
+
+ Field = Field->Next;
+ }
+
+ return (NULL);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtGetFieldType
+ *
+ * PARAMETERS: Info - Data table info
+ *
+ * RETURN: Field type
+ *
+ * DESCRIPTION: Get field type
+ *
+ *****************************************************************************/
+
+UINT8
+DtGetFieldType (
+ ACPI_DMTABLE_INFO *Info)
+{
+ UINT8 Type;
+
+
+ /* DT_FLAG means that this is the start of a block of flag bits */
+ /* TBD - we can make these a separate opcode later */
+
+ if (Info->Flags & DT_FLAG)
+ {
+ return (DT_FIELD_TYPE_FLAGS_INTEGER);
+ }
+
+ /* Type is based upon the opcode for this field in the info table */
+
+ switch (Info->Opcode)
+ {
+ case ACPI_DMT_FLAG0:
+ case ACPI_DMT_FLAG1:
+ case ACPI_DMT_FLAG2:
+ case ACPI_DMT_FLAG3:
+ case ACPI_DMT_FLAG4:
+ case ACPI_DMT_FLAG5:
+ case ACPI_DMT_FLAG6:
+ case ACPI_DMT_FLAG7:
+ case ACPI_DMT_FLAGS0:
+ case ACPI_DMT_FLAGS2:
+ Type = DT_FIELD_TYPE_FLAG;
+ break;
+
+ case ACPI_DMT_NAME4:
+ case ACPI_DMT_SIG:
+ case ACPI_DMT_NAME6:
+ case ACPI_DMT_NAME8:
+ case ACPI_DMT_STRING:
+ Type = DT_FIELD_TYPE_STRING;
+ break;
+
+ case ACPI_DMT_BUFFER:
+ case ACPI_DMT_BUF16:
+ Type = DT_FIELD_TYPE_BUFFER;
+ break;
+
+ case ACPI_DMT_PCI_PATH:
+ Type = DT_FIELD_TYPE_PCI_PATH;
+ break;
+
+ case ACPI_DMT_GAS:
+ case ACPI_DMT_HESTNTFY:
+ Type = DT_FIELD_TYPE_INLINE_SUBTABLE;
+ break;
+
+ default:
+ Type = DT_FIELD_TYPE_INTEGER;
+ break;
+ }
+
+ return (Type);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtGetBufferLength
+ *
+ * PARAMETERS: Buffer - List of integers,
+ * for example "10 3A 4F 2E"
+ *
+ * RETURN: Count of integer
+ *
+ * DESCRIPTION: Get length of bytes needed to store the integers
+ *
+ *****************************************************************************/
+
+UINT32
+DtGetBufferLength (
+ char *Buffer)
+{
+ UINT32 ByteLength = 0;
+
+
+ while (*Buffer)
+ {
+ if (*Buffer == ' ')
+ {
+ ByteLength++;
+
+ while (*Buffer == ' ')
+ {
+ Buffer++;
+ }
+ }
+
+ Buffer++;
+ }
+
+ return (++ByteLength);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtGetFieldLength
+ *
+ * PARAMETERS: Field - Current field list pointer
+ * Info - Data table info
+ *
+ * RETURN: Field length
+ *
+ * DESCRIPTION: Get length of bytes needed to compile the field
+ *
+ *****************************************************************************/
+
+UINT32
+DtGetFieldLength (
+ DT_FIELD *Field,
+ ACPI_DMTABLE_INFO *Info)
+{
+ UINT32 ByteLength = 0;
+ char *Value;
+
+
+ /* Length is based upon the opcode for this field in the info table */
+
+ switch (Info->Opcode)
+ {
+ case ACPI_DMT_FLAG0:
+ case ACPI_DMT_FLAG1:
+ case ACPI_DMT_FLAG2:
+ case ACPI_DMT_FLAG3:
+ case ACPI_DMT_FLAG4:
+ case ACPI_DMT_FLAG5:
+ case ACPI_DMT_FLAG6:
+ case ACPI_DMT_FLAG7:
+ case ACPI_DMT_FLAGS0:
+ case ACPI_DMT_FLAGS2:
+ ByteLength = 0;
+ break;
+
+ case ACPI_DMT_UINT8:
+ case ACPI_DMT_CHKSUM:
+ case ACPI_DMT_SPACEID:
+ case ACPI_DMT_MADT:
+ case ACPI_DMT_SRAT:
+ case ACPI_DMT_ASF:
+ case ACPI_DMT_HESTNTYP:
+ case ACPI_DMT_FADTPM:
+ case ACPI_DMT_IVRS:
+ ByteLength = 1;
+ break;
+
+ case ACPI_DMT_UINT16:
+ case ACPI_DMT_DMAR:
+ case ACPI_DMT_HEST:
+ case ACPI_DMT_PCI_PATH:
+ ByteLength = 2;
+ break;
+
+ case ACPI_DMT_UINT24:
+ ByteLength = 3;
+ break;
+
+ case ACPI_DMT_UINT32:
+ case ACPI_DMT_NAME4:
+ case ACPI_DMT_SIG:
+ ByteLength = 4;
+ break;
+
+ case ACPI_DMT_NAME6:
+ ByteLength = 6;
+ break;
+
+ case ACPI_DMT_UINT56:
+ ByteLength = 7;
+ break;
+
+ case ACPI_DMT_UINT64:
+ case ACPI_DMT_NAME8:
+ ByteLength = 8;
+ break;
+
+ case ACPI_DMT_STRING:
+ Value = DtGetFieldValue (Field, Info->Name);
+
+ /* TBD: error if Value is NULL? (as below?) */
+
+ ByteLength = ACPI_STRLEN (Value) + 1;
+ break;
+
+ case ACPI_DMT_GAS:
+ ByteLength = sizeof (ACPI_GENERIC_ADDRESS);
+ break;
+
+ case ACPI_DMT_HESTNTFY:
+ ByteLength = sizeof (ACPI_HEST_NOTIFY);
+ break;
+
+ case ACPI_DMT_BUFFER:
+ Value = DtGetFieldValue (Field, Info->Name);
+ if (Value)
+ {
+ ByteLength = DtGetBufferLength (Value);
+ }
+ else
+ { /* At this point, this is a fatal error */
+
+ sprintf (MsgBuffer, "Expected \"%s\"", Info->Name);
+ DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer);
+ }
+ break;
+
+ case ACPI_DMT_BUF16:
+ ByteLength = 16;
+ break;
+
+ default:
+ DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid table opcode");
+ break;
+ }
+
+ return (ByteLength);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtSum
+ *
+ * PARAMETERS: DT_WALK_CALLBACK:
+ * Subtable - Subtable
+ * Context - Unused
+ * ReturnValue - Store the checksum of subtable
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Get the checksum of subtable
+ *
+ *****************************************************************************/
+
+static void
+DtSum (
+ DT_SUBTABLE *Subtable,
+ void *Context,
+ void *ReturnValue)
+{
+ UINT8 Checksum;
+ UINT8 *Sum = ReturnValue;
+
+
+ Checksum = AcpiTbChecksum (Subtable->Buffer, Subtable->Length);
+ *Sum = (UINT8) (*Sum + Checksum);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtSetTableChecksum
+ *
+ * PARAMETERS: ChecksumPointer - Where to return the checksum
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Set checksum of the whole data table into the checksum field
+ *
+ *****************************************************************************/
+
+void
+DtSetTableChecksum (
+ UINT8 *ChecksumPointer)
+{
+ UINT8 Checksum = 0;
+ UINT8 OldSum;
+
+
+ DtWalkTableTree (Gbl_RootTable, DtSum, NULL, &Checksum);
+
+ OldSum = *ChecksumPointer;
+ Checksum = (UINT8) (Checksum - OldSum);
+
+ /* Compute the final checksum */
+
+ Checksum = (UINT8) (0 - Checksum);
+ *ChecksumPointer = Checksum;
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtSetTableLength
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Walk the subtables and set all the length fields
+ *
+ *****************************************************************************/
+
+void
+DtSetTableLength (
+ void)
+{
+ DT_SUBTABLE *ParentTable;
+ DT_SUBTABLE *ChildTable;
+
+
+ ParentTable = Gbl_RootTable;
+ ChildTable = NULL;
+
+ if (!ParentTable)
+ {
+ return;
+ }
+
+ DtSetSubtableLength (ParentTable);
+
+ while (1)
+ {
+ ChildTable = DtGetNextSubtable (ParentTable, ChildTable);
+ if (ChildTable)
+ {
+ if (ChildTable->Child)
+ {
+ ParentTable = ChildTable;
+ ChildTable = NULL;
+ }
+ else
+ {
+ ParentTable->TotalLength += ChildTable->TotalLength;
+ if (ParentTable->LengthField)
+ {
+ DtSetSubtableLength (ParentTable);
+ }
+ }
+ }
+ else
+ {
+ ChildTable = ParentTable;
+
+ if (ChildTable == Gbl_RootTable)
+ {
+ break;
+ }
+
+ ParentTable = DtGetParentSubtable (ParentTable);
+
+ ParentTable->TotalLength += ChildTable->TotalLength;
+ if (ParentTable->LengthField)
+ {
+ DtSetSubtableLength (ParentTable);
+ }
+ }
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtWalkTableTree
+ *
+ * PARAMETERS: StartTable - Subtable in the tree where walking begins
+ * UserFunction - Called during the walk
+ * Context - Passed to user function
+ * ReturnValue - The return value of UserFunction
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Performs a depth-first walk of the subtable tree
+ *
+ *****************************************************************************/
+
+void
+DtWalkTableTree (
+ DT_SUBTABLE *StartTable,
+ DT_WALK_CALLBACK UserFunction,
+ void *Context,
+ void *ReturnValue)
+{
+ DT_SUBTABLE *ParentTable;
+ DT_SUBTABLE *ChildTable;
+
+
+ ParentTable = StartTable;
+ ChildTable = NULL;
+
+ if (!ParentTable)
+ {
+ return;
+ }
+
+ UserFunction (ParentTable, Context, ReturnValue);
+
+ while (1)
+ {
+ ChildTable = DtGetNextSubtable (ParentTable, ChildTable);
+ if (ChildTable)
+ {
+ UserFunction (ChildTable, Context, ReturnValue);
+
+ if (ChildTable->Child)
+ {
+ ParentTable = ChildTable;
+ ChildTable = NULL;
+ }
+ }
+ else
+ {
+ ChildTable = ParentTable;
+ if (ChildTable == Gbl_RootTable)
+ {
+ break;
+ }
+
+ ParentTable = DtGetParentSubtable (ParentTable);
+
+ if (ChildTable->Peer == StartTable)
+ {
+ break;
+ }
+ }
+ }
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtFreeFieldList
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Free the field list
+ *
+ *****************************************************************************/
+
+void
+DtFreeFieldList (
+ void)
+{
+ DT_FIELD *Field = Gbl_FieldList;
+ DT_FIELD *NextField;
+
+
+ /* Walk and free entire field list */
+
+ while (Field)
+ {
+ NextField = Field->Next; /* Save link */
+
+ if (!(Field->Flags & DT_FIELD_NOT_ALLOCATED))
+ {
+ ACPI_FREE (Field->Name);
+ ACPI_FREE (Field->Value);
+ }
+
+ ACPI_FREE (Field);
+ Field = NextField;
+ }
+}
diff --git a/debugger/dbcmds.c b/debugger/dbcmds.c
index f8c6496a7dfa..4024b3d260c8 100644
--- a/debugger/dbcmds.c
+++ b/debugger/dbcmds.c
@@ -477,7 +477,7 @@ AcpiDbCheckPredefinedNames (
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForPredefinedNames, NULL, (void *) &Count, NULL);
- AcpiOsPrintf ("Found %d predefined names in the namespace\n", Count);
+ AcpiOsPrintf ("Found %u predefined names in the namespace\n", Count);
}
@@ -619,7 +619,7 @@ AcpiDbBatchExecute (
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbWalkForExecute, NULL, (void *) &Info, NULL);
- AcpiOsPrintf ("Executed %d predefined names in the namespace\n", Info.Count);
+ AcpiOsPrintf ("Executed %u predefined names in the namespace\n", Info.Count);
}
@@ -678,7 +678,7 @@ AcpiDbDisplayTableInfo (
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
{
TableDesc = &AcpiGbl_RootTableList.Tables[i];
- AcpiOsPrintf ("%d ", i);
+ AcpiOsPrintf ("%u ", i);
/* Make sure that the table is mapped */
@@ -1178,7 +1178,7 @@ AcpiDbSetMethodData (
if (Index > ACPI_METHOD_MAX_ARG)
{
- AcpiOsPrintf ("Arg%d - Invalid argument name\n", Index);
+ AcpiOsPrintf ("Arg%u - Invalid argument name\n", Index);
goto Cleanup;
}
@@ -1191,7 +1191,7 @@ AcpiDbSetMethodData (
ObjDesc = WalkState->Arguments[Index].Object;
- AcpiOsPrintf ("Arg%d: ", Index);
+ AcpiOsPrintf ("Arg%u: ", Index);
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
break;
@@ -1201,7 +1201,7 @@ AcpiDbSetMethodData (
if (Index > ACPI_METHOD_MAX_LOCAL)
{
- AcpiOsPrintf ("Local%d - Invalid local variable name\n", Index);
+ AcpiOsPrintf ("Local%u - Invalid local variable name\n", Index);
goto Cleanup;
}
@@ -1214,7 +1214,7 @@ AcpiDbSetMethodData (
ObjDesc = WalkState->LocalVariables[Index].Object;
- AcpiOsPrintf ("Local%d: ", Index);
+ AcpiOsPrintf ("Local%u: ", Index);
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
break;
@@ -1938,7 +1938,7 @@ AcpiDbCheckIntegrity (
(void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
AcpiDbIntegrityWalk, NULL, (void *) &Info, NULL);
- AcpiOsPrintf ("Verified %d namespace nodes with %d Objects\n",
+ AcpiOsPrintf ("Verified %u namespace nodes with %u Objects\n",
Info.Nodes, Info.Objects);
}
diff --git a/debugger/dbdisply.c b/debugger/dbdisply.c
index a610d802c8d7..3234c367ad7a 100644
--- a/debugger/dbdisply.c
+++ b/debugger/dbdisply.c
@@ -612,7 +612,7 @@ AcpiDbDisplayResults (
for (i = 0; i < ResultCount; i++)
{
ObjDesc = Frame->Results.ObjDesc[Index];
- AcpiOsPrintf ("Result%d: ", i);
+ AcpiOsPrintf ("Result%u: ", i);
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
if (Index == 0)
{
@@ -722,7 +722,7 @@ AcpiDbDisplayObjectType (
{
for (i = 0; i < Info->CompatibleIdList.Count; i++)
{
- AcpiOsPrintf ("CID %d: %s\n", i,
+ AcpiOsPrintf ("CID %u: %s\n", i,
Info->CompatibleIdList.Ids[i].String);
}
}
@@ -854,7 +854,7 @@ AcpiDbDisplayGpes (
GpeType = "GPE Block Device";
}
- AcpiOsPrintf ("\nBlock %d - Info %p DeviceNode %p [%s] - %s\n",
+ AcpiOsPrintf ("\nBlock %u - Info %p DeviceNode %p [%s] - %s\n",
Block, GpeBlock, GpeBlock->Node, Buffer, GpeType);
AcpiOsPrintf (" Registers: %u (%u GPEs)\n",
diff --git a/debugger/dbexec.c b/debugger/dbexec.c
index da21a12589c5..3555e8f63d95 100644
--- a/debugger/dbexec.c
+++ b/debugger/dbexec.c
@@ -602,7 +602,7 @@ AcpiDbMethodThread (
#if 0
if ((i % 100) == 0)
{
- AcpiOsPrintf ("%d executions, Thread 0x%x\n", i, AcpiOsGetThreadId ());
+ AcpiOsPrintf ("%u executions, Thread 0x%x\n", i, AcpiOsGetThreadId ());
}
if (ReturnObj.Length)
diff --git a/debugger/dbfileio.c b/debugger/dbfileio.c
index c6f2e253accf..d268d7db636c 100644
--- a/debugger/dbfileio.c
+++ b/debugger/dbfileio.c
@@ -289,7 +289,7 @@ AcpiDbCheckTextModeCorruption (
* meaning that we cannot simply replace CR/LF pairs with LFs.
*/
AcpiOsPrintf ("Table has been corrupted by text mode conversion\n");
- AcpiOsPrintf ("All LFs (%d) were changed to CR/LF pairs\n", Pairs);
+ AcpiOsPrintf ("All LFs (%u) were changed to CR/LF pairs\n", Pairs);
AcpiOsPrintf ("Table cannot be repaired!\n");
return (AE_BAD_VALUE);
}
diff --git a/debugger/dbhistry.c b/debugger/dbhistry.c
index 613711e0fd23..edb81e96c2d7 100644
--- a/debugger/dbhistry.c
+++ b/debugger/dbhistry.c
@@ -284,7 +284,7 @@ AcpiDbGetFromHistory (
}
}
- AcpiOsPrintf ("Invalid history number: %d\n", HistoryIndex);
+ AcpiOsPrintf ("Invalid history number: %u\n", HistoryIndex);
return (NULL);
}
diff --git a/debugger/dbinput.c b/debugger/dbinput.c
index 29b51b6d7523..429a8b8143d7 100644
--- a/debugger/dbinput.c
+++ b/debugger/dbinput.c
@@ -613,7 +613,7 @@ AcpiDbCommandDispatch (
if (ParamCount < AcpiGbl_DbCommands[CommandIndex].MinArgs)
{
- AcpiOsPrintf ("%d parameters entered, [%s] requires %d parameters\n",
+ AcpiOsPrintf ("%u parameters entered, [%s] requires %u parameters\n",
ParamCount, AcpiGbl_DbCommands[CommandIndex].Name,
AcpiGbl_DbCommands[CommandIndex].MinArgs);
diff --git a/debugger/dbutils.c b/debugger/dbutils.c
index 19ff3f02a2ae..48429750e4db 100644
--- a/debugger/dbutils.c
+++ b/debugger/dbutils.c
@@ -291,7 +291,7 @@ AcpiDbDumpExternalObject (
case ACPI_TYPE_PACKAGE:
- AcpiOsPrintf ("[Package] Contains %d Elements:\n",
+ AcpiOsPrintf ("[Package] Contains %u Elements:\n",
ObjDesc->Package.Count);
for (i = 0; i < ObjDesc->Package.Count; i++)
diff --git a/disassembler/dmobject.c b/disassembler/dmobject.c
index 6156caed5952..7eee30268edf 100644
--- a/disassembler/dmobject.c
+++ b/disassembler/dmobject.c
@@ -289,7 +289,7 @@ AcpiDmDecodeInternalObject (
case ACPI_TYPE_STRING:
- AcpiOsPrintf ("(%d) \"%.24s",
+ AcpiOsPrintf ("(%u) \"%.24s",
ObjDesc->String.Length, ObjDesc->String.Pointer);
if (ObjDesc->String.Length > 24)
@@ -305,7 +305,7 @@ AcpiDmDecodeInternalObject (
case ACPI_TYPE_BUFFER:
- AcpiOsPrintf ("(%d)", ObjDesc->Buffer.Length);
+ AcpiOsPrintf ("(%u)", ObjDesc->Buffer.Length);
for (i = 0; (i < 8) && (i < ObjDesc->Buffer.Length); i++)
{
AcpiOsPrintf (" %2.2X", ObjDesc->Buffer.Pointer[i]);
@@ -651,7 +651,7 @@ AcpiDmDisplayArguments (
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
{
ObjDesc = WalkState->Arguments[i].Object;
- AcpiOsPrintf (" Arg%d: ", i);
+ AcpiOsPrintf (" Arg%u: ", i);
AcpiDmDisplayInternalObject (ObjDesc, WalkState);
}
}
diff --git a/disassembler/dmopcode.c b/disassembler/dmopcode.c
index bbc3a2d27f8f..baeb5add56b2 100644
--- a/disassembler/dmopcode.c
+++ b/disassembler/dmopcode.c
@@ -163,7 +163,7 @@ AcpiDmMethodFlags (
/* 1) Method argument count */
- AcpiOsPrintf (", %d, ", Args);
+ AcpiOsPrintf (", %u, ", Args);
/* 2) Serialize rule */
@@ -178,7 +178,7 @@ AcpiDmMethodFlags (
if (Flags & 0xF0)
{
- AcpiOsPrintf (", %d", Flags >> 4);
+ AcpiOsPrintf (", %u", Flags >> 4);
}
}
@@ -550,7 +550,7 @@ AcpiDmDisassembleOneOp (
case AML_INT_NAMEDFIELD_OP:
Length = AcpiDmDumpName (Op->Named.Name);
- AcpiOsPrintf (",%*.s %d", (int) (5 - Length), " ",
+ AcpiOsPrintf (",%*.s %u", (unsigned) (5 - Length), " ",
(UINT32) Op->Common.Value.Integer);
AcpiDmCommaIfFieldMember (Op);
@@ -571,7 +571,7 @@ AcpiDmDisassembleOneOp (
}
else
{
- AcpiOsPrintf (" , %d", Offset);
+ AcpiOsPrintf (" , %u", Offset);
}
AcpiDmCommaIfFieldMember (Op);
diff --git a/disassembler/dmresrc.c b/disassembler/dmresrc.c
index 12bde688d4c9..2679c2d6423c 100644
--- a/disassembler/dmresrc.c
+++ b/disassembler/dmresrc.c
@@ -290,7 +290,7 @@ AcpiDmBitList (
AcpiOsPrintf (",");
}
Previous = TRUE;
- AcpiOsPrintf ("%d", i);
+ AcpiOsPrintf ("%u", i);
}
Mask >>= 1;
diff --git a/dispatcher/dsinit.c b/dispatcher/dsinit.c
index 4525a0bc4fe4..a75bf91dda3a 100644
--- a/dispatcher/dsinit.c
+++ b/dispatcher/dsinit.c
@@ -263,12 +263,12 @@ AcpiDsInitializeObjects (
"**** Starting initialization of namespace objects ****\n"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
- Info.MethodCount = 0;
- Info.OpRegionCount = 0;
- Info.ObjectCount = 0;
- Info.DeviceCount = 0;
- Info.TableIndex = TableIndex;
- Info.OwnerId = OwnerId;
+ /* Set all init info to zero */
+
+ ACPI_MEMSET (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
+
+ Info.OwnerId = OwnerId;
+ Info.TableIndex = TableIndex;
/* Walk entire namespace from the supplied root */
@@ -297,12 +297,12 @@ AcpiDsInitializeObjects (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
- "\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
+ "\nTable [%4.4s](id %4.4X) - %u Objects with %u Devices %u Methods %u Regions\n",
Table->Signature, OwnerId, Info.ObjectCount,
Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "%hd Methods, %hd Regions\n", Info.MethodCount, Info.OpRegionCount));
+ "%u Methods, %u Regions\n", Info.MethodCount, Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}
diff --git a/dispatcher/dsmethod.c b/dispatcher/dsmethod.c
index 969c9ca23e39..37d5f206e6dd 100644
--- a/dispatcher/dsmethod.c
+++ b/dispatcher/dsmethod.c
@@ -700,7 +700,18 @@ AcpiDsTerminateControlMethod (
*/
if (!(MethodDesc->Method.Flags & AOPOBJ_MODULE_LEVEL))
{
- AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
+ /* Delete any direct children of (created by) this method */
+
+ AcpiNsDeleteNamespaceSubtree (WalkState->MethodNode);
+
+ /*
+ * Delete any objects that were created by this method
+ * elsewhere in the namespace (if any were created).
+ */
+ if (MethodDesc->Method.Flags & AOPOBJ_MODIFIED_NAMESPACE)
+ {
+ AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
+ }
}
}
@@ -725,7 +736,7 @@ AcpiDsTerminateControlMethod (
* we immediately reuse it for the next thread executing this method
*/
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "*** Completed execution of one thread, %d threads remaining\n",
+ "*** Completed execution of one thread, %u threads remaining\n",
MethodDesc->Method.ThreadCount));
}
else
diff --git a/dispatcher/dsmthdat.c b/dispatcher/dsmthdat.c
index 54678921bc1b..3d17763cf13e 100644
--- a/dispatcher/dsmthdat.c
+++ b/dispatcher/dsmthdat.c
@@ -188,8 +188,7 @@ AcpiDsMethodDataInit (
WalkState->Arguments[i].Name.Integer |= (i << 24);
WalkState->Arguments[i].DescriptorType = ACPI_DESC_TYPE_NAMED;
WalkState->Arguments[i].Type = ACPI_TYPE_ANY;
- WalkState->Arguments[i].Flags =
- ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_ARG;
+ WalkState->Arguments[i].Flags = ANOBJ_METHOD_ARG;
}
/* Init the method locals */
@@ -201,8 +200,7 @@ AcpiDsMethodDataInit (
WalkState->LocalVariables[i].Name.Integer |= (i << 24);
WalkState->LocalVariables[i].DescriptorType = ACPI_DESC_TYPE_NAMED;
WalkState->LocalVariables[i].Type = ACPI_TYPE_ANY;
- WalkState->LocalVariables[i].Flags =
- ANOBJ_END_OF_PEER_LIST | ANOBJ_METHOD_LOCAL;
+ WalkState->LocalVariables[i].Flags = ANOBJ_METHOD_LOCAL;
}
return_VOID;
@@ -238,7 +236,7 @@ AcpiDsMethodDataDeleteAll (
{
if (WalkState->LocalVariables[Index].Object)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%d=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Local%u=%p\n",
Index, WalkState->LocalVariables[Index].Object));
/* Detach object (if present) and remove a reference */
@@ -253,7 +251,7 @@ AcpiDsMethodDataDeleteAll (
{
if (WalkState->Arguments[Index].Object)
{
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%d=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Deleting Arg%u=%p\n",
Index, WalkState->Arguments[Index].Object));
/* Detach object (if present) and remove a reference */
@@ -322,7 +320,7 @@ AcpiDsMethodDataInitArgs (
Index++;
}
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%d args passed to method\n", Index));
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%u args passed to method\n", Index));
return_ACPI_STATUS (AE_OK);
}
@@ -429,7 +427,7 @@ AcpiDsMethodDataSetValue (
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "NewObj %p Type %2.2X, Refs=%d [%s]\n", Object,
+ "NewObj %p Type %2.2X, Refs=%u [%s]\n", Object,
Type, Object->Common.ReferenceCount,
AcpiUtGetTypeName (Object->Common.Type)));
@@ -667,7 +665,7 @@ AcpiDsStoreObjectToLocal (
ACPI_FUNCTION_TRACE (DsStoreObjectToLocal);
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Type=%2.2X Index=%d Obj=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Type=%2.2X Index=%u Obj=%p\n",
Type, Index, ObjDesc));
/* Parameter validation */
diff --git a/dispatcher/dsopcode.c b/dispatcher/dsopcode.c
index e7ebc765301a..9d0941d8d502 100644
--- a/dispatcher/dsopcode.c
+++ b/dispatcher/dsopcode.c
@@ -307,7 +307,7 @@ AcpiDsGetBufferFieldArguments (
/* Execute the AML code for the TermArg arguments */
- Status = AcpiDsExecuteArguments (Node, AcpiNsGetParentNode (Node),
+ Status = AcpiDsExecuteArguments (Node, Node->Parent,
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
return_ACPI_STATUS (Status);
}
@@ -354,7 +354,7 @@ AcpiDsGetBankFieldArguments (
/* Execute the AML code for the TermArg arguments */
- Status = AcpiDsExecuteArguments (Node, AcpiNsGetParentNode (Node),
+ Status = AcpiDsExecuteArguments (Node, Node->Parent,
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
return_ACPI_STATUS (Status);
}
@@ -505,7 +505,7 @@ AcpiDsGetRegionArguments (
/* Execute the argument AML */
- Status = AcpiDsExecuteArguments (Node, AcpiNsGetParentNode (Node),
+ Status = AcpiDsExecuteArguments (Node, Node->Parent,
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
return_ACPI_STATUS (Status);
}
diff --git a/dispatcher/dsutils.c b/dispatcher/dsutils.c
index 8eb8b3dbbd6f..7eb06372660f 100644
--- a/dispatcher/dsutils.c
+++ b/dispatcher/dsutils.c
@@ -875,7 +875,7 @@ AcpiDsCreateOperands (
Index--;
- ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Arg #%d (%p) done, Arg1=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Arg #%u (%p) done, Arg1=%p\n",
Index, Arg, FirstArg));
}
@@ -890,7 +890,7 @@ Cleanup:
*/
AcpiDsObjStackPopAndDelete (ArgCount, WalkState);
- ACPI_EXCEPTION ((AE_INFO, Status, "While creating Arg %d", Index));
+ ACPI_EXCEPTION ((AE_INFO, Status, "While creating Arg %u", Index));
return_ACPI_STATUS (Status);
}
diff --git a/events/evgpeutil.c b/events/evgpeutil.c
index 2ac0ad448090..1bd42b2cac1d 100644
--- a/events/evgpeutil.c
+++ b/events/evgpeutil.c
@@ -114,7 +114,6 @@
*****************************************************************************/
-
#include "acpi.h"
#include "accommon.h"
#include "acevents.h"
diff --git a/events/evrgnini.c b/events/evrgnini.c
index 8a6cbfd94155..1cce564ca8e7 100644
--- a/events/evrgnini.c
+++ b/events/evrgnini.c
@@ -294,7 +294,7 @@ AcpiEvPciConfigRegionSetup (
return_ACPI_STATUS (Status);
}
- ParentNode = AcpiNsGetParentNode (RegionObj->Region.Node);
+ ParentNode = RegionObj->Region.Node->Parent;
/*
* Get the _SEG and _BBN values from the device upon which the handler
@@ -348,7 +348,7 @@ AcpiEvPciConfigRegionSetup (
break;
}
- PciRootNode = AcpiNsGetParentNode (PciRootNode);
+ PciRootNode = PciRootNode->Parent;
}
/* PCI root bridge not found, use namespace root node */
@@ -385,7 +385,7 @@ AcpiEvPciConfigRegionSetup (
PciDeviceNode = RegionObj->Region.Node;
while (PciDeviceNode && (PciDeviceNode->Type != ACPI_TYPE_DEVICE))
{
- PciDeviceNode = AcpiNsGetParentNode (PciDeviceNode);
+ PciDeviceNode = PciDeviceNode->Parent;
}
if (!PciDeviceNode)
@@ -661,7 +661,7 @@ AcpiEvInitializeRegion (
return_ACPI_STATUS (AE_NOT_EXIST);
}
- Node = AcpiNsGetParentNode (RegionObj->Region.Node);
+ Node = RegionObj->Region.Node->Parent;
SpaceId = RegionObj->Region.SpaceId;
/* Setup defaults */
@@ -785,7 +785,7 @@ AcpiEvInitializeRegion (
/* This node does not have the handler we need; Pop up one level */
- Node = AcpiNsGetParentNode (Node);
+ Node = Node->Parent;
}
/* If we get here, there is no handler for this region */
diff --git a/executer/exdump.c b/executer/exdump.c
index 5ef9fe83c77a..404a54351f44 100644
--- a/executer/exdump.c
+++ b/executer/exdump.c
@@ -864,7 +864,7 @@ AcpiExDumpOperands (
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "**** Start operand dump for opcode [%s], %d operands\n",
+ "**** Start operand dump for opcode [%s], %u operands\n",
OpcodeName, NumOperands));
if (NumOperands == 0)
@@ -948,7 +948,7 @@ AcpiExDumpNamespaceNode (
AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node));
AcpiExOutString ("Type", AcpiUtGetTypeName (Node->Type));
AcpiExOutPointer ("Attached Object", AcpiNsGetAttachedObject (Node));
- AcpiExOutPointer ("Parent", AcpiNsGetParentNode (Node));
+ AcpiExOutPointer ("Parent", Node->Parent);
AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node),
AcpiExDumpNode);
@@ -1096,7 +1096,7 @@ AcpiExDumpPackageObj (
case ACPI_TYPE_PACKAGE:
- AcpiOsPrintf ("[Package] Contains %d Elements:\n",
+ AcpiOsPrintf ("[Package] Contains %u Elements:\n",
ObjDesc->Package.Count);
for (i = 0; i < ObjDesc->Package.Count; i++)
diff --git a/executer/exfldio.c b/executer/exfldio.c
index 0cff9f94d9c2..5ba1b44c5568 100644
--- a/executer/exfldio.c
+++ b/executer/exfldio.c
@@ -202,8 +202,8 @@ AcpiExSetupRegion (
}
/*
- * Exit now for SMBus or IPMI address space, it has a non-linear address space
- * and the request cannot be directly validated
+ * Exit now for SMBus or IPMI address space, it has a non-linear
+ * address space and the request cannot be directly validated
*/
if (RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_IPMI)
@@ -233,8 +233,7 @@ AcpiExSetupRegion (
* (Region length is specified in bytes)
*/
if (RgnDesc->Region.Length <
- (ObjDesc->CommonField.BaseByteOffset +
- FieldDatumByteOffset +
+ (ObjDesc->CommonField.BaseByteOffset + FieldDatumByteOffset +
ObjDesc->CommonField.AccessByteWidth))
{
if (AcpiGbl_EnableInterpreterSlack)
@@ -644,14 +643,14 @@ AcpiExFieldDatumIo (
if (ReadWrite == ACPI_READ)
{
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Value Read %8.8X%8.8X, Width %d\n",
+ "Value Read %8.8X%8.8X, Width %u\n",
ACPI_FORMAT_UINT64 (*Value),
ObjDesc->CommonField.AccessByteWidth));
}
else
{
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Value Written %8.8X%8.8X, Width %d\n",
+ "Value Written %8.8X%8.8X, Width %u\n",
ACPI_FORMAT_UINT64 (*Value),
ObjDesc->CommonField.AccessByteWidth));
}
@@ -794,6 +793,7 @@ AcpiExExtractFromField (
UINT32 BufferTailBits;
UINT32 DatumCount;
UINT32 FieldDatumCount;
+ UINT32 AccessBitWidth;
UINT32 i;
@@ -803,7 +803,7 @@ AcpiExExtractFromField (
/* Validate target buffer and clear it */
if (BufferLength <
- ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->CommonField.BitLength))
+ ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->CommonField.BitLength))
{
ACPI_ERROR ((AE_INFO,
"Field size %u (bits) is too large for buffer (%u)",
@@ -811,17 +811,37 @@ AcpiExExtractFromField (
return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
}
+
ACPI_MEMSET (Buffer, 0, BufferLength);
+ AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth);
+
+ /* Handle the simple case here */
+
+ if ((ObjDesc->CommonField.StartFieldBitOffset == 0) &&
+ (ObjDesc->CommonField.BitLength == AccessBitWidth))
+ {
+ Status = AcpiExFieldDatumIo (ObjDesc, 0, Buffer, ACPI_READ);
+ return_ACPI_STATUS (Status);
+ }
+
+/* TBD: Move to common setup code */
+
+ /* Field algorithm is limited to sizeof(UINT64), truncate if needed */
+
+ if (ObjDesc->CommonField.AccessByteWidth > sizeof (UINT64))
+ {
+ ObjDesc->CommonField.AccessByteWidth = sizeof (UINT64);
+ AccessBitWidth = sizeof (UINT64) * 8;
+ }
/* Compute the number of datums (access width data items) */
DatumCount = ACPI_ROUND_UP_TO (
- ObjDesc->CommonField.BitLength,
- ObjDesc->CommonField.AccessBitWidth);
+ ObjDesc->CommonField.BitLength, AccessBitWidth);
+
FieldDatumCount = ACPI_ROUND_UP_TO (
- ObjDesc->CommonField.BitLength +
- ObjDesc->CommonField.StartFieldBitOffset,
- ObjDesc->CommonField.AccessBitWidth);
+ ObjDesc->CommonField.BitLength +
+ ObjDesc->CommonField.StartFieldBitOffset, AccessBitWidth);
/* Priming read from the field */
@@ -854,12 +874,11 @@ AcpiExExtractFromField (
* This avoids the differences in behavior between different compilers
* concerning shift values larger than the target data width.
*/
- if ((ObjDesc->CommonField.AccessBitWidth -
- ObjDesc->CommonField.StartFieldBitOffset) < ACPI_INTEGER_BIT_SIZE)
+ if (AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset <
+ ACPI_INTEGER_BIT_SIZE)
{
MergedDatum |= RawDatum <<
- (ObjDesc->CommonField.AccessBitWidth -
- ObjDesc->CommonField.StartFieldBitOffset);
+ (AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset);
}
if (i == DatumCount)
@@ -879,8 +898,7 @@ AcpiExExtractFromField (
/* Mask off any extra bits in the last datum */
- BufferTailBits = ObjDesc->CommonField.BitLength %
- ObjDesc->CommonField.AccessBitWidth;
+ BufferTailBits = ObjDesc->CommonField.BitLength % AccessBitWidth;
if (BufferTailBits)
{
MergedDatum &= ACPI_MASK_BITS_ABOVE (BufferTailBits);
@@ -916,6 +934,7 @@ AcpiExInsertIntoField (
void *Buffer,
UINT32 BufferLength)
{
+ void *NewBuffer;
ACPI_STATUS Status;
UINT64 Mask;
UINT64 WidthMask;
@@ -926,9 +945,9 @@ AcpiExInsertIntoField (
UINT32 BufferTailBits;
UINT32 DatumCount;
UINT32 FieldDatumCount;
- UINT32 i;
+ UINT32 AccessBitWidth;
UINT32 RequiredLength;
- void *NewBuffer;
+ UINT32 i;
ACPI_FUNCTION_TRACE (ExInsertIntoField);
@@ -965,31 +984,41 @@ AcpiExInsertIntoField (
BufferLength = RequiredLength;
}
+/* TBD: Move to common setup code */
+
+ /* Algo is limited to sizeof(UINT64), so cut the AccessByteWidth */
+ if (ObjDesc->CommonField.AccessByteWidth > sizeof (UINT64))
+ {
+ ObjDesc->CommonField.AccessByteWidth = sizeof (UINT64);
+ }
+
+ AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth);
+
/*
* Create the bitmasks used for bit insertion.
* Note: This if/else is used to bypass compiler differences with the
* shift operator
*/
- if (ObjDesc->CommonField.AccessBitWidth == ACPI_INTEGER_BIT_SIZE)
+ if (AccessBitWidth == ACPI_INTEGER_BIT_SIZE)
{
WidthMask = ACPI_UINT64_MAX;
}
else
{
- WidthMask = ACPI_MASK_BITS_ABOVE (ObjDesc->CommonField.AccessBitWidth);
+ WidthMask = ACPI_MASK_BITS_ABOVE (AccessBitWidth);
}
Mask = WidthMask &
- ACPI_MASK_BITS_BELOW (ObjDesc->CommonField.StartFieldBitOffset);
+ ACPI_MASK_BITS_BELOW (ObjDesc->CommonField.StartFieldBitOffset);
/* Compute the number of datums (access width data items) */
DatumCount = ACPI_ROUND_UP_TO (ObjDesc->CommonField.BitLength,
- ObjDesc->CommonField.AccessBitWidth);
+ AccessBitWidth);
FieldDatumCount = ACPI_ROUND_UP_TO (ObjDesc->CommonField.BitLength +
- ObjDesc->CommonField.StartFieldBitOffset,
- ObjDesc->CommonField.AccessBitWidth);
+ ObjDesc->CommonField.StartFieldBitOffset,
+ AccessBitWidth);
/* Get initial Datum from the input buffer */
@@ -1024,12 +1053,11 @@ AcpiExInsertIntoField (
* This avoids the differences in behavior between different compilers
* concerning shift values larger than the target data width.
*/
- if ((ObjDesc->CommonField.AccessBitWidth -
- ObjDesc->CommonField.StartFieldBitOffset) < ACPI_INTEGER_BIT_SIZE)
+ if ((AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset) <
+ ACPI_INTEGER_BIT_SIZE)
{
MergedDatum = RawDatum >>
- (ObjDesc->CommonField.AccessBitWidth -
- ObjDesc->CommonField.StartFieldBitOffset);
+ (AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset);
}
else
{
@@ -1048,15 +1076,15 @@ AcpiExInsertIntoField (
BufferOffset += ObjDesc->CommonField.AccessByteWidth;
ACPI_MEMCPY (&RawDatum, ((char *) Buffer) + BufferOffset,
ACPI_MIN(ObjDesc->CommonField.AccessByteWidth,
- BufferLength - BufferOffset));
+ BufferLength - BufferOffset));
+
MergedDatum |= RawDatum << ObjDesc->CommonField.StartFieldBitOffset;
}
/* Mask off any extra bits in the last datum */
BufferTailBits = (ObjDesc->CommonField.BitLength +
- ObjDesc->CommonField.StartFieldBitOffset) %
- ObjDesc->CommonField.AccessBitWidth;
+ ObjDesc->CommonField.StartFieldBitOffset) % AccessBitWidth;
if (BufferTailBits)
{
Mask &= ACPI_MASK_BITS_ABOVE (BufferTailBits);
diff --git a/executer/exprep.c b/executer/exprep.c
index 6cc371945157..624140497355 100644
--- a/executer/exprep.c
+++ b/executer/exprep.c
@@ -193,12 +193,12 @@ AcpiExGenerateAccess (
FieldByteLength = FieldByteEndOffset - FieldByteOffset;
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Bit length %d, Bit offset %d\n",
- FieldBitLength, FieldBitOffset));
+ "Bit length %u, Bit offset %u\n",
+ FieldBitLength, FieldBitOffset));
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Byte Length %d, Byte Offset %d, End Offset %d\n",
- FieldByteLength, FieldByteOffset, FieldByteEndOffset));
+ "Byte Length %u, Byte Offset %u, End Offset %u\n",
+ FieldByteLength, FieldByteOffset, FieldByteEndOffset));
/*
* Iterative search for the maximum access width that is both aligned
@@ -228,18 +228,18 @@ AcpiExGenerateAccess (
Accesses = FieldEndOffset - FieldStartOffset;
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "AccessWidth %d end is within region\n", AccessByteWidth));
+ "AccessWidth %u end is within region\n", AccessByteWidth));
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Field Start %d, Field End %d -- requires %d accesses\n",
- FieldStartOffset, FieldEndOffset, Accesses));
+ "Field Start %u, Field End %u -- requires %u accesses\n",
+ FieldStartOffset, FieldEndOffset, Accesses));
/* Single access is optimal */
if (Accesses <= 1)
{
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Entire field can be accessed with one operation of size %d\n",
+ "Entire field can be accessed with one operation of size %u\n",
AccessByteWidth));
return_VALUE (AccessByteWidth);
}
@@ -257,11 +257,11 @@ AcpiExGenerateAccess (
else
{
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "AccessWidth %d end is NOT within region\n", AccessByteWidth));
+ "AccessWidth %u end is NOT within region\n", AccessByteWidth));
if (AccessByteWidth == 1)
{
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Field goes beyond end-of-region!\n"));
+ "Field goes beyond end-of-region!\n"));
/* Field does not fit in the region at all */
@@ -273,8 +273,8 @@ AcpiExGenerateAccess (
* previous access
*/
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Backing off to previous optimal access width of %d\n",
- MinimumAccessWidth));
+ "Backing off to previous optimal access width of %u\n",
+ MinimumAccessWidth));
return_VALUE (MinimumAccessWidth);
}
}
@@ -284,7 +284,7 @@ AcpiExGenerateAccess (
* just use max access width
*/
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
- "Cannot access field in one operation, using width 8\n"));
+ "Cannot access field in one operation, using width 8\n"));
return_VALUE (8);
}
#endif /* ACPI_UNDER_DEVELOPMENT */
@@ -444,18 +444,16 @@ AcpiExPrepCommonFieldObject (
* the same (equivalent) as the ByteAlignment.
*/
AccessBitWidth = AcpiExDecodeFieldAccess (ObjDesc, FieldFlags,
- &ByteAlignment);
+ &ByteAlignment);
if (!AccessBitWidth)
{
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
- /* Setup width (access granularity) fields */
+ /* Setup width (access granularity) fields (values are: 1, 2, 4, 8) */
ObjDesc->CommonField.AccessByteWidth = (UINT8)
- ACPI_DIV_8 (AccessBitWidth); /* 1, 2, 4, 8 */
-
- ObjDesc->CommonField.AccessBitWidth = (UINT8) AccessBitWidth;
+ ACPI_DIV_8 (AccessBitWidth);
/*
* BaseByteOffset is the address of the start of the field within the
@@ -468,9 +466,9 @@ AcpiExPrepCommonFieldObject (
* region or buffer.
*/
NearestByteAddress =
- ACPI_ROUND_BITS_DOWN_TO_BYTES (FieldBitPosition);
+ ACPI_ROUND_BITS_DOWN_TO_BYTES (FieldBitPosition);
ObjDesc->CommonField.BaseByteOffset = (UINT32)
- ACPI_ROUND_DOWN (NearestByteAddress, ByteAlignment);
+ ACPI_ROUND_DOWN (NearestByteAddress, ByteAlignment);
/*
* StartFieldBitOffset is the offset of the first bit of the field within
@@ -479,16 +477,6 @@ AcpiExPrepCommonFieldObject (
ObjDesc->CommonField.StartFieldBitOffset = (UINT8)
(FieldBitPosition - ACPI_MUL_8 (ObjDesc->CommonField.BaseByteOffset));
- /*
- * Does the entire field fit within a single field access element? (datum)
- * (i.e., without crossing a datum boundary)
- */
- if ((ObjDesc->CommonField.StartFieldBitOffset + FieldBitLength) <=
- (UINT16) AccessBitWidth)
- {
- ObjDesc->Common.Flags |= AOPOBJ_SINGLE_DATUM;
- }
-
return_ACPI_STATUS (AE_OK);
}
@@ -512,8 +500,9 @@ AcpiExPrepFieldValue (
{
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *SecondDesc = NULL;
- UINT32 Type;
ACPI_STATUS Status;
+ UINT32 AccessByteWidth;
+ UINT32 Type;
ACPI_FUNCTION_TRACE (ExPrepFieldValue);
@@ -532,8 +521,7 @@ AcpiExPrepFieldValue (
Type = AcpiNsGetType (Info->RegionNode);
if (Type != ACPI_TYPE_REGION)
{
- ACPI_ERROR ((AE_INFO,
- "Needed Region, found type 0x%X (%s)",
+ ACPI_ERROR ((AE_INFO, "Needed Region, found type 0x%X (%s)",
Type, AcpiUtGetTypeName (Type)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
@@ -551,8 +539,9 @@ AcpiExPrepFieldValue (
/* Initialize areas of the object that are common to all fields */
ObjDesc->CommonField.Node = Info->FieldNode;
- Status = AcpiExPrepCommonFieldObject (ObjDesc, Info->FieldFlags,
- Info->Attribute, Info->FieldBitPosition, Info->FieldBitLength);
+ Status = AcpiExPrepCommonFieldObject (ObjDesc,
+ Info->FieldFlags, Info->Attribute,
+ Info->FieldBitPosition, Info->FieldBitLength);
if (ACPI_FAILURE (Status))
{
AcpiUtDeleteObjectDesc (ObjDesc);
@@ -567,6 +556,22 @@ AcpiExPrepFieldValue (
ObjDesc->Field.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode);
+ /* Allow full data read from EC address space */
+
+ if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
+ (ObjDesc->CommonField.BitLength > 8))
+ {
+ AccessByteWidth = ACPI_ROUND_BITS_UP_TO_BYTES (
+ ObjDesc->CommonField.BitLength);
+
+ /* Maximum byte width supported is 255 */
+
+ if (AccessByteWidth < 256)
+ {
+ ObjDesc->CommonField.AccessByteWidth = (UINT8) AccessByteWidth;
+ }
+ }
+
/* An additional reference for the container */
AcpiUtAddReference (ObjDesc->Field.RegionObj);
@@ -580,11 +585,11 @@ AcpiExPrepFieldValue (
case ACPI_TYPE_LOCAL_BANK_FIELD:
- ObjDesc->BankField.Value = Info->BankValue;
- ObjDesc->BankField.RegionObj = AcpiNsGetAttachedObject (
- Info->RegionNode);
- ObjDesc->BankField.BankObj = AcpiNsGetAttachedObject (
- Info->RegisterNode);
+ ObjDesc->BankField.Value = Info->BankValue;
+ ObjDesc->BankField.RegionObj =
+ AcpiNsGetAttachedObject (Info->RegionNode);
+ ObjDesc->BankField.BankObj =
+ AcpiNsGetAttachedObject (Info->RegisterNode);
/* An additional reference for the attached objects */
@@ -604,9 +609,11 @@ AcpiExPrepFieldValue (
* opcode and operands -- since the BankValue
* operands must be evaluated.
*/
- SecondDesc = ObjDesc->Common.NextObject;
- SecondDesc->Extra.AmlStart = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Info->DataRegisterNode)->Named.Data;
- SecondDesc->Extra.AmlLength = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Info->DataRegisterNode)->Named.Length;
+ SecondDesc = ObjDesc->Common.NextObject;
+ SecondDesc->Extra.AmlStart = ACPI_CAST_PTR (ACPI_PARSE_OBJECT,
+ Info->DataRegisterNode)->Named.Data;
+ SecondDesc->Extra.AmlLength = ACPI_CAST_PTR (ACPI_PARSE_OBJECT,
+ Info->DataRegisterNode)->Named.Length;
break;
@@ -615,10 +622,10 @@ AcpiExPrepFieldValue (
/* Get the Index and Data registers */
- ObjDesc->IndexField.IndexObj = AcpiNsGetAttachedObject (
- Info->RegisterNode);
- ObjDesc->IndexField.DataObj = AcpiNsGetAttachedObject (
- Info->DataRegisterNode);
+ ObjDesc->IndexField.IndexObj =
+ AcpiNsGetAttachedObject (Info->RegisterNode);
+ ObjDesc->IndexField.DataObj =
+ AcpiNsGetAttachedObject (Info->DataRegisterNode);
if (!ObjDesc->IndexField.DataObj || !ObjDesc->IndexField.IndexObj)
{
@@ -673,10 +680,10 @@ AcpiExPrepFieldValue (
* preserving the current type of that NamedObj.
*/
Status = AcpiNsAttachObject (Info->FieldNode, ObjDesc,
- AcpiNsGetType (Info->FieldNode));
+ AcpiNsGetType (Info->FieldNode));
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Set NamedObj %p [%4.4s], ObjDesc %p\n",
- Info->FieldNode, AcpiUtGetNodeName (Info->FieldNode), ObjDesc));
+ Info->FieldNode, AcpiUtGetNodeName (Info->FieldNode), ObjDesc));
/* Remove local reference to the object */
diff --git a/executer/exregion.c b/executer/exregion.c
index 2ac8a0e93e05..fb84d030009a 100644
--- a/executer/exregion.c
+++ b/executer/exregion.c
@@ -285,7 +285,7 @@ AcpiExSystemMemorySpaceHandler (
((UINT64) Address - (UINT64) MemInfo->MappedPhysicalAddress);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "System-Memory (width %d) R/W %d Address=%8.8X%8.8X\n",
+ "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",
BitWidth, Function, ACPI_FORMAT_NATIVE_UINT (Address)));
/*
@@ -395,7 +395,7 @@ AcpiExSystemIoSpaceHandler (
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "System-IO (width %d) R/W %d Address=%8.8X%8.8X\n",
+ "System-IO (width %u) R/W %u Address=%8.8X%8.8X\n",
BitWidth, Function, ACPI_FORMAT_NATIVE_UINT (Address)));
/* Decode the function parameter */
@@ -475,7 +475,7 @@ AcpiExPciConfigSpaceHandler (
PciRegister = (UINT16) (UINT32) Address;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "Pci-Config %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
+ "Pci-Config %u (%u) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
Function, BitWidth, PciId->Segment, PciId->Bus, PciId->Device,
PciId->Function, PciRegister));
diff --git a/executer/exsystem.c b/executer/exsystem.c
index 8f4ccfe37140..0217ef53ffac 100644
--- a/executer/exsystem.c
+++ b/executer/exsystem.c
@@ -302,6 +302,15 @@ AcpiExSystemDoSleep (
AcpiExRelinquishInterpreter ();
+ /*
+ * For compatibility with other ACPI implementations and to prevent
+ * accidental deep sleeps, limit the sleep time to something reasonable.
+ */
+ if (HowLong > ACPI_MAX_SLEEP)
+ {
+ HowLong = ACPI_MAX_SLEEP;
+ }
+
AcpiOsSleep (HowLong);
/* And now we must get the interpreter again */
diff --git a/hardware/hwsleep.c b/hardware/hwsleep.c
index d9e38061b7c3..b195512553d2 100644
--- a/hardware/hwsleep.c
+++ b/hardware/hwsleep.c
@@ -396,7 +396,7 @@ AcpiEnterSleepState (
return_ACPI_STATUS (Status);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
- "Entering sleep state [S%d]\n", SleepState));
+ "Entering sleep state [S%u]\n", SleepState));
/* Clear the SLP_EN and SLP_TYP fields */
diff --git a/hardware/hwvalid.c b/hardware/hwvalid.c
index 23b508b0a21f..7f2271bad03b 100644
--- a/hardware/hwvalid.c
+++ b/hardware/hwvalid.c
@@ -316,6 +316,13 @@ AcpiHwReadPort (
UINT32 i;
+ /* Truncate address to 16 bits if requested */
+
+ if (AcpiGbl_TruncateIoAddresses)
+ {
+ Address &= ACPI_UINT16_MAX;
+ }
+
/* Validate the entire request and perform the I/O */
Status = AcpiHwValidateIoRequest (Address, Width);
@@ -383,6 +390,13 @@ AcpiHwWritePort (
UINT32 i;
+ /* Truncate address to 16 bits if requested */
+
+ if (AcpiGbl_TruncateIoAddresses)
+ {
+ Address &= ACPI_UINT16_MAX;
+ }
+
/* Validate the entire request and perform the I/O */
Status = AcpiHwValidateIoRequest (Address, Width);
diff --git a/include/acconfig.h b/include/acconfig.h
index 9417b449dc70..7aa4f47f0943 100644
--- a/include/acconfig.h
+++ b/include/acconfig.h
@@ -193,6 +193,10 @@
#define ACPI_MAX_LOOP_ITERATIONS 0xFFFF
+/* Maximum sleep allowed via Sleep() operator */
+
+#define ACPI_MAX_SLEEP 20000 /* Two seconds */
+
/******************************************************************************
*
diff --git a/include/acdisasm.h b/include/acdisasm.h
index ab32086e2f28..4ab78ce5c14c 100644
--- a/include/acdisasm.h
+++ b/include/acdisasm.h
@@ -131,9 +131,19 @@ typedef const struct acpi_dmtable_info
UINT8 Opcode;
UINT8 Offset;
char *Name;
+ UINT8 Flags;
} ACPI_DMTABLE_INFO;
+#define DT_LENGTH 0x01 /* Field is a subtable length */
+#define DT_FLAG 0x02 /* Field is a flag value */
+#define DT_NON_ZERO 0x04 /* Field must be non-zero */
+
+/* TBD: Not used at this time */
+
+#define DT_OPTIONAL 0x08
+#define DT_COUNT 0x10
+
/*
* Values for Opcode above.
* Note: 0-7 must not change, used as a flag shift value
@@ -173,17 +183,24 @@ typedef const struct acpi_dmtable_info
#define ACPI_DMT_FADTPM 32
#define ACPI_DMT_BUF16 33
#define ACPI_DMT_IVRS 34
+#define ACPI_DMT_BUFFER 35
+#define ACPI_DMT_PCI_PATH 36
typedef
void (*ACPI_DMTABLE_HANDLER) (
ACPI_TABLE_HEADER *Table);
+typedef
+ACPI_STATUS (*ACPI_CMTABLE_HANDLER) (
+ void **PFieldList);
+
typedef struct acpi_dmtable_data
{
char *Signature;
ACPI_DMTABLE_INFO *TableInfo;
ACPI_DMTABLE_HANDLER TableHandler;
+ ACPI_CMTABLE_HANDLER CmTableHandler;
char *Name;
} ACPI_DMTABLE_DATA;
@@ -200,11 +217,18 @@ typedef struct acpi_op_walk_info
} ACPI_OP_WALK_INFO;
+/*
+ * TBD - another copy of this is in asltypes.h, fix
+ */
+#ifndef ASL_WALK_CALLBACK_DEFINED
typedef
ACPI_STATUS (*ASL_WALK_CALLBACK) (
ACPI_PARSE_OBJECT *Op,
UINT32 Level,
void *Context);
+#define ASL_WALK_CALLBACK_DEFINED
+#endif
+
typedef struct acpi_resource_tag
{
@@ -312,6 +336,11 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[];
/*
* dmtable
*/
+
+ACPI_DMTABLE_DATA *
+AcpiDmGetTableData (
+ char *Signature);
+
void
AcpiDmDumpDataTable (
ACPI_TABLE_HEADER *Table);
diff --git a/include/acexcep.h b/include/acexcep.h
index a46de7d82f5e..693c61f18b31 100644
--- a/include/acexcep.h
+++ b/include/acexcep.h
@@ -293,7 +293,7 @@ char const *AcpiGbl_ExceptionNames_Env[] =
"AE_NO_GLOBAL_LOCK",
"AE_ABORT_METHOD",
"AE_SAME_HANDLER",
- "AE_WAKE_ONLY_GPE",
+ "AE_NO_HANDLER",
"AE_OWNER_ID_LIMIT"
};
diff --git a/include/acglobal.h b/include/acglobal.h
index e0f8871fcd09..ec3351e92b93 100644
--- a/include/acglobal.h
+++ b/include/acglobal.h
@@ -199,6 +199,14 @@ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableAmlDebugObject, FALSE);
*/
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CopyDsdtLocally, FALSE);
+/*
+ * Optionally truncate I/O addresses to 16 bits. Provides compatibility
+ * with other ACPI implementations. NOTE: During ACPICA initialization,
+ * this value is set to TRUE if any Windows OSI strings have been
+ * requested by the BIOS.
+ */
+UINT8 ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE);
+
/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
@@ -355,6 +363,7 @@ extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_
ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_GlobalList;
ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_NsNodeList;
ACPI_EXTERN BOOLEAN AcpiGbl_DisplayFinalMemStats;
+ACPI_EXTERN BOOLEAN AcpiGbl_DisableMemTracking;
#endif
diff --git a/include/aclocal.h b/include/aclocal.h
index 1deced01136b..0fca5e0f23d6 100644
--- a/include/aclocal.h
+++ b/include/aclocal.h
@@ -275,8 +275,9 @@ typedef struct acpi_namespace_node
UINT8 Flags; /* Miscellaneous flags */
ACPI_OWNER_ID OwnerId; /* Node creator */
ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */
+ struct acpi_namespace_node *Parent; /* Parent node */
struct acpi_namespace_node *Child; /* First child */
- struct acpi_namespace_node *Peer; /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */
+ struct acpi_namespace_node *Peer; /* First peer */
/*
* The following fields are used by the ASL compiler and disassembler only
@@ -292,7 +293,7 @@ typedef struct acpi_namespace_node
/* Namespace Node flags */
-#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */
+#define ANOBJ_RESERVED 0x01 /* Available for use */
#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */
#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
diff --git a/include/acnamesp.h b/include/acnamesp.h
index 9ddd12e210bc..5895e062fecc 100644
--- a/include/acnamesp.h
+++ b/include/acnamesp.h
@@ -562,13 +562,4 @@ void
AcpiNsTerminate (
void);
-ACPI_NAMESPACE_NODE *
-AcpiNsGetParentNode (
- ACPI_NAMESPACE_NODE *Node);
-
-
-ACPI_NAMESPACE_NODE *
-AcpiNsGetNextValidNode (
- ACPI_NAMESPACE_NODE *Node);
-
#endif /* __ACNAMESP_H__ */
diff --git a/include/acobject.h b/include/acobject.h
index f86f8392679f..ebb656a1b4f3 100644
--- a/include/acobject.h
+++ b/include/acobject.h
@@ -164,13 +164,14 @@
/* Values for Flag byte above */
-#define AOPOBJ_AML_CONSTANT 0x01
-#define AOPOBJ_STATIC_POINTER 0x02
-#define AOPOBJ_DATA_VALID 0x04
-#define AOPOBJ_OBJECT_INITIALIZED 0x08
-#define AOPOBJ_SETUP_COMPLETE 0x10
-#define AOPOBJ_SINGLE_DATUM 0x20
-#define AOPOBJ_MODULE_LEVEL 0x40
+#define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */
+#define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */
+#define AOPOBJ_DATA_VALID 0x04 /* Object is intialized and data is valid */
+#define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */
+#define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */
+#define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */
+#define AOPOBJ_MODULE_LEVEL 0x40 /* Method is actually module-level code */
+#define AOPOBJ_MODIFIED_NAMESPACE 0x80 /* Method modified the namespace */
/******************************************************************************
@@ -385,7 +386,6 @@ typedef struct acpi_object_thermal_zone
UINT32 BaseByteOffset; /* Byte offset within containing object */\
UINT32 Value; /* Value to store into the Bank or Index register */\
UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\
- UINT8 AccessBitWidth; /* Read/Write size in bits (8-64) */
typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
diff --git a/include/acpixf.h b/include/acpixf.h
index 0e68fabfeb05..0a94de302d8e 100644
--- a/include/acpixf.h
+++ b/include/acpixf.h
@@ -120,7 +120,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20100428
+#define ACPI_CA_VERSION 0x20100528
#include "actypes.h"
#include "actbl.h"
@@ -147,6 +147,7 @@ extern ACPI_NAME AcpiGbl_TraceMethodName;
extern UINT32 AcpiGbl_TraceFlags;
extern UINT8 AcpiGbl_EnableAmlDebugObject;
extern UINT8 AcpiGbl_CopyDsdtLocally;
+extern UINT8 AcpiGbl_TruncateIoAddresses;
/*
diff --git a/include/acpredef.h b/include/acpredef.h
index 9b881fb8007a..eb3b646e477f 100644
--- a/include/acpredef.h
+++ b/include/acpredef.h
@@ -577,14 +577,15 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] =
{{"_WAK", 1, ACPI_RTYPE_NONE | ACPI_RTYPE_INTEGER | ACPI_RTYPE_PACKAGE}},
{{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2,0}, 0,0}}, /* Fixed-length (2 Int), but is optional */
+ /* _WDG/_WED are MS extensions defined by "Windows Instrumentation" */
+
+ {{"_WDG", 0, ACPI_RTYPE_BUFFER}},
+ {{"_WED", 1, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER}},
+
{{{0,0,0,0}, 0,0}} /* Table terminator */
};
#if 0
- /* Not implemented */
-
- {{"_WDG", 0, ACPI_RTYPE_BUFFER}}, /* MS Extension */
- {{"_WED", 1, ACPI_RTYPE_PACKAGE}}, /* MS Extension */
/* This is an internally implemented control method, no need to check */
{{"_OSI", 1, ACPI_RTYPE_INTEGER}},
diff --git a/include/acstruct.h b/include/acstruct.h
index d4696b83005d..53cbea421699 100644
--- a/include/acstruct.h
+++ b/include/acstruct.h
@@ -204,23 +204,23 @@ typedef struct acpi_walk_state
} ACPI_WALK_STATE;
-/* Info used by AcpiPsInitObjects */
+/* Info used by AcpiNsInitializeObjects and AcpiDsInitializeObjects */
typedef struct acpi_init_walk_info
{
- UINT16 MethodCount;
- UINT16 DeviceCount;
- UINT16 OpRegionCount;
- UINT16 FieldCount;
- UINT16 BufferCount;
- UINT16 PackageCount;
- UINT16 OpRegionInit;
- UINT16 FieldInit;
- UINT16 BufferInit;
- UINT16 PackageInit;
- UINT16 ObjectCount;
- ACPI_OWNER_ID OwnerId;
UINT32 TableIndex;
+ UINT32 ObjectCount;
+ UINT32 MethodCount;
+ UINT32 DeviceCount;
+ UINT32 OpRegionCount;
+ UINT32 FieldCount;
+ UINT32 BufferCount;
+ UINT32 PackageCount;
+ UINT32 OpRegionInit;
+ UINT32 FieldInit;
+ UINT32 BufferInit;
+ UINT32 PackageInit;
+ ACPI_OWNER_ID OwnerId;
} ACPI_INIT_WALK_INFO;
@@ -294,11 +294,11 @@ typedef struct acpi_evaluate_info
typedef struct acpi_device_walk_info
{
- UINT16 DeviceCount;
- UINT16 Num_STA;
- UINT16 Num_INI;
ACPI_TABLE_DESC *TableDesc;
ACPI_EVALUATE_INFO *EvaluateInfo;
+ UINT32 DeviceCount;
+ UINT32 Num_STA;
+ UINT32 Num_INI;
} ACPI_DEVICE_WALK_INFO;
diff --git a/include/actbl2.h b/include/actbl2.h
index 7f6ecf84a93c..fde9552e43e3 100644
--- a/include/actbl2.h
+++ b/include/actbl2.h
@@ -153,6 +153,14 @@
#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
+#ifdef ACPI_UNDEFINED_TABLES
+/*
+ * These tables have been seen in the field, but no definition has been found
+ */
+#define ACPI_SIG_ATKG "ATKG"
+#define ACPI_SIG_GSCI "GSCI" /* GMCH SCI table */
+#define ACPI_SIG_IEIT "IEIT"
+#endif
/*
* All tables must be byte-packed to match the ACPI specification, since
diff --git a/namespace/nsaccess.c b/namespace/nsaccess.c
index 7a8dc6d1a77e..b2af47f2152c 100644
--- a/namespace/nsaccess.c
+++ b/namespace/nsaccess.c
@@ -435,7 +435,7 @@ AcpiNsLookup (
while (!AcpiNsOpensScope (PrefixNode->Type) &&
PrefixNode->Type != ACPI_TYPE_ANY)
{
- PrefixNode = AcpiNsGetParentNode (PrefixNode);
+ PrefixNode = PrefixNode->Parent;
}
}
}
@@ -516,7 +516,7 @@ AcpiNsLookup (
/* Backup to the parent node */
NumCarats++;
- ThisNode = AcpiNsGetParentNode (ThisNode);
+ ThisNode = ThisNode->Parent;
if (!ThisNode)
{
/* Current scope has no parent scope */
@@ -531,7 +531,7 @@ AcpiNsLookup (
if (SearchParentFlag == ACPI_NS_NO_UPSEARCH)
{
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
- "Search scope is [%4.4s], path has %d carat(s)\n",
+ "Search scope is [%4.4s], path has %u carat(s)\n",
AcpiUtGetNodeName (ThisNode), NumCarats));
}
}
@@ -592,7 +592,7 @@ AcpiNsLookup (
Path++;
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
- "Multi Pathname (%d Segments, Flags=%X)\n",
+ "Multi Pathname (%u Segments, Flags=%X)\n",
NumSegments, Flags));
break;
diff --git a/namespace/nsalloc.c b/namespace/nsalloc.c
index aadafbf7818b..a879fc1ea8d5 100644
--- a/namespace/nsalloc.c
+++ b/namespace/nsalloc.c
@@ -255,7 +255,7 @@ AcpiNsRemoveNode (
ACPI_FUNCTION_TRACE_PTR (NsRemoveNode, Node);
- ParentNode = AcpiNsGetParentNode (Node);
+ ParentNode = Node->Parent;
PrevNode = NULL;
NextNode = ParentNode->Child;
@@ -265,34 +265,22 @@ AcpiNsRemoveNode (
while (NextNode != Node)
{
PrevNode = NextNode;
- NextNode = PrevNode->Peer;
+ NextNode = NextNode->Peer;
}
if (PrevNode)
{
/* Node is not first child, unlink it */
- PrevNode->Peer = NextNode->Peer;
- if (NextNode->Flags & ANOBJ_END_OF_PEER_LIST)
- {
- PrevNode->Flags |= ANOBJ_END_OF_PEER_LIST;
- }
+ PrevNode->Peer = Node->Peer;
}
else
{
- /* Node is first child (has no previous peer) */
-
- if (NextNode->Flags & ANOBJ_END_OF_PEER_LIST)
- {
- /* No peers at all */
-
- ParentNode->Child = NULL;
- }
- else
- { /* Link peer list to parent */
-
- ParentNode->Child = NextNode->Peer;
- }
+ /*
+ * Node is first child (has no previous peer).
+ * Link peer list to parent
+ */
+ ParentNode->Child = Node->Peer;
}
/* Delete the node and any attached objects */
@@ -336,38 +324,47 @@ AcpiNsInstallNode (
ACPI_FUNCTION_TRACE (NsInstallNode);
- /*
- * Get the owner ID from the Walk state. The owner ID is used to track
- * table deletion and deletion of objects created by methods.
- */
if (WalkState)
{
+ /*
+ * Get the owner ID from the Walk state. The owner ID is used to
+ * track table deletion and deletion of objects created by methods.
+ */
OwnerId = WalkState->OwnerId;
+
+ if ((WalkState->MethodDesc) &&
+ (ParentNode != WalkState->MethodNode))
+ {
+ /*
+ * A method is creating a new node that is not a child of the
+ * method (it is non-local). Mark the executing method as having
+ * modified the namespace. This is used for cleanup when the
+ * method exits.
+ */
+ WalkState->MethodDesc->Method.Flags |= AOPOBJ_MODIFIED_NAMESPACE;
+ }
}
/* Link the new entry into the parent and existing children */
+ Node->Peer = NULL;
+ Node->Parent = ParentNode;
ChildNode = ParentNode->Child;
+
if (!ChildNode)
{
ParentNode->Child = Node;
- Node->Flags |= ANOBJ_END_OF_PEER_LIST;
- Node->Peer = ParentNode;
}
else
{
- while (!(ChildNode->Flags & ANOBJ_END_OF_PEER_LIST))
+ /* Add node to the end of the peer list */
+
+ while (ChildNode->Peer)
{
ChildNode = ChildNode->Peer;
}
ChildNode->Peer = Node;
-
- /* Clear end-of-list flag */
-
- ChildNode->Flags &= ~ANOBJ_END_OF_PEER_LIST;
- Node->Flags |= ANOBJ_END_OF_PEER_LIST;
- Node->Peer = ParentNode;
}
/* Init the new entry */
@@ -402,9 +399,8 @@ void
AcpiNsDeleteChildren (
ACPI_NAMESPACE_NODE *ParentNode)
{
- ACPI_NAMESPACE_NODE *ChildNode;
ACPI_NAMESPACE_NODE *NextNode;
- UINT8 Flags;
+ ACPI_NAMESPACE_NODE *NodeToDelete;
ACPI_FUNCTION_TRACE_PTR (NsDeleteChildren, ParentNode);
@@ -415,39 +411,27 @@ AcpiNsDeleteChildren (
return_VOID;
}
- /* If no children, all done! */
-
- ChildNode = ParentNode->Child;
- if (!ChildNode)
- {
- return_VOID;
- }
-
/* Deallocate all children at this level */
- do
+ NextNode = ParentNode->Child;
+ while (NextNode)
{
- /* Get the things we need */
-
- NextNode = ChildNode->Peer;
- Flags = ChildNode->Flags;
-
/* Grandchildren should have all been deleted already */
- if (ChildNode->Child)
+ if (NextNode->Child)
{
ACPI_ERROR ((AE_INFO, "Found a grandchild! P=%p C=%p",
- ParentNode, ChildNode));
+ ParentNode, NextNode));
}
/*
* Delete this child node and move on to the next child in the list.
* No need to unlink the node since we are deleting the entire branch.
*/
- AcpiNsDeleteNode (ChildNode);
- ChildNode = NextNode;
-
- } while (!(Flags & ANOBJ_END_OF_PEER_LIST));
+ NodeToDelete = NextNode;
+ NextNode = NextNode->Peer;
+ AcpiNsDeleteNode (NodeToDelete);
+ };
/* Clear the parent's child pointer */
@@ -533,7 +517,7 @@ AcpiNsDeleteNamespaceSubtree (
/* Move up the tree to the grandparent */
- ParentNode = AcpiNsGetParentNode (ParentNode);
+ ParentNode = ParentNode->Parent;
}
}
@@ -655,7 +639,7 @@ AcpiNsDeleteNamespaceByOwner (
/* Move up the tree to the grandparent */
- ParentNode = AcpiNsGetParentNode (ParentNode);
+ ParentNode = ParentNode->Parent;
}
}
diff --git a/namespace/nsdump.c b/namespace/nsdump.c
index 0b0af613f24d..242033126f36 100644
--- a/namespace/nsdump.c
+++ b/namespace/nsdump.c
@@ -537,7 +537,7 @@ AcpiNsDumpOneObject (
return (AE_OK);
}
- AcpiOsPrintf ("(R%d)", ObjDesc->Common.ReferenceCount);
+ AcpiOsPrintf ("(R%u)", ObjDesc->Common.ReferenceCount);
switch (Type)
{
diff --git a/namespace/nsinit.c b/namespace/nsinit.c
index 770235e8e33d..39067bb440be 100644
--- a/namespace/nsinit.c
+++ b/namespace/nsinit.c
@@ -185,25 +185,25 @@ AcpiNsInitializeObjects (
/* Walk entire namespace from the supplied root */
Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
- ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL,
- &Info, NULL);
+ ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL,
+ &Info, NULL);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
- "\nInitialized %hd/%hd Regions %hd/%hd Fields %hd/%hd "
- "Buffers %hd/%hd Packages (%hd nodes)\n",
+ "\nInitialized %u/%u Regions %u/%u Fields %u/%u "
+ "Buffers %u/%u Packages (%u nodes)\n",
Info.OpRegionInit, Info.OpRegionCount,
Info.FieldInit, Info.FieldCount,
Info.BufferInit, Info.BufferCount,
Info.PackageInit, Info.PackageCount, Info.ObjectCount));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "%hd Control Methods found\n", Info.MethodCount));
+ "%u Control Methods found\n", Info.MethodCount));
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
- "%hd Op Regions found\n", Info.OpRegionCount));
+ "%u Op Regions found\n", Info.OpRegionCount));
return_ACPI_STATUS (AE_OK);
}
@@ -285,6 +285,16 @@ AcpiNsInitializeDevices (
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, NULL, &Info, NULL);
+ /*
+ * Any _OSI requests should be completed by now. If the BIOS has
+ * requested any Windows OSI strings, we will always truncate
+ * I/O addresses to 16 bits -- for Windows compatibility.
+ */
+ if (AcpiGbl_OsiData >= ACPI_OSI_WIN_2000)
+ {
+ AcpiGbl_TruncateIoAddresses = TRUE;
+ }
+
ACPI_FREE (Info.EvaluateInfo);
if (ACPI_FAILURE (Status))
{
@@ -292,8 +302,8 @@ AcpiNsInitializeDevices (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
- "\nExecuted %hd _INI methods requiring %hd _STA executions "
- "(examined %hd objects)\n",
+ "\nExecuted %u _INI methods requiring %u _STA executions "
+ "(examined %u objects)\n",
Info.Num_INI, Info.Num_STA, Info.DeviceCount));
return_ACPI_STATUS (Status);
@@ -510,7 +520,7 @@ AcpiNsFindIniMethods (
* The only _INI methods that we care about are those that are
* present under Device, Processor, and Thermal objects.
*/
- ParentNode = AcpiNsGetParentNode (Node);
+ ParentNode = Node->Parent;
switch (ParentNode->Type)
{
case ACPI_TYPE_DEVICE:
@@ -522,7 +532,7 @@ AcpiNsFindIniMethods (
while (ParentNode)
{
ParentNode->Flags |= ANOBJ_SUBTREE_HAS_INI;
- ParentNode = AcpiNsGetParentNode (ParentNode);
+ ParentNode = ParentNode->Parent;
}
break;
diff --git a/namespace/nsnames.c b/namespace/nsnames.c
index 7eb3e549bf93..f05288e41714 100644
--- a/namespace/nsnames.c
+++ b/namespace/nsnames.c
@@ -176,7 +176,7 @@ AcpiNsBuildExternalPath (
/* Put the name into the buffer */
ACPI_MOVE_32_TO_32 ((NameBuffer + Index), &ParentNode->Name);
- ParentNode = AcpiNsGetParentNode (ParentNode);
+ ParentNode = ParentNode->Parent;
/* Prefix name with the path separator */
@@ -298,7 +298,7 @@ AcpiNsGetPathnameLength (
return 0;
}
Size += ACPI_PATH_SEGMENT_LENGTH;
- NextNode = AcpiNsGetParentNode (NextNode);
+ NextNode = NextNode->Parent;
}
if (!Size)
diff --git a/namespace/nsparse.c b/namespace/nsparse.c
index 52cbc975992f..d97c9af702df 100644
--- a/namespace/nsparse.c
+++ b/namespace/nsparse.c
@@ -223,7 +223,7 @@ AcpiNsOneCompleteParse (
/* Parse the AML */
- ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %d parse\n", PassNumber));
+ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %u parse\n", PassNumber));
Status = AcpiPsParseAml (WalkState);
Cleanup:
diff --git a/namespace/nsrepair2.c b/namespace/nsrepair2.c
index 220608e2db61..6ac7d6c356ef 100644
--- a/namespace/nsrepair2.c
+++ b/namespace/nsrepair2.c
@@ -200,6 +200,13 @@ AcpiNsSortList (
* _GTM: Convert Buffer of BYTEs to a Buffer of DWORDs
* _PSS: Sort the list descending by Power
* _TSS: Sort the list descending by Power
+ *
+ * Names that must be packages, but cannot be sorted:
+ *
+ * _BCL: Values are tied to the Package index where they appear, and cannot
+ * be moved or sorted. These index values are used for _BQC and _BCM.
+ * However, we can fix the case where a buffer is returned, by converting
+ * it to a Package of integers.
*/
static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] =
{
diff --git a/namespace/nssearch.c b/namespace/nssearch.c
index fa15b9c5bb0f..3bee106f2d71 100644
--- a/namespace/nssearch.c
+++ b/namespace/nssearch.c
@@ -229,17 +229,6 @@ AcpiNsSearchOneScope (
return_ACPI_STATUS (AE_OK);
}
- /*
- * The last entry in the list points back to the parent,
- * so a flag is used to indicate the end-of-list
- */
- if (Node->Flags & ANOBJ_END_OF_PEER_LIST)
- {
- /* Searched entire list, we are done */
-
- break;
- }
-
/* Didn't match name, move on to the next peer object */
Node = Node->Peer;
@@ -296,7 +285,7 @@ AcpiNsSearchParentTree (
ACPI_FUNCTION_TRACE (NsSearchParentTree);
- ParentNode = AcpiNsGetParentNode (Node);
+ ParentNode = Node->Parent;
/*
* If there is no parent (i.e., we are at the root) or type is "local",
@@ -341,7 +330,7 @@ AcpiNsSearchParentTree (
/* Not found here, go up another level (until we reach the root) */
- ParentNode = AcpiNsGetParentNode (ParentNode);
+ ParentNode = ParentNode->Parent;
}
/* Not found in parent tree */
diff --git a/namespace/nsutils.c b/namespace/nsutils.c
index 98ec9ff3c4b6..fc6140c00f1e 100644
--- a/namespace/nsutils.c
+++ b/namespace/nsutils.c
@@ -1057,128 +1057,3 @@ Cleanup:
ACPI_FREE (InternalPath);
return_ACPI_STATUS (Status);
}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiNsGetParentNode
- *
- * PARAMETERS: Node - Current table entry
- *
- * RETURN: Parent entry of the given entry
- *
- * DESCRIPTION: Obtain the parent entry for a given entry in the namespace.
- *
- ******************************************************************************/
-
-ACPI_NAMESPACE_NODE *
-AcpiNsGetParentNode (
- ACPI_NAMESPACE_NODE *Node)
-{
- ACPI_FUNCTION_ENTRY ();
-
-
- if (!Node)
- {
- return (NULL);
- }
-
- /*
- * Walk to the end of this peer list. The last entry is marked with a flag
- * and the peer pointer is really a pointer back to the parent. This saves
- * putting a parent back pointer in each and every named object!
- */
- while (!(Node->Flags & ANOBJ_END_OF_PEER_LIST))
- {
- Node = Node->Peer;
- }
-
- return (Node->Peer);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiNsGetNextValidNode
- *
- * PARAMETERS: Node - Current table entry
- *
- * RETURN: Next valid Node in the linked node list. NULL if no more valid
- * nodes.
- *
- * DESCRIPTION: Find the next valid node within a name table.
- * Useful for implementing NULL-end-of-list loops.
- *
- ******************************************************************************/
-
-ACPI_NAMESPACE_NODE *
-AcpiNsGetNextValidNode (
- ACPI_NAMESPACE_NODE *Node)
-{
-
- /* If we are at the end of this peer list, return NULL */
-
- if (Node->Flags & ANOBJ_END_OF_PEER_LIST)
- {
- return NULL;
- }
-
- /* Otherwise just return the next peer */
-
- return (Node->Peer);
-}
-
-
-#ifdef ACPI_OBSOLETE_FUNCTIONS
-/*******************************************************************************
- *
- * FUNCTION: AcpiNsFindParentName
- *
- * PARAMETERS: *ChildNode - Named Obj whose name is to be found
- *
- * RETURN: The ACPI name
- *
- * DESCRIPTION: Search for the given obj in its parent scope and return the
- * name segment, or "????" if the parent name can't be found
- * (which "should not happen").
- *
- ******************************************************************************/
-
-ACPI_NAME
-AcpiNsFindParentName (
- ACPI_NAMESPACE_NODE *ChildNode)
-{
- ACPI_NAMESPACE_NODE *ParentNode;
-
-
- ACPI_FUNCTION_TRACE (NsFindParentName);
-
-
- if (ChildNode)
- {
- /* Valid entry. Get the parent Node */
-
- ParentNode = AcpiNsGetParentNode (ChildNode);
- if (ParentNode)
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Parent of %p [%4.4s] is %p [%4.4s]\n",
- ChildNode, AcpiUtGetNodeName (ChildNode),
- ParentNode, AcpiUtGetNodeName (ParentNode)));
-
- if (ParentNode->Name.Integer)
- {
- return_VALUE ((ACPI_NAME) ParentNode->Name.Integer);
- }
- }
-
- ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "Unable to find parent of %p (%4.4s)\n",
- ChildNode, AcpiUtGetNodeName (ChildNode)));
- }
-
- return_VALUE (ACPI_UNKNOWN_NAME);
-}
-#endif
-
-
diff --git a/namespace/nswalk.c b/namespace/nswalk.c
index b6c573bda7d5..2863926060ae 100644
--- a/namespace/nswalk.c
+++ b/namespace/nswalk.c
@@ -158,16 +158,6 @@ AcpiNsGetNextNode (
return (ParentNode->Child);
}
- /*
- * Get the next node.
- *
- * If we are at the end of this peer list, return NULL
- */
- if (ChildNode->Flags & ANOBJ_END_OF_PEER_LIST)
- {
- return NULL;
- }
-
/* Otherwise just return the next peer */
return (ChildNode->Peer);
@@ -227,9 +217,9 @@ AcpiNsGetNextNodeTyped (
return (NextNode);
}
- /* Otherwise, move on to the next node */
+ /* Otherwise, move on to the next peer node */
- NextNode = AcpiNsGetNextValidNode (NextNode);
+ NextNode = NextNode->Peer;
}
/* Not found */
@@ -454,7 +444,7 @@ AcpiNsWalkNamespace (
*/
Level--;
ChildNode = ParentNode;
- ParentNode = AcpiNsGetParentNode (ParentNode);
+ ParentNode = ParentNode->Parent;
NodePreviouslyVisited = TRUE;
}
diff --git a/namespace/nsxfobj.c b/namespace/nsxfobj.c
index aef106e80b93..8e6ed643e78c 100644
--- a/namespace/nsxfobj.c
+++ b/namespace/nsxfobj.c
@@ -242,7 +242,7 @@ AcpiGetParent (
/* Get the parent entry */
- ParentNode = AcpiNsGetParentNode (Node);
+ ParentNode = Node->Parent;
*RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, ParentNode);
/* Return exception if parent is null */
diff --git a/os_specific/service_layers/oswinxf.c b/os_specific/service_layers/oswinxf.c
index 4c50416267a2..eef0b3544130 100644
--- a/os_specific/service_layers/oswinxf.c
+++ b/os_specific/service_layers/oswinxf.c
@@ -336,7 +336,7 @@ AcpiOsTableOverride (
*NewTable = OsGetTable (TableName);
if (*NewTable)
{
- AcpiOsPrintf ("Table [%s] obtained from registry, %d bytes\n",
+ AcpiOsPrintf ("Table [%s] obtained from registry, %u bytes\n",
TableName, (*NewTable)->Length);
}
else
@@ -744,7 +744,7 @@ AcpiOsCreateSemaphore (
AcpiGbl_Semaphores[i].CurrentUnits = (UINT16) InitialUnits;
AcpiGbl_Semaphores[i].OsHandle = Mutex;
- ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Handle=%d, Max=%d, Current=%d, OsHandle=%p\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Handle=%u, Max=%u, Current=%u, OsHandle=%p\n",
i, MaxUnits, InitialUnits, Mutex));
*OutHandle = (void *) i;
@@ -827,7 +827,7 @@ AcpiOsWaitSemaphore (
if (Units > 1)
{
- printf ("WaitSemaphore: Attempt to receive %d units\n", Units);
+ printf ("WaitSemaphore: Attempt to receive %u units\n", Units);
return AE_NOT_IMPLEMENTED;
}
@@ -915,7 +915,7 @@ AcpiOsSignalSemaphore (
if (Units > 1)
{
- printf ("SignalSemaphore: Attempt to signal %d units, Index %2.2X\n", Units, Index);
+ printf ("SignalSemaphore: Attempt to signal %u units, Index %2.2X\n", Units, Index);
return AE_NOT_IMPLEMENTED;
}
diff --git a/tools/acpiexec/aehandlers.c b/tools/acpiexec/aehandlers.c
index 53424f61e5cb..cd4ae92da43c 100644
--- a/tools/acpiexec/aehandlers.c
+++ b/tools/acpiexec/aehandlers.c
@@ -182,7 +182,7 @@ AeCtrlCHandler (
signal (SIGINT, SIG_IGN);
SigintCount++;
- AcpiOsPrintf ("Caught a ctrl-c (#%d)\n\n", SigintCount);
+ AcpiOsPrintf ("Caught a ctrl-c (#%u)\n\n", SigintCount);
if (AcpiGbl_MethodExecuting)
{
@@ -618,7 +618,7 @@ AeInstallHandlers (void)
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "Could not install an OpRegion handler for %s space(%d)",
+ "Could not install an OpRegion handler for %s space(%u)",
AcpiUtGetRegionName((UINT8) SpaceId[i]), SpaceId[i]));
return (Status);
}
diff --git a/tools/acpiexec/aemain.c b/tools/acpiexec/aemain.c
index 55f701d1ac31..050ba281025b 100644
--- a/tools/acpiexec/aemain.c
+++ b/tools/acpiexec/aemain.c
@@ -135,7 +135,7 @@ char *FileList[ASL_MAX_FILES];
int FileCount;
-#define AE_SUPPORTED_OPTIONS "?ab:de^f:ghimo:rstvx:z"
+#define AE_SUPPORTED_OPTIONS "?b:d:e:f:gm^ovx:"
/******************************************************************************
@@ -157,19 +157,25 @@ usage (void)
printf ("Where:\n");
printf (" -? Display this message\n");
- printf (" -a Do not abort methods on error\n");
printf (" -b <CommandLine> Batch mode command execution\n");
- printf (" -e [Method] Batch mode method execution\n");
- printf (" -f <Value> Specify OpRegion initialization fill value\n");
- printf (" -i Do not run STA/INI methods during init\n");
- printf (" -m Display final memory use statistics\n");
- printf (" -o <OutputFile> Send output to this file\n");
- printf (" -r Disable OpRegion address simulation\n");
- printf (" -s Enable Interpreter Slack Mode\n");
- printf (" -t Enable Interpreter Serialized Mode\n");
- printf (" -v Verbose init output\n");
- printf (" -x <DebugLevel> Specify debug output level\n");
- printf (" -z Enable debug semaphore timeout\n");
+ printf (" -m [Method] Batch mode method execution. Default=MAIN\n");
+ printf ("\n");
+
+ printf (" -da Disable method abort on error\n");
+ printf (" -di Disable execution of STA/INI methods during init\n");
+ printf (" -do Disable Operation Region address simulation\n");
+ printf (" -dt Disable allocation tracking (performance)\n");
+ printf ("\n");
+
+ printf (" -ef Enable display of final memory statistics\n");
+ printf (" -em Enable Interpreter Serialized Mode\n");
+ printf (" -es Enable Interpreter Slack Mode\n");
+ printf (" -et Enable debug semaphore timeout\n");
+ printf ("\n");
+
+ printf (" -f <Value> Operation Region initialization fill value\n");
+ printf (" -v Verbose initialization output\n");
+ printf (" -x <DebugLevel> Debug output level\n");
}
@@ -471,10 +477,6 @@ main (
while ((j = AcpiGetopt (argc, argv, AE_SUPPORTED_OPTIONS)) != EOF) switch(j)
{
- case 'a':
- AcpiGbl_IgnoreErrors = TRUE;
- break;
-
case 'b':
if (strlen (AcpiGbl_Optarg) > 127)
{
@@ -487,20 +489,58 @@ main (
break;
case 'd':
- AcpiGbl_DbOpt_disasm = TRUE;
- AcpiGbl_DbOpt_stats = TRUE;
+ switch (AcpiGbl_Optarg[0])
+ {
+ case 'a':
+ AcpiGbl_IgnoreErrors = TRUE;
+ break;
+
+ case 'i':
+ AcpiGbl_DbOpt_ini_methods = FALSE;
+ break;
+
+ case 'o':
+ AcpiGbl_DbOpt_NoRegionSupport = TRUE;
+ break;
+
+ case 't':
+ #ifdef ACPI_DBG_TRACK_ALLOCATIONS
+ AcpiGbl_DisableMemTracking = TRUE;
+ #endif
+ break;
+
+ default:
+ printf ("Unknown option: -d%s\n", AcpiGbl_Optarg);
+ return (-1);
+ }
break;
case 'e':
- AcpiGbl_BatchMode = 2;
switch (AcpiGbl_Optarg[0])
{
- case '^':
- strcpy (BatchBuffer, "MAIN");
+ case 'f':
+ #ifdef ACPI_DBG_TRACK_ALLOCATIONS
+ AcpiGbl_DisplayFinalMemStats = TRUE;
+ #endif
break;
- default:
- strcpy (BatchBuffer, AcpiGbl_Optarg);
+
+ case 'm':
+ AcpiGbl_AllMethodsSerialized = TRUE;
+ printf ("Enabling AML Interpreter serialized mode\n");
+ break;
+
+ case 's':
+ AcpiGbl_EnableInterpreterSlack = TRUE;
+ printf ("Enabling AML Interpreter slack mode\n");
+ break;
+
+ case 't':
+ AcpiGbl_DebugTimeout = TRUE;
break;
+
+ default:
+ printf ("Unknown option: -e%s\n", AcpiGbl_Optarg);
+ return (-1);
}
break;
@@ -513,32 +553,23 @@ main (
AcpiGbl_DbFilename = NULL;
break;
- case 'i':
- AcpiGbl_DbOpt_ini_methods = FALSE;
- break;
-
case 'm':
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
- AcpiGbl_DisplayFinalMemStats = TRUE;
-#endif
- break;
-
- case 'o':
- printf ("O option is not implemented\n");
- break;
-
- case 'r':
- AcpiGbl_DbOpt_NoRegionSupport = TRUE;
- break;
+ AcpiGbl_BatchMode = 2;
+ switch (AcpiGbl_Optarg[0])
+ {
+ case '^':
+ strcpy (BatchBuffer, "MAIN");
+ break;
- case 's':
- AcpiGbl_EnableInterpreterSlack = TRUE;
- printf ("Enabling AML Interpreter slack mode\n");
+ default:
+ strcpy (BatchBuffer, AcpiGbl_Optarg);
+ break;
+ }
break;
- case 't':
- AcpiGbl_AllMethodsSerialized = TRUE;
- printf ("Enabling AML Interpreter serialized mode\n");
+ case 'o':
+ AcpiGbl_DbOpt_disasm = TRUE;
+ AcpiGbl_DbOpt_stats = TRUE;
break;
case 'v':
@@ -551,10 +582,6 @@ main (
printf ("Debug Level: 0x%8.8X\n", AcpiDbgLevel);
break;
- case 'z':
- AcpiGbl_DebugTimeout = TRUE;
- break;
-
case '?':
case 'h':
default:
diff --git a/tools/acpisrc/asconvrt.c b/tools/acpisrc/asconvrt.c
index 4ceb43563313..a75b53a41207 100644
--- a/tools/acpisrc/asconvrt.c
+++ b/tools/acpisrc/asconvrt.c
@@ -298,7 +298,7 @@ AsCheckForBraces (
if (!Gbl_QuietMode)
{
- printf ("Missing braces for <if>, line %d: %s\n", TotalLines, Filename);
+ printf ("Missing braces for <if>, line %u: %s\n", TotalLines, Filename);
}
}
}
@@ -317,7 +317,7 @@ AsCheckForBraces (
if (!Gbl_QuietMode)
{
- printf ("Missing braces for <if>, line %d: %s\n", TotalLines, Filename);
+ printf ("Missing braces for <if>, line %u: %s\n", TotalLines, Filename);
}
}
}
@@ -336,7 +336,7 @@ AsCheckForBraces (
if (!Gbl_QuietMode)
{
- printf ("Missing braces for <else>, line %d: %s\n", TotalLines, Filename);
+ printf ("Missing braces for <else>, line %u: %s\n", TotalLines, Filename);
}
}
}
@@ -1126,7 +1126,7 @@ AsCountLines (
if (LongLineCount)
{
- VERBOSE_PRINT (("%d Lines longer than 80 found in %s\n", LongLineCount, Filename));
+ VERBOSE_PRINT (("%u Lines longer than 80 found in %s\n", LongLineCount, Filename));
Gbl_LongLines += LongLineCount;
}
@@ -1293,7 +1293,7 @@ AsCountSourceLines (
Gbl_WhiteLines += WhiteCount;
Gbl_CommentLines += CommentCount;
- VERBOSE_PRINT (("%d Comment %d White %d Code %d Lines in %s\n",
+ VERBOSE_PRINT (("%u Comment %u White %u Code %u Lines in %s\n",
CommentCount, WhiteCount, LineCount, LineCount+WhiteCount+CommentCount, Filename));
}
diff --git a/tools/acpisrc/asfile.c b/tools/acpisrc/asfile.c
index ab62f176c9d2..dd249410772f 100644
--- a/tools/acpisrc/asfile.c
+++ b/tools/acpisrc/asfile.c
@@ -341,13 +341,13 @@ AsDetectLoneLineFeeds (
{
if (!Gbl_IgnoreLoneLineFeeds)
{
- printf ("%s: ****File has UNIX format**** (LF only, not CR/LF) %d lines\n",
+ printf ("%s: ****File has UNIX format**** (LF only, not CR/LF) %u lines\n",
Filename, LfCount);
}
}
else
{
- printf ("%s: %d lone linefeeds in file\n", Filename, LfCount);
+ printf ("%s: %u lone linefeeds in file\n", Filename, LfCount);
}
return TRUE;
}
@@ -795,7 +795,7 @@ AsGetFile (
Buffer = calloc (Size * 2, 1);
if (!Buffer)
{
- printf ("Could not allocate buffer of size %d\n", Size * 2);
+ printf ("Could not allocate buffer of size %u\n", Size * 2);
goto ErrorExit;
}
diff --git a/tools/acpixtract/acpixtract.c b/tools/acpixtract/acpixtract.c
index 5a99fc4710fb..e3d6b7529edc 100644
--- a/tools/acpixtract/acpixtract.c
+++ b/tools/acpixtract/acpixtract.c
@@ -793,7 +793,7 @@ ListTables (
TableHeader->AslCompilerId, TableHeader->AslCompilerRevision);
}
- printf ("\nFound %d ACPI tables [%8.8X]\n", TableCount, VERSION);
+ printf ("\nFound %u ACPI tables [%8.8X]\n", TableCount, VERSION);
fclose (InputFile);
return (0);
}
diff --git a/utilities/utglobal.c b/utilities/utglobal.c
index 34af1f5fc507..778909af3418 100644
--- a/utilities/utglobal.c
+++ b/utilities/utglobal.c
@@ -944,10 +944,10 @@ AcpiUtInitGlobals (
AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
+ AcpiGbl_RootNodeStruct.Parent = NULL;
AcpiGbl_RootNodeStruct.Child = NULL;
AcpiGbl_RootNodeStruct.Peer = NULL;
AcpiGbl_RootNodeStruct.Object = NULL;
- AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST;
#ifdef ACPI_DISASSEMBLER
@@ -960,6 +960,7 @@ AcpiUtInitGlobals (
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
AcpiGbl_DisplayFinalMemStats = FALSE;
+ AcpiGbl_DisableMemTracking = FALSE;
#endif
return_ACPI_STATUS (AE_OK);
diff --git a/utilities/uttrack.c b/utilities/uttrack.c
index ac45e9a3d88c..38dba03ad8b0 100644
--- a/utilities/uttrack.c
+++ b/utilities/uttrack.c
@@ -436,6 +436,11 @@ AcpiUtTrackAllocation (
ACPI_FUNCTION_TRACE_PTR (UtTrackAllocation, Allocation);
+ if (AcpiGbl_DisableMemTracking)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
MemList = AcpiGbl_GlobalList;
Status = AcpiUtAcquireMutex (ACPI_MTX_MEMORY);
if (ACPI_FAILURE (Status))
@@ -518,6 +523,11 @@ AcpiUtRemoveAllocation (
ACPI_FUNCTION_TRACE (UtRemoveAllocation);
+ if (AcpiGbl_DisableMemTracking)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
MemList = AcpiGbl_GlobalList;
if (NULL == MemList->ListHead)
{
@@ -650,6 +660,11 @@ AcpiUtDumpAllocations (
ACPI_FUNCTION_TRACE (UtDumpAllocations);
+ if (AcpiGbl_DisableMemTracking)
+ {
+ return;
+ }
+
/*
* Walk the allocation list.
*/
@@ -668,7 +683,7 @@ AcpiUtDumpAllocations (
if (Element->Size < sizeof (ACPI_COMMON_DESCRIPTOR))
{
- AcpiOsPrintf ("%p Length 0x%04X %9.9s-%d "
+ AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u "
"[Not a Descriptor - too small]\n",
Descriptor, Element->Size, Element->Module,
Element->Line);
@@ -679,7 +694,7 @@ AcpiUtDumpAllocations (
if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) != ACPI_DESC_TYPE_CACHED)
{
- AcpiOsPrintf ("%p Length 0x%04X %9.9s-%d [%s] ",
+ AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u [%s] ",
Descriptor, Element->Size, Element->Module,
Element->Line, AcpiUtGetDescriptorName (Descriptor));
@@ -757,7 +772,7 @@ AcpiUtDumpAllocations (
}
else
{
- ACPI_ERROR ((AE_INFO, "%d(0x%X) Outstanding allocations",
+ ACPI_ERROR ((AE_INFO, "%u(0x%X) Outstanding allocations",
NumOutstanding, NumOutstanding));
}