]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/acpica/lib-acpi/src/acpica/common/dmrestag.c
update
[l4.git] / l4 / pkg / acpica / lib-acpi / src / acpica / common / dmrestag.c
index e314b318af8735f3d46a234ad179b09e74b2f651..39e42d13976e7b9e80e6d455b318a8dd89fc7a20 100644 (file)
@@ -8,13 +8,13 @@
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2012, Intel Corp.
  * All rights reserved.
  *
  * 2. License
  *
  * 2.1. This is your license from Intel Corp. under its intellectual property
- * rights.  You may have additional license terms from the party that provided
+ * rights. You may have additional license terms from the party that provided
  * you this software, covering your right to use that party's intellectual
  * property rights.
  *
@@ -31,7 +31,7 @@
  * offer to sell, and import the Covered Code and derivative works thereof
  * solely to the minimum extent necessary to exercise the above copyright
  * license, and in no event shall the patent license extend to any additions
- * to or modifications of the Original Intel Code.  No other license or right
+ * to or modifications of the Original Intel Code. No other license or right
  * is granted directly or by implication, estoppel or otherwise;
  *
  * The above copyright and patent license is granted only if the following
  * Redistribution of source code of any substantial portion of the Covered
  * Code or modification with rights to further distribute source must include
  * the above Copyright Notice, the above License, this list of Conditions,
- * and the following Disclaimer and Export Compliance provision.  In addition,
+ * and the following Disclaimer and Export Compliance provision. In addition,
  * Licensee must cause all Covered Code to which Licensee contributes to
  * contain a file documenting the changes Licensee made to create that Covered
- * Code and the date of any change.  Licensee must include in that file the
- * documentation of any changes made by any predecessor Licensee.  Licensee
+ * Code and the date of any change. Licensee must include in that file the
+ * documentation of any changes made by any predecessor Licensee. Licensee
  * must include a prominent statement that the modification is derived,
  * directly or indirectly, from Original Intel Code.
  *
@@ -55,7 +55,7 @@
  * Redistribution of source code of any substantial portion of the Covered
  * Code or modification without rights to further distribute source must
  * include the following Disclaimer and Export Compliance provision in the
- * documentation and/or other materials provided with distribution.  In
+ * documentation and/or other materials provided with distribution. In
  * addition, Licensee may not authorize further sublicense of source of any
  * portion of the Covered Code, and must include terms to the effect that the
  * license from Licensee to its licensee is limited to the intellectual
  * 4. Disclaimer and Export Compliance
  *
  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
- * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
- * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
- * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
- * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
+ * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
+ * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
+ * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
+ * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
  * PARTICULAR PURPOSE.
  *
  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
- * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
+ * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
  * LIMITED REMEDY.
  *
  * 4.3. Licensee shall not export, either directly or indirectly, any of this
  * software or system incorporating such software without first obtaining any
  * required license or other approval from the U. S. Department of Commerce or
- * any other agency or department of the United States Government.  In the
+ * any other agency or department of the United States Government. In the
  * event Licensee exports any such software from the United States or
  * re-exports any such software from a foreign destination, Licensee shall
  * ensure that the distribution and export/re-export of the software is in
@@ -135,7 +135,7 @@ AcpiDmUpdateResourceName (
 static char *
 AcpiDmSearchTagList (
     UINT32                  BitIndex,
-    ACPI_RESOURCE_TAG       *TagList);
+    const ACPI_RESOURCE_TAG *TagList);
 
 static char *
 AcpiDmGetResourceTag (
@@ -145,6 +145,7 @@ AcpiDmGetResourceTag (
 
 static char *
 AcpiGetTagPathname (
+    ACPI_PARSE_OBJECT       *Op,
     ACPI_NAMESPACE_NODE     *BufferNode,
     ACPI_NAMESPACE_NODE     *ResourceNode,
     UINT32                  BitIndex);
@@ -180,7 +181,7 @@ AcpiDmAddResourcesToNamespace (
  *
  ******************************************************************************/
 
-static ACPI_RESOURCE_TAG        AcpiDmIrqTags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmIrqTags[] =
 {
     {( 1 * 8),      ACPI_RESTAG_INTERRUPT},
     {( 3 * 8) + 0,  ACPI_RESTAG_INTERRUPTTYPE},
@@ -189,7 +190,7 @@ static ACPI_RESOURCE_TAG        AcpiDmIrqTags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmDmaTags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmDmaTags[] =
 {
     {( 1 * 8),      ACPI_RESTAG_DMA},
     {( 2 * 8) + 0,  ACPI_RESTAG_XFERTYPE},
@@ -198,7 +199,7 @@ static ACPI_RESOURCE_TAG        AcpiDmDmaTags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmIoTags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmIoTags[] =
 {
     {( 1 * 8) + 0,  ACPI_RESTAG_DECODE},
     {( 2 * 8),      ACPI_RESTAG_MINADDR},
@@ -208,14 +209,22 @@ static ACPI_RESOURCE_TAG        AcpiDmIoTags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmFixedIoTags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmFixedIoTags[] =
 {
     {( 1 * 8),      ACPI_RESTAG_BASEADDRESS},
     {( 3 * 8),      ACPI_RESTAG_LENGTH},
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmMemory24Tags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmFixedDmaTags[] =
+{
+    {( 1 * 8),      ACPI_RESTAG_DMA},
+    {( 3 * 8),      ACPI_RESTAG_DMATYPE},
+    {( 5 * 8),      ACPI_RESTAG_XFERTYPE},
+    {0,             NULL}
+};
+
+static const ACPI_RESOURCE_TAG      AcpiDmMemory24Tags[] =
 {
     {( 3 * 8) + 0,  ACPI_RESTAG_READWRITETYPE},
     {( 4 * 8),      ACPI_RESTAG_MINADDR},
@@ -225,7 +234,7 @@ static ACPI_RESOURCE_TAG        AcpiDmMemory24Tags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmRegisterTags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmRegisterTags[] =
 {
     {( 3 * 8),      ACPI_RESTAG_ADDRESSSPACE},
     {( 4 * 8),      ACPI_RESTAG_REGISTERBITWIDTH},
@@ -235,7 +244,7 @@ static ACPI_RESOURCE_TAG        AcpiDmRegisterTags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmMemory32Tags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmMemory32Tags[] =
 {
     {( 3 * 8) + 0,  ACPI_RESTAG_READWRITETYPE},
     {( 4 * 8),      ACPI_RESTAG_MINADDR},
@@ -245,7 +254,7 @@ static ACPI_RESOURCE_TAG        AcpiDmMemory32Tags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmFixedMemory32Tags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmFixedMemory32Tags[] =
 {
     {( 3 * 8) + 0,  ACPI_RESTAG_READWRITETYPE},
     {( 4 * 8),      ACPI_RESTAG_BASEADDRESS},
@@ -253,7 +262,7 @@ static ACPI_RESOURCE_TAG        AcpiDmFixedMemory32Tags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmInterruptTags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmInterruptTags[] =
 {
     {( 3 * 8) + 1,  ACPI_RESTAG_INTERRUPTTYPE},
     {( 3 * 8) + 2,  ACPI_RESTAG_INTERRUPTLEVEL},
@@ -262,7 +271,7 @@ static ACPI_RESOURCE_TAG        AcpiDmInterruptTags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmAddress16Tags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmAddress16Tags[] =
 {
     {( 4 * 8) + 1,  ACPI_RESTAG_DECODE},
     {( 4 * 8) + 2,  ACPI_RESTAG_MINTYPE},
@@ -275,7 +284,7 @@ static ACPI_RESOURCE_TAG        AcpiDmAddress16Tags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmAddress32Tags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmAddress32Tags[] =
 {
     {( 4 * 8) + 1,  ACPI_RESTAG_DECODE},
     {( 4 * 8) + 2,  ACPI_RESTAG_MINTYPE},
@@ -288,7 +297,7 @@ static ACPI_RESOURCE_TAG        AcpiDmAddress32Tags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmAddress64Tags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmAddress64Tags[] =
 {
     {( 4 * 8) + 1,  ACPI_RESTAG_DECODE},
     {( 4 * 8) + 2,  ACPI_RESTAG_MINTYPE},
@@ -301,7 +310,7 @@ static ACPI_RESOURCE_TAG        AcpiDmAddress64Tags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmExtendedAddressTags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmExtendedAddressTags[] =
 {
     {( 4 * 8) + 1,  ACPI_RESTAG_DECODE},
     {( 4 * 8) + 2,  ACPI_RESTAG_MINTYPE},
@@ -315,9 +324,71 @@ static ACPI_RESOURCE_TAG        AcpiDmExtendedAddressTags[] =
     {0,             NULL}
 };
 
-/* Special-case tables for the type-specific flags */
+/* Subtype tables for GPIO descriptors */
+
+static const ACPI_RESOURCE_TAG      AcpiDmGpioIntTags[] =
+{
+    {( 7 * 8) + 0,  ACPI_RESTAG_MODE},
+    {( 7 * 8) + 1,  ACPI_RESTAG_POLARITY},
+    {( 7 * 8) + 3,  ACPI_RESTAG_INTERRUPTSHARE},
+    {( 9 * 8),      ACPI_RESTAG_PINCONFIG},
+    {(10 * 8),      ACPI_RESTAG_DRIVESTRENGTH},
+    {(12 * 8),      ACPI_RESTAG_DEBOUNCETIME},
+    {0,             NULL}
+};
+
+static const ACPI_RESOURCE_TAG      AcpiDmGpioIoTags[] =
+{
+    {( 7 * 8) + 0,  ACPI_RESTAG_IORESTRICTION},
+    {( 7 * 8) + 3,  ACPI_RESTAG_INTERRUPTSHARE},
+    {( 9 * 8),      ACPI_RESTAG_PINCONFIG},
+    {(10 * 8),      ACPI_RESTAG_DRIVESTRENGTH},
+    {(12 * 8),      ACPI_RESTAG_DEBOUNCETIME},
+    {0,             NULL}
+};
+
+/* Subtype tables for SerialBus descriptors */
+
+static const ACPI_RESOURCE_TAG      AcpiDmI2cSerialBusTags[] =
+{
+    {( 6 * 8) + 0,  ACPI_RESTAG_SLAVEMODE},
+    {( 7 * 8) + 0,  ACPI_RESTAG_MODE},
+    {(12 * 8),      ACPI_RESTAG_SPEED},
+    {(16 * 8),      ACPI_RESTAG_ADDRESS},
+    {0,             NULL}
+};
+
+static const ACPI_RESOURCE_TAG      AcpiDmSpiSerialBusTags[] =
+{
+    {( 6 * 8) + 0,  ACPI_RESTAG_SLAVEMODE},
+    {( 7 * 8) + 0,  ACPI_RESTAG_MODE},
+    {( 7 * 8) + 1,  ACPI_RESTAG_DEVICEPOLARITY},
+    {(12 * 8),      ACPI_RESTAG_SPEED},
+    {(16 * 8),      ACPI_RESTAG_LENGTH},
+    {(17 * 8),      ACPI_RESTAG_PHASE},
+    {(18 * 8),      ACPI_RESTAG_POLARITY},
+    {(19 * 8),      ACPI_RESTAG_ADDRESS},
+    {0,             NULL}
+};
+
+static const ACPI_RESOURCE_TAG      AcpiDmUartSerialBusTags[] =
+{
+    {( 6 * 8) + 0,  ACPI_RESTAG_SLAVEMODE}, /* Note: not part of original macro */
+    {( 7 * 8) + 0,  ACPI_RESTAG_FLOWCONTROL},
+    {( 7 * 8) + 2,  ACPI_RESTAG_STOPBITS},
+    {( 7 * 8) + 4,  ACPI_RESTAG_LENGTH},
+    {( 7 * 8) + 7,  ACPI_RESTAG_ENDIANNESS},
+    {(12 * 8),      ACPI_RESTAG_SPEED},
+    {(16 * 8),      ACPI_RESTAG_LENGTH_RX},
+    {(18 * 8),      ACPI_RESTAG_LENGTH_TX},
+    {(20 * 8),      ACPI_RESTAG_PARITY},
+    {(21 * 8),      ACPI_RESTAG_LINE},
+    {0,             NULL}
+};
+
+/* Subtype tables for Address descriptor type-specific flags */
 
-static ACPI_RESOURCE_TAG        AcpiDmMemoryFlagTags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmMemoryFlagTags[] =
 {
     {( 5 * 8) + 0,  ACPI_RESTAG_READWRITETYPE},
     {( 5 * 8) + 1,  ACPI_RESTAG_MEMTYPE},
@@ -326,7 +397,7 @@ static ACPI_RESOURCE_TAG        AcpiDmMemoryFlagTags[] =
     {0,             NULL}
 };
 
-static ACPI_RESOURCE_TAG        AcpiDmIoFlagTags[] =
+static const ACPI_RESOURCE_TAG      AcpiDmIoFlagTags[] =
 {
     {( 5 * 8) + 0,  ACPI_RESTAG_RANGETYPE},
     {( 5 * 8) + 4,  ACPI_RESTAG_TYPE},
@@ -335,9 +406,15 @@ static ACPI_RESOURCE_TAG        AcpiDmIoFlagTags[] =
 };
 
 
-/* Dispatch table used to obtain the correct tag table for a descriptor */
-
-static ACPI_RESOURCE_TAG        *AcpiGbl_ResourceTags [] =
+/*
+ * Dispatch table used to obtain the correct tag table for a descriptor.
+ *
+ * A NULL in this table means one of three things:
+ * 1) The descriptor ID is reserved and invalid
+ * 2) The descriptor has no tags associated with it
+ * 3) The descriptor has subtypes and a separate table will be used.
+ */
+static const ACPI_RESOURCE_TAG      *AcpiGbl_ResourceTags[] =
 {
     /* Small descriptors */
 
@@ -351,7 +428,7 @@ static ACPI_RESOURCE_TAG        *AcpiGbl_ResourceTags [] =
     NULL,                           /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
     AcpiDmIoTags,                   /* 0x08, ACPI_RESOURCE_NAME_IO_PORT */
     AcpiDmFixedIoTags,              /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO_PORT */
-    NULL,                           /* 0x0A, Reserved */
+    AcpiDmFixedDmaTags,             /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */
     NULL,                           /* 0x0B, Reserved */
     NULL,                           /* 0x0C, Reserved */
     NULL,                           /* 0x0D, Reserved */
@@ -371,9 +448,29 @@ static ACPI_RESOURCE_TAG        *AcpiGbl_ResourceTags [] =
     AcpiDmAddress16Tags,            /* 0x08, ACPI_RESOURCE_NAME_WORD_ADDRESS_SPACE */
     AcpiDmInterruptTags,            /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_XRUPT */
     AcpiDmAddress64Tags,            /* 0x0A, ACPI_RESOURCE_NAME_QWORD_ADDRESS_SPACE */
-    AcpiDmExtendedAddressTags       /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */
+    AcpiDmExtendedAddressTags,      /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS_SPACE */
+    NULL,                           /* 0x0C, ACPI_RESOURCE_NAME_GPIO - Use Subtype table below */
+    NULL,                           /* 0x0D, Reserved */
+    NULL                            /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use Subtype table below */
+};
+
+/* GPIO Subtypes */
+
+static const ACPI_RESOURCE_TAG      *AcpiGbl_GpioResourceTags[] =
+{
+    AcpiDmGpioIntTags,              /* 0x00 Interrupt Connection */
+    AcpiDmGpioIoTags                /* 0x01 I/O Connection */
 };
 
+/* Serial Bus Subtypes */
+
+static const ACPI_RESOURCE_TAG      *AcpiGbl_SerialResourceTags[] =
+{
+    NULL,                           /* 0x00 Reserved */
+    AcpiDmI2cSerialBusTags,         /* 0x01 I2C SerialBus */
+    AcpiDmSpiSerialBusTags,         /* 0x02 SPI SerialBus */
+    AcpiDmUartSerialBusTags         /* 0x03 UART SerialBus */
+};
 
 /*
  * Globals used to generate unique resource descriptor names. We use names that
@@ -419,7 +516,6 @@ AcpiDmCheckResourceReference (
     ACPI_NAMESPACE_NODE     *BufferNode;
     ACPI_NAMESPACE_NODE     *ResourceNode;
     const ACPI_OPCODE_INFO  *OpInfo;
-    char                    *Pathname;
     UINT32                  BitIndex;
 
 
@@ -445,6 +541,11 @@ AcpiDmCheckResourceReference (
     /* Get the Index term, must be an integer constant to convert */
 
     IndexOp = BufferNameOp->Common.Next;
+
+    /* Major cheat: The Node field is also used for the Tag ptr. Clear it now */
+
+    IndexOp->Common.Node = NULL;
+
     OpInfo = AcpiPsGetOpcodeInfo (IndexOp->Common.AmlOpcode);
     if (OpInfo->ObjectType != ACPI_TYPE_INTEGER)
     {
@@ -495,14 +596,7 @@ AcpiDmCheckResourceReference (
 
     /* Translate the Index to a resource tag pathname */
 
-    Pathname = AcpiGetTagPathname (BufferNode, ResourceNode, BitIndex);
-    if (Pathname)
-    {
-        /* Complete the conversion of the Index to a symbol */
-
-        IndexOp->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
-        IndexOp->Common.Value.String = Pathname;
-    }
+    AcpiGetTagPathname (IndexOp, BufferNode, ResourceNode, BitIndex);
 }
 
 
@@ -549,13 +643,6 @@ AcpiDmGetResourceNode (
             return (Node);
         }
 
-        /* List is circular, this flag marks the end */
-
-        if (Node->Flags & ANOBJ_END_OF_PEER_LIST)
-        {
-            return (NULL);
-        }
-
         Node = Node->Peer;
     }
 
@@ -580,6 +667,7 @@ AcpiDmGetResourceNode (
 
 static char *
 AcpiGetTagPathname (
+    ACPI_PARSE_OBJECT       *IndexOp,
     ACPI_NAMESPACE_NODE     *BufferNode,
     ACPI_NAMESPACE_NODE     *ResourceNode,
     UINT32                  BitIndex)
@@ -672,6 +760,15 @@ AcpiGetTagPathname (
 
     AcpiNsInternalizeName (Pathname, &InternalPath);
     ACPI_FREE (Pathname);
+
+    /* Update the Op with the symbol */
+
+    AcpiPsInitOp (IndexOp, AML_INT_NAMEPATH_OP);
+    IndexOp->Common.Value.String = InternalPath;
+
+    /* We will need the tag later. Cheat by putting it in the Node field */
+
+    IndexOp->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Tag);
     return (InternalPath);
 }
 
@@ -711,8 +808,8 @@ AcpiDmUpdateResourceName (
 
     Name[0] = '_';
     Name[1] = AcpiGbl_Prefix[AcpiGbl_NextPrefix];
-    Name[2] = AcpiUtHexToAsciiChar (AcpiGbl_NextResourceId, 4);
-    Name[3] = AcpiUtHexToAsciiChar (AcpiGbl_NextResourceId, 0);
+    Name[2] = AcpiUtHexToAsciiChar ((UINT64) AcpiGbl_NextResourceId, 4);
+    Name[3] = AcpiUtHexToAsciiChar ((UINT64) AcpiGbl_NextResourceId, 0);
 
     /* Update globals for next name */
 
@@ -745,6 +842,9 @@ AcpiDmUpdateResourceName (
  *
  * DESCRIPTION: Convert a BitIndex into a symbolic resource tag.
  *
+ * Note: ResourceIndex should be previously validated and guaranteed to ve
+ *       valid.
+ *
  ******************************************************************************/
 
 static char *
@@ -753,23 +853,16 @@ AcpiDmGetResourceTag (
     AML_RESOURCE            *Resource,
     UINT8                   ResourceIndex)
 {
-    ACPI_RESOURCE_TAG       *TagList;
+    const ACPI_RESOURCE_TAG *TagList;
     char                    *Tag = NULL;
 
 
     /* Get the tag list for this resource descriptor type */
 
     TagList = AcpiGbl_ResourceTags[ResourceIndex];
-    if (!TagList)
-    {
-        /* There are no tags for this resource type */
-
-        return (NULL);
-    }
 
     /*
-     * Handle the type-specific flags field for the address descriptors.
-     * Kindof brute force, but just blindly search for an index match.
+     * Handle descriptors that have multiple subtypes
      */
     switch (Resource->DescriptorType)
     {
@@ -778,6 +871,10 @@ AcpiDmGetResourceTag (
     case ACPI_RESOURCE_NAME_ADDRESS64:
     case ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64:
 
+        /*
+         * Subtype differentiation is the flags.
+         * Kindof brute force, but just blindly search for an index match
+         */
         if (Resource->Address.ResourceType == ACPI_ADDRESS_TYPE_MEMORY_RANGE)
         {
             Tag = AcpiDmSearchTagList (BitIndex, AcpiDmMemoryFlagTags);
@@ -795,13 +892,42 @@ AcpiDmGetResourceTag (
         }
         break;
 
+    case ACPI_RESOURCE_NAME_GPIO:
+
+        /* GPIO connection has 2 subtypes: Interrupt and I/O */
+
+        if (Resource->Gpio.ConnectionType > AML_RESOURCE_MAX_GPIOTYPE)
+        {
+            return (NULL);
+        }
+
+        TagList = AcpiGbl_GpioResourceTags[Resource->Gpio.ConnectionType];
+        break;
+
+    case ACPI_RESOURCE_NAME_SERIAL_BUS:
+
+        /* SerialBus has 3 subtypes: I2C, SPI, and UART */
+
+        if ((Resource->CommonSerialBus.Type == 0) ||
+            (Resource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE))
+        {
+            return (NULL);
+        }
+
+        TagList = AcpiGbl_SerialResourceTags[Resource->CommonSerialBus.Type];
+        break;
+
     default:
         break;
     }
 
-    /* Search the tag list for this descriptor type */
+    /* Search for a match against the BitIndex */
+
+    if (TagList)
+    {
+        Tag = AcpiDmSearchTagList (BitIndex, TagList);
+    }
 
-    Tag = AcpiDmSearchTagList (BitIndex, TagList);
     return (Tag);
 }
 
@@ -823,7 +949,7 @@ AcpiDmGetResourceTag (
 static char *
 AcpiDmSearchTagList (
     UINT32                  BitIndex,
-    ACPI_RESOURCE_TAG       *TagList)
+    const ACPI_RESOURCE_TAG *TagList)
 {
 
     /*
@@ -996,4 +1122,3 @@ AcpiDmAddResourceToNamespace (
     Node->Length = Length;
     return (AE_OK);
 }
-