summaryrefslogtreecommitdiff
path: root/source/components
diff options
context:
space:
mode:
Diffstat (limited to 'source/components')
-rw-r--r--source/components/debugger/dbobject.c4
-rw-r--r--source/components/disassembler/dmopcode.c11
-rw-r--r--source/components/disassembler/dmwalk.c29
-rw-r--r--source/components/dispatcher/dsutils.c14
-rw-r--r--source/components/executer/exfldio.c15
-rw-r--r--source/components/hardware/hwregs.c239
-rw-r--r--source/components/namespace/nsaccess.c4
-rw-r--r--source/components/namespace/nsdump.c2
-rw-r--r--source/components/utilities/utdebug.c42
-rw-r--r--source/components/utilities/utdecode.c2
10 files changed, 129 insertions, 233 deletions
diff --git a/source/components/debugger/dbobject.c b/source/components/debugger/dbobject.c
index 58022b8fd53f..b424882f625b 100644
--- a/source/components/debugger/dbobject.c
+++ b/source/components/debugger/dbobject.c
@@ -161,10 +161,10 @@ AcpiDbDecodeInternalObject (
case ACPI_TYPE_STRING:
- AcpiOsPrintf ("(%u) \"%.24s",
+ AcpiOsPrintf ("(%u) \"%.60s",
ObjDesc->String.Length, ObjDesc->String.Pointer);
- if (ObjDesc->String.Length > 24)
+ if (ObjDesc->String.Length > 60)
{
AcpiOsPrintf ("...");
}
diff --git a/source/components/disassembler/dmopcode.c b/source/components/disassembler/dmopcode.c
index f4d13191c2f8..7ca171cbbbeb 100644
--- a/source/components/disassembler/dmopcode.c
+++ b/source/components/disassembler/dmopcode.c
@@ -971,7 +971,16 @@ AcpiDmDisassembleOneOp (
case AML_EXTERNAL_OP:
- break;
+ if (AcpiGbl_DmEmitExternalOpcodes)
+ {
+ AcpiOsPrintf ("/* Opcode 0x15 */ ");
+
+ /* Fallthrough */
+ }
+ else
+ {
+ break;
+ }
default:
diff --git a/source/components/disassembler/dmwalk.c b/source/components/disassembler/dmwalk.c
index 7465e75d3804..3c953f5465e1 100644
--- a/source/components/disassembler/dmwalk.c
+++ b/source/components/disassembler/dmwalk.c
@@ -462,21 +462,26 @@ AcpiDmDescendingOp (
{
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;
+
+ 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);
+ Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE;
+ return (AE_CTRL_DEPTH);
+ }
}
}
}
diff --git a/source/components/dispatcher/dsutils.c b/source/components/dispatcher/dsutils.c
index f41f6b2b2165..66eac34f1cc4 100644
--- a/source/components/dispatcher/dsutils.c
+++ b/source/components/dispatcher/dsutils.c
@@ -603,12 +603,14 @@ AcpiDsCreateOperand (
}
else if (ParentOp->Common.AmlOpcode == AML_EXTERNAL_OP)
{
- /* TBD: May only be temporary */
-
- ObjDesc = AcpiUtCreateStringObject ((ACPI_SIZE) NameLength);
-
- 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 --git a/source/components/executer/exfldio.c b/source/components/executer/exfldio.c
index a865a86ae1f3..fd46a0c02367 100644
--- a/source/components/executer/exfldio.c
+++ b/source/components/executer/exfldio.c
@@ -946,9 +946,20 @@ AcpiExInsertIntoField (
AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth);
- /* Create the bitmasks used for bit insertion */
+ /*
+ * Create the bitmasks used for bit insertion.
+ * Note: This if/else is used to bypass compiler differences with the
+ * shift operator
+ */
+ if (AccessBitWidth == ACPI_INTEGER_BIT_SIZE)
+ {
+ WidthMask = ACPI_UINT64_MAX;
+ }
+ else
+ {
+ WidthMask = ACPI_MASK_BITS_ABOVE (AccessBitWidth);
+ }
- WidthMask = ACPI_MASK_BITS_ABOVE_64 (AccessBitWidth);
Mask = WidthMask &
ACPI_MASK_BITS_BELOW (ObjDesc->CommonField.StartFieldBitOffset);
diff --git a/source/components/hardware/hwregs.c b/source/components/hardware/hwregs.c
index 87c18d1b4c64..bc85c96b553f 100644
--- a/source/components/hardware/hwregs.c
+++ b/source/components/hardware/hwregs.c
@@ -54,11 +54,6 @@
/* Local Prototypes */
-static UINT8
-AcpiHwGetAccessBitWidth (
- ACPI_GENERIC_ADDRESS *Reg,
- UINT8 MaxBitWidth);
-
static ACPI_STATUS
AcpiHwReadMultiple (
UINT32 *Value,
@@ -76,43 +71,6 @@ AcpiHwWriteMultiple (
/******************************************************************************
*
- * 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)
-{
-
- if (!Reg->AccessWidth)
- {
- 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
@@ -133,9 +91,6 @@ AcpiHwValidateRegister (
UINT8 MaxBitWidth,
UINT64 *Address)
{
- UINT8 BitWidth;
- UINT8 AccessWidth;
-
/* Must have a valid pointer to a GAS structure */
@@ -165,25 +120,24 @@ AcpiHwValidateRegister (
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);
@@ -204,7 +158,10 @@ AcpiHwValidateRegister (
* 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.
*
******************************************************************************/
@@ -214,12 +171,7 @@ AcpiHwRead (
ACPI_GENERIC_ADDRESS *Reg)
{
UINT64 Address;
- UINT8 AccessWidth;
- UINT32 BitWidth;
- UINT8 BitOffset;
UINT64 Value64;
- UINT32 Value32;
- UINT8 Index;
ACPI_STATUS Status;
@@ -234,64 +186,30 @@ AcpiHwRead (
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);
- }
-
- if (BitOffset)
- {
- Value32 &= ACPI_MASK_BITS_BELOW (BitOffset);
- BitOffset = 0;
- }
- if (BitWidth < AccessWidth)
- {
- Value32 &= ACPI_MASK_BITS_ABOVE (BitWidth);
- }
- }
-
- ACPI_SET_BITS (Value, Index * AccessWidth,
- ACPI_MASK_BITS_ABOVE_32 (AccessWidth), Value32);
+ Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
+ Address, &Value64, Reg->BitWidth);
- 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",
- *Value, AccessWidth, ACPI_FORMAT_UINT64 (Address),
+ *Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address),
AcpiUtGetRegionName (Reg->SpaceId)));
return (Status);
@@ -319,12 +237,6 @@ AcpiHwWrite (
ACPI_GENERIC_ADDRESS *Reg)
{
UINT64 Address;
- UINT8 AccessWidth;
- UINT32 BitWidth;
- UINT8 BitOffset;
- UINT64 Value64;
- UINT32 NewValue32, OldValue32;
- UINT8 Index;
ACPI_STATUS Status;
@@ -339,109 +251,24 @@ AcpiHwWrite (
return (Status);
}
- /* Convert AccessWidth into number of bits based */
-
- 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)
{
- NewValue32 = ACPI_GET_BITS (&Value, Index * AccessWidth,
- ACPI_MASK_BITS_ABOVE_32 (AccessWidth));
-
- if (BitOffset > AccessWidth)
- {
- BitOffset -= AccessWidth;
- }
- else
- {
- if (BitOffset)
- {
- NewValue32 &= ACPI_MASK_BITS_BELOW (BitOffset);
- }
-
- if (BitWidth < AccessWidth)
- {
- NewValue32 &= ACPI_MASK_BITS_ABOVE (BitWidth);
- }
-
- if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
- {
- if (BitOffset || BitWidth < AccessWidth)
- {
- /*
- * Read old values in order not to modify the bits that
- * are beyond the register BitWidth/BitOffset setting.
- */
- Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
- Address + Index * ACPI_DIV_8 (AccessWidth),
- &Value64, AccessWidth);
- OldValue32 = (UINT32) Value64;
-
- if (BitOffset)
- {
- OldValue32 &= ACPI_MASK_BITS_ABOVE (BitOffset + 1);
- BitOffset = 0;
- }
-
- if (BitWidth < AccessWidth)
- {
- OldValue32 &= ACPI_MASK_BITS_BELOW (BitWidth - 1);
- }
-
- NewValue32 |= OldValue32;
- }
-
- Value64 = (UINT64) NewValue32;
- Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
- Address + Index * ACPI_DIV_8 (AccessWidth),
- Value64, AccessWidth);
- }
- else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
- {
- if (BitOffset || BitWidth < AccessWidth)
- {
- /*
- * Read old values in order not to modify the bits that
- * are beyond the register BitWidth/BitOffset setting.
- */
- Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
- Address + Index * ACPI_DIV_8 (AccessWidth),
- &OldValue32, AccessWidth);
-
- if (BitOffset)
- {
- OldValue32 &= ACPI_MASK_BITS_ABOVE (BitOffset + 1);
- BitOffset = 0;
- }
-
- if (BitWidth < AccessWidth)
- {
- OldValue32 &= ACPI_MASK_BITS_BELOW (BitWidth - 1);
- }
-
- NewValue32 |= OldValue32;
- }
-
- Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
- Address + Index * ACPI_DIV_8 (AccessWidth),
- NewValue32, AccessWidth);
- }
- }
-
- BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth;
- Index++;
+ Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
+ Address, (UINT64) Value, Reg->BitWidth);
+ }
+ else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
+ {
+ Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
+ Address, Value, Reg->BitWidth);
}
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n",
- Value, AccessWidth, ACPI_FORMAT_UINT64 (Address),
+ Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address),
AcpiUtGetRegionName (Reg->SpaceId)));
return (Status);
diff --git a/source/components/namespace/nsaccess.c b/source/components/namespace/nsaccess.c
index 42a6d807a2c3..eb6fed623011 100644
--- a/source/components/namespace/nsaccess.c
+++ b/source/components/namespace/nsaccess.c
@@ -116,8 +116,8 @@ AcpiNsRootInitialize (
continue;
}
- Status = AcpiNsLookup (NULL, (char *) InitVal->Name, InitVal->Type,
- ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH,
+ Status = AcpiNsLookup (NULL, ACPI_CAST_PTR (char, InitVal->Name),
+ InitVal->Type, ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH,
NULL, &NewNode);
if (ACPI_FAILURE (Status))
{
diff --git a/source/components/namespace/nsdump.c b/source/components/namespace/nsdump.c
index 776653fc43ec..32ada86001b9 100644
--- a/source/components/namespace/nsdump.c
+++ b/source/components/namespace/nsdump.c
@@ -381,7 +381,7 @@ AcpiNsDumpOneObject (
case ACPI_TYPE_STRING:
AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length);
- AcpiUtPrintString (ObjDesc->String.Pointer, 32);
+ AcpiUtPrintString (ObjDesc->String.Pointer, 80);
AcpiOsPrintf ("\n");
break;
diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c
index b6ae2c73356b..6a298d175b34 100644
--- a/source/components/utilities/utdebug.c
+++ b/source/components/utilities/utdebug.c
@@ -632,6 +632,48 @@ AcpiUtPtrExit (
/*******************************************************************************
*
+ * FUNCTION: AcpiUtStrExit
+ *
+ * PARAMETERS: LineNumber - Caller's line number
+ * FunctionName - Caller's procedure name
+ * ModuleName - Caller's module name
+ * ComponentId - Caller's component ID
+ * String - String to display
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is
+ * set in DebugLevel. Prints exit value also.
+ *
+ ******************************************************************************/
+
+void
+AcpiUtStrExit (
+ UINT32 LineNumber,
+ const char *FunctionName,
+ const char *ModuleName,
+ UINT32 ComponentId,
+ const char *String)
+{
+
+ /* Check if enabled up-front for performance */
+
+ if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId))
+ {
+ AcpiDebugPrint (ACPI_LV_FUNCTIONS,
+ LineNumber, FunctionName, ModuleName, ComponentId,
+ "%s %s\n", AcpiGbl_FunctionExitPrefix, String);
+ }
+
+ if (AcpiGbl_NestingLevel)
+ {
+ AcpiGbl_NestingLevel--;
+ }
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiTracePoint
*
* PARAMETERS: Type - Trace event type
diff --git a/source/components/utilities/utdecode.c b/source/components/utilities/utdecode.c
index 648cc5c5c973..5c8f2cec8055 100644
--- a/source/components/utilities/utdecode.c
+++ b/source/components/utilities/utdecode.c
@@ -284,7 +284,7 @@ AcpiUtGetObjectTypeName (
return_PTR ("Invalid object");
}
- return_PTR (AcpiUtGetTypeName (ObjDesc->Common.Type));
+ return_STR (AcpiUtGetTypeName (ObjDesc->Common.Type));
}