From owner-svn-src-vendor@FreeBSD.ORG Wed Jun 26 19:01:15 2013 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 363BC378; Wed, 26 Jun 2013 19:01:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 244BE16F9; Wed, 26 Jun 2013 19:01:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5QJ1Fj4028510; Wed, 26 Jun 2013 19:01:15 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5QJ1B6A028479; Wed, 26 Jun 2013 19:01:11 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201306261901.r5QJ1B6A028479@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 26 Jun 2013 19:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r252256 - in vendor-sys/acpica/dist: . generate/unix generate/unix/acpidump generate/unix/iasl source/common source/compiler source/components/debugger source/components/disassembler so... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2013 19:01:15 -0000 Author: jkim Date: Wed Jun 26 19:01:10 2013 New Revision: 252256 URL: http://svnweb.freebsd.org/changeset/base/252256 Log: Import ACPICA 20130626. Added: vendor-sys/acpica/dist/source/os_specific/service_layers/osfreebsdtbl.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/Makefile.common vendor-sys/acpica/dist/generate/unix/Makefile.config vendor-sys/acpica/dist/generate/unix/acpidump/Makefile vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/source/common/dmrestag.c vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/common/dmtbdump.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/asltree.c vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/dtfield.c vendor-sys/acpica/dist/source/compiler/dtio.c vendor-sys/acpica/dist/source/compiler/dttable.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/compiler/dtutils.c vendor-sys/acpica/dist/source/compiler/preprocess.h vendor-sys/acpica/dist/source/compiler/prscan.c vendor-sys/acpica/dist/source/components/debugger/dbcmds.c vendor-sys/acpica/dist/source/components/debugger/dbdisply.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/debugger/dbnames.c vendor-sys/acpica/dist/source/components/disassembler/dmbuffer.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/disassembler/dmresrcl.c vendor-sys/acpica/dist/source/components/disassembler/dmresrcl2.c vendor-sys/acpica/dist/source/components/events/evgpeinit.c vendor-sys/acpica/dist/source/components/executer/exdump.c vendor-sys/acpica/dist/source/components/namespace/nsdump.c vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c vendor-sys/acpica/dist/source/components/namespace/nsxfname.c vendor-sys/acpica/dist/source/components/resources/rsdump.c vendor-sys/acpica/dist/source/components/resources/rsutils.c vendor-sys/acpica/dist/source/components/tables/tbxfroot.c vendor-sys/acpica/dist/source/components/utilities/uteval.c vendor-sys/acpica/dist/source/components/utilities/utstring.c vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/actables.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/os_specific/service_layers/oslinuxtbl.c vendor-sys/acpica/dist/source/tools/acpidump/acpidump.h vendor-sys/acpica/dist/source/tools/acpidump/apdump.c vendor-sys/acpica/dist/source/tools/acpidump/apmain.c vendor-sys/acpica/dist/source/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/source/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpihelp/ahmain.c vendor-sys/acpica/dist/source/tools/acpisrc/asfile.c vendor-sys/acpica/dist/source/tools/acpisrc/asmain.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/changes.txt Wed Jun 26 19:01:10 2013 (r252256) @@ -1,4 +1,60 @@ ---------------------------------------- +26 June 2013. Summary of changes for version 20130626: + +1) ACPICA kernel-resident subsystem: + +Fixed an issue with runtime repair of the _CST object. Null or invalid +elements were not always removed properly. Lv Zheng. + +Removed an arbitrary restriction of 256 GPEs per GPE block (such as the +FADT-defined GPE0 and GPE1). For GPE0, GPE1, and each GPE Block Device, +the maximum number of GPEs is 1016. Use of multiple GPE block devices +makes the system-wide number of GPEs essentially unlimited. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 95.9K Code, 26.9K Data, 122.8K Total + Debug Version: 184.1K Code, 76.7K Data, 260.8K Total + Previous Release: + Non-Debug Version: 96.0K Code, 27.0K Data, 123.0K Total + Debug Version: 184.1K Code, 76.8K Data, 260.9K Total + + +2) iASL Compiler/Disassembler and Tools: + +Portable AcpiDump: Implemented full support for the Linux and FreeBSD +hosts. Now supports Linux, FreeBSD, and Windows. + +Disassembler: Added some missing types for the HEST and EINJ tables: "Set +Error Type With Address", "CMCI", "MCE", and "Flush Cacheline". + +iASL/Preprocessor: Implemented full support for nested +#if/#else/#elif/#endif blocks. Allows arbitrary depth of nested blocks. + +Disassembler: Expanded maximum output string length to 64K. Was 256 bytes +max. The original purpose of this constraint was to limit the amount of +debug output. However, the string function in question (UtPrintString) is +now used for the disassembler also, where 256 bytes is insufficient. +Reported by RehabMan@GitHub. + +iASL/DataTables: Fixed some problems and issues with compilation of DMAR +tables. ACPICA BZ 999. Lv Zheng. + +iASL: Fixed a couple of error exit issues that could result in a "Could +not delete " message during ASL compilation. + +AcpiDump: Allow "FADT" and "MADT" as valid table signatures, even though +the actual signatures for these tables are "FACP" and "APIC", +respectively. + +AcpiDump: Added support for multiple UEFI tables. Only SSDT and UEFI +tables are allowed to have multiple instances. + +---------------------------------------- 17 May 2013. Summary of changes for version 20130517: 1) ACPICA kernel-resident subsystem: Modified: vendor-sys/acpica/dist/generate/unix/Makefile.common ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.common Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/generate/unix/Makefile.common Wed Jun 26 19:01:10 2013 (r252256) @@ -12,11 +12,11 @@ HARDWARE_NAME := $(shell uname -m) # Main rule will only generate versions that are appropriate for the running # OS, either 64-bit or 32-bit. # -all: ${PROGS} -${PROGS}: FORCE +all: $(PROGS) +$(PROGS): FORCE @cd $(BUILD_DIRECTORY_PATH)/$@; \ mkdir -p obj; \ - make || exit "$$?"; \ + $(MAKE) || exit "$$?"; \ if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \ echo "64-bit version of $@:"; \ else \ @@ -30,12 +30,12 @@ ${PROGS}: FORCE # in the local bin directory # clean: FORCE - @for toolname in ${PROGS}; do \ + @for toolname in $(PROGS); do \ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ if [ -d "obj" ] ; then \ echo "Removing $$toolname:"; \ pwd; \ - make clean; \ + $(MAKE) clean; \ rmdir obj; \ echo ""; \ fi; \ @@ -46,12 +46,12 @@ clean: FORCE # Very clean removes all executables and the local bin directory # veryclean: FORCE - @for toolname in ${PROGS}; do \ + @for toolname in $(PROGS); do \ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ if [ -d "obj" ] ; then \ echo "Removing $$toolname:"; \ pwd; \ - make clean; \ + $(MAKE) clean; \ rmdir obj; \ echo ""; \ fi; \ @@ -68,10 +68,10 @@ veryclean: FORCE # Install all tools, either 32-bit or 64-bit as appropriate for the host OS # install: FORCE - @for toolname in ${PROGS}; do \ + @for toolname in $(PROGS); do \ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ pwd; \ - make PROG=$$toolname install; \ + $(MAKE) PROG=$$toolname install; \ if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \ echo "Installed 64-bit version of $$toolname"; \ else \ Modified: vendor-sys/acpica/dist/generate/unix/Makefile.config ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.config Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/generate/unix/Makefile.config Wed Jun 26 19:01:10 2013 (r252256) @@ -26,7 +26,7 @@ # Notes: # gcc should be version 4 or greater, otherwise some of the options # used will not be recognized. -# Optional: Change HOST to an appropriate value (_LINUX, __FreeBSD__, etc.) +# Optional: Set HOST to an appropriate value (_LINUX, _FreeBSD, _APPLE, _CYGWIN, etc.) # See include/platform/acenv.h for supported values. # Note: HOST is not nearly as important for applications as it # is for the kernel-resident version of ACPICA, and it may @@ -155,22 +155,27 @@ CWARNINGFLAGS += \ -Waddress\ -Waggregate-return\ -Wchar-subscripts\ - -Wempty-body\ -Wmissing-declarations\ -Wmissing-field-initializers\ -Wnested-externs\ -Wold-style-definition\ + -Wno-format-nonliteral\ -Wredundant-decls # -# Additional gcc 4+ flags +# Per-host flags and exclusions # -ifneq ($(HOST), _APPLE) -CWARNINGFLAGS += \ - -Wlogical-op\ - -Wmissing-parameter-type\ - -Wold-style-declaration\ - -Wtype-limits +ifneq ($(HOST), _FreeBSD) + CWARNINGFLAGS += \ + -Wempty-body + + ifneq ($(HOST), _APPLE) + CWARNINGFLAGS += \ + -Wlogical-op\ + -Wmissing-parameter-type\ + -Wold-style-declaration\ + -Wtype-limits + endif endif # Modified: vendor-sys/acpica/dist/generate/unix/acpidump/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpidump/Makefile Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/generate/unix/acpidump/Makefile Wed Jun 26 19:01:10 2013 (r252256) @@ -32,15 +32,26 @@ OBJECTS = \ $(OBJDIR)/apfiles.o\ $(OBJDIR)/apmain.o\ $(OBJDIR)/tbprint.o\ + $(OBJDIR)/tbxfroot.o\ $(OBJDIR)/utbuffer.o\ $(OBJDIR)/utexcep.o\ $(OBJDIR)/utmath.o\ $(OBJDIR)/utstring.o\ $(OBJDIR)/utxferror.o\ - $(OBJDIR)/oslinuxtbl.o\ $(OBJDIR)/getopt.o # +# Per-host interfaces +# +ifeq ($(HOST), _FreeBSD) +OBJECTS += \ + $(OBJDIR)/osfreebsdtbl.o +else +OBJECTS += \ + $(OBJDIR)/oslinuxtbl.o +endif + +# # Flags specific to acpidump # CFLAGS += \ Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Wed Jun 26 19:01:10 2013 (r252256) @@ -238,22 +238,22 @@ include ../Makefile.rules # Parser and Lexer - intermediate C files # $(OBJDIR)/aslcompilerlex.c : $(ASL_COMPILER)/aslcompiler.l $(ASL_COMPILER)/aslsupport.l - ${LEX} ${LFLAGS} -PAslCompiler -o$@ $(ASL_COMPILER)/aslcompiler.l + $(LEX) $(LFLAGS) -PAslCompiler -o$@ $(ASL_COMPILER)/aslcompiler.l $(OBJDIR)/aslcompilerparse.c $(OBJDIR)/aslcompilerparse.h : $(ASL_COMPILER)/aslcompiler.y - ${YACC} ${YFLAGS} -pAslCompiler -o$@ $? + $(YACC) $(YFLAGS) -pAslCompiler -o$@ $? $(OBJDIR)/dtparserlex.c : $(ASL_COMPILER)/dtparser.l - ${LEX} ${LFLAGS} -PDtParser -o$@ $? + $(LEX) $(LFLAGS) -PDtParser -o$@ $? $(OBJDIR)/dtparserparse.c $(OBJDIR)/dtparserparse.h : $(ASL_COMPILER)/dtparser.y - ${YACC} ${YFLAGS} -pDtParser -o$@ $? + $(YACC) $(YFLAGS) -pDtParser -o$@ $? $(OBJDIR)/prparserlex.c : $(ASL_COMPILER)/prparser.l - ${LEX} ${LFLAGS} -PPrParser -o$@ $? + $(LEX) $(LFLAGS) -PPrParser -o$@ $? $(OBJDIR)/prparserparse.c $(OBJDIR)/prparserparse.h : $(ASL_COMPILER)/prparser.y - ${YACC} ${YFLAGS} -pPrParser -o$@ $? + $(YACC) $(YFLAGS) -pPrParser -o$@ $? # Modified: vendor-sys/acpica/dist/source/common/dmrestag.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmrestag.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/common/dmrestag.c Wed Jun 26 19:01:10 2013 (r252256) @@ -666,6 +666,7 @@ AcpiGetTagPathname ( Status = AcpiNsBuildExternalPath (BufferNode, RequiredSize, Pathname); if (ACPI_FAILURE (Status)) { + ACPI_FREE (Pathname); return (NULL); } Modified: vendor-sys/acpica/dist/source/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtable.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/common/dmtable.c Wed Jun 26 19:01:10 2013 (r252256) @@ -100,6 +100,7 @@ static const char *AcpiDmEinjA "Execute Operation", "Check Busy Status", "Get Command Status", + "Set Error Type With Address", "Unknown Action" }; @@ -110,6 +111,7 @@ static const char *AcpiDmEinjI "Write Register", "Write Register Value", "Noop", + "Flush Cacheline", "Unknown Instruction" }; @@ -180,6 +182,8 @@ static const char *AcpiDmHestN "Local Interrupt", "SCI", "NMI", + "CMCI", /* ACPI 5.0 */ + "MCE", /* ACPI 5.0 */ "Unknown Notify Type" /* Reserved */ }; @@ -744,6 +748,11 @@ AcpiDmDumpTable ( ByteLength = 8; break; + case ACPI_DMT_BUF10: + + ByteLength = 10; + break; + case ACPI_DMT_BUF16: case ACPI_DMT_UUID: @@ -862,6 +871,7 @@ AcpiDmDumpTable ( break; case ACPI_DMT_BUF7: + case ACPI_DMT_BUF10: case ACPI_DMT_BUF16: case ACPI_DMT_BUF128: /* Modified: vendor-sys/acpica/dist/source/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/common/dmtbdump.c Wed Jun 26 19:01:10 2013 (r252256) @@ -872,6 +872,7 @@ AcpiDmDumpDmar ( { return; } + AcpiOsPrintf ("\n"); switch (SubTable->Type) { @@ -924,6 +925,7 @@ AcpiDmDumpDmar ( { return; } + AcpiOsPrintf ("\n"); /* Dump the PCI Path entries for this device scope */ @@ -941,6 +943,7 @@ AcpiDmDumpDmar ( PathOffset += 2; PciPath += 2; + AcpiOsPrintf ("\n"); } /* Point to next device scope entry */ Modified: vendor-sys/acpica/dist/source/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/common/dmtbinfo.c Wed Jun 26 19:01:10 2013 (r252256) @@ -780,6 +780,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI { {ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Width), "Host Address Width", 0}, {ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_BUF10, ACPI_DMAR_OFFSET (Reserved[0]), "Reserved", 0}, ACPI_DMT_TERMINATOR }; Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Wed Jun 26 19:01:10 2013 (r252256) @@ -966,7 +966,19 @@ CmCleanupAndExit ( /* Close all open files */ - Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ + /* + * Take care with the preprocessor file (.i), it might be the same + * as the "input" file, depending on where the compiler has terminated + * or aborted. Prevent attempt to close the same file twice in + * loop below. + */ + if (Gbl_Files[ASL_FILE_PREPROCESSOR].Handle == + Gbl_Files[ASL_FILE_INPUT].Handle) + { + Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; + } + + /* Close the standard I/O files */ for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) { Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.h Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.h Wed Jun 26 19:01:10 2013 (r252256) @@ -248,7 +248,7 @@ typedef enum ASL_MSG_TOO_MANY_ARGUMENTS, ASL_MSG_UNKNOWN_DIRECTIVE, ASL_MSG_UNKNOWN_PRAGMA, - + ASL_MSG_WARNING_DIRECTIVE, /* These messages are used by the data table compiler only */ @@ -433,6 +433,7 @@ char *AslMessages /* ASL_MSG_TOO_MANY_ARGUMENTS */ "Too many macro arguments", /* ASL_MSG_UNKNOWN_DIRECTIVE */ "Unknown directive", /* ASL_MSG_UNKNOWN_PRAGMA */ "Unknown pragma", +/* ASL_MSG_WARNING_DIRECTIVE */ "#warning", /* Table compiler */ Modified: vendor-sys/acpica/dist/source/compiler/asltree.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asltree.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/compiler/asltree.c Wed Jun 26 19:01:10 2013 (r252256) @@ -823,6 +823,7 @@ TrLinkChildren ( { AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Child, "Child node list invalid"); + va_end(ap); return (Op); } @@ -869,8 +870,8 @@ TrLinkChildren ( } PrevChild = Child; } - va_end(ap); + va_end(ap); DbgPrint (ASL_PARSE_OUTPUT, "\n\n"); return (Op); } Modified: vendor-sys/acpica/dist/source/compiler/aslutils.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslutils.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/compiler/aslutils.c Wed Jun 26 19:01:10 2013 (r252256) @@ -353,8 +353,6 @@ DbgPrint ( va_list Args; - va_start (Args, Fmt); - if (!Gbl_DebugFlag) { return; @@ -366,6 +364,7 @@ DbgPrint ( return; } + va_start (Args, Fmt); (void) vfprintf (stderr, Fmt, Args); va_end (Args); return; Modified: vendor-sys/acpica/dist/source/compiler/dtfield.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtfield.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/compiler/dtfield.c Wed Jun 26 19:01:10 2013 (r252256) @@ -467,12 +467,13 @@ DtCompileBuffer ( if (ACPI_FAILURE (Status)) { DtError (ASL_ERROR, ASL_MSG_BUFFER_ELEMENT, Field, MsgBuffer); - return (ByteLength - Count); + goto Exit; } Buffer[i] = (UINT8) Value; } +Exit: ACPI_FREE (StringValue); return (ByteLength - Count); } Modified: vendor-sys/acpica/dist/source/compiler/dtio.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtio.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/compiler/dtio.c Wed Jun 26 19:01:10 2013 (r252256) @@ -287,31 +287,21 @@ DtParseLine ( while (Start < Colon) { - if (*Start == ' ') - { - Start++; - continue; - } - - /* Found left bracket, go to the right bracket */ - if (*Start == '[') { + /* Found left bracket, go to the right bracket */ + while (Start < Colon && *Start != ']') { Start++; } - - if (Start == Colon) - { - break; - } - - Start++; - continue; + } + else if (*Start != ' ') + { + break; } - break; + Start++; } /* @@ -1138,4 +1128,5 @@ DtWriteTableToListing ( AcpiUtDumpBuffer (Buffer, Gbl_TableLength, DB_BYTE_DISPLAY, 0); AcpiOsRedirectOutput (stdout); + ACPI_FREE (Buffer); } Modified: vendor-sys/acpica/dist/source/compiler/dttable.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dttable.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/compiler/dttable.c Wed Jun 26 19:01:10 2013 (r252256) @@ -541,8 +541,9 @@ DtCompileDmar ( DT_FIELD *SubtableStart; ACPI_DMTABLE_INFO *InfoTable; ACPI_DMAR_HEADER *DmarHeader; - UINT8 *ReservedBuffer; - UINT32 ReservedSize; + ACPI_DMAR_DEVICE_SCOPE *DmarDeviceScope; + UINT32 DeviceScopeLength; + UINT32 PciPathLength; Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable, TRUE); @@ -553,17 +554,7 @@ DtCompileDmar ( 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); + DtPushSubtable (Subtable); while (*PFieldList) { @@ -621,10 +612,13 @@ DtCompileDmar ( ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); + DtPushSubtable (Subtable); /* Optional Device Scope subtables */ - while (*PFieldList) + DeviceScopeLength = DmarHeader->Length - Subtable->Length - + ParentTable->Length; + while (DeviceScopeLength) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope, &Subtable, FALSE); @@ -637,9 +631,12 @@ DtCompileDmar ( DtInsertSubtable (ParentTable, Subtable); DtPushSubtable (Subtable); + DmarDeviceScope = ACPI_CAST_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable->Buffer); + /* Optional PCI Paths */ - while (*PFieldList) + PciPathLength = DmarDeviceScope->Length - Subtable->Length; + while (PciPathLength) { Status = DtCompileTable (PFieldList, TableInfoDmarPciPath, &Subtable, FALSE); @@ -651,10 +648,15 @@ DtCompileDmar ( ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); + PciPathLength -= Subtable->Length; } + + DtPopSubtable (); + DeviceScopeLength -= DmarDeviceScope->Length; } DtPopSubtable (); + DtPopSubtable (); } return (AE_OK); Modified: vendor-sys/acpica/dist/source/compiler/dttemplate.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dttemplate.h Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/compiler/dttemplate.h Wed Jun 26 19:01:10 2013 (r252256) @@ -188,22 +188,22 @@ const unsigned char TemplateDbgp[] = const unsigned char TemplateDmar[] = { 0x44,0x4D,0x41,0x52,0x8C,0x00,0x00,0x00, /* 00000000 "DMAR...." */ - 0x01,0x15,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ + 0x01,0x03,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x28,0x05,0x10,0x20,0x2F,0x01,0x00,0x00, /* 00000020 "(.. /..." */ + 0x17,0x05,0x13,0x20,0x2F,0x01,0x00,0x00, /* 00000020 "... /..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "........" */ 0x00,0x00,0x18,0x00,0x01,0x00,0x00,0x00, /* 00000030 "........" */ - 0x00,0x00,0x02,0xFD,0x00,0x00,0x00,0x00, /* 00000038 "........" */ - 0x03,0x08,0x00,0x00,0x08,0xF0,0x1F,0x07, /* 00000040 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ + 0x03,0x08,0x00,0x00,0x08,0x00,0x00,0x01, /* 00000040 "........" */ 0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00, /* 00000048 ".. ....." */ - 0x00,0x10,0xC2,0x78,0x00,0x00,0x00,0x00, /* 00000050 "...x...." */ - 0xFF,0x3F,0xC2,0x78,0x00,0x00,0x00,0x00, /* 00000058 ".?.x...." */ - 0x01,0x08,0x00,0x00,0x00,0x00,0x1D,0x00, /* 00000060 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */ + 0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */ + 0x01,0x08,0x00,0x00,0x00,0x00,0x00,0x02, /* 00000060 "........" */ 0x02,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */ - 0x02,0x08,0x00,0x00,0x00,0x00,0x01,0x00, /* 00000070 "........" */ + 0x02,0x08,0x00,0x00,0x00,0x00,0x00,0x03, /* 00000070 "........" */ 0x03,0x00,0x14,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ - 0x00,0x00,0x02,0xFD,0x00,0x00,0x00,0x00, /* 00000080 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00 /* 00000088 "...." */ }; Modified: vendor-sys/acpica/dist/source/compiler/dtutils.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtutils.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/compiler/dtutils.c Wed Jun 26 19:01:10 2013 (r252256) @@ -397,6 +397,7 @@ DtGetFieldType ( case ACPI_DMT_BUFFER: case ACPI_DMT_BUF7: + case ACPI_DMT_BUF10: case ACPI_DMT_BUF16: case ACPI_DMT_BUF128: case ACPI_DMT_PCI_PATH: @@ -630,6 +631,11 @@ DtGetFieldLength ( } break; + case ACPI_DMT_BUF10: + + ByteLength = 10; + break; + case ACPI_DMT_BUF16: case ACPI_DMT_UUID: Modified: vendor-sys/acpica/dist/source/compiler/preprocess.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/preprocess.h Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/compiler/preprocess.h Wed Jun 26 19:01:10 2013 (r252256) @@ -124,6 +124,17 @@ typedef struct pr_file_node } PR_FILE_NODE; +#define MAX_ARGUMENT_LENGTH 24 + +typedef struct directive_info +{ + struct directive_info *Next; + char Argument[MAX_ARGUMENT_LENGTH]; + int Directive; + BOOLEAN IgnoringThisCodeBlock; + +} DIRECTIVE_INFO; + /* * Globals @@ -136,12 +147,13 @@ PR_EXTERN char PR_INIT_ PR_EXTERN char PR_INIT_GLOBAL (*Gbl_MacroTokenBuffer, NULL); /* [ASL_LINE_BUFFER_SIZE]; */ PR_EXTERN char PR_INIT_GLOBAL (*Gbl_ExpressionTokenBuffer, NULL); /* [ASL_LINE_BUFFER_SIZE]; */ -PR_EXTERN PR_FILE_NODE *Gbl_InputFileList; -PR_EXTERN PR_DEFINE_INFO PR_INIT_GLOBAL (*Gbl_DefineList, NULL); PR_EXTERN UINT32 Gbl_PreprocessorLineNumber; PR_EXTERN int Gbl_IfDepth; +PR_EXTERN PR_FILE_NODE *Gbl_InputFileList; +PR_EXTERN PR_DEFINE_INFO PR_INIT_GLOBAL (*Gbl_DefineList, NULL); PR_EXTERN BOOLEAN PR_INIT_GLOBAL (Gbl_PreprocessorError, FALSE); - +PR_EXTERN BOOLEAN PR_INIT_GLOBAL (Gbl_IgnoringThisCodeBlock, FALSE); +PR_EXTERN DIRECTIVE_INFO PR_INIT_GLOBAL (*Gbl_DirectiveStack, NULL); /* * prscan - Preprocessor entry @@ -158,7 +170,7 @@ void PrTerminatePreprocessor ( void); -BOOLEAN +void PrDoPreprocess ( void); Modified: vendor-sys/acpica/dist/source/compiler/prscan.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/prscan.c Wed Jun 26 18:12:38 2013 (r252255) +++ vendor-sys/acpica/dist/source/compiler/prscan.c Wed Jun 26 19:01:10 2013 (r252256) @@ -65,13 +65,27 @@ PrPreprocessInputFile ( static void PrDoDirective ( char *DirectiveToken, - char **Next, - BOOLEAN *IgnoringThisCodeBlock); + char **Next); static int PrMatchDirective ( char *Directive); +static void +PrPushDirective ( + int Directive, + char *Argument); + +static ACPI_STATUS +PrPopDirective ( + void); + +static void +PrDbgPrint ( + char *Action, + char *DirectiveName); + + /* * Supported preprocessor directives */ @@ -156,11 +170,16 @@ PrInitializeGlobals ( { /* Init globals */ - Gbl_IfDepth = 0; Gbl_InputFileList = NULL; Gbl_CurrentLineNumber = 0; Gbl_PreprocessorLineNumber = 1; Gbl_PreprocessorError = FALSE; + + /* These are used to track #if/#else blocks (possibly nested) */ + + Gbl_IfDepth = 0; + Gbl_IgnoringThisCodeBlock = FALSE; + Gbl_DirectiveStack = NULL; } @@ -207,7 +226,7 @@ PrTerminatePreprocessor ( * * PARAMETERS: None * - * RETURN: Error Status. TRUE if error, FALSE if OK. + * RETURN: None * * DESCRIPTION: Main entry point for the iASL Preprocessor. Input file must * be already open. Handles multiple input files via the @@ -215,7 +234,7 @@ PrTerminatePreprocessor ( * ******************************************************************************/ -BOOLEAN +void PrDoPreprocess ( void) { @@ -237,20 +256,7 @@ PrDoPreprocess ( } while (MoreInputFiles); - - /* - * TBD: is this necessary? (Do we abort on any preprocessing errors?) - */ - if (Gbl_PreprocessorError) - { - /* TBD: can't use source_output file for preprocessor error reporting */ - - Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle = NULL; - PrTerminatePreprocessor (); - return (TRUE); - } - - /* Point compiler input to the new preprocessor file (.i) */ + /* Point compiler input to the new preprocessor output file (.i) */ FlCloseFile (ASL_FILE_INPUT); Gbl_Files[ASL_FILE_INPUT].Handle = Gbl_Files[ASL_FILE_PREPROCESSOR].Handle; @@ -262,7 +268,6 @@ PrDoPreprocess ( Gbl_CurrentLineNumber = 1; DbgPrint (ASL_DEBUG_OUTPUT, "Preprocessing phase complete \n\n"); - return (FALSE); } @@ -290,7 +295,6 @@ PrPreprocessInputFile ( char *ReplaceString; PR_DEFINE_INFO *DefineInfo; ACPI_SIZE TokenOffset; - BOOLEAN IgnoringThisCodeBlock = FALSE; char *Next; int OffsetAdjust; @@ -320,7 +324,7 @@ PrPreprocessInputFile ( /* Execute the directive, do not write line to output file */ - PrDoDirective (Token, &Next, &IgnoringThisCodeBlock); + PrDoDirective (Token, &Next); continue; } @@ -329,7 +333,7 @@ PrPreprocessInputFile ( * FALSE, ignore the line and do not write it to the output file. * This continues until an #else or #endif is encountered. */ - if (IgnoringThisCodeBlock == TRUE) + if (Gbl_IgnoringThisCodeBlock) { continue; } @@ -416,12 +420,8 @@ PrPreprocessInputFile ( * * PARAMETERS: Directive - Pointer to directive name token * Next - "Next" buffer from GetNextToken - * IgnoringThisCodeBlock - Where the "ignore code" flag is - * returned. * - * RETURN: IgnoringThisCodeBlock: Set to TRUE if we are skipping the FALSE - * part of an #if or #else block. Set to FALSE when the - * corresponding #else or #endif is encountered. + * RETURN: None. * * DESCRIPTION: Main processing for all preprocessor directives * @@ -430,8 +430,7 @@ PrPreprocessInputFile ( static void PrDoDirective ( char *DirectiveToken, - char **Next, - BOOLEAN *IgnoringThisCodeBlock) + char **Next) { char *Token = Gbl_MainTokenBuffer; char *Token2; @@ -459,14 +458,28 @@ PrDoDirective ( return; } - /* TBD: Need a faster way to do this: */ - - if ((Directive == PR_DIRECTIVE_ELIF) || - (Directive == PR_DIRECTIVE_ELSE) || - (Directive == PR_DIRECTIVE_ENDIF)) + /* + * If we are currently ignoring this block and we encounter a #else or + * #elif, we must ignore their blocks also if the parent block is also + * being ignored. + */ + if (Gbl_IgnoringThisCodeBlock) { - DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID "Begin #%s\n", - Gbl_CurrentLineNumber, Gbl_DirectiveInfo[Directive].Name); + switch (Directive) + { + case PR_DIRECTIVE_ELSE: + case PR_DIRECTIVE_ELIF: + + if (Gbl_DirectiveStack && Gbl_DirectiveStack->IgnoringThisCodeBlock) + { + PrDbgPrint ("Ignoring", Gbl_DirectiveInfo[Directive].Name); + return; + } + break; + + default: + break; + } } /* @@ -476,57 +489,54 @@ PrDoDirective ( */ switch (Directive) { + case PR_DIRECTIVE_ELSE: + + Gbl_IgnoringThisCodeBlock = !(Gbl_IgnoringThisCodeBlock); + PrDbgPrint ("Executing", "else block"); + return; + case PR_DIRECTIVE_ELIF: - *IgnoringThisCodeBlock = !(*IgnoringThisCodeBlock); - if (*IgnoringThisCodeBlock == TRUE) + Gbl_IgnoringThisCodeBlock = !(Gbl_IgnoringThisCodeBlock); + Directive = PR_DIRECTIVE_IF; + + if (Gbl_IgnoringThisCodeBlock == TRUE) { /* Not executing the ELSE part -- all done here */ + PrDbgPrint ("Ignoring", "elif block"); return; } - /* Will execute the ELSE..IF part */ + /* + * After this, we will execute the IF part further below. + * First, however, pop off the original #if directive. + */ + if (ACPI_FAILURE (PrPopDirective ())) + { + PrError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, + THIS_TOKEN_OFFSET (DirectiveToken)); + } - DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID - "#elif - Executing else block\n", - Gbl_CurrentLineNumber); - Directive = PR_DIRECTIVE_IF; + PrDbgPrint ("Executing", "elif block"); break; - case PR_DIRECTIVE_ELSE: + case PR_DIRECTIVE_ENDIF: - *IgnoringThisCodeBlock = !(*IgnoringThisCodeBlock); - return; + PrDbgPrint ("Executing", "endif"); - case PR_DIRECTIVE_ENDIF: + /* Pop the owning #if/#ifdef/#ifndef */ - *IgnoringThisCodeBlock = FALSE; - Gbl_IfDepth--; - if (Gbl_IfDepth < 0) + if (ACPI_FAILURE (PrPopDirective ())) { PrError (ASL_ERROR, ASL_MSG_ENDIF_MISMATCH, THIS_TOKEN_OFFSET (DirectiveToken)); - Gbl_IfDepth = 0; } return; default: - break; } - /* - * At this point, if we are ignoring the current code block, - * do not process any more directives (i.e., ignore them also.) - */ - if (*IgnoringThisCodeBlock == TRUE) - { - return; - } - - DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID "Begin #%s\n", - Gbl_CurrentLineNumber, Gbl_DirectiveInfo[Directive].Name); - /* Most directives have at least one argument */ if (Gbl_DirectiveInfo[Directive].ArgCount == 1) @@ -538,8 +548,85 @@ PrDoDirective ( } } + /* + * At this point, if we are ignoring the current code block, + * do not process any more directives (i.e., ignore them also.) + * For "if" style directives, open/push a new block anyway. We + * must do this to keep track of #endif directives + */ + if (Gbl_IgnoringThisCodeBlock) + { + switch (Directive) + { + case PR_DIRECTIVE_IF: + case PR_DIRECTIVE_IFDEF: + case PR_DIRECTIVE_IFNDEF: + + PrPushDirective (Directive, Token); + PrDbgPrint ("Ignoring", Gbl_DirectiveInfo[Directive].Name); + break; + + default: + break; + } + + return; + } + + /* + * Execute the directive + */ + PrDbgPrint ("Begin execution", Gbl_DirectiveInfo[Directive].Name); + switch (Directive) { + case PR_DIRECTIVE_IF: + + TokenOffset = Token - Gbl_MainTokenBuffer; + + /* Need to expand #define macros in the expression string first */ + + Status = PrResolveIntegerExpression ( + &Gbl_CurrentLineBuffer[TokenOffset-1], &Value); + if (ACPI_FAILURE (Status)) + { + return; + } + + PrPushDirective (Directive, Token); + if (!Value) + { + Gbl_IgnoringThisCodeBlock = TRUE; + } + + DbgPrint (ASL_DEBUG_OUTPUT, PR_PREFIX_ID + "Resolved #if: %8.8X%8.8X %s\n", + Gbl_CurrentLineNumber, ACPI_FORMAT_UINT64 (Value), + Gbl_IgnoringThisCodeBlock ? "" : ""); + break; + + case PR_DIRECTIVE_IFDEF: + + PrPushDirective (Directive, Token); + if (!PrMatchDefine (Token)) + { + Gbl_IgnoringThisCodeBlock = TRUE; + } + + PrDbgPrint ("Evaluated", "ifdef"); + break; + + case PR_DIRECTIVE_IFNDEF: + + PrPushDirective (Directive, Token); + if (PrMatchDefine (Token)) + { + Gbl_IgnoringThisCodeBlock = TRUE; + } + + PrDbgPrint ("Evaluated", "ifndef"); + break; + case PR_DIRECTIVE_DEFINE: *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***