Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Sep 2009 01:21:44 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r196804 - in vendor-sys/acpica/dist: . common compiler dispatcher executer include namespace parser tools/acpiexec utilities
Message-ID:  <200909040121.n841LiYe049782@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Fri Sep  4 01:21:44 2009
New Revision: 196804
URL: http://svn.freebsd.org/changeset/base/196804

Log:
  Import ACPICA 20090903

Modified:
  vendor-sys/acpica/dist/changes.txt
  vendor-sys/acpica/dist/common/dmtbdump.c
  vendor-sys/acpica/dist/common/dmtbinfo.c
  vendor-sys/acpica/dist/compiler/aslcompiler.h
  vendor-sys/acpica/dist/compiler/aslfiles.c
  vendor-sys/acpica/dist/compiler/aslglobal.h
  vendor-sys/acpica/dist/compiler/aslload.c
  vendor-sys/acpica/dist/compiler/aslmain.c
  vendor-sys/acpica/dist/compiler/asltypes.h
  vendor-sys/acpica/dist/dispatcher/dsmthdat.c
  vendor-sys/acpica/dist/dispatcher/dsobject.c
  vendor-sys/acpica/dist/executer/exstorob.c
  vendor-sys/acpica/dist/include/acdisasm.h
  vendor-sys/acpica/dist/include/aclocal.h
  vendor-sys/acpica/dist/include/acpixf.h
  vendor-sys/acpica/dist/namespace/nsinit.c
  vendor-sys/acpica/dist/namespace/nspredef.c
  vendor-sys/acpica/dist/parser/psloop.c
  vendor-sys/acpica/dist/tools/acpiexec/aecommon.h
  vendor-sys/acpica/dist/tools/acpiexec/aeexec.c
  vendor-sys/acpica/dist/tools/acpiexec/aehandlers.c
  vendor-sys/acpica/dist/tools/acpiexec/aemain.c
  vendor-sys/acpica/dist/tools/acpiexec/aetables.c
  vendor-sys/acpica/dist/utilities/uteval.c

Modified: vendor-sys/acpica/dist/changes.txt
==============================================================================
--- vendor-sys/acpica/dist/changes.txt	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/changes.txt	Fri Sep  4 01:21:44 2009	(r196804)
@@ -1,4 +1,77 @@
 ----------------------------------------
+03 September 2009. Summary of changes for version 20090903:
+
+This release is available at www.acpica.org/downloads
+
+1) ACPI CA Core Subsystem:
+
+For Windows Vista compatibility, added the automatic execution of an _INI 
+method located at the namespace root (\_INI). This method is executed at 
+table load time. This support is in addition to the automatic execution of 
+\_SB._INI. Lin Ming.
+
+Fixed a possible memory leak in the interpreter for AML package objects if 
+the package initializer list is longer than the defined size of the package. 
+This apparently can only happen if the BIOS changes the package size on the 
+fly (seen in a _PSS object), as ASL compilers do not allow this. The 
+interpreter will truncate the package to the defined size (and issue an error 
+message), but previously could leave the extra objects undeleted if they were 
+pre-created during the argument processing (such is the case if the package 
+consists of a number of sub-packages as in the _PSS.) ACPICA BZ 805.
+
+Fixed a problem seen when a Buffer or String is stored to itself via ASL. 
+This has been reported in the field. Previously, ACPICA would zero out the 
+buffer/string. Now, the operation is treated as a noop. Provides Windows 
+compatibility. ACPICA BZ 803. Lin Ming.
+
+Removed an extraneous error message for ASL constructs of the form 
+Store(LocalX,LocalX) when LocalX is uninitialized. These curious statements 
+are seen in many BIOSs and are once again treated as NOOPs and no error is 
+emitted when they are encountered. ACPICA BZ 785.
+
+Fixed an extraneous warning message if a _DSM reserved method returns a 
+Package object. _DSM can return any type of object, so validation on the 
+return type cannot be performed. ACPICA BZ 802.
+
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The 
+debug version of the code includes the debug output trace mechanism and has a 
+much larger code and data size.
+
+  Previous Release:
+    Non-Debug Version:  85.5K Code, 18.0K Data, 103.5K Total
+    Debug Version:     161.6K Code, 50.9K Data, 212.5K Total
+  Current Release:
+    Non-Debug Version:  85.6K Code, 18.0K Data, 103.6K Total
+    Debug Version:     161.7K Code, 50.9K Data, 212.6K Total
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL: Fixed a problem with the use of the Alias operator and Resource 
+Templates. The correct alias is now constructed and no error is emitted. 
+ACPICA BZ 738.
+
+iASL: Implemented the -I option to specify additional search directories for 
+include files. Allows multiple additional search paths for include files. 
+Directories are searched in the order specified on the command line (after 
+the local directory is searched.) ACPICA BZ 800.
+
+iASL: Fixed a problem where the full pathname for include files was not 
+emitted for warnings/errors. This caused the IDE support to not work 
+properly. ACPICA BZ 765.
+
+iASL: Implemented the -@ option to specify a Windows-style response file 
+containing additional command line options. ACPICA BZ 801.
+
+AcpiExec: Added support to load multiple AML files simultaneously (such as a 
+DSDT and multiple SSDTs). Also added support for wildcards within the AML 
+pathname. These features allow all machine tables to be easily loaded and 
+debugged together. ACPICA BZ 804.
+
+Disassembler: Added missing support for disassembly of HEST table Error Bank 
+subtables. 
+
+----------------------------------------
 30 July 2009. Summary of changes for version 20090730:
 
 This release is available at www.acpica.org/downloads

Modified: vendor-sys/acpica/dist/common/dmtbdump.c
==============================================================================
--- vendor-sys/acpica/dist/common/dmtbdump.c	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/common/dmtbdump.c	Fri Sep  4 01:21:44 2009	(r196804)
@@ -747,6 +747,8 @@ AcpiDmDumpHest (
     UINT32                  Offset = sizeof (ACPI_TABLE_HEST);
     ACPI_DMTABLE_INFO       *InfoTable;
     UINT32                  SubTableLength;
+    UINT32                  BankCount;
+    ACPI_HEST_IA_ERROR_BANK *BankTable;
 
 
     /* Main table */
@@ -762,16 +764,21 @@ AcpiDmDumpHest (
     SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
     while (Offset < Table->Length)
     {
+        BankCount = 0;
         switch (SubTable->Type)
         {
         case ACPI_HEST_TYPE_IA32_CHECK:
             InfoTable = AcpiDmTableInfoHest0;
             SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
+            BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
+                            SubTable))->NumHardwareBanks;
             break;
 
         case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
             InfoTable = AcpiDmTableInfoHest1;
             SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED);
+            BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
+                            SubTable))->NumHardwareBanks;
             break;
 
         case ACPI_HEST_TYPE_IA32_NMI:
@@ -814,9 +821,34 @@ AcpiDmDumpHest (
             return;
         }
 
-        /* Point to next sub-table (each subtable is of fixed length) */
+        /* Point to end of current subtable (each subtable above is of fixed length) */
 
         Offset += SubTableLength;
+
+        /* If there are any (fixed-length) Error Banks from above, dump them now */
+
+        if (BankCount)
+        {
+            BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, SubTable, SubTableLength);
+            SubTableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
+
+            while (BankCount)
+            {
+                AcpiOsPrintf ("\n");
+                Status = AcpiDmDumpTable (Length, Offset, BankTable,
+                            sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
+                if (ACPI_FAILURE (Status))
+                {
+                    return;
+                }
+                Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
+                BankTable++;
+                BankCount--;
+            }
+        }
+
+        /* Point to next sub-table */
+
         SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength);
     }
 }

Modified: vendor-sys/acpica/dist/common/dmtbinfo.c
==============================================================================
--- vendor-sys/acpica/dist/common/dmtbinfo.c	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/common/dmtbinfo.c	Fri Sep  4 01:21:44 2009	(r196804)
@@ -178,6 +178,7 @@
 #define ACPI_HEST8_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f)
 #define ACPI_HEST9_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_HEST_GENERIC,f)
 #define ACPI_HESTN_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_HEST_NOTIFY,f)
+#define ACPI_HESTB_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f)
 #define ACPI_IVRSH_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_IVRS_HEADER,f)
 #define ACPI_IVRS0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f)
 #define ACPI_IVRS1_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_IVRS_MEMORY,f)
@@ -905,6 +906,25 @@ ACPI_DMTABLE_INFO           AcpiDmTableI
 };
 
 
+/*
+ * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
+ * ACPI_HEST_IA_CORRECTED structures.
+ */
+ACPI_DMTABLE_INFO           AcpiDmTableInfoHestBank[] =
+{
+    {ACPI_DMT_UINT8,    ACPI_HESTB_OFFSET (BankNumber),             "Bank Number"},
+    {ACPI_DMT_UINT8,    ACPI_HESTB_OFFSET (ClearStatusOnInit),      "Clear Status On Init"},
+    {ACPI_DMT_UINT8,    ACPI_HESTB_OFFSET (StatusFormat),           "Status Format"},
+    {ACPI_DMT_UINT8,    ACPI_HESTB_OFFSET (Reserved),               "Reserved"},
+    {ACPI_DMT_UINT32,   ACPI_HESTB_OFFSET (ControlRegister),        "Control Register"},
+    {ACPI_DMT_UINT64,   ACPI_HESTB_OFFSET (ControlData),            "Control Data"},
+    {ACPI_DMT_UINT32,   ACPI_HESTB_OFFSET (StatusRegister),         "Status Register"},
+    {ACPI_DMT_UINT32,   ACPI_HESTB_OFFSET (AddressRegister),        "Address Register"},
+    {ACPI_DMT_UINT32,   ACPI_HESTB_OFFSET (MiscRegister),           "Misc Register"},
+    {ACPI_DMT_EXIT,     0,                                          NULL}
+};
+
+
 /*******************************************************************************
  *
  * HPET - High Precision Event Timer table

Modified: vendor-sys/acpica/dist/compiler/aslcompiler.h
==============================================================================
--- vendor-sys/acpica/dist/compiler/aslcompiler.h	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/compiler/aslcompiler.h	Fri Sep  4 01:21:44 2009	(r196804)
@@ -556,6 +556,10 @@ AslAbort (
     void);
 
 void
+FlAddIncludeDirectory (
+    char                    *Dir);
+
+void
 FlOpenIncludeFile (
     ACPI_PARSE_OBJECT       *Op);
 

Modified: vendor-sys/acpica/dist/compiler/aslfiles.c
==============================================================================
--- vendor-sys/acpica/dist/compiler/aslfiles.c	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/compiler/aslfiles.c	Fri Sep  4 01:21:44 2009	(r196804)
@@ -128,10 +128,11 @@ FlOpenFile (
     char                    *Filename,
     char                    *Mode);
 
-static FILE *
-FlOpenLocalFile (
-    char                    *LocalName,
-    char                    *Mode);
+FILE *
+FlOpenIncludeWithPrefix (
+    char                    *PrefixDir,
+    char                    *Filename);
+
 
 #ifdef ACPI_OBSOLETE_FUNCTIONS
 ACPI_STATUS
@@ -172,45 +173,6 @@ AslAbort (
 
 /*******************************************************************************
  *
- * FUNCTION:    FlOpenLocalFile
- *
- * PARAMETERS:  LocalName           - Single filename (not a pathname)
- *              Mode                - Open mode for fopen
- *
- * RETURN:      File descriptor
- *
- * DESCRIPTION: Build a complete pathname for the input filename and open
- *              the file.
- *
- ******************************************************************************/
-
-static FILE *
-FlOpenLocalFile (
-    char                    *LocalName,
-    char                    *Mode)
-{
-
-    StringBuffer[0] = 0;
-
-    /* Check for an absolute pathname */
-
-    if ((LocalName[0] != '/') &&        /* Forward slash */
-        (LocalName[0] != '\\') &&       /* backslash (Win) */
-        (LocalName[1] != ':'))          /* Device name (Win) */
-    {
-        /* The include file path is relative, prepend the directory path */
-
-        strcat (StringBuffer, Gbl_DirectoryPath);
-    }
-    strcat (StringBuffer, LocalName);
-
-    DbgPrint (ASL_PARSE_OUTPUT, "FlOpenLocalFile: %s\n", StringBuffer);
-    return (fopen (StringBuffer, (const char *) Mode));
-}
-
-
-/*******************************************************************************
- *
  * FUNCTION:    FlFileError
  *
  * PARAMETERS:  FileId              - Index into file info array
@@ -481,6 +443,122 @@ FlSetLineNumber (
 
 /*******************************************************************************
  *
+ * FUNCTION:    FlAddIncludeDirectory
+ *
+ * PARAMETERS:  Dir             - Directory pathname string
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Add a directory the list of include prefix directories.
+ *
+ ******************************************************************************/
+
+void
+FlAddIncludeDirectory (
+    char                    *Dir)
+{
+    ASL_INCLUDE_DIR         *NewDir;
+    ASL_INCLUDE_DIR         *NextDir;
+    ASL_INCLUDE_DIR         *PrevDir = NULL;
+    UINT32                  NeedsSeparator = 0;
+    size_t                  DirLength;
+
+
+    DirLength = strlen (Dir);
+    if (!DirLength)
+    {
+        return;
+    }
+
+    /* Make sure that the pathname ends with a path separator */
+
+    if ((Dir[DirLength-1] != '/') &&
+        (Dir[DirLength-1] != '\\'))
+    {
+        NeedsSeparator = 1;
+    }
+
+    NewDir = ACPI_ALLOCATE_ZEROED (sizeof (ASL_INCLUDE_DIR));
+    NewDir->Dir = ACPI_ALLOCATE (DirLength + 1 + NeedsSeparator);
+    strcpy (NewDir->Dir, Dir);
+    if (NeedsSeparator)
+    {
+        strcat (NewDir->Dir, "/");
+    }
+
+    /*
+     * Preserve command line ordering of -I options by adding new elements
+     * at the end of the list
+     */
+    NextDir = Gbl_IncludeDirList;
+    while (NextDir)
+    {
+        PrevDir = NextDir;
+        NextDir = NextDir->Next;
+    }
+
+    if (PrevDir)
+    {
+        PrevDir->Next = NewDir;
+    }
+    else
+    {
+        Gbl_IncludeDirList = NewDir;
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    FlOpenIncludeWithPrefix
+ *
+ * PARAMETERS:  PrefixDir       - Prefix directory pathname. Can be a zero
+ *                                length string.
+ *              Filename        - The include filename from the source ASL.
+ *
+ * RETURN:      Valid file descriptor if successful. Null otherwise.
+ *
+ * DESCRIPTION: Open an include file and push it on the input file stack.
+ *
+ ******************************************************************************/
+
+FILE *
+FlOpenIncludeWithPrefix (
+    char                    *PrefixDir,
+    char                    *Filename)
+{
+    FILE                    *IncludeFile;
+    char                    *Pathname;
+
+
+    /* Build the full pathname to the file */
+
+    Pathname = ACPI_ALLOCATE (strlen (PrefixDir) + strlen (Filename) + 1);
+
+    strcpy (Pathname, PrefixDir);
+    strcat (Pathname, Filename);
+
+    DbgPrint (ASL_PARSE_OUTPUT, "\nAttempt to open include file: path %s\n\n",
+        Pathname);
+
+    /* Attempt to open the file, push if successful */
+
+    IncludeFile = fopen (Pathname, "r");
+    if (IncludeFile)
+    {
+        /* Push the include file on the open input file stack */
+
+        AslPushInputFileStack (IncludeFile, Pathname);
+        return (IncludeFile);
+    }
+
+    ACPI_FREE (Pathname);
+    return (NULL);
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    FlOpenIncludeFile
  *
  * PARAMETERS:  Op        - Parse node for the INCLUDE ASL statement
@@ -495,7 +573,8 @@ void
 FlOpenIncludeFile (
     ACPI_PARSE_OBJECT       *Op)
 {
-    FILE                    *IncFile;
+    FILE                    *IncludeFile;
+    ASL_INCLUDE_DIR         *NextDir;
 
 
     /* Op must be valid */
@@ -518,21 +597,58 @@ FlOpenIncludeFile (
     FlPrintFile (ASL_FILE_SOURCE_OUTPUT, "\n");
     Gbl_CurrentLineOffset++;
 
-    /* Prepend the directory pathname and open the include file */
 
-    DbgPrint (ASL_PARSE_OUTPUT, "\nOpen include file: path %s\n\n",
-        Op->Asl.Value.String);
-    IncFile = FlOpenLocalFile (Op->Asl.Value.String, "r");
-    if (!IncFile)
+    /* Attempt to open the include file */
+
+    /* If the file specifies an absolute path, just open it */
+
+    if ((Op->Asl.Value.String[0] == '/')  ||
+        (Op->Asl.Value.String[0] == '\\') ||
+        (Op->Asl.Value.String[1] == ':'))
     {
-        sprintf (MsgBuffer, "%s (%s)", Op->Asl.Value.String, strerror (errno));
-        AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, Op, MsgBuffer);
+        IncludeFile = FlOpenIncludeWithPrefix ("", Op->Asl.Value.String);
+        if (!IncludeFile)
+        {
+            goto ErrorExit;
+        }
         return;
     }
 
-    /* Push the include file on the open input file stack */
+    /*
+     * The include filename is not an absolute path.
+     *
+     * First, search for the file within the "local" directory -- meaning
+     * the same directory that contains the source file.
+     *
+     * Construct the file pathname from the global directory name.
+     */
+    IncludeFile = FlOpenIncludeWithPrefix (Gbl_DirectoryPath, Op->Asl.Value.String);
+    if (IncludeFile)
+    {
+        return;
+    }
+
+    /*
+     * Second, search for the file within the (possibly multiple) directories
+     * specified by the -I option on the command line.
+     */
+    NextDir = Gbl_IncludeDirList;
+    while (NextDir)
+    {
+        IncludeFile = FlOpenIncludeWithPrefix (NextDir->Dir, Op->Asl.Value.String);
+        if (IncludeFile)
+        {
+            return;
+        }
+
+        NextDir = NextDir->Next;
+    }
+
+    /* We could not open the include file after trying very hard */
 
-    AslPushInputFileStack (IncFile, Op->Asl.Value.String);
+ErrorExit:
+    sprintf (MsgBuffer, "%s, %s", Op->Asl.Value.String, strerror (errno));
+    AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, Op, MsgBuffer);
 }
 
 

Modified: vendor-sys/acpica/dist/compiler/aslglobal.h
==============================================================================
--- vendor-sys/acpica/dist/compiler/aslglobal.h	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/compiler/aslglobal.h	Fri Sep  4 01:21:44 2009	(r196804)
@@ -148,7 +148,7 @@ extern char                         HexL
 #define ASL_LINE_BUFFER_SIZE        512
 #define ASL_MSG_BUFFER_SIZE         4096
 #define HEX_TABLE_LINE_SIZE         8
-#define HEX_LISTING_LINE_SIZE       16
+#define HEX_LISTING_LINE_SIZE       8
 
 
 /* Source code buffers and pointers for error reporting */
@@ -212,6 +212,7 @@ ASL_EXTERN char                     *Gbl
 ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_ExternalFilename, NULL);
 ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL);
 ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL);
+ASL_EXTERN ASL_INCLUDE_DIR          ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL);
 ASL_EXTERN char                     *Gbl_CurrentInputFilename;
 
 ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_HasIncludeFiles, FALSE);

Modified: vendor-sys/acpica/dist/compiler/aslload.c
==============================================================================
--- vendor-sys/acpica/dist/compiler/aslload.c	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/compiler/aslload.c	Fri Sep  4 01:21:44 2009	(r196804)
@@ -353,6 +353,7 @@ LdLoadResourceElements (
 
     Node->Value = (UINT32) Op->Asl.Value.Integer;
     Node->Op = Op;
+    Op->Asl.Node = Node;
 
     /*
      * Now enter the predefined fields, for easy lookup when referenced

Modified: vendor-sys/acpica/dist/compiler/aslmain.c
==============================================================================
--- vendor-sys/acpica/dist/compiler/aslmain.c	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/compiler/aslmain.c	Fri Sep  4 01:21:44 2009	(r196804)
@@ -150,6 +150,28 @@ AslCommandLine (
     int                     argc,
     char                    **argv);
 
+static int
+AslDoOptions (
+    int                     argc,
+    char                    **argv,
+    BOOLEAN                 IsResponseFile);
+
+static void
+AslMergeOptionTokens (
+    char                    *InBuffer,
+    char                    *OutBuffer);
+
+static int
+AslDoResponseFile (
+    char                    *Filename);
+
+extern int   AcpiGbl_Opterr;
+extern int   AcpiGbl_Optind;
+
+
+#define ASL_TOKEN_SEPARATORS    " \t\n"
+#define ASL_SUPPORTED_OPTIONS   "@:2b:cd^e:fgh^i^I:l^o:p:r:s:t:v:w:x:"
+
 
 /*******************************************************************************
  *
@@ -168,8 +190,12 @@ Options (
     void)
 {
 
-    printf ("General Output:\n");
-    printf ("  -p <prefix>    Specify path/filename prefix for all output files\n");
+    printf ("Global:\n");
+    printf ("  -@<file>       Specify command file\n");
+    printf ("  -I<dir>        Specify additional include directory\n");
+
+    printf ("\nGeneral Output:\n");
+    printf ("  -p<prefix>     Specify path/filename prefix for all output files\n");
     printf ("  -va            Disable all errors and warnings (summary only)\n");
     printf ("  -vi            Less verbose errors and warnings for use with IDEs\n");
     printf ("  -vo            Enable optimization comments\n");
@@ -310,39 +336,149 @@ AslInitialize (
 
 /*******************************************************************************
  *
- * FUNCTION:    AslCommandLine
+ * FUNCTION:    AslMergeOptionTokens
  *
- * PARAMETERS:  argc/argv
+ * PARAMETERS:  InBuffer            - Input containing an option string
+ *              OutBuffer           - Merged output buffer
  *
  * RETURN:      None
  *
- * DESCRIPTION: Command line processing
+ * DESCRIPTION: Remove all whitespace from an option string.
+ *
+ ******************************************************************************/
+
+static void
+AslMergeOptionTokens (
+    char                    *InBuffer,
+    char                    *OutBuffer)
+{
+    char                    *Token;
+
+
+    *OutBuffer = 0;
+
+    Token = strtok (InBuffer, ASL_TOKEN_SEPARATORS);
+    while (Token)
+    {
+        strcat (OutBuffer, Token);
+        Token = strtok (NULL, ASL_TOKEN_SEPARATORS);
+    }
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AslDoResponseFile
+ *
+ * PARAMETERS:  Filename        - Name of the response file
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Open a response file and process all options within.
  *
  ******************************************************************************/
 
 static int
-AslCommandLine (
-    int                     argc,
-    char                    **argv)
+AslDoResponseFile (
+    char                    *Filename)
 {
-    BOOLEAN                 BadCommandLine = FALSE;
-    int                     j;
+    char                    *argv = StringBuffer2;
+    FILE                    *ResponseFile;
+    int                     OptStatus = 0;
+    int                     Opterr;
+    int                     Optind;
 
 
-    /* Minimum command line contains at least one option or an input file */
+    ResponseFile = fopen (Filename, "r");
+    if (!ResponseFile)
+    {
+        printf ("Could not open command file %s, %s\n",
+            Filename, strerror (errno));
+        return -1;
+    }
 
-    if (argc < 2)
+    /* Must save the current GetOpt globals */
+
+    Opterr = AcpiGbl_Opterr;
+    Optind = AcpiGbl_Optind;
+
+    /*
+     * Process all lines in the response file. There must be one complete
+     * option per line
+     */
+    while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ResponseFile))
     {
-        AslCompilerSignon (ASL_FILE_STDOUT);
-        Usage ();
-        exit (1);
+        /* Compress all tokens, allowing us to use a single argv entry */
+
+        AslMergeOptionTokens (StringBuffer, StringBuffer2);
+
+        /* Process the option */
+
+        AcpiGbl_Opterr = 0;
+        AcpiGbl_Optind = 0;
+
+        OptStatus = AslDoOptions (1, &argv, TRUE);
+        if (OptStatus)
+        {
+            printf ("Invalid option in command file %s: %s\n",
+                Filename, StringBuffer);
+            break;
+        }
     }
 
+    /* Restore the GetOpt globals */
+
+    AcpiGbl_Opterr = Opterr;
+    AcpiGbl_Optind = Optind;
+
+    fclose (ResponseFile);
+    return (OptStatus);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AslDoOptions
+ *
+ * PARAMETERS:  argc/argv           - Standard argc/argv
+ *              IsResponseFile      - TRUE if executing a response file.
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Command line option processing
+ *
+ ******************************************************************************/
+
+static int
+AslDoOptions (
+    int                     argc,
+    char                    **argv,
+    BOOLEAN                 IsResponseFile)
+{
+    int                     j;
+
+
     /* Get the command line options */
 
-    while ((j = AcpiGetopt (argc, argv, "2b:cd^e:fgh^i^l^o:p:r:s:t:v:w:x:")) != EOF) switch (j)
+    while ((j = AcpiGetopt (argc, argv, ASL_SUPPORTED_OPTIONS)) != EOF) switch (j)
     {
+    case '@':   /* Begin a response file */
+
+        if (IsResponseFile)
+        {
+            printf ("Nested command files are not supported\n");
+            return -1;
+        }
+
+        if (AslDoResponseFile (AcpiGbl_Optarg))
+        {
+            return -1;
+        }
+        break;
+
+
     case '2':
+
         Gbl_Acpi2 = TRUE;
         break;
 
@@ -364,8 +500,7 @@ AslCommandLine (
 
         default:
             printf ("Unknown option: -b%s\n", AcpiGbl_Optarg);
-            BadCommandLine = TRUE;
-            break;
+            return (-1);
         }
 
         /* Produce debug output file */
@@ -394,8 +529,7 @@ AslCommandLine (
 
         default:
             printf ("Unknown option: -d%s\n", AcpiGbl_Optarg);
-            BadCommandLine = TRUE;
-            break;
+            return (-1);
         }
 
         Gbl_DisasmFlag = TRUE;
@@ -444,12 +578,17 @@ AslCommandLine (
 
         default:
             printf ("Unknown option: -h%s\n", AcpiGbl_Optarg);
-            BadCommandLine = TRUE;
-            break;
+            return (-1);
         }
         break;
 
 
+    case 'I': /* Add an include file search directory */
+
+        FlAddIncludeDirectory (AcpiGbl_Optarg);
+        break;
+
+
     case 'i':
 
         switch (AcpiGbl_Optarg[0])
@@ -470,8 +609,7 @@ AslCommandLine (
 
         default:
             printf ("Unknown option: -s%s\n", AcpiGbl_Optarg);
-            BadCommandLine = TRUE;
-            break;
+            return (-1);
         }
         break;
 
@@ -500,8 +638,7 @@ AslCommandLine (
 
         default:
             printf ("Unknown option: -l%s\n", AcpiGbl_Optarg);
-            BadCommandLine = TRUE;
-            break;
+            return (-1);
         }
         break;
 
@@ -549,8 +686,7 @@ AslCommandLine (
 
         default:
             printf ("Unknown option: -c%s\n", AcpiGbl_Optarg);
-            BadCommandLine = TRUE;
-            break;
+            return (-1);
         }
         break;
 
@@ -589,8 +725,7 @@ AslCommandLine (
 
         default:
             printf ("Unknown option: -s%s\n", AcpiGbl_Optarg);
-            BadCommandLine = TRUE;
-            break;
+            return (-1);
         }
         break;
 
@@ -611,8 +746,7 @@ AslCommandLine (
 
         default:
             printf ("Unknown option: -t%s\n", AcpiGbl_Optarg);
-            BadCommandLine = TRUE;
-            break;
+            return (-1);
         }
         break;
 
@@ -647,8 +781,7 @@ AslCommandLine (
 
         default:
             printf ("Unknown option: -v%s\n", AcpiGbl_Optarg);
-            BadCommandLine = TRUE;
-            break;
+            return (-1);
         }
         break;
 
@@ -671,8 +804,7 @@ AslCommandLine (
 
         default:
             printf ("Unknown option: -w%s\n", AcpiGbl_Optarg);
-            BadCommandLine = TRUE;
-            break;
+            return (-1);
         }
         break;
 
@@ -685,10 +817,46 @@ AslCommandLine (
 
     default:
 
-        BadCommandLine = TRUE;
-        break;
+        return (-1);
+    }
+
+    return (0);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AslCommandLine
+ *
+ * PARAMETERS:  argc/argv
+ *
+ * RETURN:      Last argv index
+ *
+ * DESCRIPTION: Command line processing
+ *
+ ******************************************************************************/
+
+static int
+AslCommandLine (
+    int                     argc,
+    char                    **argv)
+{
+    int                     BadCommandLine = 0;
+
+
+    /* Minimum command line contains at least the command and an input file */
+
+    if (argc < 2)
+    {
+        AslCompilerSignon (ASL_FILE_STDOUT);
+        Usage ();
+        exit (1);
     }
 
+    /* Process all command line options */
+
+    BadCommandLine = AslDoOptions (argc, argv, FALSE);
+
     /* Next parameter must be the input filename */
 
     if (!argv[AcpiGbl_Optind] &&

Modified: vendor-sys/acpica/dist/compiler/asltypes.h
==============================================================================
--- vendor-sys/acpica/dist/compiler/asltypes.h	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/compiler/asltypes.h	Fri Sep  4 01:21:44 2009	(r196804)
@@ -255,6 +255,14 @@ typedef enum
 #define ASL_NUM_FILES           (ASL_MAX_FILE_TYPE + 1)
 
 
+typedef struct asl_include_dir
+{
+    char                        *Dir;
+    struct asl_include_dir      *Next;
+
+} ASL_INCLUDE_DIR;
+
+
 /* An entry in the exception list, one for each error/warning */
 
 typedef struct asl_error_msg

Modified: vendor-sys/acpica/dist/dispatcher/dsmthdat.c
==============================================================================
--- vendor-sys/acpica/dist/dispatcher/dsmthdat.c	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/dispatcher/dsmthdat.c	Fri Sep  4 01:21:44 2009	(r196804)
@@ -548,9 +548,10 @@ AcpiDsMethodDataGetValue (
 
         case ACPI_REFCLASS_LOCAL:
 
-            ACPI_ERROR ((AE_INFO,
-                "Uninitialized Local[%d] at node %p", Index, Node));
-
+            /*
+             * No error message for this case, will be trapped again later to
+             * detect and ignore cases of Store(LocalX,LocalX)
+             */
             return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL);
 
         default:

Modified: vendor-sys/acpica/dist/dispatcher/dsobject.c
==============================================================================
--- vendor-sys/acpica/dist/dispatcher/dsobject.c	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/dispatcher/dsobject.c	Fri Sep  4 01:21:44 2009	(r196804)
@@ -570,15 +570,28 @@ AcpiDsBuildInternalPackageObj (
     {
         /*
          * NumElements was exhausted, but there are remaining elements in the
-         * PackageList.
+         * PackageList. Truncate the package to NumElements.
          *
          * Note: technically, this is an error, from ACPI spec: "It is an error
          * for NumElements to be less than the number of elements in the
-         * PackageList". However, for now, we just print an error message and
-         * no exception is returned.
+         * PackageList". However, we just print an error message and
+         * no exception is returned. This provides Windows compatibility. Some
+         * BIOSs will alter the NumElements on the fly, creating this type
+         * of ill-formed package object.
          */
         while (Arg)
         {
+            /*
+             * We must delete any package elements that were created earlier
+             * and are not going to be used because of the package truncation.
+             */
+            if (Arg->Common.Node)
+            {
+                AcpiUtRemoveReference (
+                    ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node));
+                Arg->Common.Node = NULL;
+            }
+
             /* Find out how many elements there really are */
 
             i++;
@@ -586,7 +599,7 @@ AcpiDsBuildInternalPackageObj (
         }
 
         ACPI_ERROR ((AE_INFO,
-            "Package List length (%X) larger than NumElements count (%X), truncated\n",
+            "Package List length (0x%X) larger than NumElements count (0x%X), truncated\n",
             i, ElementCount));
     }
     else if (i < ElementCount)
@@ -596,7 +609,7 @@ AcpiDsBuildInternalPackageObj (
          * Note: this is not an error, the package is padded out with NULLs.
          */
         ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-            "Package List length (%X) smaller than NumElements count (%X), padded with null elements\n",
+            "Package List length (0x%X) smaller than NumElements count (0x%X), padded with null elements\n",
             i, ElementCount));
     }
 

Modified: vendor-sys/acpica/dist/executer/exstorob.c
==============================================================================
--- vendor-sys/acpica/dist/executer/exstorob.c	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/executer/exstorob.c	Fri Sep  4 01:21:44 2009	(r196804)
@@ -150,6 +150,13 @@ AcpiExStoreBufferToBuffer (
     ACPI_FUNCTION_TRACE_PTR (ExStoreBufferToBuffer, SourceDesc);
 
 
+    /* If Source and Target are the same, just return */
+
+    if (SourceDesc == TargetDesc)
+    {
+        return_ACPI_STATUS (AE_OK);
+    }
+
     /* We know that SourceDesc is a buffer by now */
 
     Buffer = ACPI_CAST_PTR (UINT8, SourceDesc->Buffer.Pointer);
@@ -248,6 +255,13 @@ AcpiExStoreStringToString (
     ACPI_FUNCTION_TRACE_PTR (ExStoreStringToString, SourceDesc);
 
 
+    /* If Source and Target are the same, just return */
+
+    if (SourceDesc == TargetDesc)
+    {
+        return_ACPI_STATUS (AE_OK);
+    }
+
     /* We know that SourceDesc is a string by now */
 
     Buffer = ACPI_CAST_PTR (UINT8, SourceDesc->String.Pointer);

Modified: vendor-sys/acpica/dist/include/acdisasm.h
==============================================================================
--- vendor-sys/acpica/dist/include/acdisasm.h	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/include/acdisasm.h	Fri Sep  4 01:21:44 2009	(r196804)
@@ -273,6 +273,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTa
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest8[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest9[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHestNotify[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHestBank[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHpet[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIvrs[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIvrs0[];

Modified: vendor-sys/acpica/dist/include/aclocal.h
==============================================================================
--- vendor-sys/acpica/dist/include/aclocal.h	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/include/aclocal.h	Fri Sep  4 01:21:44 2009	(r196804)
@@ -1127,6 +1127,9 @@ typedef struct acpi_bit_register_info
 #define ACPI_OSI_WIN_XP_SP2             0x05
 #define ACPI_OSI_WINSRV_2003_SP1        0x06
 #define ACPI_OSI_WIN_VISTA              0x07
+#define ACPI_OSI_WINSRV_2008            0x08
+#define ACPI_OSI_WIN_VISTA_SP1          0x09
+#define ACPI_OSI_WIN_7                  0x0A
 
 #define ACPI_ALWAYS_ILLEGAL             0x00
 

Modified: vendor-sys/acpica/dist/include/acpixf.h
==============================================================================
--- vendor-sys/acpica/dist/include/acpixf.h	Thu Sep  3 23:04:33 2009	(r196803)
+++ vendor-sys/acpica/dist/include/acpixf.h	Fri Sep  4 01:21:44 2009	(r196804)

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



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