Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Aug 2012 20:54:52 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239340 - in head: share/man/man4 sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/de...
Message-ID:  <201208162054.q7GKsrbo067915@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Thu Aug 16 20:54:52 2012
New Revision: 239340
URL: http://svn.freebsd.org/changeset/base/239340

Log:
  Merge ACPICA 20120816.

Added:
  head/sys/contrib/dev/acpica/components/utilities/utxfinit.c
     - copied, changed from r239333, vendor-sys/acpica/dist/source/components/utilities/utxfinit.c
  head/sys/contrib/dev/acpica/include/acbuffer.h
     - copied unchanged from r239333, vendor-sys/acpica/dist/source/include/acbuffer.h
Modified:
  head/share/man/man4/acpi.4
  head/sys/conf/files
  head/sys/contrib/dev/acpica/acpica_prep.sh
  head/sys/contrib/dev/acpica/changes.txt   (contents, props changed)
  head/sys/contrib/dev/acpica/common/adisasm.c
  head/sys/contrib/dev/acpica/common/ahpredef.c
  head/sys/contrib/dev/acpica/common/dmtable.c
  head/sys/contrib/dev/acpica/common/dmtbdump.c
  head/sys/contrib/dev/acpica/common/dmtbinfo.c
  head/sys/contrib/dev/acpica/compiler/aslcompiler.h
  head/sys/contrib/dev/acpica/compiler/aslcompiler.y
  head/sys/contrib/dev/acpica/compiler/aslfold.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.h
  head/sys/contrib/dev/acpica/compiler/asltree.c
  head/sys/contrib/dev/acpica/compiler/aslutils.c
  head/sys/contrib/dev/acpica/components/debugger/dbcmds.c
  head/sys/contrib/dev/acpica/components/debugger/dbexec.c
  head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c
  head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
  head/sys/contrib/dev/acpica/components/dispatcher/dswload.c
  head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c
  head/sys/contrib/dev/acpica/components/events/evgpe.c
  head/sys/contrib/dev/acpica/components/events/evxfgpe.c
  head/sys/contrib/dev/acpica/components/hardware/hwesleep.c
  head/sys/contrib/dev/acpica/components/hardware/hwgpe.c
  head/sys/contrib/dev/acpica/components/hardware/hwsleep.c
  head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
  head/sys/contrib/dev/acpica/components/namespace/nsdump.c
  head/sys/contrib/dev/acpica/components/utilities/utosi.c
  head/sys/contrib/dev/acpica/components/utilities/utxface.c
  head/sys/contrib/dev/acpica/components/utilities/utxferror.c
  head/sys/contrib/dev/acpica/include/acdisasm.h
  head/sys/contrib/dev/acpica/include/achware.h
  head/sys/contrib/dev/acpica/include/aclocal.h
  head/sys/contrib/dev/acpica/include/acmacros.h
  head/sys/contrib/dev/acpica/include/acnames.h
  head/sys/contrib/dev/acpica/include/acpixf.h
  head/sys/contrib/dev/acpica/include/actbl.h
  head/sys/contrib/dev/acpica/include/actbl1.h
  head/sys/contrib/dev/acpica/include/actbl2.h
  head/sys/contrib/dev/acpica/include/actbl3.h
  head/sys/contrib/dev/acpica/include/actypes.h
  head/sys/contrib/dev/acpica/include/platform/acenv.h
  head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
  head/sys/dev/acpica/acpi.c
  head/sys/dev/acpica/acpivar.h
  head/sys/modules/acpi/acpi/Makefile
  head/sys/x86/acpica/acpi_wakeup.c
  head/usr.sbin/acpi/acpidb/Makefile
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)
  head/sys/contrib/dev/acpica/common/   (props changed)
  head/sys/contrib/dev/acpica/compiler/   (props changed)
  head/sys/contrib/dev/acpica/components/debugger/   (props changed)
  head/sys/contrib/dev/acpica/components/disassembler/   (props changed)
  head/sys/contrib/dev/acpica/components/dispatcher/   (props changed)
  head/sys/contrib/dev/acpica/components/events/   (props changed)
  head/sys/contrib/dev/acpica/components/hardware/   (props changed)
  head/sys/contrib/dev/acpica/components/namespace/   (props changed)
  head/sys/contrib/dev/acpica/components/utilities/   (props changed)
  head/sys/contrib/dev/acpica/include/   (props changed)
  head/sys/contrib/dev/acpica/os_specific/   (props changed)

Modified: head/share/man/man4/acpi.4
==============================================================================
--- head/share/man/man4/acpi.4	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/share/man/man4/acpi.4	Thu Aug 16 20:54:52 2012	(r239340)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 4, 2012
+.Dd August 16, 2012
 .Dt ACPI 4
 .Os
 .Sh NAME
@@ -219,14 +219,6 @@ Override any automatic quirks completely
 Beep the PC speaker on resume.
 This can help diagnose suspend/resume problems.
 Default is 0 (disabled).
-.It Va debug.acpi.sleep_flags
-Execute optional ACPI methods for suspend/resume.
-If the bit 0 is set (1), it will try to execute _GTS (Going To Sleep) method
-when entering suspend state.
-If the bit 1 is set (2), it will try to execute _BFS (Back From Sleep) method
-when leaving suspend state.
-If both the bits are set (3), both the methods will be tried.
-Default is 0 (disabled).
 .It Va hint.acpi.0.disabled
 Set this to 1 to disable all of ACPI.
 If ACPI has been disabled on your system due to a blacklist entry for your

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/sys/conf/files	Thu Aug 16 20:54:52 2012	(r239340)
@@ -436,6 +436,7 @@ contrib/dev/acpica/components/utilities/
 contrib/dev/acpica/components/utilities/utstate.c	optional acpi
 contrib/dev/acpica/components/utilities/utxface.c	optional acpi
 contrib/dev/acpica/components/utilities/utxferror.c	optional acpi
+contrib/dev/acpica/components/utilities/utxfinit.c	optional acpi
 #contrib/dev/acpica/components/utilities/utxfmutex.c	optional acpi
 contrib/ipfilter/netinet/fil.c	optional ipfilter inet \
 	compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -I$S/contrib/ipfilter"

Modified: head/sys/contrib/dev/acpica/acpica_prep.sh
==============================================================================
--- head/sys/contrib/dev/acpica/acpica_prep.sh	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/sys/contrib/dev/acpica/acpica_prep.sh	Thu Aug 16 20:54:52 2012	(r239340)
@@ -18,18 +18,20 @@ fulldirs="common compiler components inc
 
 # files to remove
 stripdirs="generate libraries tests tools"
-stripfiles="Makefile README acintel.h aclinux.h acmsvc.h acnetbsd.h	\
-	acos2.h accygwin.h acefi.h acwin.h acwin64.h osunixdir.c	\
-	oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c"
+stripfiles="Makefile README accygwin.h acefi.h achaiku.h acintel.h	\
+	aclinux.h acmsvc.h acnetbsd.h acos2.h acwin.h acwin64.h		\
+	new_table.txt osunixdir.c oswindir.c oswintbl.c oswinxf.c	\
+	readme.txt utclib.c"
 
 # include files to canonify
-src_headers="acapps.h accommon.h acconfig.h acdebug.h acdisasm.h	\
-	acdispat.h acevents.h acexcep.h acglobal.h achware.h acinterp.h	\
-	aclocal.h acmacros.h acnames.h acnamesp.h acobject.h acopcode.h	\
-	acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h acpredef.h	\
-	acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h	\
-	actbl2.h actbl3.h actypes.h acutils.h amlcode.h amlresrc.h	\
-	platform/acenv.h platform/acfreebsd.h platform/acgcc.h"
+src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h	\
+	acdisasm.h acdispat.h acevents.h acexcep.h acglobal.h achware.h	\
+	acinterp.h aclocal.h acmacros.h acnames.h acnamesp.h acobject.h	\
+	acopcode.h acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h	\
+	acpredef.h acresrc.h acrestyp.h acstruct.h actables.h actbl.h	\
+	actbl1.h actbl2.h actbl3.h actypes.h acutils.h amlcode.h	\
+	amlresrc.h platform/acenv.h platform/acfreebsd.h		\
+	platform/acgcc.h"
 comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h	\
 	aslsupport.l asltypes.h dtcompiler.h dttemplate.h preprocess.h"
 platform_headers="acfreebsd.h acgcc.h"

Modified: head/sys/contrib/dev/acpica/changes.txt
==============================================================================
--- head/sys/contrib/dev/acpica/changes.txt	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/sys/contrib/dev/acpica/changes.txt	Thu Aug 16 20:54:52 2012	(r239340)
@@ -1,4 +1,97 @@
 ----------------------------------------
+16 August 2012. Summary of changes for version 20120816:
+
+This release is available at https://www.acpica.org/downloads
+The ACPI 5.0 specification is available at www.acpi.info
+
+1) ACPICA Kernel-resident Subsystem:
+
+Removed all use of the deprecated _GTS and _BFS predefined methods. The _GTS 
+(Going To Sleep) and _BFS (Back From Sleep) methods are essentially 
+deprecated and will probably be removed from the ACPI specification. Windows 
+does not invoke them, and reportedly never will. The final nail in the coffin 
+is that the ACPI specification states that these methods must be run with 
+interrupts off, which is not going to happen in a kernel interpreter. Note: 
+Linux has removed all use of the methods also. It was discovered that 
+invoking these functions caused failures on some machines, probably because 
+they were never tested since Windows does not call them. Affects two external 
+interfaces, AcpiEnterSleepState and AcpiLeaveSleepStatePrep. Tang Feng. 
+ACPICA BZ 969.
+
+Implemented support for complex bit-packed buffers returned from the _PLD 
+(Physical Location of Device) predefined method. Adds a new external 
+interface, AcpiDecodePldBuffer that parses the buffer into a more usable C 
+structure. Note: C Bitfields cannot be used for this type of predefined 
+structure since the memory layout of individual bitfields is not defined by 
+the C language. In addition, there are endian concerns where a compiler will 
+change the bitfield ordering based on the machine type. The new ACPICA 
+interface eliminates these issues, and should be called after _PLD is 
+executed. ACPICA BZ 954.
+
+Implemented a change to allow a scope change to root (via "Scope (\)") during 
+execution of module-level ASL code (code that is executed at table load 
+time.) Lin Ming.
+
+Added the Windows8/Server2012 string for the _OSI method. This change adds a 
+new _OSI string, "Windows 2012" for both Windows 8 and Windows Server 2012.
+
+Added header support for the new ACPI tables DBG2 (Debug Port Table Type 2) 
+and CSRT (Core System Resource Table).
+
+Added struct header support for the _FDE, _GRT, _GTM, and _SRT predefined 
+names. This simplifies access to the buffers returned by these predefined 
+names. Adds a new file, include/acbuffer.h. ACPICA BZ 956.
+
+GPE support: Removed an extraneous parameter from the various low-level 
+internal GPE functions. Tang Feng.
+
+Removed the linux makefiles from the unix packages. The generate/linux 
+makefiles are obsolete and have been removed from the unix tarball release 
+packages. The replacement makefiles are under generate/unix, and there is a 
+top-level makefile under the main acpica directory. ACPICA BZ 967, 912.
+
+Updates for Unix makefiles:
+1) Add -D_FORTIFY_SOURCE=2 for gcc generation. Arjan van de Ven.
+2) Update linker flags (move to end of command line) for AcpiExec utility. 
+Guan Chao.
+
+Split ACPICA initialization functions to new file, utxfinit.c. Split from 
+utxface.c to improve modularity and reduce file size.
+
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The 
+debug version of the code includes the debug output trace mechanism and has a 
+much larger code and data size.
+
+  Previous Release:
+    Non-Debug Version:  93.5K Code, 25.3K Data, 118.8K Total
+    Debug Version:     173.7K Code, 74.0K Data, 247.7K Total
+  Current Release:
+    Non-Debug Version:  93.8K Code, 25.3K Data, 119.1K Total
+    Debug Version:     175.7K Code, 74.8K Data, 250.5K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fixed a problem with constant folding for fixed-length constant 
+expressions. The constant-folding code was not being invoked for constant 
+expressions that allow the use of type 3/4/5 opcodes to generate constants 
+for expressions such as ByteConstExpr, WordConstExpr, etc. This could result 
+in the generation of invalid AML bytecode. ACPICA BZ 970.
+
+iASL: Fixed a generation issue on newer versions of Bison. Newer versions 
+apparently automatically emit some of the necessary externals. This change 
+handles these versions in order to eliminate generation warnings.
+
+Disassembler: Added support to decode the DBG2 and CSRT ACPI tables.
+
+Disassembler: Add support to decode _PLD buffers. The decoded buffer appears 
+within comments in the output file.
+
+Debugger: Fixed a regression with the "Threads" command where 
+AE_BAD_PARAMETER was always returned.
+
+----------------------------------------
 11 July 2012. Summary of changes for version 20120711:
 
 This release is available at https://www.acpica.org/downloads The ACPI 5.0 

Modified: head/sys/contrib/dev/acpica/common/adisasm.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/adisasm.c	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/sys/contrib/dev/acpica/common/adisasm.c	Thu Aug 16 20:54:52 2012	(r239340)
@@ -60,9 +60,13 @@
 #define _COMPONENT          ACPI_TOOLS
         ACPI_MODULE_NAME    ("adisasm")
 
-
+/*
+ * Older versions of Bison won't emit this external in the generated header.
+ * Newer versions do emit the external, so we don't need to do it.
+ */
+#ifndef ASLCOMPILER_ASLCOMPILERPARSE_H
 extern int                  AslCompilerdebug;
-
+#endif
 
 ACPI_STATUS
 LsDisplayNamespace (

Modified: head/sys/contrib/dev/acpica/common/ahpredef.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/ahpredef.c	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/sys/contrib/dev/acpica/common/ahpredef.c	Thu Aug 16 20:54:52 2012	(r239340)
@@ -198,7 +198,7 @@ const AH_PREDEFINED_NAME    AslPredefine
     AH_PREDEF ("_PIC",    "Interrupt Model", "Inform AML of the interrupt model in use"),
     AH_PREDEF ("_PIF",    "Power Source Information", "Returns a Power Source information block"),
     AH_PREDEF ("_PIN",    "Pin List", "Pin list, Resource Descriptor field"),
-    AH_PREDEF ("_PLD",    "Physical Device Location", "Returns a device's physical location information"),
+    AH_PREDEF ("_PLD",    "Physical Location of Device", "Returns a device's physical location information"),
     AH_PREDEF ("_PMC",    "Power Meter Capabilities", "Returns a list of Power Meter capabilities info"),
     AH_PREDEF ("_PMD",    "Power Metered Devices", "Returns a list of devices that are measured by the power meter device"),
     AH_PREDEF ("_PMM",    "Power Meter Measurement", "Returns the current value of the Power Meter"),

Modified: head/sys/contrib/dev/acpica/common/dmtable.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/dmtable.c	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/sys/contrib/dev/acpica/common/dmtable.c	Thu Aug 16 20:54:52 2012	(r239340)
@@ -277,22 +277,24 @@ static const char           *AcpiDmGasAc
 ACPI_DMTABLE_DATA    AcpiDmTableData[] =
 {
     {ACPI_SIG_ASF,  NULL,                   AcpiDmDumpAsf,  DtCompileAsf,   TemplateAsf,    "Alert Standard Format table"},
-    {ACPI_SIG_BOOT, AcpiDmTableInfoBoot,    NULL,           NULL,           TemplateBoot,   "Simple Boot Flag Table"},
     {ACPI_SIG_BERT, AcpiDmTableInfoBert,    NULL,           NULL,           TemplateBert,   "Boot Error Record Table"},
     {ACPI_SIG_BGRT, AcpiDmTableInfoBgrt,    NULL,           NULL,           TemplateBgrt,   "Boot Graphics Resource Table"},
+    {ACPI_SIG_BOOT, AcpiDmTableInfoBoot,    NULL,           NULL,           TemplateBoot,   "Simple Boot Flag Table"},
     {ACPI_SIG_CPEP, NULL,                   AcpiDmDumpCpep, DtCompileCpep,  TemplateCpep,   "Corrected Platform Error Polling table"},
+    {ACPI_SIG_CSRT, NULL,                   AcpiDmDumpCsrt, NULL,           NULL,           "Core System Resource Table"},
+    {ACPI_SIG_DBG2, NULL,                   AcpiDmDumpDbg2, NULL,           NULL,           "Debug Port table type 2"},
     {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp,    NULL,           NULL,           TemplateDbgp,   "Debug Port table"},
     {ACPI_SIG_DMAR, NULL,                   AcpiDmDumpDmar, DtCompileDmar,  TemplateDmar,   "DMA Remapping table"},
     {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt,    NULL,           NULL,           TemplateEcdt,   "Embedded Controller Boot Resources Table"},
     {ACPI_SIG_EINJ, NULL,                   AcpiDmDumpEinj, DtCompileEinj,  TemplateEinj,   "Error Injection table"},
     {ACPI_SIG_ERST, NULL,                   AcpiDmDumpErst, DtCompileErst,  TemplateErst,   "Error Record Serialization Table"},
-    {ACPI_SIG_FADT, NULL,                   AcpiDmDumpFadt, DtCompileFadt,  TemplateFadt,   "Fixed ACPI Description Table"},
+    {ACPI_SIG_FADT, NULL,                   AcpiDmDumpFadt, DtCompileFadt,  TemplateFadt,   "Fixed ACPI Description Table (FADT)"},
     {ACPI_SIG_FPDT, NULL,                   AcpiDmDumpFpdt, DtCompileFpdt,  TemplateFpdt,   "Firmware Performance Data Table"},
     {ACPI_SIG_GTDT, AcpiDmTableInfoGtdt,    NULL,           NULL,           TemplateGtdt,   "Generic Timer Description Table"},
     {ACPI_SIG_HEST, NULL,                   AcpiDmDumpHest, DtCompileHest,  TemplateHest,   "Hardware Error Source Table"},
     {ACPI_SIG_HPET, AcpiDmTableInfoHpet,    NULL,           NULL,           TemplateHpet,   "High Precision Event Timer table"},
     {ACPI_SIG_IVRS, NULL,                   AcpiDmDumpIvrs, DtCompileIvrs,  TemplateIvrs,   "I/O Virtualization Reporting Structure"},
-    {ACPI_SIG_MADT, NULL,                   AcpiDmDumpMadt, DtCompileMadt,  TemplateMadt,   "Multiple APIC Description Table"},
+    {ACPI_SIG_MADT, NULL,                   AcpiDmDumpMadt, DtCompileMadt,  TemplateMadt,   "Multiple APIC Description Table (MADT)"},
     {ACPI_SIG_MCFG, NULL,                   AcpiDmDumpMcfg, DtCompileMcfg,  TemplateMcfg,   "Memory Mapped Configuration table"},
     {ACPI_SIG_MCHI, AcpiDmTableInfoMchi,    NULL,           NULL,           TemplateMchi,   "Management Controller Host Interface table"},
     {ACPI_SIG_MPST, AcpiDmTableInfoMpst,    AcpiDmDumpMpst, DtCompileMpst,  TemplateMpst,   "Memory Power State Table"},

Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/dmtbdump.c	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/sys/contrib/dev/acpica/common/dmtbdump.c	Thu Aug 16 20:54:52 2012	(r239340)
@@ -52,11 +52,79 @@
         ACPI_MODULE_NAME    ("dmtbdump")
 
 
+/* Local prototypes */
+
 static void
 AcpiDmValidateFadtLength (
     UINT32                  Revision,
     UINT32                  Length);
 
+static void
+AcpiDmDumpBuffer (
+    void                    *Table,
+    UINT32                  BufferOffset,
+    UINT32                  Length,
+    UINT32                  AbsoluteOffset,
+    char                    *Header);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDmDumpBuffer
+ *
+ * PARAMETERS:  Table               - ACPI Table or subtable
+ *              BufferOffset        - Offset of buffer from Table above
+ *              Length              - Length of the buffer
+ *              AbsoluteOffset      - Offset of buffer in the main ACPI table
+ *              Header              - Name of the buffer field (printed on the
+ *                                    first line only.)
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of an arbitrary length data buffer (in the
+ *              disassembler output format.)
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmDumpBuffer (
+    void                    *Table,
+    UINT32                  BufferOffset,
+    UINT32                  Length,
+    UINT32                  AbsoluteOffset,
+    char                    *Header)
+{
+    UINT8                   *Buffer;
+    UINT32                  i;
+
+
+    if (!Length)
+    {
+        return;
+    }
+
+    Buffer = ACPI_CAST_PTR (UINT8, Table) + BufferOffset;
+    i = 0;
+
+    while (i < Length)
+    {
+        if (!(i % 16))
+        {
+            AcpiOsPrintf ("\n");
+            AcpiDmLineHeader (AbsoluteOffset,
+                ((Length - i) > 16) ? 16 : (Length - i), Header);
+            Header = NULL;
+        }
+
+        AcpiOsPrintf ("%.02X ", *Buffer);
+        i++;
+        Buffer++;
+        AbsoluteOffset++;
+    }
+
+    AcpiOsPrintf ("\n");
+}
+
 
 /*******************************************************************************
  *
@@ -529,6 +597,208 @@ AcpiDmDumpCpep (
 
 /*******************************************************************************
  *
+ * FUNCTION:    AcpiDmDumpCsrt
+ *
+ * PARAMETERS:  Table               - A CSRT table
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of a CSRT. This table type consists
+ *              of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpCsrt (
+    ACPI_TABLE_HEADER       *Table)
+{
+    ACPI_STATUS             Status;
+    ACPI_CSRT_GROUP         *SubTable;
+    ACPI_CSRT_DESCRIPTOR    *SubSubTable;
+    UINT32                  Length = Table->Length;
+    UINT32                  Offset = sizeof (ACPI_TABLE_CSRT);
+    UINT32                  SubOffset;
+    UINT32                  SubSubOffset;
+    UINT32                  InfoLength;
+
+
+    /* The main table only contains the ACPI header, thus already handled */
+
+    /* Sub-tables (Resource Groups) */
+
+    SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
+    while (Offset < Table->Length)
+    {
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
+                    SubTable->Length, AcpiDmTableInfoCsrt0);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        SubOffset = sizeof (ACPI_CSRT_GROUP);
+
+        /* Shared resource group info buffer */
+
+        AcpiDmDumpBuffer (SubTable, SubOffset, SubTable->InfoLength,
+            Offset+SubOffset, "Shared Data");
+        SubOffset += SubTable->InfoLength;
+
+        /* Sub-Sub-tables (Resource Descriptors) */
+
+        SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
+            Offset + SubOffset);
+
+        while ((SubOffset < SubTable->Length) &&
+              ((Offset + SubOffset) < Table->Length))
+        {
+            AcpiOsPrintf ("\n");
+            Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable,
+                        SubSubTable->Length, AcpiDmTableInfoCsrt1);
+            if (ACPI_FAILURE (Status))
+            {
+                return;
+            }
+
+            SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR);
+
+            /* Resource-specific info buffer */
+
+            InfoLength = SubSubTable->Length - SubSubOffset;
+
+            AcpiDmDumpBuffer (SubSubTable, SubSubOffset, InfoLength,
+                Offset + SubOffset + SubSubOffset, "ResourceInfo");
+            SubSubOffset += InfoLength;
+
+            /* Point to next sub-sub-table */
+
+            SubOffset += SubSubTable->Length;
+            SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable,
+                        SubSubTable->Length);
+        }
+
+        /* Point to next sub-table */
+
+        Offset += SubTable->Length;
+        SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
+                    SubTable->Length);
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDmDumpDbg2
+ *
+ * PARAMETERS:  Table               - A DBG2 table
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of a DBG2. This table type consists
+ *              of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpDbg2 (
+    ACPI_TABLE_HEADER       *Table)
+{
+    ACPI_STATUS             Status;
+    ACPI_DBG2_DEVICE        *SubTable;
+    UINT32                  Length = Table->Length;
+    UINT32                  Offset = sizeof (ACPI_TABLE_DBG2);
+    UINT32                  i;
+    UINT32                  ArrayOffset;
+    UINT32                  AbsoluteOffset;
+    UINT8                   *Array;
+
+
+    /* Main table */
+
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
+    if (ACPI_FAILURE (Status))
+    {
+        return;
+    }
+
+    /* Sub-tables */
+
+    SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
+    while (Offset < Table->Length)
+    {
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
+                    SubTable->Length, AcpiDmTableInfoDbg2Device);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        /* Dump the BaseAddress array */
+
+        for (i = 0; i < SubTable->RegisterCount; i++)
+        {
+            ArrayOffset = SubTable->BaseAddressOffset +
+                (sizeof (ACPI_GENERIC_ADDRESS) * i);
+            AbsoluteOffset = Offset + ArrayOffset;
+            Array = (UINT8 *) SubTable + ArrayOffset;
+
+            Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+                        SubTable->Length, AcpiDmTableInfoDbg2Addr);
+            if (ACPI_FAILURE (Status))
+            {
+                return;
+            }
+        }
+
+        /* Dump the AddressSize array */
+
+        for (i = 0; i < SubTable->RegisterCount; i++)
+        {
+            ArrayOffset = SubTable->AddressSizeOffset +
+                (sizeof (UINT32) * i);
+            AbsoluteOffset = Offset + ArrayOffset;
+            Array = (UINT8 *) SubTable + ArrayOffset;
+
+            Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+                        SubTable->Length, AcpiDmTableInfoDbg2Size);
+            if (ACPI_FAILURE (Status))
+            {
+                return;
+            }
+        }
+
+        /* Dump the Namestring (required) */
+
+        AcpiOsPrintf ("\n");
+        ArrayOffset = SubTable->NamepathOffset;
+        AbsoluteOffset = Offset + ArrayOffset;
+        Array = (UINT8 *) SubTable + ArrayOffset;
+
+        Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
+                    SubTable->Length, AcpiDmTableInfoDbg2Name);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        /* Dump the OemData (optional) */
+
+        AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
+            Offset + SubTable->OemDataOffset, "OEM Data");
+
+        /* Point to next sub-table */
+
+        Offset += SubTable->Length;
+        SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
+                    SubTable->Length);
+    }
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    AcpiDmDumpDmar
  *
  * PARAMETERS:  Table               - A DMAR table
@@ -540,6 +810,7 @@ AcpiDmDumpCpep (
  *
  ******************************************************************************/
 
+
 void
 AcpiDmDumpDmar (
     ACPI_TABLE_HEADER       *Table)

Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c
==============================================================================
--- head/sys/contrib/dev/acpica/common/dmtbinfo.c	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/sys/contrib/dev/acpica/common/dmtbinfo.c	Thu Aug 16 20:54:52 2012	(r239340)
@@ -86,6 +86,7 @@
 #define ACPI_BGRT_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_BGRT,f)
 #define ACPI_BOOT_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_BOOT,f)
 #define ACPI_CPEP_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_CPEP,f)
+#define ACPI_DBG2_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_DBG2,f)
 #define ACPI_DBGP_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_DBGP,f)
 #define ACPI_DMAR_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_DMAR,f)
 #define ACPI_DRTM_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_TABLE_DRTM,f)
@@ -126,6 +127,9 @@
 #define ACPI_ASF3_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f)
 #define ACPI_ASF4_OFFSET(f)             (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
 #define ACPI_CPEP0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f)
+#define ACPI_CSRT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f)
+#define ACPI_CSRT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_CSRT_DESCRIPTOR,f)
+#define ACPI_DBG20_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DBG2_DEVICE,f)
 #define ACPI_DMARS_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f)
 #define ACPI_DMAR0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f)
 #define ACPI_DMAR1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
@@ -641,6 +645,94 @@ ACPI_DMTABLE_INFO           AcpiDmTableI
 
 /*******************************************************************************
  *
+ * CSRT - Core System Resource Table
+ *
+ ******************************************************************************/
+
+/* Main table consists only of the standard ACPI table header */
+
+/* Resource Group subtable */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoCsrt0[] =
+{
+    {ACPI_DMT_UINT32,   ACPI_CSRT0_OFFSET (Length),                 "Length", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT0_OFFSET (VendorId),               "Vendor ID", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT0_OFFSET (SubvendorId),            "Subvendor ID", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT0_OFFSET (DeviceId),               "Device ID", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT0_OFFSET (SubdeviceId),            "Subdevice ID", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT0_OFFSET (Revision),               "Revision", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT0_OFFSET (Reserved),               "Reserved", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT0_OFFSET (InfoLength),             "InfoLength", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+/* Resource Descriptor subtable */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoCsrt1[] =
+{
+    {ACPI_DMT_UINT32,   ACPI_CSRT1_OFFSET (Length),                 "Length", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT1_OFFSET (Type),                   "Type", 0},
+    {ACPI_DMT_UINT16,   ACPI_CSRT1_OFFSET (Subtype),                "Subtype", 0},
+    {ACPI_DMT_UINT32,   ACPI_CSRT1_OFFSET (Uid),                    "UID", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
+ * DBG2 - Debug Port Table 2
+ *
+ ******************************************************************************/
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2[] =
+{
+    {ACPI_DMT_UINT32,   ACPI_DBG2_OFFSET (InfoOffset),              "Info Offset", 0},
+    {ACPI_DMT_UINT32,   ACPI_DBG2_OFFSET (InfoCount),               "Info Count", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+/* Debug Device Information Subtable */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2Device[] =
+{
+    {ACPI_DMT_UINT8,    ACPI_DBG20_OFFSET (Revision),               "Revision", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (Length),                 "Length", 0},
+    {ACPI_DMT_UINT8,    ACPI_DBG20_OFFSET (RegisterCount),          "Register Count", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (NamepathLength),         "Namepath Length", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (NamepathOffset),         "Namepath Offset", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (OemDataLength),          "OEM Data Length", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (OemDataOffset),          "OEM Data Offset", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (PortType),               "Port Type", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (PortSubtype),            "Port Subtype", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (Reserved),               "Reserved", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (BaseAddressOffset),      "Base Address Offset", 0},
+    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (AddressSizeOffset),      "Address Size Offset", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+/* Variable-length data for the subtable */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2Addr[] =
+{
+    {ACPI_DMT_GAS,      0,                                          "Base Address Register", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2Size[] =
+{
+    {ACPI_DMT_UINT32,   0,                                          "Address Size", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2Name[] =
+{
+    {ACPI_DMT_STRING,   0,                                          "Namepath", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+
+/*******************************************************************************
+ *
  * DBGP - Debug Port
  *
  ******************************************************************************/

Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslcompiler.h	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h	Thu Aug 16 20:54:52 2012	(r239340)
@@ -594,6 +594,11 @@ TrSetNodeFlags (
     UINT32                  Flags);
 
 ACPI_PARSE_OBJECT *
+TrSetNodeAmlLength (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  Length);
+
+ACPI_PARSE_OBJECT *
 TrLinkPeerNodes (
     UINT32                  NumPeers,
     ...);

Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.y
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslcompiler.y	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/sys/contrib/dev/acpica/compiler/aslcompiler.y	Thu Aug 16 20:54:52 2012	(r239340)
@@ -560,7 +560,7 @@ void *                      AslLocalAllo
 %type <n> SwitchTerm
 %type <n> UnloadTerm
 %type <n> WhileTerm
-//%type <n> CaseTermList
+/* %type <n> CaseTermList */
 
 /* Type 2 opcodes */
 
@@ -2507,30 +2507,38 @@ ConstExprTerm
     | PARSEOP___PATH__              {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);}
     ;
 
+/*
+ * The NODE_COMPILE_TIME_CONST flag in the following constant expressions
+ * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes
+ * to simple integers. It is an error if these types of expressions cannot be
+ * reduced, since the AML grammar for ****ConstExpr requires a simple constant.
+ * Note: The required byte length of the constant is passed through to the
+ * constant folding code in the node AmlLength field.
+ */
 ByteConstExpr
-    : Type3Opcode                   {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
-    | Type2IntegerOpcode            {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
+    : Type3Opcode                   {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
+    | Type2IntegerOpcode            {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
     | ConstExprTerm                 {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
     | ByteConst                     {}
     ;
 
 WordConstExpr
-    : Type3Opcode                   {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
-    | Type2IntegerOpcode            {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
+    : Type3Opcode                   {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
+    | Type2IntegerOpcode            {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
     | ConstExprTerm                 {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
     | WordConst                     {}
     ;
 
 DWordConstExpr
-    : Type3Opcode                   {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
-    | Type2IntegerOpcode            {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
+    : Type3Opcode                   {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
+    | Type2IntegerOpcode            {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
     | ConstExprTerm                 {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
     | DWordConst                    {}
     ;
 
 QWordConstExpr
-    : Type3Opcode                   {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
-    | Type2IntegerOpcode            {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
+    : Type3Opcode                   {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
+    | Type2IntegerOpcode            {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
     | ConstExprTerm                 {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
     | QWordConst                    {}
     ;
@@ -2839,10 +2847,10 @@ ExtendedSpaceTerm
 
 FixedDmaTerm
     : PARSEOP_FIXEDDMA '('          {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);}
-        WordConstExpr               // 04: DMA RequestLines
-        ',' WordConstExpr           // 06: DMA Channels
-        OptionalXferSize            // 07: DMA TransferSize
-        OptionalNameString          // 08: DescriptorName
+        WordConstExpr               /* 04: DMA RequestLines */
+        ',' WordConstExpr           /* 06: DMA Channels */
+        OptionalXferSize            /* 07: DMA TransferSize */
+        OptionalNameString          /* 08: DescriptorName */
         ')'                         {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);}
     | PARSEOP_FIXEDDMA '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
@@ -2860,16 +2868,16 @@ FixedIOTerm
 
 GpioIntTerm
     : PARSEOP_GPIO_INT '('          {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);}
-        InterruptTypeKeyword        // 04: InterruptType
-        ',' InterruptLevel          // 06: InterruptLevel
-        OptionalShareType           // 07: SharedType
-        ',' PinConfigByte           // 09: PinConfig
-        OptionalWordConstExpr       // 10: DebounceTimeout
-        ',' StringData              // 12: ResourceSource
-        OptionalByteConstExpr       // 13: ResourceSourceIndex
-        OptionalResourceType        // 14: ResourceType
-        OptionalNameString          // 15: DescriptorName
-        OptionalBuffer_Last         // 16: VendorData
+        InterruptTypeKeyword        /* 04: InterruptType */
+        ',' InterruptLevel          /* 06: InterruptLevel */
+        OptionalShareType           /* 07: SharedType */
+        ',' PinConfigByte           /* 09: PinConfig */
+        OptionalWordConstExpr       /* 10: DebounceTimeout */
+        ',' StringData              /* 12: ResourceSource */
+        OptionalByteConstExpr       /* 13: ResourceSourceIndex */
+        OptionalResourceType        /* 14: ResourceType */
+        OptionalNameString          /* 15: DescriptorName */
+        OptionalBuffer_Last         /* 16: VendorData */
         ')' '{'
             DWordConstExpr '}'      {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);}
     | PARSEOP_GPIO_INT '('
@@ -2878,16 +2886,16 @@ GpioIntTerm
 
 GpioIoTerm
     : PARSEOP_GPIO_IO '('           {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);}
-        OptionalShareType_First     // 04: SharedType
-        ',' PinConfigByte           // 06: PinConfig
-        OptionalWordConstExpr       // 07: DebounceTimeout
-        OptionalWordConstExpr       // 08: DriveStrength
-        OptionalIoRestriction       // 09: IoRestriction
-        ',' StringData              // 11: ResourceSource
-        OptionalByteConstExpr       // 12: ResourceSourceIndex
-        OptionalResourceType        // 13: ResourceType
-        OptionalNameString          // 14: DescriptorName
-        OptionalBuffer_Last         // 15: VendorData
+        OptionalShareType_First     /* 04: SharedType */
+        ',' PinConfigByte           /* 06: PinConfig */
+        OptionalWordConstExpr       /* 07: DebounceTimeout */
+        OptionalWordConstExpr       /* 08: DriveStrength */
+        OptionalIoRestriction       /* 09: IoRestriction */
+        ',' StringData              /* 11: ResourceSource */
+        OptionalByteConstExpr       /* 12: ResourceSourceIndex */
+        OptionalResourceType        /* 13: ResourceType */
+        OptionalNameString          /* 14: DescriptorName */
+        OptionalBuffer_Last         /* 15: VendorData */
         ')' '{'
             DWordList '}'           {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);}
     | PARSEOP_GPIO_IO '('
@@ -2896,15 +2904,15 @@ GpioIoTerm
 
 I2cSerialBusTerm
     : PARSEOP_I2C_SERIALBUS '('     {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);}
-        WordConstExpr               // 04: SlaveAddress
-        OptionalSlaveMode           // 05: SlaveMode
-        ',' DWordConstExpr          // 07: ConnectionSpeed
-        OptionalAddressingMode      // 08: AddressingMode
-        ',' StringData              // 10: ResourceSource
-        OptionalByteConstExpr       // 11: ResourceSourceIndex
-        OptionalResourceType        // 12: ResourceType
-        OptionalNameString          // 13: DescriptorName
-        OptionalBuffer_Last         // 14: VendorData
+        WordConstExpr               /* 04: SlaveAddress */
+        OptionalSlaveMode           /* 05: SlaveMode */
+        ',' DWordConstExpr          /* 07: ConnectionSpeed */
+        OptionalAddressingMode      /* 08: AddressingMode */
+        ',' StringData              /* 10: ResourceSource */
+        OptionalByteConstExpr       /* 11: ResourceSourceIndex */
+        OptionalResourceType        /* 12: ResourceType */
+        OptionalNameString          /* 13: DescriptorName */
+        OptionalBuffer_Last         /* 14: VendorData */
         ')'                         {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);}
     | PARSEOP_I2C_SERIALBUS '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
@@ -3077,19 +3085,19 @@ RegisterTerm
 
 SpiSerialBusTerm
     : PARSEOP_SPI_SERIALBUS '('     {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);}
-        WordConstExpr               // 04: DeviceSelection
-        OptionalDevicePolarity      // 05: DevicePolarity
-        OptionalWireMode            // 06: WireMode
-        ',' ByteConstExpr           // 08: DataBitLength
-        OptionalSlaveMode           // 09: SlaveMode
-        ',' DWordConstExpr          // 11: ConnectionSpeed
-        ',' ClockPolarityKeyword    // 13: ClockPolarity
-        ',' ClockPhaseKeyword       // 15: ClockPhase
-        ',' StringData              // 17: ResourceSource
-        OptionalByteConstExpr       // 18: ResourceSourceIndex
-        OptionalResourceType        // 19: ResourceType
-        OptionalNameString          // 20: DescriptorName
-        OptionalBuffer_Last         // 21: VendorData
+        WordConstExpr               /* 04: DeviceSelection */
+        OptionalDevicePolarity      /* 05: DevicePolarity */
+        OptionalWireMode            /* 06: WireMode */
+        ',' ByteConstExpr           /* 08: DataBitLength */
+        OptionalSlaveMode           /* 09: SlaveMode */
+        ',' DWordConstExpr          /* 11: ConnectionSpeed */
+        ',' ClockPolarityKeyword    /* 13: ClockPolarity */
+        ',' ClockPhaseKeyword       /* 15: ClockPhase */
+        ',' StringData              /* 17: ResourceSource */
+        OptionalByteConstExpr       /* 18: ResourceSourceIndex */
+        OptionalResourceType        /* 19: ResourceType */
+        OptionalNameString          /* 20: DescriptorName */
+        OptionalBuffer_Last         /* 21: VendorData */
         ')'                         {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);}
     | PARSEOP_SPI_SERIALBUS '('
         error ')'                   {$$ = AslDoError(); yyclearin;}
@@ -3115,20 +3123,20 @@ StartDependentFnTerm
 
 UartSerialBusTerm
     : PARSEOP_UART_SERIALBUS '('    {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);}
-        DWordConstExpr              // 04: ConnectionSpeed
-        OptionalBitsPerByte         // 05: BitsPerByte
-        OptionalStopBits            // 06: StopBits
-        ',' ByteConstExpr           // 08: LinesInUse
-        OptionalEndian              // 09: Endianess
-        OptionalParityType          // 10: Parity
-        OptionalFlowControl         // 11: FlowControl
-        ',' WordConstExpr           // 13: Rx BufferSize
-        ',' WordConstExpr           // 15: Tx BufferSize
-        ',' StringData              // 17: ResourceSource
-        OptionalByteConstExpr       // 18: ResourceSourceIndex
-        OptionalResourceType        // 19: ResourceType
-        OptionalNameString          // 20: DescriptorName
-        OptionalBuffer_Last         // 21: VendorData
+        DWordConstExpr              /* 04: ConnectionSpeed */
+        OptionalBitsPerByte         /* 05: BitsPerByte */
+        OptionalStopBits            /* 06: StopBits */
+        ',' ByteConstExpr           /* 08: LinesInUse */
+        OptionalEndian              /* 09: Endianess */
+        OptionalParityType          /* 10: Parity */
+        OptionalFlowControl         /* 11: FlowControl */
+        ',' WordConstExpr           /* 13: Rx BufferSize */
+        ',' WordConstExpr           /* 15: Tx BufferSize */
+        ',' StringData              /* 17: ResourceSource */
+        OptionalByteConstExpr       /* 18: ResourceSourceIndex */
+        OptionalResourceType        /* 19: ResourceType */
+        OptionalNameString          /* 20: DescriptorName */
+        OptionalBuffer_Last         /* 21: VendorData */
         ')'                         {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);}
     | PARSEOP_UART_SERIALBUS '('
         error ')'                   {$$ = AslDoError(); yyclearin;}

Modified: head/sys/contrib/dev/acpica/compiler/aslfold.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslfold.c	Thu Aug 16 20:30:14 2012	(r239339)
+++ head/sys/contrib/dev/acpica/compiler/aslfold.c	Thu Aug 16 20:54:52 2012	(r239340)
@@ -73,6 +73,11 @@ OpcAmlCheckForConstant (
     UINT32                  Level,
     void                    *Context);
 
+static void
+OpcUpdateIntegerNode (
+    ACPI_PARSE_OBJECT       *Op,
+    UINT64                  Value);
+
 
 /*******************************************************************************
  *
@@ -214,14 +219,14 @@ OpcAmlCheckForConstant (
         {
             /*
              * We are looking at at normal expression to see if it can be
-             * reduced.  It can't.  No error
+             * reduced. It can't. No error
              */
             return (AE_TYPE);
         }
 
         /*
          * This is an expression that MUST reduce to a constant, and it
-         * can't be reduced.  This is an error
+         * can't be reduced. This is an error
          */
         if (Op->Asl.CompileFlags & NODE_IS_TARGET)
         {
@@ -319,17 +324,17 @@ OpcAmlConstantWalk (
         return AE_NO_MEMORY;
     }
 
-    WalkState->NextOp               = NULL;
-    WalkState->Params               = NULL;
-    WalkState->CallerReturnDesc     = &ObjDesc;
-    WalkState->WalkType             = WalkType;
+    WalkState->NextOp = NULL;
+    WalkState->Params = NULL;
+    WalkState->WalkType = WalkType;
+    WalkState->CallerReturnDesc = &ObjDesc;
 
     /*
      * Examine the entire subtree -- all nodes must be constants
      * or type 3/4/5 opcodes
      */
     Status = TrWalkParseTree (Op, ASL_WALK_VISIT_DOWNWARD,
-                OpcAmlCheckForConstant, NULL, WalkState);
+        OpcAmlCheckForConstant, NULL, WalkState);
 
     /*
      * Did we find an entire subtree that contains all constants and type 3/4/5
@@ -369,7 +374,7 @@ OpcAmlConstantWalk (
         /* Hand off the subtree to the AML interpreter */
 
         Status = TrWalkParseTree (Op, ASL_WALK_VISIT_TWICE,
-                    OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
+            OpcAmlEvaluationWalk1, OpcAmlEvaluationWalk2, WalkState);
         Op->Common.Parent = OriginalParentOp;
 
         /* TBD: we really *should* release the RootOp node */
@@ -382,22 +387,26 @@ OpcAmlConstantWalk (
 
             Status = AcpiDsResultPop (&ObjDesc, WalkState);
         }
+
+        /* Check for error from the ACPICA core */
+
+        if (ACPI_FAILURE (Status))
+        {
+            AslCoreSubsystemError (Op, Status,
+                "Failure during constant evaluation", FALSE);
+        }
     }
 
     if (ACPI_FAILURE (Status))
     {
         /* We could not resolve the subtree for some reason */
 
-        AslCoreSubsystemError (Op, Status,
-            "Failure during constant evaluation", FALSE);
         AslError (ASL_ERROR, ASL_MSG_CONSTANT_EVALUATION, Op,
             Op->Asl.ParseOpName);
 
-        /* Set the subtree value to ZERO anyway.  Eliminates further errors */
+        /* Set the subtree value to ZERO anyway. Eliminates further errors */
 
-        Op->Asl.ParseOpcode      = PARSEOP_INTEGER;
-        Op->Common.Value.Integer = 0;
-        OpcSetOptimalIntegerSize (Op);
+        OpcUpdateIntegerNode (Op, 0);
     }
     else
     {
@@ -412,21 +421,20 @@ OpcAmlConstantWalk (
         {
         case ACPI_TYPE_INTEGER:
 
-            Op->Asl.ParseOpcode      = PARSEOP_INTEGER;
-            Op->Common.Value.Integer = ObjDesc->Integer.Value;
-            OpcSetOptimalIntegerSize (Op);
+            OpcUpdateIntegerNode (Op, ObjDesc->Integer.Value);
 
             DbgPrint (ASL_PARSE_OUTPUT,
-                "Constant expression reduced to (INTEGER) %8.8X%8.8X\n",
-                ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
+                "Constant expression reduced to (%s) %8.8X%8.8X\n",
+                Op->Asl.ParseOpName,
+                ACPI_FORMAT_UINT64 (Op->Common.Value.Integer));
             break;
 
 
         case ACPI_TYPE_STRING:
 
-            Op->Asl.ParseOpcode     = PARSEOP_STRING_LITERAL;
-            Op->Common.AmlOpcode    = AML_STRING_OP;
-            Op->Asl.AmlLength       = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
+            Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL;
+            Op->Common.AmlOpcode = AML_STRING_OP;
+            Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1;
             Op->Common.Value.String = ObjDesc->String.Pointer;
 

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208162054.q7GKsrbo067915>