aboutsummaryrefslogtreecommitdiff
path: root/source/components/namespace
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/namespace')
-rw-r--r--source/components/namespace/nseval.c26
-rw-r--r--source/components/namespace/nspredef.c121
2 files changed, 19 insertions, 128 deletions
diff --git a/source/components/namespace/nseval.c b/source/components/namespace/nseval.c
index cdd6a9fcd004..1de341ce9024 100644
--- a/source/components/namespace/nseval.c
+++ b/source/components/namespace/nseval.c
@@ -109,18 +109,22 @@ AcpiNsEvaluate (
Info->ReturnObject = NULL;
Info->ParamCount = 0;
- /*
- * Get the actual namespace node for the target object. Handles these cases:
- *
- * 1) Null node, Pathname (absolute path)
- * 2) Node, Pathname (path relative to Node)
- * 3) Node, Null Pathname
- */
- Status = AcpiNsGetNode (Info->PrefixNode, Info->Pathname,
- ACPI_NS_NO_UPSEARCH, &Info->ResolvedNode);
- if (ACPI_FAILURE (Status))
+ if (!Info->ResolvedNode)
{
- return_ACPI_STATUS (Status);
+ /*
+ * Get the actual namespace node for the target object if we need to.
+ * Handles these cases:
+ *
+ * 1) Null node, Pathname (absolute path)
+ * 2) Node, Pathname (path relative to Node)
+ * 3) Node, Null Pathname
+ */
+ Status = AcpiNsGetNode (Info->PrefixNode, Info->Pathname,
+ ACPI_NS_NO_UPSEARCH, &Info->ResolvedNode);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
}
/*
diff --git a/source/components/namespace/nspredef.c b/source/components/namespace/nspredef.c
index f12bc155ac06..a9250e36207c 100644
--- a/source/components/namespace/nspredef.c
+++ b/source/components/namespace/nspredef.c
@@ -82,30 +82,11 @@ AcpiNsCheckReference (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT *ReturnObject);
-static void
-AcpiNsGetExpectedTypes (
- char *Buffer,
- UINT32 ExpectedBtypes);
-
static UINT32
AcpiNsGetBitmappedType (
ACPI_OPERAND_OBJECT *ReturnObject);
-/*
- * Names for the types that can be returned by the predefined objects.
- * Used for warning messages. Must be in the same order as the ACPI_RTYPEs
- */
-static const char *AcpiRtypeNames[] =
-{
- "/Integer",
- "/String",
- "/Buffer",
- "/Package",
- "/Reference",
-};
-
-
/*******************************************************************************
*
* FUNCTION: AcpiNsCheckPredefinedNames
@@ -137,7 +118,7 @@ AcpiNsCheckPredefinedNames (
/* Match the name for this method/object against the predefined list */
- Predefined = AcpiNsCheckForPredefinedName (Node);
+ Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii);
/* Get the full pathname to the object, for use in warning messages */
@@ -321,8 +302,8 @@ AcpiNsCheckParameterCount (
* Validate the user-supplied parameter count.
* Allow two different legal argument counts (_SCP, etc.)
*/
- RequiredParamsCurrent = Predefined->Info.ParamCount & 0x0F;
- RequiredParamsOld = Predefined->Info.ParamCount >> 4;
+ RequiredParamsCurrent = Predefined->Info.ArgumentList & METHOD_ARG_MASK;
+ RequiredParamsOld = Predefined->Info.ArgumentList >> METHOD_ARG_BIT_WIDTH;
if (UserParamCount != ACPI_UINT32_MAX)
{
@@ -353,58 +334,6 @@ AcpiNsCheckParameterCount (
/*******************************************************************************
*
- * FUNCTION: AcpiNsCheckForPredefinedName
- *
- * PARAMETERS: Node - Namespace node for the method/object
- *
- * RETURN: Pointer to entry in predefined table. NULL indicates not found.
- *
- * DESCRIPTION: Check an object name against the predefined object list.
- *
- ******************************************************************************/
-
-const ACPI_PREDEFINED_INFO *
-AcpiNsCheckForPredefinedName (
- ACPI_NAMESPACE_NODE *Node)
-{
- const ACPI_PREDEFINED_INFO *ThisName;
-
-
- /* Quick check for a predefined name, first character must be underscore */
-
- if (Node->Name.Ascii[0] != '_')
- {
- return (NULL);
- }
-
- /* Search info table for a predefined method/object name */
-
- ThisName = PredefinedNames;
- while (ThisName->Info.Name[0])
- {
- if (ACPI_COMPARE_NAME (Node->Name.Ascii, ThisName->Info.Name))
- {
- return (ThisName);
- }
-
- /*
- * Skip next entry in the table if this name returns a Package
- * (next entry contains the package info)
- */
- if (ThisName->Info.ExpectedBtypes & ACPI_RTYPE_PACKAGE)
- {
- ThisName++;
- }
-
- ThisName++;
- }
-
- return (NULL); /* Not found */
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiNsCheckObjectType
*
* PARAMETERS: Data - Pointer to validation data structure
@@ -480,7 +409,7 @@ TypeErrorExit:
/* Create a string with all expected types for this predefined object */
- AcpiNsGetExpectedTypes (TypeBuffer, ExpectedBtypes);
+ AcpiUtGetExpectedReturnTypes (TypeBuffer, ExpectedBtypes);
if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
{
@@ -600,45 +529,3 @@ AcpiNsGetBitmappedType (
return (ReturnBtype);
}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiNsGetExpectedTypes
- *
- * PARAMETERS: Buffer - Pointer to where the string is returned
- * ExpectedBtypes - Bitmap of expected return type(s)
- *
- * RETURN: Buffer is populated with type names.
- *
- * DESCRIPTION: Translate the expected types bitmap into a string of ascii
- * names of expected types, for use in warning messages.
- *
- ******************************************************************************/
-
-static void
-AcpiNsGetExpectedTypes (
- char *Buffer,
- UINT32 ExpectedBtypes)
-{
- UINT32 ThisRtype;
- UINT32 i;
- UINT32 j;
-
-
- j = 1;
- Buffer[0] = 0;
- ThisRtype = ACPI_RTYPE_INTEGER;
-
- for (i = 0; i < ACPI_NUM_RTYPES; i++)
- {
- /* If one of the expected types, concatenate the name of this type */
-
- if (ExpectedBtypes & ThisRtype)
- {
- ACPI_STRCAT (Buffer, &AcpiRtypeNames[i][j]);
- j = 0; /* Use name separator from now on */
- }
- ThisRtype <<= 1; /* Next Rtype */
- }
-}