Merge ACPICA 20110623. trunk
authorjruoho <jruoho@NetBSD.org>
Tue, 28 Jun 2011 09:04:29 +0000
branchtrunk
changeset 202296 9b18fca7cbd2
parent 202295 de9fd5741b1a
child 202297 f985977ed720
Merge ACPICA 20110623.
sys/external/bsd/acpica/dist/common/dmtbinfo.c
sys/external/bsd/acpica/dist/compiler/aslutils.c
sys/external/bsd/acpica/dist/debugger/dbdisply.c
sys/external/bsd/acpica/dist/debugger/dbexec.c
sys/external/bsd/acpica/dist/debugger/dbinput.c
sys/external/bsd/acpica/dist/debugger/dbutils.c
sys/external/bsd/acpica/dist/events/evrgnini.c
sys/external/bsd/acpica/dist/include/acdebug.h
sys/external/bsd/acpica/dist/include/acdisasm.h
sys/external/bsd/acpica/dist/include/acglobal.h
sys/external/bsd/acpica/dist/include/aclocal.h
sys/external/bsd/acpica/dist/include/acpiosxf.h
sys/external/bsd/acpica/dist/include/acpixf.h
sys/external/bsd/acpica/dist/include/actypes.h
sys/external/bsd/acpica/dist/namespace/nsrepair2.c
sys/external/bsd/acpica/dist/osunixxf.c
sys/external/bsd/acpica/dist/tools/acpiexec/osunixdir.c
sys/external/bsd/acpica/dist/tools/acpisrc/osunixdir.c
sys/external/bsd/acpica/dist/utilities/utdecode.c
--- a/sys/external/bsd/acpica/dist/common/dmtbinfo.c	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/common/dmtbinfo.c	Tue Jun 28 09:04:29 2011 +0000
@@ -51,6 +51,31 @@
         ACPI_MODULE_NAME    ("dmtbinfo")
 
 /*
+ * How to add a new table:
+ *
+ * - Add the C table definition to the actbl1.h or actbl2.h header.
+ * - Add ACPI_xxxx_OFFSET macro(s) for the table (and subtables) to list below.
+ * - Define the table in this file (for the disassembler). If any
+ *   new data types are required (ACPI_DMT_*), see below.
+ * - Add an external declaration for the new table definition (AcpiDmTableInfo*)
+ *     in acdisam.h
+ * - Add new table definition to the dispatch table in dmtable.c (AcpiDmTableData)
+ *     If a simple table (with no subtables), no disassembly code is needed.
+ *     Otherwise, create the AcpiDmDump* function for to disassemble the table
+ *     and add it to the dmtbdump.c file.
+ * - Add an external declaration for the new AcpiDmDump* function in acdisasm.h
+ * - Add the new AcpiDmDump* function to the dispatch table in dmtable.c
+ * - Create a template for the new table
+ * - Add data table compiler support
+ *
+ * How to add a new data type (ACPI_DMT_*):
+ *
+ * - Add new type at the end of the ACPI_DMT list in acdisasm.h
+ * - Add length and implementation cases in dmtable.c  (disassembler)
+ * - Add type and length cases in dtutils.c (DT compiler)
+ */
+
+/*
  * Macros used to generate offsets to specific table fields
  */
 #define ACPI_FACS_OFFSET(f)             (UINT8) ACPI_OFFSET (ACPI_TABLE_FACS,f)
@@ -131,6 +156,9 @@
 #define ACPI_MADTH_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
 #define ACPI_MCFG0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
 #define ACPI_MSCT0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
+#define ACPI_SLICH_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SLIC_HEADER,f)
+#define ACPI_SLIC0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SLIC_KEY,f)
+#define ACPI_SLIC1_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SLIC_MARKER,f)
 #define ACPI_SRATH_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
 #define ACPI_SRAT0_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
 #define ACPI_SRAT1_OFFSET(f)            (UINT8) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
@@ -1256,13 +1284,42 @@
 
 /*******************************************************************************
  *
- * SLIC - Software Licensing Description Table. NOT FULLY IMPLEMENTED, do not
- * have the table definition.
+ * SLIC - Software Licensing Description Table. There is no common table, just
+ * the standard ACPI header and then subtables.
  *
  ******************************************************************************/
 
-ACPI_DMTABLE_INFO           AcpiDmTableInfoSlic[] =
+/* Common Subtable header (one per Subtable) */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoSlicHdr[] =
+{
+    {ACPI_DMT_SLIC,     ACPI_SLICH_OFFSET (Type),                   "Subtable Type", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLICH_OFFSET (Length),                 "Length", DT_LENGTH},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoSlic0[] =
 {
+    {ACPI_DMT_UINT8,    ACPI_SLIC0_OFFSET (KeyType),                "Key Type", 0},
+    {ACPI_DMT_UINT8,    ACPI_SLIC0_OFFSET (Version),                "Version", 0},
+    {ACPI_DMT_UINT16,   ACPI_SLIC0_OFFSET (Reserved),               "Reserved", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC0_OFFSET (Algorithm),              "Algorithm", 0},
+    {ACPI_DMT_NAME4,    ACPI_SLIC0_OFFSET (Magic),                  "Magic", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC0_OFFSET (BitLength),              "BitLength", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC0_OFFSET (Exponent),               "Exponent", 0},
+    {ACPI_DMT_BUF128,   ACPI_SLIC0_OFFSET (Modulus[0]),             "Modulus", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoSlic1[] =
+{
+    {ACPI_DMT_UINT32,   ACPI_SLIC1_OFFSET (Version),                "Version", 0},
+    {ACPI_DMT_NAME6,    ACPI_SLIC1_OFFSET (OemId[0]),               "Oem ID", 0},
+    {ACPI_DMT_NAME8,    ACPI_SLIC1_OFFSET (OemTableId[0]),          "Oem Table ID", 0},
+    {ACPI_DMT_NAME8,    ACPI_SLIC1_OFFSET (WindowsFlag[0]),         "Windows Flag", 0},
+    {ACPI_DMT_UINT32,   ACPI_SLIC1_OFFSET (SlicVersion),            "SLIC Version", 0},
+    {ACPI_DMT_BUF16,    ACPI_SLIC1_OFFSET (Reserved[0]),            "Reserved", 0},
+    {ACPI_DMT_BUF128,   ACPI_SLIC1_OFFSET (Signature[0]),           "Signature", 0},
     ACPI_DMT_TERMINATOR
 };
 
--- a/sys/external/bsd/acpica/dist/compiler/aslutils.c	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/compiler/aslutils.c	Tue Jun 28 09:04:29 2011 +0000
@@ -53,13 +53,6 @@
 #define _COMPONENT          ACPI_COMPILER
         ACPI_MODULE_NAME    ("aslutils")
 
-#ifdef _USE_BERKELEY_YACC
-extern const char * const       AslCompilername[];
-static const char * const       *yytname = &AslCompilername[254];
-#else
-extern const char * const       yytname[];
-#endif
-
 char                        AslHexLookup[] =
 {
     '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
@@ -68,12 +61,6 @@
 
 /* Local prototypes */
 
-static ACPI_STATUS
-UtStrtoul64 (
-    char                    *String,
-    UINT32                  Base,
-    UINT64                  *RetInteger);
-
 static void
 UtPadNameWithUnderscores (
     char                    *NameSeg,
@@ -450,32 +437,6 @@
 
 /*******************************************************************************
  *
- * FUNCTION:    UtGetOpName
- *
- * PARAMETERS:  ParseOpcode         - Parser keyword ID
- *
- * RETURN:      Pointer to the opcode name
- *
- * DESCRIPTION: Get the ascii name of the parse opcode
- *
- ******************************************************************************/
-
-char *
-UtGetOpName (
-    UINT32                  ParseOpcode)
-{
-
-    /*
-     * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
-     * Ignore first 8 characters of the name
-     */
-    return ((char *) yytname
-        [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
-}
-
-
-/*******************************************************************************
- *
  * FUNCTION:    UtDisplaySummary
  *
  * PARAMETERS:  FileID          - ID of outpout file
@@ -884,7 +845,7 @@
  *
  ******************************************************************************/
 
-static ACPI_STATUS
+ACPI_STATUS
 UtStrtoul64 (
     char                    *String,
     UINT32                  Base,
--- a/sys/external/bsd/acpica/dist/debugger/dbdisply.c	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbdisply.c	Tue Jun 28 09:04:29 2011 +0000
@@ -69,6 +69,50 @@
     void                    *Target);
 
 
+/*
+ * System handler information.
+ * Used for Handlers command, in AcpiDbDisplayHandlers.
+ */
+#define ACPI_PREDEFINED_PREFIX          "%25s (%.2X) : "
+#define ACPI_HANDLER_NAME_STRING               "%30s : "
+#define ACPI_HANDLER_PRESENT_STRING                    "%-9s (%p)\n"
+#define ACPI_HANDLER_NOT_PRESENT_STRING                "%-9s\n"
+
+/* All predefined Address Space IDs */
+
+static ACPI_ADR_SPACE_TYPE  AcpiGbl_SpaceIdList[] =
+{
+    ACPI_ADR_SPACE_SYSTEM_MEMORY,
+    ACPI_ADR_SPACE_SYSTEM_IO,
+    ACPI_ADR_SPACE_PCI_CONFIG,
+    ACPI_ADR_SPACE_EC,
+    ACPI_ADR_SPACE_SMBUS,
+    ACPI_ADR_SPACE_CMOS,
+    ACPI_ADR_SPACE_PCI_BAR_TARGET,
+    ACPI_ADR_SPACE_IPMI,
+    ACPI_ADR_SPACE_DATA_TABLE,
+    ACPI_ADR_SPACE_FIXED_HARDWARE
+};
+
+/* Global handler information */
+
+typedef struct acpi_handler_info
+{
+    void                    *Handler;
+    char                    *Name;
+
+} ACPI_HANDLER_INFO;
+
+static ACPI_HANDLER_INFO    AcpiGbl_HandlerList[] =
+{
+    {&AcpiGbl_SystemNotify.Handler,     "System Notifications"},
+    {&AcpiGbl_DeviceNotify.Handler,     "Device Notifications"},
+    {&AcpiGbl_TableHandler,             "ACPI Table Events"},
+    {&AcpiGbl_ExceptionHandler,         "Control Method Exceptions"},
+    {&AcpiGbl_InterfaceHandler,         "OSI Invocations"}
+};
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiDbGetPointer
@@ -887,6 +931,7 @@
     }
 }
 
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiDbDisplayHandlers
@@ -899,46 +944,6 @@
  *
  ******************************************************************************/
 
-#define ACPI_PREDEFINED_PREFIX          "%25s (%.2X) : "
-#define ACPI_HANDLER_NAME_STRING               "%30s : "
-#define ACPI_HANDLER_PRESENT_STRING                    "%-9s (%p)\n"
-#define ACPI_HANDLER_NOT_PRESENT_STRING                "%-9s\n"
-
-/* All predefined Space IDs */
-
-static ACPI_ADR_SPACE_TYPE  SpaceIdList[] =
-{
-    ACPI_ADR_SPACE_SYSTEM_MEMORY,
-    ACPI_ADR_SPACE_SYSTEM_IO,
-    ACPI_ADR_SPACE_PCI_CONFIG,
-    ACPI_ADR_SPACE_EC,
-    ACPI_ADR_SPACE_SMBUS,
-    ACPI_ADR_SPACE_CMOS,
-    ACPI_ADR_SPACE_PCI_BAR_TARGET,
-    ACPI_ADR_SPACE_IPMI,
-    ACPI_ADR_SPACE_DATA_TABLE,
-    ACPI_ADR_SPACE_FIXED_HARDWARE
-};
-
-/* Global handler information */
-
-typedef struct acpi_handler_info
-{
-    void                    *Handler;
-    const char              *Name;
-
-} ACPI_HANDLER_INFO;
-
-ACPI_HANDLER_INFO           HandlerList[] =
-{
-    {&AcpiGbl_SystemNotify.Handler,     "System Notifications"},
-    {&AcpiGbl_DeviceNotify.Handler,     "Device Notifications"},
-    {&AcpiGbl_TableHandler,             "ACPI Table Events"},
-    {&AcpiGbl_ExceptionHandler,         "Control Method Exceptions"},
-    {&AcpiGbl_InterfaceHandler,         "OSI Invocations"}
-};
-
-
 void
 AcpiDbDisplayHandlers (
     void)
@@ -956,9 +961,9 @@
     ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
     if (ObjDesc)
     {
-        for (i = 0; i < ACPI_ARRAY_LENGTH (SpaceIdList); i++)
+        for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_SpaceIdList); i++)
         {
-            SpaceId = SpaceIdList[i];
+            SpaceId = AcpiGbl_SpaceIdList[i];
             HandlerObj = ObjDesc->Device.Handler;
 
             AcpiOsPrintf (ACPI_PREDEFINED_PREFIX,
@@ -1008,13 +1013,13 @@
 
     AcpiOsPrintf ("\nMiscellaneous Global Handlers:\n");
 
-    for (i = 0; i < ACPI_ARRAY_LENGTH (HandlerList); i++)
+    for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiGbl_HandlerList); i++)
     {
-        AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, HandlerList[i].Name);
-        if (HandlerList[i].Handler)
+        AcpiOsPrintf (ACPI_HANDLER_NAME_STRING, AcpiGbl_HandlerList[i].Name);
+        if (AcpiGbl_HandlerList[i].Handler)
         {
             AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING, "User",
-                HandlerList[i].Handler);
+                AcpiGbl_HandlerList[i].Handler);
         }
         else
         {
--- a/sys/external/bsd/acpica/dist/debugger/dbexec.c	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbexec.c	Tue Jun 28 09:04:29 2011 +0000
@@ -53,7 +53,8 @@
         ACPI_MODULE_NAME    ("dbexec")
 
 
-static ACPI_DB_METHOD_INFO  AcpiGbl_DbMethodInfo;
+static ACPI_DB_METHOD_INFO          AcpiGbl_DbMethodInfo;
+#define DB_DEFAULT_PKG_ELEMENTS     33
 
 /* Local prototypes */
 
@@ -81,6 +82,348 @@
     void                    *Context,
     void                    **ReturnValue);
 
+static ACPI_STATUS
+AcpiDbHexCharToValue (
+    int                     HexChar,
+    UINT8                   *ReturnValue);
+
+static ACPI_STATUS
+AcpiDbConvertToPackage (
+    char                    *String,
+    ACPI_OBJECT             *Object);
+
+static ACPI_STATUS
+AcpiDbConvertToObject (
+    ACPI_OBJECT_TYPE        Type,
+    char                    *String,
+    ACPI_OBJECT             *Object);
+
+static void
+AcpiDbDeleteObjects (
+    UINT32                  Count,
+    ACPI_OBJECT             *Objects);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbHexCharToValue
+ *
+ * PARAMETERS:  HexChar             - Ascii Hex digit, 0-9|a-f|A-F
+ *              ReturnValue         - Where the converted value is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Convert a single hex character to a 4-bit number (0-16).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbHexCharToValue (
+    int                     HexChar,
+    UINT8                   *ReturnValue)
+{
+    UINT8                   Value;
+
+
+    /* Digit must be ascii [0-9a-fA-F] */
+
+    if (!ACPI_IS_XDIGIT (HexChar))
+    {
+        return (AE_BAD_HEX_CONSTANT);
+    }
+
+    if (HexChar <= 0x39)
+    {
+        Value = (UINT8) (HexChar - 0x30);
+    }
+    else
+    {
+        Value = (UINT8) (ACPI_TOUPPER (HexChar) - 0x37);
+    }
+
+    *ReturnValue = Value;
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbHexByteToBinary
+ *
+ * PARAMETERS:  HexByte             - Double hex digit (0x00 - 0xFF) in format:
+ *                                    HiByte then LoByte.
+ *              ReturnValue         - Where the converted value is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Convert two hex characters to an 8 bit number (0 - 255).
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbHexByteToBinary (
+    char                    *HexByte,
+    UINT8                   *ReturnValue)
+{
+    UINT8                   Local0;
+    UINT8                   Local1;
+    ACPI_STATUS             Status;
+
+
+    /* High byte */
+
+    Status = AcpiDbHexCharToValue (HexByte[0], &Local0);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
+
+    /* Low byte */
+
+    Status = AcpiDbHexCharToValue (HexByte[1], &Local1);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
+
+    *ReturnValue = (UINT8) ((Local0 << 4) | Local1);
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbConvertToBuffer
+ *
+ * PARAMETERS:  String              - Input string to be converted
+ *              Object              - Where the buffer object is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Convert a string to a buffer object. String is treated a list
+ *              of buffer elements, each separated by a space or comma.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbConvertToBuffer (
+    char                    *String,
+    ACPI_OBJECT             *Object)
+{
+    UINT32                  i;
+    UINT32                  j;
+    UINT32                  Length;
+    UINT8                   *Buffer;
+    ACPI_STATUS             Status;
+
+
+    /* Generate the final buffer length */
+
+    for (i = 0, Length = 0; String[i];)
+    {
+        i+=2;
+        Length++;
+
+        while (String[i] &&
+              ((String[i] == ',') || (String[i] == ' ')))
+        {
+            i++;
+        }
+    }
+
+    Buffer = ACPI_ALLOCATE (Length);
+    if (!Buffer)
+    {
+        return (AE_NO_MEMORY);
+    }
+
+    /* Convert the command line bytes to the buffer */
+
+    for (i = 0, j = 0; String[i];)
+    {
+        Status = AcpiDbHexByteToBinary (&String[i], &Buffer[j]);
+        if (ACPI_FAILURE (Status))
+        {
+            ACPI_FREE (Buffer);
+            return (Status);
+        }
+
+        j++;
+        i+=2;
+        while (String[i] &&
+              ((String[i] == ',') || (String[i] == ' ')))
+        {
+            i++;
+        }
+    }
+
+    Object->Type = ACPI_TYPE_BUFFER;
+    Object->Buffer.Pointer = Buffer;
+    Object->Buffer.Length = Length;
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbConvertToPackage
+ *
+ * PARAMETERS:  String              - Input string to be converted
+ *              Object              - Where the package object is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Convert a string to a package object. Handles nested packages
+ *              via recursion with AcpiDbConvertToObject.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbConvertToPackage (
+    char                    *String,
+    ACPI_OBJECT             *Object)
+{
+    char                    *This;
+    char                    *Next;
+    UINT32                  i;
+    ACPI_OBJECT_TYPE        Type;
+    ACPI_OBJECT             *Elements;
+    ACPI_STATUS             Status;
+
+
+    Elements = ACPI_ALLOCATE_ZEROED (
+        DB_DEFAULT_PKG_ELEMENTS * sizeof (ACPI_OBJECT));
+
+    This = String;
+    for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++)
+    {
+        This = AcpiDbGetNextToken (This, &Next, &Type);
+        if (!This)
+        {
+            break;
+        }
+
+        /* Recursive call to convert each package element */
+
+        Status = AcpiDbConvertToObject (Type, This, &Elements[i]);
+        if (ACPI_FAILURE (Status))
+        {
+            AcpiDbDeleteObjects (i + 1, Elements);
+            ACPI_FREE (Elements);
+            return (Status);
+        }
+
+        This = Next;
+    }
+
+    Object->Type = ACPI_TYPE_PACKAGE;
+    Object->Package.Count = i;
+    Object->Package.Elements = Elements;
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbConvertToObject
+ *
+ * PARAMETERS:  Type                - Object type as determined by parser
+ *              String              - Input string to be converted
+ *              Object              - Where the new object is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Convert a typed and tokenized string to an ACPI_OBJECT. Typing:
+ *              1) String objects were surrounded by quotes.
+ *              2) Buffer objects were surrounded by parentheses.
+ *              3) Package objects were surrounded by brackets "[]".
+ *              4) All standalone tokens are treated as integers.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiDbConvertToObject (
+    ACPI_OBJECT_TYPE        Type,
+    char                    *String,
+    ACPI_OBJECT             *Object)
+{
+    ACPI_STATUS             Status = AE_OK;
+
+
+    switch (Type)
+    {
+    case ACPI_TYPE_STRING:
+        Object->Type = ACPI_TYPE_STRING;
+        Object->String.Pointer = String;
+        Object->String.Length = (UINT32) ACPI_STRLEN (String);
+        break;
+
+    case ACPI_TYPE_BUFFER:
+        Status = AcpiDbConvertToBuffer (String, Object);
+        break;
+
+    case ACPI_TYPE_PACKAGE:
+        Status = AcpiDbConvertToPackage (String, Object);
+        break;
+
+    default:
+        Object->Type = ACPI_TYPE_INTEGER;
+        Status = AcpiUtStrtoul64 (String, 16, &Object->Integer.Value);
+        break;
+    }
+
+    return (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDbDeleteObjects
+ *
+ * PARAMETERS:  Count               - Count of objects in the list
+ *              Objects             - Array of ACPI_OBJECTs to be deleted
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Delete a list of ACPI_OBJECTS. Handles packages and nested
+ *              packages via recursion.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDbDeleteObjects (
+    UINT32                  Count,
+    ACPI_OBJECT             *Objects)
+{
+    UINT32                  i;
+
+
+    for (i = 0; i < Count; i++)
+    {
+        switch (Objects[i].Type)
+        {
+        case ACPI_TYPE_BUFFER:
+            ACPI_FREE (Objects[i].Buffer.Pointer);
+            break;
+
+        case ACPI_TYPE_PACKAGE:
+
+            /* Recursive call to delete package elements */
+
+            AcpiDbDeleteObjects (Objects[i].Package.Count,
+                Objects[i].Package.Elements);
+
+            /* Free the elements array */
+
+            ACPI_FREE (Objects[i].Package.Elements);
+            break;
+
+        default:
+            break;
+        }
+    }
+}
+
 
 /*******************************************************************************
  *
@@ -104,8 +447,8 @@
     ACPI_OBJECT_LIST        ParamObjects;
     ACPI_OBJECT             Params[ACPI_METHOD_NUM_ARGS];
     ACPI_HANDLE             Handle;
+    ACPI_DEVICE_INFO        *ObjInfo;
     UINT32                  i;
-    ACPI_DEVICE_INFO        *ObjInfo;
 
 
     ACPI_FUNCTION_TRACE (DbExecuteMethod);
@@ -139,25 +482,37 @@
     {
         /* Are there arguments to the method? */
 
+        i = 0;
         if (Info->Args && Info->Args[0])
         {
-            for (i = 0; Info->Args[i] &&
+            /* Get arguments passed on the command line */
+
+            for (; Info->Args[i] &&
                 (i < ACPI_METHOD_NUM_ARGS) &&
                 (i < ObjInfo->ParamCount);
                 i++)
             {
-                Params[i].Type          = ACPI_TYPE_INTEGER;
-                Params[i].Integer.Value = ACPI_STRTOUL (Info->Args[i], NULL, 16);
-            }
+                /* Convert input string (token) to an actual ACPI_OBJECT */
 
-            ParamObjects.Pointer = Params;
-            ParamObjects.Count   = i;
+                Status = AcpiDbConvertToObject (Info->Types[i],
+                    Info->Args[i], &Params[i]);
+                if (ACPI_FAILURE (Status))
+                {
+                    ACPI_EXCEPTION ((AE_INFO, Status,
+                        "While parsing method arguments"));
+                    goto Cleanup;
+                }
+            }
         }
-        else
+
+        /* Create additional "default" parameters as needed */
+
+        if (i < ObjInfo->ParamCount)
         {
-            /* Setup default parameters */
+            AcpiOsPrintf ("Adding %u arguments containing default values\n",
+                ObjInfo->ParamCount - i);
 
-            for (i = 0; i < ObjInfo->ParamCount; i++)
+            for (; i < ObjInfo->ParamCount; i++)
             {
                 switch (i)
                 {
@@ -181,14 +536,12 @@
                     break;
                 }
             }
+        }
 
-            ParamObjects.Pointer     = Params;
-            ParamObjects.Count       = ObjInfo->ParamCount;
-        }
+        ParamObjects.Count = ObjInfo->ParamCount;
+        ParamObjects.Pointer = Params;
     }
 
-    ACPI_FREE (ObjInfo);
-
     /* Prepare for a return object of arbitrary size */
 
     ReturnObj->Pointer = AcpiGbl_DbBuffer;
@@ -198,7 +551,7 @@
 
     AcpiGbl_MethodExecuting = TRUE;
     Status = AcpiEvaluateObject (NULL,
-                Info->Pathname, &ParamObjects, ReturnObj);
+        Info->Pathname, &ParamObjects, ReturnObj);
 
     AcpiGbl_CmSingleStep = FALSE;
     AcpiGbl_MethodExecuting = FALSE;
@@ -206,16 +559,20 @@
     if (ACPI_FAILURE (Status))
     {
         ACPI_EXCEPTION ((AE_INFO, Status,
-        "while executing %s from debugger", Info->Pathname));
+            "while executing %s from debugger", Info->Pathname));
 
         if (Status == AE_BUFFER_OVERFLOW)
         {
             ACPI_ERROR ((AE_INFO,
-            "Possible overflow of internal debugger buffer (size 0x%X needed 0x%X)",
+                "Possible overflow of internal debugger buffer (size 0x%X needed 0x%X)",
                 ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length));
         }
     }
 
+Cleanup:
+    AcpiDbDeleteObjects (ObjInfo->ParamCount, Params);
+    ACPI_FREE (ObjInfo);
+
     return_ACPI_STATUS (Status);
 }
 
@@ -380,6 +737,7 @@
 AcpiDbExecute (
     char                    *Name,
     char                    **Args,
+    ACPI_OBJECT_TYPE        *Types,
     UINT32                  Flags)
 {
     ACPI_STATUS             Status;
@@ -417,6 +775,7 @@
         AcpiUtStrupr (NameString);
         AcpiGbl_DbMethodInfo.Name = NameString;
         AcpiGbl_DbMethodInfo.Args = Args;
+        AcpiGbl_DbMethodInfo.Types = Types;
         AcpiGbl_DbMethodInfo.Flags = Flags;
 
         ReturnObj.Pointer = NULL;
@@ -529,6 +888,8 @@
     LocalInfo.Arguments[2] = LocalInfo.IndexOfThreadStr;
     LocalInfo.Arguments[3] = NULL;
 
+    LocalInfo.Types = LocalInfo.ArgTypes;
+
     (void) AcpiOsSignalSemaphore (Info->InfoGate, 1);
 
     for (i = 0; i < Info->NumLoops; i++)
@@ -696,6 +1057,12 @@
     AcpiGbl_DbMethodInfo.Arguments[1] = AcpiGbl_DbMethodInfo.IdOfThreadStr;
     AcpiGbl_DbMethodInfo.Arguments[2] = AcpiGbl_DbMethodInfo.IndexOfThreadStr;
     AcpiGbl_DbMethodInfo.Arguments[3] = NULL;
+
+    AcpiGbl_DbMethodInfo.Types = AcpiGbl_DbMethodInfo.ArgTypes;
+    AcpiGbl_DbMethodInfo.ArgTypes[0] = ACPI_TYPE_INTEGER;
+    AcpiGbl_DbMethodInfo.ArgTypes[1] = ACPI_TYPE_INTEGER;
+    AcpiGbl_DbMethodInfo.ArgTypes[2] = ACPI_TYPE_INTEGER;
+
     AcpiDbUInt32ToHexString (NumThreads, AcpiGbl_DbMethodInfo.NumThreadsStr);
 
     AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);
--- a/sys/external/bsd/acpica/dist/debugger/dbinput.c	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbinput.c	Tue Jun 28 09:04:29 2011 +0000
@@ -54,11 +54,6 @@
 
 /* Local prototypes */
 
-static char *
-AcpiDbGetNextToken (
-    char                    *String,
-    char                    **Next);
-
 static UINT32
 AcpiDbGetLine (
     char                    *InputBuffer);
@@ -285,6 +280,10 @@
     AcpiOsPrintf ("  Call                                Run to next control method invocation\n");
     AcpiOsPrintf ("  Debug <Namepath> [Arguments]        Single Step a control method\n");
     AcpiOsPrintf ("  Execute <Namepath> [Arguments]      Execute control method\n");
+    AcpiOsPrintf ("     Hex Integer                      Integer method argument\n");
+    AcpiOsPrintf ("     \"Ascii String\"                   String method argument\n");
+    AcpiOsPrintf ("     (Byte List)                      Buffer method argument\n");
+    AcpiOsPrintf ("     [Package Element List]           Package method argument\n");
     AcpiOsPrintf ("  Go                                  Allow method to run to completion\n");
     AcpiOsPrintf ("  Information                         Display info about the current method\n");
     AcpiOsPrintf ("  Into                                Step into (not over) a method call\n");
@@ -318,12 +317,15 @@
  *
  ******************************************************************************/
 
-static char *
+char *
 AcpiDbGetNextToken (
     char                    *String,
-    char                    **Next)
+    char                    **Next,
+    ACPI_OBJECT_TYPE        *ReturnType)
 {
     char                    *Start;
+    UINT32                  Depth;
+    ACPI_OBJECT_TYPE        Type = ACPI_TYPE_INTEGER;
 
 
     /* At end of buffer? */
@@ -333,7 +335,7 @@
         return (NULL);
     }
 
-    /* Get rid of any spaces at the beginning */
+    /* Remove any spaces at the beginning */
 
     if (*String == ' ')
     {
@@ -348,22 +350,88 @@
         }
     }
 
-    if (*String == '"')
+    switch (*String)
     {
+    case '"':
+
         /* This is a quoted string, scan until closing quote */
 
         String++;
         Start = String;
+        Type = ACPI_TYPE_STRING;
 
-        /* Find end of token */
+        /* Find end of string */
 
         while (*String && (*String != '"'))
         {
             String++;
         }
-    }
-    else
-    {
+        break;
+
+    case '(':
+
+        /* This is the start of a buffer, scan until closing paren */
+
+        String++;
+        Start = String;
+        Type = ACPI_TYPE_BUFFER;
+
+        /* Find end of buffer */
+
+        while (*String && (*String != ')'))
+        {
+            String++;
+        }
+        break;
+
+    case '[':
+
+        /* This is the start of a package, scan until closing bracket */
+
+        String++;
+        Depth = 1;
+        Start = String;
+        Type = ACPI_TYPE_PACKAGE;
+
+        /* Find end of package (closing bracket) */
+
+        while (*String)
+        {
+            /* Handle String package elements */
+
+            if (*String == '"')
+            {
+                /* Find end of string */
+
+                String++;
+                while (*String && (*String != '"'))
+                {
+                    String++;
+                }
+                if (!(*String))
+                {
+                    break;
+                }
+            }
+            else if (*String == '[')
+            {
+                Depth++;         /* A nested package declaration */
+            }
+            else if (*String == ']')
+            {
+                Depth--;
+                if (Depth == 0) /* Found final package closing bracket */
+                {
+                    break;
+                }
+            }
+
+            String++;
+        }
+        break;
+
+    default:
+
         Start = String;
 
         /* Find end of token */
@@ -372,6 +440,7 @@
         {
             String++;
         }
+        break;
     }
 
     if (!(*String))
@@ -384,6 +453,7 @@
         *Next = String + 1;
     }
 
+    *ReturnType = Type;
     return (Start);
 }
 
@@ -416,7 +486,8 @@
     This = AcpiGbl_DbParsedBuf;
     for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
     {
-        AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next);
+        AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next,
+            &AcpiGbl_DbArgTypes[i]);
         if (!AcpiGbl_DbArgs[i])
         {
             break;
@@ -575,7 +646,8 @@
         break;
 
     case CMD_DEBUG:
-        AcpiDbExecute (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], EX_SINGLE_STEP);
+        AcpiDbExecute (AcpiGbl_DbArgs[1],
+            &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_SINGLE_STEP);
         break;
 
     case CMD_DISASSEMBLE:
@@ -601,7 +673,7 @@
 
     case CMD_EXECUTE:
         AcpiDbExecute (AcpiGbl_DbArgs[1],
-            &AcpiGbl_DbArgs[2], EX_NO_SINGLE_STEP);
+            &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_NO_SINGLE_STEP);
         break;
 
     case CMD_FIND:
@@ -961,7 +1033,13 @@
 
         /* Get the user input line */
 
-        (void) AcpiOsGetLine (AcpiGbl_DbLineBuf);
+        Status = AcpiOsGetLine (AcpiGbl_DbLineBuf,
+            ACPI_DB_LINE_BUFFER_SIZE, NULL);
+        if (ACPI_FAILURE (Status))
+        {
+            ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line"));
+            return (Status);
+        }
 
         /* Check for single or multithreaded debug */
 
--- a/sys/external/bsd/acpica/dist/debugger/dbutils.c	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/debugger/dbutils.c	Tue Jun 28 09:04:29 2011 +0000
@@ -382,7 +382,7 @@
     UINT32                  Value,
     char                    *Buffer)
 {
-    UINT8                   i;
+    int                     i;
 
 
     if (Value == 0)
@@ -391,10 +391,9 @@
         return;
     }
 
-    ACPI_STRCPY (Buffer, "0x");
-    Buffer[10] = '\0';
+    Buffer[8] = '\0';
 
-    for (i = 9; i > 1; i--)
+    for (i = 7; i >= 0; i--)
     {
         Buffer[i] = Converter [Value & 0x0F];
         Value = Value >> 4;
--- a/sys/external/bsd/acpica/dist/events/evrgnini.c	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/events/evrgnini.c	Tue Jun 28 09:04:29 2011 +0000
@@ -696,7 +696,7 @@
                         }
                     }
 
-                    Status = AcpiEvExecuteRegMethod (RegionObj, 1);
+                    Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT);
 
                     if (AcpiNsLocked)
                     {
--- a/sys/external/bsd/acpica/dist/include/acdebug.h	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/include/acdebug.h	Tue Jun 28 09:04:29 2011 +0000
@@ -277,6 +277,7 @@
 AcpiDbExecute (
     char                    *Name,
     char                    **Args,
+    ACPI_OBJECT_TYPE        *Types,
     UINT32                  Flags);
 
 void
@@ -357,6 +358,12 @@
     char                    Prompt,
     ACPI_PARSE_OBJECT       *Op);
 
+char *
+AcpiDbGetNextToken (
+    char                    *String,
+    char                    **Next,
+    ACPI_OBJECT_TYPE        *ReturnType);
+
 
 /*
  * dbstats - Generation and display of ACPI table statistics
--- a/sys/external/bsd/acpica/dist/include/acdisasm.h	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/include/acdisasm.h	Tue Jun 28 09:04:29 2011 +0000
@@ -129,7 +129,8 @@
 #define ACPI_DMT_DEVICE_PATH            44
 #define ACPI_DMT_LABEL                  45
 #define ACPI_DMT_BUF7                   46
-
+#define ACPI_DMT_BUF128                 47
+#define ACPI_DMT_SLIC                   48
 
 typedef
 void (*ACPI_DMTABLE_HANDLER) (
@@ -262,7 +263,9 @@
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSbst[];
-extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlic[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlicHdr[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlic0[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlic1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSlit[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSpcr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSpmi[];
@@ -379,6 +382,10 @@
     ACPI_TABLE_HEADER       *Table);
 
 void
+AcpiDmDumpSlic (
+    ACPI_TABLE_HEADER       *Table);
+
+void
 AcpiDmDumpSlit (
     ACPI_TABLE_HEADER       *Table);
 
--- a/sys/external/bsd/acpica/dist/include/acglobal.h	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/include/acglobal.h	Tue Jun 28 09:04:29 2011 +0000
@@ -128,6 +128,12 @@
  */
 UINT8       ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE);
 
+/*
+ * Disable runtime checking and repair of values returned by control methods.
+ * Use only if the repair is causing a problem on a particular machine.
+ */
+UINT8       ACPI_INIT_GLOBAL (AcpiGbl_DisableAutoRepair, FALSE);
+
 
 /* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
 
@@ -190,13 +196,16 @@
 
 /*
  * Global lock mutex is an actual AML mutex object
- * Global lock semaphore works in conjunction with the HW global lock
+ * Global lock semaphore works in conjunction with the actual global lock
+ * Global lock spinlock is used for "pending" handshake
  */
 ACPI_EXTERN ACPI_OPERAND_OBJECT        *AcpiGbl_GlobalLockMutex;
 ACPI_EXTERN ACPI_SEMAPHORE              AcpiGbl_GlobalLockSemaphore;
+ACPI_EXTERN ACPI_SPINLOCK               AcpiGbl_GlobalLockPendingLock;
 ACPI_EXTERN UINT16                      AcpiGbl_GlobalLockHandle;
 ACPI_EXTERN BOOLEAN                     AcpiGbl_GlobalLockAcquired;
 ACPI_EXTERN BOOLEAN                     AcpiGbl_GlobalLockPresent;
+ACPI_EXTERN BOOLEAN                     AcpiGbl_GlobalLockPending;
 
 /*
  * Spinlocks are used for interfaces that can be possibly called at
@@ -422,10 +431,11 @@
 ACPI_EXTERN BOOLEAN                     AcpiGbl_DbOpt_NoRegionSupport;
 
 ACPI_EXTERN char                       *AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS];
-ACPI_EXTERN char                        AcpiGbl_DbLineBuf[80];
-ACPI_EXTERN char                        AcpiGbl_DbParsedBuf[80];
-ACPI_EXTERN char                        AcpiGbl_DbScopeBuf[40];
-ACPI_EXTERN char                        AcpiGbl_DbDebugFilename[40];
+ACPI_EXTERN ACPI_OBJECT_TYPE            AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS];
+ACPI_EXTERN char                        AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_EXTERN char                        AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE];
+ACPI_EXTERN char                        AcpiGbl_DbScopeBuf[80];
+ACPI_EXTERN char                        AcpiGbl_DbDebugFilename[80];
 ACPI_EXTERN BOOLEAN                     AcpiGbl_DbOutputToFile;
 ACPI_EXTERN char                       *AcpiGbl_DbBuffer;
 ACPI_EXTERN char                       *AcpiGbl_DbFilename;
--- a/sys/external/bsd/acpica/dist/include/aclocal.h	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/include/aclocal.h	Tue Jun 28 09:04:29 2011 +0000
@@ -410,6 +410,7 @@
     char                        *Pathname;
     const ACPI_PREDEFINED_INFO  *Predefined;
     union acpi_operand_object   *ParentPackage;
+    ACPI_NAMESPACE_NODE         *Node;
     UINT32                      Flags;
     UINT8                       NodeFlags;
 
@@ -1197,6 +1198,7 @@
     UINT32                          NumLoops;
     char                            Pathname[128];
     char                            **Args;
+    ACPI_OBJECT_TYPE                *Types;
 
     /*
      * Arguments to be passed to method for the command
@@ -1205,6 +1207,7 @@
      *   Index of current thread inside all them created.
      */
     char                            InitArgs;
+    ACPI_OBJECT_TYPE                ArgTypes[4];
     char                            *Arguments[4];
     char                            NumThreadsStr[11];
     char                            IdOfThreadStr[11];
--- a/sys/external/bsd/acpica/dist/include/acpiosxf.h	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/include/acpiosxf.h	Tue Jun 28 09:04:29 2011 +0000
@@ -376,9 +376,11 @@
 /*
  * Debug input
  */
-UINT32
+ACPI_STATUS
 AcpiOsGetLine (
-    char                    *Buffer);
+    char                    *Buffer,
+    UINT32                  BufferLength,
+    UINT32                  *BytesRead);
 
 
 /*
--- a/sys/external/bsd/acpica/dist/include/acpixf.h	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/include/acpixf.h	Tue Jun 28 09:04:29 2011 +0000
@@ -48,7 +48,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20110211
+#define ACPI_CA_VERSION                 0x20110623
 
 #include "actypes.h"
 #include "actbl.h"
@@ -76,6 +76,7 @@
 extern UINT8                AcpiGbl_EnableAmlDebugObject;
 extern UINT8                AcpiGbl_CopyDsdtLocally;
 extern UINT8                AcpiGbl_TruncateIoAddresses;
+extern UINT8                AcpiGbl_DisableAutoRepair;
 
 
 /*
--- a/sys/external/bsd/acpica/dist/include/actypes.h	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/include/actypes.h	Tue Jun 28 09:04:29 2011 +0000
@@ -717,9 +717,24 @@
 #define ACPI_ADR_SPACE_CMOS             (ACPI_ADR_SPACE_TYPE) 5
 #define ACPI_ADR_SPACE_PCI_BAR_TARGET   (ACPI_ADR_SPACE_TYPE) 6
 #define ACPI_ADR_SPACE_IPMI             (ACPI_ADR_SPACE_TYPE) 7
-#define ACPI_ADR_SPACE_DATA_TABLE       (ACPI_ADR_SPACE_TYPE) 8
-#define ACPI_ADR_SPACE_FIXED_HARDWARE   (ACPI_ADR_SPACE_TYPE) 127
+
+#define ACPI_NUM_PREDEFINED_REGIONS     8
 
+/*
+ * Special Address Spaces
+ *
+ * Note: A Data Table region is a special type of operation region
+ * that has its own AML opcode. However, internally, the AML
+ * interpreter simply creates an operation region with an an address
+ * space type of ACPI_ADR_SPACE_DATA_TABLE.
+ */
+#define ACPI_ADR_SPACE_DATA_TABLE       (ACPI_ADR_SPACE_TYPE) 0x7E /* Internal to ACPICA only */
+#define ACPI_ADR_SPACE_FIXED_HARDWARE   (ACPI_ADR_SPACE_TYPE) 0x7F
+
+/* Values for _REG connection code */
+
+#define ACPI_REG_DISCONNECT             0
+#define ACPI_REG_CONNECT                1
 
 /*
  * BitRegister IDs
--- a/sys/external/bsd/acpica/dist/namespace/nsrepair2.c	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/namespace/nsrepair2.c	Tue Jun 28 09:04:29 2011 +0000
@@ -555,8 +555,23 @@
 {
     ACPI_OPERAND_OBJECT     *ReturnObject = *ReturnObjectPtr;
     ACPI_STATUS             Status;
+    ACPI_NAMESPACE_NODE     *Node;
 
 
+    /*
+     * We can only sort the _TSS return package if there is no _PSS in the
+     * same scope. This is because if _PSS is present, the ACPI specification
+     * dictates that the _TSS Power Dissipation field is to be ignored, and
+     * therefore some BIOSs leave garbage values in the _TSS Power field(s).
+     * In this case, it is best to just return the _TSS package as-is.
+     * (May, 2011)
+     */
+    Status = AcpiNsGetNode (Data->Node, "^_PSS", ACPI_NS_NO_UPSEARCH, &Node);
+    if (ACPI_SUCCESS (Status))
+    {
+        return (AE_OK);
+    }
+
     Status = AcpiNsCheckSortedList (Data, ReturnObject, 5, 1,
 	ACPI_SORT_DESCENDING, __UNCONST("PowerDissipation"));
 
--- a/sys/external/bsd/acpica/dist/osunixxf.c	Tue Jun 28 09:01:37 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1195 +0,0 @@
-/******************************************************************************
- *
- * Module Name: osunixxf - UNIX OSL interfaces
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2011, Intel Corp.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- *    substantially similar to the "NO WARRANTY" disclaimer below
- *    ("Disclaimer") and any redistribution must be conditioned upon
- *    including a substantially similar Disclaimer requirement for further
- *    binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- *    of any contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-
-/*
- * These interfaces are required in order to compile the ASL compiler and the
- * various ACPICA tools under Linux or other Unix-like system.
- *
- * Note: Use #define __APPLE__ for OS X generation.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <semaphore.h>
-#include <pthread.h>
-#include <errno.h>
-
-#include "acpi.h"
-#include "accommon.h"
-#include "amlcode.h"
-#include "acparser.h"
-#include "acdebug.h"
-
-#define _COMPONENT          ACPI_OS_SERVICES
-        ACPI_MODULE_NAME    ("osunixxf")
-
-
-extern FILE                    *AcpiGbl_DebugFile;
-FILE                           *AcpiGbl_OutputFile;
-
-
-/* Upcalls to AcpiExec */
-
-ACPI_PHYSICAL_ADDRESS
-AeLocalGetRootPointer (
-    void);
-
-void
-AeTableOverride (
-    ACPI_TABLE_HEADER       *ExistingTable,
-    ACPI_TABLE_HEADER       **NewTable);
-
-typedef void* (*PTHREAD_CALLBACK) (void *);
-
-/* Apple-specific */
-
-#ifdef __APPLE__
-#define sem_destroy         sem_close
-#endif
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsInitialize, AcpiOsTerminate
- *
- * PARAMETERS:  None
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Init and terminate. Nothing to do.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsInitialize (
-    void)
-{
-
-    AcpiGbl_OutputFile = stdout;
-    return (AE_OK);
-}
-
-
-ACPI_STATUS
-AcpiOsTerminate (
-    void)
-{
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsGetRootPointer
- *
- * PARAMETERS:  None
- *
- * RETURN:      RSDP physical address
- *
- * DESCRIPTION: Gets the ACPI root pointer (RSDP)
- *
- *****************************************************************************/
-
-ACPI_PHYSICAL_ADDRESS
-AcpiOsGetRootPointer (
-    void)
-{
-
-    return (AeLocalGetRootPointer ());
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsPredefinedOverride
- *
- * PARAMETERS:  InitVal             - Initial value of the predefined object
- *              NewVal              - The new value for the object
- *
- * RETURN:      Status, pointer to value. Null pointer returned if not
- *              overriding.
- *
- * DESCRIPTION: Allow the OS to override predefined names
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsPredefinedOverride (
-    const ACPI_PREDEFINED_NAMES *InitVal,
-    ACPI_STRING                 *NewVal)
-{
-
-    if (!InitVal || !NewVal)
-    {
-        return (AE_BAD_PARAMETER);
-    }
-
-    *NewVal = NULL;
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsTableOverride
- *
- * PARAMETERS:  ExistingTable       - Header of current table (probably
- *                                    firmware)
- *              NewTable            - Where an entire new table is returned.
- *
- * RETURN:      Status, pointer to new table. Null pointer returned if no
- *              table is available to override
- *
- * DESCRIPTION: Return a different version of a table if one is available
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsTableOverride (
-    ACPI_TABLE_HEADER       *ExistingTable,
-    ACPI_TABLE_HEADER       **NewTable)
-{
-
-    if (!ExistingTable || !NewTable)
-    {
-        return (AE_BAD_PARAMETER);
-    }
-
-    *NewTable = NULL;
-
-#ifdef ACPI_EXEC_APP
-
-    AeTableOverride (ExistingTable, NewTable);
-    return (AE_OK);
-#else
-
-    return (AE_NO_ACPI_TABLES);
-#endif
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsRedirectOutput
- *
- * PARAMETERS:  Destination         - An open file handle/pointer
- *
- * RETURN:      None
- *
- * DESCRIPTION: Causes redirect of AcpiOsPrintf and AcpiOsVprintf
- *
- *****************************************************************************/
-
-void
-AcpiOsRedirectOutput (
-    void                    *Destination)
-{
-
-    AcpiGbl_OutputFile = Destination;
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsPrintf
- *
- * PARAMETERS:  fmt, ...            - Standard printf format
- *
- * RETURN:      None
- *
- * DESCRIPTION: Formatted output
- *
- *****************************************************************************/
-
-void ACPI_INTERNAL_VAR_XFACE
-AcpiOsPrintf (
-    const char              *Fmt,
-    ...)
-{
-    va_list                 Args;
-
-
-    va_start (Args, Fmt);
-    AcpiOsVprintf (Fmt, Args);
-    va_end (Args);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsVprintf
- *
- * PARAMETERS:  fmt                 - Standard printf format
- *              args                - Argument list
- *
- * RETURN:      None
- *
- * DESCRIPTION: Formatted output with argument list pointer
- *
- *****************************************************************************/
-
-void
-AcpiOsVprintf (
-    const char              *Fmt,
-    va_list                 Args)
-{
-    INT32                   Count = 0;
-    UINT8                   Flags;
-
-
-    Flags = AcpiGbl_DbOutputFlags;
-    if (Flags & ACPI_DB_REDIRECTABLE_OUTPUT)
-    {
-        /* Output is directable to either a file (if open) or the console */
-
-        if (AcpiGbl_DebugFile)
-        {
-            /* Output file is open, send the output there */
-
-            Count = vfprintf (AcpiGbl_DebugFile, Fmt, Args);
-        }
-        else
-        {
-            /* No redirection, send output to console (once only!) */
-
-            Flags |= ACPI_DB_CONSOLE_OUTPUT;
-        }
-    }
-
-    if (Flags & ACPI_DB_CONSOLE_OUTPUT)
-    {
-        Count = vfprintf (AcpiGbl_OutputFile, Fmt, Args);
-    }
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsGetLine
- *
- * PARAMETERS:  fmt                 - Standard printf format
- *              args                - Argument list
- *
- * RETURN:      Actual bytes read
- *
- * DESCRIPTION: Formatted input with argument list pointer
- *
- *****************************************************************************/
-
-UINT32
-AcpiOsGetLine (
-    char                    *Buffer)
-{
-    UINT8                   Temp;
-    UINT32                  i;
-
-
-    for (i = 0; ; i++)
-    {
-        scanf ("%1c", &Temp);
-        if (!Temp || Temp == '\n')
-        {
-            break;
-        }
-
-        Buffer [i] = Temp;
-    }
-
-    /* Null terminate the buffer */
-
-    Buffer [i] = 0;
-
-    /* Return the number of bytes in the string */
-
-    return (i);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsMapMemory
- *
- * PARAMETERS:  where               - Physical address of memory to be mapped
- *              length              - How much memory to map
- *
- * RETURN:      Pointer to mapped memory. Null on error.
- *
- * DESCRIPTION: Map physical memory into caller's address space
- *
- *****************************************************************************/
-
-void *
-AcpiOsMapMemory (
-    ACPI_PHYSICAL_ADDRESS   where,
-    ACPI_SIZE               length)
-{
-
-    return (ACPI_TO_POINTER ((ACPI_SIZE) where));
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsUnmapMemory
- *
- * PARAMETERS:  where               - Logical address of memory to be unmapped
- *              length              - How much memory to unmap
- *
- * RETURN:      None.
- *
- * DESCRIPTION: Delete a previously created mapping. Where and Length must
- *              correspond to a previous mapping exactly.
- *
- *****************************************************************************/
-
-void
-AcpiOsUnmapMemory (
-    void                    *where,
-    ACPI_SIZE               length)
-{
-
-    return;
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsAllocate
- *
- * PARAMETERS:  Size                - Amount to allocate, in bytes
- *
- * RETURN:      Pointer to the new allocation. Null on error.
- *
- * DESCRIPTION: Allocate memory. Algorithm is dependent on the OS.
- *
- *****************************************************************************/
-
-void *
-AcpiOsAllocate (
-    ACPI_SIZE               size)
-{
-    void                    *Mem;
-
-
-    Mem = (void *) malloc ((size_t) size);
-    return (Mem);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsFree
- *
- * PARAMETERS:  mem                 - Pointer to previously allocated memory
- *
- * RETURN:      None.
- *
- * DESCRIPTION: Free memory allocated via AcpiOsAllocate
- *
- *****************************************************************************/
-
-void
-AcpiOsFree (
-    void                    *mem)
-{
-
-    free (mem);
-}
-
-
-#ifdef ACPI_SINGLE_THREADED
-/******************************************************************************
- *
- * FUNCTION:    Semaphore stub functions
- *
- * DESCRIPTION: Stub functions used for single-thread applications that do
- *              not require semaphore synchronization. Full implementations
- *              of these functions appear after the stubs.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsCreateSemaphore (
-    UINT32              MaxUnits,
-    UINT32              InitialUnits,
-    ACPI_HANDLE         *OutHandle)
-{
-    *OutHandle = (ACPI_HANDLE) 1;
-    return (AE_OK);
-}
-
-ACPI_STATUS
-AcpiOsDeleteSemaphore (
-    ACPI_HANDLE         Handle)
-{
-    return (AE_OK);
-}
-
-ACPI_STATUS
-AcpiOsWaitSemaphore (
-    ACPI_HANDLE         Handle,
-    UINT32              Units,
-    UINT16              Timeout)
-{
-    return (AE_OK);
-}
-
-ACPI_STATUS
-AcpiOsSignalSemaphore (
-    ACPI_HANDLE         Handle,
-    UINT32              Units)
-{
-    return (AE_OK);
-}
-
-#else
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsCreateSemaphore
- *
- * PARAMETERS:  InitialUnits        - Units to be assigned to the new semaphore
- *              OutHandle           - Where a handle will be returned
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Create an OS semaphore
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsCreateSemaphore (
-    UINT32              MaxUnits,
-    UINT32              InitialUnits,
-    ACPI_HANDLE         *OutHandle)
-{
-    sem_t               *Sem;
-
-
-    if (!OutHandle)
-    {
-        return (AE_BAD_PARAMETER);
-    }
-
-#ifdef __APPLE__
-    {
-        char            *SemaphoreName = tmpnam (NULL);
-
-        Sem = sem_open (SemaphoreName, O_EXCL|O_CREAT, 0755, InitialUnits);
-        if (!Sem)
-        {
-            return (AE_NO_MEMORY);
-        }
-        sem_unlink (SemaphoreName); /* This just deletes the name */
-    }
-
-#else
-    Sem = AcpiOsAllocate (sizeof (sem_t));
-    if (!Sem)
-    {
-        return (AE_NO_MEMORY);
-    }
-
-    if (sem_init (Sem, 0, InitialUnits) == -1)
-    {
-        AcpiOsFree (Sem);
-        return (AE_BAD_PARAMETER);
-    }
-#endif
-
-    *OutHandle = (ACPI_HANDLE) Sem;
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsDeleteSemaphore
- *
- * PARAMETERS:  Handle              - Handle returned by AcpiOsCreateSemaphore
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Delete an OS semaphore
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsDeleteSemaphore (
-    ACPI_HANDLE         Handle)
-{
-    sem_t               *Sem = (sem_t *) Handle;
-
-
-    if (!Sem)
-    {
-        return (AE_BAD_PARAMETER);
-    }
-
-    if (sem_destroy (Sem) == -1)
-    {
-        return (AE_BAD_PARAMETER);
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsWaitSemaphore
- *
- * PARAMETERS:  Handle              - Handle returned by AcpiOsCreateSemaphore
- *              Units               - How many units to wait for
- *              Timeout             - How long to wait
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Wait for units
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsWaitSemaphore (
-    ACPI_HANDLE         Handle,
-    UINT32              Units,
-    UINT16              Timeout)
-{
-    ACPI_STATUS         Status = AE_OK;
-    sem_t               *Sem = (sem_t *) Handle;
-    struct timespec     T;
-
-
-    if (!Sem)
-    {
-        return (AE_BAD_PARAMETER);
-    }
-
-    switch (Timeout)
-    {
-    /*
-     * No Wait:
-     * --------
-     * A zero timeout value indicates that we shouldn't wait - just
-     * acquire the semaphore if available otherwise return AE_TIME
-     * (a.k.a. 'would block').
-     */
-    case 0:
-
-        if (sem_trywait(Sem) == -1)
-        {
-            Status = (AE_TIME);
-        }
-        break;
-
-    /* Wait Indefinitely */
-
-    case ACPI_WAIT_FOREVER:
-
-        if (sem_wait (Sem))
-        {
-            Status = (AE_TIME);
-        }
-        break;
-
-    /* Wait with Timeout */
-
-    default:
-
-        T.tv_sec = Timeout / 1000;
-        T.tv_nsec = (Timeout - (T.tv_sec * 1000)) * 1000000;
-
-#ifdef ACPI_USE_ALTERNATE_TIMEOUT
-        /*
-         * Alternate timeout mechanism for environments where
-         * sem_timedwait is not available or does not work properly.
-         */
-        while (Timeout)
-        {
-            if (sem_trywait (Sem) == 0)
-            {
-                /* Got the semaphore */
-                return (AE_OK);
-            }
-            usleep (1000);  /* one millisecond */
-            Timeout--;
-        }
-        Status = (AE_TIME);
-#else
-
-        if (sem_timedwait (Sem, &T))
-        {
-            Status = (AE_TIME);
-        }
-#endif
-
-        break;
-    }
-
-    return (Status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsSignalSemaphore
- *
- * PARAMETERS:  Handle              - Handle returned by AcpiOsCreateSemaphore
- *              Units               - Number of units to send
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Send units
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsSignalSemaphore (
-    ACPI_HANDLE         Handle,
-    UINT32              Units)
-{
-    sem_t               *Sem = (sem_t *)Handle;
-
-
-    if (!Sem)
-    {
-        return (AE_BAD_PARAMETER);
-    }
-
-    if (sem_post (Sem) == -1)
-    {
-        return (AE_LIMIT);
-    }
-
-    return (AE_OK);
-}
-
-#endif /* ACPI_SINGLE_THREADED */
-
-
-/******************************************************************************
- *
- * FUNCTION:    Spinlock interfaces
- *
- * DESCRIPTION: Map these interfaces to semaphore interfaces
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsCreateLock (
-    ACPI_SPINLOCK           *OutHandle)
-{
-
-    return (AcpiOsCreateSemaphore (1, 1, OutHandle));
-}
-
-
-void
-AcpiOsDeleteLock (
-    ACPI_SPINLOCK           Handle)
-{
-    AcpiOsDeleteSemaphore (Handle);
-}
-
-
-ACPI_CPU_FLAGS
-AcpiOsAcquireLock (
-    ACPI_HANDLE             Handle)
-{
-    AcpiOsWaitSemaphore (Handle, 1, 0xFFFF);
-    return (0);
-}
-
-
-void
-AcpiOsReleaseLock (
-    ACPI_SPINLOCK           Handle,
-    ACPI_CPU_FLAGS          Flags)
-{
-    AcpiOsSignalSemaphore (Handle, 1);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsInstallInterruptHandler
- *
- * PARAMETERS:  InterruptNumber     - Level handler should respond to.
- *              Isr                 - Address of the ACPI interrupt handler
- *              ExceptPtr           - Where status is returned
- *
- * RETURN:      Handle to the newly installed handler.
- *
- * DESCRIPTION: Install an interrupt handler. Used to install the ACPI
- *              OS-independent handler.
- *
- *****************************************************************************/
-
-UINT32
-AcpiOsInstallInterruptHandler (
-    UINT32                  InterruptNumber,
-    ACPI_OSD_HANDLER        ServiceRoutine,
-    void                    *Context)
-{
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsRemoveInterruptHandler
- *
- * PARAMETERS:  Handle              - Returned when handler was installed
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Uninstalls an interrupt handler.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsRemoveInterruptHandler (
-    UINT32                  InterruptNumber,
-    ACPI_OSD_HANDLER        ServiceRoutine)
-{
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsExecute
- *
- * PARAMETERS:  Type                - Type of execution
- *              Function            - Address of the function to execute
- *              Context             - Passed as a parameter to the function
- *
- * RETURN:      Status.
- *
- * DESCRIPTION: Execute a new thread
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsExecute (
-    ACPI_EXECUTE_TYPE       Type,
-    ACPI_OSD_EXEC_CALLBACK  Function,
-    void                    *Context)
-{
-    pthread_t               thread;
-    int                     ret;
-
-
-    ret = pthread_create (&thread, NULL, (PTHREAD_CALLBACK) Function, Context);
-    if (ret)
-    {
-        AcpiOsPrintf("Create thread failed");
-    }
-    return (0);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsStall
- *
- * PARAMETERS:  microseconds        - Time to sleep
- *
- * RETURN:      Blocks until sleep is completed.
- *
- * DESCRIPTION: Sleep at microsecond granularity
- *
- *****************************************************************************/
-
-void
-AcpiOsStall (
-    UINT32                  microseconds)
-{
-
-    if (microseconds)
-    {
-        usleep (microseconds);
-    }
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsSleep
- *
- * PARAMETERS:  milliseconds        - Time to sleep
- *
- * RETURN:      Blocks until sleep is completed.
- *
- * DESCRIPTION: Sleep at millisecond granularity
- *
- *****************************************************************************/
-
-void
-AcpiOsSleep (
-    UINT64                  milliseconds)
-{
-
-    sleep (milliseconds / 1000);    /* Sleep for whole seconds */
-
-    /*
-     * Arg to usleep() must be less than 1,000,000 (1 second)
-     */
-    usleep ((milliseconds % 1000) * 1000);      /* Sleep for remaining usecs */
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsGetTimer
- *
- * PARAMETERS:  None
- *
- * RETURN:      Current time in 100 nanosecond units
- *
- * DESCRIPTION: Get the current system time
- *
- *****************************************************************************/
-
-UINT64
-AcpiOsGetTimer (
-    void)
-{
-    struct timeval          time;
-
-
-    gettimeofday (&time, NULL);
-
-    /* Seconds * 10^7 = 100ns(10^-7), Microseconds(10^-6) * 10^1 = 100ns */
-
-    return (((UINT64) time.tv_sec * 10000000) + ((UINT64) time.tv_usec * 10));
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsReadPciConfiguration
- *
- * PARAMETERS:  PciId               - Seg/Bus/Dev
- *              Register            - Device Register
- *              Value               - Buffer where value is placed
- *              Width               - Number of bits
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Read data from PCI configuration space
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsReadPciConfiguration (
-    ACPI_PCI_ID             *PciId,
-    UINT32                  Register,
-    UINT64                  *Value,
-    UINT32                  Width)
-{
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsWritePciConfiguration
- *
- * PARAMETERS:  PciId               - Seg/Bus/Dev
- *              Register            - Device Register
- *              Value               - Value to be written
- *              Width               - Number of bits
- *
- * RETURN:      Status.
- *
- * DESCRIPTION: Write data to PCI configuration space
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsWritePciConfiguration (
-    ACPI_PCI_ID             *PciId,
-    UINT32                  Register,
-    UINT64                  Value,
-    UINT32                  Width)
-{
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsReadPort
- *
- * PARAMETERS:  Address             - Address of I/O port/register to read
- *              Value               - Where value is placed
- *              Width               - Number of bits
- *
- * RETURN:      Value read from port
- *
- * DESCRIPTION: Read data from an I/O port or register
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsReadPort (
-    ACPI_IO_ADDRESS         Address,
-    UINT32                  *Value,
-    UINT32                  Width)
-{
-
-    switch (Width)
-    {
-    case 8:
-        *Value = 0xFF;
-        break;
-
-    case 16:
-        *Value = 0xFFFF;
-        break;
-
-    case 32:
-        *Value = 0xFFFFFFFF;
-        break;
-
-    default:
-        return (AE_BAD_PARAMETER);
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsWritePort
- *
- * PARAMETERS:  Address             - Address of I/O port/register to write
- *              Value               - Value to write
- *              Width               - Number of bits
- *
- * RETURN:      None
- *
- * DESCRIPTION: Write data to an I/O port or register
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsWritePort (
-    ACPI_IO_ADDRESS         Address,
-    UINT32                  Value,
-    UINT32                  Width)
-{
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsReadMemory
- *
- * PARAMETERS:  Address             - Physical Memory Address to read
- *              Value               - Where value is placed
- *              Width               - Number of bits
- *
- * RETURN:      Value read from physical memory address
- *
- * DESCRIPTION: Read data from a physical memory address
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsReadMemory (
-    ACPI_PHYSICAL_ADDRESS   Address,
-    UINT32                  *Value,
-    UINT32                  Width)
-{
-
-    switch (Width)
-    {
-    case 8:
-    case 16:
-    case 32:
-        *Value = 0;
-        break;
-
-    default:
-        return (AE_BAD_PARAMETER);
-    }
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsWriteMemory
- *
- * PARAMETERS:  Address             - Physical Memory Address to write
- *              Value               - Value to write
- *              Width               - Number of bits
- *
- * RETURN:      None
- *
- * DESCRIPTION: Write data to a physical memory address
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsWriteMemory (
-    ACPI_PHYSICAL_ADDRESS   Address,
-    UINT32                  Value,
-    UINT32                  Width)
-{
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsReadable
- *
- * PARAMETERS:  Pointer             - Area to be verified
- *              Length              - Size of area
- *
- * RETURN:      TRUE if readable for entire length
- *
- * DESCRIPTION: Verify that a pointer is valid for reading
- *
- *****************************************************************************/
-
-BOOLEAN
-AcpiOsReadable (
-    void                    *Pointer,
-    ACPI_SIZE               Length)
-{
-
-    return (TRUE);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsWritable
- *
- * PARAMETERS:  Pointer             - Area to be verified
- *              Length              - Size of area
- *
- * RETURN:      TRUE if writable for entire length
- *
- * DESCRIPTION: Verify that a pointer is valid for writing
- *
- *****************************************************************************/
-
-BOOLEAN
-AcpiOsWritable (
-    void                    *Pointer,
-    ACPI_SIZE               Length)
-{
-
-    return (TRUE);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsGetThreadId
- *
- * PARAMETERS:  None
- *
- * RETURN:      Id of the running thread
- *
- * DESCRIPTION: Get the ID of the current (running) thread
- *
- *****************************************************************************/
-
-ACPI_THREAD_ID
-AcpiOsGetThreadId (
-    void)
-{
-    return (ACPI_CAST_PTHREAD_T (pthread_self()));
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiOsSignal
- *
- * PARAMETERS:  Function            - ACPI CA signal function code
- *              Info                - Pointer to function-dependent structure
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Miscellaneous functions. Example implementation only.
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsSignal (
-    UINT32                  Function,
-    void                    *Info)
-{
-
-    switch (Function)
-    {
-    case ACPI_SIGNAL_FATAL:
-        break;
-
-    case ACPI_SIGNAL_BREAKPOINT:
-        break;
-
-    default:
-        break;
-    }
-
-    return (AE_OK);
-}
--- a/sys/external/bsd/acpica/dist/tools/acpiexec/osunixdir.c	Tue Jun 28 09:01:37 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,251 +0,0 @@
-
-/******************************************************************************
- *
- * Module Name: osunixdir - Unix directory access interfaces
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2011, Intel Corp.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- *    substantially similar to the "NO WARRANTY" disclaimer below
- *    ("Disclaimer") and any redistribution must be conditioned upon
- *    including a substantially similar Disclaimer requirement for further
- *    binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- *    of any contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dirent.h>
-#include <fnmatch.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#include "acpisrc.h"
-
-/*
- * Allocated structure returned from OsOpenDirectory
- */
-typedef struct ExternalFindInfo
-{
-    char                        *DirPathname;
-    DIR                         *DirPtr;
-    char                        temp_buffer[128];
-    char                        *WildcardSpec;
-    char                        RequestedFileType;
-
-} EXTERNAL_FIND_INFO;
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiOsOpenDirectory
- *
- * PARAMETERS:  DirPathname         - Full pathname to the directory
- *              WildcardSpec        - string of the form "*.c", etc.
- *
- * RETURN:      A directory "handle" to be used in subsequent search operations.
- *              NULL returned on failure.
- *
- * DESCRIPTION: Open a directory in preparation for a wildcard search
- *
- ******************************************************************************/
-
-void *
-AcpiOsOpenDirectory (
-    char                    *DirPathname,
-    char                    *WildcardSpec,
-    char                    RequestedFileType)
-{
-    EXTERNAL_FIND_INFO      *ExternalInfo;
-    DIR                     *dir;
-
-
-    /* Allocate the info struct that will be returned to the caller */
-
-    ExternalInfo = calloc (sizeof (EXTERNAL_FIND_INFO), 1);
-    if (!ExternalInfo)
-    {
-        return (NULL);
-    }
-
-    /* Get the directory stream */
-
-    dir = opendir (DirPathname);
-    if (!dir)
-    {
-        free (ExternalInfo);
-        return (NULL);
-    }
-
-    /* Save the info in the return structure */
-
-    ExternalInfo->WildcardSpec = WildcardSpec;
-    ExternalInfo->RequestedFileType = RequestedFileType;
-    ExternalInfo->DirPathname = DirPathname;
-    ExternalInfo->DirPtr = dir;
-    return (ExternalInfo);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiOsGetNextFilename
- *
- * PARAMETERS:  DirHandle           - Created via AcpiOsOpenDirectory
- *
- * RETURN:      Next filename matched. NULL if no more matches.
- *
- * DESCRIPTION: Get the next file in the directory that matches the wildcard
- *              specification.
- *
- ******************************************************************************/
-
-char *
-AcpiOsGetNextFilename (
-    void                    *DirHandle)
-{
-    EXTERNAL_FIND_INFO      *ExternalInfo = DirHandle;
-    struct dirent           *dir_entry;
-    char                    *temp_str;
-    int                     str_len;
-    struct stat             temp_stat;
-    int                     err;
-
-
-    while ((dir_entry = readdir (ExternalInfo->DirPtr)))
-    {
-        if (!fnmatch (ExternalInfo->WildcardSpec, dir_entry->d_name, 0))
-        {
-            if (dir_entry->d_name[0] == '.')
-            {
-                continue;
-            }
-
-            str_len = strlen (dir_entry->d_name) +
-                        strlen (ExternalInfo->DirPathname) + 2;
-
-            temp_str = calloc (str_len, 1);
-            if (!temp_str)
-            {
-                printf ("Could not allocate buffer for temporary string\n");
-                return (NULL);
-            }
-
-            strcpy (temp_str, ExternalInfo->DirPathname);
-            strcat (temp_str, "/");
-            strcat (temp_str, dir_entry->d_name);
-
-            err = stat (temp_str, &temp_stat);
-            free (temp_str);
-            if (err == -1)
-            {
-                printf ("stat() error - should not happen\n");
-                return (NULL);
-            }
-
-            if ((S_ISDIR (temp_stat.st_mode)
-                && (ExternalInfo->RequestedFileType == REQUEST_DIR_ONLY))
-               ||
-               ((!S_ISDIR (temp_stat.st_mode)
-                && ExternalInfo->RequestedFileType == REQUEST_FILE_ONLY)))
-            {
-                /* copy to a temp buffer because dir_entry struct is on the stack */
-
-                strcpy (ExternalInfo->temp_buffer, dir_entry->d_name);
-                return (ExternalInfo->temp_buffer);
-            }
-        }
-    }
-
-    return (NULL);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiOsCloseDirectory
- *
- * PARAMETERS:  DirHandle           - Created via AcpiOsOpenDirectory
- *
- * RETURN:      None.
- *
- * DESCRIPTION: Close the open directory and cleanup.
- *
- ******************************************************************************/
-
-void
-AcpiOsCloseDirectory (
-    void                    *DirHandle)
-{
-    EXTERNAL_FIND_INFO      *ExternalInfo = DirHandle;
-
-
-    /* Close the directory and free allocations */
-
-    closedir (ExternalInfo->DirPtr);
-    free (DirHandle);
-}
-
-
-/* Other functions acpisrc uses but that aren't standard on Unix */
-
-/*******************************************************************************
- *
- * FUNCTION:    strlwr
- *
- * PARAMETERS:  str                 - String to be lowercased.
- *
- * RETURN:      str.
- *
- * DESCRIPTION: Lowercase a string in-place.
- *
- ******************************************************************************/
-
-char *
-strlwr  (
-   char         *str)
-{
-    int         length;
-    int         i;
-
-
-    length = strlen (str);
-
-    for (i = 0; i < length; i++)
-    {
-        str[i] = tolower ((int) str[i]);
-    }
-
-    return (str);
-}
--- a/sys/external/bsd/acpica/dist/tools/acpisrc/osunixdir.c	Tue Jun 28 09:01:37 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,251 +0,0 @@
-
-/******************************************************************************
- *
- * Module Name: osunixdir - Unix directory access interfaces
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2011, Intel Corp.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- *    substantially similar to the "NO WARRANTY" disclaimer below
- *    ("Disclaimer") and any redistribution must be conditioned upon
- *    including a substantially similar Disclaimer requirement for further
- *    binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- *    of any contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dirent.h>
-#include <fnmatch.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#include "acpisrc.h"
-
-/*
- * Allocated structure returned from OsOpenDirectory
- */
-typedef struct ExternalFindInfo
-{
-    char                        *DirPathname;
-    DIR                         *DirPtr;
-    char                        temp_buffer[128];
-    char                        *WildcardSpec;
-    char                        RequestedFileType;
-
-} EXTERNAL_FIND_INFO;
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiOsOpenDirectory
- *
- * PARAMETERS:  DirPathname         - Full pathname to the directory
- *              WildcardSpec        - string of the form "*.c", etc.
- *
- * RETURN:      A directory "handle" to be used in subsequent search operations.
- *              NULL returned on failure.
- *
- * DESCRIPTION: Open a directory in preparation for a wildcard search
- *
- ******************************************************************************/
-
-void *
-AcpiOsOpenDirectory (
-    char                    *DirPathname,
-    char                    *WildcardSpec,
-    char                    RequestedFileType)
-{
-    EXTERNAL_FIND_INFO      *ExternalInfo;
-    DIR                     *dir;
-
-
-    /* Allocate the info struct that will be returned to the caller */
-
-    ExternalInfo = calloc (sizeof (EXTERNAL_FIND_INFO), 1);
-    if (!ExternalInfo)
-    {
-        return (NULL);
-    }
-
-    /* Get the directory stream */
-
-    dir = opendir (DirPathname);
-    if (!dir)
-    {
-        free (ExternalInfo);
-        return (NULL);
-    }
-
-    /* Save the info in the return structure */
-
-    ExternalInfo->WildcardSpec = WildcardSpec;
-    ExternalInfo->RequestedFileType = RequestedFileType;
-    ExternalInfo->DirPathname = DirPathname;
-    ExternalInfo->DirPtr = dir;
-    return (ExternalInfo);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiOsGetNextFilename
- *
- * PARAMETERS:  DirHandle           - Created via AcpiOsOpenDirectory
- *
- * RETURN:      Next filename matched. NULL if no more matches.
- *
- * DESCRIPTION: Get the next file in the directory that matches the wildcard
- *              specification.
- *
- ******************************************************************************/
-
-char *
-AcpiOsGetNextFilename (
-    void                    *DirHandle)
-{
-    EXTERNAL_FIND_INFO      *ExternalInfo = DirHandle;
-    struct dirent           *dir_entry;
-    char                    *temp_str;
-    int                     str_len;
-    struct stat             temp_stat;
-    int                     err;
-
-
-    while ((dir_entry = readdir (ExternalInfo->DirPtr)))
-    {
-        if (!fnmatch (ExternalInfo->WildcardSpec, dir_entry->d_name, 0))
-        {
-            if (dir_entry->d_name[0] == '.')
-            {
-                continue;
-            }
-
-            str_len = strlen (dir_entry->d_name) +
-                        strlen (ExternalInfo->DirPathname) + 2;
-
-            temp_str = calloc (str_len, 1);
-            if (!temp_str)
-            {
-                printf ("Could not allocate buffer for temporary string\n");
-                return (NULL);
-            }
-
-            strcpy (temp_str, ExternalInfo->DirPathname);
-            strcat (temp_str, "/");
-            strcat (temp_str, dir_entry->d_name);
-
-            err = stat (temp_str, &temp_stat);
-            free (temp_str);
-            if (err == -1)
-            {
-                printf ("stat() error - should not happen\n");
-                return (NULL);
-            }
-
-            if ((S_ISDIR (temp_stat.st_mode)
-                && (ExternalInfo->RequestedFileType == REQUEST_DIR_ONLY))
-               ||
-               ((!S_ISDIR (temp_stat.st_mode)
-                && ExternalInfo->RequestedFileType == REQUEST_FILE_ONLY)))
-            {
-                /* copy to a temp buffer because dir_entry struct is on the stack */
-
-                strcpy (ExternalInfo->temp_buffer, dir_entry->d_name);
-                return (ExternalInfo->temp_buffer);
-            }
-        }
-    }
-
-    return (NULL);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiOsCloseDirectory
- *
- * PARAMETERS:  DirHandle           - Created via AcpiOsOpenDirectory
- *
- * RETURN:      None.
- *
- * DESCRIPTION: Close the open directory and cleanup.
- *
- ******************************************************************************/
-
-void
-AcpiOsCloseDirectory (
-    void                    *DirHandle)
-{
-    EXTERNAL_FIND_INFO      *ExternalInfo = DirHandle;
-
-
-    /* Close the directory and free allocations */
-
-    closedir (ExternalInfo->DirPtr);
-    free (DirHandle);
-}
-
-
-/* Other functions acpisrc uses but that aren't standard on Unix */
-
-/*******************************************************************************
- *
- * FUNCTION:    strlwr
- *
- * PARAMETERS:  str                 - String to be lowercased.
- *
- * RETURN:      str.
- *
- * DESCRIPTION: Lowercase a string in-place.
- *
- ******************************************************************************/
-
-char *
-strlwr  (
-   char         *str)
-{
-    int         length;
-    int         i;
-
-
-    length = strlen (str);
-
-    for (i = 0; i < length; i++)
-    {
-        str[i] = tolower ((int) str[i]);
-    }
-
-    return (str);
-}
--- a/sys/external/bsd/acpica/dist/utilities/utdecode.c	Tue Jun 28 09:01:37 2011 +0000
+++ b/sys/external/bsd/acpica/dist/utilities/utdecode.c	Tue Jun 28 09:04:29 2011 +0000
@@ -187,8 +187,7 @@
     "SMBus",
     "SystemCMOS",
     "PCIBARTarget",
-    "IPMI",
-    "DataTable"
+    "IPMI"
 };
 
 
@@ -201,6 +200,10 @@
     {
         return ("UserDefinedRegion");
     }
+    else if (SpaceId == ACPI_ADR_SPACE_DATA_TABLE)
+    {
+        return ("DataTable");
+    }
     else if (SpaceId == ACPI_ADR_SPACE_FIXED_HARDWARE)
     {
         return ("FunctionalFixedHW");