diff options
author | Mike Smith <msmith@FreeBSD.org> | 2001-05-29 19:52:40 +0000 |
---|---|---|
committer | Mike Smith <msmith@FreeBSD.org> | 2001-05-29 19:52:40 +0000 |
commit | 0065eb1222e3ccb5cbb7c512ccb611a0e3ed7b54 (patch) | |
tree | a1bc1b7537f2d89240bd2e92ac027e82c5efeb6c /sys/contrib/dev/acpica/nssearch.c | |
parent | a9a41ca37c81d67c4527087c329367f8133b826c (diff) |
Import the 20010518 Intel ACPI CA release. Note that Intel's directory layout
keeps changing, so to reduce repository thrash everything has been moved into
a single directory. (repo copy involved)
Notes
Notes:
svn path=/vendor-sys/acpica/dist/; revision=77424
Diffstat (limited to 'sys/contrib/dev/acpica/nssearch.c')
-rw-r--r-- | sys/contrib/dev/acpica/nssearch.c | 98 |
1 files changed, 39 insertions, 59 deletions
diff --git a/sys/contrib/dev/acpica/nssearch.c b/sys/contrib/dev/acpica/nssearch.c index 3ecdf4ebb143..6b4f50fca0b7 100644 --- a/sys/contrib/dev/acpica/nssearch.c +++ b/sys/contrib/dev/acpica/nssearch.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nssearch - Namespace search - * $Revision: 64 $ + * $Revision: 70 $ * ******************************************************************************/ @@ -122,7 +122,7 @@ #include "acnamesp.h" -#define _COMPONENT NAMESPACE +#define _COMPONENT ACPI_NAMESPACE MODULE_NAME ("nssearch") @@ -131,9 +131,9 @@ * FUNCTION: AcpiNsSearchNode * * PARAMETERS: *TargetName - Ascii ACPI name to search for - * *Node - Starting table where search will begin + * *Node - Starting table where search will begin * Type - Object type to match - * **ReturnNode - Where the matched Named obj is returned + * **ReturnNode - Where the matched Named obj is returned * * RETURN: Status * @@ -156,7 +156,7 @@ ACPI_STATUS AcpiNsSearchNode ( UINT32 TargetName, ACPI_NAMESPACE_NODE *Node, - OBJECT_TYPE_INTERNAL Type, + ACPI_OBJECT_TYPE8 Type, ACPI_NAMESPACE_NODE **ReturnNode) { ACPI_NAMESPACE_NODE *NextNode; @@ -169,18 +169,14 @@ AcpiNsSearchNode ( if (TRACE_NAMES & AcpiDbgLevel) { NATIVE_CHAR *ScopeName; - + ScopeName = AcpiNsGetTablePathname (Node); if (ScopeName) { - DEBUG_PRINT (TRACE_NAMES, - ("NsSearchNode: Searching %s [%p]\n", - ScopeName, Node)); - DEBUG_PRINT (TRACE_NAMES, - ("NsSearchNode: For %4.4s (type %X)\n", - &TargetName, Type)); + DEBUG_PRINTP (TRACE_NAMES, ("Searching %s [%p] For %4.4s (type %X)\n", + ScopeName, Node, &TargetName, Type)); - AcpiCmFree (ScopeName); + AcpiUtFree (ScopeName); } } #endif @@ -199,29 +195,24 @@ AcpiNsSearchNode ( if (NextNode->Name == TargetName) { /* - * Found matching entry. Capture type if - * appropriate before returning the entry. + * Found matching entry. Capture the type if appropriate, before + * returning the entry. + * + * The DefFieldDefn and BankFieldDefn cases are actually looking up + * the Region in which the field will be defined */ - /* - * The DefFieldDefn and BankFieldDefn cases - * are actually looking up the Region in which - * the field will be defined - */ - - if ((INTERNAL_TYPE_DEF_FIELD_DEFN == Type) || + if ((INTERNAL_TYPE_FIELD_DEFN == Type) || (INTERNAL_TYPE_BANK_FIELD_DEFN == Type)) { Type = ACPI_TYPE_REGION; } /* - * Scope, DefAny, and IndexFieldDefn are bogus - * "types" which do not actually have anything - * to do with the type of the name being looked - * up. For any other value of Type, if the type - * stored in the entry is Any (i.e. unknown), - * save the actual type. + * Scope, DefAny, and IndexFieldDefn are bogus "types" which do not + * actually have anything to do with the type of the name being + * looked up. For any other value of Type, if the type stored in + * the entry is Any (i.e. unknown), save the actual type. */ if (Type != INTERNAL_TYPE_SCOPE && @@ -232,8 +223,8 @@ AcpiNsSearchNode ( NextNode->Type = (UINT8) Type; } - DEBUG_PRINT (TRACE_NAMES, - ("NsSearchNode: Name %4.4s (actual type %X) found at %p\n", + DEBUG_PRINTP (TRACE_NAMES, + ("Name %4.4s (actual type %X) found at %p\n", &TargetName, NextNode->Type, NextNode)); *ReturnNode = NextNode; @@ -260,11 +251,9 @@ AcpiNsSearchNode ( /* Searched entire table, not found */ - DEBUG_PRINT (TRACE_NAMES, - ("NsSearchNode: Name %4.4s (type %X) not found at %p\n", + DEBUG_PRINTP (TRACE_NAMES, ("Name %4.4s (type %X) not found at %p\n", &TargetName, Type, NextNode)); - return_ACPI_STATUS (AE_NOT_FOUND); } @@ -274,9 +263,9 @@ AcpiNsSearchNode ( * FUNCTION: AcpiNsSearchParentTree * * PARAMETERS: *TargetName - Ascii ACPI name to search for - * *Node - Starting table where search will begin + * *Node - Starting table where search will begin * Type - Object type to match - * **ReturnNode - Where the matched Named Obj is returned + * **ReturnNode - Where the matched Named Obj is returned * * RETURN: Status * @@ -298,7 +287,7 @@ static ACPI_STATUS AcpiNsSearchParentTree ( UINT32 TargetName, ACPI_NAMESPACE_NODE *Node, - OBJECT_TYPE_INTERNAL Type, + ACPI_OBJECT_TYPE8 Type, ACPI_NAMESPACE_NODE **ReturnNode) { ACPI_STATUS Status; @@ -314,20 +303,18 @@ AcpiNsSearchParentTree ( * If there is no parent (at the root) or type is "local", we won't be * searching the parent tree. */ - if ((AcpiNsLocal (Type)) || + if ((AcpiNsLocal (Type)) || (!ParentNode)) { if (!ParentNode) { - DEBUG_PRINT (TRACE_NAMES, - ("NsSearchParentTree: [%4.4s] has no parent\n", + DEBUG_PRINTP (TRACE_NAMES, ("[%4.4s] has no parent\n", &TargetName)); } if (AcpiNsLocal (Type)) { - DEBUG_PRINT (TRACE_NAMES, - ("NsSearchParentTree: [%4.4s] (type %X) is local (no search)\n", + DEBUG_PRINTP (TRACE_NAMES, ("[%4.4s] type %X is local(no search)\n", &TargetName, Type)); } @@ -337,15 +324,12 @@ AcpiNsSearchParentTree ( /* Search the parent tree */ - DEBUG_PRINT (TRACE_NAMES, - ("NsSearchParentTree: Searching parent for %4.4s\n", - &TargetName)); + DEBUG_PRINTP (TRACE_NAMES, ("Searching parent for %4.4s\n", &TargetName)); /* * Search parents until found the target or we have backed up to * the root */ - while (ParentNode) { /* Search parent scope */ @@ -380,12 +364,12 @@ AcpiNsSearchParentTree ( * * PARAMETERS: TargetName - Ascii ACPI name to search for (4 chars) * WalkState - Current state of the walk - * *Node - Starting table where search will begin + * *Node - Starting table where search will begin * InterpreterMode - Add names only in MODE_LoadPassX. * Otherwise,search only. * Type - Object type to match * Flags - Flags describing the search restrictions - * **ReturnNode - Where the Node is returned + * **ReturnNode - Where the Node is returned * * RETURN: Status * @@ -405,7 +389,7 @@ AcpiNsSearchAndEnter ( ACPI_WALK_STATE *WalkState, ACPI_NAMESPACE_NODE *Node, OPERATING_MODE InterpreterMode, - OBJECT_TYPE_INTERNAL Type, + ACPI_OBJECT_TYPE8 Type, UINT32 Flags, ACPI_NAMESPACE_NODE **ReturnNode) { @@ -420,8 +404,7 @@ AcpiNsSearchAndEnter ( if (!Node || !TargetName || !ReturnNode) { - DEBUG_PRINT (ACPI_ERROR, - ("NsSearchAndEnter: Null param: Table %p Name %p Return %p\n", + DEBUG_PRINTP (ACPI_ERROR, ("Null param- Table %p Name %p Return %p\n", Node, TargetName, ReturnNode)); REPORT_ERROR (("NsSearchAndEnter: bad (null) parameter\n")); @@ -431,10 +414,9 @@ AcpiNsSearchAndEnter ( /* Name must consist of printable characters */ - if (!AcpiCmValidAcpiName (TargetName)) + if (!AcpiUtValidAcpiName (TargetName)) { - DEBUG_PRINT (ACPI_ERROR, - ("NsSearchAndEnter: *** Bad character in name: %08lx *** \n", + DEBUG_PRINTP (ACPI_ERROR, ("*** Bad character in name: %08lx *** \n", TargetName)); REPORT_ERROR (("NsSearchAndEnter: Bad character in ACPI Name\n")); @@ -445,13 +427,12 @@ AcpiNsSearchAndEnter ( /* Try to find the name in the table specified by the caller */ *ReturnNode = ENTRY_NOT_FOUND; - Status = AcpiNsSearchNode (TargetName, Node, - Type, ReturnNode); + Status = AcpiNsSearchNode (TargetName, Node, Type, ReturnNode); if (Status != AE_NOT_FOUND) { /* - * If we found it AND the request specifies that a - * find is an error, return the error + * If we found it AND the request specifies that a find is an error, + * return the error */ if ((Status == AE_OK) && (Flags & NS_ERROR_IF_FOUND)) @@ -499,8 +480,7 @@ AcpiNsSearchAndEnter ( */ if (InterpreterMode == IMODE_EXECUTE) { - DEBUG_PRINT (TRACE_NAMES, - ("NsSearchAndEnter: %4.4s Not found in %p [Not adding]\n", + DEBUG_PRINTP (TRACE_NAMES, ("%4.4s Not found in %p [Not adding]\n", &TargetName, Node)); return_ACPI_STATUS (AE_NOT_FOUND); |