Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/acpica/dist merge conflicts.



details:   https://anonhg.NetBSD.org/src/rev/76457544aa8d
branches:  trunk
changeset: 346540:76457544aa8d
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jul 18 17:26:12 2016 +0000

description:
merge conflicts.

diffstat:

 sys/external/bsd/acpica/dist/disassembler/dmwalk.c |   29 +-
 sys/external/bsd/acpica/dist/dispatcher/dsutils.c  |   20 +-
 sys/external/bsd/acpica/dist/hardware/hwregs.c     |  289 ++------------------
 sys/external/bsd/acpica/dist/include/acglobal.h    |    1 +
 sys/external/bsd/acpica/dist/include/acmacros.h    |   17 -
 sys/external/bsd/acpica/dist/include/acoutput.h    |    6 +-
 sys/external/bsd/acpica/dist/include/acpixf.h      |    2 +-
 sys/external/bsd/acpica/dist/include/acutils.h     |   20 +
 sys/external/bsd/acpica/dist/namespace/nsaccess.c  |    4 +-
 sys/external/bsd/acpica/dist/namespace/nsdump.c    |    2 +-
 sys/external/bsd/acpica/dist/utilities/utdebug.c   |   42 +++
 sys/external/bsd/acpica/dist/utilities/utdecode.c  |    2 +-
 12 files changed, 131 insertions(+), 303 deletions(-)

diffs (truncated from 681 to 300 lines):

diff -r 40c3c100d8b8 -r 76457544aa8d sys/external/bsd/acpica/dist/disassembler/dmwalk.c
--- a/sys/external/bsd/acpica/dist/disassembler/dmwalk.c        Mon Jul 18 17:23:24 2016 +0000
+++ b/sys/external/bsd/acpica/dist/disassembler/dmwalk.c        Mon Jul 18 17:26:12 2016 +0000
@@ -462,21 +462,26 @@
         {
             NextOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST;
 
-            /*
-             * A Zero predicate indicates the possibility of one or more
-             * External() opcodes within the If() block.
-             */
-            if (NextOp->Common.AmlOpcode == AML_ZERO_OP)
-            {
-                NextOp2 = NextOp->Common.Next;
+            /* Don't emit the actual embedded externals unless asked */
 
-                if (NextOp2 &&
-                    (NextOp2->Common.AmlOpcode == AML_EXTERNAL_OP))
+            if (!AcpiGbl_DmEmitExternalOpcodes)
+            {
+                /*
+                 * A Zero predicate indicates the possibility of one or more
+                 * External() opcodes within the If() block.
+                 */
+                if (NextOp->Common.AmlOpcode == AML_ZERO_OP)
                 {
-                    /* Ignore the If 0 block and all children */
+                    NextOp2 = NextOp->Common.Next;
 
-                    Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
-                    return (AE_CTRL_DEPTH);
+                    if (NextOp2 &&
+                        (NextOp2->Common.AmlOpcode == AML_EXTERNAL_OP))
+                    {
+                        /* Ignore the If 0 block and all children */
+
+                        Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+                        return (AE_CTRL_DEPTH);
+                    }
                 }
             }
         }
diff -r 40c3c100d8b8 -r 76457544aa8d sys/external/bsd/acpica/dist/dispatcher/dsutils.c
--- a/sys/external/bsd/acpica/dist/dispatcher/dsutils.c Mon Jul 18 17:23:24 2016 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dsutils.c Mon Jul 18 17:26:12 2016 +0000
@@ -603,18 +603,14 @@
                 }
                 else if (ParentOp->Common.AmlOpcode == AML_EXTERNAL_OP)
                 {
-                    /* TBD: May only be temporary */
-
-                    ObjDesc = AcpiUtCreateStringObject ((ACPI_SIZE) NameLength);
-                   if (!ObjDesc)
-                   {
-                       Status = AE_NO_MEMORY;
-                   }
-                   else
-                   {
-                       strncpy (ObjDesc->String.Pointer, NameString, NameLength);
-                       Status = AE_OK;
-                   }
+                    /*
+                     * This opcode should never appear here. It is used only
+                     * by AML disassemblers and is surrounded by an If(0)
+                     * by the ASL compiler.
+                     *
+                     * Therefore, if we see it here, it is a serious error.
+                     */
+                    Status = AE_AML_BAD_OPCODE;
                 }
                 else
                 {
diff -r 40c3c100d8b8 -r 76457544aa8d sys/external/bsd/acpica/dist/hardware/hwregs.c
--- a/sys/external/bsd/acpica/dist/hardware/hwregs.c    Mon Jul 18 17:23:24 2016 +0000
+++ b/sys/external/bsd/acpica/dist/hardware/hwregs.c    Mon Jul 18 17:26:12 2016 +0000
@@ -54,11 +54,6 @@
 
 /* Local Prototypes */
 
-static UINT8
-AcpiHwGetAccessBitWidth (
-    ACPI_GENERIC_ADDRESS    *Reg,
-    UINT8                   MaxBitWidth);
-
 static ACPI_STATUS
 AcpiHwReadMultiple (
     UINT32                  *Value,
@@ -76,61 +71,6 @@
 
 /******************************************************************************
  *
- * FUNCTION:    AcpiHwGetAccessBitWidth
- *
- * PARAMETERS:  Reg                 - GAS register structure
- *              MaxBitWidth         - Max BitWidth supported (32 or 64)
- *
- * RETURN:      Status
- *
- * DESCRIPTION: Obtain optimal access bit width
- *
- ******************************************************************************/
-
-static UINT8
-AcpiHwGetAccessBitWidth (
-    ACPI_GENERIC_ADDRESS    *Reg,
-    UINT8                   MaxBitWidth)
-{
-    UINT64                  Address;
-
-
-    if (!Reg->AccessWidth)
-    {
-        /*
-         * Detect old register descriptors where only the BitWidth field
-         * makes senses. The target address is copied to handle possible
-         * alignment issues.
-         */
-        ACPI_MOVE_64_TO_64 (&Address, &Reg->Address);
-        if (!Reg->BitOffset && Reg->BitWidth &&
-            ACPI_IS_POWER_OF_TWO (Reg->BitWidth) &&
-            ACPI_IS_ALIGNED (Reg->BitWidth, 8) &&
-            ACPI_IS_ALIGNED (Address, Reg->BitWidth))
-        {
-            return (Reg->BitWidth);
-        }
-        else
-        {
-            if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_IO)
-            {
-                return (32);
-            }
-            else
-            {
-                return (MaxBitWidth);
-            }
-        }
-    }
-    else
-    {
-        return (1 << (Reg->AccessWidth + 2));
-    }
-}
-
-
-/******************************************************************************
- *
  * FUNCTION:    AcpiHwValidateRegister
  *
  * PARAMETERS:  Reg                 - GAS register structure
@@ -151,9 +91,6 @@
     UINT8                   MaxBitWidth,
     UINT64                  *Address)
 {
-    UINT8                   BitWidth;
-    UINT8                   AccessWidth;
-
 
     /* Must have a valid pointer to a GAS structure */
 
@@ -183,25 +120,24 @@
         return (AE_SUPPORT);
     }
 
-    /* Validate the AccessWidth */
+    /* Validate the BitWidth */
 
-    if (Reg->AccessWidth > 4)
+    if ((Reg->BitWidth != 8) &&
+        (Reg->BitWidth != 16) &&
+        (Reg->BitWidth != 32) &&
+        (Reg->BitWidth != MaxBitWidth))
     {
         ACPI_ERROR ((AE_INFO,
-            "Unsupported register access width: 0x%X", Reg->AccessWidth));
+            "Unsupported register bit width: 0x%X", Reg->BitWidth));
         return (AE_SUPPORT);
     }
 
-    /* Validate the BitWidth, convert AccessWidth into number of bits */
+    /* Validate the BitOffset. Just a warning for now. */
 
-    AccessWidth = AcpiHwGetAccessBitWidth (Reg, MaxBitWidth);
-    BitWidth = ACPI_ROUND_UP (Reg->BitOffset + Reg->BitWidth, AccessWidth);
-    if (MaxBitWidth < BitWidth)
+    if (Reg->BitOffset != 0)
     {
         ACPI_WARNING ((AE_INFO,
-            "Requested bit width 0x%X is smaller than register bit width 0x%X",
-            MaxBitWidth, BitWidth));
-        return (AE_SUPPORT);
+            "Unsupported register bit offset: 0x%X", Reg->BitOffset));
     }
 
     return (AE_OK);
@@ -222,7 +158,10 @@
  *              64-bit values is not needed.
  *
  * LIMITATIONS: <These limitations also apply to AcpiHwWrite>
+ *      BitWidth must be exactly 8, 16, or 32.
  *      SpaceID must be SystemMemory or SystemIO.
+ *      BitOffset and AccessWidth are currently ignored, as there has
+ *          not been a need to implement these.
  *
  ******************************************************************************/
 
@@ -232,12 +171,7 @@
     ACPI_GENERIC_ADDRESS    *Reg)
 {
     UINT64                  Address;
-    UINT8                   AccessWidth;
-    UINT32                  BitWidth;
-    UINT8                   BitOffset;
     UINT64                  Value64;
-    UINT32                  Value32;
-    UINT8                   Index;
     ACPI_STATUS             Status;
 
 
@@ -252,74 +186,30 @@
         return (Status);
     }
 
-    /*
-     * Initialize entire 32-bit return value to zero, convert AccessWidth
-     * into number of bits based
-     */
+    /* Initialize entire 32-bit return value to zero */
+
     *Value = 0;
-    AccessWidth = AcpiHwGetAccessBitWidth (Reg, 32);
-    BitWidth = Reg->BitOffset + Reg->BitWidth;
-    BitOffset = Reg->BitOffset;
 
     /*
      * Two address spaces supported: Memory or IO. PCI_Config is
      * not supported here because the GAS structure is insufficient
      */
-    Index = 0;
-    while (BitWidth)
+    if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
     {
-        if (BitOffset >= AccessWidth)
-        {
-            Value32 = 0;
-            BitOffset -= AccessWidth;
-        }
-        else
-        {
-            if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
-            {
-                Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
-                    Address + Index * ACPI_DIV_8 (AccessWidth),
-                    &Value64, AccessWidth);
-                Value32 = (UINT32) Value64;
-            }
-            else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
-            {
-                Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
-                    Address + Index * ACPI_DIV_8 (AccessWidth),
-                    &Value32, AccessWidth);
-            }
+        Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
+            Address, &Value64, Reg->BitWidth);
 
-            /*
-             * Use offset style bit masks because:
-             * BitOffset < AccessWidth/BitWidth < AccessWidth, and
-             * AccessWidth is ensured to be less than 32-bits by
-             * AcpiHwValidateRegister().
-             */
-            if (BitOffset)
-            {
-                Value32 &= ACPI_MASK_BITS_BELOW (BitOffset);
-                BitOffset = 0;
-            }
-            if (BitWidth < AccessWidth)
-            {
-                Value32 &= ACPI_MASK_BITS_ABOVE (BitWidth);
-            }
-        }
-
-        /*
-         * Use offset style bit writes because "Index * AccessWidth" is
-         * ensured to be less than 32-bits by AcpiHwValidateRegister().
-         */
-        ACPI_SET_BITS (Value, Index * AccessWidth,
-            ACPI_MASK_BITS_ABOVE_32 (AccessWidth), Value32);
-
-        BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth;
-        Index++;
+        *Value = (UINT32) Value64;
+    }
+    else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
+    {
+        Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
+            Address, Value, Reg->BitWidth);
     }
 
     ACPI_DEBUG_PRINT ((ACPI_DB_IO,
         "Read:  %8.8X width %2d from %8.8X%8.8X (%s)\n",



Home | Main Index | Thread Index | Old Index