ACPICA: Update comments
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>hifive-unleashed-5.1
parent
ec3153fb0e
commit
3effba3206
|
@ -193,21 +193,28 @@ acpi_ns_walk_namespace(acpi_object_type type,
|
||||||
acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node,
|
acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node,
|
||||||
child_node);
|
child_node);
|
||||||
if (child_node) {
|
if (child_node) {
|
||||||
/*
|
|
||||||
* Found node, Get the type if we are not
|
/* Found node, Get the type if we are not searching for ANY */
|
||||||
* searching for ANY
|
|
||||||
*/
|
|
||||||
if (type != ACPI_TYPE_ANY) {
|
if (type != ACPI_TYPE_ANY) {
|
||||||
child_type = child_node->type;
|
child_type = child_node->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1) Type must match
|
||||||
|
* 2) Permanent namespace nodes are OK
|
||||||
|
* 3) Ignore temporary nodes unless told otherwise. Typically,
|
||||||
|
* the temporary nodes can cause a race condition where they can
|
||||||
|
* be deleted during the execution of the user function. Only the
|
||||||
|
* debugger namespace dump will examine the temporary nodes.
|
||||||
|
*/
|
||||||
if ((child_type == type) &&
|
if ((child_type == type) &&
|
||||||
(!(child_node->flags & ANOBJ_TEMPORARY) ||
|
(!(child_node->flags & ANOBJ_TEMPORARY) ||
|
||||||
(child_node->flags & ANOBJ_TEMPORARY)
|
(child_node->flags & ANOBJ_TEMPORARY)
|
||||||
&& (flags & ACPI_NS_WALK_TEMP_NODES))) {
|
&& (flags & ACPI_NS_WALK_TEMP_NODES))) {
|
||||||
/*
|
/*
|
||||||
* Found a matching node, invoke the user
|
* Found a matching node, invoke the user callback function.
|
||||||
* callback function
|
* Unlock the namespace if flag is set.
|
||||||
*/
|
*/
|
||||||
if (flags & ACPI_NS_WALK_UNLOCK) {
|
if (flags & ACPI_NS_WALK_UNLOCK) {
|
||||||
mutex_status =
|
mutex_status =
|
||||||
|
@ -219,8 +226,9 @@ acpi_ns_walk_namespace(acpi_object_type type,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
status = user_function(child_node, level,
|
status =
|
||||||
context, return_value);
|
user_function(child_node, level, context,
|
||||||
|
return_value);
|
||||||
|
|
||||||
if (flags & ACPI_NS_WALK_UNLOCK) {
|
if (flags & ACPI_NS_WALK_UNLOCK) {
|
||||||
mutex_status =
|
mutex_status =
|
||||||
|
@ -254,20 +262,17 @@ acpi_ns_walk_namespace(acpi_object_type type,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Depth first search:
|
* Depth first search: Attempt to go down another level in the
|
||||||
* Attempt to go down another level in the namespace
|
* namespace if we are allowed to. Don't go any further if we have
|
||||||
* if we are allowed to. Don't go any further if we
|
* reached the caller specified maximum depth or if the user
|
||||||
* have reached the caller specified maximum depth
|
* function has specified that the maximum depth has been reached.
|
||||||
* or if the user function has specified that the
|
|
||||||
* maximum depth has been reached.
|
|
||||||
*/
|
*/
|
||||||
if ((level < max_depth) && (status != AE_CTRL_DEPTH)) {
|
if ((level < max_depth) && (status != AE_CTRL_DEPTH)) {
|
||||||
if (acpi_ns_get_next_node
|
if (acpi_ns_get_next_node
|
||||||
(ACPI_TYPE_ANY, child_node, NULL)) {
|
(ACPI_TYPE_ANY, child_node, NULL)) {
|
||||||
/*
|
|
||||||
* There is at least one child of this
|
/* There is at least one child of this node, visit it */
|
||||||
* node, visit the onde
|
|
||||||
*/
|
|
||||||
level++;
|
level++;
|
||||||
parent_node = child_node;
|
parent_node = child_node;
|
||||||
child_node = NULL;
|
child_node = NULL;
|
||||||
|
@ -275,9 +280,8 @@ acpi_ns_walk_namespace(acpi_object_type type,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* No more children of this node (acpi_ns_get_next_node
|
* No more children of this node (acpi_ns_get_next_node failed), go
|
||||||
* failed), go back upwards in the namespace tree to
|
* back upwards in the namespace tree to the node's parent.
|
||||||
* the node's parent.
|
|
||||||
*/
|
*/
|
||||||
level--;
|
level--;
|
||||||
child_node = parent_node;
|
child_node = parent_node;
|
||||||
|
|
Loading…
Reference in New Issue