Source
* searching enclosing scopes in cases identified by acpi_ns_local().
// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/*******************************************************************************
*
* Module Name: nssearch - Namespace search
*
******************************************************************************/
ACPI_MODULE_NAME("nssearch")
/* Local prototypes */
static acpi_status
acpi_ns_search_parent_tree(u32 target_name,
struct acpi_namespace_node *node,
acpi_object_type type,
struct acpi_namespace_node **return_node);
/*******************************************************************************
*
* FUNCTION: acpi_ns_search_one_scope
*
* PARAMETERS: target_name - Ascii ACPI name to search for
* parent_node - Starting node where search will begin
* type - Object type to match
* return_node - Where the matched Named obj is returned
*
* RETURN: Status
*
* DESCRIPTION: Search a single level of the namespace. Performs a
* simple search of the specified level, and does not add
* entries or search parents.
*
*
* Named object lists are built (and subsequently dumped) in the
* order in which the names are encountered during the namespace load;
*
* All namespace searching is linear in this implementation, but
* could be easily modified to support any improved search
* algorithm. However, the linear search was chosen for simplicity
* and because the trees are small and the other interpreter
* execution overhead is relatively high.
*
* Note: CPU execution analysis has shown that the AML interpreter spends
* a very small percentage of its time searching the namespace. Therefore,
* the linear search seems to be sufficient, as there would seem to be
* little value in improving the search.
*
******************************************************************************/
acpi_status
acpi_ns_search_one_scope(u32 target_name,
struct acpi_namespace_node *parent_node,
acpi_object_type type,
struct acpi_namespace_node **return_node)
{