aboutsummaryrefslogtreecommitdiff
path: root/source/components/namespace/nspredef.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2013-04-04 21:18:57 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2013-04-04 21:18:57 +0000
commit0ff2ef6cfe11e98b10c26dc8f1c359e6502538c8 (patch)
tree2d060ed4fedfc9aace2e673176570faa8ae1d376 /source/components/namespace/nspredef.c
parent6bb10c5e2fa82c104e57c7468335930ba9e47d4f (diff)
downloadsrc-0ff2ef6cfe11e98b10c26dc8f1c359e6502538c8.tar.gz
src-0ff2ef6cfe11e98b10c26dc8f1c359e6502538c8.zip
Import ACPICA 20130328.vendor/acpica/20130328
Notes
Notes: svn path=/vendor-sys/acpica/dist/; revision=249109 svn path=/vendor-sys/acpica/20130328/; revision=249110; tag=vendor/acpica/20130328
Diffstat (limited to 'source/components/namespace/nspredef.c')
-rw-r--r--source/components/namespace/nspredef.c121
1 files changed, 4 insertions, 117 deletions
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 */
- }
-}