aboutsummaryrefslogtreecommitdiff
path: root/source/components/disassembler
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2012-11-14 22:20:16 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2012-11-14 22:20:16 +0000
commitc2463a8709e5b3a5ce54c09d35b4820a756b0fc5 (patch)
tree2ffc551e57f0545a17c165d729c1438a26236f60 /source/components/disassembler
parent31aa864e8c068201d58aad3a8f82ddb51df11015 (diff)
downloadsrc-c2463a8709e5b3a5ce54c09d35b4820a756b0fc5.tar.gz
src-c2463a8709e5b3a5ce54c09d35b4820a756b0fc5.zip
Import ACPICA 20121114.vendor/acpica/20121114
Notes
Notes: svn path=/vendor-sys/acpica/dist/; revision=243044 svn path=/vendor-sys/acpica/20121114/; revision=243045; tag=vendor/acpica/20121114
Diffstat (limited to 'source/components/disassembler')
-rw-r--r--source/components/disassembler/dmdeferred.c272
-rw-r--r--source/components/disassembler/dmopcode.c2
-rw-r--r--source/components/disassembler/dmresrc.c14
-rw-r--r--source/components/disassembler/dmresrcl.c54
-rw-r--r--source/components/disassembler/dmresrcl2.c44
-rw-r--r--source/components/disassembler/dmresrcs.c20
6 files changed, 343 insertions, 63 deletions
diff --git a/source/components/disassembler/dmdeferred.c b/source/components/disassembler/dmdeferred.c
new file mode 100644
index 000000000000..a3f40aee9b1a
--- /dev/null
+++ b/source/components/disassembler/dmdeferred.c
@@ -0,0 +1,272 @@
+/******************************************************************************
+ *
+ * Module Name: dmdeferred - Disassembly of deferred AML opcodes
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2012, 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"
+#include "acdispat.h"
+#include "amlcode.h"
+#include "acdisasm.h"
+#include "acparser.h"
+
+#define _COMPONENT ACPI_CA_DISASSEMBLER
+ ACPI_MODULE_NAME ("dmdeferred")
+
+
+/* Local prototypes */
+
+static ACPI_STATUS
+AcpiDmDeferredParse (
+ ACPI_PARSE_OBJECT *Op,
+ UINT8 *Aml,
+ UINT32 AmlLength);
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiDmParseDeferredOps
+ *
+ * PARAMETERS: Root - Root of the parse tree
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Parse the deferred opcodes (Methods, regions, etc.)
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiDmParseDeferredOps (
+ ACPI_PARSE_OBJECT *Root)
+{
+ const ACPI_OPCODE_INFO *OpInfo;
+ ACPI_PARSE_OBJECT *Op = Root;
+ ACPI_STATUS Status;
+
+
+ ACPI_FUNCTION_NAME (DmParseDeferredOps);
+
+
+ /* Traverse the entire parse tree */
+
+ while (Op)
+ {
+ OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
+ if (!(OpInfo->Flags & AML_DEFER))
+ {
+ Op = AcpiPsGetDepthNext (Root, Op);
+ continue;
+ }
+
+ /* Now we know we have a deferred opcode */
+
+ switch (Op->Common.AmlOpcode)
+ {
+ case AML_METHOD_OP:
+ case AML_BUFFER_OP:
+ case AML_PACKAGE_OP:
+ case AML_VAR_PACKAGE_OP:
+
+ Status = AcpiDmDeferredParse (Op, Op->Named.Data, Op->Named.Length);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+ break;
+
+ /* We don't need to do anything for these deferred opcodes */
+
+ case AML_REGION_OP:
+ case AML_DATA_REGION_OP:
+ case AML_CREATE_QWORD_FIELD_OP:
+ case AML_CREATE_DWORD_FIELD_OP:
+ case AML_CREATE_WORD_FIELD_OP:
+ case AML_CREATE_BYTE_FIELD_OP:
+ case AML_CREATE_BIT_FIELD_OP:
+ case AML_CREATE_FIELD_OP:
+ case AML_BANK_FIELD_OP:
+
+ break;
+
+ default:
+ ACPI_ERROR ((AE_INFO, "Unhandled deferred AML opcode [0x%.4X]",
+ Op->Common.AmlOpcode));
+ break;
+ }
+
+ Op = AcpiPsGetDepthNext (Root, Op);
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiDmDeferredParse
+ *
+ * PARAMETERS: Op - Root Op of the deferred opcode
+ * Aml - Pointer to the raw AML
+ * AmlLength - Length of the AML
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Parse one deferred opcode
+ * (Methods, operation regions, etc.)
+ *
+ *****************************************************************************/
+
+static ACPI_STATUS
+AcpiDmDeferredParse (
+ ACPI_PARSE_OBJECT *Op,
+ UINT8 *Aml,
+ UINT32 AmlLength)
+{
+ ACPI_WALK_STATE *WalkState;
+ ACPI_STATUS Status;
+ ACPI_PARSE_OBJECT *SearchOp;
+ ACPI_PARSE_OBJECT *StartOp;
+ UINT32 BaseAmlOffset;
+ ACPI_PARSE_OBJECT *NewRootOp;
+ ACPI_PARSE_OBJECT *ExtraOp;
+
+
+ ACPI_FUNCTION_TRACE (DmDeferredParse);
+
+
+ if (!Aml || !AmlLength)
+ {
+ return_ACPI_STATUS (AE_OK);
+ }
+
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Parsing deferred opcode %s [%4.4s]\n",
+ Op->Common.AmlOpName, (char *) &Op->Named.Name));
+
+ /* Need a new walk state to parse the AML */
+
+ WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL);
+ if (!WalkState)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
+ Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, Aml,
+ AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ /* Parse the AML for this deferred opcode */
+
+ WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
+ WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
+ Status = AcpiPsParseAml (WalkState);
+
+ /*
+ * We need to update all of the AML offsets, since the parser thought
+ * that the method began at offset zero. In reality, it began somewhere
+ * within the ACPI table, at the BaseAmlOffset. Walk the entire tree that
+ * was just created and update the AmlOffset in each Op.
+ */
+ BaseAmlOffset = (Op->Common.Value.Arg)->Common.AmlOffset + 1;
+ StartOp = (Op->Common.Value.Arg)->Common.Next;
+ SearchOp = StartOp;
+
+ while (SearchOp)
+ {
+ SearchOp->Common.AmlOffset += BaseAmlOffset;
+ SearchOp = AcpiPsGetDepthNext (StartOp, SearchOp);
+ }
+
+ /*
+ * For Buffer and Package opcodes, link the newly parsed subtree
+ * into the main parse tree
+ */
+ switch (Op->Common.AmlOpcode)
+ {
+ case AML_BUFFER_OP:
+ case AML_PACKAGE_OP:
+ case AML_VAR_PACKAGE_OP:
+
+ switch (Op->Common.AmlOpcode)
+ {
+ case AML_PACKAGE_OP:
+
+ ExtraOp = Op->Common.Value.Arg;
+ NewRootOp = ExtraOp->Common.Next;
+ ACPI_FREE (ExtraOp);
+ break;
+
+ case AML_VAR_PACKAGE_OP:
+ case AML_BUFFER_OP:
+ default:
+
+ NewRootOp = Op->Common.Value.Arg;
+ break;
+ }
+
+ Op->Common.Value.Arg = NewRootOp->Common.Value.Arg;
+
+ /* Must point all parents to the main tree */
+
+ StartOp = Op;
+ SearchOp = StartOp;
+ while (SearchOp)
+ {
+ if (SearchOp->Common.Parent == NewRootOp)
+ {
+ SearchOp->Common.Parent = Op;
+ }
+
+ SearchOp = AcpiPsGetDepthNext (StartOp, SearchOp);
+ }
+
+ ACPI_FREE (NewRootOp);
+ break;
+
+ default:
+ break;
+ }
+
+ return_ACPI_STATUS (AE_OK);
+}
diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c
index 9d61b0257906..443ef089e90b 100644
--- a/source/components/disassembler/dmopcode.c
+++ b/source/components/disassembler/dmopcode.c
@@ -645,7 +645,7 @@ AcpiDmDisassembleOneOp (
*/
if (!AcpiGbl_NoResourceDisassembly)
{
- Status = AcpiDmIsResourceTemplate (Op);
+ Status = AcpiDmIsResourceTemplate (WalkState, Op);
if (ACPI_SUCCESS (Status))
{
Op->Common.DisasmOpcode = ACPI_DASM_RESOURCE;
diff --git a/source/components/disassembler/dmresrc.c b/source/components/disassembler/dmresrc.c
index 470be9505090..bf2a4d4da496 100644
--- a/source/components/disassembler/dmresrc.c
+++ b/source/components/disassembler/dmresrc.c
@@ -279,7 +279,7 @@ AcpiDmResourceTemplate (
/* Validate the Resource Type and Resource Length */
- Status = AcpiUtValidateResource (Aml, &ResourceIndex);
+ Status = AcpiUtValidateResource (NULL, Aml, &ResourceIndex);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("/*** Could not validate Resource, type (%X) %s***/\n",
@@ -366,7 +366,8 @@ AcpiDmResourceTemplate (
*
* FUNCTION: AcpiDmIsResourceTemplate
*
- * PARAMETERS: Op - Buffer Op to be examined
+ * PARAMETERS: WalkState - Current walk info
+ * Op - Buffer Op to be examined
*
* RETURN: Status. AE_OK if valid template
*
@@ -377,6 +378,7 @@ AcpiDmResourceTemplate (
ACPI_STATUS
AcpiDmIsResourceTemplate (
+ ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op)
{
ACPI_STATUS Status;
@@ -396,6 +398,12 @@ AcpiDmIsResourceTemplate (
/* Get the ByteData list and length */
NextOp = Op->Common.Value.Arg;
+ if (!NextOp)
+ {
+ AcpiOsPrintf ("NULL byte list in buffer\n");
+ return (AE_TYPE);
+ }
+
NextOp = NextOp->Common.Next;
if (!NextOp)
{
@@ -407,7 +415,7 @@ AcpiDmIsResourceTemplate (
/* Walk the byte list, abort on any invalid descriptor type or length */
- Status = AcpiUtWalkAmlResources (Aml, Length, NULL, &EndAml);
+ Status = AcpiUtWalkAmlResources (WalkState, Aml, Length, NULL, &EndAml);
if (ACPI_FAILURE (Status))
{
return (AE_TYPE);
diff --git a/source/components/disassembler/dmresrcl.c b/source/components/disassembler/dmresrcl.c
index ed78b31c707b..dfd8e781bdaa 100644
--- a/source/components/disassembler/dmresrcl.c
+++ b/source/components/disassembler/dmresrcl.c
@@ -318,7 +318,7 @@ AcpiDmAddressCommon (
/* This is either a Memory, IO, or BusNumber descriptor (0,1,2) */
- AcpiOsPrintf ("%s (", AcpiGbl_WordDecode [ResourceType & 0x3]);
+ AcpiOsPrintf ("%s (", AcpiGbl_WordDecode [ACPI_GET_2BIT_FLAG (ResourceType)]);
/* Decode the general and type-specific flags */
@@ -331,7 +331,7 @@ AcpiDmAddressCommon (
AcpiDmIoFlags (Flags);
if (ResourceType == ACPI_IO_RANGE)
{
- AcpiOsPrintf (" %s,", AcpiGbl_RngDecode [SpecificFlags & 0x3]);
+ AcpiOsPrintf (" %s,", AcpiGbl_RngDecode [ACPI_GET_2BIT_FLAG (SpecificFlags)]);
}
}
}
@@ -383,10 +383,10 @@ AcpiDmSpaceFlags (
{
AcpiOsPrintf ("%s, %s, %s, %s,",
- AcpiGbl_ConsumeDecode [(Flags & 1)],
- AcpiGbl_DecDecode [(Flags & 0x2) >> 1],
- AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
- AcpiGbl_MaxDecode [(Flags & 0x8) >> 3]);
+ AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
+ AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)],
+ AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
+ AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)]);
}
@@ -407,10 +407,10 @@ AcpiDmIoFlags (
UINT8 Flags)
{
AcpiOsPrintf ("%s, %s, %s, %s,",
- AcpiGbl_ConsumeDecode [(Flags & 1)],
- AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
- AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
- AcpiGbl_DecDecode [(Flags & 0x2) >> 1]);
+ AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
+ AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
+ AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)],
+ AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)]);
}
@@ -432,14 +432,14 @@ AcpiDmIoFlags2 (
{
AcpiOsPrintf (", %s",
- AcpiGbl_TtpDecode [(SpecificFlags & 0x10) >> 4]);
+ AcpiGbl_TtpDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 4)]);
/* TRS is only used if TTP is TypeTranslation */
if (SpecificFlags & 0x10)
{
AcpiOsPrintf (", %s",
- AcpiGbl_TrsDecode [(SpecificFlags & 0x20) >> 5]);
+ AcpiGbl_TrsDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 5)]);
}
}
@@ -464,12 +464,12 @@ AcpiDmMemoryFlags (
{
AcpiOsPrintf ("%s, %s, %s, %s, %s, %s,",
- AcpiGbl_ConsumeDecode [(Flags & 1)],
- AcpiGbl_DecDecode [(Flags & 0x2) >> 1],
- AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
- AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
- AcpiGbl_MemDecode [(SpecificFlags & 0x6) >> 1],
- AcpiGbl_RwDecode [(SpecificFlags & 0x1)]);
+ AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
+ AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)],
+ AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
+ AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)],
+ AcpiGbl_MemDecode [ACPI_EXTRACT_2BIT_FLAG (SpecificFlags, 1)],
+ AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (SpecificFlags)]);
}
@@ -491,8 +491,8 @@ AcpiDmMemoryFlags2 (
{
AcpiOsPrintf (", %s, %s",
- AcpiGbl_MtpDecode [(SpecificFlags & 0x18) >> 3],
- AcpiGbl_TtpDecode [(SpecificFlags & 0x20) >> 5]);
+ AcpiGbl_MtpDecode [ACPI_EXTRACT_2BIT_FLAG (SpecificFlags, 3)],
+ AcpiGbl_TtpDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 5)]);
}
@@ -767,7 +767,7 @@ AcpiDmMemory24Descriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("Memory24 (%s,\n",
- AcpiGbl_RwDecode [Resource->Memory24.Flags & 1]);
+ AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->Memory24.Flags)]);
/* Dump the 4 contiguous WORD values */
@@ -806,7 +806,7 @@ AcpiDmMemory32Descriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("Memory32 (%s,\n",
- AcpiGbl_RwDecode [Resource->Memory32.Flags & 1]);
+ AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->Memory32.Flags)]);
/* Dump the 4 contiguous DWORD values */
@@ -845,7 +845,7 @@ AcpiDmFixedMemory32Descriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("Memory32Fixed (%s,\n",
- AcpiGbl_RwDecode [Resource->FixedMemory32.Flags & 1]);
+ AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->FixedMemory32.Flags)]);
AcpiDmIndent (Level + 1);
AcpiDmDumpInteger32 (Resource->FixedMemory32.Address, "Address Base");
@@ -942,10 +942,10 @@ AcpiDmInterruptDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("Interrupt (%s, %s, %s, %s, ",
- AcpiGbl_ConsumeDecode [(Resource->ExtendedIrq.Flags & 1)],
- AcpiGbl_HeDecode [(Resource->ExtendedIrq.Flags >> 1) & 1],
- AcpiGbl_LlDecode [(Resource->ExtendedIrq.Flags >> 2) & 1],
- AcpiGbl_ShrDecode [(Resource->ExtendedIrq.Flags >> 3) & 1]);
+ AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->ExtendedIrq.Flags)],
+ AcpiGbl_HeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->ExtendedIrq.Flags, 1)],
+ AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->ExtendedIrq.Flags, 2)],
+ AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->ExtendedIrq.Flags, 3)]);
/*
* The ResourceSource fields are optional and appear after the interrupt
diff --git a/source/components/disassembler/dmresrcl2.c b/source/components/disassembler/dmresrcl2.c
index afa1f5c40083..0615f5c399c5 100644
--- a/source/components/disassembler/dmresrcl2.c
+++ b/source/components/disassembler/dmresrcl2.c
@@ -201,7 +201,7 @@ AcpiDmGpioCommon (
AcpiOsPrintf (", ");
AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
AcpiOsPrintf ("%s, ",
- AcpiGbl_ConsumeDecode [(Resource->Gpio.Flags & 1)]);
+ AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.Flags)]);
/* Insert a descriptor name */
@@ -273,9 +273,9 @@ AcpiDmGpioIntDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("GpioInt (%s, %s, %s, ",
- AcpiGbl_HeDecode [(Resource->Gpio.IntFlags & 1)],
- AcpiGbl_LlDecode [(Resource->Gpio.IntFlags >> 1) & 1],
- AcpiGbl_ShrDecode [(Resource->Gpio.IntFlags >> 3) & 1]);
+ AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.IntFlags)],
+ AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Gpio.IntFlags, 1)],
+ AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
/* PinConfig, DebounceTimeout */
@@ -306,7 +306,7 @@ AcpiDmGpioIntDescriptor (
*
* RETURN: None
*
- * DESCRIPTION: Decode a GPIO Interrupt descriptor
+ * DESCRIPTION: Decode a GPIO I/O descriptor
*
******************************************************************************/
@@ -323,7 +323,7 @@ AcpiDmGpioIoDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("GpioIo (%s, ",
- AcpiGbl_ShrDecode [(Resource->Gpio.IntFlags >> 3) & 1]);
+ AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Gpio.IntFlags, 3)]);
if (Resource->Gpio.PinConfig <= 3)
{
@@ -340,7 +340,7 @@ AcpiDmGpioIoDescriptor (
AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DebounceTimeout);
AcpiOsPrintf ("0x%4.4X, ", Resource->Gpio.DriveStrength);
AcpiOsPrintf ("%s,\n",
- AcpiGbl_IorDecode [Resource->Gpio.IntFlags & 3]);
+ AcpiGbl_IorDecode [ACPI_GET_2BIT_FLAG (Resource->Gpio.IntFlags)]);
/* Dump the GpioInt/GpioIo common portion of the descriptor */
@@ -480,12 +480,12 @@ AcpiDmI2cSerialBusDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("I2cSerialBus (0x%4.4X, %s, 0x%8.8X,\n",
Resource->I2cSerialBus.SlaveAddress,
- AcpiGbl_SmDecode [(Resource->I2cSerialBus.Flags & 1)],
+ AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.Flags)],
Resource->I2cSerialBus.ConnectionSpeed);
AcpiDmIndent (Level + 1);
AcpiOsPrintf ("%s, ",
- AcpiGbl_AmDecode [(Resource->I2cSerialBus.TypeSpecificFlags & 1)]);
+ AcpiGbl_AmDecode [ACPI_GET_1BIT_FLAG (Resource->I2cSerialBus.TypeSpecificFlags)]);
/* ResourceSource is a required field */
@@ -503,7 +503,7 @@ AcpiDmI2cSerialBusDescriptor (
AcpiOsPrintf ("0x%2.2X, ", Resource->I2cSerialBus.ResSourceIndex);
AcpiOsPrintf ("%s, ",
- AcpiGbl_ConsumeDecode [(Resource->I2cSerialBus.Flags >> 1) & 1]);
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->I2cSerialBus.Flags, 1)]);
/* Insert a descriptor name */
@@ -546,21 +546,21 @@ AcpiDmSpiSerialBusDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("SpiSerialBus (0x%4.4X, %s, %s, 0x%2.2X,\n",
Resource->SpiSerialBus.DeviceSelection,
- AcpiGbl_DpDecode [(Resource->SpiSerialBus.TypeSpecificFlags >> 1) & 1],
- AcpiGbl_WmDecode [(Resource->SpiSerialBus.TypeSpecificFlags & 1)],
+ AcpiGbl_DpDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags, 1)],
+ AcpiGbl_WmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.TypeSpecificFlags)],
Resource->SpiSerialBus.DataBitLength);
/* SlaveMode, ConnectionSpeed, ClockPolarity, ClockPhase */
AcpiDmIndent (Level + 1);
AcpiOsPrintf ("%s, 0x%8.8X, %s,\n",
- AcpiGbl_SmDecode [(Resource->SpiSerialBus.Flags & 1)],
+ AcpiGbl_SmDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.Flags)],
Resource->SpiSerialBus.ConnectionSpeed,
- AcpiGbl_CpoDecode [(Resource->SpiSerialBus.ClockPolarity & 1)]);
+ AcpiGbl_CpoDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPolarity)]);
AcpiDmIndent (Level + 1);
AcpiOsPrintf ("%s, ",
- AcpiGbl_CphDecode [(Resource->SpiSerialBus.ClockPhase & 1)]);
+ AcpiGbl_CphDecode [ACPI_GET_1BIT_FLAG (Resource->SpiSerialBus.ClockPhase)]);
/* ResourceSource is a required field */
@@ -578,7 +578,7 @@ AcpiDmSpiSerialBusDescriptor (
AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex);
AcpiOsPrintf ("%s, ",
- AcpiGbl_ConsumeDecode [(Resource->SpiSerialBus.Flags >> 1) & 1]);
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->SpiSerialBus.Flags, 1)]);
/* Insert a descriptor name */
@@ -621,17 +621,17 @@ AcpiDmUartSerialBusDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("UartSerialBus (0x%8.8X, %s, %s,\n",
Resource->UartSerialBus.DefaultBaudRate,
- AcpiGbl_BpbDecode [(Resource->UartSerialBus.TypeSpecificFlags >> 4) & 3],
- AcpiGbl_SbDecode [(Resource->UartSerialBus.TypeSpecificFlags >> 2) & 3]);
+ AcpiGbl_BpbDecode [ACPI_EXTRACT_3BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 4)],
+ AcpiGbl_SbDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 2)]);
/* LinesInUse, IsBigEndian, Parity, FlowControl */
AcpiDmIndent (Level + 1);
AcpiOsPrintf ("0x%2.2X, %s, %s, %s,\n",
Resource->UartSerialBus.LinesEnabled,
- AcpiGbl_EdDecode [(Resource->UartSerialBus.TypeSpecificFlags >> 7) & 1],
- AcpiGbl_PtDecode [Resource->UartSerialBus.Parity & 7],
- AcpiGbl_FcDecode [Resource->UartSerialBus.TypeSpecificFlags & 3]);
+ AcpiGbl_EdDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags, 7)],
+ AcpiGbl_PtDecode [ACPI_GET_3BIT_FLAG (Resource->UartSerialBus.Parity)],
+ AcpiGbl_FcDecode [ACPI_GET_2BIT_FLAG (Resource->UartSerialBus.TypeSpecificFlags)]);
/* ReceiveBufferSize, TransmitBufferSize */
@@ -656,7 +656,7 @@ AcpiDmUartSerialBusDescriptor (
AcpiOsPrintf ("0x%2.2X, ", Resource->UartSerialBus.ResSourceIndex);
AcpiOsPrintf ("%s, ",
- AcpiGbl_ConsumeDecode [(Resource->UartSerialBus.Flags >> 1) & 1]);
+ AcpiGbl_ConsumeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->UartSerialBus.Flags, 1)]);
/* Insert a descriptor name */
diff --git a/source/components/disassembler/dmresrcs.c b/source/components/disassembler/dmresrcs.c
index d3b1dd8dce9d..60eb558259a3 100644
--- a/source/components/disassembler/dmresrcs.c
+++ b/source/components/disassembler/dmresrcs.c
@@ -76,16 +76,16 @@ AcpiDmIrqDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("%s (",
- AcpiGbl_IrqDecode [Length & 1]);
+ AcpiGbl_IrqDecode [ACPI_GET_1BIT_FLAG (Length)]);
/* Decode flags byte if present */
if (Length & 1)
{
AcpiOsPrintf ("%s, %s, %s, ",
- AcpiGbl_HeDecode [Resource->Irq.Flags & 1],
- AcpiGbl_LlDecode [(Resource->Irq.Flags >> 3) & 1],
- AcpiGbl_ShrDecode [(Resource->Irq.Flags >> 4) & 1]);
+ AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Irq.Flags)],
+ AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Irq.Flags, 3)],
+ AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Irq.Flags, 4)]);
}
/* Insert a descriptor name */
@@ -121,9 +121,9 @@ AcpiDmDmaDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("DMA (%s, %s, %s, ",
- AcpiGbl_TypDecode [(Resource->Dma.Flags >> 5) & 3],
- AcpiGbl_BmDecode [(Resource->Dma.Flags >> 2) & 1],
- AcpiGbl_SizDecode [(Resource->Dma.Flags >> 0) & 3]);
+ AcpiGbl_TypDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Dma.Flags, 5)],
+ AcpiGbl_BmDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Dma.Flags, 2)],
+ AcpiGbl_SizDecode [ACPI_GET_2BIT_FLAG (Resource->Dma.Flags)]);
/* Insert a descriptor name */
@@ -201,7 +201,7 @@ AcpiDmIoDescriptor (
AcpiDmIndent (Level);
AcpiOsPrintf ("IO (%s,\n",
- AcpiGbl_IoDecode [(Resource->Io.Flags & 1)]);
+ AcpiGbl_IoDecode [ACPI_GET_1BIT_FLAG (Resource->Io.Flags)]);
AcpiDmIndent (Level + 1);
AcpiDmDumpInteger16 (Resource->Io.Minimum, "Range Minimum");
@@ -287,8 +287,8 @@ AcpiDmStartDependentDescriptor (
if (Length & 1)
{
AcpiOsPrintf ("StartDependentFn (0x%2.2X, 0x%2.2X)\n",
- (UINT32) Resource->StartDpf.Flags & 3,
- (UINT32) (Resource->StartDpf.Flags >> 2) & 3);
+ (UINT32) ACPI_GET_2BIT_FLAG (Resource->StartDpf.Flags),
+ (UINT32) ACPI_EXTRACT_2BIT_FLAG (Resource->StartDpf.Flags, 2));
}
else
{