Sync ACPICA with Intel's version 20140724.
authorSascha Wildner <saw@online.de>
Sat, 26 Jul 2014 09:37:51 +0000 (11:37 +0200)
committerSascha Wildner <saw@online.de>
Sat, 26 Jul 2014 09:42:48 +0000 (11:42 +0200)
* ACPI 5.1 is fully supported in ACPICA as of this release.

* Better handling of GPEs with no associated handler or control message.

* Timer() support in the AML Debug object.

* New -u option in acpihelp(8).

* Bug fixes & other enhancements.

For a more detailed list, please see sys/contrib/dev/acpica/changes.txt.

77 files changed:
sys/conf/files
sys/contrib/dev/acpica/changes.txt
sys/contrib/dev/acpica/generate/unix/acpiexamples/Makefile
sys/contrib/dev/acpica/generate/unix/acpiexec/Makefile
sys/contrib/dev/acpica/generate/unix/acpihelp/Makefile
sys/contrib/dev/acpica/generate/unix/acpinames/Makefile
sys/contrib/dev/acpica/generate/unix/iasl/Makefile
sys/contrib/dev/acpica/source/common/ahids.c
sys/contrib/dev/acpica/source/common/ahpredef.c
sys/contrib/dev/acpica/source/common/ahuuids.c [new file with mode: 0644]
sys/contrib/dev/acpica/source/common/dmextern.c
sys/contrib/dev/acpica/source/common/dmtable.c
sys/contrib/dev/acpica/source/common/dmtbdump.c
sys/contrib/dev/acpica/source/common/dmtbinfo.c
sys/contrib/dev/acpica/source/compiler/aslanalyze.c
sys/contrib/dev/acpica/source/compiler/aslcompiler.h
sys/contrib/dev/acpica/source/compiler/aslcompiler.l
sys/contrib/dev/acpica/source/compiler/asldefine.h
sys/contrib/dev/acpica/source/compiler/aslglobal.h
sys/contrib/dev/acpica/source/compiler/aslmessages.c
sys/contrib/dev/acpica/source/compiler/aslmessages.h
sys/contrib/dev/acpica/source/compiler/aslmethod.c
sys/contrib/dev/acpica/source/compiler/aslopcodes.c
sys/contrib/dev/acpica/source/compiler/aslprepkg.c
sys/contrib/dev/acpica/source/compiler/aslutils.c
sys/contrib/dev/acpica/source/compiler/asluuid.c
sys/contrib/dev/acpica/source/compiler/dtcompiler.h
sys/contrib/dev/acpica/source/compiler/dtfield.c
sys/contrib/dev/acpica/source/compiler/dttable.c
sys/contrib/dev/acpica/source/compiler/dttemplate.h
sys/contrib/dev/acpica/source/compiler/dtutils.c
sys/contrib/dev/acpica/source/components/disassembler/dmbuffer.c
sys/contrib/dev/acpica/source/components/disassembler/dmopcode.c
sys/contrib/dev/acpica/source/components/disassembler/dmwalk.c
sys/contrib/dev/acpica/source/components/events/evgpe.c
sys/contrib/dev/acpica/source/components/events/evxfgpe.c
sys/contrib/dev/acpica/source/components/executer/exdebug.c
sys/contrib/dev/acpica/source/components/executer/exdump.c
sys/contrib/dev/acpica/source/components/executer/exfield.c
sys/contrib/dev/acpica/source/components/namespace/nsobject.c
sys/contrib/dev/acpica/source/components/utilities/utdecode.c
sys/contrib/dev/acpica/source/components/utilities/utfileio.c
sys/contrib/dev/acpica/source/components/utilities/uthex.c [copied from sys/contrib/dev/acpica/source/include/platform/achaiku.h with 54% similarity]
sys/contrib/dev/acpica/source/components/utilities/utprint.c
sys/contrib/dev/acpica/source/components/utilities/utuuid.c [copied from sys/contrib/dev/acpica/source/include/platform/achaiku.h with 53% similarity]
sys/contrib/dev/acpica/source/include/acconfig.h
sys/contrib/dev/acpica/source/include/acdisasm.h
sys/contrib/dev/acpica/source/include/aclocal.h
sys/contrib/dev/acpica/source/include/acnames.h
sys/contrib/dev/acpica/source/include/acpixf.h
sys/contrib/dev/acpica/source/include/acpredef.h
sys/contrib/dev/acpica/source/include/actbl.h
sys/contrib/dev/acpica/source/include/actbl1.h
sys/contrib/dev/acpica/source/include/actbl2.h
sys/contrib/dev/acpica/source/include/actbl3.h
sys/contrib/dev/acpica/source/include/actypes.h
sys/contrib/dev/acpica/source/include/acutils.h
sys/contrib/dev/acpica/source/include/platform/achaiku.h
sys/contrib/dev/acpica/source/include/platform/aclinux.h
sys/contrib/dev/acpica/source/include/platform/aclinuxex.h
sys/contrib/dev/acpica/source/os_specific/service_layers/osefixf.c
sys/contrib/dev/acpica/source/os_specific/service_layers/oslibcfs.c
sys/contrib/dev/acpica/source/os_specific/service_layers/osunixxf.c
sys/contrib/dev/acpica/source/os_specific/service_layers/oswintbl.c
sys/contrib/dev/acpica/source/tools/acpiexec/aehandlers.c
sys/contrib/dev/acpica/source/tools/acpihelp/acpihelp.h
sys/contrib/dev/acpica/source/tools/acpihelp/ahdecode.c
sys/contrib/dev/acpica/source/tools/acpihelp/ahmain.c
sys/contrib/dev/acpica/source/tools/acpisrc/asconvrt.c
sys/contrib/dev/acpica/source/tools/acpisrc/astable.c
sys/contrib/dev/acpica/tests/misc/grammar.asl
sys/dev/acpica/Makefile
usr.sbin/acpi/acpiexec/Makefile
usr.sbin/acpi/acpihelp/Makefile
usr.sbin/acpi/acpihelp/acpihelp.8
usr.sbin/acpi/acpinames/Makefile
usr.sbin/acpi/iasl/Makefile

index 9a0d679..eb2a6e5 100644 (file)
@@ -2096,6 +2096,7 @@ kern/dsched/bfq/bfq_helper_thread.c       optional dsched_bfq
 
 # ACPICA code
 ${ACPICA_DIR}/common/ahids.c                   optional acpi
+${ACPICA_DIR}/common/ahuuids.c                 optional acpi
 ${ACPICA_COMP_DIR}/debugger/dbcmds.c           optional acpi acpi_debug
 ${ACPICA_COMP_DIR}/debugger/dbconvert.c                optional acpi acpi_debug
 ${ACPICA_COMP_DIR}/debugger/dbdisply.c         optional acpi acpi_debug
@@ -2251,6 +2252,7 @@ ${ACPICA_COMP_DIR}/utilities/uterror.c            optional acpi
 ${ACPICA_COMP_DIR}/utilities/uteval.c          optional acpi
 ${ACPICA_COMP_DIR}/utilities/utexcep.c         optional acpi
 ${ACPICA_COMP_DIR}/utilities/utglobal.c                optional acpi
+${ACPICA_COMP_DIR}/utilities/uthex.c           optional acpi
 ${ACPICA_COMP_DIR}/utilities/utids.c           optional acpi
 ${ACPICA_COMP_DIR}/utilities/utinit.c          optional acpi
 ${ACPICA_COMP_DIR}/utilities/utlock.c          optional acpi
@@ -2264,6 +2266,7 @@ ${ACPICA_COMP_DIR}/utilities/utpredef.c           optional acpi
 ${ACPICA_COMP_DIR}/utilities/utresrc.c         optional acpi
 ${ACPICA_COMP_DIR}/utilities/utstate.c         optional acpi
 ${ACPICA_COMP_DIR}/utilities/utstring.c                optional acpi
+${ACPICA_COMP_DIR}/utilities/utuuid.c          optional acpi
 ${ACPICA_COMP_DIR}/utilities/utxface.c         optional acpi
 ${ACPICA_COMP_DIR}/utilities/utxferror.c       optional acpi
 ${ACPICA_COMP_DIR}/utilities/utxfinit.c                optional acpi
index 3acf4fd..eae9f81 100644 (file)
@@ -1,3 +1,84 @@
+----------------------------------------
+
+24 July 2014. Summary of changes for version 20140724: 
+
+This release is available at https://acpica.org/downloads
+
+The ACPI 5.1 specification has been released and is available at: 
+http://uefi.org/specs/access
+
+
+0) ACPI 5.1 support in ACPICA:
+
+ACPI 5.1 is fully supported in ACPICA as of this release.
+
+New predefined names. Support includes iASL and runtime ACPICA 
+validation.
+    _CCA (Cache Coherency Attribute).
+    _DSD (Device-Specific Data). David Box.
+
+Modifications to existing ACPI tables. Support includes headers, iASL 
+Data Table compiler, disassembler, and the template generator.
+    FADT - New fields and flags. Graeme Gregory.
+    GTDT - One new subtable and new fields. Tomasz Nowicki.
+    MADT - Two new subtables. Tomasz Nowicki.
+    PCCT - One new subtable.
+
+Miscellaneous.
+    New notification type for System Resource Affinity change events.
+
+
+1) ACPICA kernel-resident subsystem:
+
+Fixed a regression introduced in 20140627 where a fault can happen during 
+the deletion of Alias AML namespace objects. The problem affected both 
+the core ACPICA and the ACPICA tools including iASL and AcpiExec.
+
+Implemented a new GPE public interface, AcpiMarkGpeForWake. Provides a 
+simple mechanism to enable wake GPEs that have no associated handler or 
+control method. Rafael Wysocki.
+
+Updated the AcpiEnableGpe interface to disallow the enable if there is no 
+handler or control method associated with the particular GPE. This will 
+help avoid meaningless GPEs and even GPE floods. Rafael Wysocki.
+
+Updated GPE handling and dispatch by disabling the GPE before clearing 
+the status bit for edge-triggered GPEs. Lv Zheng.
+
+Added Timer() support to the AML Debug object. The current timer value is 
+now displayed with each invocation of (Store to) the debug object to 
+enable simple generation of execution times for AML code (method 
+execution for example.) ACPICA BZ 1093.
+
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The 
+debug version of the code includes the debug output trace mechanism and 
+has a much larger code and data size.
+
+  Current Release:
+    Non-Debug Version:  98.7K Code, 27.3K Data, 126.0K Total
+    Debug Version:     192.0K Code, 79.7K Data, 271.7K Total
+  Previous Release:
+    Non-Debug Version:  98.7K Code, 27.2K Data, 125.9K Total
+    Debug Version:     191.7K Code, 79.6K Data, 271.3K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+Fixed an issue with the recently added local printf implementation, 
+concerning width/precision specifiers that could cause incorrect output. 
+Lv Zheng. ACPICA BZ 1094.
+
+Disassembler: Added support to detect buffers that contain UUIDs and 
+disassemble them to an invocation of the ToUUID operator. Also emit 
+commented descriptions of known ACPI-related UUIDs.
+
+AcpiHelp: Added support to display known ACPI-related UUIDs. New option, 
+-u. Adds three new files. 
+
+iASL: Update table compiler and disassembler for DMAR table changes that 
+were introduced in September 2013. With assistance by David Woodhouse.
+
 ----------------------------------------
 27 June 2014. Summary of changes for version 20140627:
 
index 8bcdb9b..4583143 100644 (file)
@@ -138,6 +138,7 @@ OBJECTS = \
        $(OBJDIR)/uteval.o\
        $(OBJDIR)/utexcep.o\
        $(OBJDIR)/utglobal.o\
+       $(OBJDIR)/uthex.o\
        $(OBJDIR)/utids.o\
        $(OBJDIR)/utinit.o\
        $(OBJDIR)/utlock.o\
index 6c5c632..8d7facf 100644 (file)
@@ -45,6 +45,7 @@ OBJECTS = \
        $(OBJDIR)/aemain.o\
        $(OBJDIR)/aetables.o\
        $(OBJDIR)/ahids.o\
+       $(OBJDIR)/ahuuids.o\
        $(OBJDIR)/cmfsize.o\
        $(OBJDIR)/dbcmds.o\
        $(OBJDIR)/dbconvert.o\
@@ -204,6 +205,7 @@ OBJECTS = \
        $(OBJDIR)/utexcep.o\
        $(OBJDIR)/utfileio.o\
        $(OBJDIR)/utglobal.o\
+       $(OBJDIR)/uthex.o\
        $(OBJDIR)/utids.o\
        $(OBJDIR)/utinit.o\
        $(OBJDIR)/utlock.o\
@@ -219,6 +221,7 @@ OBJECTS = \
        $(OBJDIR)/utstate.o\
        $(OBJDIR)/utstring.o\
        $(OBJDIR)/uttrack.o\
+       $(OBJDIR)/utuuid.o\
        $(OBJDIR)/utxface.o\
        $(OBJDIR)/utxferror.o\
        $(OBJDIR)/utxfinit.o\
index 25c8c0a..ed4ee8a 100644 (file)
@@ -35,15 +35,18 @@ OBJECTS = \
        $(OBJDIR)/ahids.o\
        $(OBJDIR)/ahpredef.o\
        $(OBJDIR)/ahmain.o\
+       $(OBJDIR)/ahuuids.o\
        $(OBJDIR)/getopt.o\
        $(OBJDIR)/oslibcfs.o\
        $(OBJDIR)/osunixxf.o\
        $(OBJDIR)/utdebug.o\
        $(OBJDIR)/utexcep.o\
        $(OBJDIR)/utglobal.o\
+       $(OBJDIR)/uthex.o\
        $(OBJDIR)/utmath.o\
        $(OBJDIR)/utpredef.o\
-       $(OBJDIR)/utprint.o
+       $(OBJDIR)/utprint.o\
+       $(OBJDIR)/utuuid.o
 
 #
 # Flags specific to acpihelp
index 27c7b95..743c6c5 100644 (file)
@@ -103,6 +103,7 @@ OBJECTS = \
        $(OBJDIR)/utexcep.o\
        $(OBJDIR)/utfileio.o\
        $(OBJDIR)/utglobal.o\
+       $(OBJDIR)/uthex.o\
        $(OBJDIR)/utids.o\
        $(OBJDIR)/utinit.o\
        $(OBJDIR)/utlock.o\
index 7fd7bbe..051450c 100644 (file)
@@ -48,6 +48,7 @@ OBJECTS = \
        $(OBJDIR)/adwalk.o\
        $(OBJDIR)/ahids.o\
        $(OBJDIR)/ahpredef.o\
+       $(OBJDIR)/ahuuids.o\
        $(OBJDIR)/aslanalyze.o\
        $(OBJDIR)/aslbtypes.o\
        $(OBJDIR)/aslcodegen.o\
@@ -193,6 +194,7 @@ OBJECTS = \
        $(OBJDIR)/utexcep.o\
        $(OBJDIR)/utfileio.o\
        $(OBJDIR)/utglobal.o\
+       $(OBJDIR)/uthex.o\
        $(OBJDIR)/utinit.o\
        $(OBJDIR)/utlock.o\
        $(OBJDIR)/utmath.o\
@@ -205,6 +207,7 @@ OBJECTS = \
        $(OBJDIR)/utresrc.o\
        $(OBJDIR)/utstate.o\
        $(OBJDIR)/utstring.o\
+       $(OBJDIR)/utuuid.o\
        $(OBJDIR)/utxface.o\
        $(OBJDIR)/utxferror.o
 
index 851393b..13cd100 100644 (file)
@@ -174,7 +174,11 @@ const AH_DEVICE_ID  AslDeviceIds[] =
     {"PNP0C60",     "Display Sensor Device"},
     {"PNP0C70",     "Dock Sensor Device"},
     {"PNP0C80",     "Memory Device"},
-    {"PNP0D40",     "Standard Compliant SD Host Controller"},
+    {"PNP0D10",     "XHCI USB Controller with debug"},
+    {"PNP0D15",     "XHCI USB Controller without debug"},
+    {"PNP0D20",     "EHCI USB Controller without debug"},
+    {"PNP0D25",     "EHCI USB Controller with debug"},
+    {"PNP0D40",     "SDA Standard Compliant SD Host Controller"},
     {"PNP0D80",     "Windows-compatible System Power Management Controller"},
     {"PNP0F03",     "Microsoft PS/2-style Mouse"},
     {"SMO91D0",     "Sensor Hub"},
index 6f4258b..b4661e7 100644 (file)
@@ -97,6 +97,7 @@ const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
     AH_PREDEF ("_BTM",    "Battery Time", "Returns the battery runtime"),
     AH_PREDEF ("_BTP",    "Battery Trip Point", "Sets a Control Method Battery trip point"),
     AH_PREDEF ("_CBA",    "Configuration Base Address", "Sets the base address for a PCI Express host bridge"),
+    AH_PREDEF ("_CCA",    "Cache Coherency Attribute", "Returns a device's support level for cache coherency"),
     AH_PREDEF ("_CDM",    "Clock Domain", "Returns a logical processor's clock domain identifier"),
     AH_PREDEF ("_CID",    "Compatible ID", "Returns a device's Plug and Play Compatible ID list"),
     AH_PREDEF ("_CLS",    "Class Code", "Returns PCI class code and subclass"),
@@ -121,6 +122,7 @@ const AH_PREDEFINED_NAME    AslPredefinedInfo[] =
     AH_PREDEF ("_DOS",    "Disable Output Switching", "Sets the display output switching mode"),
     AH_PREDEF ("_DPL",    "Device Selection Polarity", "Polarity of Device Selection signal, Resource Descriptor field"),
     AH_PREDEF ("_DRS",    "Drive Strength", "Drive Strength setting for GPIO connection, Resource Descriptor field"),
+    AH_PREDEF ("_DSD",    "Device-Specific Data", "Returns a list of device property information"),
     AH_PREDEF ("_DSM",    "Device-Specific Method", "Executes device-specific functions"),
     AH_PREDEF ("_DSS",    "Device Set State", "Sets the display device state"),
     AH_PREDEF ("_DSW",    "Device Sleep Wake", "Sets the sleep and wake transition states for a device"),
diff --git a/sys/contrib/dev/acpica/source/common/ahuuids.c b/sys/contrib/dev/acpica/source/common/ahuuids.c
new file mode 100644 (file)
index 0000000..8d0b080
--- /dev/null
@@ -0,0 +1,129 @@
+/******************************************************************************
+ *
+ * Module Name: ahuuids - Table of known ACPI-related UUIDs
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2014, 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 "acpi.h"
+#include "accommon.h"
+
+#define _COMPONENT          ACPI_UTILITIES
+        ACPI_MODULE_NAME    ("ahuuids")
+
+/*
+ * Table of "known" (ACPI-related) UUIDs
+ */
+const AH_UUID  AcpiUuids[] =
+{
+    {"PCI Host Bridge Device",
+        "33db4d5b-1ff7-401c-9657-7441c03dd766"},
+
+    {"Platform-wide Capabilities",
+        "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"},
+
+    {"Dynamic Enumeration",
+        "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"},
+
+    {"GPIO Controller",
+        "4f248f40-d5e2-499f-834c-27758ea1cd3f"},
+
+    {"Battery Thermal Limit",
+        "4c2067e3-887d-475c-9720-4af1d3ed602e"},
+
+    {"Thermal Extensions",
+        "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"},
+
+    {"USB Controller",
+        "ce2ee385-00e6-48cb-9f05-2edb927c4899"},
+
+    {"HID I2C Device",
+        "3cdff6f7-4267-4555-ad05-b30a3d8938de"},
+
+    {"Power Button Device",
+        "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"},
+
+    {"Device Labeling Interface",
+        "e5c937d0-3553-4d7a-9117-ea4d19c3434d"},
+
+    {"SATA Controller",
+        "e4db149b-fcfe-425b-a6d8-92357d78fc7f"},
+
+    {"Physical Presence Interface",
+        "3dddfaa6-361b-4eb4-a424-8d10089d1653"},
+
+    {NULL, NULL}
+};
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiAhMatchUuid
+ *
+ * PARAMETERS:  Data                - Data buffer containing a UUID
+ *
+ * RETURN:      ASCII description string for the UUID if it is found.
+ *
+ * DESCRIPTION: Returns a description string for "known" UUIDs, which are
+ *              are UUIDs that are related to ACPI in some way.
+ *
+ ******************************************************************************/
+
+const char *
+AcpiAhMatchUuid (
+    UINT8                   *Data)
+{
+    const AH_UUID           *Info;
+    UINT8                   UuidBuffer[UUID_BUFFER_LENGTH];
+
+
+    /* Walk the table of known ACPI-related UUIDs */
+
+    for (Info = AcpiUuids; Info->Description; Info++)
+    {
+        AcpiUtConvertStringToUuid (Info->String, UuidBuffer);
+
+        if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH))
+        {
+            return (Info->Description);
+        }
+    }
+
+    return (NULL);
+}
index 728207c..37c3a65 100644 (file)
@@ -406,18 +406,37 @@ AcpiDmGetExternalsFromFile (
     while (fgets (StringBuffer, ASL_MSG_BUFFER_SIZE, ExternalRefFile))
     {
         Token = strtok (StringBuffer, METHOD_SEPARATORS);   /* "External" */
-        if (!Token) continue;
-        if (strcmp (Token, "External")) continue;
+        if (!Token)
+        {
+            continue;
+        }
+        if (strcmp (Token, "External"))
+        {
+            continue;
+        }
 
         MethodName = strtok (NULL, METHOD_SEPARATORS);      /* Method namepath */
-        if (!MethodName) continue;
+        if (!MethodName)
+        {
+            continue;
+        }
 
         Token = strtok (NULL, METHOD_SEPARATORS);           /* "MethodObj" */
-        if (!Token) continue;
-        if (strcmp (Token, "MethodObj")) continue;
+        if (!Token)
+        {
+            continue;
+        }
+
+        if (strcmp (Token, "MethodObj"))
+        {
+            continue;
+        }
 
         Token = strtok (NULL, METHOD_SEPARATORS);           /* Arg count */
-        if (!Token) continue;
+        if (!Token)
+        {
+            continue;
+        }
 
         /* Convert arg count string to an integer */
 
index 384f795..e5627d7 100644 (file)
@@ -87,9 +87,21 @@ static const char           *AcpiDmDmarSubnames[] =
     "Reserved Memory Region",
     "Root Port ATS Capability",
     "Remapping Hardware Static Affinity",
+    "ACPI Namespace Device Declaration",
     "Unknown SubTable Type"         /* Reserved */
 };
 
+static const char           *AcpiDmDmarScope[] =
+{
+    "Reserved value",
+    "PCI Endpoint Device",
+    "PCI Bridge Device",
+    "IOAPIC Device",
+    "Message-capable HPET Device",
+    "Namespace Device",
+    "Unknown Scope Type"            /* Reserved */
+};
+
 static const char           *AcpiDmEinjActions[] =
 {
     "Begin Operation",
@@ -160,6 +172,13 @@ static const char           *AcpiDmErstInstructions[] =
     "Unknown Instruction"
 };
 
+static const char           *AcpiDmGtdtSubnames[] =
+{
+    "Generic Timer Block",
+    "Generic Watchdog Timer",
+    "Unknown SubTable Type"         /* Reserved */
+};
+
 static const char           *AcpiDmHestSubnames[] =
 {
     "IA-32 Machine Check Exception",
@@ -189,25 +208,28 @@ static const char           *AcpiDmHestNotifySubnames[] =
 
 static const char           *AcpiDmMadtSubnames[] =
 {
-    "Processor Local APIC",         /* ACPI_MADT_TYPE_LOCAL_APIC */
-    "I/O APIC",                     /* ACPI_MADT_TYPE_IO_APIC */
-    "Interrupt Source Override",    /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
-    "NMI Source",                   /* ACPI_MADT_TYPE_NMI_SOURCE */
-    "Local APIC NMI",               /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
-    "Local APIC Address Override",  /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
-    "I/O SAPIC",                    /* ACPI_MADT_TYPE_IO_SAPIC */
-    "Local SAPIC",                  /* ACPI_MADT_TYPE_LOCAL_SAPIC */
-    "Platform Interrupt Sources",   /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
-    "Processor Local x2APIC",       /* ACPI_MADT_TYPE_LOCAL_X2APIC */
-    "Local x2APIC NMI",             /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
-    "Generic Interrupt Controller", /* ACPI_MADT_GENERIC_INTERRUPT */
-    "Generic Interrupt Distributor",/* ACPI_MADT_GENERIC_DISTRIBUTOR */
-    "Unknown SubTable Type"         /* Reserved */
+    "Processor Local APIC",             /* ACPI_MADT_TYPE_LOCAL_APIC */
+    "I/O APIC",                         /* ACPI_MADT_TYPE_IO_APIC */
+    "Interrupt Source Override",        /* ACPI_MADT_TYPE_INTERRUPT_OVERRIDE */
+    "NMI Source",                       /* ACPI_MADT_TYPE_NMI_SOURCE */
+    "Local APIC NMI",                   /* ACPI_MADT_TYPE_LOCAL_APIC_NMI */
+    "Local APIC Address Override",      /* ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE */
+    "I/O SAPIC",                        /* ACPI_MADT_TYPE_IO_SAPIC */
+    "Local SAPIC",                      /* ACPI_MADT_TYPE_LOCAL_SAPIC */
+    "Platform Interrupt Sources",       /* ACPI_MADT_TYPE_INTERRUPT_SOURCE */
+    "Processor Local x2APIC",           /* ACPI_MADT_TYPE_LOCAL_X2APIC */
+    "Local x2APIC NMI",                 /* ACPI_MADT_TYPE_LOCAL_X2APIC_NMI */
+    "Generic Interrupt Controller",     /* ACPI_MADT_GENERIC_INTERRUPT */
+    "Generic Interrupt Distributor",    /* ACPI_MADT_GENERIC_DISTRIBUTOR */
+    "Generic MSI Frame",                /* ACPI_MADT_GENERIC_MSI_FRAME */
+    "Generic Interrupt Redistributor",  /* ACPI_MADT_GENERIC_REDISTRIBUTOR */
+    "Unknown SubTable Type"             /* Reserved */
 };
 
 static const char           *AcpiDmPcctSubnames[] =
 {
     "Generic Communications Subspace",  /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
+    "HW-Reduced Communications Subspace",
     "Unknown SubTable Type"             /* Reserved */
 };
 
@@ -306,7 +328,7 @@ ACPI_DMTABLE_DATA    AcpiDmTableData[] =
     {ACPI_SIG_ERST, NULL,                   AcpiDmDumpErst, DtCompileErst,  TemplateErst,   "Error Record Serialization Table"},
     {ACPI_SIG_FADT, NULL,                   AcpiDmDumpFadt, DtCompileFadt,  TemplateFadt,   "Fixed ACPI Description Table (FADT)"},
     {ACPI_SIG_FPDT, NULL,                   AcpiDmDumpFpdt, DtCompileFpdt,  TemplateFpdt,   "Firmware Performance Data Table"},
-    {ACPI_SIG_GTDT, AcpiDmTableInfoGtdt,    NULL,           NULL,           TemplateGtdt,   "Generic Timer Description Table"},
+    {ACPI_SIG_GTDT, NULL,                   AcpiDmDumpGtdt, DtCompileGtdt,  TemplateGtdt,   "Generic Timer Description Table"},
     {ACPI_SIG_HEST, NULL,                   AcpiDmDumpHest, DtCompileHest,  TemplateHest,   "Hardware Error Source Table"},
     {ACPI_SIG_HPET, AcpiDmTableInfoHpet,    NULL,           NULL,           TemplateHpet,   "High Precision Event Timer table"},
     {ACPI_SIG_IVRS, NULL,                   AcpiDmDumpIvrs, DtCompileIvrs,  TemplateIvrs,   "I/O Virtualization Reporting Structure"},
@@ -705,6 +727,7 @@ AcpiDmDumpTable (
         case ACPI_DMT_SPACEID:
         case ACPI_DMT_ACCWIDTH:
         case ACPI_DMT_IVRS:
+        case ACPI_DMT_GTDT:
         case ACPI_DMT_MADT:
         case ACPI_DMT_PCCT:
         case ACPI_DMT_PMTT:
@@ -716,6 +739,7 @@ AcpiDmDumpTable (
         case ACPI_DMT_EINJINST:
         case ACPI_DMT_ERSTACT:
         case ACPI_DMT_ERSTINST:
+        case ACPI_DMT_DMAR_SCOPE:
 
             ByteLength = 1;
             break;
@@ -1047,6 +1071,19 @@ AcpiDmDumpTable (
             AcpiOsPrintf (UINT16_FORMAT, ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]);
             break;
 
+        case ACPI_DMT_DMAR_SCOPE:
+
+            /* DMAR device scope types */
+
+            Temp8 = *Target;
+            if (Temp8 > ACPI_DMAR_SCOPE_TYPE_RESERVED)
+            {
+                Temp8 = ACPI_DMAR_SCOPE_TYPE_RESERVED;
+            }
+
+            AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmDmarScope[Temp8]);
+            break;
+
         case ACPI_DMT_EINJACT:
 
             /* EINJ Action types */
@@ -1099,6 +1136,19 @@ AcpiDmDumpTable (
             AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmErstInstructions[Temp8]);
             break;
 
+        case ACPI_DMT_GTDT:
+
+            /* GTDT subtable types */
+
+            Temp8 = *Target;
+            if (Temp8 > ACPI_GTDT_TYPE_RESERVED)
+            {
+                Temp8 = ACPI_GTDT_TYPE_RESERVED;
+            }
+
+            AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmGtdtSubnames[Temp8]);
+            break;
+
         case ACPI_DMT_HEST:
 
             /* HEST subtable types */
index 8d52ce3..72ec095 100644 (file)
@@ -891,18 +891,24 @@ AcpiDmDumpDmar (
             ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
             break;
 
-        case ACPI_DMAR_TYPE_ATSR:
+        case ACPI_DMAR_TYPE_ROOT_ATS:
 
             InfoTable = AcpiDmTableInfoDmar2;
             ScopeOffset = sizeof (ACPI_DMAR_ATSR);
             break;
 
-        case ACPI_DMAR_HARDWARE_AFFINITY:
+        case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
 
             InfoTable = AcpiDmTableInfoDmar3;
             ScopeOffset = sizeof (ACPI_DMAR_RHSA);
             break;
 
+        case ACPI_DMAR_TYPE_NAMESPACE:
+
+            InfoTable = AcpiDmTableInfoDmar4;
+            ScopeOffset = sizeof (ACPI_DMAR_ANDD);
+            break;
+
         default:
 
             AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", SubTable->Type);
@@ -916,7 +922,16 @@ AcpiDmDumpDmar (
             return;
         }
 
-        /* Dump the device scope entries (if any) */
+        /*
+         * Dump the optional device scope entries
+         */
+        if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
+            (SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE))
+        {
+            /* These types do not support device scopes */
+
+            goto NextSubtable;
+        }
 
         ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
         while (ScopeOffset < SubTable->Length)
@@ -956,6 +971,7 @@ AcpiDmDumpDmar (
                 ScopeTable, ScopeTable->Length);
         }
 
+NextSubtable:
         /* Point to next subtable */
 
         Offset += SubTable->Length;
@@ -1153,6 +1169,123 @@ NextSubTable:
 }
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDmDumpGtdt
+ *
+ * PARAMETERS:  Table               - A GTDT table
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Format the contents of a GTDT. This table type consists
+ *              of an open-ended number of subtables.
+ *
+ ******************************************************************************/
+
+void
+AcpiDmDumpGtdt (
+    ACPI_TABLE_HEADER       *Table)
+{
+    ACPI_STATUS             Status;
+    ACPI_GTDT_HEADER        *SubTable;
+    UINT32                  Length = Table->Length;
+    UINT32                  Offset = sizeof (ACPI_TABLE_GTDT);
+    ACPI_DMTABLE_INFO       *InfoTable;
+    UINT32                  SubTableLength;
+    UINT32                  GtCount;
+    ACPI_GTDT_TIMER_ENTRY   *GtxTable;
+
+
+    /* Main table */
+
+    Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
+    if (ACPI_FAILURE (Status))
+    {
+        return;
+    }
+
+    /* Subtables */
+
+    SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
+    while (Offset < Table->Length)
+    {
+        /* Common subtable header */
+
+        AcpiOsPrintf ("\n");
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
+                    SubTable->Length, AcpiDmTableInfoGtdtHdr);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        GtCount = 0;
+        switch (SubTable->Type)
+        {
+        case ACPI_GTDT_TYPE_TIMER_BLOCK:
+
+            SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
+            GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+                        SubTable))->TimerCount;
+
+            InfoTable = AcpiDmTableInfoGtdt0;
+            break;
+
+        case ACPI_GTDT_TYPE_WATCHDOG:
+
+            SubTableLength = sizeof (ACPI_GTDT_WATCHDOG);
+
+            InfoTable = AcpiDmTableInfoGtdt1;
+            break;
+
+        default:
+
+            /* Cannot continue on unknown type - no length */
+
+            AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", SubTable->Type);
+            return;
+        }
+
+        Status = AcpiDmDumpTable (Length, Offset, SubTable,
+                    SubTable->Length, InfoTable);
+        if (ACPI_FAILURE (Status))
+        {
+            return;
+        }
+
+        /* Point to end of current subtable (each subtable above is of fixed length) */
+
+        Offset += SubTableLength;
+
+        /* If there are any Gt Timer Blocks from above, dump them now */
+
+        if (GtCount)
+        {
+            GtxTable = ACPI_ADD_PTR (ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength);
+            SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
+
+            while (GtCount)
+            {
+                AcpiOsPrintf ("\n");
+                Status = AcpiDmDumpTable (Length, Offset, GtxTable,
+                            sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
+                if (ACPI_FAILURE (Status))
+                {
+                    return;
+                }
+                Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
+                GtxTable++;
+                GtCount--;
+            }
+        }
+
+        /* Point to next subtable */
+
+        SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength);
+    }
+}
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiDmDumpHest
@@ -1662,6 +1795,16 @@ AcpiDmDumpMadt (
             InfoTable = AcpiDmTableInfoMadt12;
             break;
 
+        case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
+
+            InfoTable = AcpiDmTableInfoMadt13;
+            break;
+
+        case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
+
+            InfoTable = AcpiDmTableInfoMadt14;
+            break;
+
         default:
 
             AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", SubTable->Type);
@@ -2017,6 +2160,7 @@ AcpiDmDumpPcct (
 {
     ACPI_STATUS             Status;
     ACPI_PCCT_SUBSPACE      *SubTable;
+    ACPI_DMTABLE_INFO       *InfoTable;
     UINT32                  Length = Table->Length;
     UINT32                  Offset = sizeof (ACPI_TABLE_PCCT);
 
@@ -2044,10 +2188,20 @@ AcpiDmDumpPcct (
             return;
         }
 
-        /* ACPI 5.0: Only one type of PCCT subtable is supported */
-
-        if (SubTable->Header.Type != ACPI_PCCT_TYPE_GENERIC_SUBSPACE)
+        switch (SubTable->Header.Type)
         {
+        case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
+
+            InfoTable = AcpiDmTableInfoPcct0;
+            break;
+
+        case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
+
+            InfoTable = AcpiDmTableInfoPcct1;
+            break;
+
+        default:
+
             AcpiOsPrintf (
                 "\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n",
                 SubTable->Header.Type);
@@ -2056,7 +2210,7 @@ AcpiDmDumpPcct (
 
         AcpiOsPrintf ("\n");
         Status = AcpiDmDumpTable (Length, Offset, SubTable,
-                    SubTable->Header.Length, AcpiDmTableInfoPcct0);
+                    SubTable->Header.Length, InfoTable);
         if (ACPI_FAILURE (Status))
         {
             return;
@@ -2210,8 +2364,7 @@ AcpiDmDumpPmtt (
             if (DomainCount)
             {
                 AcpiOsPrintf (
-                    "\n**** DomainCount exceeds subtable length\n\n",
-                    MemSubTable->Type);
+                    "\n**** DomainCount exceeds subtable length\n\n");
             }
 
             /* Walk the physical component (DIMM) subtables */
index 577dca7..0bfd9e6 100644 (file)
 #define ACPI_DMAR1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
 #define ACPI_DMAR2_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DMAR_ATSR,f)
 #define ACPI_DMAR3_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DMAR_RHSA,f)
+#define ACPI_DMAR4_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_DMAR_ANDD,f)
 #define ACPI_EINJ0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
 #define ACPI_ERST0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
 #define ACPI_FPDTH_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f)
 #define ACPI_FPDT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_FPDT_BOOT,f)
 #define ACPI_FPDT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_FPDT_S3PT_PTR,f)
+#define ACPI_GTDT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_BLOCK,f)
+#define ACPI_GTDT0a_OFFSET(f)           (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_ENTRY,f)
+#define ACPI_GTDT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_GTDT_WATCHDOG,f)
+#define ACPI_GTDTH_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_GTDT_HEADER,f)
 #define ACPI_HEST0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f)
 #define ACPI_HEST1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f)
 #define ACPI_HEST2_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_HEST_IA_NMI,f)
 #define ACPI_MADT10_OFFSET(f)           (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f)
 #define ACPI_MADT11_OFFSET(f)           (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f)
 #define ACPI_MADT12_OFFSET(f)           (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f)
+#define ACPI_MADT13_OFFSET(f)           (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f)
+#define ACPI_MADT14_OFFSET(f)           (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_REDISTRIBUTOR,f)
 #define ACPI_MADTH_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
 #define ACPI_MCFG0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
 #define ACPI_MPST0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f)
 #define ACPI_MSCT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
 #define ACPI_MTMR0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_MTMR_ENTRY,f)
 #define ACPI_PCCT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f)
+#define ACPI_PCCT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f)
 #define ACPI_PMTT0_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f)
 #define ACPI_PMTT1_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f)
 #define ACPI_PMTT1A_OFFSET(f)           (UINT16) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f)
 #define ACPI_SRAT1_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o)
 #define ACPI_SRAT2_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o)
 #define ACPI_GTDT_FLAG_OFFSET(f,o)      ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o)
+#define ACPI_GTDT0a_FLAG_OFFSET(f,o)    ACPI_FLAG_OFFSET (ACPI_GTDT_TIMER_ENTRY,f,o)
+#define ACPI_GTDT1_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o)
 #define ACPI_LPITH_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_LPIT_HEADER,f,o)
 #define ACPI_MADT_FLAG_OFFSET(f,o)      ACPI_FLAG_OFFSET (ACPI_TABLE_MADT,f,o)
 #define ACPI_MADT0_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC,f,o)
 #define ACPI_MADT9_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o)
 #define ACPI_MADT10_FLAG_OFFSET(f,o)    ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o)
 #define ACPI_MADT11_FLAG_OFFSET(f,o)    ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f,o)
+#define ACPI_MADT13_FLAG_OFFSET(f,o)    ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f,o)
 #define ACPI_MPST0_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_MPST_POWER_NODE,f,o)
 #define ACPI_MPST2_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_MPST_POWER_DATA,f,o)
 #define ACPI_PCCT_FLAG_OFFSET(f,o)      ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o)
+#define ACPI_PCCT1_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o)
 #define ACPI_PMTTH_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_PMTT_HEADER,f,o)
 #define ACPI_WDDT_FLAG_OFFSET(f,o)      ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o)
 #define ACPI_EINJ0_FLAG_OFFSET(f,o)     ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
@@ -440,17 +452,22 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoFadt2[] =
 {
     {ACPI_DMT_GAS,      ACPI_FADT_OFFSET (ResetRegister),           "Reset Register", 0},
     {ACPI_DMT_UINT8,    ACPI_FADT_OFFSET (ResetValue),              "Value to cause reset", 0},
-    {ACPI_DMT_UINT24,   ACPI_FADT_OFFSET (Reserved4[0]),            "Reserved", 0},
+    {ACPI_DMT_UINT16,   ACPI_FADT_OFFSET (ArmBootFlags),            "Reserved", 0},
+    {ACPI_DMT_UINT8,    ACPI_FADT_OFFSET (MinorRevision),           "Reserved", 0},
     ACPI_DMT_TERMINATOR
 };
 
-/* ACPI 2.0+ Extensions (FADT version 3 and 4) */
+/* ACPI 2.0+ Extensions (FADT version 3, 4, and 5) */
 
 ACPI_DMTABLE_INFO           AcpiDmTableInfoFadt3[] =
 {
     {ACPI_DMT_GAS,      ACPI_FADT_OFFSET (ResetRegister),           "Reset Register", 0},
     {ACPI_DMT_UINT8,    ACPI_FADT_OFFSET (ResetValue),              "Value to cause reset", 0},
-    {ACPI_DMT_UINT24,   ACPI_FADT_OFFSET (Reserved4[0]),            "Reserved", 0},
+    {ACPI_DMT_UINT16,   ACPI_FADT_OFFSET (ArmBootFlags),            "ARM Flags (decoded below)", DT_FLAG},
+    {ACPI_DMT_FLAG0,    ACPI_FADT_FLAG_OFFSET(ArmBootFlags,0),      "PSCI Compliant", 0},
+    {ACPI_DMT_FLAG1,    ACPI_FADT_FLAG_OFFSET(ArmBootFlags,0),      "Must use HVC for PSCI", 0},
+    ACPI_DMT_NEW_LINE,
+    {ACPI_DMT_UINT8,    ACPI_FADT_OFFSET (MinorRevision),           "FADT Minor Revision", 0},
     {ACPI_DMT_UINT64,   ACPI_FADT_OFFSET (XFacs),                   "FACS Address", 0},
     {ACPI_DMT_UINT64,   ACPI_FADT_OFFSET (XDsdt),                   "DSDT Address", 0},
     {ACPI_DMT_GAS,      ACPI_FADT_OFFSET (XPm1aEventBlock),         "PM1A Event Block", 0},
@@ -807,7 +824,7 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoDmarHdr[] =
 
 ACPI_DMTABLE_INFO           AcpiDmTableInfoDmarScope[] =
 {
-    {ACPI_DMT_UINT8,    ACPI_DMARS_OFFSET (EntryType),              "Device Scope Entry Type", 0},
+    {ACPI_DMT_DMAR_SCOPE, ACPI_DMARS_OFFSET (EntryType),            "Device Scope Type", 0},
     {ACPI_DMT_UINT8,    ACPI_DMARS_OFFSET (Length),                 "Entry Length", DT_LENGTH},
     {ACPI_DMT_UINT16,   ACPI_DMARS_OFFSET (Reserved),               "Reserved", 0},
     {ACPI_DMT_UINT8,    ACPI_DMARS_OFFSET (EnumerationId),          "Enumeration ID", 0},
@@ -859,6 +876,16 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoDmar3[] =
     ACPI_DMT_TERMINATOR
 };
 
+/* 4: ACPI Namespace Device Declaration Structure */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoDmar4[] =
+{
+    {ACPI_DMT_UINT24,   ACPI_DMAR4_OFFSET (Reserved[0]),            "Reserved", 0},
+    {ACPI_DMT_UINT8,    ACPI_DMAR4_OFFSET (DeviceNumber),           "Device Number", 0},
+    {ACPI_DMT_STRING,   ACPI_DMAR4_OFFSET (DeviceName[0]),          "Device Name", 0},
+    ACPI_DMT_TERMINATOR
+};
+
 
 /*******************************************************************************
  *
@@ -998,29 +1025,89 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoFpdt1[] =
 
 ACPI_DMTABLE_INFO           AcpiDmTableInfoGtdt[] =
 {
-    {ACPI_DMT_UINT64,   ACPI_GTDT_OFFSET (Address),                 "Timer Address", 0},
-    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (Flags),                   "Flags (decoded below)", DT_FLAG},
-    {ACPI_DMT_FLAG0,    ACPI_GTDT_FLAG_OFFSET (Flags,0),            "Memory Present", 0},
+    {ACPI_DMT_UINT64,   ACPI_GTDT_OFFSET (CounterBlockAddresss),    "Counter Block Address", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (Reserved),                "Reserved", 0},
     ACPI_DMT_NEW_LINE,
-    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (SecurePl1Interrupt),      "Secure PL1 Interrupt", 0},
-    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (SecurePl1Flags),          "SPL1 Flags (decoded below)", DT_FLAG},
-    {ACPI_DMT_FLAG0,    ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0),   "Trigger Mode", 0},
-    {ACPI_DMT_FLAG1,    ACPI_GTDT_FLAG_OFFSET (SecurePl1Flags,0),   "Polarity", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (SecureEl1Interrupt),      "Secure EL1 Interrupt", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (SecureEl1Flags),          "EL1 Flags (decoded below)", DT_FLAG},
+    {ACPI_DMT_FLAG0,    ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0),   "Trigger Mode", 0},
+    {ACPI_DMT_FLAG1,    ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0),   "Polarity", 0},
+    {ACPI_DMT_FLAG2,    ACPI_GTDT_FLAG_OFFSET (SecureEl1Flags,0),   "Always On", 0},
     ACPI_DMT_NEW_LINE,
-    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (NonSecurePl1Interrupt),   "Non-Secure PL1 Interrupt", 0},
-    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (NonSecurePl1Flags),       "NSPL1 Flags (decoded below)", DT_FLAG},
-    {ACPI_DMT_FLAG0,    ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Trigger Mode", 0},
-    {ACPI_DMT_FLAG1,    ACPI_GTDT_FLAG_OFFSET (NonSecurePl1Flags,0),"Polarity", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (NonSecureEl1Interrupt),   "Non-Secure EL1 Interrupt", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (NonSecureEl1Flags),       "NEL1 Flags (decoded below)", DT_FLAG},
+    {ACPI_DMT_FLAG0,    ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Trigger Mode", 0},
+    {ACPI_DMT_FLAG1,    ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Polarity", 0},
+    {ACPI_DMT_FLAG2,    ACPI_GTDT_FLAG_OFFSET (NonSecureEl1Flags,0),"Always On", 0},
     ACPI_DMT_NEW_LINE,
     {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (VirtualTimerInterrupt),   "Virtual Timer Interrupt", 0},
     {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (VirtualTimerFlags),       "VT Flags (decoded below)", DT_FLAG},
     {ACPI_DMT_FLAG0,    ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Trigger Mode", 0},
     {ACPI_DMT_FLAG1,    ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Polarity", 0},
+    {ACPI_DMT_FLAG2,    ACPI_GTDT_FLAG_OFFSET (VirtualTimerFlags,0),"Always On", 0},
+    ACPI_DMT_NEW_LINE,
+    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (NonSecureEl2Interrupt),   "Non-Secure EL2 Interrupt", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (NonSecureEl2Flags),       "NEL2 Flags (decoded below)", DT_FLAG},
+    {ACPI_DMT_FLAG0,    ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Trigger Mode", 0},
+    {ACPI_DMT_FLAG1,    ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Polarity", 0},
+    {ACPI_DMT_FLAG2,    ACPI_GTDT_FLAG_OFFSET (NonSecureEl2Flags,0),"Always On", 0},
+    {ACPI_DMT_UINT64,   ACPI_GTDT_OFFSET (CounterReadBlockAddress), "Counter Read Block Address", 0},
     ACPI_DMT_NEW_LINE,
-    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (NonSecurePl2Interrupt),   "Non-Secure PL2 Interrupt", 0},
-    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (NonSecurePl2Flags),       "NSPL2 Flags (decoded below)", DT_FLAG},
-    {ACPI_DMT_FLAG0,    ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Trigger Mode", 0},
-    {ACPI_DMT_FLAG1,    ACPI_GTDT_FLAG_OFFSET (NonSecurePl2Flags,0),"Polarity", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (PlatformTimerCount),      "Platform Timer Count", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT_OFFSET (PlatformTimerOffset),     "Platform Timer Offset", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+/* GTDT Subtable header (one per Subtable) */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoGtdtHdr[] =
+{
+    {ACPI_DMT_GTDT,     ACPI_GTDTH_OFFSET (Type),                   "Subtable Type", 0},
+    {ACPI_DMT_UINT16,   ACPI_GTDTH_OFFSET (Length),                 "Length", DT_LENGTH},
+    ACPI_DMT_TERMINATOR
+};
+
+/* GTDT Subtables */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoGtdt0[] =
+{
+    {ACPI_DMT_UINT8,    ACPI_GTDT0_OFFSET (Reserved),               "Reserved", 0},
+    {ACPI_DMT_UINT64,   ACPI_GTDT0_OFFSET (BlockAddress),           "Block Address", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT0_OFFSET (TimerCount),             "Timer Count", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT0_OFFSET (TimerOffset),            "Timer Offset", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoGtdt0a[] =
+{
+    {ACPI_DMT_UINT8 ,   ACPI_GTDT0a_OFFSET (FrameNumber),               "Frame Number", 0},
+    {ACPI_DMT_UINT24,   ACPI_GTDT0a_OFFSET (Reserved[0]),               "Reserved", 0},
+    {ACPI_DMT_UINT64,   ACPI_GTDT0a_OFFSET (BaseAddress),               "Base Address", 0},
+    {ACPI_DMT_UINT64,   ACPI_GTDT0a_OFFSET (El0BaseAddress),            "EL0 Base Address", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT0a_OFFSET (TimerInterrupt),            "Timer Interrupt", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT0a_OFFSET (TimerFlags),                "Timer Flags (decoded below)", 0},
+    {ACPI_DMT_FLAG0,    ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0),         "Trigger Mode", 0},
+    {ACPI_DMT_FLAG1,    ACPI_GTDT0a_FLAG_OFFSET (TimerFlags,0),         "Polarity", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT0a_OFFSET (VirtualTimerInterrupt),     "Virtual Timer Interrupt", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT0a_OFFSET (VirtualTimerFlags),         "Virtual Timer Flags (decoded below)", 0},
+    {ACPI_DMT_FLAG0,    ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0),  "Trigger Mode", 0},
+    {ACPI_DMT_FLAG1,    ACPI_GTDT0a_FLAG_OFFSET (VirtualTimerFlags,0),  "Polarity", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT0a_OFFSET (CommonFlags),               "Common Flags (decoded below)", 0},
+    {ACPI_DMT_FLAG0,    ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0),        "Secure", 0},
+    {ACPI_DMT_FLAG1,    ACPI_GTDT0a_FLAG_OFFSET (CommonFlags,0),        "Always On", 0},
+    ACPI_DMT_TERMINATOR
+};
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoGtdt1[] =
+{
+    {ACPI_DMT_UINT8,    ACPI_GTDT1_OFFSET (Reserved),               "Reserved", 0},
+    {ACPI_DMT_UINT64,   ACPI_GTDT1_OFFSET (RefreshFrameAddress),    "Refresh Frame Address", 0},
+    {ACPI_DMT_UINT64,   ACPI_GTDT1_OFFSET (ControlFrameAddress),    "Control Frame Address", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT1_OFFSET (TimerInterrupt),         "Timer Interrupt", 0},
+    {ACPI_DMT_UINT32,   ACPI_GTDT1_OFFSET (TimerFlags),             "Timer Flags (decoded below)", DT_FLAG},
+    {ACPI_DMT_FLAG0,    ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0),      "Trigger Mode", 0},
+    {ACPI_DMT_FLAG1,    ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0),      "Polarity", 0},
+    {ACPI_DMT_FLAG2,    ACPI_GTDT1_FLAG_OFFSET (TimerFlags,0),      "Security", 0},
     ACPI_DMT_TERMINATOR
 };
 
@@ -1527,14 +1614,21 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoMadt10[] =
 ACPI_DMTABLE_INFO           AcpiDmTableInfoMadt11[] =
 {
     {ACPI_DMT_UINT16,   ACPI_MADT11_OFFSET (Reserved),              "Reserved", 0},
-    {ACPI_DMT_UINT32,   ACPI_MADT11_OFFSET (GicId),                 "Local GIC Hardware ID", 0},
+    {ACPI_DMT_UINT32,   ACPI_MADT11_OFFSET (CpuInterfaceNumber),    "CPU Interface Number", 0},
     {ACPI_DMT_UINT32,   ACPI_MADT11_OFFSET (Uid),                   "Processor UID", 0},
     {ACPI_DMT_UINT32,   ACPI_MADT11_OFFSET (Flags),                 "Flags (decoded below)", DT_FLAG},
     {ACPI_DMT_FLAG0,    ACPI_MADT11_FLAG_OFFSET (Flags,0),          "Processor Enabled", 0},
+    {ACPI_DMT_FLAG1,    ACPI_MADT11_FLAG_OFFSET (Flags,0),          "Performance Interrupt Trigger Mode", 0},
+    {ACPI_DMT_FLAG2,    ACPI_MADT11_FLAG_OFFSET (Flags,0),          "Virtual GIC Interrupt Trigger Mode", 0},
     {ACPI_DMT_UINT32,   ACPI_MADT11_OFFSET (ParkingVersion),        "Parking Protocol Version", 0},
     {ACPI_DMT_UINT32,   ACPI_MADT11_OFFSET (PerformanceInterrupt),  "Performance Interrupt", 0},
     {ACPI_DMT_UINT64,   ACPI_MADT11_OFFSET (ParkedAddress),         "Parked Address", 0},
     {ACPI_DMT_UINT64,   ACPI_MADT11_OFFSET (BaseAddress),           "Base Address", 0},
+    {ACPI_DMT_UINT64,   ACPI_MADT11_OFFSET (GicvBaseAddress),       "Virtual GIC Base Address", 0},
+    {ACPI_DMT_UINT64,   ACPI_MADT11_OFFSET (GichBaseAddress),       "Hypervisor GIC Base Address", 0},
+    {ACPI_DMT_UINT32,   ACPI_MADT11_OFFSET (VgicInterrupt),         "Virtual GIC Interrupt", 0},
+    {ACPI_DMT_UINT64,   ACPI_MADT11_OFFSET (GicrBaseAddress),       "Redistributor Base Address", 0},
+    {ACPI_DMT_UINT64,   ACPI_MADT11_OFFSET (ArmMpidr),              "ARM MPIDR", 0},
     ACPI_DMT_TERMINATOR
 };
 
@@ -1550,6 +1644,30 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoMadt12[] =
    ACPI_DMT_TERMINATOR
 };
 
+/* 13: Generic MSI Frame (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoMadt13[] =
+{
+    {ACPI_DMT_UINT16,   ACPI_MADT13_OFFSET (Reserved),              "Reserved", 0},
+    {ACPI_DMT_UINT32,   ACPI_MADT13_OFFSET (MsiFrameId),            "MSI Frame ID", 0},
+    {ACPI_DMT_UINT64,   ACPI_MADT13_OFFSET (BaseAddress),           "Base Address", 0},
+    {ACPI_DMT_UINT32,   ACPI_MADT13_OFFSET (Flags),                 "Flags (decoded below)", DT_FLAG},
+    {ACPI_DMT_FLAG0,    ACPI_MADT13_FLAG_OFFSET (Flags,0),          "Select SPI", 0},
+    {ACPI_DMT_UINT16,   ACPI_MADT13_OFFSET (SpiCount),              "SPI Count", 0},
+    {ACPI_DMT_UINT16,   ACPI_MADT13_OFFSET (SpiBase),               "SPI Base", 0},
+   ACPI_DMT_TERMINATOR
+};
+
+/* 14: Generic Redistributor (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoMadt14[] =
+{
+    {ACPI_DMT_UINT16,   ACPI_MADT14_OFFSET (Reserved),              "Reserved", 0},
+    {ACPI_DMT_UINT64,   ACPI_MADT14_OFFSET (BaseAddress),           "Base Address", 0},
+    {ACPI_DMT_UINT32,   ACPI_MADT14_OFFSET (Length),                "Length", 0},
+   ACPI_DMT_TERMINATOR
+};
+
 
 /*******************************************************************************
  *
@@ -1769,6 +1887,26 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoPcct0[] =
     ACPI_DMT_TERMINATOR
 };
 
+/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
+
+ACPI_DMTABLE_INFO           AcpiDmTableInfoPcct1[] =
+{
+    {ACPI_DMT_UINT32,   ACPI_PCCT1_OFFSET (DoorbellInterrupt),      "Doorbell Interrupt", 0},
+    {ACPI_DMT_UINT8,    ACPI_PCCT1_OFFSET (Flags),                  "Flags (Decoded Below)", DT_FLAG},
+    {ACPI_DMT_FLAG0,    ACPI_PCCT1_FLAG_OFFSET (Flags,0),           "Polarity", 0},
+    {ACPI_DMT_FLAG1,    ACPI_PCCT1_FLAG_OFFSET (Flags,0),           "Mode", 0},
+    {ACPI_DMT_UINT8,    ACPI_PCCT1_OFFSET (Reserved),               "Reserved", 0},
+    {ACPI_DMT_UINT64,   ACPI_PCCT1_OFFSET (BaseAddress),            "Base Address", 0},
+    {ACPI_DMT_UINT64,   ACPI_PCCT1_OFFSET (Length),                 "Address Length", 0},
+    {ACPI_DMT_GAS,      ACPI_PCCT1_OFFSET (DoorbellRegister),       "Doorbell Register", 0},
+    {ACPI_DMT_UINT64,   ACPI_PCCT1_OFFSET (PreserveMask),           "Preserve Mask", 0},
+    {ACPI_DMT_UINT64,   ACPI_PCCT1_OFFSET (WriteMask),              "Write Mask", 0},
+    {ACPI_DMT_UINT32,   ACPI_PCCT1_OFFSET (Latency),                "Command Latency", 0},
+    {ACPI_DMT_UINT32,   ACPI_PCCT1_OFFSET (MaxAccessRate),          "Maximum Access Rate", 0},
+    {ACPI_DMT_UINT16,   ACPI_PCCT1_OFFSET (MinTurnaroundTime),      "Minimum Turnaround Time", 0},
+    ACPI_DMT_TERMINATOR
+};
+
 
 /*******************************************************************************
  *
index 112c121..940f220 100644 (file)
@@ -569,3 +569,51 @@ ApCheckRegMethod (
 
     AslError (ASL_WARNING, ASL_MSG_NO_REGION, Op, NULL);
 }
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    ApFindNameInScope
+ *
+ * PARAMETERS:  Name                - Name to search for
+ *              Op                  - Current parse op
+ *
+ * RETURN:      TRUE if name found in the same scope as Op.
+ *
+ * DESCRIPTION: Determine if a name appears in the same scope as Op, as either
+ *              a Method() or a Name().
+ *
+ ******************************************************************************/
+
+BOOLEAN
+ApFindNameInScope (
+    char                    *Name,
+    ACPI_PARSE_OBJECT       *Op)
+{
+    ACPI_PARSE_OBJECT       *Next;
+    ACPI_PARSE_OBJECT       *Parent;
+
+
+    /* Get the start of the current scope */
+
+    Parent = Op->Asl.Parent;
+    Next = Parent->Asl.Child;
+
+    /* Search entire scope for a match to the name */
+
+    while (Next)
+    {
+        if ((Next->Asl.ParseOpcode == PARSEOP_METHOD) ||
+            (Next->Asl.ParseOpcode == PARSEOP_NAME))
+        {
+            if (ACPI_COMPARE_NAME (Name, Next->Asl.NameSeg))
+            {
+                return (TRUE);
+            }
+        }
+
+        Next = Next->Asl.Next;
+    }
+
+    return (FALSE);
+}
index 40dcd69..10251a8 100644 (file)
@@ -275,6 +275,11 @@ void
 ApCheckRegMethod (
     ACPI_PARSE_OBJECT       *Op);
 
+BOOLEAN
+ApFindNameInScope (
+    char                    *Name,
+    ACPI_PARSE_OBJECT       *Op);
+
 
 /*
  * aslerror - error handling/reporting
@@ -890,10 +895,6 @@ void
 UtDisplaySummary (
     UINT32                  FileId);
 
-UINT8
-UtHexCharToValue (
-    int                     HexChar);
-
 void
 UtConvertByteToHex (
     UINT8                   RawByte,
@@ -954,11 +955,6 @@ ACPI_STATUS
 AuValidateUuid (
     char                    *InString);
 
-ACPI_STATUS
-AuConvertStringToUuid (
-    char                    *InString,
-    char                    *UuIdBuffer);
-
 ACPI_STATUS
 AuConvertUuidToString (
     char                    *UuIdBuffer,
index 286e628..60caa49 100644 (file)
@@ -110,10 +110,10 @@ NamePathTail                [.]{NameSeg}
 [ \t]                       { count (0); }
 
 
-"/*"                        { if (!AslDoComment ()) yyterminate (); }
-"//"                        { if (!AslDoCommentType2 ()) yyterminate (); }
+"/*"                        { if (!AslDoComment ()) {yyterminate ();} }
+"//"                        { if (!AslDoCommentType2 ()) {yyterminate ();} }
 
-"\""                        { if (AslDoStringLiteral ()) return (PARSEOP_STRING_LITERAL); else yyterminate (); }
+"\""                        { if (AslDoStringLiteral ()) {return (PARSEOP_STRING_LITERAL);} else {yyterminate ();} }
 ";"                         { count (0); return(';'); }
 
 
@@ -639,9 +639,9 @@ NamePathTail                [.]{NameSeg}
                                 AslCompilererror (MsgBuffer);}
 
 <<EOF>>                     { if (AslPopInputFileStack ())
-                                yyterminate();
+                                {yyterminate();}
                               else
-                                return (PARSEOP_INCLUDE_END);};
+                                {return (PARSEOP_INCLUDE_END);} };
 
 %%
 
index 9e42a30..636a02c 100644 (file)
@@ -55,7 +55,7 @@
 #define ASL_INVOCATION_NAME         "iasl"
 #define ASL_CREATOR_ID              "INTL"
 
-#define ASL_COMPLIANCE              "Supports ACPI Specification Revision 5.0A"
+#define ASL_COMPLIANCE              "Supports ACPI Specification Revision 5.1"
 
 
 /* Configuration constants */
index 2707f4d..4896d70 100644 (file)
 
 #ifdef _DECLARE_GLOBALS
 UINT32                              Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0};
-char                                AslHexLookup[] =
-{
-    '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
-};
-
 
 /* Table below must match ASL_FILE_TYPES in asltypes.h */
 
@@ -92,7 +87,6 @@ ASL_FILE_INFO                       Gbl_Files [ASL_NUM_FILES] =
 
 #else
 extern UINT32                       Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
-extern char                         AslHexLookup[];
 extern ASL_FILE_INFO                Gbl_Files [ASL_NUM_FILES];
 #endif
 
index 926bc46..c9d196f 100644 (file)
@@ -233,6 +233,7 @@ const char                      *AslCompilerMsgs [] =
 /*    ASL_MSG_WRITE */                      "Could not write file",
 /*    ASL_MSG_RANGE */                      "Constant out of range",
 /*    ASL_MSG_BUFFER_ALLOCATION */          "Could not allocate line buffer",
+/*    ASL_MSG_MISSING_DEPENDENCY */         "Missing dependency"
 };
 
 /* Table compiler */
index 851d46c..48ebcbf 100644 (file)
@@ -235,6 +235,7 @@ typedef enum
     ASL_MSG_WRITE,
     ASL_MSG_RANGE,
     ASL_MSG_BUFFER_ALLOCATION,
+    ASL_MSG_MISSING_DEPENDENCY,
 
     /* These messages are used by the Data Table compiler only */
 
index a9b0640..a040d92 100644 (file)
@@ -108,6 +108,17 @@ MtMethodAnalysisWalkBegin (
 
         WalkInfo->MethodStack = MethodInfo;
 
+        /* Special handling for _DSD, must have a _HID also */
+
+        if (!ACPI_STRCMP (METHOD_NAME__DSD, Op->Asl.NameSeg))
+        {
+            if (!ApFindNameInScope (METHOD_NAME__HID, Op))
+            {
+                AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+                    "_DSD requires _HID in same scope");
+            }
+        }
+
         /* Get the name node */
 
         Next = Op->Asl.Child;
@@ -413,6 +424,15 @@ MtMethodAnalysisWalkBegin (
             }
         }
 
+        else if (!ACPI_STRCMP (METHOD_NAME__DSD, Op->Asl.NameSeg))
+        {
+            if (!ApFindNameInScope (METHOD_NAME__HID, Op))
+            {
+                AslError (ASL_WARNING, ASL_MSG_MISSING_DEPENDENCY, Op,
+                    "_DSD requires _HID in same scope");
+            }
+        }
+
         break;
 
     default:
index 7c1cd5b..d6f32d2 100644 (file)
@@ -623,10 +623,10 @@ OpcDoEisaId (
             (UINT32) ((UINT8) (InString[1] - 0x40)) << 21 |
             (UINT32) ((UINT8) (InString[2] - 0x40)) << 16 |
 
-            (UtHexCharToValue (InString[3])) << 12 |
-            (UtHexCharToValue (InString[4])) << 8  |
-            (UtHexCharToValue (InString[5])) << 4  |
-             UtHexCharToValue (InString[6]);
+            (AcpiUtAsciiCharToHex (InString[3])) << 12 |
+            (AcpiUtAsciiCharToHex (InString[4])) << 8  |
+            (AcpiUtAsciiCharToHex (InString[5])) << 4  |
+             AcpiUtAsciiCharToHex (InString[6]);
 
         /* Swap to little-endian to get final ID (see function header) */
 
@@ -666,7 +666,7 @@ OpcDoUuId (
     ACPI_PARSE_OBJECT       *Op)
 {
     char                    *InString;
-    char                    *Buffer;
+    UINT8                   *Buffer;
     ACPI_STATUS             Status = AE_OK;
     ACPI_PARSE_OBJECT       *NewOp;
 
@@ -681,7 +681,7 @@ OpcDoUuId (
     }
     else
     {
-        (void) AuConvertStringToUuid (InString, Buffer);
+        AcpiUtConvertStringToUuid (InString, Buffer);
     }
 
     /* Change Op to a Buffer */
index b4f9695..f6fed53 100644 (file)
@@ -289,6 +289,41 @@ ApCheckPackage (
             Package, 1, Count);
         break;
 
+    case ACPI_PTYPE2_UUID_PAIR:
+
+        /* The package contains a variable list of UUID Buffer/Package pairs */
+
+        /* The length of the package must be even */
+
+        if (Count & 1)
+        {
+            sprintf (MsgBuffer, "%4.4s: Package length, %d, must be even.",
+                Predefined->Info.Name, Count);
+
+            AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH,
+                ParentOp->Asl.Child, MsgBuffer);
+        }
+
+        /* Validate the alternating types */
+
+        for (i = 0; i < Count; ++i)
+        {
+            if (i & 1)
+            {
+                ApCheckObjectType (Predefined->Info.Name, Op,
+                    Package->RetInfo.ObjectType2, i);
+            }
+            else
+            {
+                ApCheckObjectType (Predefined->Info.Name, Op,
+                    Package->RetInfo.ObjectType1, i);
+            }
+
+            Op = Op->Asl.Next;
+        }
+
+        break;
+
     case ACPI_PTYPE2:
     case ACPI_PTYPE2_FIXED:
     case ACPI_PTYPE2_MIN:
index 7dc0697..b6e6087 100644 (file)
@@ -241,37 +241,6 @@ UtEndEvent (
 }
 
 
-/*******************************************************************************
- *
- * FUNCTION:    UtHexCharToValue
- *
- * PARAMETERS:  HexChar             - Hex character in Ascii
- *
- * RETURN:      The binary value of the hex character
- *
- * DESCRIPTION: Perform ascii-to-hex translation
- *
- ******************************************************************************/
-
-UINT8
-UtHexCharToValue (
-    int                     HexChar)
-{
-
-    if (HexChar <= 0x39)
-    {
-        return ((UINT8) (HexChar - 0x30));
-    }
-
-    if (HexChar <= 0x46)
-    {
-        return ((UINT8) (HexChar - 0x37));
-    }
-
-    return ((UINT8) (HexChar - 0x57));
-}
-
-
 /*******************************************************************************
  *
  * FUNCTION:    UtConvertByteToHex
@@ -296,8 +265,8 @@ UtConvertByteToHex (
     Buffer[0] = '0';
     Buffer[1] = 'x';
 
-    Buffer[2] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
-    Buffer[3] = (UINT8) AslHexLookup[RawByte & 0xF];
+    Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
+    Buffer[3] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
 }
 
 
@@ -312,7 +281,7 @@ UtConvertByteToHex (
  * RETURN:      Ascii hex byte is stored in Buffer.
  *
  * DESCRIPTION: Perform hex-to-ascii translation. The return data is prefixed
- *              with "0x"
+ *              with '0', and a trailing 'h' is added.
  *
  ******************************************************************************/
 
@@ -323,8 +292,8 @@ UtConvertByteToAsmHex (
 {
 
     Buffer[0] = '0';
-    Buffer[1] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF];
-    Buffer[2] = (UINT8) AslHexLookup[RawByte & 0xF];
+    Buffer[1] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 4);
+    Buffer[2] = (UINT8) AcpiUtHexToAsciiChar (RawByte, 0);
     Buffer[3] = 'h';
 }
 
index f7b1f0c..f79a33b 100644 (file)
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-
 #include "aslcompiler.h"
 
 #define _COMPONENT          ACPI_COMPILER
         ACPI_MODULE_NAME    ("asluuid")
 
 
-/*
- * UUID support functions.
- *
- * This table is used to convert an input UUID ascii string to a 16 byte
- * buffer and the reverse. The table maps a UUID buffer index 0-15 to
- * the index within the 36-byte UUID string where the associated 2-byte
- * hex value can be found.
- *
- * 36-byte UUID strings are of the form:
- *     aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
- * Where aa-pp are one byte hex numbers, made up of two hex digits
- *
- * Note: This table is basically the inverse of the string-to-offset table
- * found in the ACPI spec in the description of the ToUUID macro.
- */
-static UINT8    Gbl_MapToUuidOffset[16] =
-{
-    6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
-};
-
-#define UUID_BUFFER_LENGTH          16
-#define UUID_STRING_LENGTH          36
-
-/* Positions for required hyphens (dashes) in UUID strings */
-
-#define UUID_HYPHEN1_OFFSET         8
-#define UUID_HYPHEN2_OFFSET         13
-#define UUID_HYPHEN3_OFFSET         18
-#define UUID_HYPHEN4_OFFSET         23
+extern UINT8    AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH];
 
 
 /*******************************************************************************
@@ -135,42 +106,6 @@ AuValidateUuid (
 }
 
 
-/*******************************************************************************
- *
- * FUNCTION:    AuConvertStringToUuid
- *
- * PARAMETERS:  InString            - 36-byte formatted UUID string
- *              UuidBuffer          - 16-byte UUID buffer
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Convert 36-byte formatted UUID string to 16-byte UUID buffer
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AuConvertStringToUuid (
-    char                    *InString,
-    char                    *UuidBuffer)
-{
-    UINT32                  i;
-
-
-    if (!InString || !UuidBuffer)
-    {
-        return (AE_BAD_PARAMETER);
-    }
-
-    for (i = 0; i < UUID_BUFFER_LENGTH; i++)
-    {
-        UuidBuffer[i]  = (char) (UtHexCharToValue (InString[Gbl_MapToUuidOffset[i]]) << 4);
-        UuidBuffer[i] |= (char)  UtHexCharToValue (InString[Gbl_MapToUuidOffset[i] + 1]);
-    }
-
-    return (AE_OK);
-}
-
-
 /*******************************************************************************
  *
  * FUNCTION:    AuConvertUuidToString
@@ -200,8 +135,11 @@ AuConvertUuidToString (
 
     for (i = 0; i < UUID_BUFFER_LENGTH; i++)
     {
-        OutString[Gbl_MapToUuidOffset[i]] =     (UINT8) AslHexLookup[(UuidBuffer[i] >> 4) & 0xF];
-        OutString[Gbl_MapToUuidOffset[i] + 1] = (UINT8) AslHexLookup[UuidBuffer[i] & 0xF];
+        OutString[AcpiGbl_MapToUuidOffset[i]] =
+            AcpiUtHexToAsciiChar (UuidBuffer[i], 4);
+
+        OutString[AcpiGbl_MapToUuidOffset[i] + 1] =
+            AcpiUtHexToAsciiChar (UuidBuffer[i], 0);
     }
 
     /* Insert required hyphens (dashes) */
index db5d306..cec699c 100644 (file)
@@ -419,6 +419,10 @@ ACPI_STATUS
 DtCompileFpdt (
     void                    **PFieldList);
 
+ACPI_STATUS
+DtCompileGtdt (
+    void                    **PFieldList);
+
 ACPI_STATUS
 DtCompileHest (
     void                    **PFieldList);
index ff77242..98c8779 100644 (file)
@@ -259,7 +259,7 @@ DtCompileUuid (
     }
     else
     {
-        Status = AuConvertStringToUuid (InString, (char *) Buffer);
+        AcpiUtConvertStringToUuid (InString, Buffer);
     }
 
     return (Status);
index c341bf2..78a459f 100644 (file)
@@ -736,16 +736,21 @@ DtCompileDmar (
             InfoTable = AcpiDmTableInfoDmar1;
             break;
 
-        case ACPI_DMAR_TYPE_ATSR:
+        case ACPI_DMAR_TYPE_ROOT_ATS:
 
             InfoTable = AcpiDmTableInfoDmar2;
             break;
 
-        case ACPI_DMAR_HARDWARE_AFFINITY:
+        case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
 
             InfoTable = AcpiDmTableInfoDmar3;
             break;
 
+        case ACPI_DMAR_TYPE_NAMESPACE:
+
+            InfoTable = AcpiDmTableInfoDmar4;
+            break;
+
         default:
 
             DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
@@ -762,10 +767,20 @@ DtCompileDmar (
 
         ParentTable = DtPeekSubtable ();
         DtInsertSubtable (ParentTable, Subtable);
-        DtPushSubtable (Subtable);
 
-        /* Optional Device Scope subtables */
+        /*
+         * Optional Device Scope subtables
+         */
+        if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
+            (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
+        {
+            /* These types do not support device scopes */
 
+            DtPopSubtable ();
+            continue;
+        }
+
+        DtPushSubtable (Subtable);
         DeviceScopeLength = DmarHeader->Length - Subtable->Length -
             ParentTable->Length;
         while (DeviceScopeLength)
@@ -938,6 +953,125 @@ DtCompileFadt (
     return (AE_OK);
 }
 
+/******************************************************************************
+ *
+ * FUNCTION:    DtCompileGtdt
+ *
+ * PARAMETERS:  List                - Current field list pointer
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Compile GTDT.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileGtdt (
+    void                    **List)
+{
+    ACPI_STATUS             Status;
+    DT_SUBTABLE             *Subtable;
+    DT_SUBTABLE             *ParentTable;
+    DT_FIELD                **PFieldList = (DT_FIELD **) List;
+    DT_FIELD                *SubtableStart;
+    ACPI_SUBTABLE_HEADER    *GtdtHeader;
+    ACPI_DMTABLE_INFO       *InfoTable;
+    UINT32                  GtCount;
+
+
+    Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
+                &Subtable, TRUE);
+    if (ACPI_FAILURE (Status))
+    {
+        return (Status);
+    }
+
+    ParentTable = DtPeekSubtable ();
+    DtInsertSubtable (ParentTable, Subtable);
+
+    while (*PFieldList)
+    {
+        SubtableStart = *PFieldList;
+        Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtHdr,
+                    &Subtable, TRUE);
+        if (ACPI_FAILURE (Status))
+        {
+            return (Status);
+        }
+
+        ParentTable = DtPeekSubtable ();
+        DtInsertSubtable (ParentTable, Subtable);
+        DtPushSubtable (Subtable);
+
+        GtdtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
+
+        switch (GtdtHeader->Type)
+        {
+        case ACPI_GTDT_TYPE_TIMER_BLOCK:
+
+            InfoTable = AcpiDmTableInfoGtdt0;
+            break;
+
+        case ACPI_GTDT_TYPE_WATCHDOG:
+
+            InfoTable = AcpiDmTableInfoGtdt1;
+            break;
+
+        default:
+
+            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "GTDT");
+            return (AE_ERROR);
+        }
+
+        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+        if (ACPI_FAILURE (Status))
+        {
+            return (Status);
+        }
+
+        ParentTable = DtPeekSubtable ();
+        DtInsertSubtable (ParentTable, Subtable);
+
+        /*
+         * Additional GT block subtable data
+         */
+
+        switch (GtdtHeader->Type)
+        {
+        case ACPI_GTDT_TYPE_TIMER_BLOCK:
+
+            DtPushSubtable (Subtable);
+            ParentTable = DtPeekSubtable ();
+
+            GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
+                Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
+            while (GtCount)
+            {
+                Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt0a,
+                            &Subtable, TRUE);
+                if (ACPI_FAILURE (Status))
+                {
+                    return (Status);
+                }
+
+
+                DtInsertSubtable (ParentTable, Subtable);
+                GtCount--;
+            }
+            DtPopSubtable ();
+            break;
+
+        default:
+
+            break;
+        }
+
+        DtPopSubtable ();
+    }
+
+    return (AE_OK);
+}
+
 
 /******************************************************************************
  *
@@ -1501,6 +1635,16 @@ DtCompileMadt (
             InfoTable = AcpiDmTableInfoMadt12;
             break;
 
+        case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
+
+            InfoTable = AcpiDmTableInfoMadt13;
+            break;
+
+        case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
+
+            InfoTable = AcpiDmTableInfoMadt14;
+            break;
+
         default:
 
             DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT");
@@ -1792,6 +1936,11 @@ DtCompilePcct (
             InfoTable = AcpiDmTableInfoPcct0;
             break;
 
+        case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
+
+            InfoTable = AcpiDmTableInfoPcct1;
+            break;
+
         default:
 
             DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
index 4c8ba08..67515ea 100644 (file)
@@ -395,7 +395,7 @@ const unsigned char TemplateFadt[] =
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000068    "........" */
     0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01,  /* 00000070    "........" */
     0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000078    "........" */
-    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000080    "........" */
+    0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,  /* 00000080    "........" */
     0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000088    "........" */
     0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x02,  /* 00000090    "..... .." */
     0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000098    "........" */
@@ -434,16 +434,34 @@ const unsigned char TemplateFpdt[] =
 
 const unsigned char TemplateGtdt[] =
 {
-    0x47,0x54,0x44,0x54,0x50,0x00,0x00,0x00,  /* 00000000    "GTDTP..." */
-    0x01,0xF1,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
-    0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
-    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-    0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "#.. ...." */
-    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000028    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000030    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000038    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000040    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00   /* 00000048    "........" */
+    0x47,0x54,0x44,0x54,0xe0,0x00,0x00,0x00,  /* 00000000    "GTDT...." */
+    0x02,0xb0,0x4c,0x49,0x4e,0x41,0x52,0x4f,  /* 00000008    "..LINARO" */
+    0x52,0x54,0x53,0x4d,0x56,0x45,0x56,0x38,  /* 00000010    "RTSMVEV8" */
+    0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c,  /* 00000018    "....INTL" */
+    0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "$.. ...." */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000028    "........" */
+    0x1d,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000030    "........" */
+    0x1e,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000038    "........" */
+    0x1b,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000040    "........" */
+    0x1a,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000048    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000050    "........" */
+    0x02,0x00,0x00,0x00,0x60,0x00,0x00,0x00,  /* 00000058    "....`..." */
+    0x00,0x64,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000060    ".d......" */
+    0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,  /* 00000068    "........" */
+    0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000070    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000078    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000080    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000088    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000090    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000098    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000a0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000a8    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 000000b0    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 000000b8    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x1c,0x00,0x00,  /* 000000c0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000c8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000d0    "........" */
+    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 000000d8    "........" */
 };
 
 const unsigned char TemplateHest[] =
@@ -575,41 +593,48 @@ const unsigned char TemplateLpit[] =
     0x00,0x00,0x00,0x00                       /* 000000B0    "...."     */
 };
 
-/* MADT with ACPI 5.0 subtables */
+/* MADT with ACPI 5.1 subtables */
 
 const unsigned char TemplateMadt[] =
 {
-    0x41,0x50,0x49,0x43,0xF6,0x00,0x00,0x00,  /* 00000000    "APIC...." */
-    0x01,0xB0,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
-    0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
-    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-    0x23,0x06,0x11,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "#.. ...." */
+    0x41,0x50,0x49,0x43,0x2a,0x01,0x00,0x00,  /* 00000000    "APIC*..." */
+    0x04,0x34,0x49,0x4e,0x54,0x45,0x4c,0x20,  /* 00000008    ".4INTEL " */
+    0x54,0x45,0x4d,0x50,0x4c,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
+    0x01,0x00,0x00,0x00,0x49,0x4e,0x54,0x4c,  /* 00000018    "....INTL" */
+    0x24,0x04,0x14,0x20,0x00,0x00,0x00,0x00,  /* 00000020    "$.. ...." */
     0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00,  /* 00000028    "........" */
-    0x01,0x00,0x00,0x00,0x01,0x0C,0x01,0x00,  /* 00000030    "........" */
+    0x01,0x00,0x00,0x00,0x01,0x0c,0x01,0x00,  /* 00000030    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000038    "........" */
-    0x02,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000040    "........" */
-    0x00,0x00,0x03,0x08,0x0D,0x00,0x01,0x00,  /* 00000048    "........" */
+    0x02,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000040    "........" */
+    0x00,0x00,0x03,0x08,0x0d,0x00,0x01,0x00,  /* 00000048    "........" */
     0x00,0x00,0x04,0x06,0x00,0x05,0x00,0x01,  /* 00000050    "........" */
-    0x05,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000058    "........" */
+    0x05,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000058    "........" */
     0x00,0x00,0x00,0x00,0x06,0x10,0x00,0x00,  /* 00000060    "........" */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000068    "........" */
     0x00,0x00,0x00,0x00,0x07,0x16,0x00,0x00,  /* 00000070    "........" */
     0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000078    "........" */
-    0x00,0x00,0x00,0x00,0x5C,0x43,0x50,0x55,  /* 00000080    "....\CPU" */
+    0x00,0x00,0x00,0x00,0x5c,0x43,0x50,0x55,  /* 00000080    "....\CPU" */
     0x30,0x00,0x08,0x10,0x05,0x00,0x00,0x00,  /* 00000088    "0......." */
     0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,  /* 00000090    "........" */
     0x00,0x00,0x09,0x10,0x00,0x00,0x00,0x00,  /* 00000098    "........" */
-    0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,  /* 000000A0    "........" */
-    0x00,0x00,0x0A,0x0C,0x05,0x00,0x00,0x00,  /* 000000A8    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x28,  /* 000000B0    ".......(" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000B8    "........" */
-    0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,  /* 000000C0    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000C8    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000D0    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x18,  /* 000000D8    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E0    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E8    "........" */
-    0x00,0x00,0x00,0x00,0x00,0x00             /* 000000F0    "......"   */
+    0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,  /* 000000a0    "........" */
+    0x00,0x00,0x0a,0x0c,0x05,0x00,0x00,0x00,  /* 000000a8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x4c,  /* 000000b0    ".......L" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000b8    "........" */
+    0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,  /* 000000c0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000c8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000d0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000d8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000e0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000e8    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000f0    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000f8    "........" */
+    0x00,0x00,0x0e,0x10,0x00,0x00,0x00,0x00,  /* 00000100    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000108    "........" */
+    0x00,0x00,0x0c,0x18,0x00,0x00,0x00,0x00,  /* 00000110    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000118    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000120    "........" */
+    0x00,0x00                                 /* 00000128    "..      " */
 };
 
 const unsigned char TemplateMcfg[] =
@@ -703,27 +728,27 @@ const unsigned char TemplateMtmr[] =
 const unsigned char TemplatePcct[] =
 {
     0x50,0x43,0x43,0x54,0xAC,0x00,0x00,0x00,  /* 00000000    "PCCT...." */
-    0x01,0x97,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
-    0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
+    0x01,0xCF,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
+    0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65,  /* 00000010    "Template" */
     0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
-    0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00,  /* 00000020    "... ...." */
+    0x27,0x06,0x14,0x20,0x01,0x00,0x00,0x00,  /* 00000020    "'.. ...." */
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000028    "........" */
     0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000030    ".>......" */
-    0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,  /* 00000038    "........" */
-    0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,  /* 00000040    """""""""" */
-    0x01,0x32,0x00,0x03,0x33,0x33,0x33,0x33,  /* 00000048    ".2..3333" */
-    0x33,0x33,0x33,0x33,0x44,0x44,0x44,0x44,  /* 00000050    "3333DDDD" */
-    0x44,0x44,0x44,0x44,0x55,0x55,0x55,0x55,  /* 00000058    "DDDDUUUU" */
-    0x55,0x55,0x55,0x55,0x66,0x66,0x66,0x66,  /* 00000060    "UUUUffff" */
-    0x77,0x77,0x77,0x77,0x88,0x88,0x00,0x3E,  /* 00000068    "wwww...>" */
-    0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,  /* 00000070    "........" */
-    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEE,0xEE,  /* 00000078    "........" */
-    0xEE,0xEE,0xEE,0xEE,0xEE,0xEE,0x01,0x32,  /* 00000080    ".......2" */
-    0x00,0x03,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,  /* 00000088    "........" */
-    0xDD,0xDD,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,  /* 00000090    "........" */
-    0xCC,0xCC,0xBB,0xBB,0xBB,0xBB,0xBB,0xBB,  /* 00000098    "........" */
-    0xBB,0xBB,0xAA,0xAA,0xAA,0xAA,0x99,0x99,  /* 000000A0    "........" */
-    0x99,0x99,0x88,0x88                       /* 000000A8    "...."     */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000038    "........" */
+    0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000040    "........" */
+    0x01,0x32,0x00,0x03,0x00,0x00,0x00,0x00,  /* 00000048    ".2......" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000050    "........" */
+    0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,  /* 00000058    "........" */
+    0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x00,0x00,  /* 00000060    "........" */
+    0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x3E,  /* 00000068    ".......>" */
+    0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,  /* 00000070    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,  /* 00000078    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x32,  /* 00000080    ".......2" */
+    0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000088    "........" */
+    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000090    "........" */
+    0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,  /* 00000098    "........" */
+    0xFF,0xFF,0x01,0x00,0x00,0x00,0x01,0x00,  /* 000000A0    "........" */
+    0x00,0x00,0x01,0x00                       /* 000000A8    "...."     */
 };
 
 const unsigned char TemplatePmtt[] =
index 281bfb3..9cfd314 100644 (file)
@@ -501,6 +501,7 @@ DtGetFieldLength (
     case ACPI_DMT_SPACEID:
     case ACPI_DMT_ACCWIDTH:
     case ACPI_DMT_IVRS:
+    case ACPI_DMT_GTDT:
     case ACPI_DMT_MADT:
     case ACPI_DMT_PCCT:
     case ACPI_DMT_PMTT:
@@ -512,6 +513,7 @@ DtGetFieldLength (
     case ACPI_DMT_EINJINST:
     case ACPI_DMT_ERSTACT:
     case ACPI_DMT_ERSTINST:
+    case ACPI_DMT_DMAR_SCOPE:
 
         ByteLength = 1;
         break;
index 739fb44..2231ce1 100644 (file)
@@ -41,9 +41,9 @@
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-
 #include "acpi.h"
 #include "accommon.h"
+#include "acutils.h"
 #include "acdisasm.h"
 #include "acparser.h"
 #include "amlcode.h"
 
 /* Local prototypes */
 
+static void
+AcpiDmUuid (
+    ACPI_PARSE_OBJECT       *Op);
+
 static void
 AcpiDmUnicode (
     ACPI_PARSE_OBJECT       *Op);
@@ -71,6 +75,7 @@ AcpiDmPldBuffer (
     UINT8                   *ByteData,
     UINT32                  ByteCount);
 
+
 #define ACPI_BUFFER_BYTES_PER_LINE      8
 
 
@@ -216,6 +221,11 @@ AcpiDmByteList (
         AcpiOsPrintf ("\n");
         break;
 
+    case ACPI_DASM_UUID:
+
+        AcpiDmUuid (Op);
+        break;
+
     case ACPI_DASM_UNICODE:
 
         AcpiDmUnicode (Op);
@@ -239,6 +249,137 @@ AcpiDmByteList (
 }
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDmIsUuidBuffer
+ *
+ * PARAMETERS:  Op              - Buffer Object to be examined
+ *
+ * RETURN:      TRUE if buffer contains a UUID
+ *
+ * DESCRIPTION: Determine if a buffer Op contains a UUID
+ *
+ * To help determine whether the buffer is a UUID versus a raw data buffer,
+ * there a are a couple bytes we can look at:
+ *
+ *    xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
+ *
+ * The variant covered by the UUID specification is indicated by the two most
+ * significant bits of N being 1 0 (i.e., the hexadecimal N will always be
+ * 8, 9, A, or B).
+ *
+ * The variant covered by the UUID specification has five versions. For this
+ * variant, the four bits of M indicates the UUID version (i.e., the
+ * hexadecimal M will be either 1, 2, 3, 4, or 5).
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AcpiDmIsUuidBuffer (
+    ACPI_PARSE_OBJECT       *Op)
+{
+    UINT8                   *ByteData;
+    UINT32                  ByteCount;
+    ACPI_PARSE_OBJECT       *SizeOp;
+    ACPI_PARSE_OBJECT       *NextOp;
+
+
+    /* Buffer size is the buffer argument */
+
+    SizeOp = Op->Common.Value.Arg;
+
+    /* Next, the initializer byte list to examine */
+
+    NextOp = SizeOp->Common.Next;
+    if (!NextOp)
+    {
+        return (FALSE);
+    }
+
+    /* Extract the byte list info */
+
+    ByteData = NextOp->Named.Data;
+    ByteCount = (UINT32) NextOp->Common.Value.Integer;
+
+    /* Byte count must be exactly 16 */
+
+    if (ByteCount != UUID_BUFFER_LENGTH)
+    {
+        return (FALSE);
+    }
+
+    /* Check for valid "M" and "N" values (see function header above) */
+
+    if (((ByteData[7] & 0xF0) == 0x00) || /* M={1,2,3,4,5} */
+        ((ByteData[7] & 0xF0) > 0x50)  ||
+        ((ByteData[8] & 0xF0) < 0x80)  || /* N={8,9,A,B} */
+        ((ByteData[8] & 0xF0) > 0xB0))
+    {
+        return (FALSE);
+    }
+
+    /* Ignore the Size argument in the disassembly of this buffer op */
+
+    SizeOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+    return (TRUE);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDmUuid
+ *
+ * PARAMETERS:  Op              - Byte List op containing a UUID
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Dump a buffer containing a UUID as a standard ASCII string.
+ *
+ * Output Format:
+ * In its canonical form, the UUID is represented by a string containing 32
+ * lowercase hexadecimal digits, displayed in 5 groups separated by hyphens.
+ * The complete form is 8-4-4-4-12 for a total of 36 characters (32
+ * alphanumeric characters representing hex digits and 4 hyphens). In bytes,
+ * 4-2-2-2-6. Example:
+ *
+ *    ToUUID ("107ededd-d381-4fd7-8da9-08e9a6c79644")
+ *
+ ******************************************************************************/
+
+static void
+AcpiDmUuid (
+    ACPI_PARSE_OBJECT       *Op)
+{
+    UINT8                   *Data;
+    const char              *Description;
+
+
+    Data = ACPI_CAST_PTR (UINT8, Op->Named.Data);
+
+    /* Emit the 36-byte UUID string in the proper format/order */
+
+    AcpiOsPrintf (
+        "\"%2.2x%2.2x%2.2x%2.2x-"
+        "%2.2x%2.2x-"
+        "%2.2x%2.2x-"
+        "%2.2x%2.2x-"
+        "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\")",
+        Data[3], Data[2], Data[1], Data[0],
+        Data[5], Data[4],
+        Data[7], Data[6],
+        Data[8], Data[9],
+        Data[10], Data[11], Data[12], Data[13], Data[14], Data[15]);
+
+    /* Dump the UUID description string if available */
+
+    Description = AcpiAhMatchUuid (Data);
+    if (Description)
+    {
+        AcpiOsPrintf (" /* %s */", Description);
+    }
+}
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiDmIsUnicodeBuffer
index 30f985c..52e01a9 100644 (file)
@@ -827,7 +827,12 @@ AcpiDmDisassembleOneOp (
             }
         }
 
-        if (AcpiDmIsUnicodeBuffer (Op))
+        if (AcpiDmIsUuidBuffer (Op))
+        {
+            Op->Common.DisasmOpcode = ACPI_DASM_UUID;
+            AcpiOsPrintf ("ToUUID (");
+        }
+        else if (AcpiDmIsUnicodeBuffer (Op))
         {
             Op->Common.DisasmOpcode = ACPI_DASM_UNICODE;
             AcpiOsPrintf ("Unicode (");
index 0aa3052..2da52ea 100644 (file)
@@ -285,7 +285,8 @@ AcpiDmBlockType (
 
     case AML_BUFFER_OP:
 
-        if (Op->Common.DisasmOpcode == ACPI_DASM_UNICODE)
+        if ((Op->Common.DisasmOpcode == ACPI_DASM_UNICODE) ||
+            (Op->Common.DisasmOpcode == ACPI_DASM_UUID))
         {
             return (BLOCK_NONE);
         }
index c31f0b3..9394025 100644 (file)
@@ -760,22 +760,6 @@ AcpiEvGpeDispatch (
              GpeNumber, AcpiGbl_GlobalEventHandlerContext);
     }
 
-    /*
-     * If edge-triggered, clear the GPE status bit now. Note that
-     * level-triggered events are cleared after the GPE is serviced.
-     */
-    if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
-            ACPI_GPE_EDGE_TRIGGERED)
-    {
-        Status = AcpiHwClearGpe (GpeEventInfo);
-        if (ACPI_FAILURE (Status))
-        {
-            ACPI_EXCEPTION ((AE_INFO, Status,
-                "Unable to clear GPE %02X", GpeNumber));
-            return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
-        }
-    }
-
     /*
      * Always disable the GPE so that it does not keep firing before
      * any asynchronous activity completes (either from the execution
@@ -793,6 +777,24 @@ AcpiEvGpeDispatch (
         return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
     }
 
+    /*
+     * If edge-triggered, clear the GPE status bit now. Note that
+     * level-triggered events are cleared after the GPE is serviced.
+     */
+    if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
+            ACPI_GPE_EDGE_TRIGGERED)
+    {
+        Status = AcpiHwClearGpe (GpeEventInfo);
+        if (ACPI_FAILURE (Status))
+        {
+            ACPI_EXCEPTION ((AE_INFO, Status,
+                "Unable to clear GPE %02X", GpeNumber));
+            (void) AcpiHwLowSetGpe (GpeEventInfo,
+                    ACPI_GPE_CONDITIONAL_ENABLE);
+            return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
+        }
+    }
+
     /*
      * Dispatch the GPE to either an installed handler or the control
      * method associated with this GPE (_Lxx or _Exx). If a handler
index 73164e1..9e7436a 100644 (file)
@@ -141,12 +141,23 @@ AcpiEnableGpe (
 
     Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
-    /* Ensure that we have a valid GPE number */
-
+    /*
+     * Ensure that we have a valid GPE number and that there is some way
+     * of handling the GPE (handler or a GPE method). In other words, we
+     * won't allow a valid GPE to be enabled if there is no way to handle it.
+     */
     GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
     if (GpeEventInfo)
     {
-        Status = AcpiEvAddGpeReference (GpeEventInfo);
+        if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) !=
+            ACPI_GPE_DISPATCH_NONE)
+        {
+            Status = AcpiEvAddGpeReference (GpeEventInfo);
+        }
+        else
+        {
+            Status = AE_NO_HANDLER;
+        }
     }
 
     AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
@@ -274,6 +285,60 @@ UnlockAndExit:
 ACPI_EXPORT_SYMBOL (AcpiSetGpe)
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiMarkGpeForWake
+ *
+ * PARAMETERS:  GpeDevice           - Parent GPE Device. NULL for GPE0/GPE1
+ *              GpeNumber           - GPE level within the GPE block
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Mark a GPE as having the ability to wake the system. Simply
+ *              sets the ACPI_GPE_CAN_WAKE flag.
+ *
+ * Some potential callers of AcpiSetupGpeForWake may know in advance that
+ * there won't be any notify handlers installed for device wake notifications
+ * from the given GPE (one example is a button GPE in Linux). For these cases,
+ * AcpiMarkGpeForWake should be used instead of AcpiSetupGpeForWake.
+ * This will set the ACPI_GPE_CAN_WAKE flag for the GPE without trying to
+ * setup implicit wake notification for it (since there's no handler method).
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiMarkGpeForWake (
+    ACPI_HANDLE             GpeDevice,
+    UINT32                  GpeNumber)
+{
+    ACPI_GPE_EVENT_INFO     *GpeEventInfo;
+    ACPI_STATUS             Status = AE_BAD_PARAMETER;
+    ACPI_CPU_FLAGS          Flags;
+
+
+    ACPI_FUNCTION_TRACE (AcpiMarkGpeForWake);
+
+
+    Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+
+    /* Ensure that we have a valid GPE number */
+
+    GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
+    if (GpeEventInfo)
+    {
+        /* Mark the GPE as a possible wake event */
+
+        GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
+        Status = AE_OK;
+    }
+
+    AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+    return_ACPI_STATUS (Status);
+}
+
+ACPI_EXPORT_SYMBOL (AcpiMarkGpeForWake)
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiSetupGpeForWake
index df61b79..9223e4b 100644 (file)
@@ -82,6 +82,7 @@ AcpiExDoDebugObject (
     UINT32                  Index)
 {
     UINT32                  i;
+    UINT32                  Timer;
 
 
     ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc);
@@ -95,13 +96,21 @@ AcpiExDoDebugObject (
         return_VOID;
     }
 
+    /*
+     * We will emit the current timer value (in microseconds) with each
+     * debug output. Only need the lower 26 bits. This allows for 67
+     * million microseconds or 67 seconds before rollover.
+     */
+    Timer = (UINT32) (AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */
+    Timer &= 0x03FFFFFF;
+
     /*
      * Print line header as long as we are not in the middle of an
      * object display
      */
     if (!((Level > 0) && Index == 0))
     {
-        AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
+        AcpiOsPrintf ("[ACPI Debug %.8u] %*s", Timer, Level, " ");
     }
 
     /* Display the index for package output only */
index 815e337..6e7de67 100644 (file)
@@ -508,7 +508,7 @@ AcpiExDumpObject (
                 }
             }
 
-            AcpiOsPrintf ("\n", Next);
+            AcpiOsPrintf ("\n");
             break;
 
         case ACPI_EXD_HDLR_LIST:
@@ -542,7 +542,7 @@ AcpiExDumpObject (
                 }
             }
 
-            AcpiOsPrintf ("\n", Next);
+            AcpiOsPrintf ("\n");
             break;
 
         case ACPI_EXD_RGN_LIST:
@@ -576,7 +576,7 @@ AcpiExDumpObject (
                 }
             }
 
-            AcpiOsPrintf ("\n", Next);
+            AcpiOsPrintf ("\n");
             break;
 
         case ACPI_EXD_NODE:
index a1de0ca..479eee7 100644 (file)
@@ -203,14 +203,13 @@ AcpiExReadDataFromField (
             Length = AcpiExGetSerialAccessLength (AccessorType,
                 ObjDesc->Field.AccessLength);
 
-           /*
-             * Add additional 2 bytes for modeled GenericSerialBus data buffer:
-             * typedef struct {
-             *     BYTEStatus; // Byte 0 of the data buffer
-             *     BYTELength; // Byte 1 of the data buffer
-             *     BYTE[x-1]Data; // Bytes 2-x of the arbitrary length data buffer,
-             * }
-            */
+            /*
+             * Add additional 2 bytes for the GenericSerialBus data buffer:
+             *
+             *     Status;      (Byte 0 of the data buffer)
+             *     Length;      (Byte 1 of the data buffer)
+             *     Data[x-1];   (Bytes 2-x of the arbitrary length data buffer)
+             */
             Length += 2;
             Function = ACPI_READ | (AccessorType << 16);
         }
@@ -397,14 +396,13 @@ AcpiExWriteDataToField (
             Length = AcpiExGetSerialAccessLength (AccessorType,
                 ObjDesc->Field.AccessLength);
 
-           /*
-             * Add additional 2 bytes for modeled GenericSerialBus data buffer:
-             * typedef struct {
-             *     BYTEStatus; // Byte 0 of the data buffer
-             *     BYTELength; // Byte 1 of the data buffer
-             *     BYTE[x-1]Data; // Bytes 2-x of the arbitrary length data buffer,
-             * }
-            */
+            /*
+             * Add additional 2 bytes for the GenericSerialBus data buffer:
+             *
+             *     Status;      (Byte 0 of the data buffer)
+             *     Length;      (Byte 1 of the data buffer)
+             *     Data[x-1];   (Bytes 2-x of the arbitrary length data buffer)
+             */
             Length += 2;
             Function = ACPI_WRITE | (AccessorType << 16);
         }
index 9221ac0..7550fed 100644 (file)
@@ -263,17 +263,16 @@ AcpiNsDetachObject (
         {
             Node->Object = Node->Object->Common.NextObject;
         }
-    }
 
-    /*
-     * Detach the object from any data objects (which are still held by
-     * the namespace node)
-     */
-
-    if (ObjDesc->Common.NextObject &&
-       ((ObjDesc->Common.NextObject)->Common.Type == ACPI_TYPE_LOCAL_DATA))
-    {
-       ObjDesc->Common.NextObject = NULL;
+        /*
+         * Detach the object from any data objects (which are still held by
+         * the namespace node)
+         */
+        if (ObjDesc->Common.NextObject &&
+           ((ObjDesc->Common.NextObject)->Common.Type == ACPI_TYPE_LOCAL_DATA))
+        {
+           ObjDesc->Common.NextObject = NULL;
+        }
     }
 
     /* Reset the node type to untyped */
index 28617dd..1666a36 100644 (file)
@@ -91,38 +91,6 @@ const UINT8                     AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] =
 };
 
 
-/*******************************************************************************
- *
- * FUNCTION:    AcpiUtHexToAsciiChar
- *
- * PARAMETERS:  Integer             - Contains the hex digit
- *              Position            - bit position of the digit within the
- *                                    integer (multiple of 4)
- *
- * RETURN:      The converted Ascii character
- *
- * DESCRIPTION: Convert a hex digit to an Ascii character
- *
- ******************************************************************************/
-
-/* Hex to ASCII conversion table */
-
-static const char           AcpiGbl_HexToAscii[] =
-{
-    '0','1','2','3','4','5','6','7',
-    '8','9','A','B','C','D','E','F'
-};
-
-char
-AcpiUtHexToAsciiChar (
-    UINT64                  Integer,
-    UINT32                  Position)
-{
-
-    return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
-}
-
-
 /*******************************************************************************
  *
  * FUNCTION:    AcpiUtGetRegionName
@@ -541,7 +509,8 @@ static const char           *AcpiGbl_GenericNotify[ACPI_NOTIFY_MAX + 1] =
     /* 09 */ "Device PLD Check",
     /* 0A */ "Reserved",
     /* 0B */ "System Locality Update",
-    /* 0C */ "Shutdown Request"
+    /* 0C */ "Shutdown Request",
+    /* 0D */ "System Resource Affinity Update"
 };
 
 static const char           *AcpiGbl_DeviceNotify[4] =
@@ -575,7 +544,7 @@ AcpiUtGetNotifyName (
     ACPI_OBJECT_TYPE        Type)
 {
 
-    /* 00 - 0C are common to all object types */
+    /* 00 - 0D are common to all object types */
 
     if (NotifyValue <= ACPI_NOTIFY_MAX)
     {
index 1d9adbb..c6b66ae 100644 (file)
@@ -232,8 +232,7 @@ AcpiUtReadTable (
             Status = FlCheckForAscii (fp, NULL, FALSE);
             if (ACPI_SUCCESS (Status))
             {
-                AcpiOsPrintf ("File appears to be ASCII only, must be binary\n",
-                    TableHeader.Length, FileSize);
+                AcpiOsPrintf ("File appears to be ASCII only, must be binary\n");
             }
 #endif
             return (AE_BAD_HEADER);
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Name: achaiku.h - OS specific defines, etc. for Haiku (www.haiku-os.org)
+ * Module Name: uthex -- Hex/ASCII support functions
  *
  *****************************************************************************/
 
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-#ifndef __ACHAIKU_H__
-#define __ACHAIKU_H__
+#define __UTHEX_C__
 
-#include "acgcc.h"
-#include <KernelExport.h>
+#include "acpi.h"
+#include "accommon.h"
 
-struct mutex;
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("uthex")
 
 
-/* Host-dependent types and defines for user- and kernel-space ACPICA */
+/* Hex to ASCII conversion table */
 
-#define ACPI_USE_SYSTEM_CLIBRARY
-#define ACPI_USE_STANDARD_HEADERS
+static char                 AcpiGbl_HexToAscii[] =
+{
+    '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
+};
 
-#define ACPI_MUTEX_TYPE             ACPI_OSL_MUTEX
-#define ACPI_MUTEX                  struct mutex *
 
-#define ACPI_USE_NATIVE_DIVIDE
-
-// #define ACPI_THREAD_ID               thread_id
-#define ACPI_SEMAPHORE              sem_id
-#define ACPI_SPINLOCK               spinlock *
-#define ACPI_CPU_FLAGS              cpu_status
-
-#define COMPILER_DEPENDENT_INT64    int64
-#define COMPILER_DEPENDENT_UINT64   uint64
-
-
-#ifdef B_HAIKU_64_BIT
-#define ACPI_MACHINE_WIDTH          64
-#else
-#define ACPI_MACHINE_WIDTH          32
-#endif
-
-
-#ifdef _KERNEL_MODE
-/* Host-dependent types and defines for in-kernel ACPICA */
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtHexToAsciiChar
+ *
+ * PARAMETERS:  Integer             - Contains the hex digit
+ *              Position            - bit position of the digit within the
+ *                                    integer (multiple of 4)
+ *
+ * RETURN:      The converted Ascii character
+ *
+ * DESCRIPTION: Convert a hex digit to an Ascii character
+ *
+ ******************************************************************************/
 
-/* ACPICA cache implementation is adequate. */
-#define ACPI_USE_LOCAL_CACHE
+char
+AcpiUtHexToAsciiChar (
+    UINT64                  Integer,
+    UINT32                  Position)
+{
 
-#define ACPI_FLUSH_CPU_CACHE() __asm __volatile("wbinvd");
+    return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
+}
 
-/* Based on FreeBSD's due to lack of documentation */
-extern int AcpiOsAcquireGlobalLock(uint32 *lock);
-extern int AcpiOsReleaseGlobalLock(uint32 *lock);
 
-#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq)    do {                \
-        (Acq) = AcpiOsAcquireGlobalLock(&((GLptr)->GlobalLock));    \
-} while (0)
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtHexCharToValue
+ *
+ * PARAMETERS:  AsciiChar             - Hex character in Ascii
+ *
+ * RETURN:      The binary value of the ascii/hex character
+ *
+ * DESCRIPTION: Perform ascii-to-hex translation
+ *
+ ******************************************************************************/
 
-#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq)    do {                \
-        (Acq) = AcpiOsReleaseGlobalLock(&((GLptr)->GlobalLock));    \
-} while (0)
+UINT8
+AcpiUtAsciiCharToHex (
+    int                     HexChar)
+{
 
-#else /* _KERNEL_MODE */
-/* Host-dependent types and defines for user-space ACPICA */
+    if (HexChar <= 0x39)
+    {
+        return ((UINT8) (HexChar - 0x30));
+    }
 
-#error "We only support kernel mode ACPI atm."
+    if (HexChar <= 0x46)
+    {
+        return ((UINT8) (HexChar - 0x37));
+    }
 
-#endif /* _KERNEL_MODE */
-#endif /* __ACHAIKU_H__ */
+    return ((UINT8) (HexChar - 0x57));
+}
index 0194d56..21f7034 100644 (file)
@@ -88,6 +88,12 @@ AcpiUtPutNumber (
     BOOLEAN                 Upper);
 
 
+/* Module globals */
+
+static const char           AcpiGbl_LowerHexDigits[] = "0123456789abcdef";
+static const char           AcpiGbl_UpperHexDigits[] = "0123456789ABCDEF";
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiUtBoundStringLength
@@ -95,7 +101,7 @@ AcpiUtPutNumber (
  * PARAMETERS:  String              - String with boundary
  *              Count               - Boundary of the string
  *
- * RETURN:      Length of the string.
+ * RETURN:      Length of the string. Less than or equal to Count.
  *
  * DESCRIPTION: Calculate the length of a string with boundary.
  *
@@ -145,8 +151,8 @@ AcpiUtBoundStringOutput (
     {
         *String = c;
     }
-    ++String;
 
+    ++String;
     return (String);
 }
 
@@ -174,15 +180,13 @@ AcpiUtPutNumber (
     UINT8                   Base,
     BOOLEAN                 Upper)
 {
-    const char              LowerDigits[] = "0123456789abcdef";
-    const char              UpperDigits[] = "0123456789ABCDEF";
     const char              *Digits;
     UINT64                  DigitIndex;
     char                    *Pos;
 
 
     Pos = String;
-    Digits = Upper ? UpperDigits : LowerDigits;
+    Digits = Upper ? AcpiGbl_UpperHexDigits : AcpiGbl_LowerHexDigits;
 
     if (Number == 0)
     {
@@ -196,8 +200,8 @@ AcpiUtPutNumber (
             *(Pos++) = Digits[DigitIndex];
         }
     }
-    /* *(Pos++) = '0'; */
 
+    /* *(Pos++) = '0'; */
     return (Pos);
 }
 
@@ -228,8 +232,8 @@ AcpiUtScanNumber (
         Number *= 10;
         Number += *(String++) - '0';
     }
-    *NumberPtr = Number;
 
+    *NumberPtr = Number;
     return (String);
 }
 
@@ -264,8 +268,8 @@ AcpiUtPrintNumber (
     {
         *(Pos2++) = *(--Pos1);
     }
-    *Pos2 = 0;
 
+    *Pos2 = 0;
     return (String);
 }
 
@@ -298,6 +302,7 @@ AcpiUtFormatNumber (
     INT32                   Precision,
     UINT8                   Type)
 {
+    char                    *Pos;
     char                    Sign;
     char                    Zero;
     BOOLEAN                 NeedPrefix;
@@ -306,12 +311,13 @@ AcpiUtFormatNumber (
     char                    ReversedString[66];
 
 
-    /* Perform sanity checks */
+    /* Parameter validation */
 
     if (Base < 2 || Base > 16)
     {
-        return NULL;
+        return (NULL);
     }
+
     if (Type & ACPI_FORMAT_LEFT)
     {
         Type &= ~ACPI_FORMAT_ZERO;
@@ -354,9 +360,8 @@ AcpiUtFormatNumber (
 
     /* Generate full string in reverse order */
 
-    i = ACPI_PTR_DIFF (
-            AcpiUtPutNumber (ReversedString, Number, Base, Upper),
-           ReversedString);
+    Pos = AcpiUtPutNumber (ReversedString, Number, Base, Upper);
+    i = ACPI_PTR_DIFF (Pos, ReversedString);
 
     /* Printing 100 using %2d gives "100", not "00" */
 
@@ -364,6 +369,7 @@ AcpiUtFormatNumber (
     {
         Precision = i;
     }
+
     Width -= Precision;
 
     /* Output the string */
@@ -386,7 +392,7 @@ AcpiUtFormatNumber (
         {
             String = AcpiUtBoundStringOutput (String, End,
                         Upper ? 'X' : 'x');
-       }
+        }
     }
     if (!(Type & ACPI_FORMAT_LEFT))
     {
@@ -395,6 +401,7 @@ AcpiUtFormatNumber (
             String = AcpiUtBoundStringOutput (String, End, Zero);
         }
     }
+
     while (i <= --Precision)
     {
         String = AcpiUtBoundStringOutput (String, End, '0');
@@ -422,7 +429,7 @@ AcpiUtFormatNumber (
  *              Format              - Standard printf format
  *              Args                - Argument list
  *
- * RETURN:      Size of successfully output bytes
+ * RETURN:      Number of bytes actually written.
  *
  * DESCRIPTION: Formatted output to a string using argument list pointer.
  *
@@ -453,7 +460,7 @@ AcpiUtVsnprintf (
     Pos = String;
     End = String + Size;
 
-    for (; *Format ; ++Format)
+    for (; *Format; ++Format)
     {
         if (*Format != '%')
         {
@@ -494,6 +501,7 @@ AcpiUtVsnprintf (
 
         /* Process width */
 
+        Width = -1;
         if (ACPI_IS_DIGIT (*Format))
         {
             Format = AcpiUtScanNumber (Format, &Number);
@@ -502,7 +510,7 @@ AcpiUtVsnprintf (
         else if (*Format == '*')
         {
             ++Format;
-            Width = va_arg(Args, int);
+            Width = va_arg (Args, int);
             if (Width < 0)
             {
                 Width = -Width;
@@ -512,6 +520,7 @@ AcpiUtVsnprintf (
 
         /* Process precision */
 
+        Precision = -1;
         if (*Format == '.')
         {
             ++Format;
@@ -523,7 +532,7 @@ AcpiUtVsnprintf (
             else if (*Format == '*')
             {
                 ++Format;
-                Precision = va_arg(Args, int);
+                Precision = va_arg (Args, int);
             }
             if (Precision < 0)
             {
@@ -533,10 +542,12 @@ AcpiUtVsnprintf (
 
         /* Process qualifier */
 
+        Qualifier = -1;
         if (*Format == 'h' || *Format == 'l' || *Format == 'L')
         {
             Qualifier = *Format;
             ++Format;
+
             if (Qualifier == 'l' && *Format == 'l')
             {
                 Qualifier = 'L';
@@ -560,8 +571,10 @@ AcpiUtVsnprintf (
                     Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
                 }
             }
+
             c = (char) va_arg (Args, int);
             Pos = AcpiUtBoundStringOutput (Pos, End, c);
+
             while (--Width > 0)
             {
                 Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
@@ -624,10 +637,10 @@ AcpiUtVsnprintf (
                 Width = 2 * sizeof (void *);
                 Type |= ACPI_FORMAT_ZERO;
             }
+
             p = va_arg (Args, void *);
             Pos = AcpiUtFormatNumber (Pos, End,
-                    ACPI_TO_INTEGER (p),
-                    16, Width, Precision, Type);
+                    ACPI_TO_INTEGER (p), 16, Width, Precision, Type);
             continue;
 
         default:
@@ -676,7 +689,8 @@ AcpiUtVsnprintf (
                 Number = (signed int) Number;
             }
         }
-        Pos = AcpiUtFormatNumber(Pos, End, Number, Base,
+
+        Pos = AcpiUtFormatNumber (Pos, End, Number, Base,
                 Width, Precision, Type);
     }
 
@@ -704,7 +718,7 @@ AcpiUtVsnprintf (
  *              Size                - Boundary of the string
  *              Format, ...         - Standard printf format
  *
- * RETURN:      Size of successfully output bytes
+ * RETURN:      Number of bytes actually written.
  *
  * DESCRIPTION: Formatted output to a string.
  *
@@ -738,7 +752,7 @@ AcpiUtSnprintf (
  *              Format              - Standard printf format
  *              Args                - Argument list
  *
- * RETURN:      Size of successfully output bytes
+ * RETURN:      Number of bytes actually written.
  *
  * DESCRIPTION: Formatted output to a file using argument list pointer.
  *
@@ -755,8 +769,9 @@ AcpiUtFileVprintf (
 
 
     Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
-    Length = AcpiUtVsnprintf(AcpiGbl_PrintBuffer,
+    Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer,
                 sizeof (AcpiGbl_PrintBuffer), Format, Args);
+
     (void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1);
     AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
 
@@ -771,7 +786,7 @@ AcpiUtFileVprintf (
  * PARAMETERS:  File                - File descriptor
  *              Format, ...         - Standard printf format
  *
- * RETURN:      Size of successfully output bytes
+ * RETURN:      Number of bytes actually written.
  *
  * DESCRIPTION: Formatted output to a file.
  *
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Name: achaiku.h - OS specific defines, etc. for Haiku (www.haiku-os.org)
+ * Module Name: utuuid -- UUID support functions
  *
  *****************************************************************************/
 
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-#ifndef __ACHAIKU_H__
-#define __ACHAIKU_H__
+#define __UTUUID_C__
 
-#include "acgcc.h"
-#include <KernelExport.h>
+#include "acpi.h"
+#include "accommon.h"
 
-struct mutex;
+#define _COMPONENT          ACPI_COMPILER
+        ACPI_MODULE_NAME    ("utuuid")
 
 
-/* Host-dependent types and defines for user- and kernel-space ACPICA */
-
-#define ACPI_USE_SYSTEM_CLIBRARY
-#define ACPI_USE_STANDARD_HEADERS
-
-#define ACPI_MUTEX_TYPE             ACPI_OSL_MUTEX
-#define ACPI_MUTEX                  struct mutex *
-
-#define ACPI_USE_NATIVE_DIVIDE
-
-// #define ACPI_THREAD_ID               thread_id
-#define ACPI_SEMAPHORE              sem_id
-#define ACPI_SPINLOCK               spinlock *
-#define ACPI_CPU_FLAGS              cpu_status
-
-#define COMPILER_DEPENDENT_INT64    int64
-#define COMPILER_DEPENDENT_UINT64   uint64
-
-
-#ifdef B_HAIKU_64_BIT
-#define ACPI_MACHINE_WIDTH          64
-#else
-#define ACPI_MACHINE_WIDTH          32
-#endif
-
-
-#ifdef _KERNEL_MODE
-/* Host-dependent types and defines for in-kernel ACPICA */
-
-/* ACPICA cache implementation is adequate. */
-#define ACPI_USE_LOCAL_CACHE
-
-#define ACPI_FLUSH_CPU_CACHE() __asm __volatile("wbinvd");
+/*
+ * UUID support functions.
+ *
+ * This table is used to convert an input UUID ascii string to a 16 byte
+ * buffer and the reverse. The table maps a UUID buffer index 0-15 to
+ * the index within the 36-byte UUID string where the associated 2-byte
+ * hex value can be found.
+ *
+ * 36-byte UUID strings are of the form:
+ *     aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
+ * Where aa-pp are one byte hex numbers, made up of two hex digits
+ *
+ * Note: This table is basically the inverse of the string-to-offset table
+ * found in the ACPI spec in the description of the ToUUID macro.
+ */
+const UINT8    AcpiGbl_MapToUuidOffset[UUID_BUFFER_LENGTH] =
+{
+    6,4,2,0,11,9,16,14,19,21,24,26,28,30,32,34
+};
 
-/* Based on FreeBSD's due to lack of documentation */
-extern int AcpiOsAcquireGlobalLock(uint32 *lock);
-extern int AcpiOsReleaseGlobalLock(uint32 *lock);
 
-#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq)    do {                \
-        (Acq) = AcpiOsAcquireGlobalLock(&((GLptr)->GlobalLock));    \
-} while (0)
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiUtConvertStringToUuid
+ *
+ * PARAMETERS:  InString            - 36-byte formatted UUID string
+ *              UuidBuffer          - Where the 16-byte UUID buffer is returned
+ *
+ * RETURN:      None. Output data is returned in the UuidBuffer
+ *
+ * DESCRIPTION: Convert a 36-byte formatted UUID string to 16-byte UUID buffer
+ *
+ ******************************************************************************/
 
-#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq)    do {                \
-        (Acq) = AcpiOsReleaseGlobalLock(&((GLptr)->GlobalLock));    \
-} while (0)
+void
+AcpiUtConvertStringToUuid (
+    char                    *InString,
+    UINT8                   *UuidBuffer)
+{
+    UINT32                  i;
 
-#else /* _KERNEL_MODE */
-/* Host-dependent types and defines for user-space ACPICA */
 
-#error "We only support kernel mode ACPI atm."
+    for (i = 0; i < UUID_BUFFER_LENGTH; i++)
+    {
+        UuidBuffer[i] =
+            (AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i]]) << 4);
 
-#endif /* _KERNEL_MODE */
-#endif /* __ACHAIKU_H__ */
+        UuidBuffer[i] |=
+            AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i] + 1]);
+    }
+}
index 4cad6f4..69242ee 100644 (file)
 #define ACPI_NUM_SxW_METHODS            5
 
 
+/******************************************************************************
+ *
+ * Miscellaneous constants
+ *
+ *****************************************************************************/
+
+/* UUID constants */
+
+#define UUID_BUFFER_LENGTH          16 /* Length of UUID in memory */
+#define UUID_STRING_LENGTH          36 /* Total length of a UUID string */
+
+/* Positions for required hyphens (dashes) in UUID strings */
+
+#define UUID_HYPHEN1_OFFSET         8
+#define UUID_HYPHEN2_OFFSET         13
+#define UUID_HYPHEN3_OFFSET         18
+#define UUID_HYPHEN4_OFFSET         23
+
+
 /******************************************************************************
  *
  * ACPI AML Debugger
index 7de84ac..094356a 100644 (file)
@@ -137,11 +137,13 @@ typedef enum
 
     ACPI_DMT_ASF,
     ACPI_DMT_DMAR,
+    ACPI_DMT_DMAR_SCOPE,
     ACPI_DMT_EINJACT,
     ACPI_DMT_EINJINST,
     ACPI_DMT_ERSTACT,
     ACPI_DMT_ERSTINST,
     ACPI_DMT_FADTPM,
+    ACPI_DMT_GTDT,
     ACPI_DMT_HEST,
     ACPI_DMT_HESTNTFY,
     ACPI_DMT_HESTNTYP,
@@ -255,6 +257,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar3[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar4[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDrtm[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoEcdt[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoEinj[];
@@ -272,6 +275,10 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFpdt0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoFpdt1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGas[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGtdt[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGtdtHdr[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGtdt0[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGtdt0a[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGtdt1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHeader[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest0[];
@@ -309,6 +316,8 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt9[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt10[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt11[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt12[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt13[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadt14[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMadtHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMcfg[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoMcfg0[];
@@ -332,6 +341,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPmttHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcctHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct0[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoS3pt[];
@@ -444,6 +454,10 @@ void
 AcpiDmDumpFpdt (
     ACPI_TABLE_HEADER       *Table);
 
+void
+AcpiDmDumpGtdt (
+    ACPI_TABLE_HEADER       *Table);
+
 void
 AcpiDmDumpHest (
     ACPI_TABLE_HEADER       *Table);
@@ -654,6 +668,10 @@ void
 AcpiDmDecompressEisaId (
     UINT32                  EncodedId);
 
+BOOLEAN
+AcpiDmIsUuidBuffer (
+    ACPI_PARSE_OBJECT       *Op);
+
 BOOLEAN
 AcpiDmIsUnicodeBuffer (
     ACPI_PARSE_OBJECT       *Op);
index 3fcfe1f..7b9e83d 100644 (file)
@@ -878,12 +878,13 @@ typedef union acpi_parse_value
 #define ACPI_DASM_STRING                0x02        /* Buffer is a ASCII string */
 #define ACPI_DASM_UNICODE               0x03        /* Buffer is a Unicode string */
 #define ACPI_DASM_PLD_METHOD            0x04        /* Buffer is a _PLD method bit-packed buffer */
-#define ACPI_DASM_EISAID                0x05        /* Integer is an EISAID */
-#define ACPI_DASM_MATCHOP               0x06        /* Parent opcode is a Match() operator */
-#define ACPI_DASM_LNOT_PREFIX           0x07        /* Start of a LNotEqual (etc.) pair of opcodes */
-#define ACPI_DASM_LNOT_SUFFIX           0x08        /* End  of a LNotEqual (etc.) pair of opcodes */
-#define ACPI_DASM_HID_STRING            0x09        /* String is a _HID or _CID */
-#define ACPI_DASM_IGNORE                0x0A        /* Not used at this time */
+#define ACPI_DASM_UUID                  0x05        /* Buffer is a UUID/GUID */
+#define ACPI_DASM_EISAID                0x06        /* Integer is an EISAID */
+#define ACPI_DASM_MATCHOP               0x07        /* Parent opcode is a Match() operator */
+#define ACPI_DASM_LNOT_PREFIX           0x08        /* Start of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_LNOT_SUFFIX           0x09        /* End  of a LNotEqual (etc.) pair of opcodes */
+#define ACPI_DASM_HID_STRING            0x0A        /* String is a _HID or _CID */
+#define ACPI_DASM_IGNORE                0x0B        /* Not used at this time */
 
 /*
  * Generic operation (for example:  If, While, Store)
@@ -1358,4 +1359,11 @@ typedef struct ah_device_id
 
 } AH_DEVICE_ID;
 
+typedef struct ah_uuid
+{
+    char            *Description;
+    char            *String;
+
+} AH_UUID;
+
 #endif /* __ACLOCAL_H__ */
index f5daace..b8322e6 100644 (file)
@@ -55,6 +55,7 @@
 #define METHOD_NAME__HID        "_HID"
 #define METHOD_NAME__INI        "_INI"
 #define METHOD_NAME__PLD        "_PLD"
+#define METHOD_NAME__DSD        "_DSD"
 #define METHOD_NAME__PRS        "_PRS"
 #define METHOD_NAME__PRT        "_PRT"
 #define METHOD_NAME__PRW        "_PRW"
index 31adb70..7174101 100644 (file)
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20140627
+#define ACPI_CA_VERSION                 0x20140724
 
 #include "acconfig.h"
 #include "actypes.h"
@@ -849,6 +849,12 @@ AcpiFinishGpe (
     ACPI_HANDLE             GpeDevice,
     UINT32                  GpeNumber))
 
+ACPI_HW_DEPENDENT_RETURN_STATUS (
+ACPI_STATUS
+AcpiMarkGpeForWake (
+    ACPI_HANDLE             GpeDevice,
+    UINT32                  GpeNumber))
+
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
 AcpiSetupGpeForWake (
index 3ab4ae0..c41ab03 100644 (file)
  *      count = 0 (optional)
  *      (Used for _DLM)
  *
+ * ACPI_PTYPE2_UUID_PAIR: Each subpackage is preceded by a UUID Buffer. The UUID
+ *      defines the format of the package. Zero-length parent package is
+ *      allowed.
+ *      (Used for _DSD)
+ *
  *****************************************************************************/
 
 enum AcpiReturnPackageTypes
@@ -119,7 +124,8 @@ enum AcpiReturnPackageTypes
     ACPI_PTYPE2_FIXED       = 7,
     ACPI_PTYPE2_MIN         = 8,
     ACPI_PTYPE2_REV_FIXED   = 9,
-    ACPI_PTYPE2_FIX_VAR     = 10
+    ACPI_PTYPE2_FIX_VAR     = 10,
+    ACPI_PTYPE2_UUID_PAIR   = 11
 };
 
 
@@ -366,6 +372,9 @@ const ACPI_PREDEFINED_INFO          AcpiGbl_PredefinedMethods[] =
     {{"_CBA",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */
 
+    {{"_CCA",   METHOD_0ARGS,
+                METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* ACPI 5.1 */
+
     {{"_CDM",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
@@ -434,6 +443,10 @@ const ACPI_PREDEFINED_INFO          AcpiGbl_PredefinedMethods[] =
     {{"_DOS",   METHOD_1ARGS (ACPI_TYPE_INTEGER),
                 METHOD_NO_RETURN_VALUE}},
 
+    {{"_DSD",   METHOD_0ARGS,
+                METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */
+                    PACKAGE_INFO (ACPI_PTYPE2_UUID_PAIR, ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_PACKAGE, 1,0),
+
     {{"_DSM",   METHOD_4ARGS (ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_PACKAGE),
                 METHOD_RETURNS (ACPI_RTYPE_ALL)}}, /* Must return a value, but it can be of any type */
 
index a419195..6ef64e1 100644 (file)
@@ -296,7 +296,8 @@ typedef struct acpi_table_fadt
     UINT32                  Flags;              /* Miscellaneous flag bits (see below for individual flags) */
     ACPI_GENERIC_ADDRESS    ResetRegister;      /* 64-bit address of the Reset register */
     UINT8                   ResetValue;         /* Value to write to the ResetRegister port to reset the system */
-    UINT8                   Reserved4[3];       /* Reserved, must be zero */
+    UINT16                  ArmBootFlags;       /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
+    UINT8                   MinorRevision;      /* FADT Minor Revision (ACPI 5.1) */
     UINT64                  XFacs;              /* 64-bit physical address of FACS */
     UINT64                  XDsdt;              /* 64-bit physical address of DSDT */
     ACPI_GENERIC_ADDRESS    XPm1aEventBlock;    /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
@@ -313,7 +314,7 @@ typedef struct acpi_table_fadt
 } ACPI_TABLE_FADT;
 
 
-/* Masks for FADT Boot Architecture Flags (BootFlags) [Vx]=Introduced in this FADT revision */
+/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
 
 #define ACPI_FADT_LEGACY_DEVICES    (1)         /* 00: [V2] System has LPC or ISA bus devices */
 #define ACPI_FADT_8042              (1<<1)      /* 01: [V3] System has an 8042 controller on port 60/64 */
@@ -322,6 +323,11 @@ typedef struct acpi_table_fadt
 #define ACPI_FADT_NO_ASPM           (1<<4)      /* 04: [V4] PCIe ASPM control must not be enabled */
 #define ACPI_FADT_NO_CMOS_RTC       (1<<5)      /* 05: [V5] No CMOS real-time clock present */
 
+/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
+
+#define ACPI_FADT_PSCI_COMPLIANT    (1)         /* 00: [V5+] PSCI 0.2+ is implemented */
+#define ACPI_FADT_PSCI_USE_HVC      (1<<1)      /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */
+
 /* Masks for FADT flags */
 
 #define ACPI_FADT_WBINVD            (1)         /* 00: [V1] The WBINVD instruction works properly */
@@ -435,7 +441,7 @@ typedef struct acpi_table_desc
  *     FADT V5  size: 0x10C
  */
 #define ACPI_FADT_V1_SIZE       (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
-#define ACPI_FADT_V2_SIZE       (UINT32) (ACPI_FADT_OFFSET (Reserved4[0]) + 3)
+#define ACPI_FADT_V2_SIZE       (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1)
 #define ACPI_FADT_V3_SIZE       (UINT32) (ACPI_FADT_OFFSET (SleepControl))
 #define ACPI_FADT_V5_SIZE       (UINT32) (sizeof (ACPI_TABLE_FADT))
 
index fe47a73..f9aa1e0 100644 (file)
@@ -762,20 +762,22 @@ typedef struct acpi_table_madt
 
 enum AcpiMadtType
 {
-    ACPI_MADT_TYPE_LOCAL_APIC           = 0,
-    ACPI_MADT_TYPE_IO_APIC              = 1,
-    ACPI_MADT_TYPE_INTERRUPT_OVERRIDE   = 2,
-    ACPI_MADT_TYPE_NMI_SOURCE           = 3,
-    ACPI_MADT_TYPE_LOCAL_APIC_NMI       = 4,
-    ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE  = 5,
-    ACPI_MADT_TYPE_IO_SAPIC             = 6,
-    ACPI_MADT_TYPE_LOCAL_SAPIC          = 7,
-    ACPI_MADT_TYPE_INTERRUPT_SOURCE     = 8,
-    ACPI_MADT_TYPE_LOCAL_X2APIC         = 9,
-    ACPI_MADT_TYPE_LOCAL_X2APIC_NMI     = 10,
-    ACPI_MADT_TYPE_GENERIC_INTERRUPT    = 11,
-    ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR  = 12,
-    ACPI_MADT_TYPE_RESERVED             = 13    /* 13 and greater are reserved */
+    ACPI_MADT_TYPE_LOCAL_APIC               = 0,
+    ACPI_MADT_TYPE_IO_APIC                  = 1,
+    ACPI_MADT_TYPE_INTERRUPT_OVERRIDE       = 2,
+    ACPI_MADT_TYPE_NMI_SOURCE               = 3,
+    ACPI_MADT_TYPE_LOCAL_APIC_NMI           = 4,
+    ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE      = 5,
+    ACPI_MADT_TYPE_IO_SAPIC                 = 6,
+    ACPI_MADT_TYPE_LOCAL_SAPIC              = 7,
+    ACPI_MADT_TYPE_INTERRUPT_SOURCE         = 8,
+    ACPI_MADT_TYPE_LOCAL_X2APIC             = 9,
+    ACPI_MADT_TYPE_LOCAL_X2APIC_NMI         = 10,
+    ACPI_MADT_TYPE_GENERIC_INTERRUPT        = 11,
+    ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR      = 12,
+    ACPI_MADT_TYPE_GENERIC_MSI_FRAME        = 13,
+    ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR    = 14,
+    ACPI_MADT_TYPE_RESERVED                 = 15    /* 15 and greater are reserved */
 };
 
 
@@ -936,16 +938,27 @@ typedef struct acpi_madt_generic_interrupt
 {
     ACPI_SUBTABLE_HEADER    Header;
     UINT16                  Reserved;           /* Reserved - must be zero */
-    UINT32                  GicId;
+    UINT32                  CpuInterfaceNumber;
     UINT32                  Uid;
     UINT32                  Flags;
     UINT32                  ParkingVersion;
     UINT32                  PerformanceInterrupt;
     UINT64                  ParkedAddress;
     UINT64                  BaseAddress;
+    UINT64                  GicvBaseAddress;
+    UINT64                  GichBaseAddress;
+    UINT32                  VgicInterrupt;
+    UINT64                  GicrBaseAddress;
+    UINT64                  ArmMpidr;
 
 } ACPI_MADT_GENERIC_INTERRUPT;
 
+/* Masks for Flags field above */
+
+/* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
+#define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)  /* 01: Performance Interrupt Mode */
+#define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)  /* 02: VGIC Maintenance Interrupt mode */
+
 
 /* 12: Generic Distributor (ACPI 5.0) */
 
@@ -961,11 +974,42 @@ typedef struct acpi_madt_generic_distributor
 } ACPI_MADT_GENERIC_DISTRIBUTOR;
 
 
+/* 13: Generic MSI Frame (ACPI 5.1) */
+
+typedef struct acpi_madt_generic_msi_frame
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;           /* Reserved - must be zero */
+    UINT32                  MsiFrameId;
+    UINT64                  BaseAddress;
+    UINT32                  Flags;
+    UINT16                  SpiCount;
+    UINT16                  SpiBase;
+
+} ACPI_MADT_GENERIC_MSI_FRAME;
+
+/* Masks for Flags field above */
+
+#define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
+
+
+/* 14: Generic Redistributor (ACPI 5.1) */
+
+typedef struct acpi_madt_generic_redistributor
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;           /* reserved - must be zero */
+    UINT64                  BaseAddress;
+    UINT32                  Length;
+
+} ACPI_MADT_GENERIC_REDISTRIBUTOR;
+
+
 /*
  * Common flags fields for MADT subtables
  */
 
-/* MADT Local APIC flags (LapicFlags) and GIC flags */
+/* MADT Local APIC flags */
 
 #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
 
index df6692f..a6f2f20 100644 (file)
@@ -450,7 +450,7 @@ typedef struct acpi_table_dbgp
  *        Version 1
  *
  * Conforms to "Intel Virtualization Technology for Directed I/O",
- * Version 1.2, Sept. 2008
+ * Version 2.2, Sept. 2013
  *
  ******************************************************************************/
 
@@ -483,9 +483,10 @@ enum AcpiDmarType
 {
     ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
     ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
-    ACPI_DMAR_TYPE_ATSR                 = 2,
-    ACPI_DMAR_HARDWARE_AFFINITY         = 3,
-    ACPI_DMAR_TYPE_RESERVED             = 4     /* 4 and greater are reserved */
+    ACPI_DMAR_TYPE_ROOT_ATS             = 2,
+    ACPI_DMAR_TYPE_HARDWARE_AFFINITY    = 3,
+    ACPI_DMAR_TYPE_NAMESPACE            = 4,
+    ACPI_DMAR_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
 };
 
 
@@ -501,7 +502,7 @@ typedef struct acpi_dmar_device_scope
 
 } ACPI_DMAR_DEVICE_SCOPE;
 
-/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE */
+/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
 
 enum AcpiDmarScopeType
 {
@@ -510,7 +511,8 @@ enum AcpiDmarScopeType
     ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
     ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
     ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
-    ACPI_DMAR_SCOPE_TYPE_RESERVED       = 5     /* 5 and greater are reserved */
+    ACPI_DMAR_SCOPE_TYPE_NAMESPACE      = 5,
+    ACPI_DMAR_SCOPE_TYPE_RESERVED       = 6     /* 6 and greater are reserved */
 };
 
 typedef struct acpi_dmar_pci_path
@@ -587,6 +589,18 @@ typedef struct acpi_dmar_rhsa
 } ACPI_DMAR_RHSA;
 
 
+/* 4: ACPI Namespace Device Declaration Structure */
+
+typedef struct acpi_dmar_andd
+{
+    ACPI_DMAR_HEADER        Header;
+    UINT8                   Reserved[3];
+    UINT8                   DeviceNumber;
+    char                    DeviceName[1];
+
+} ACPI_DMAR_ANDD;
+
+
 /*******************************************************************************
  *
  * HPET - High Precision Event Timer table
index ce69acd..37bbd3e 100644 (file)
@@ -280,35 +280,111 @@ typedef struct acpi_s3pt_suspend
 
 /*******************************************************************************
  *
- * GTDT - Generic Timer Description Table (ACPI 5.0)
- *        Version 1
+ * GTDT - Generic Timer Description Table (ACPI 5.1)
+ *        Version 2
  *
  ******************************************************************************/
 
 typedef struct acpi_table_gtdt
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT64                  Address;
-    UINT32                  Flags;
-    UINT32                  SecurePl1Interrupt;
-    UINT32                  SecurePl1Flags;
-    UINT32                  NonSecurePl1Interrupt;
-    UINT32                  NonSecurePl1Flags;
+    UINT64                  CounterBlockAddresss;
+    UINT32                  Reserved;
+    UINT32                  SecureEl1Interrupt;
+    UINT32                  SecureEl1Flags;
+    UINT32                  NonSecureEl1Interrupt;
+    UINT32                  NonSecureEl1Flags;
     UINT32                  VirtualTimerInterrupt;
     UINT32                  VirtualTimerFlags;
-    UINT32                  NonSecurePl2Interrupt;
-    UINT32                  NonSecurePl2Flags;
+    UINT32                  NonSecureEl2Interrupt;
+    UINT32                  NonSecureEl2Flags;
+    UINT64                  CounterReadBlockAddress;
+    UINT32                  PlatformTimerCount;
+    UINT32                  PlatformTimerOffset;
 
 } ACPI_TABLE_GTDT;
 
-/* Values for Flags field above */
+/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
+
+#define ACPI_GTDT_INTERRUPT_MODE        (1)
+#define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
+#define ACPI_GTDT_ALWAYS_ON             (1<<2)
+
+
+/* Common GTDT subtable header */
+
+typedef struct acpi_gtdt_header
+{
+    UINT8                   Type;
+    UINT16                  Length;
+
+} ACPI_GTDT_HEADER;
+
+/* Values for GTDT subtable type above */
+
+enum AcpiGtdtType
+{
+    ACPI_GTDT_TYPE_TIMER_BLOCK      = 0,
+    ACPI_GTDT_TYPE_WATCHDOG         = 1,
+    ACPI_GTDT_TYPE_RESERVED         = 2    /* 2 and greater are reserved */
+};
+
+
+/* GTDT Subtables, correspond to Type in acpi_gtdt_header */
+
+/* 0: Generic Timer Block */
+
+typedef struct acpi_gtdt_timer_block
+{
+    ACPI_GTDT_HEADER        Header;
+    UINT8                   Reserved;
+    UINT64                  BlockAddress;
+    UINT32                  TimerCount;
+    UINT32                  TimerOffset;
+
+} ACPI_GTDT_TIMER_BLOCK;
+
+/* Timer Sub-Structure, one per timer */
+
+typedef struct acpi_gtdt_timer_entry
+{
+    UINT8                   FrameNumber;
+    UINT8                   Reserved[3];
+    UINT64                  BaseAddress;
+    UINT64                  El0BaseAddress;
+    UINT32                  TimerInterrupt;
+    UINT32                  TimerFlags;
+    UINT32                  VirtualTimerInterrupt;
+    UINT32                  VirtualTimerFlags;
+    UINT32                  CommonFlags;
+
+} ACPI_GTDT_TIMER_ENTRY;
+
+
+/* Flag Definitions: CommonFlags above */
+
+#define ACPI_GTDT_GT_IS_SECURE_TIMER    (1)
+#define ACPI_GTDT_GT_ALWAYS_ON          (1<<1)
+
 
-#define ACPI_GTDT_MAPPED_BLOCK_PRESENT      1
+/* 1: SBSA Generic Watchdog Structure */
 
-/* Values for all "TimerFlags" fields above */
+typedef struct acpi_gtdt_watchdog
+{
+    ACPI_GTDT_HEADER        Header;
+    UINT8                   Reserved;
+    UINT64                  RefreshFrameAddress;
+    UINT64                  ControlFrameAddress;
+    UINT32                  TimerInterrupt;
+    UINT32                  TimerFlags;
+
+} ACPI_GTDT_WATCHDOG;
 
-#define ACPI_GTDT_INTERRUPT_MODE            1
-#define ACPI_GTDT_INTERRUPT_POLARITY        2
+/* Flag Definitions: TimerFlags above */
+
+#define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
+#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
+#define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
 
 
 /*******************************************************************************
@@ -453,7 +529,8 @@ typedef struct acpi_table_pcct
 enum AcpiPcctType
 {
     ACPI_PCCT_TYPE_GENERIC_SUBSPACE     = 0,
-    ACPI_PCCT_TYPE_RESERVED             = 1     /* 1 and greater are reserved */
+    ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE  = 1,
+    ACPI_PCCT_TYPE_RESERVED             = 2     /* 2 and greater are reserved */
 };
 
 /*
@@ -478,6 +555,31 @@ typedef struct acpi_pcct_subspace
 } ACPI_PCCT_SUBSPACE;
 
 
+/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
+
+typedef struct acpi_pcct_hw_reduced
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT32                  DoorbellInterrupt;
+    UINT8                   Flags;
+    UINT8                   Reserved;
+    UINT64                  BaseAddress;
+    UINT64                  Length;
+    ACPI_GENERIC_ADDRESS    DoorbellRegister;
+    UINT64                  PreserveMask;
+    UINT64                  WriteMask;
+    UINT32                  Latency;
+    UINT32                  MaxAccessRate;
+    UINT16                  MinTurnaroundTime;
+
+} ACPI_PCCT_HW_REDUCED;
+
+/* Values for doorbell flags above */
+
+#define ACPI_PCCT_INTERRUPT_POLARITY    (1)
+#define ACPI_PCCT_INTERRUPT_MODE        (1<<1)
+
+
 /*
  * PCC memory structures (not part of the ACPI table)
  */
index 5e1c307..8171923 100644 (file)
@@ -524,7 +524,7 @@ typedef UINT64                          ACPI_INTEGER;
 
 #define ACPI_TO_POINTER(i)              ACPI_ADD_PTR (void, (void *) NULL,(ACPI_SIZE) i)
 #define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p, (void *) NULL)
-#define ACPI_OFFSET(d, f)               (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
+#define ACPI_OFFSET(d, f)               ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) NULL)
 #define ACPI_PHYSADDR_TO_PTR(i)         ACPI_TO_POINTER(i)
 #define ACPI_PTR_TO_PHYSADDR(i)         ACPI_TO_INTEGER(i)
 
@@ -618,8 +618,9 @@ typedef UINT64                          ACPI_INTEGER;
 #define ACPI_NOTIFY_RESERVED            (UINT8) 0x0A
 #define ACPI_NOTIFY_LOCALITY_UPDATE     (UINT8) 0x0B
 #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (UINT8) 0x0C
+#define ACPI_NOTIFY_AFFINITY_UPDATE     (UINT8) 0x0D
 
-#define ACPI_NOTIFY_MAX                 0x0C
+#define ACPI_NOTIFY_MAX                 0x0D
 
 /*
  * Types associated with ACPI names and objects. The first group of
index b006234..e5656c4 100644 (file)
@@ -225,6 +225,10 @@ AcpiUtHexToAsciiChar (
     UINT64                  Integer,
     UINT32                  Position);
 
+UINT8
+AcpiUtAsciiCharToHex (
+    int                     HexChar);
+
 BOOLEAN
 AcpiUtValidObjectType (
     ACPI_OBJECT_TYPE        Type);
@@ -1135,6 +1139,10 @@ const AH_DEVICE_ID *
 AcpiAhMatchHardwareId (
     char                    *Hid);
 
+const char *
+AcpiAhMatchUuid (
+    UINT8                   *Data);
+
 /*
  * utprint - printf/vprintf output functions
  */
@@ -1176,4 +1184,12 @@ AcpiUtFilePrintf (
     ...);
 #endif
 
+/*
+ * utuuid -- UUID support functions
+ */
+void
+AcpiUtConvertStringToUuid (
+    char                    *InString,
+    UINT8                   *UuidBuffer);
+
 #endif /* _ACUTILS_H */
index ab8bf0d..931ebf9 100644 (file)
@@ -60,7 +60,8 @@ struct mutex;
 
 #define ACPI_USE_NATIVE_DIVIDE
 
-// #define ACPI_THREAD_ID               thread_id
+/* #define ACPI_THREAD_ID               thread_id */
+
 #define ACPI_SEMAPHORE              sem_id
 #define ACPI_SPINLOCK               spinlock *
 #define ACPI_CPU_FLAGS              cpu_status
index a51f288..30f53e9 100644 (file)
 #define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject
 #define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId
 #define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory
-#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory
 
 /*
  * OSL interfaces used by debugger/disassembler
 #define __init
 #endif
 
-#ifndef __iomem
-#define __iomem
-#endif
-
 /* Host-dependent types and defines for user-space ACPICA */
 
 #define ACPI_FLUSH_CPU_CACHE()
index 87d4391..c51f90c 100644 (file)
@@ -114,16 +114,6 @@ AcpiOsGetThreadId (
         Lock ? AE_OK : AE_NO_MEMORY; \
     })
 
-void __iomem *
-AcpiOsMapMemory (
-    ACPI_PHYSICAL_ADDRESS   Where,
-    ACPI_SIZE               Length);
-
-void
-AcpiOsUnmapMemory (
-    void __iomem            *LogicalAddress,
-    ACPI_SIZE               Size);
-
 /*
  * OSL interfaces added by Linux
  */
index 3f6c5da..bbb68d8 100644 (file)
 #define ACPI_EFI_PRINT_LENGTH   256
 
 
-/* Local definitions */
-
-typedef struct acpi_efi_memory_descriptor {
-    EFI_MEMORY_DESCRIPTOR   *Descriptor;
-    UINTN                   EntryCount;
-    UINTN                   EntrySize;
-    UINTN                   Cookie;
-    UINT32                  Version;
-} ACPI_EFI_MEMORY_DESCRIPTOR;
-
-
 /* Local prototypes */
 
-static void *
-AcpiEfiAllocatePool (
-    ACPI_SIZE               Size);
-
 static ACPI_STATUS
 AcpiEfiArgify (
     char                    *String,
@@ -100,25 +85,10 @@ AcpiEfiFlushFile (
     CHAR16                  *Pos,
     BOOLEAN                 FlushAll);
 
-static void
-AcpiEfiFreePool (
-    void                    *Mem);
-
-static ACPI_STATUS
-AcpiEfiInitializeMemoryMap (
-    void);
-
-static void
-AcpiEfiTerminateMemoryMap (
-    void);
-
 
 /* Local variables */
 
 static EFI_FILE_HANDLE      AcpiGbl_EfiCurrentVolume = NULL;
-static ACPI_EFI_MEMORY_DESCRIPTOR       AcpiGbl_EfiMemoryMap;
-static BOOLEAN                          AcpiGbl_EfiMemoryInitialized = FALSE;
-static UINTN                            AcpiGbl_EfiPoolAllocation = EfiBootServicesData;
 
 
 /******************************************************************************
@@ -156,107 +126,6 @@ AcpiEfiCompareGuid (
 }
 
 
-/******************************************************************************
- *
- * FUNCTION:    AcpiEfiInitializeMemoryMap
- *
- * PARAMETERS:  None
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Initialize EFI memory map.
- *
- *****************************************************************************/
-
-static ACPI_STATUS
-AcpiEfiInitializeMemoryMap (
-    void)
-{
-    EFI_STATUS              Status;
-    ACPI_EFI_MEMORY_DESCRIPTOR *Map;
-    UINT32                  Length;
-
-
-    if (AcpiGbl_EfiMemoryInitialized)
-    {
-        return (AE_OK);
-    }
-
-    /* Initialize */
-
-    Map = &AcpiGbl_EfiMemoryMap;
-    Length = sizeof (EFI_MEMORY_DESCRIPTOR);
-    Map->Descriptor = NULL;
-    Status = EFI_BUFFER_TOO_SMALL;
-
-    /* Allocation and GetMemoryMap() loop */
-
-    while (!AcpiGbl_EfiMemoryInitialized &&
-           Status == EFI_BUFFER_TOO_SMALL)
-    {
-        Map->Descriptor = AcpiEfiAllocatePool (Length);
-        if (!Map->Descriptor)
-        {
-            return (AE_NO_MEMORY);
-        }
-        Status = uefi_call_wrapper (BS->GetMemoryMap, 5,
-                    &Length, Map->Descriptor,
-                    &Map->Cookie, &Map->EntrySize, &Map->Version);
-        if (!EFI_ERROR (Status))
-        {
-            AcpiGbl_EfiMemoryInitialized = TRUE;
-        }
-        else if (Status == EFI_BUFFER_TOO_SMALL)
-        {
-            AcpiEfiFreePool (Map->Descriptor);
-        }
-    }
-
-    /* Finalize */
-
-    if (!AcpiGbl_EfiMemoryInitialized)
-    {
-        if (Map->Descriptor)
-        {
-            AcpiEfiFreePool (Map->Descriptor);
-            Map->Descriptor = NULL;
-        }
-        return (AE_ERROR);
-    }
-    else
-    {
-        Map->EntryCount = Length / sizeof (EFI_MEMORY_DESCRIPTOR);
-    }
-
-    return (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiEfiTerminateMemoryMap
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Terminate EFI memory map.
- *
- *****************************************************************************/
-
-static void
-AcpiEfiTerminateMemoryMap (
-    void)
-{
-
-    if (AcpiGbl_EfiMemoryInitialized)
-    {
-        AcpiEfiFreePool (AcpiGbl_EfiMemoryMap.Descriptor);
-        AcpiGbl_EfiMemoryInitialized = FALSE;
-    }
-}
-
-
 /******************************************************************************
  *
  * FUNCTION:    AcpiEfiGetRsdpViaGuid
@@ -291,58 +160,6 @@ AcpiEfiGetRsdpViaGuid (
 }
 
 
-/******************************************************************************
- *
- * FUNCTION:    AcpiEfiAllocatePool
- *
- * PARAMETERS:  Size                - Amount to allocate, in bytes
- *
- * RETURN:      Pointer to the new allocation. Null on error.
- *
- * DESCRIPTION: Allocate pool memory.
- *
- *****************************************************************************/
-
-static void *
-AcpiEfiAllocatePool (
-    ACPI_SIZE               Size)
-{
-    EFI_STATUS              EfiStatus;
-    void                    *Mem;
-
-
-    EfiStatus = uefi_call_wrapper (BS->AllocatePool, 3,
-        AcpiGbl_EfiPoolAllocation, Size, &Mem);
-    if (EFI_ERROR (EfiStatus))
-    {
-        AcpiLogError ("EFI_BOOT_SERVICES->AllocatePool(EfiLoaderData) failure.\n");
-        return (NULL);
-    }
-
-    return (Mem);
-}
-
-/******************************************************************************
- *
- * FUNCTION:    AcpiEfiFreePool
- *
- * PARAMETERS:  Mem                 - Pointer to previously allocated memory
- *
- * RETURN:      None
- *
- * DESCRIPTION: Free memory allocated via AcpiEfiAllocatePool
- *
- *****************************************************************************/
-
-static void
-AcpiEfiFreePool (
-    void                    *Mem)
-{
-
-    uefi_call_wrapper (BS->FreePool, 1, Mem);
-}
-
-
 /******************************************************************************
  *
  * FUNCTION:    AcpiOsGetRootPointer
@@ -392,32 +209,6 @@ AcpiOsMapMemory (
     ACPI_PHYSICAL_ADDRESS   where,
     ACPI_SIZE               length)
 {
-    UINTN                   i;
-    EFI_MEMORY_DESCRIPTOR   *p;
-    UINT64                  Size;
-    EFI_PHYSICAL_ADDRESS    End;
-
-
-    for (i = 0, p = AcpiGbl_EfiMemoryMap.Descriptor;
-         i < AcpiGbl_EfiMemoryMap.EntryCount;
-         i++, p = ACPI_ADD_PTR (EFI_MEMORY_DESCRIPTOR, p, AcpiGbl_EfiMemoryMap.EntrySize))
-    {
-        Size = p->NumberOfPages << EFI_PAGE_SHIFT;
-        End = p->PhysicalStart + Size;
-
-        if (!(p->Attribute & EFI_MEMORY_RUNTIME) || !p->VirtualStart)
-        {
-            continue;
-        }
-
-        if (where >= p->PhysicalStart && where < End)
-        {
-            where += p->VirtualStart - p->PhysicalStart;
-            break;
-        }
-    }
-
-    /* Default to use the physical address */
 
     return (ACPI_TO_POINTER ((ACPI_SIZE) where));
 }
@@ -1252,7 +1043,6 @@ efi_main (
         AcpiLogError ("EFI_BOOT_SERVICES->HandleProtocol(LoadedImageProtocol) failure.\n");
         return (EfiStatus);
     }
-    AcpiGbl_EfiPoolAllocation = Info->ImageDataType;
     EfiStatus = uefi_call_wrapper (BS->HandleProtocol, 3,
         Info->DeviceHandle, &FileSystemProtocol, (void **) &Volume);
     if (EFI_ERROR (EfiStatus))
@@ -1267,12 +1057,6 @@ efi_main (
         AcpiLogError ("EFI_FILE_IO_INTERFACE->OpenVolume() failure.\n");
         return (EfiStatus);
     }
-    Status = AcpiEfiInitializeMemoryMap ();
-    if (ACPI_FAILURE (Status))
-    {
-        EfiStatus = EFI_DEVICE_ERROR;
-        goto ErrorAlloc;
-    }
 
     Status = AcpiEfiConvertArgcv (Info->LoadOptions,
         Info->LoadOptionsSize, &argc, &argv, &OptBuffer);
@@ -1294,7 +1078,6 @@ ErrorAlloc:
     {
         ACPI_FREE (OptBuffer);
     }
-    AcpiEfiTerminateMemoryMap ();
 
     return (EfiStatus);
 }
index 3bb55bb..606e3a9 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Module Name: oslibcfs - C library OSL for file IO
+ * Module Name: oslibcfs - C library OSL for file I/O
  *
  *****************************************************************************/
 
@@ -69,8 +69,9 @@ AcpiOsOpenFile (
     UINT8                   Modes)
 {
     ACPI_FILE               File;
-    char                    ModesStr[4];
     UINT32                  i = 0;
+    char                    ModesStr[4];
+
 
     if (Modes & ACPI_FILE_READING)
     {
@@ -84,6 +85,7 @@ AcpiOsOpenFile (
     {
         ModesStr[i++] = 'b';
     }
+
     ModesStr[i++] = '\0';
 
     File = fopen (Path, ModesStr);
@@ -100,11 +102,11 @@ AcpiOsOpenFile (
  *
  * FUNCTION:    AcpiOsCloseFile
  *
- * PARAMETERS:  File                - File descriptor
+ * PARAMETERS:  File                - An open file descriptor
  *
  * RETURN:      None.
  *
- * DESCRIPTION: Close a file.
+ * DESCRIPTION: Close a file opened via AcpiOsOpenFile.
  *
  ******************************************************************************/
 
@@ -120,14 +122,14 @@ AcpiOsCloseFile (
  *
  * FUNCTION:    AcpiOsReadFile
  *
- * PARAMETERS:  File                - File descriptor
+ * PARAMETERS:  File                - An open file descriptor
  *              Buffer              - Data buffer
  *              Size                - Data block size
  *              Count               - Number of data blocks
  *
- * RETURN:      Size of successfully read buffer.
+ * RETURN:      Number of bytes actually read.
  *
- * DESCRIPTION: Read a file.
+ * DESCRIPTION: Read from a file.
  *
  ******************************************************************************/
 
@@ -140,6 +142,7 @@ AcpiOsReadFile (
 {
     int                     Length;
 
+
     Length = fread (Buffer, Size, Count, File);
     if (Length < 0)
     {
@@ -154,14 +157,14 @@ AcpiOsReadFile (
  *
  * FUNCTION:    AcpiOsWriteFile
  *
- * PARAMETERS:  File                - File descriptor
+ * PARAMETERS:  File                - An open file descriptor
  *              Buffer              - Data buffer
  *              Size                - Data block size
  *              Count               - Number of data blocks
  *
- * RETURN:      Size of successfully written buffer.
+ * RETURN:      Number of bytes actually written.
  *
- * DESCRIPTION: Write a file.
+ * DESCRIPTION: Write to a file.
  *
  ******************************************************************************/
 
@@ -174,6 +177,7 @@ AcpiOsWriteFile (
 {
     int                     Length;
 
+
     Length = fwrite (Buffer, Size, Count, File);
     if (Length < 0)
     {
@@ -188,9 +192,9 @@ AcpiOsWriteFile (
  *
  * FUNCTION:    AcpiOsGetFileOffset
  *
- * PARAMETERS:  File                - File descriptor
+ * PARAMETERS:  File                - An open file descriptor
  *
- * RETURN:      Size of current position.
+ * RETURN:      Current file pointer position.
  *
  * DESCRIPTION: Get current file offset.
  *
@@ -202,8 +206,8 @@ AcpiOsGetFileOffset (
 {
     long                    Offset;
 
-    Offset = ftell (File);
 
+    Offset = ftell (File);
     return (Offset);
 }
 
@@ -212,8 +216,8 @@ AcpiOsGetFileOffset (
  *
  * FUNCTION:    AcpiOsSetFileOffset
  *
- * PARAMETERS:  File                - File descriptor
- *              Offset              - File offset
+ * PARAMETERS:  File                - An open file descriptor
+ *              Offset              - New file offset
  *              From                - From begin/end of file
  *
  * RETURN:      Status
index eb088b9..b2df842 100644 (file)
@@ -1159,7 +1159,7 @@ AcpiOsGetTimer (
  * FUNCTION:    AcpiOsReadPciConfiguration
  *
  * PARAMETERS:  PciId               - Seg/Bus/Dev
- *              Register            - Device Register
+ *              PciRegister         - Device Register
  *              Value               - Buffer where value is placed
  *              Width               - Number of bits
  *
@@ -1172,7 +1172,7 @@ AcpiOsGetTimer (
 ACPI_STATUS
 AcpiOsReadPciConfiguration (
     ACPI_PCI_ID             *PciId,
-    UINT32                  Register,
+    UINT32                  PciRegister,
     UINT64                  *Value,
     UINT32                  Width)
 {
@@ -1187,7 +1187,7 @@ AcpiOsReadPciConfiguration (
  * FUNCTION:    AcpiOsWritePciConfiguration
  *
  * PARAMETERS:  PciId               - Seg/Bus/Dev
- *              Register            - Device Register
+ *              PciRegister         - Device Register
  *              Value               - Value to be written
  *              Width               - Number of bits
  *
@@ -1200,7 +1200,7 @@ AcpiOsReadPciConfiguration (
 ACPI_STATUS
 AcpiOsWritePciConfiguration (
     ACPI_PCI_ID             *PciId,
-    UINT32                  Register,
+    UINT32                  PciRegister,
     UINT64                  Value,
     UINT32                  Width)
 {
index 0afde68..7c8ec2b 100644 (file)
@@ -329,7 +329,7 @@ AcpiOsGetTableByName (
 
     WinStatus = RegQueryValueEx (Handle, KeyBuffer, NULL, NULL,
         NULL, &DataSize);
-    if (WinStatus = ERROR_SUCCESS)
+    if (WinStatus != ERROR_SUCCESS)
     {
         fprintf (stderr, "Could not read the %s table size: %s\n",
             Signature, WindowsFormatException (WinStatus));
@@ -350,7 +350,7 @@ AcpiOsGetTableByName (
 
     WinStatus = RegQueryValueEx (Handle, KeyBuffer, NULL, NULL,
         (UCHAR *) ReturnTable, &DataSize);
-    if (WinStatus = ERROR_SUCCESS)
+    if (WinStatus != ERROR_SUCCESS)
     {
         fprintf (stderr, "Could not read %s data: %s\n",
             Signature, WindowsFormatException (WinStatus));
index 1280ff6..9f32ae7 100644 (file)
@@ -1341,8 +1341,7 @@ AeRegionHandler (
             case AML_FIELD_ATTRIB_RAW_BYTES:
             case AML_FIELD_ATTRIB_RAW_PROCESS:
 
-                /* (-2) for status/length */
-                Length = MyContext->AccessLength - 2;
+                Length = MyContext->AccessLength;
                 break;
 
             default:
@@ -1376,8 +1375,7 @@ AeRegionHandler (
             case AML_FIELD_ATTRIB_RAW_BYTES:
             case AML_FIELD_ATTRIB_RAW_PROCESS:
 
-                /* (-2) for status/length */
-                Length = MyContext->AccessLength - 2;
+                Length = MyContext->AccessLength;
                 break;
 
             default:
index da15e4e..5e7a40f 100644 (file)
@@ -71,6 +71,7 @@
 #define     AH_DISPLAY_DEVICE_IDS       6
 #define     AH_DECODE_EXCEPTION         7
 #define     AH_DECODE_ASL_AML           8
+#define     AH_DISPLAY_UUIDS            9
 
 #define     AH_MAX_ASL_LINE_LENGTH      70
 #define     AH_MAX_AML_LINE_LENGTH      100
@@ -109,6 +110,7 @@ typedef struct ah_asl_keyword
 extern const AH_AML_OPCODE          AmlOpcodeInfo[];
 extern const AH_ASL_OPERATOR        AslOperatorInfo[];
 extern const AH_ASL_KEYWORD         AslKeywordInfo[];
+extern const AH_UUID                AcpiUuids[];
 extern BOOLEAN                      AhDisplayAll;
 
 void
@@ -147,4 +149,8 @@ void
 AhDisplayDeviceIds (
     char                    *Name);
 
+void
+AhDisplayUuids (
+    void);
+
 #endif /* __ACPIHELP_H */
index 60e3808..3857071 100644 (file)
@@ -871,6 +871,34 @@ AhDisplayDeviceIds (
 }
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    AhDisplayUuids
+ *
+ * PARAMETERS:  None
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Display all known UUIDs.
+ *
+ ******************************************************************************/
+
+void
+AhDisplayUuids (
+    void)
+{
+    const AH_UUID           *Info;
+
+
+    printf ("ACPI-related UUIDs:\n\n");
+
+    for (Info = AcpiUuids; Info->Description; Info++)
+    {
+        printf ("%32s : %s\n", Info->Description, Info->String);
+    }
+}
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AhDecodeException
index 9be1f3b..4749e5b 100644 (file)
@@ -51,7 +51,7 @@ AhDisplayUsage (
     void);
 
 #define AH_UTILITY_NAME             "ACPI Help Utility"
-#define AH_SUPPORTED_OPTIONS        "aehikmopsv"
+#define AH_SUPPORTED_OPTIONS        "aehikmopsuv"
 
 
 /******************************************************************************
@@ -82,6 +82,7 @@ AhDisplayUsage (
 
     ACPI_USAGE_TEXT ("\nOther ACPI Names:\n");
     ACPI_OPTION ("-i [Name/Prefix]",        "Find/Display ACPI/PNP Hardware ID(s)");
+    ACPI_OPTION ("-u",                      "Display ACPI-related UUIDs");
 
     ACPI_USAGE_TEXT ("\nACPI Values:\n");
     ACPI_OPTION ("-e [HexValue]",           "Decode ACPICA exception code");
@@ -167,6 +168,11 @@ main (
         DecodeType = AH_DECODE_ASL;
         break;
 
+    case 'u':
+
+        DecodeType = AH_DISPLAY_UUIDS;
+        break;
+
     case 'v': /* -v: (Version): signon already emitted, just exit */
 
         return (0);
@@ -224,6 +230,11 @@ main (
         AhDecodeException (Name);
         break;
 
+    case AH_DISPLAY_UUIDS:
+
+        AhDisplayUuids ();
+        break;
+
     default:
 
         if (!Name)
index 53c0c54..5184b8b 100644 (file)
@@ -268,7 +268,7 @@ AsCheckAndSkipLiterals (
  *
  * FUNCTION:    AsAsCheckForBraces
  *
- * DESCRIPTION: Check for an open brace after each if statement
+ * DESCRIPTION: Check for an open brace after each if/else statement
  *
  ******************************************************************************/
 
@@ -280,14 +280,69 @@ AsCheckForBraces (
     char                    *SubBuffer = Buffer;
     char                    *NextBrace;
     char                    *NextSemicolon;
-    char                    *NextIf;
     UINT32                  TotalLines = 1;
+    char                    *EndBuffer;
 
 
-    while (*SubBuffer)
+    EndBuffer = SubBuffer + strlen (SubBuffer);
+
+    while (SubBuffer <= EndBuffer)
     {
+        /* TBD: Update this function to work properly, as per code below */
+        /* SubBuffer = AsCheckAndSkipLiterals (SubBuffer, &TotalLines); */
+
+        /* Skip normal comments */
+
+        if ((*SubBuffer == '/') &&
+            (*(SubBuffer + 1) == '*'))
+        {
+            /* Must maintain line count */
+
+            SubBuffer += 2;
+            while (strncmp ("*/", SubBuffer, 2))
+            {
+                if (*SubBuffer == '\n')
+                {
+                    TotalLines++;
+                }
+                SubBuffer++;
+            }
+            SubBuffer += 2;
+            continue;
+        }
+
+        /* Skip single quoted chars */
+
+        if (*SubBuffer == '\'')
+        {
+            SubBuffer++;
+            if (*SubBuffer == '\\')
+            {
+                SubBuffer++;
+            }
+            SubBuffer++;
+            continue;
+        }
 
-        SubBuffer = AsCheckAndSkipLiterals (SubBuffer, &TotalLines);
+        /* Skip quoted strings */
+
+        if (*SubBuffer == '"')
+        {
+            SubBuffer++;
+            while (*SubBuffer != '"')
+            {
+                /* Handle escapes within the string */
+
+                if (*SubBuffer == '\\')
+                {
+                    SubBuffer++;
+                }
+                SubBuffer++;
+            }
+
+            SubBuffer++;
+            continue;
+        }
 
         if (*SubBuffer == '\n')
         {
@@ -296,13 +351,12 @@ AsCheckForBraces (
         else if (!(strncmp (" if", SubBuffer, 3)))
         {
             SubBuffer += 2;
+
             NextBrace = strstr (SubBuffer, "{");
             NextSemicolon = strstr (SubBuffer, ";");
-            NextIf = strstr (SubBuffer, " if");
 
             if ((!NextBrace) ||
-               (NextSemicolon && (NextBrace > NextSemicolon)) ||
-               (NextIf && (NextBrace > NextIf)))
+               (NextSemicolon && (NextBrace > NextSemicolon)))
             {
                 Gbl_MissingBraces++;
 
@@ -315,19 +369,18 @@ AsCheckForBraces (
         else if (!(strncmp (" else if", SubBuffer, 8)))
         {
             SubBuffer += 7;
+
             NextBrace = strstr (SubBuffer, "{");
             NextSemicolon = strstr (SubBuffer, ";");
-            NextIf = strstr (SubBuffer, " if");
 
             if ((!NextBrace) ||
-               (NextSemicolon && (NextBrace > NextSemicolon)) ||
-               (NextIf && (NextBrace > NextIf)))
+               (NextSemicolon && (NextBrace > NextSemicolon)))
             {
                 Gbl_MissingBraces++;
 
                 if (!Gbl_QuietMode)
                 {
-                    printf ("Missing braces for <if>, line %u: %s\n", TotalLines, Filename);
+                    printf ("Missing braces for <else if>, line %u: %s\n", TotalLines, Filename);
                 }
             }
         }
@@ -336,11 +389,9 @@ AsCheckForBraces (
             SubBuffer += 4;
             NextBrace = strstr (SubBuffer, "{");
             NextSemicolon = strstr (SubBuffer, ";");
-            NextIf = strstr (SubBuffer, " if");
 
             if ((!NextBrace) ||
-               (NextSemicolon && (NextBrace > NextSemicolon)) ||
-               (NextIf && (NextBrace > NextIf)))
+               (NextSemicolon && (NextBrace > NextSemicolon)))
             {
                 Gbl_MissingBraces++;
 
@@ -1192,6 +1243,9 @@ AsCountTabs (
  * DESCRIPTION: Count the number of "//" comments. This type of comment is
  *              non-ANSI C.
  *
+ * NOTE: July 2014: Allows // within quoted strings and within normal
+ *       comments. Eliminates extraneous warnings from this utility.
+ *
  ******************************************************************************/
 
 void
@@ -1200,22 +1254,82 @@ AsCountNonAnsiComments (
     char                    *Filename)
 {
     char                    *SubBuffer = Buffer;
+    char                    *EndBuffer;
     UINT32                  CommentCount = 0;
+    char                    *StartBuffer;
+
 
+    EndBuffer = SubBuffer + strlen (SubBuffer);
 
-    while (SubBuffer)
+    while (SubBuffer <= EndBuffer)
     {
-        SubBuffer = strstr (SubBuffer, "//");
-        if (SubBuffer)
+        /* Skip normal comments */
+
+        if ((*SubBuffer == '/') &&
+            (*(SubBuffer + 1) == '*'))
         {
-            CommentCount++;
+            SubBuffer = strstr (SubBuffer + 2, "*/");
+            if (!SubBuffer)
+            {
+                break;
+            }
+
             SubBuffer += 2;
+            continue;
+        }
+
+        /* Skip single quoted chars */
+
+        if (*SubBuffer == '\'')
+        {
+            SubBuffer++;
+            if (*SubBuffer == '\\')
+            {
+                SubBuffer++;
+            }
+            SubBuffer++;
+            continue;
+        }
+
+        /* Skip quoted strings */
+
+        if (*SubBuffer == '"')
+        {
+ StartBuffer = SubBuffer;
+AcpiOsPrintf ("START STRING: %.64s\n", StartBuffer);
+           SubBuffer++;
+            while (*SubBuffer != '"')
+            {
+                /* Handle escapes within the string */
+
+                if (*SubBuffer == '\\')
+                {
+                    SubBuffer++;
+                }
+                SubBuffer++;
+            }
+
+            SubBuffer++;
+            continue;
+        }
+
+        /* Finally: check for slash-slash comment */
+
+        if ((*SubBuffer == '/') &&
+            (*(SubBuffer + 1) == '/'))
+        {
+            CommentCount++;
+            SubBuffer++;
         }
+
+        SubBuffer++;
     }
 
+    /* Error if any slash-slash comments found */
+
     if (CommentCount)
     {
-        AsPrint ("Non-ANSI Comments found", CommentCount, Filename);
+        AsPrint ("Non-ANSI // Comments Found", CommentCount, Filename);
         Gbl_NonAnsiComments += CommentCount;
     }
 }
index 7f25988..1f6f09d 100644 (file)
@@ -506,6 +506,7 @@ ACPI_TYPED_IDENTIFIER_TABLE           AcpiIdentifiers[] = {
     {"ACPI_TABLE_FACS",                     SRC_TYPE_STRUCT},
     {"ACPI_TABLE_FADT",                     SRC_TYPE_STRUCT},
     {"ACPI_TABLE_FPDT",                     SRC_TYPE_STRUCT},
+    {"ACPI_TABLE_GTDT",                     SRC_TYPE_STRUCT},
     {"ACPI_TABLE_HEST",                     SRC_TYPE_STRUCT},
     {"ACPI_TABLE_HPET",                     SRC_TYPE_STRUCT},
     {"ACPI_TABLE_IBFT",                     SRC_TYPE_STRUCT},
@@ -551,17 +552,22 @@ ACPI_TYPED_IDENTIFIER_TABLE           AcpiIdentifiers[] = {
     {"ACPI_DBG2_DEVICE",                    SRC_TYPE_STRUCT},
     {"ACPI_DMAR_HEADER",                    SRC_TYPE_STRUCT},
     {"ACPI_DMAR_DEVICE_SCOPE",              SRC_TYPE_STRUCT},
+    {"ACPI_DMAR_ANDD",                      SRC_TYPE_STRUCT},
     {"ACPI_DMAR_ATSR",                      SRC_TYPE_STRUCT},
     {"ACPI_DMAR_RHSA",                      SRC_TYPE_STRUCT},
     {"ACPI_DMAR_HARDWARE_UNIT",             SRC_TYPE_STRUCT},
     {"ACPI_DMAR_RESERVED_MEMORY",           SRC_TYPE_STRUCT},
     {"ACPI_EINJ_ENTRY",                     SRC_TYPE_STRUCT},
     {"ACPI_EINJ_TRIGGER",                   SRC_TYPE_STRUCT},
+    {"ACPI_ERST_ENTRY",                     SRC_TYPE_STRUCT},
+    {"ACPI_ERST_INFO",                      SRC_TYPE_STRUCT},
     {"ACPI_FPDT_HEADER",                    SRC_TYPE_STRUCT},
     {"ACPI_FPDT_BOOT",                      SRC_TYPE_STRUCT},
     {"ACPI_FPDT_S3PT_PTR",                  SRC_TYPE_STRUCT},
-    {"ACPI_ERST_ENTRY",                     SRC_TYPE_STRUCT},
-    {"ACPI_ERST_INFO",                      SRC_TYPE_STRUCT},
+    {"ACPI_GTDT_HEADER",                    SRC_TYPE_STRUCT},
+    {"ACPI_GTDT_TIMER_BLOCK",               SRC_TYPE_STRUCT},
+    {"ACPI_GTDT_TIMER_ENTRY",               SRC_TYPE_STRUCT},
+    {"ACPI_GTDT_WATCHDOG",                  SRC_TYPE_STRUCT},
     {"ACPI_HEST_AER_COMMON",                SRC_TYPE_STRUCT},
     {"ACPI_HEST_HEADER",                    SRC_TYPE_STRUCT},
     {"ACPI_HEST_NOTIFY",                    SRC_TYPE_STRUCT},
@@ -589,6 +595,8 @@ ACPI_TYPED_IDENTIFIER_TABLE           AcpiIdentifiers[] = {
     {"ACPI_IVRS_DEVICE8C",                  SRC_TYPE_STRUCT},
     {"ACPI_IVRS_MEMORY",                    SRC_TYPE_STRUCT},
     {"ACPI_MADT_ADDRESS_OVERRIDE",          SRC_TYPE_STRUCT},
+    {"ACPI_MADT_GENERIC_MSI_FRAME",         SRC_TYPE_STRUCT},
+    {"ACPI_MADT_GENERIC_REDISTRIBUTOR",     SRC_TYPE_STRUCT},
     {"ACPI_MADT_HEADER",                    SRC_TYPE_STRUCT},
     {"ACPI_MADT_IO_APIC",                   SRC_TYPE_STRUCT},
     {"ACPI_MADT_IO_SAPIC",                  SRC_TYPE_STRUCT},
@@ -611,6 +619,8 @@ ACPI_TYPED_IDENTIFIER_TABLE           AcpiIdentifiers[] = {
     {"ACPI_MPST_POWER_STATE",               SRC_TYPE_STRUCT},
     {"ACPI_MCFG_ALLOCATION",                SRC_TYPE_STRUCT},
     {"ACPI_MSCT_PROXIMITY",                 SRC_TYPE_STRUCT},
+    {"ACPI_PCCT_HW_REDUCED",                SRC_TYPE_STRUCT},
+    {"ACPI_PCCT_SHARED_MEMORY",             SRC_TYPE_STRUCT},
     {"ACPI_PCCT_SUBSPACE",                  SRC_TYPE_STRUCT},
     {"ACPI_RSDP_COMMON",                    SRC_TYPE_STRUCT},
     {"ACPI_RSDP_EXTENSION",                 SRC_TYPE_STRUCT},
@@ -652,6 +662,7 @@ ACPI_TYPED_IDENTIFIER_TABLE           AcpiIdentifiers[] = {
     {"AH_ASL_KEYWORD",                      SRC_TYPE_STRUCT},
     {"AH_DEVICE_ID",                        SRC_TYPE_STRUCT},
     {"AH_PREDEFINED_NAME",                  SRC_TYPE_STRUCT},
+    {"AH_UUID",                             SRC_TYPE_STRUCT},
 
     /* AcpiXtract utility */
 
index d8b201a..c5f6434 100644 (file)
@@ -8402,7 +8402,7 @@ DefinitionBlock (
                     Return (0x71)
                 }
 
-                Store (DerefOf (Index (DEST, 3)), Local0) // DEST = "Destination buffer that...
+                Store (DerefOf (Index (DEST, 3)), Local0) // DEST = "Destination buffer that..."
 
                 If (LNotEqual (Local0, 0x74))       //  't'
                 {
index af259ac..b2c1a3e 100644 (file)
@@ -30,7 +30,7 @@ CFLAGS+=      -DACPI_DEBUG_CACHE
 KMOD   = acpi
 
 # ACPICA sources
-SRCS+= ahids.c
+SRCS+= ahids.c ahuuids.c
 SRCS+= dbcmds.c dbconvert.c dbdisply.c dbexec.c dbfileio.c dbhistry.c
 SRCS+= dbinput.c dbstats.c dbtest.c dbutils.c dbxface.c
 SRCS+= dbmethod.c dbnames.c
@@ -59,10 +59,10 @@ SRCS+=      rsirq.c rslist.c rsmemory.c rsmisc.c rsserial.c rsutils.c
 SRCS+= rsxface.c tbdata.c tbfadt.c tbfind.c tbinstal.c tbprint.c
 SRCS+= tbutils.c tbxface.c tbxfload.c tbxfroot.c utalloc.c utbuffer.c
 SRCS+= utaddress.c utclib.c utcopy.c
-SRCS+= utdebug.c utdelete.c uterror.c uteval.c utexcep.c
-SRCS+= utlock.c utglobal.c utinit.c utmath.c utmisc.c utmutex.c
-SRCS+= utobject.c utownerid.c utpredef.c
-SRCS+= utresrc.c utstate.c utstring.c utxface.c utdecode.c utids.c utosi.c
+SRCS+= utdebug.c utdecode.c utdelete.c uterror.c uteval.c utexcep.c
+SRCS+= utglobal.c uthex.c utids.c utinit.c utlock.c
+SRCS+= utmath.c utmisc.c utmutex.c utobject.c utosi.c utownerid.c utpredef.c
+SRCS+= utresrc.c utstate.c utstring.c utuuid.c utxface.c
 SRCS+= utxferror.c utxfinit.c
 
 # OSD layer
index a595686..d3530a5 100644 (file)
@@ -20,6 +20,7 @@ SRCS= \
 SRCS+= \
        acgetline.c \
        ahids.c \
+       ahuuids.c \
        cmfsize.c \
        dbcmds.c \
        dbconvert.c \
@@ -178,6 +179,7 @@ SRCS+=      \
        utexcep.c \
        utfileio.o \
        utglobal.c \
+       uthex.c \
        utids.c \
        utinit.c \
        utlock.c \
@@ -193,6 +195,7 @@ SRCS+=      \
        utstate.c \
        utstring.c \
        uttrack.c \
+       utuuid.c \
        utxface.c \
        utxferror.c \
        utxfinit.c \
index 2a82866..4c904d0 100644 (file)
@@ -17,7 +17,8 @@ SRCS= \
        ahdecode.c \
        ahids.c \
        ahpredef.c \
-       ahmain.c
+       ahmain.c \
+       ahuuids.c
 
 SRCS+= \
        getopt.c \
@@ -26,9 +27,11 @@ SRCS+=       \
        utdebug.c \
        utexcep.c \
        utglobal.c \
+       uthex.c \
        utmath.c \
        utpredef.c \
-       utprint.c
+       utprint.c \
+       utuuid.c
 
 CFLAGS+= \
        -DACPI_HELP_APP \
index 59fcdd0..99020c3 100644 (file)
@@ -28,7 +28,7 @@
 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd April 14, 2014
+.Dd July 25, 2014
 .Dt ACPIHELP 8
 .Os
 .Sh NAME
@@ -59,6 +59,8 @@ Decode hex AML opcode.
 Find/Display ASL predefined method name(s).
 .It Fl s Op Ar name/prefix
 Find/Display ASL operator name(s).
+.It Fl u
+Display ACPI-related UUIDs.
 .It Fl v
 Display version information.
 .El
index bebc743..2ea889f 100644 (file)
@@ -83,6 +83,7 @@ SRCS+=        \
        utexcep.c \
        utfileio.c \
        utglobal.c \
+       uthex.c \
        utids.c \
        utinit.c \
        utlock.c \
index c1db27c..c505260 100644 (file)
@@ -25,6 +25,7 @@ SRCS= \
        adwalk.c \
        ahids.c \
        ahpredef.c \
+       ahuuids.c \
        aslanalyze.c \
        aslbtypes.c \
        aslcodegen.c \
@@ -169,6 +170,7 @@ SRCS=       \
        utexcep.c \
        utfileio.c \
        utglobal.c \
+       uthex.c \
        utinit.c \
        utlock.c \
        utmath.c \
@@ -181,6 +183,7 @@ SRCS=       \
        utresrc.c \
        utstate.c \
        utstring.c \
+       utuuid.c \
        utxface.c \
        utxferror.c