nsaccess.c revision 70243
1/*******************************************************************************
2 *
3 * Module Name: nsaccess - Top-level functions for accessing ACPI namespace
4 *              $Revision: 116 $
5 *
6 ******************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, 2000, Intel Corp.
13 * All rights reserved.
14 *
15 * 2. License
16 *
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights.  You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
20 * property rights.
21 *
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
28 *
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code.  No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
37 *
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
40 *
41 * 3. Conditions
42 *
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision.  In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change.  Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee.  Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
54 *
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution.  In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
65 * make.
66 *
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
75 *
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
80 *
81 * 4. Disclaimer and Export Compliance
82 *
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89 * PARTICULAR PURPOSE.
90 *
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98 * LIMITED REMEDY.
99 *
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government.  In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
114 *
115 *****************************************************************************/
116
117#define __NSACCESS_C__
118
119#include "acpi.h"
120#include "amlcode.h"
121#include "acinterp.h"
122#include "acnamesp.h"
123#include "acdispat.h"
124
125
126#define _COMPONENT          NAMESPACE
127        MODULE_NAME         ("nsaccess")
128
129
130/*******************************************************************************
131 *
132 * FUNCTION:    AcpiNsRootInitialize
133 *
134 * PARAMETERS:  None
135 *
136 * RETURN:      Status
137 *
138 * DESCRIPTION: Allocate and initialize the default root named objects
139 *
140 * MUTEX:       Locks namespace for entire execution
141 *
142 ******************************************************************************/
143
144ACPI_STATUS
145AcpiNsRootInitialize (void)
146{
147    ACPI_STATUS             Status = AE_OK;
148    PREDEFINED_NAMES        *InitVal = NULL;
149    ACPI_NAMESPACE_NODE     *NewNode;
150    ACPI_OPERAND_OBJECT     *ObjDesc;
151
152
153    FUNCTION_TRACE ("NsRootInitialize");
154
155
156    AcpiCmAcquireMutex (ACPI_MTX_NAMESPACE);
157
158    /*
159     * The global root ptr is initially NULL, so a non-NULL value indicates
160     * that AcpiNsRootInitialize() has already been called; just return.
161     */
162
163    if (AcpiGbl_RootNode)
164    {
165        Status = AE_OK;
166        goto UnlockAndExit;
167    }
168
169
170    /*
171     * Tell the rest of the subsystem that the root is initialized
172     * (This is OK because the namespace is locked)
173     */
174
175    AcpiGbl_RootNode = &AcpiGbl_RootNodeStruct;
176
177
178    /* Enter the pre-defined names in the name table */
179
180    DEBUG_PRINT (ACPI_INFO,
181        ("Entering predefined name table entries into namespace\n"));
182
183    for (InitVal = AcpiGbl_PreDefinedNames; InitVal->Name; InitVal++)
184    {
185        Status = AcpiNsLookup (NULL, InitVal->Name,
186                                (OBJECT_TYPE_INTERNAL) InitVal->Type,
187                                IMODE_LOAD_PASS2, NS_NO_UPSEARCH,
188                                NULL, &NewNode);
189
190        if (ACPI_FAILURE (Status) || (!NewNode)) /* Must be on same line for code converter */
191        {
192            DEBUG_PRINT (ACPI_ERROR,
193                ("Could not create predefined name %s, %s\n",
194                InitVal->Name, AcpiCmFormatException (Status)));
195        }
196
197        /*
198         * Name entered successfully.
199         * If entry in PreDefinedNames[] specifies an
200         * initial value, create the initial value.
201         */
202
203        if (InitVal->Val)
204        {
205            /*
206             * Entry requests an initial value, allocate a
207             * descriptor for it.
208             */
209
210            ObjDesc = AcpiCmCreateInternalObject (
211                            (OBJECT_TYPE_INTERNAL) InitVal->Type);
212
213            if (!ObjDesc)
214            {
215                Status = AE_NO_MEMORY;
216                goto UnlockAndExit;
217            }
218
219            /*
220             * Convert value string from table entry to
221             * internal representation. Only types actually
222             * used for initial values are implemented here.
223             */
224
225            switch (InitVal->Type)
226            {
227
228            case ACPI_TYPE_NUMBER:
229
230                ObjDesc->Number.Value =
231                        (ACPI_INTEGER) STRTOUL (InitVal->Val, NULL, 10);
232                break;
233
234
235            case ACPI_TYPE_STRING:
236
237                ObjDesc->String.Length =
238                        (UINT16) STRLEN (InitVal->Val);
239
240                /*
241                 * Allocate a buffer for the string.  All
242                 * String.Pointers must be allocated buffers!
243                 * (makes deletion simpler)
244                 */
245                ObjDesc->String.Pointer = AcpiCmAllocate (
246                                                (ObjDesc->String.Length + 1));
247                if (!ObjDesc->String.Pointer)
248                {
249                    AcpiCmRemoveReference (ObjDesc);
250                    Status = AE_NO_MEMORY;
251                    goto UnlockAndExit;
252                }
253
254                STRCPY (ObjDesc->String.Pointer, InitVal->Val);
255                break;
256
257
258            case ACPI_TYPE_MUTEX:
259
260                ObjDesc->Mutex.SyncLevel =
261                        (UINT16) STRTOUL (InitVal->Val, NULL, 10);
262
263                if (STRCMP (InitVal->Name, "_GL_") == 0)
264                {
265                    /*
266                     * Create a counting semaphore for the
267                     * global lock
268                     */
269                    Status = AcpiOsCreateSemaphore (ACPI_NO_UNIT_LIMIT,
270                                            1, &ObjDesc->Mutex.Semaphore);
271
272                    if (ACPI_FAILURE (Status))
273                    {
274                        goto UnlockAndExit;
275                    }
276                    /*
277                     * We just created the mutex for the
278                     * global lock, save it
279                     */
280
281                    AcpiGbl_GlobalLockSemaphore = ObjDesc->Mutex.Semaphore;
282                }
283
284                else
285                {
286                    /* Create a mutex */
287
288                    Status = AcpiOsCreateSemaphore (1, 1,
289                                        &ObjDesc->Mutex.Semaphore);
290
291                    if (ACPI_FAILURE (Status))
292                    {
293                        goto UnlockAndExit;
294                    }
295                }
296                break;
297
298
299            default:
300                REPORT_ERROR (("Unsupported initial type value %X\n",
301                    InitVal->Type));
302                AcpiCmRemoveReference (ObjDesc);
303                ObjDesc = NULL;
304                continue;
305            }
306
307            /* Store pointer to value descriptor in the Node */
308
309            AcpiNsAttachObject (NewNode, ObjDesc,
310                                ObjDesc->Common.Type);
311        }
312    }
313
314
315UnlockAndExit:
316    AcpiCmReleaseMutex (ACPI_MTX_NAMESPACE);
317    return_ACPI_STATUS (Status);
318}
319
320
321/*******************************************************************************
322 *
323 * FUNCTION:    AcpiNsLookup
324 *
325 * PARAMETERS:  PrefixNode  - Search scope if name is not fully qualified
326 *              Pathname        - Search pathname, in internal format
327 *                                (as represented in the AML stream)
328 *              Type            - Type associated with name
329 *              InterpreterMode - IMODE_LOAD_PASS2 => add name if not found
330 *              Flags           - Flags describing the search restrictions
331 *              WalkState       - Current state of the walk
332 *              ReturnNode  - Where the Node is placed (if found
333 *                                or created successfully)
334 *
335 * RETURN:      Status
336 *
337 * DESCRIPTION: Find or enter the passed name in the name space.
338 *              Log an error if name not found in Exec mode.
339 *
340 * MUTEX:       Assumes namespace is locked.
341 *
342 ******************************************************************************/
343
344ACPI_STATUS
345AcpiNsLookup (
346    ACPI_GENERIC_STATE      *ScopeInfo,
347    NATIVE_CHAR             *Pathname,
348    OBJECT_TYPE_INTERNAL    Type,
349    OPERATING_MODE          InterpreterMode,
350    UINT32                  Flags,
351    ACPI_WALK_STATE         *WalkState,
352    ACPI_NAMESPACE_NODE     **ReturnNode)
353{
354    ACPI_STATUS             Status;
355    ACPI_NAMESPACE_NODE      *PrefixNode;
356    ACPI_NAMESPACE_NODE     *CurrentNode = NULL;
357    ACPI_NAMESPACE_NODE     *ScopeToPush = NULL;
358    ACPI_NAMESPACE_NODE     *ThisNode = NULL;
359    UINT32                  NumSegments;
360    ACPI_NAME               SimpleName;
361    BOOLEAN                 NullNamePath = FALSE;
362    OBJECT_TYPE_INTERNAL    TypeToCheckFor;
363    OBJECT_TYPE_INTERNAL    ThisSearchType;
364
365    DEBUG_ONLY_MEMBERS      (UINT32 i)
366
367
368    FUNCTION_TRACE ("NsLookup");
369
370
371    if (!ReturnNode)
372    {
373        return_ACPI_STATUS (AE_BAD_PARAMETER);
374    }
375
376
377    AcpiGbl_NsLookupCount++;
378
379    *ReturnNode = ENTRY_NOT_FOUND;
380
381
382    if (!AcpiGbl_RootNode)
383    {
384        return (AE_NO_NAMESPACE);
385    }
386
387    /*
388     * Get the prefix scope.
389     * A null scope means use the root scope
390     */
391
392    if ((!ScopeInfo) ||
393        (!ScopeInfo->Scope.Node))
394    {
395        DEBUG_PRINT (TRACE_NAMES,
396            ("NsLookup: Null scope prefix, using root node (%p)\n", AcpiGbl_RootNode));
397
398        PrefixNode = AcpiGbl_RootNode;
399    }
400    else
401    {
402        PrefixNode = ScopeInfo->Scope.Node;
403    }
404
405
406    /*
407     * This check is explicitly split provide relax the TypeToCheckFor
408     * conditions for BankFieldDefn.  Originally, both BankFieldDefn and
409     * DefFieldDefn caused TypeToCheckFor to be set to ACPI_TYPE_REGION,
410     * but the BankFieldDefn may also check for a Field definition as well
411     * as an OperationRegion.
412     */
413
414    if (INTERNAL_TYPE_DEF_FIELD_DEFN == Type)
415    {
416        /* DefFieldDefn defines fields in a Region */
417
418        TypeToCheckFor = ACPI_TYPE_REGION;
419    }
420
421    else if (INTERNAL_TYPE_BANK_FIELD_DEFN == Type)
422    {
423        /* BankFieldDefn defines data fields in a Field Object */
424
425        TypeToCheckFor = ACPI_TYPE_ANY;
426    }
427
428    else
429    {
430        TypeToCheckFor = Type;
431    }
432
433
434    /* TBD: [Restructure] - Move the pathname stuff into a new procedure */
435
436    /* Examine the name pointer */
437
438    if (!Pathname)
439    {
440        /*  8-12-98 ASL Grammar Update supports null NamePath   */
441
442        NullNamePath = TRUE;
443        NumSegments = 0;
444        ThisNode = AcpiGbl_RootNode;
445
446        DEBUG_PRINT (TRACE_NAMES,
447            ("NsLookup: Null Pathname (Zero segments),  Flags=%x\n", Flags));
448    }
449
450    else
451    {
452        /*
453         * Valid name pointer (Internal name format)
454         *
455         * Check for prefixes.  As represented in the AML stream, a
456         * Pathname consists of an optional scope prefix followed by
457         * a segment part.
458         *
459         * If present, the scope prefix is either a RootPrefix (in
460         * which case the name is fully qualified), or zero or more
461         * ParentPrefixes (in which case the name's scope is relative
462         * to the current scope).
463         *
464         * The segment part consists of either:
465         *  - A single 4-byte name segment, or
466         *  - A DualNamePrefix followed by two 4-byte name segments, or
467         *  - A MultiNamePrefixOp, followed by a byte indicating the
468         *    number of segments and the segments themselves.
469         */
470
471        if (*Pathname == AML_ROOT_PREFIX)
472        {
473            /* Pathname is fully qualified, look in root name table */
474
475            CurrentNode = AcpiGbl_RootNode;
476
477            /* point to segment part */
478
479            Pathname++;
480
481            DEBUG_PRINT (TRACE_NAMES,
482                ("NsLookup: Searching from root [%p]\n",
483                CurrentNode));
484
485            /* Direct reference to root, "\" */
486
487            if (!(*Pathname))
488            {
489                ThisNode = AcpiGbl_RootNode;
490                goto CheckForNewScopeAndExit;
491            }
492        }
493
494        else
495        {
496            /* Pathname is relative to current scope, start there */
497
498            CurrentNode = PrefixNode;
499
500            DEBUG_PRINT (TRACE_NAMES,
501                ("NsLookup: Searching relative to pfx scope [%p]\n",
502                PrefixNode));
503
504            /*
505             * Handle up-prefix (carat).  More than one prefix
506             * is supported
507             */
508
509            while (*Pathname == AML_PARENT_PREFIX)
510            {
511                /* Point to segment part or next ParentPrefix */
512
513                Pathname++;
514
515                /*  Backup to the parent's scope  */
516
517                ThisNode = AcpiNsGetParentObject (CurrentNode);
518                if (!ThisNode)
519                {
520                    /* Current scope has no parent scope */
521
522                    REPORT_ERROR (("Too many parent prefixes (^) - reached root\n"));
523                    return_ACPI_STATUS (AE_NOT_FOUND);
524                }
525
526                CurrentNode = ThisNode;
527            }
528        }
529
530
531        /*
532         * Examine the name prefix opcode, if any,
533         * to determine the number of segments
534         */
535
536        if (*Pathname == AML_DUAL_NAME_PREFIX)
537        {
538            NumSegments = 2;
539
540            /* point to first segment */
541
542            Pathname++;
543
544            DEBUG_PRINT (TRACE_NAMES,
545                ("NsLookup: Dual Pathname (2 segments, Flags=%X)\n", Flags));
546        }
547
548        else if (*Pathname == AML_MULTI_NAME_PREFIX_OP)
549        {
550            NumSegments = (UINT32)* (UINT8 *) ++Pathname;
551
552            /* point to first segment */
553
554            Pathname++;
555
556            DEBUG_PRINT (TRACE_NAMES,
557                ("NsLookup: Multi Pathname (%d Segments, Flags=%X) \n",
558                NumSegments, Flags));
559        }
560
561        else
562        {
563            /*
564             * No Dual or Multi prefix, hence there is only one
565             * segment and Pathname is already pointing to it.
566             */
567            NumSegments = 1;
568
569            DEBUG_PRINT (TRACE_NAMES,
570                ("NsLookup: Simple Pathname (1 segment, Flags=%X)\n", Flags));
571        }
572
573#ifdef ACPI_DEBUG
574
575        /* TBD: [Restructure] Make this a procedure */
576
577        /* Debug only: print the entire name that we are about to lookup */
578
579        DEBUG_PRINT (TRACE_NAMES, ("NsLookup: ["));
580
581        for (i = 0; i < NumSegments; i++)
582        {
583            DEBUG_PRINT_RAW (TRACE_NAMES, ("%4.4s/", &Pathname[i * 4]));
584        }
585        DEBUG_PRINT_RAW (TRACE_NAMES, ("]\n"));
586#endif
587    }
588
589
590    /*
591     * Search namespace for each segment of the name.
592     * Loop through and verify/add each name segment.
593     */
594
595
596    while (NumSegments-- && CurrentNode)
597    {
598        /*
599         * Search for the current name segment under the current
600         * named object.  The Type is significant only at the last (topmost)
601         * level.  (We don't care about the types along the path, only
602         * the type of the final target object.)
603         */
604        ThisSearchType = ACPI_TYPE_ANY;
605        if (!NumSegments)
606        {
607            ThisSearchType = Type;
608        }
609
610        /* Pluck one ACPI name from the front of the pathname */
611
612        MOVE_UNALIGNED32_TO_32 (&SimpleName, Pathname);
613
614        /* Try to find the ACPI name */
615
616        Status = AcpiNsSearchAndEnter (SimpleName, WalkState,
617                                        CurrentNode, InterpreterMode,
618                                        ThisSearchType, Flags,
619                                        &ThisNode);
620
621        if (ACPI_FAILURE (Status))
622        {
623            if (Status == AE_NOT_FOUND)
624            {
625                /* Name not found in ACPI namespace  */
626
627                DEBUG_PRINT (TRACE_NAMES,
628                    ("NsLookup: Name [%4.4s] not found in scope %X\n",
629                    &SimpleName, CurrentNode));
630            }
631
632            return_ACPI_STATUS (Status);
633        }
634
635
636        /*
637         * If 1) This is the last segment (NumSegments == 0)
638         *    2) and looking for a specific type
639         *       (Not checking for TYPE_ANY)
640         *    3) Which is not an alias
641         *    4) which is not a local type (TYPE_DEF_ANY)
642         *    5) which is not a local type (TYPE_SCOPE)
643         *    6) which is not a local type (TYPE_INDEX_FIELD_DEFN)
644         *    7) and type of object is known (not TYPE_ANY)
645         *    8) and object does not match request
646         *
647         * Then we have a type mismatch.  Just warn and ignore it.
648         */
649        if ((NumSegments        == 0)                               &&
650            (TypeToCheckFor     != ACPI_TYPE_ANY)                   &&
651            (TypeToCheckFor     != INTERNAL_TYPE_ALIAS)             &&
652            (TypeToCheckFor     != INTERNAL_TYPE_DEF_ANY)           &&
653            (TypeToCheckFor     != INTERNAL_TYPE_SCOPE)             &&
654            (TypeToCheckFor     != INTERNAL_TYPE_INDEX_FIELD_DEFN)  &&
655            (ThisNode->Type     != ACPI_TYPE_ANY)                   &&
656            (ThisNode->Type     != TypeToCheckFor))
657        {
658            /* Complain about a type mismatch */
659
660            REPORT_WARNING (
661                ("NsLookup: %4.4s, type %X, checking for type %X\n",
662                &SimpleName, ThisNode->Type, TypeToCheckFor));
663        }
664
665        /*
666         * If this is the last name segment and we are not looking for a
667         * specific type, but the type of found object is known, use that type
668         * to see if it opens a scope.
669         */
670
671        if ((0 == NumSegments) && (ACPI_TYPE_ANY == Type))
672        {
673            Type = ThisNode->Type;
674        }
675
676        if ((NumSegments || AcpiNsOpensScope (Type)) &&
677            (ThisNode->Child == NULL))
678        {
679            /*
680             * More segments or the type implies enclosed scope,
681             * and the next scope has not been allocated.
682             */
683
684            DEBUG_PRINT (ACPI_INFO,
685                ("NsLookup: Load mode=%X  ThisNode=%X\n",
686                InterpreterMode, ThisNode));
687        }
688
689        CurrentNode = ThisNode;
690
691        /* point to next name segment */
692
693        Pathname += ACPI_NAME_SIZE;
694    }
695
696
697    /*
698     * Always check if we need to open a new scope
699     */
700
701CheckForNewScopeAndExit:
702
703    if (!(Flags & NS_DONT_OPEN_SCOPE) && (WalkState))
704    {
705        /*
706         * If entry is a type which opens a scope,
707         * push the new scope on the scope stack.
708         */
709
710        if (AcpiNsOpensScope (TypeToCheckFor))
711        {
712            /*  8-12-98 ASL Grammar Update supports null NamePath   */
713
714            if (NullNamePath)
715            {
716                /* TBD: [Investigate] - is this the correct thing to do? */
717
718                ScopeToPush = NULL;
719            }
720            else
721            {
722                ScopeToPush = ThisNode;
723            }
724
725            Status = AcpiDsScopeStackPush (ScopeToPush, Type,
726                                            WalkState);
727            if (ACPI_FAILURE (Status))
728            {
729                return_ACPI_STATUS (Status);
730            }
731
732            DEBUG_PRINT (ACPI_INFO,
733                ("NsLookup: Set global scope to %p\n", ScopeToPush));
734        }
735    }
736
737    *ReturnNode = ThisNode;
738    return_ACPI_STATUS (AE_OK);
739}
740
741