nsaccess.c revision 71867
1/*******************************************************************************
2 *
3 * Module Name: nsaccess - Top-level functions for accessing ACPI namespace
4 *              $Revision: 119 $
5 *
6 ******************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, 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_INTEGER:
229
230                ObjDesc->Integer.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    UINT32                  LocalFlags = Flags & ~NS_ERROR_IF_FOUND;
365
366    DEBUG_EXEC              (UINT32 i;)
367
368
369    FUNCTION_TRACE ("NsLookup");
370
371
372    if (!ReturnNode)
373    {
374        return_ACPI_STATUS (AE_BAD_PARAMETER);
375    }
376
377
378    AcpiGbl_NsLookupCount++;
379
380    *ReturnNode = ENTRY_NOT_FOUND;
381
382
383    if (!AcpiGbl_RootNode)
384    {
385        return (AE_NO_NAMESPACE);
386    }
387
388    /*
389     * Get the prefix scope.
390     * A null scope means use the root scope
391     */
392
393    if ((!ScopeInfo) ||
394        (!ScopeInfo->Scope.Node))
395    {
396        DEBUG_PRINT (TRACE_NAMES,
397            ("NsLookup: Null scope prefix, using root node (%p)\n", AcpiGbl_RootNode));
398
399        PrefixNode = AcpiGbl_RootNode;
400    }
401    else
402    {
403        PrefixNode = ScopeInfo->Scope.Node;
404    }
405
406
407    /*
408     * This check is explicitly split provide relax the TypeToCheckFor
409     * conditions for BankFieldDefn.  Originally, both BankFieldDefn and
410     * DefFieldDefn caused TypeToCheckFor to be set to ACPI_TYPE_REGION,
411     * but the BankFieldDefn may also check for a Field definition as well
412     * as an OperationRegion.
413     */
414
415    if (INTERNAL_TYPE_DEF_FIELD_DEFN == Type)
416    {
417        /* DefFieldDefn defines fields in a Region */
418
419        TypeToCheckFor = ACPI_TYPE_REGION;
420    }
421
422    else if (INTERNAL_TYPE_BANK_FIELD_DEFN == Type)
423    {
424        /* BankFieldDefn defines data fields in a Field Object */
425
426        TypeToCheckFor = ACPI_TYPE_ANY;
427    }
428
429    else
430    {
431        TypeToCheckFor = Type;
432    }
433
434
435    /* TBD: [Restructure] - Move the pathname stuff into a new procedure */
436
437    /* Examine the name pointer */
438
439    if (!Pathname)
440    {
441        /*  8-12-98 ASL Grammar Update supports null NamePath   */
442
443        NullNamePath = TRUE;
444        NumSegments = 0;
445        ThisNode = AcpiGbl_RootNode;
446
447        DEBUG_PRINT (TRACE_NAMES,
448            ("NsLookup: Null Pathname (Zero segments),  Flags=%x\n", Flags));
449    }
450
451    else
452    {
453        /*
454         * Valid name pointer (Internal name format)
455         *
456         * Check for prefixes.  As represented in the AML stream, a
457         * Pathname consists of an optional scope prefix followed by
458         * a segment part.
459         *
460         * If present, the scope prefix is either a RootPrefix (in
461         * which case the name is fully qualified), or zero or more
462         * ParentPrefixes (in which case the name's scope is relative
463         * to the current scope).
464         *
465         * The segment part consists of either:
466         *  - A single 4-byte name segment, or
467         *  - A DualNamePrefix followed by two 4-byte name segments, or
468         *  - A MultiNamePrefixOp, followed by a byte indicating the
469         *    number of segments and the segments themselves.
470         */
471
472        if (*Pathname == AML_ROOT_PREFIX)
473        {
474            /* Pathname is fully qualified, look in root name table */
475
476            CurrentNode = AcpiGbl_RootNode;
477
478            /* point to segment part */
479
480            Pathname++;
481
482            DEBUG_PRINT (TRACE_NAMES,
483                ("NsLookup: Searching from root [%p]\n",
484                CurrentNode));
485
486            /* Direct reference to root, "\" */
487
488            if (!(*Pathname))
489            {
490                ThisNode = AcpiGbl_RootNode;
491                goto CheckForNewScopeAndExit;
492            }
493        }
494
495        else
496        {
497            /* Pathname is relative to current scope, start there */
498
499            CurrentNode = PrefixNode;
500
501            DEBUG_PRINT (TRACE_NAMES,
502                ("NsLookup: Searching relative to pfx scope [%p]\n",
503                PrefixNode));
504
505            /*
506             * Handle up-prefix (carat).  More than one prefix
507             * is supported
508             */
509
510            while (*Pathname == AML_PARENT_PREFIX)
511            {
512                /* Point to segment part or next ParentPrefix */
513
514                Pathname++;
515
516                /*  Backup to the parent's scope  */
517
518                ThisNode = AcpiNsGetParentObject (CurrentNode);
519                if (!ThisNode)
520                {
521                    /* Current scope has no parent scope */
522
523                    REPORT_ERROR (("Too many parent prefixes (^) - reached root\n"));
524                    return_ACPI_STATUS (AE_NOT_FOUND);
525                }
526
527                CurrentNode = ThisNode;
528            }
529        }
530
531
532        /*
533         * Examine the name prefix opcode, if any,
534         * to determine the number of segments
535         */
536
537        if (*Pathname == AML_DUAL_NAME_PREFIX)
538        {
539            NumSegments = 2;
540
541            /* point to first segment */
542
543            Pathname++;
544
545            DEBUG_PRINT (TRACE_NAMES,
546                ("NsLookup: Dual Pathname (2 segments, Flags=%X)\n", Flags));
547        }
548
549        else if (*Pathname == AML_MULTI_NAME_PREFIX_OP)
550        {
551            NumSegments = (UINT32)* (UINT8 *) ++Pathname;
552
553            /* point to first segment */
554
555            Pathname++;
556
557            DEBUG_PRINT (TRACE_NAMES,
558                ("NsLookup: Multi Pathname (%d Segments, Flags=%X) \n",
559                NumSegments, Flags));
560        }
561
562        else
563        {
564            /*
565             * No Dual or Multi prefix, hence there is only one
566             * segment and Pathname is already pointing to it.
567             */
568            NumSegments = 1;
569
570            DEBUG_PRINT (TRACE_NAMES,
571                ("NsLookup: Simple Pathname (1 segment, Flags=%X)\n", Flags));
572        }
573
574#ifdef ACPI_DEBUG
575
576        /* TBD: [Restructure] Make this a procedure */
577
578        /* Debug only: print the entire name that we are about to lookup */
579
580        DEBUG_PRINT (TRACE_NAMES, ("NsLookup: ["));
581
582        for (i = 0; i < NumSegments; i++)
583        {
584            DEBUG_PRINT_RAW (TRACE_NAMES, ("%4.4s/", &Pathname[i * 4]));
585        }
586        DEBUG_PRINT_RAW (TRACE_NAMES, ("]\n"));
587#endif
588    }
589
590
591    /*
592     * Search namespace for each segment of the name.
593     * Loop through and verify/add each name segment.
594     */
595
596
597    while (NumSegments-- && CurrentNode)
598    {
599        /*
600         * Search for the current name segment under the current
601         * named object.  The Type is significant only at the last (topmost)
602         * level.  (We don't care about the types along the path, only
603         * the type of the final target object.)
604         */
605        ThisSearchType = ACPI_TYPE_ANY;
606        if (!NumSegments)
607        {
608            ThisSearchType = Type;
609            LocalFlags = Flags;
610        }
611
612        /* Pluck one ACPI name from the front of the pathname */
613
614        MOVE_UNALIGNED32_TO_32 (&SimpleName, Pathname);
615
616        /* Try to find the ACPI name */
617
618        Status = AcpiNsSearchAndEnter (SimpleName, WalkState,
619                                        CurrentNode, InterpreterMode,
620                                        ThisSearchType, LocalFlags,
621                                        &ThisNode);
622
623        if (ACPI_FAILURE (Status))
624        {
625            if (Status == AE_NOT_FOUND)
626            {
627                /* Name not found in ACPI namespace  */
628
629                DEBUG_PRINT (TRACE_NAMES,
630                    ("NsLookup: Name [%4.4s] not found in scope %X\n",
631                    &SimpleName, CurrentNode));
632            }
633
634            return_ACPI_STATUS (Status);
635        }
636
637
638        /*
639         * If 1) This is the last segment (NumSegments == 0)
640         *    2) and looking for a specific type
641         *       (Not checking for TYPE_ANY)
642         *    3) Which is not an alias
643         *    4) which is not a local type (TYPE_DEF_ANY)
644         *    5) which is not a local type (TYPE_SCOPE)
645         *    6) which is not a local type (TYPE_INDEX_FIELD_DEFN)
646         *    7) and type of object is known (not TYPE_ANY)
647         *    8) and object does not match request
648         *
649         * Then we have a type mismatch.  Just warn and ignore it.
650         */
651        if ((NumSegments        == 0)                               &&
652            (TypeToCheckFor     != ACPI_TYPE_ANY)                   &&
653            (TypeToCheckFor     != INTERNAL_TYPE_ALIAS)             &&
654            (TypeToCheckFor     != INTERNAL_TYPE_DEF_ANY)           &&
655            (TypeToCheckFor     != INTERNAL_TYPE_SCOPE)             &&
656            (TypeToCheckFor     != INTERNAL_TYPE_INDEX_FIELD_DEFN)  &&
657            (ThisNode->Type     != ACPI_TYPE_ANY)                   &&
658            (ThisNode->Type     != TypeToCheckFor))
659        {
660            /* Complain about a type mismatch */
661
662            REPORT_WARNING (
663                ("NsLookup: %4.4s, type %X, checking for type %X\n",
664                &SimpleName, ThisNode->Type, TypeToCheckFor));
665        }
666
667        /*
668         * If this is the last name segment and we are not looking for a
669         * specific type, but the type of found object is known, use that type
670         * to see if it opens a scope.
671         */
672
673        if ((0 == NumSegments) && (ACPI_TYPE_ANY == Type))
674        {
675            Type = ThisNode->Type;
676        }
677
678        if ((NumSegments || AcpiNsOpensScope (Type)) &&
679            (ThisNode->Child == NULL))
680        {
681            /*
682             * More segments or the type implies enclosed scope,
683             * and the next scope has not been allocated.
684             */
685
686            DEBUG_PRINT (ACPI_INFO,
687                ("NsLookup: Load mode=%X  ThisNode=%X\n",
688                InterpreterMode, ThisNode));
689        }
690
691        CurrentNode = ThisNode;
692
693        /* point to next name segment */
694
695        Pathname += ACPI_NAME_SIZE;
696    }
697
698
699    /*
700     * Always check if we need to open a new scope
701     */
702
703CheckForNewScopeAndExit:
704
705    if (!(Flags & NS_DONT_OPEN_SCOPE) && (WalkState))
706    {
707        /*
708         * If entry is a type which opens a scope,
709         * push the new scope on the scope stack.
710         */
711
712        if (AcpiNsOpensScope (TypeToCheckFor))
713        {
714            /*  8-12-98 ASL Grammar Update supports null NamePath   */
715
716            if (NullNamePath)
717            {
718                /* TBD: [Investigate] - is this the correct thing to do? */
719
720                ScopeToPush = NULL;
721            }
722            else
723            {
724                ScopeToPush = ThisNode;
725            }
726
727            Status = AcpiDsScopeStackPush (ScopeToPush, Type,
728                                            WalkState);
729            if (ACPI_FAILURE (Status))
730            {
731                return_ACPI_STATUS (Status);
732            }
733
734            DEBUG_PRINT (ACPI_INFO,
735                ("NsLookup: Set global scope to %p\n", ScopeToPush));
736        }
737    }
738
739    *ReturnNode = ThisNode;
740    return_ACPI_STATUS (AE_OK);
741}
742
743