summaryrefslogtreecommitdiff
path: root/source/components/namespace
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/namespace')
-rw-r--r--source/components/namespace/nsaccess.c27
-rw-r--r--source/components/namespace/nsnames.c4
-rw-r--r--source/components/namespace/nsutils.c2
-rw-r--r--source/components/namespace/nsxfeval.c41
4 files changed, 59 insertions, 15 deletions
diff --git a/source/components/namespace/nsaccess.c b/source/components/namespace/nsaccess.c
index 401015753219..1404eabf67ad 100644
--- a/source/components/namespace/nsaccess.c
+++ b/source/components/namespace/nsaccess.c
@@ -155,6 +155,9 @@
#include "acnamesp.h"
#include "acdispat.h"
+#ifdef ACPI_ASL_COMPILER
+ #include "acdisasm.h"
+#endif
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME ("nsaccess")
@@ -710,6 +713,30 @@ AcpiNsLookup (
CurrentNode));
}
+#ifdef ACPI_ASL_COMPILER
+ /*
+ * If this ACPI name already exists within the namespace as an
+ * external declaration, then mark the external as a conflicting
+ * declaration and proceed to process the current node as if it did
+ * not exist in the namespace. If this node is not processed as
+ * normal, then it could cause improper namespace resolution
+ * by failing to open a new scope.
+ */
+ if (AcpiGbl_DisasmFlag &&
+ (Status == AE_ALREADY_EXISTS) &&
+ ((ThisNode->Flags & ANOBJ_IS_EXTERNAL) ||
+ (WalkState && WalkState->Opcode == AML_EXTERNAL_OP)))
+ {
+ ThisNode->Flags &= ~ANOBJ_IS_EXTERNAL;
+ ThisNode->Type = (UINT8)ThisSearchType;
+ if (WalkState->Opcode != AML_EXTERNAL_OP)
+ {
+ AcpiDmMarkExternalConflict (ThisNode);
+ }
+ break;
+ }
+#endif
+
*ReturnNode = ThisNode;
return_ACPI_STATUS (Status);
}
diff --git a/source/components/namespace/nsnames.c b/source/components/namespace/nsnames.c
index 1dc536101e0b..f68fbc1ed547 100644
--- a/source/components/namespace/nsnames.c
+++ b/source/components/namespace/nsnames.c
@@ -324,10 +324,6 @@ AcpiNsHandleToPathname (
(void) AcpiNsBuildNormalizedPath (Node, Buffer->Pointer,
RequiredSize, NoTrailing);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X]\n",
(char *) Buffer->Pointer, (UINT32) RequiredSize));
diff --git a/source/components/namespace/nsutils.c b/source/components/namespace/nsutils.c
index 3ab7a0ebdcbf..2b6f6fb8e435 100644
--- a/source/components/namespace/nsutils.c
+++ b/source/components/namespace/nsutils.c
@@ -206,7 +206,7 @@ AcpiNsPrintNodePathname (
AcpiOsPrintf ("%s ", Message);
}
- AcpiOsPrintf ("[%s] (Node %p)", (char *) Buffer.Pointer, Node);
+ AcpiOsPrintf ("%s", (char *) Buffer.Pointer);
ACPI_FREE (Buffer.Pointer);
}
}
diff --git a/source/components/namespace/nsxfeval.c b/source/components/namespace/nsxfeval.c
index 4dd8ff1d2fe4..ab3ad5988549 100644
--- a/source/components/namespace/nsxfeval.c
+++ b/source/components/namespace/nsxfeval.c
@@ -199,6 +199,8 @@ AcpiEvaluateObjectTyped (
{
ACPI_STATUS Status;
BOOLEAN FreeBufferOnError = FALSE;
+ ACPI_HANDLE TargetHandle;
+ char *FullPathname;
ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
@@ -216,41 +218,56 @@ AcpiEvaluateObjectTyped (
FreeBufferOnError = TRUE;
}
+ Status = AcpiGetHandle (Handle, Pathname, &TargetHandle);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ FullPathname = AcpiNsGetExternalPathname (TargetHandle);
+ if (!FullPathname)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
/* Evaluate the object */
- Status = AcpiEvaluateObject (Handle, Pathname,
- ExternalParams, ReturnBuffer);
+ Status = AcpiEvaluateObject (TargetHandle, NULL, ExternalParams,
+ ReturnBuffer);
if (ACPI_FAILURE (Status))
{
- return_ACPI_STATUS (Status);
+ goto Exit;
}
- /* Type ANY means "don't care" */
+ /* Type ANY means "don't care about return value type" */
if (ReturnType == ACPI_TYPE_ANY)
{
- return_ACPI_STATUS (AE_OK);
+ goto Exit;
}
if (ReturnBuffer->Length == 0)
{
/* Error because caller specifically asked for a return value */
- ACPI_ERROR ((AE_INFO, "No return value"));
- return_ACPI_STATUS (AE_NULL_OBJECT);
+ ACPI_ERROR ((AE_INFO, "%s did not return any object",
+ FullPathname));
+ Status = AE_NULL_OBJECT;
+ goto Exit;
}
/* Examine the object type returned from EvaluateObject */
if (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type == ReturnType)
{
- return_ACPI_STATUS (AE_OK);
+ goto Exit;
}
/* Return object type does not match requested type */
ACPI_ERROR ((AE_INFO,
- "Incorrect return type [%s] requested [%s]",
+ "Incorrect return type from %s - received [%s], requested [%s]",
+ FullPathname,
AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type),
AcpiUtGetTypeName (ReturnType)));
@@ -268,7 +285,11 @@ AcpiEvaluateObjectTyped (
}
ReturnBuffer->Length = 0;
- return_ACPI_STATUS (AE_TYPE);
+ Status = AE_TYPE;
+
+Exit:
+ ACPI_FREE (FullPathname);
+ return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiEvaluateObjectTyped)