svn commit: r243044 - in vendor-sys/acpica/dist: . generate/unix/acpibin generate/unix/acpiexec generate/unix/iasl source/common source/compiler source/components/debugger source/components/disasse...
Jung-uk Kim
jkim at FreeBSD.org
Wed Nov 14 22:20:17 UTC 2012
Author: jkim
Date: Wed Nov 14 22:20:16 2012
New Revision: 243044
URL: http://svnweb.freebsd.org/changeset/base/243044
Log:
Import ACPICA 20121114.
Added:
vendor-sys/acpica/dist/source/components/disassembler/dmdeferred.c (contents, props changed)
Modified:
vendor-sys/acpica/dist/changes.txt
vendor-sys/acpica/dist/generate/unix/acpibin/Makefile
vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile
vendor-sys/acpica/dist/generate/unix/iasl/Makefile
vendor-sys/acpica/dist/source/common/adfile.c
vendor-sys/acpica/dist/source/common/adisasm.c
vendor-sys/acpica/dist/source/common/dmextern.c
vendor-sys/acpica/dist/source/common/dmrestag.c
vendor-sys/acpica/dist/source/compiler/aslcompile.c
vendor-sys/acpica/dist/source/compiler/aslcompiler.h
vendor-sys/acpica/dist/source/compiler/aslerror.c
vendor-sys/acpica/dist/source/compiler/aslfiles.c
vendor-sys/acpica/dist/source/compiler/aslglobal.h
vendor-sys/acpica/dist/source/compiler/asllisting.c
vendor-sys/acpica/dist/source/compiler/asllookup.c
vendor-sys/acpica/dist/source/compiler/aslmain.c
vendor-sys/acpica/dist/source/compiler/aslstartup.c
vendor-sys/acpica/dist/source/compiler/dttemplate.c
vendor-sys/acpica/dist/source/compiler/prutils.c
vendor-sys/acpica/dist/source/compiler/readme.txt
vendor-sys/acpica/dist/source/components/debugger/dbfileio.c
vendor-sys/acpica/dist/source/components/debugger/dbinput.c
vendor-sys/acpica/dist/source/components/debugger/dbmethod.c
vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c
vendor-sys/acpica/dist/source/components/disassembler/dmresrc.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/disassembler/dmresrcs.c
vendor-sys/acpica/dist/source/components/dispatcher/dsmethod.c
vendor-sys/acpica/dist/source/components/executer/exregion.c
vendor-sys/acpica/dist/source/components/namespace/nsutils.c
vendor-sys/acpica/dist/source/components/namespace/nsxfname.c
vendor-sys/acpica/dist/source/components/resources/rscalc.c
vendor-sys/acpica/dist/source/components/resources/rscreate.c
vendor-sys/acpica/dist/source/components/resources/rsdump.c
vendor-sys/acpica/dist/source/components/resources/rslist.c
vendor-sys/acpica/dist/source/components/resources/rsmisc.c
vendor-sys/acpica/dist/source/components/resources/rsxface.c
vendor-sys/acpica/dist/source/components/utilities/utdelete.c
vendor-sys/acpica/dist/source/components/utilities/utresrc.c
vendor-sys/acpica/dist/source/components/utilities/utstate.c
vendor-sys/acpica/dist/source/components/utilities/uttrack.c
vendor-sys/acpica/dist/source/include/acdisasm.h
vendor-sys/acpica/dist/source/include/acmacros.h
vendor-sys/acpica/dist/source/include/acpixf.h
vendor-sys/acpica/dist/source/include/acrestyp.h
vendor-sys/acpica/dist/source/include/acutils.h
vendor-sys/acpica/dist/source/tools/acpibin/abcompare.c
vendor-sys/acpica/dist/source/tools/acpibin/abmain.c
vendor-sys/acpica/dist/source/tools/acpibin/acpibin.h
vendor-sys/acpica/dist/source/tools/acpisrc/acpisrc.h
vendor-sys/acpica/dist/source/tools/acpisrc/asfile.c
vendor-sys/acpica/dist/source/tools/acpixtract/acpixtract.c
Modified: vendor-sys/acpica/dist/changes.txt
==============================================================================
--- vendor-sys/acpica/dist/changes.txt Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/changes.txt Wed Nov 14 22:20:16 2012 (r243044)
@@ -1,4 +1,94 @@
----------------------------------------
+14 November 2012. Summary of changes for version 20121114:
+
+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:
+
+Implemented a performance enhancement for ACPI/AML Package objects. This
+change greatly increases the performance of Package objects within the
+interpreter. It changes the processing of reference counts for packages by
+optimizing for the most common case where the package sub-objects are
+either Integers, Strings, or Buffers. Increases the overall performance of
+the ASLTS test suite by 1.5X (Increases the Slack Mode performance by 2X.)
+Chao Guan. ACPICA BZ 943.
+
+Implemented and deployed common macros to extract flag bits from resource
+descriptors. Improves readability and maintainability of the code. Fixes a
+problem with the UART serial bus descriptor for the number of data bits
+flags (was incorrectly 2 bits, should be 3).
+
+Enhanced the ACPI_GETx and ACPI_SETx macros. Improved the implementation
+of the macros and changed the SETx macros to the style of (destination,
+source). Also added ACPI_CASTx companion macros. Lv Zheng.
+
+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.9K Code, 25.2K Data, 119.1K Total
+ Debug Version: 175.5K Code, 74.5K Data, 250.0K Total
+ Current Release:
+ Non-Debug Version: 94.3K Code, 25.3K Data, 119.6K Total
+ Debug Version: 175.5K Code, 74.5K Data, 250.0K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Disassembler: Added the new ACPI 5.0 interrupt sharing flags. This change
+adds the ShareAndWake and ExclusiveAndWake flags which were added to the
+Irq, Interrupt, and Gpio resource descriptors in ACPI 5.0. ACPICA BZ 986.
+
+Disassembler: Fixed a problem with external declaration generation. Fixes
+a problem where an incorrect pathname could be generated for an external
+declaration if the original reference to the object includes leading
+carats (^). ACPICA BZ 984.
+
+Debugger: Completed a major update for the Disassemble<method> command.
+This command was out-of-date and did not properly disassemble control
+methods that had any reasonable complexity. This fix brings the command up
+to the same level as the rest of the disassembler. Adds one new file,
+dmdeferred.c, which is existing code that is now common with the main
+disassembler and the debugger disassemble command. ACPICA MZ 978.
+
+iASL: Moved the parser entry prototype to avoid a duplicate declaration.
+Newer versions of Bison emit this prototype, so moved the prototype out of
+the iASL header to where it is actually used in order to avoid a duplicate
+declaration.
+
+iASL/Tools: Standardized use of the stream I/O functions:
+ 1) Ensure check for I/O error after every fopen/fread/fwrite
+ 2) Ensure proper order of size/count arguments for fread/fwrite
+ 3) Use test of (Actual != Requested) after all fwrite, and most fread
+ 4) Standardize I/O error messages
+Improves reliability and maintainability of the code. Bob Moore, Lv Zheng.
+ACPICA BZ 981.
+
+Disassembler: Prevent duplicate External() statements. During generation
+of external statements, detect similar pathnames that are actually
+duplicates such as these:
+ External (\ABCD)
+ External (ABCD)
+Remove all leading '\' characters from pathnames during the external
+statement generation so that duplicates will be detected and tossed.
+ACPICA BZ 985.
+
+Tools: Replace low-level I/O with stream I/O functions. Replace
+open/read/write/close with the stream I/O equivalents
+fopen/fread/fwrite/fclose for portability and performance. Lv Zheng, Bob
+Moore.
+
+AcpiBin: Fix for the dump-to-hex function. Now correctly output the table
+name header so that AcpiXtract recognizes the output file/table.
+
+iASL: Remove obsolete -2 option flag. Originally intended to force the
+compiler/disassembler into an ACPI 2.0 mode, this was never implemented
+and the entire concept is now obsolete.
+
+----------------------------------------
18 October 2012. Summary of changes for version 20121018:
Modified: vendor-sys/acpica/dist/generate/unix/acpibin/Makefile
==============================================================================
--- vendor-sys/acpica/dist/generate/unix/acpibin/Makefile Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/generate/unix/acpibin/Makefile Wed Nov 14 22:20:16 2012 (r243044)
@@ -27,7 +27,7 @@ HEADERS = \
$(wildcard $(ACPIBIN)/*.h)
OBJECTS = \
- $(OBJDIR)/abcompare.o \
+ $(OBJDIR)/abcompare.o \
$(OBJDIR)/abmain.o \
$(OBJDIR)/utalloc.o \
$(OBJDIR)/utcache.o \
Modified: vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile
==============================================================================
--- vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Wed Nov 14 22:20:16 2012 (r243044)
@@ -55,6 +55,7 @@ OBJECTS = \
$(OBJDIR)/dbutils.o \
$(OBJDIR)/dbxface.o \
$(OBJDIR)/dmbuffer.o \
+ $(OBJDIR)/dmdeferred.o \
$(OBJDIR)/dmnames.o \
$(OBJDIR)/dmobject.o \
$(OBJDIR)/dmopcode.o \
Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile
==============================================================================
--- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Wed Nov 14 22:20:16 2012 (r243044)
@@ -90,6 +90,7 @@ OBJECTS = \
$(OBJDIR)/dtutils.o \
$(OBJDIR)/dbfileio.o \
$(OBJDIR)/dmbuffer.o \
+ $(OBJDIR)/dmdeferred.o \
$(OBJDIR)/dmextern.o \
$(OBJDIR)/dmnames.o \
$(OBJDIR)/dmobject.o \
@@ -192,13 +193,13 @@ INTERMEDIATES = \
$(OBJDIR)/prparserparse.c
MISC = \
- $(OBJDIR)/aslcompilerparse.h \
+ $(OBJDIR)/aslcompilerparse.h \
$(OBJDIR)/aslcompiler.y.h \
$(OBJDIR)/aslcompilerparse.output \
- $(OBJDIR)/dtparserparse.h \
+ $(OBJDIR)/dtparserparse.h \
$(OBJDIR)/dtparser.y.h \
$(OBJDIR)/dtparserparse.output \
- $(OBJDIR)/prparserparse.h \
+ $(OBJDIR)/prparserparse.h \
$(OBJDIR)/prparser.y.h \
$(OBJDIR)/prparserparse.output
Modified: vendor-sys/acpica/dist/source/common/adfile.c
==============================================================================
--- vendor-sys/acpica/dist/source/common/adfile.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/common/adfile.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -124,19 +124,24 @@ AdWriteBuffer (
char *Buffer,
UINT32 Length)
{
- FILE *fp;
+ FILE *File;
ACPI_SIZE Actual;
- fp = fopen (Filename, "wb");
- if (!fp)
+ File = fopen (Filename, "wb");
+ if (!File)
{
- printf ("Couldn't open %s\n", Filename);
+ printf ("Could not open file %s\n", Filename);
return (-1);
}
- Actual = fwrite (Buffer, (size_t) Length, 1, fp);
- fclose (fp);
+ Actual = fwrite (Buffer, 1, (size_t) Length, File);
+ if (Actual != Length)
+ {
+ printf ("Could not write to file %s\n", Filename);
+ }
+
+ fclose (File);
return ((INT32) Actual);
}
Modified: vendor-sys/acpica/dist/source/common/adisasm.c
==============================================================================
--- vendor-sys/acpica/dist/source/common/adisasm.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/common/adisasm.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -88,17 +88,6 @@ AdCreateTableHeader (
char *Filename,
ACPI_TABLE_HEADER *Table);
-static ACPI_STATUS
-AdDeferredParse (
- ACPI_PARSE_OBJECT *Op,
- UINT8 *Aml,
- UINT32 AmlLength);
-
-static ACPI_STATUS
-AdParseDeferredOps (
- ACPI_PARSE_OBJECT *Root);
-
-
/* Stubs for ASL compiler */
#ifndef ACPI_ASL_COMPILER
@@ -753,207 +742,6 @@ AdDisplayTables (
/******************************************************************************
*
- * FUNCTION: AdDeferredParse
- *
- * PARAMETERS: Op - Root Op of the deferred opcode
- * Aml - Pointer to the raw AML
- * AmlLength - Length of the AML
- *
- * RETURN: Status
- *
- * DESCRIPTION: Parse one deferred opcode
- * (Methods, operation regions, etc.)
- *
- *****************************************************************************/
-
-static ACPI_STATUS
-AdDeferredParse (
- ACPI_PARSE_OBJECT *Op,
- UINT8 *Aml,
- UINT32 AmlLength)
-{
- ACPI_WALK_STATE *WalkState;
- ACPI_STATUS Status;
- ACPI_PARSE_OBJECT *SearchOp;
- ACPI_PARSE_OBJECT *StartOp;
- UINT32 BaseAmlOffset;
- ACPI_PARSE_OBJECT *ExtraOp;
-
-
- ACPI_FUNCTION_TRACE (AdDeferredParse);
-
-
- fprintf (stderr, ".");
-
- if (!Aml || !AmlLength)
- {
- return_ACPI_STATUS (AE_OK);
- }
-
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Parsing %s [%4.4s]\n",
- Op->Common.AmlOpName, (char *) &Op->Named.Name));
-
- WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL);
- if (!WalkState)
- {
- return_ACPI_STATUS (AE_NO_MEMORY);
- }
-
- Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, Aml,
- AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Parse the method */
-
- WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
- WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
- Status = AcpiPsParseAml (WalkState);
-
- /*
- * We need to update all of the Aml offsets, since the parser thought
- * that the method began at offset zero. In reality, it began somewhere
- * within the ACPI table, at the BaseAmlOffset. Walk the entire tree that
- * was just created and update the AmlOffset in each Op
- */
- BaseAmlOffset = (Op->Common.Value.Arg)->Common.AmlOffset + 1;
- StartOp = (Op->Common.Value.Arg)->Common.Next;
- SearchOp = StartOp;
-
- /* Walk the parse tree */
-
- while (SearchOp)
- {
- SearchOp->Common.AmlOffset += BaseAmlOffset;
- SearchOp = AcpiPsGetDepthNext (StartOp, SearchOp);
- }
-
- /*
- * Link the newly parsed subtree into the main parse tree
- */
- switch (Op->Common.AmlOpcode)
- {
- case AML_BUFFER_OP:
- case AML_PACKAGE_OP:
- case AML_VAR_PACKAGE_OP:
-
- switch (Op->Common.AmlOpcode)
- {
- case AML_PACKAGE_OP:
- ExtraOp = Op->Common.Value.Arg;
- ExtraOp = ExtraOp->Common.Next;
- Op->Common.Value.Arg = ExtraOp->Common.Value.Arg;
- break;
-
- case AML_VAR_PACKAGE_OP:
- case AML_BUFFER_OP:
- default:
- ExtraOp = Op->Common.Value.Arg;
- Op->Common.Value.Arg = ExtraOp->Common.Value.Arg;
- break;
- }
-
- /* Must point all parents to the main tree */
-
- StartOp = Op;
- SearchOp = StartOp;
- while (SearchOp)
- {
- if (SearchOp->Common.Parent == ExtraOp)
- {
- SearchOp->Common.Parent = Op;
- }
- SearchOp = AcpiPsGetDepthNext (StartOp, SearchOp);
- }
- break;
-
- default:
- break;
- }
-
- return_ACPI_STATUS (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: AdParseDeferredOps
- *
- * PARAMETERS: Root - Root of the parse tree
- *
- * RETURN: Status
- *
- * DESCRIPTION: Parse the deferred opcodes (Methods, regions, etc.)
- *
- *****************************************************************************/
-
-static ACPI_STATUS
-AdParseDeferredOps (
- ACPI_PARSE_OBJECT *Root)
-{
- ACPI_PARSE_OBJECT *Op = Root;
- ACPI_STATUS Status = AE_OK;
- const ACPI_OPCODE_INFO *OpInfo;
-
-
- ACPI_FUNCTION_NAME (AdParseDeferredOps);
- fprintf (stderr, "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
-
- while (Op)
- {
- OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
- if (!(OpInfo->Flags & AML_DEFER))
- {
- Op = AcpiPsGetDepthNext (Root, Op);
- continue;
- }
-
- switch (Op->Common.AmlOpcode)
- {
- case AML_METHOD_OP:
- case AML_BUFFER_OP:
- case AML_PACKAGE_OP:
- case AML_VAR_PACKAGE_OP:
-
- Status = AdDeferredParse (Op, Op->Named.Data, Op->Named.Length);
- if (ACPI_FAILURE (Status))
- {
- return (Status);
- }
- break;
-
- case AML_REGION_OP:
- case AML_DATA_REGION_OP:
- case AML_CREATE_QWORD_FIELD_OP:
- case AML_CREATE_DWORD_FIELD_OP:
- case AML_CREATE_WORD_FIELD_OP:
- case AML_CREATE_BYTE_FIELD_OP:
- case AML_CREATE_BIT_FIELD_OP:
- case AML_CREATE_FIELD_OP:
- case AML_BANK_FIELD_OP:
-
- /* Nothing to do in these cases */
-
- break;
-
- default:
- ACPI_ERROR ((AE_INFO, "Unhandled deferred opcode [%s]",
- Op->Common.AmlOpName));
- break;
- }
-
- Op = AcpiPsGetDepthNext (Root, Op);
- }
-
- fprintf (stderr, "\n");
- return (Status);
-}
-
-
-/******************************************************************************
- *
* FUNCTION: AdGetLocalTables
*
* PARAMETERS: Filename - Not used
@@ -1191,7 +979,9 @@ AdParseTable (
/* Pass 3: Parse control methods and link their parse trees into the main parse tree */
- Status = AdParseDeferredOps (AcpiGbl_ParseOpRoot);
+ fprintf (stderr, "Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)\n");
+ Status = AcpiDmParseDeferredOps (AcpiGbl_ParseOpRoot);
+ fprintf (stderr, "\n");
/* Process Resource Templates */
Modified: vendor-sys/acpica/dist/source/common/dmextern.c
==============================================================================
--- vendor-sys/acpica/dist/source/common/dmextern.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/common/dmextern.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -153,10 +153,17 @@ AcpiDmNormalizeParentPrefix (
char *Fullpath;
char *ParentPath;
ACPI_SIZE Length;
+ UINT32 Index = 0;
- /* Search upwards in the parse tree until we reach a namespace node */
+ if (!Op)
+ {
+ return (NULL);
+ }
+
+ /* Search upwards in the parse tree until we reach the next namespace node */
+ Op = Op->Common.Parent;
while (Op)
{
if (Op->Common.Node)
@@ -205,6 +212,13 @@ AcpiDmNormalizeParentPrefix (
* for the required dot separator (ParentPath.Path)
*/
Length++;
+
+ /* For External() statements, we do not want a leading '\' */
+
+ if (*ParentPath == AML_ROOT_PREFIX)
+ {
+ Index = 1;
+ }
}
Fullpath = ACPI_ALLOCATE_ZEROED (Length);
@@ -219,7 +233,7 @@ AcpiDmNormalizeParentPrefix (
*
* Copy the parent path
*/
- ACPI_STRCAT (Fullpath, ParentPath);
+ ACPI_STRCPY (Fullpath, &ParentPath[Index]);
/*
* Add dot separator
@@ -366,7 +380,22 @@ AcpiDmAddToExternalList (
return;
}
- /* Externalize the ACPI path */
+ /*
+ * We don't want External() statements to contain a leading '\'.
+ * This prevents duplicate external statements of the form:
+ *
+ * External (\ABCD)
+ * External (ABCD)
+ *
+ * This would cause a compile time error when the disassembled
+ * output file is recompiled.
+ */
+ if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
+ {
+ Path++;
+ }
+
+ /* Externalize the ACPI pathname */
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
NULL, &ExternalPath);
@@ -375,8 +404,10 @@ AcpiDmAddToExternalList (
return;
}
- /* Get the full pathname from root if "Path" has a parent prefix */
-
+ /*
+ * Get the full pathname from the root if "Path" has one or more
+ * parent prefixes (^). Note: path will not contain a leading '\'.
+ */
if (*Path == (UINT8) AML_PARENT_PREFIX)
{
Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
Modified: vendor-sys/acpica/dist/source/common/dmrestag.c
==============================================================================
--- vendor-sys/acpica/dist/source/common/dmrestag.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/common/dmrestag.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -625,7 +625,7 @@ AcpiGetTagPathname (
Aml = ACPI_CAST_PTR (AML_RESOURCE,
&Op->Named.Data[ResourceNode->Value]);
- Status = AcpiUtValidateResource (Aml, &ResourceTableIndex);
+ Status = AcpiUtValidateResource (NULL, Aml, &ResourceTableIndex);
if (ACPI_FAILURE (Status))
{
return (NULL);
@@ -938,7 +938,7 @@ AcpiDmFindResources (
* resource descriptors to the namespace, as children of the
* buffer node.
*/
- if (ACPI_SUCCESS (AcpiDmIsResourceTemplate (Op)))
+ if (ACPI_SUCCESS (AcpiDmIsResourceTemplate (NULL, Op)))
{
Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
AcpiDmAddResourcesToNamespace (Parent->Common.Node, Op);
@@ -991,7 +991,7 @@ AcpiDmAddResourcesToNamespace (
* Insert each resource into the namespace
* NextOp contains the Aml pointer and the Aml length
*/
- AcpiUtWalkAmlResources ((UINT8 *) NextOp->Named.Data,
+ AcpiUtWalkAmlResources (NULL, (UINT8 *) NextOp->Named.Data,
(ACPI_SIZE) NextOp->Common.Value.Integer,
AcpiDmAddResourceToNamespace, BufferNode);
}
Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslcompile.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -50,6 +50,15 @@
#define _COMPONENT ACPI_COMPILER
ACPI_MODULE_NAME ("aslcompile")
+/*
+ * Main parser entry
+ * External is here in case the parser emits the same external in the
+ * generated header. (Newer versions of Bison)
+ */
+int
+AslCompilerparse(
+ void);
+
/* Local prototypes */
static void
@@ -274,7 +283,7 @@ FlConsumeAnsiComment (
BOOLEAN ClosingComment = FALSE;
- while (fread (&Byte, 1, 1, Handle))
+ while (fread (&Byte, 1, 1, Handle) == 1)
{
/* Scan until comment close is found */
@@ -317,7 +326,7 @@ FlConsumeNewComment (
UINT8 Byte;
- while (fread (&Byte, 1, 1, Handle))
+ while (fread (&Byte, 1, 1, Handle) == 1)
{
Status->Offset++;
@@ -368,7 +377,7 @@ FlCheckForAscii (
/* Read the entire file */
- while (fread (&Byte, 1, 1, Handle))
+ while (fread (&Byte, 1, 1, Handle) == 1)
{
/* Ignore comment fields (allow non-ascii within) */
Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Wed Nov 14 22:20:16 2012 (r243044)
@@ -86,10 +86,6 @@
/*
* Main ASL parser - generated from flex/bison, lex/yacc, etc.
*/
-int
-AslCompilerparse(
- void);
-
ACPI_PARSE_OBJECT *
AslDoError (
void);
Modified: vendor-sys/acpica/dist/source/compiler/aslerror.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslerror.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/aslerror.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -294,7 +294,7 @@ AePrintException (
else
{
RActual = fread (&SourceByte, 1, 1, SourceFile);
- if (!RActual)
+ if (RActual != 1)
{
fprintf (OutputFile,
"[*** iASL: Read error on source code temp file %s ***]",
@@ -304,8 +304,20 @@ AePrintException (
{
while (RActual && SourceByte && (SourceByte != '\n') && (Total < 256))
{
- fwrite (&SourceByte, 1, 1, OutputFile);
+ if (fwrite (&SourceByte, 1, 1, OutputFile) != 1)
+ {
+ printf ("[*** iASL: Write error on output file ***]\n");
+ return;
+ }
+
RActual = fread (&SourceByte, 1, 1, SourceFile);
+ if (RActual != 1)
+ {
+ fprintf (OutputFile,
+ "[*** iASL: Read error on source code temp file %s ***]",
+ Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename);
+ return;
+ }
Total++;
}
Modified: vendor-sys/acpica/dist/source/compiler/aslfiles.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslfiles.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/aslfiles.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -143,15 +143,14 @@ FlOpenFile (
File = fopen (Filename, Mode);
-
- Gbl_Files[FileId].Filename = Filename;
- Gbl_Files[FileId].Handle = File;
-
if (!File)
{
FlFileError (FileId, ASL_MSG_OPEN);
AslAbort ();
}
+
+ Gbl_Files[FileId].Filename = Filename;
+ Gbl_Files[FileId].Handle = File;
}
@@ -216,7 +215,7 @@ FlReadFile (
/* Read and check for error */
Actual = fread (Buffer, 1, Length, Gbl_Files[FileId].Handle);
- if (Actual != Length)
+ if (Actual < Length)
{
if (feof (Gbl_Files[FileId].Handle))
{
@@ -659,16 +658,17 @@ FlOpenIncludeWithPrefix (
/* Attempt to open the file, push if successful */
IncludeFile = fopen (Pathname, "r");
- if (IncludeFile)
+ if (!IncludeFile)
{
- /* Push the include file on the open input file stack */
-
- AslPushInputFileStack (IncludeFile, Pathname);
- return (IncludeFile);
+ fprintf (stderr, "Could not open include file %s\n", Pathname);
+ ACPI_FREE (Pathname);
+ return (NULL);
}
- ACPI_FREE (Pathname);
- return (NULL);
+ /* Push the include file on the open input file stack */
+
+ AslPushInputFileStack (IncludeFile, Pathname);
+ return (IncludeFile);
}
@@ -952,7 +952,7 @@ FlOpenMiscOutputFiles (
return (AE_OK);
}
- /* Create/Open a combined source output file */
+ /* Create/Open a combined source output file */
Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE);
if (!Filename)
Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslglobal.h Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Wed Nov 14 22:20:16 2012 (r243044)
@@ -137,7 +137,6 @@ ASL_EXTERN BOOLEAN ASL_
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessFlag, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE);
-ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_Acpi2, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE);
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE);
Modified: vendor-sys/acpica/dist/source/compiler/asllisting.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/asllisting.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/asllisting.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -135,6 +135,10 @@ LsTreeWriteWalk (
UINT32 Level,
void *Context);
+static UINT32
+LsReadAmlOutputFile (
+ UINT8 *Buffer);
+
/*******************************************************************************
*
@@ -1282,6 +1286,38 @@ LsDoHexOutput (
/*******************************************************************************
*
+ * FUNCTION: LsReadAmlOutputFile
+ *
+ * PARAMETERS: Buffer - Where to return data
+ *
+ * RETURN: None.
+ *
+ * DESCRIPTION: Read a line of the AML output prior to formatting the data
+ *
+ ******************************************************************************/
+
+static UINT32
+LsReadAmlOutputFile (
+ UINT8 *Buffer)
+{
+ UINT32 Actual;
+
+
+ Actual = fread (Buffer, 1, HEX_TABLE_LINE_SIZE,
+ Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+
+ if (ferror (Gbl_Files[ASL_FILE_AML_OUTPUT].Handle))
+ {
+ FlFileError (ASL_FILE_AML_OUTPUT, ASL_MSG_READ);
+ AslAbort ();
+ }
+
+ return (Actual);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: LsDoHexOutputC
*
* PARAMETERS: None
@@ -1319,8 +1355,7 @@ LsDoHexOutputC (
{
/* Read enough bytes needed for one output line */
- LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE,
- Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+ LineLength = LsReadAmlOutputFile (FileData);
if (!LineLength)
{
break;
@@ -1407,8 +1442,7 @@ LsDoHexOutputAsl (
{
/* Read enough bytes needed for one output line */
- LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE,
- Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+ LineLength = LsReadAmlOutputFile (FileData);
if (!LineLength)
{
break;
@@ -1494,8 +1528,7 @@ LsDoHexOutputAsm (
{
/* Read enough bytes needed for one output line */
- LineLength = fread (FileData, 1, HEX_TABLE_LINE_SIZE,
- Gbl_Files[ASL_FILE_AML_OUTPUT].Handle);
+ LineLength = LsReadAmlOutputFile (FileData);
if (!LineLength)
{
break;
Modified: vendor-sys/acpica/dist/source/compiler/asllookup.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/asllookup.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/asllookup.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -329,16 +329,19 @@ LsDoOneNamespaceObject (
case ACPI_TYPE_LOCAL_RESOURCE_FIELD:
- if (Node->Flags & 0x80)
+ FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
+ " [Field Offset 0x%.4X Bits 0x%.4X Bytes] ",
+ Node->Value, Node->Value / 8);
+
+ if (Node->Flags & ANOBJ_IS_REFERENCED)
{
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
- " [Field Offset 0x%.4X Bits 0x%.4X Bytes]",
- Node->Value, Node->Value / 8);
+ "Referenced");
}
else
{
FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
- " [Field Offset 0x%.4X Bytes]", Node->Value);
+ "Name not referenced");
}
break;
Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslmain.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/aslmain.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -100,7 +100,7 @@ AslDoResponseFile (
#define ASL_TOKEN_SEPARATORS " \t\n"
-#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T:G^v^w|x:z"
+#define ASL_SUPPORTED_OPTIONS "@:b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T:G^v^w|x:z"
/*******************************************************************************
@@ -171,7 +171,6 @@ Options (
ACPI_OPTION ("-dc [file]", "Disassemble AML and immediately compile it");
ACPI_OPTION ("", "(Obtain DSDT from current system if no input file)");
ACPI_OPTION ("-e [f1,f2]", "Include ACPI table(s) for external symbol resolution");
- ACPI_OPTION ("-2", "Emit ACPI 2.0 compatible ASL code");
ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)");
ACPI_OPTION ("-vt", "Dump binary table data in hex format within output file");
@@ -473,11 +472,6 @@ AslDoOptions (
break;
- case '2': /* ACPI 2.0 compatibility mode */
- Gbl_Acpi2 = TRUE;
- break;
-
-
case 'b': /* Debug output options */
switch (AcpiGbl_Optarg[0])
{
Modified: vendor-sys/acpica/dist/source/compiler/aslstartup.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/aslstartup.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/aslstartup.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -337,6 +337,13 @@ AslDoOneFile (
return (Status);
}
+#if 0
+ /* TBD: Handle additional output files for disassembler */
+
+ Status = FlOpenMiscOutputFiles (Gbl_OutputFilenamePrefix);
+ LsDisplayNamespace ();
+#endif
+
/* Shutdown compiler and ACPICA subsystem */
AeClearErrorLog ();
Modified: vendor-sys/acpica/dist/source/compiler/dttemplate.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/dttemplate.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/dttemplate.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -280,6 +280,7 @@ DtCreateOneTemplate (
char *DisasmFilename;
FILE *File;
ACPI_STATUS Status = AE_OK;
+ ACPI_SIZE Actual;
/* New file will have a .asl suffix */
@@ -334,18 +335,32 @@ DtCreateOneTemplate (
}
else
{
- /* Special ACPI tables - DSDT, SSDT, FACS, RSDP */
+ /* Special ACPI tables - DSDT, SSDT, FADT, RSDP */
AcpiOsPrintf (" */\n\n");
if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_DSDT))
{
- fwrite (TemplateDsdt, sizeof (TemplateDsdt) -1, 1, File);
+ Actual = fwrite (TemplateDsdt, 1, sizeof (TemplateDsdt) -1, File);
+ if (Actual != sizeof (TemplateDsdt) -1)
+ {
+ fprintf (stderr,
+ "Could not write to output file %s\n", DisasmFilename);
+ Status = AE_ERROR;
+ goto Cleanup;
+ }
}
else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_SSDT))
{
- fwrite (TemplateSsdt, sizeof (TemplateSsdt) -1, 1, File);
+ Actual = fwrite (TemplateSsdt, 1, sizeof (TemplateSsdt) -1, File);
+ if (Actual != sizeof (TemplateSsdt) -1)
+ {
+ fprintf (stderr,
+ "Could not write to output file %s\n", DisasmFilename);
+ Status = AE_ERROR;
+ goto Cleanup;
+ }
}
- else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS))
+ else if (ACPI_COMPARE_NAME (Signature, ACPI_SIG_FACS)) /* FADT */
{
AcpiDmDumpDataTable (ACPI_CAST_PTR (ACPI_TABLE_HEADER,
TemplateFacs));
@@ -359,7 +374,8 @@ DtCreateOneTemplate (
{
fprintf (stderr,
"%4.4s, Unrecognized ACPI table signature\n", Signature);
- return (AE_ERROR);
+ Status = AE_ERROR;
+ goto Cleanup;
}
}
@@ -367,6 +383,7 @@ DtCreateOneTemplate (
"Created ACPI table template for [%4.4s], written to \"%s\"\n",
Signature, DisasmFilename);
+Cleanup:
fclose (File);
AcpiOsRedirectOutput (stdout);
ACPI_FREE (DisasmFilename);
Modified: vendor-sys/acpica/dist/source/compiler/prutils.c
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/prutils.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/prutils.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -337,16 +337,17 @@ PrOpenIncludeWithPrefix (
/* Attempt to open the file, push if successful */
IncludeFile = fopen (Pathname, "r");
- if (IncludeFile)
+ if (!IncludeFile)
{
- /* Push the include file on the open input file stack */
-
- PrPushInputFileStack (IncludeFile, Pathname);
- return (IncludeFile);
+ fprintf (stderr, "Could not open include file %s\n", Pathname);
+ ACPI_FREE (Pathname);
+ return (NULL);
}
- ACPI_FREE (Pathname);
- return (NULL);
+ /* Push the include file on the open input file stack */
+
+ PrPushInputFileStack (IncludeFile, Pathname);
+ return (IncludeFile);
}
Modified: vendor-sys/acpica/dist/source/compiler/readme.txt
==============================================================================
--- vendor-sys/acpica/dist/source/compiler/readme.txt Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/compiler/readme.txt Wed Nov 14 22:20:16 2012 (r243044)
@@ -2,6 +2,9 @@
* Miscellaneous instructions for building and using the iASL compiler.
*/
+Last update: 24 October 2012
+
+
1) Generating iASL from source
------------------------------
@@ -23,20 +26,28 @@ be installed):
constant expressions.
3) The "common" source directory that is used for all ACPI components.
+
+1a) Notes for Linux/Unix generation
+-----------------------------------
+
On Linux/Unix systems, the following commands will build the compiler:
cd acpica (or cd acpica/generate/unix)
make clean
make iasl
-On Windows, the Visual Studio 2008 project file appears in this directory:
+iASL has been generated with these versions of Flex/Bison:
+
+ Flex: Version 2.5.32
+ Bison: Version 2.6.2
- generate/msvc9/AcpiComponents.sln
+1b) Notes for Windows generation
+--------------------------------
+On Windows, the Visual Studio 2008 project file appears in this directory:
-1a) Notes for Windows GNU Flex and GNU Bison
---------------------------------------------
+ generate/msvc9/AcpiComponents.sln
The Windows versions of GNU Flex/Bison must be installed, and they must
be installed in a directory that contains no embedded spaces in the
@@ -56,7 +67,7 @@ the updated $PATH.
iASL has been generated with these versions of Flex/Bison for Windows:
- Flex for Windows: V2.5.4
+ Flex for Windows: V2.5.4a
Bison for Windows: V2.4.1
Flex is available at: http://gnuwin32.sourceforge.net/packages/flex.htm
Modified: vendor-sys/acpica/dist/source/components/debugger/dbfileio.c
==============================================================================
--- vendor-sys/acpica/dist/source/components/debugger/dbfileio.c Wed Nov 14 21:25:55 2012 (r243043)
+++ vendor-sys/acpica/dist/source/components/debugger/dbfileio.c Wed Nov 14 22:20:16 2012 (r243044)
@@ -135,17 +135,16 @@ AcpiDbOpenDebugFile (
AcpiDbCloseDebugFile ();
AcpiGbl_DebugFile = fopen (Name, "w+");
- if (AcpiGbl_DebugFile)
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-vendor
mailing list