本文整理匯總了C++中ACPI_IS_ROOT_PREFIX函數的典型用法代碼示例。如果您正苦於以下問題:C++ ACPI_IS_ROOT_PREFIX函數的具體用法?C++ ACPI_IS_ROOT_PREFIX怎麽用?C++ ACPI_IS_ROOT_PREFIX使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ACPI_IS_ROOT_PREFIX函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: acpi_ns_get_internal_name_length
void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)
{
const char *next_external_char;
u32 i;
ACPI_FUNCTION_ENTRY();
next_external_char = info->external_name;
info->num_carats = 0;
info->num_segments = 0;
info->fully_qualified = FALSE;
/*
* For the internal name, the required length is 4 bytes per segment,
* plus 1 each for root_prefix, multi_name_prefix_op, segment count,
* trailing null (which is not really needed, but no there's harm in
* putting it there)
*
* strlen() + 1 covers the first name_seg, which has no path separator
*/
if (ACPI_IS_ROOT_PREFIX(*next_external_char)) {
info->fully_qualified = TRUE;
next_external_char++;
/* Skip redundant root_prefix, like \\_SB.PCI0.SBRG.EC0 */
while (ACPI_IS_ROOT_PREFIX(*next_external_char)) {
next_external_char++;
}
} else {
/* Handle Carat prefixes */
while (ACPI_IS_PARENT_PREFIX(*next_external_char)) {
info->num_carats++;
next_external_char++;
}
}
/*
* Determine the number of ACPI name "segments" by counting the number of
* path separators within the string. Start with one segment since the
* segment count is [(# separators) + 1], and zero separators is ok.
*/
if (*next_external_char) {
info->num_segments = 1;
for (i = 0; next_external_char[i]; i++) {
if (ACPI_IS_PATH_SEPARATOR(next_external_char[i])) {
info->num_segments++;
}
}
}
info->length = (ACPI_NAME_SIZE * info->num_segments) +
4 + info->num_carats;
info->next_external_char = next_external_char;
}
示例2: acpi_get_handle
acpi_status
acpi_get_handle(acpi_handle parent,
acpi_string pathname, acpi_handle * ret_handle)
{
acpi_status status;
struct acpi_namespace_node *node = NULL;
struct acpi_namespace_node *prefix_node = NULL;
ACPI_FUNCTION_ENTRY();
/* Parameter Validation */
if (!ret_handle || !pathname) {
return (AE_BAD_PARAMETER);
}
/* Convert a parent handle to a prefix node */
if (parent) {
prefix_node = acpi_ns_validate_handle(parent);
if (!prefix_node) {
return (AE_BAD_PARAMETER);
}
}
/*
* Valid cases are:
* 1) Fully qualified pathname
* 2) Parent + Relative pathname
*
* Error for <null Parent + relative path>
*/
if (ACPI_IS_ROOT_PREFIX(pathname[0])) {
/* Pathname is fully qualified (starts with '\') */
/* Special case for root-only, since we can't search for it */
if (!strcmp(pathname, ACPI_NS_ROOT_PATH)) {
*ret_handle =
ACPI_CAST_PTR(acpi_handle, acpi_gbl_root_node);
return (AE_OK);
}
} else if (!prefix_node) {
/* Relative path with null prefix is disallowed */
return (AE_BAD_PARAMETER);
}
/* Find the Node and convert to a handle */
status =
acpi_ns_get_node(prefix_node, pathname, ACPI_NS_NO_UPSEARCH, &node);
if (ACPI_SUCCESS(status)) {
*ret_handle = ACPI_CAST_PTR(acpi_handle, node);
}
return (status);
}
示例3: acpi_db_prep_namestring
void acpi_db_prep_namestring(char *name)
{
if (!name) {
return;
}
acpi_ut_strupr(name);
/* Convert a leading forward slash to a backslash */
if (*name == '/') {
*name = '\\';
}
/* Ignore a leading backslash, this is the root prefix */
if (ACPI_IS_ROOT_PREFIX(*name)) {
name++;
}
/* Convert all slash path separators to dots */
while (*name) {
if ((*name == '/') || (*name == '\\')) {
*name = '.';
}
name++;
}
}
示例4: AcpiDmNamestring
void
AcpiDmNamestring (
char *Name)
{
UINT32 SegCount;
if (!Name)
{
return;
}
/* Handle all Scope Prefix operators */
while (ACPI_IS_ROOT_PREFIX (ACPI_GET8 (Name)) ||
ACPI_IS_PARENT_PREFIX (ACPI_GET8 (Name)))
{
/* Append prefix character */
AcpiOsPrintf ("%1c", ACPI_GET8 (Name));
Name++;
}
switch (ACPI_GET8 (Name))
{
case 0:
SegCount = 0;
break;
case AML_DUAL_NAME_PREFIX:
SegCount = 2;
Name++;
break;
case AML_MULTI_NAME_PREFIX_OP:
SegCount = (UINT32) ACPI_GET8 (Name + 1);
Name += 2;
break;
default:
SegCount = 1;
break;
}
while (SegCount)
{
/* Append Name segment */
AcpiDmDumpName (*ACPI_CAST_PTR (UINT32, Name));
SegCount--;
if (SegCount)
{
/* Not last name, append dot separator */
AcpiOsPrintf (".");
}
Name += ACPI_NAME_SIZE;
}
}
示例5: acpi_db_set_scope
void acpi_db_set_scope(char *name)
{
acpi_status status;
struct acpi_namespace_node *node;
if (!name || name[0] == 0) {
acpi_os_printf("Current scope: %s\n", acpi_gbl_db_scope_buf);
return;
}
acpi_db_prep_namestring(name);
if (ACPI_IS_ROOT_PREFIX(name[0])) {
/* Validate new scope from the root */
status = acpi_ns_get_node(acpi_gbl_root_node, name,
ACPI_NS_NO_UPSEARCH, &node);
if (ACPI_FAILURE(status)) {
goto error_exit;
}
acpi_gbl_db_scope_buf[0] = 0;
} else {
/* Validate new scope relative to old scope */
status = acpi_ns_get_node(acpi_gbl_db_scope_node, name,
ACPI_NS_NO_UPSEARCH, &node);
if (ACPI_FAILURE(status)) {
goto error_exit;
}
}
/* Build the final pathname */
if (acpi_ut_safe_strcat
(acpi_gbl_db_scope_buf, sizeof(acpi_gbl_db_scope_buf), name)) {
status = AE_BUFFER_OVERFLOW;
goto error_exit;
}
if (acpi_ut_safe_strcat
(acpi_gbl_db_scope_buf, sizeof(acpi_gbl_db_scope_buf), "\\")) {
status = AE_BUFFER_OVERFLOW;
goto error_exit;
}
acpi_gbl_db_scope_node = node;
acpi_os_printf("New scope: %s\n", acpi_gbl_db_scope_buf);
return;
error_exit:
acpi_os_printf("Could not attach scope: %s, %s\n",
name, acpi_format_exception(status));
}
示例6: acpi_ns_get_node_unlocked
acpi_status
acpi_ns_get_node_unlocked(struct acpi_namespace_node *prefix_node,
const char *pathname,
u32 flags, struct acpi_namespace_node **return_node)
{
union acpi_generic_state scope_info;
acpi_status status;
char *internal_path;
ACPI_FUNCTION_TRACE_PTR(ns_get_node_unlocked,
ACPI_CAST_PTR(char, pathname));
/* Simplest case is a null pathname */
if (!pathname) {
*return_node = prefix_node;
if (!prefix_node) {
*return_node = acpi_gbl_root_node;
}
return_ACPI_STATUS(AE_OK);
}
/* Quick check for a reference to the root */
if (ACPI_IS_ROOT_PREFIX(pathname[0]) && (!pathname[1])) {
*return_node = acpi_gbl_root_node;
return_ACPI_STATUS(AE_OK);
}
/* Convert path to internal representation */
status = acpi_ns_internalize_name(pathname, &internal_path);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
/* Setup lookup scope (search starting point) */
scope_info.scope.node = prefix_node;
/* Lookup the name in the namespace */
status = acpi_ns_lookup(&scope_info, internal_path, ACPI_TYPE_ANY,
ACPI_IMODE_EXECUTE,
(flags | ACPI_NS_DONT_OPEN_SCOPE), NULL,
return_node);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s, %s\n",
pathname, acpi_format_exception(status)));
}
ACPI_FREE(internal_path);
return_ACPI_STATUS(status);
}
示例7: AcpiDbSetScope
void
AcpiDbSetScope (
char *Name)
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
if (!Name || Name[0] == 0)
{
AcpiOsPrintf ("Current scope: %s\n", AcpiGbl_DbScopeBuf);
return;
}
AcpiDbPrepNamestring (Name);
if (ACPI_IS_ROOT_PREFIX (Name[0]))
{
/* Validate new scope from the root */
Status = AcpiNsGetNode (AcpiGbl_RootNode, Name, ACPI_NS_NO_UPSEARCH,
&Node);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
ACPI_STRCPY (AcpiGbl_DbScopeBuf, Name);
ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
}
else
{
/* Validate new scope relative to old scope */
Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name, ACPI_NS_NO_UPSEARCH,
&Node);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
ACPI_STRCAT (AcpiGbl_DbScopeBuf, Name);
ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
}
AcpiGbl_DbScopeNode = Node;
AcpiOsPrintf ("New scope: %s\n", AcpiGbl_DbScopeBuf);
return;
ErrorExit:
AcpiOsPrintf ("Could not attach scope: %s, %s\n",
Name, AcpiFormatException (Status));
}
示例8: UtAttachNameseg
static void
UtAttachNameseg (
ACPI_PARSE_OBJECT *Op,
char *Name)
{
char *NameSeg;
char PaddedNameSeg[4];
if (!Name)
{
return;
}
/* Look for the last dot in the namepath */
NameSeg = strrchr (Name, '.');
if (NameSeg)
{
/* Found last dot, we have also found the final nameseg */
NameSeg++;
UtPadNameWithUnderscores (NameSeg, PaddedNameSeg);
}
else
{
/* No dots in the namepath, there is only a single nameseg. */
/* Handle prefixes */
while (ACPI_IS_ROOT_PREFIX (*Name) ||
ACPI_IS_PARENT_PREFIX (*Name))
{
Name++;
}
/* Remaining string should be one single nameseg */
UtPadNameWithUnderscores (Name, PaddedNameSeg);
}
ACPI_MOVE_NAME (Op->Asl.NameSeg, PaddedNameSeg);
}
示例9: AcpiDbPrepNamestring
void
AcpiDbPrepNamestring (
char *Name)
{
if (!Name)
{
return;
}
AcpiUtStrupr (Name);
/* Convert a leading forward slash to a backslash */
if (*Name == '/')
{
*Name = '\\';
}
/* Ignore a leading backslash, this is the root prefix */
if (ACPI_IS_ROOT_PREFIX (*Name))
{
Name++;
}
/* Convert all slash path separators to dots */
while (*Name)
{
if ((*Name == '/') ||
(*Name == '\\'))
{
*Name = '.';
}
Name++;
}
}
示例10: acpi_evaluate_object
/*******************************************************************************
*
* FUNCTION: acpi_evaluate_object
*
* PARAMETERS: handle - Object handle (optional)
* pathname - Object pathname (optional)
* external_params - List of parameters to pass to method,
* terminated by NULL. May be NULL
* if no parameters are being passed.
* return_buffer - Where to put method's return value (if
* any). If NULL, no value is returned.
*
* RETURN: Status
*
* DESCRIPTION: Find and evaluate the given object, passing the given
* parameters if necessary. One of "Handle" or "Pathname" must
* be valid (non-null)
*
******************************************************************************/
acpi_status
acpi_evaluate_object(acpi_handle handle,
acpi_string pathname,
struct acpi_object_list *external_params,
struct acpi_buffer *return_buffer)
{
acpi_status status;
struct acpi_evaluate_info *info;
acpi_size buffer_space_needed;
u32 i;
ACPI_FUNCTION_TRACE(acpi_evaluate_object);
/* Allocate and initialize the evaluation information block */
info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
if (!info) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
info->pathname = pathname;
/* Convert and validate the device handle */
info->prefix_node = acpi_ns_validate_handle(handle);
if (!info->prefix_node) {
status = AE_BAD_PARAMETER;
goto cleanup;
}
/*
* If there are parameters to be passed to a control method, the external
* objects must all be converted to internal objects
*/
if (external_params && external_params->count) {
/*
* Allocate a new parameter block for the internal objects
* Add 1 to count to allow for null terminated internal list
*/
info->parameters = ACPI_ALLOCATE_ZEROED(((acpi_size)
external_params->
count +
1) * sizeof(void *));
if (!info->parameters) {
status = AE_NO_MEMORY;
goto cleanup;
}
/* Convert each external object in the list to an internal object */
for (i = 0; i < external_params->count; i++) {
status =
acpi_ut_copy_eobject_to_iobject(&external_params->
pointer[i],
&info->
parameters[i]);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
}
info->parameters[external_params->count] = NULL;
}
/*
* Three major cases:
* 1) Fully qualified pathname
* 2) No handle, not fully qualified pathname (error)
* 3) Valid handle
*/
if ((pathname) && (ACPI_IS_ROOT_PREFIX(pathname[0]))) {
/* The path is fully qualified, just evaluate by name */
info->prefix_node = NULL;
status = acpi_ns_evaluate(info);
} else if (!handle) {
/*
* A handle is optional iff a fully qualified pathname is specified.
* Since we've already handled fully qualified names above, this is
* an error
*/
//.........這裏部分代碼省略.........
示例11: AcpiEvaluateObject
ACPI_STATUS
AcpiEvaluateObject (
ACPI_HANDLE Handle,
ACPI_STRING Pathname,
ACPI_OBJECT_LIST *ExternalParams,
ACPI_BUFFER *ReturnBuffer)
{
ACPI_STATUS Status;
ACPI_EVALUATE_INFO *Info;
ACPI_SIZE BufferSpaceNeeded;
UINT32 i;
ACPI_FUNCTION_TRACE (AcpiEvaluateObject);
/* Allocate and initialize the evaluation information block */
Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
if (!Info)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Convert and validate the device handle */
Info->PrefixNode = AcpiNsValidateHandle (Handle);
if (!Info->PrefixNode)
{
Status = AE_BAD_PARAMETER;
goto Cleanup;
}
/*
* Get the actual namespace node for the target object.
* Handles these cases:
*
* 1) Null node, valid pathname from root (absolute path)
* 2) Node and valid pathname (path relative to Node)
* 3) Node, Null pathname
*/
if ((Pathname) &&
(ACPI_IS_ROOT_PREFIX (Pathname[0])))
{
/* The path is fully qualified, just evaluate by name */
Info->PrefixNode = NULL;
}
else if (!Handle)
{
/*
* A handle is optional iff a fully qualified pathname is specified.
* Since we've already handled fully qualified names above, this is
* an error.
*/
if (!Pathname)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Both Handle and Pathname are NULL"));
}
else
{
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Null Handle with relative pathname [%s]", Pathname));
}
Status = AE_BAD_PARAMETER;
goto Cleanup;
}
Info->RelativePathname = Pathname;
/*
* Convert all external objects passed as arguments to the
* internal version(s).
*/
if (ExternalParams && ExternalParams->Count)
{
Info->ParamCount = (UINT16) ExternalParams->Count;
/* Warn on impossible argument count */
if (Info->ParamCount > ACPI_METHOD_NUM_ARGS)
{
ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS,
"Excess arguments (%u) - using only %u",
Info->ParamCount, ACPI_METHOD_NUM_ARGS));
Info->ParamCount = ACPI_METHOD_NUM_ARGS;
}
/*
* Allocate a new parameter block for the internal objects
* Add 1 to count to allow for null terminated internal list
*/
Info->Parameters = ACPI_ALLOCATE_ZEROED (
((ACPI_SIZE) Info->ParamCount + 1) * sizeof (void *));
if (!Info->Parameters)
{
Status = AE_NO_MEMORY;
//.........這裏部分代碼省略.........
示例12: AcpiNsGetNodeUnlocked
ACPI_STATUS
AcpiNsGetNodeUnlocked (
ACPI_NAMESPACE_NODE *PrefixNode,
const char *Pathname,
UINT32 Flags,
ACPI_NAMESPACE_NODE **ReturnNode)
{
ACPI_GENERIC_STATE ScopeInfo;
ACPI_STATUS Status;
char *InternalPath;
ACPI_FUNCTION_TRACE_PTR (NsGetNodeUnlocked, ACPI_CAST_PTR (char, Pathname));
/* Simplest case is a null pathname */
if (!Pathname)
{
*ReturnNode = PrefixNode;
if (!PrefixNode)
{
*ReturnNode = AcpiGbl_RootNode;
}
return_ACPI_STATUS (AE_OK);
}
/* Quick check for a reference to the root */
if (ACPI_IS_ROOT_PREFIX (Pathname[0]) && (!Pathname[1]))
{
*ReturnNode = AcpiGbl_RootNode;
return_ACPI_STATUS (AE_OK);
}
/* Convert path to internal representation */
Status = AcpiNsInternalizeName (Pathname, &InternalPath);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Setup lookup scope (search starting point) */
ScopeInfo.Scope.Node = PrefixNode;
/* Lookup the name in the namespace */
Status = AcpiNsLookup (&ScopeInfo, InternalPath, ACPI_TYPE_ANY,
ACPI_IMODE_EXECUTE, (Flags | ACPI_NS_DONT_OPEN_SCOPE),
NULL, ReturnNode);
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s, %s\n",
Pathname, AcpiFormatException (Status)));
}
ACPI_FREE (InternalPath);
return_ACPI_STATUS (Status);
}
示例13: AcpiNsGetInternalNameLength
void
AcpiNsGetInternalNameLength (
ACPI_NAMESTRING_INFO *Info)
{
const char *NextExternalChar;
UINT32 i;
ACPI_FUNCTION_ENTRY ();
NextExternalChar = Info->ExternalName;
Info->NumCarats = 0;
Info->NumSegments = 0;
Info->FullyQualified = FALSE;
/*
* For the internal name, the required length is 4 bytes per segment,
* plus 1 each for RootPrefix, MultiNamePrefixOp, segment count,
* trailing null (which is not really needed, but no there's harm in
* putting it there)
*
* strlen() + 1 covers the first NameSeg, which has no path separator
*/
if (ACPI_IS_ROOT_PREFIX (*NextExternalChar))
{
Info->FullyQualified = TRUE;
NextExternalChar++;
/* Skip redundant RootPrefix, like \\_SB.PCI0.SBRG.EC0 */
while (ACPI_IS_ROOT_PREFIX (*NextExternalChar))
{
NextExternalChar++;
}
}
else
{
/* Handle Carat prefixes */
while (ACPI_IS_PARENT_PREFIX (*NextExternalChar))
{
Info->NumCarats++;
NextExternalChar++;
}
}
/*
* Determine the number of ACPI name "segments" by counting the number of
* path separators within the string. Start with one segment since the
* segment count is [(# separators) + 1], and zero separators is ok.
*/
if (*NextExternalChar)
{
Info->NumSegments = 1;
for (i = 0; NextExternalChar[i]; i++)
{
if (ACPI_IS_PATH_SEPARATOR (NextExternalChar[i]))
{
Info->NumSegments++;
}
}
}
Info->Length = (ACPI_NAME_SIZE * Info->NumSegments) +
4 + Info->NumCarats;
Info->NextExternalChar = NextExternalChar;
}
示例14: AcpiDmDisplayPath
void
AcpiDmDisplayPath (
ACPI_PARSE_OBJECT *Op)
{
ACPI_PARSE_OBJECT *Prev;
ACPI_PARSE_OBJECT *Search;
UINT32 Name;
BOOLEAN DoDot = FALSE;
ACPI_PARSE_OBJECT *NamePath;
const ACPI_OPCODE_INFO *OpInfo;
/* We are only interested in named objects */
OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
if (!(OpInfo->Flags & AML_NSNODE))
{
return;
}
if (OpInfo->Flags & AML_CREATE)
{
/* Field creation - check for a fully qualified namepath */
if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)
{
NamePath = AcpiPsGetArg (Op, 3);
}
else
{
NamePath = AcpiPsGetArg (Op, 2);
}
if ((NamePath) &&
(NamePath->Common.Value.String) &&
(ACPI_IS_ROOT_PREFIX (NamePath->Common.Value.String[0])))
{
AcpiDmNamestring (NamePath->Common.Value.String);
return;
}
}
Prev = NULL; /* Start with Root Node */
while (Prev != Op)
{
/* Search upwards in the tree to find scope with "prev" as its parent */
Search = Op;
for (; ;)
{
if (Search->Common.Parent == Prev)
{
break;
}
/* Go up one level */
Search = Search->Common.Parent;
}
if (Prev)
{
OpInfo = AcpiPsGetOpcodeInfo (Search->Common.AmlOpcode);
if (!(OpInfo->Flags & AML_FIELD))
{
/* Below root scope, append scope name */
if (DoDot)
{
/* Append dot */
AcpiOsPrintf (".");
}
if (OpInfo->Flags & AML_CREATE)
{
if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)
{
NamePath = AcpiPsGetArg (Op, 3);
}
else
{
NamePath = AcpiPsGetArg (Op, 2);
}
if ((NamePath) &&
(NamePath->Common.Value.String))
{
AcpiDmDumpName (NamePath->Common.Value.String);
}
}
else
{
Name = AcpiPsGetName (Search);
AcpiDmDumpName ((char *) &Name);
}
DoDot = TRUE;
}
//.........這裏部分代碼省略.........
示例15: OptOptimizeNameDeclaration
static ACPI_STATUS
OptOptimizeNameDeclaration (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState,
ACPI_NAMESPACE_NODE *CurrentNode,
ACPI_NAMESPACE_NODE *TargetNode,
char *AmlNameString,
char **NewPath)
{
ACPI_STATUS Status;
char *NewPathExternal;
ACPI_NAMESPACE_NODE *Node;
ACPI_FUNCTION_TRACE (OptOptimizeNameDeclaration);
if (((CurrentNode == AcpiGbl_RootNode) ||
(Op->Common.Parent->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK)) &&
(ACPI_IS_ROOT_PREFIX (AmlNameString[0])))
{
/*
* The current scope is the root, and the namepath has a root prefix
* that is therefore extraneous. Remove it.
*/
*NewPath = &AmlNameString[1];
/* Debug output */
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, *NewPath,
NULL, &NewPathExternal);
if (ACPI_FAILURE (Status))
{
AslCoreSubsystemError (Op, Status, "Externalizing NamePath",
ASL_NO_ABORT);
return (Status);
}
/*
* Check to make sure that the optimization finds the node we are
* looking for. This is simply a sanity check on the new
* path that has been created.
*
* We know that we are at the root, so NULL is used for the scope.
*/
Status = AcpiNsLookup (NULL, *NewPath,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node));
if (ACPI_SUCCESS (Status))
{
/* Found the namepath, but make sure the node is correct */
if (Node == TargetNode)
{
/* The lookup matched the node, accept this optimization */
AslError (ASL_OPTIMIZATION, ASL_MSG_NAME_OPTIMIZATION,
Op, NewPathExternal);
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
"AT ROOT: %-24s", NewPathExternal));
}
else
{
/* Node is not correct, do not use this optimization */
Status = AE_NOT_FOUND;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
" ***** WRONG NODE"));
AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Op,
"Not using optimized name - found wrong node");
}
}
else
{
/* The lookup failed, we obviously cannot use this optimization */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
" ***** NOT FOUND"));
AslError (ASL_WARNING, ASL_MSG_COMPILER_INTERNAL, Op,
"Not using optimized name - did not find node");
}
ACPI_FREE (NewPathExternal);
return (Status);
}
/* Could not optimize */
return (AE_NOT_FOUND);
}