Home | History | Annotate | Line # | Download | only in compiler
aslpredef.c revision 1.1.1.3.2.1
      1          1.1  jruoho /******************************************************************************
      2          1.1  jruoho  *
      3          1.1  jruoho  * Module Name: aslpredef - support for ACPI predefined names
      4          1.1  jruoho  *
      5          1.1  jruoho  *****************************************************************************/
      6          1.1  jruoho 
      7      1.1.1.2  jruoho /*
      8  1.1.1.3.2.1    yamt  * Copyright (C) 2000 - 2013, Intel Corp.
      9          1.1  jruoho  * All rights reserved.
     10          1.1  jruoho  *
     11      1.1.1.2  jruoho  * Redistribution and use in source and binary forms, with or without
     12      1.1.1.2  jruoho  * modification, are permitted provided that the following conditions
     13      1.1.1.2  jruoho  * are met:
     14      1.1.1.2  jruoho  * 1. Redistributions of source code must retain the above copyright
     15      1.1.1.2  jruoho  *    notice, this list of conditions, and the following disclaimer,
     16      1.1.1.2  jruoho  *    without modification.
     17      1.1.1.2  jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18      1.1.1.2  jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
     19      1.1.1.2  jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
     20      1.1.1.2  jruoho  *    including a substantially similar Disclaimer requirement for further
     21      1.1.1.2  jruoho  *    binary redistribution.
     22      1.1.1.2  jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
     23      1.1.1.2  jruoho  *    of any contributors may be used to endorse or promote products derived
     24      1.1.1.2  jruoho  *    from this software without specific prior written permission.
     25      1.1.1.2  jruoho  *
     26      1.1.1.2  jruoho  * Alternatively, this software may be distributed under the terms of the
     27      1.1.1.2  jruoho  * GNU General Public License ("GPL") version 2 as published by the Free
     28      1.1.1.2  jruoho  * Software Foundation.
     29      1.1.1.2  jruoho  *
     30      1.1.1.2  jruoho  * NO WARRANTY
     31      1.1.1.2  jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32      1.1.1.2  jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33      1.1.1.2  jruoho  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34      1.1.1.2  jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35      1.1.1.2  jruoho  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36      1.1.1.2  jruoho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37      1.1.1.2  jruoho  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38      1.1.1.2  jruoho  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39      1.1.1.2  jruoho  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40      1.1.1.2  jruoho  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41      1.1.1.2  jruoho  * POSSIBILITY OF SUCH DAMAGES.
     42      1.1.1.2  jruoho  */
     43          1.1  jruoho 
     44          1.1  jruoho #define ACPI_CREATE_PREDEFINED_TABLE
     45  1.1.1.3.2.1    yamt #define ACPI_CREATE_RESOURCE_TABLE
     46          1.1  jruoho 
     47          1.1  jruoho #include "aslcompiler.h"
     48          1.1  jruoho #include "aslcompiler.y.h"
     49          1.1  jruoho #include "acpredef.h"
     50  1.1.1.3.2.1    yamt #include "acnamesp.h"
     51          1.1  jruoho 
     52          1.1  jruoho 
     53          1.1  jruoho #define _COMPONENT          ACPI_COMPILER
     54          1.1  jruoho         ACPI_MODULE_NAME    ("aslpredef")
     55          1.1  jruoho 
     56          1.1  jruoho 
     57          1.1  jruoho /* Local prototypes */
     58          1.1  jruoho 
     59      1.1.1.2  jruoho static void
     60      1.1.1.2  jruoho ApCheckForUnexpectedReturnValue (
     61      1.1.1.2  jruoho     ACPI_PARSE_OBJECT       *Op,
     62      1.1.1.2  jruoho     ASL_METHOD_INFO         *MethodInfo);
     63      1.1.1.2  jruoho 
     64          1.1  jruoho static UINT32
     65          1.1  jruoho ApCheckForSpecialName (
     66          1.1  jruoho     ACPI_PARSE_OBJECT       *Op,
     67          1.1  jruoho     char                    *Name);
     68          1.1  jruoho 
     69          1.1  jruoho 
     70          1.1  jruoho /*******************************************************************************
     71          1.1  jruoho  *
     72          1.1  jruoho  * FUNCTION:    ApCheckForPredefinedMethod
     73          1.1  jruoho  *
     74          1.1  jruoho  * PARAMETERS:  Op              - A parse node of type "METHOD".
     75          1.1  jruoho  *              MethodInfo      - Saved info about this method
     76          1.1  jruoho  *
     77          1.1  jruoho  * RETURN:      None
     78          1.1  jruoho  *
     79          1.1  jruoho  * DESCRIPTION: If method is a predefined name, check that the number of
     80          1.1  jruoho  *              arguments and the return type (returns a value or not)
     81          1.1  jruoho  *              is correct.
     82          1.1  jruoho  *
     83          1.1  jruoho  ******************************************************************************/
     84          1.1  jruoho 
     85      1.1.1.3  jruoho BOOLEAN
     86          1.1  jruoho ApCheckForPredefinedMethod (
     87          1.1  jruoho     ACPI_PARSE_OBJECT       *Op,
     88          1.1  jruoho     ASL_METHOD_INFO         *MethodInfo)
     89          1.1  jruoho {
     90  1.1.1.3.2.1    yamt     UINT32                      Index;
     91  1.1.1.3.2.1    yamt     UINT32                      RequiredArgCount;
     92  1.1.1.3.2.1    yamt     const ACPI_PREDEFINED_INFO  *ThisName;
     93          1.1  jruoho 
     94          1.1  jruoho 
     95          1.1  jruoho     /* Check for a match against the predefined name list */
     96          1.1  jruoho 
     97          1.1  jruoho     Index = ApCheckForPredefinedName (Op, Op->Asl.NameSeg);
     98          1.1  jruoho 
     99          1.1  jruoho     switch (Index)
    100          1.1  jruoho     {
    101          1.1  jruoho     case ACPI_NOT_RESERVED_NAME:        /* No underscore or _Txx or _xxx name not matched */
    102          1.1  jruoho     case ACPI_PREDEFINED_NAME:          /* Resource Name or reserved scope name */
    103          1.1  jruoho     case ACPI_COMPILER_RESERVED_NAME:   /* A _Txx that was not emitted by compiler */
    104          1.1  jruoho 
    105          1.1  jruoho         /* Just return, nothing to do */
    106      1.1.1.3  jruoho         return (FALSE);
    107          1.1  jruoho 
    108          1.1  jruoho 
    109          1.1  jruoho     case ACPI_EVENT_RESERVED_NAME:      /* _Lxx/_Exx/_Wxx/_Qxx methods */
    110          1.1  jruoho 
    111          1.1  jruoho         Gbl_ReservedMethods++;
    112          1.1  jruoho 
    113          1.1  jruoho         /* NumArguments must be zero for all _Lxx/_Exx/_Wxx/_Qxx methods */
    114          1.1  jruoho 
    115          1.1  jruoho         if (MethodInfo->NumArguments != 0)
    116          1.1  jruoho         {
    117  1.1.1.3.2.1    yamt             snprintf (MsgBuffer, sizeof(MsgBuffer), "%s requires %u", Op->Asl.ExternalName, 0);
    118          1.1  jruoho 
    119          1.1  jruoho             AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
    120          1.1  jruoho                 MsgBuffer);
    121          1.1  jruoho         }
    122          1.1  jruoho         break;
    123          1.1  jruoho 
    124          1.1  jruoho 
    125          1.1  jruoho     default:
    126          1.1  jruoho         /*
    127  1.1.1.3.2.1    yamt          * Matched a predefined method name - validate the ASL-defined
    128  1.1.1.3.2.1    yamt          * argument count against the ACPI specification.
    129          1.1  jruoho          *
    130  1.1.1.3.2.1    yamt          * Some methods are allowed to have a "minimum" number of args
    131  1.1.1.3.2.1    yamt          * (_SCP) because their definition in ACPI has changed over time.
    132          1.1  jruoho          */
    133          1.1  jruoho         Gbl_ReservedMethods++;
    134  1.1.1.3.2.1    yamt         ThisName = &AcpiGbl_PredefinedMethods[Index];
    135  1.1.1.3.2.1    yamt         RequiredArgCount = METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList);
    136          1.1  jruoho 
    137  1.1.1.3.2.1    yamt         if (MethodInfo->NumArguments != RequiredArgCount)
    138          1.1  jruoho         {
    139  1.1.1.3.2.1    yamt             snprintf (MsgBuffer, sizeof(MsgBuffer), "%4.4s requires %u",
    140  1.1.1.3.2.1    yamt                 ThisName->Info.Name, RequiredArgCount);
    141          1.1  jruoho 
    142  1.1.1.3.2.1    yamt             if (MethodInfo->NumArguments < RequiredArgCount)
    143          1.1  jruoho             {
    144  1.1.1.3.2.1    yamt                 AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op,
    145          1.1  jruoho                     MsgBuffer);
    146          1.1  jruoho             }
    147  1.1.1.3.2.1    yamt             else if ((MethodInfo->NumArguments > RequiredArgCount) &&
    148  1.1.1.3.2.1    yamt                 !(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM))
    149          1.1  jruoho             {
    150  1.1.1.3.2.1    yamt                 AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
    151          1.1  jruoho                     MsgBuffer);
    152          1.1  jruoho             }
    153          1.1  jruoho         }
    154          1.1  jruoho 
    155          1.1  jruoho         /*
    156          1.1  jruoho          * Check if method returns no value, but the predefined name is
    157          1.1  jruoho          * required to return a value
    158          1.1  jruoho          */
    159          1.1  jruoho         if (MethodInfo->NumReturnNoValue &&
    160  1.1.1.3.2.1    yamt             ThisName->Info.ExpectedBtypes)
    161          1.1  jruoho         {
    162  1.1.1.3.2.1    yamt             AcpiUtGetExpectedReturnTypes (StringBuffer,
    163  1.1.1.3.2.1    yamt                 ThisName->Info.ExpectedBtypes);
    164          1.1  jruoho 
    165  1.1.1.3.2.1    yamt             snprintf (MsgBuffer, sizeof(MsgBuffer), "%s required for %4.4s",
    166  1.1.1.3.2.1    yamt                 StringBuffer, ThisName->Info.Name);
    167          1.1  jruoho 
    168          1.1  jruoho             AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op,
    169          1.1  jruoho                 MsgBuffer);
    170          1.1  jruoho         }
    171          1.1  jruoho         break;
    172          1.1  jruoho     }
    173      1.1.1.3  jruoho 
    174      1.1.1.3  jruoho     return (TRUE);
    175          1.1  jruoho }
    176          1.1  jruoho 
    177          1.1  jruoho 
    178          1.1  jruoho /*******************************************************************************
    179          1.1  jruoho  *
    180      1.1.1.2  jruoho  * FUNCTION:    ApCheckForUnexpectedReturnValue
    181      1.1.1.2  jruoho  *
    182      1.1.1.2  jruoho  * PARAMETERS:  Op              - A parse node of type "RETURN".
    183      1.1.1.2  jruoho  *              MethodInfo      - Saved info about this method
    184      1.1.1.2  jruoho  *
    185      1.1.1.2  jruoho  * RETURN:      None
    186      1.1.1.2  jruoho  *
    187      1.1.1.2  jruoho  * DESCRIPTION: Check for an unexpected return value from a predefined method.
    188      1.1.1.2  jruoho  *              Invoked for predefined methods that are defined to not return
    189      1.1.1.2  jruoho  *              any value. If there is a return value, issue a remark, since
    190      1.1.1.2  jruoho  *              the ASL writer may be confused as to the method definition
    191      1.1.1.2  jruoho  *              and/or functionality.
    192      1.1.1.2  jruoho  *
    193      1.1.1.2  jruoho  * Note: We ignore all return values of "Zero", since this is what a standalone
    194      1.1.1.2  jruoho  *       Return() statement will always generate -- so we ignore it here --
    195      1.1.1.2  jruoho  *       i.e., there is no difference between Return() and Return(Zero).
    196      1.1.1.2  jruoho  *       Also, a null Return() will be disassembled to return(Zero) -- so, we
    197      1.1.1.2  jruoho  *       don't want to generate extraneous remarks/warnings for a disassembled
    198      1.1.1.2  jruoho  *       ASL file.
    199      1.1.1.2  jruoho  *
    200      1.1.1.2  jruoho  ******************************************************************************/
    201      1.1.1.2  jruoho 
    202      1.1.1.2  jruoho static void
    203      1.1.1.2  jruoho ApCheckForUnexpectedReturnValue (
    204      1.1.1.2  jruoho     ACPI_PARSE_OBJECT       *Op,
    205      1.1.1.2  jruoho     ASL_METHOD_INFO         *MethodInfo)
    206      1.1.1.2  jruoho {
    207      1.1.1.2  jruoho     ACPI_PARSE_OBJECT       *ReturnValueOp;
    208      1.1.1.2  jruoho 
    209      1.1.1.2  jruoho 
    210      1.1.1.2  jruoho     /* Ignore Return() and Return(Zero) (they are the same) */
    211      1.1.1.2  jruoho 
    212      1.1.1.2  jruoho     ReturnValueOp = Op->Asl.Child;
    213      1.1.1.2  jruoho     if (ReturnValueOp->Asl.ParseOpcode == PARSEOP_ZERO)
    214      1.1.1.2  jruoho     {
    215      1.1.1.2  jruoho         return;
    216      1.1.1.2  jruoho     }
    217      1.1.1.2  jruoho 
    218      1.1.1.2  jruoho     /* We have a valid return value, but the reserved name did not expect it */
    219      1.1.1.2  jruoho 
    220      1.1.1.2  jruoho     AslError (ASL_WARNING, ASL_MSG_RESERVED_NO_RETURN_VAL,
    221      1.1.1.2  jruoho         Op, MethodInfo->Op->Asl.ExternalName);
    222      1.1.1.2  jruoho }
    223      1.1.1.2  jruoho 
    224      1.1.1.2  jruoho 
    225      1.1.1.2  jruoho /*******************************************************************************
    226      1.1.1.2  jruoho  *
    227          1.1  jruoho  * FUNCTION:    ApCheckPredefinedReturnValue
    228          1.1  jruoho  *
    229          1.1  jruoho  * PARAMETERS:  Op              - A parse node of type "RETURN".
    230          1.1  jruoho  *              MethodInfo      - Saved info about this method
    231          1.1  jruoho  *
    232          1.1  jruoho  * RETURN:      None
    233          1.1  jruoho  *
    234          1.1  jruoho  * DESCRIPTION: If method is a predefined name, attempt to validate the return
    235          1.1  jruoho  *              value. Only "static" types can be validated - a simple return
    236          1.1  jruoho  *              of an integer/string/buffer/package or a named reference to
    237          1.1  jruoho  *              a static object. Values such as a Localx or Argx or a control
    238      1.1.1.2  jruoho  *              method invocation are not checked. Issue a warning if there is
    239      1.1.1.2  jruoho  *              a valid return value, but the reserved method defines no
    240      1.1.1.2  jruoho  *              return value.
    241          1.1  jruoho  *
    242          1.1  jruoho  ******************************************************************************/
    243          1.1  jruoho 
    244          1.1  jruoho void
    245          1.1  jruoho ApCheckPredefinedReturnValue (
    246          1.1  jruoho     ACPI_PARSE_OBJECT       *Op,
    247          1.1  jruoho     ASL_METHOD_INFO         *MethodInfo)
    248          1.1  jruoho {
    249  1.1.1.3.2.1    yamt     UINT32                      Index;
    250  1.1.1.3.2.1    yamt     ACPI_PARSE_OBJECT           *ReturnValueOp;
    251  1.1.1.3.2.1    yamt     const ACPI_PREDEFINED_INFO  *ThisName;
    252          1.1  jruoho 
    253          1.1  jruoho 
    254          1.1  jruoho     /* Check parent method for a match against the predefined name list */
    255          1.1  jruoho 
    256          1.1  jruoho     Index = ApCheckForPredefinedName (MethodInfo->Op,
    257          1.1  jruoho                 MethodInfo->Op->Asl.NameSeg);
    258          1.1  jruoho 
    259          1.1  jruoho     switch (Index)
    260          1.1  jruoho     {
    261      1.1.1.2  jruoho     case ACPI_EVENT_RESERVED_NAME:      /* _Lxx/_Exx/_Wxx/_Qxx methods */
    262      1.1.1.2  jruoho 
    263      1.1.1.2  jruoho         /* No return value expected, warn if there is one */
    264      1.1.1.2  jruoho 
    265      1.1.1.2  jruoho         ApCheckForUnexpectedReturnValue (Op, MethodInfo);
    266      1.1.1.2  jruoho         return;
    267      1.1.1.2  jruoho 
    268          1.1  jruoho     case ACPI_NOT_RESERVED_NAME:        /* No underscore or _Txx or _xxx name not matched */
    269          1.1  jruoho     case ACPI_PREDEFINED_NAME:          /* Resource Name or reserved scope name */
    270          1.1  jruoho     case ACPI_COMPILER_RESERVED_NAME:   /* A _Txx that was not emitted by compiler */
    271          1.1  jruoho 
    272          1.1  jruoho         /* Just return, nothing to do */
    273          1.1  jruoho         return;
    274          1.1  jruoho 
    275          1.1  jruoho     default: /* A standard predefined ACPI name */
    276          1.1  jruoho 
    277  1.1.1.3.2.1    yamt         ThisName = &AcpiGbl_PredefinedMethods[Index];
    278  1.1.1.3.2.1    yamt         if (!ThisName->Info.ExpectedBtypes)
    279          1.1  jruoho         {
    280      1.1.1.2  jruoho             /* No return value expected, warn if there is one */
    281      1.1.1.2  jruoho 
    282      1.1.1.2  jruoho             ApCheckForUnexpectedReturnValue (Op, MethodInfo);
    283          1.1  jruoho             return;
    284          1.1  jruoho         }
    285          1.1  jruoho 
    286          1.1  jruoho         /* Get the object returned, it is the next argument */
    287          1.1  jruoho 
    288          1.1  jruoho         ReturnValueOp = Op->Asl.Child;
    289          1.1  jruoho         switch (ReturnValueOp->Asl.ParseOpcode)
    290          1.1  jruoho         {
    291          1.1  jruoho         case PARSEOP_ZERO:
    292          1.1  jruoho         case PARSEOP_ONE:
    293          1.1  jruoho         case PARSEOP_ONES:
    294          1.1  jruoho         case PARSEOP_INTEGER:
    295          1.1  jruoho         case PARSEOP_STRING_LITERAL:
    296          1.1  jruoho         case PARSEOP_BUFFER:
    297          1.1  jruoho         case PARSEOP_PACKAGE:
    298          1.1  jruoho 
    299          1.1  jruoho             /* Static data return object - check against expected type */
    300          1.1  jruoho 
    301  1.1.1.3.2.1    yamt             ApCheckObjectType (ThisName->Info.Name, ReturnValueOp,
    302  1.1.1.3.2.1    yamt                 ThisName->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT);
    303  1.1.1.3.2.1    yamt 
    304  1.1.1.3.2.1    yamt             /* For packages, check the individual package elements */
    305  1.1.1.3.2.1    yamt 
    306  1.1.1.3.2.1    yamt             if (ReturnValueOp->Asl.ParseOpcode == PARSEOP_PACKAGE)
    307  1.1.1.3.2.1    yamt             {
    308  1.1.1.3.2.1    yamt                 ApCheckPackage (ReturnValueOp, ThisName);
    309  1.1.1.3.2.1    yamt             }
    310          1.1  jruoho             break;
    311          1.1  jruoho 
    312          1.1  jruoho         default:
    313          1.1  jruoho             /*
    314          1.1  jruoho              * All other ops are very difficult or impossible to typecheck at
    315          1.1  jruoho              * compile time. These include all Localx, Argx, and method
    316          1.1  jruoho              * invocations. Also, NAMESEG and NAMESTRING because the type of
    317          1.1  jruoho              * any named object can be changed at runtime (for example,
    318          1.1  jruoho              * CopyObject will change the type of the target object.)
    319          1.1  jruoho              */
    320          1.1  jruoho             break;
    321          1.1  jruoho         }
    322          1.1  jruoho     }
    323          1.1  jruoho }
    324          1.1  jruoho 
    325          1.1  jruoho 
    326          1.1  jruoho /*******************************************************************************
    327          1.1  jruoho  *
    328          1.1  jruoho  * FUNCTION:    ApCheckForPredefinedObject
    329          1.1  jruoho  *
    330          1.1  jruoho  * PARAMETERS:  Op              - A parse node
    331          1.1  jruoho  *              Name            - The ACPI name to be checked
    332          1.1  jruoho  *
    333          1.1  jruoho  * RETURN:      None
    334          1.1  jruoho  *
    335          1.1  jruoho  * DESCRIPTION: Check for a predefined name for a static object (created via
    336          1.1  jruoho  *              the ASL Name operator). If it is a predefined ACPI name, ensure
    337          1.1  jruoho  *              that the name does not require any arguments (which would
    338          1.1  jruoho  *              require a control method implemenation of the name), and that
    339          1.1  jruoho  *              the type of the object is one of the expected types for the
    340          1.1  jruoho  *              predefined name.
    341          1.1  jruoho  *
    342          1.1  jruoho  ******************************************************************************/
    343          1.1  jruoho 
    344          1.1  jruoho void
    345          1.1  jruoho ApCheckForPredefinedObject (
    346          1.1  jruoho     ACPI_PARSE_OBJECT       *Op,
    347          1.1  jruoho     char                    *Name)
    348          1.1  jruoho {
    349  1.1.1.3.2.1    yamt     UINT32                      Index;
    350  1.1.1.3.2.1    yamt     ACPI_PARSE_OBJECT           *ObjectOp;
    351  1.1.1.3.2.1    yamt     const ACPI_PREDEFINED_INFO  *ThisName;
    352          1.1  jruoho 
    353          1.1  jruoho 
    354          1.1  jruoho     /*
    355          1.1  jruoho      * Check for a real predefined name -- not a resource descriptor name
    356          1.1  jruoho      * or a predefined scope name
    357          1.1  jruoho      */
    358          1.1  jruoho     Index = ApCheckForPredefinedName (Op, Name);
    359          1.1  jruoho 
    360          1.1  jruoho     switch (Index)
    361          1.1  jruoho     {
    362          1.1  jruoho     case ACPI_NOT_RESERVED_NAME:        /* No underscore or _Txx or _xxx name not matched */
    363          1.1  jruoho     case ACPI_PREDEFINED_NAME:          /* Resource Name or reserved scope name */
    364          1.1  jruoho     case ACPI_COMPILER_RESERVED_NAME:   /* A _Txx that was not emitted by compiler */
    365          1.1  jruoho 
    366          1.1  jruoho         /* Nothing to do */
    367          1.1  jruoho         return;
    368          1.1  jruoho 
    369          1.1  jruoho     case ACPI_EVENT_RESERVED_NAME:      /* _Lxx/_Exx/_Wxx/_Qxx methods */
    370          1.1  jruoho 
    371          1.1  jruoho         /*
    372          1.1  jruoho          * These names must be control methods, by definition in ACPI spec.
    373          1.1  jruoho          * Also because they are defined to return no value. None of them
    374          1.1  jruoho          * require any arguments.
    375          1.1  jruoho          */
    376          1.1  jruoho         AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
    377          1.1  jruoho             "with zero arguments");
    378          1.1  jruoho         return;
    379          1.1  jruoho 
    380  1.1.1.3.2.1    yamt     default:
    381          1.1  jruoho 
    382  1.1.1.3.2.1    yamt         break;
    383  1.1.1.3.2.1    yamt     }
    384          1.1  jruoho 
    385  1.1.1.3.2.1    yamt     /* A standard predefined ACPI name */
    386          1.1  jruoho 
    387  1.1.1.3.2.1    yamt     /*
    388  1.1.1.3.2.1    yamt      * If this predefined name requires input arguments, then
    389  1.1.1.3.2.1    yamt      * it must be implemented as a control method
    390  1.1.1.3.2.1    yamt      */
    391  1.1.1.3.2.1    yamt     ThisName = &AcpiGbl_PredefinedMethods[Index];
    392  1.1.1.3.2.1    yamt     if (METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList) > 0)
    393  1.1.1.3.2.1    yamt     {
    394  1.1.1.3.2.1    yamt         AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
    395  1.1.1.3.2.1    yamt             "with arguments");
    396  1.1.1.3.2.1    yamt         return;
    397  1.1.1.3.2.1    yamt     }
    398          1.1  jruoho 
    399  1.1.1.3.2.1    yamt     /*
    400  1.1.1.3.2.1    yamt      * If no return value is expected from this predefined name, then
    401  1.1.1.3.2.1    yamt      * it follows that it must be implemented as a control method
    402  1.1.1.3.2.1    yamt      * (with zero args, because the args > 0 case was handled above)
    403  1.1.1.3.2.1    yamt      * Examples are: _DIS, _INI, _IRC, _OFF, _ON, _PSx
    404  1.1.1.3.2.1    yamt      */
    405  1.1.1.3.2.1    yamt     if (!ThisName->Info.ExpectedBtypes)
    406  1.1.1.3.2.1    yamt     {
    407  1.1.1.3.2.1    yamt         AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
    408  1.1.1.3.2.1    yamt             "with zero arguments");
    409          1.1  jruoho         return;
    410          1.1  jruoho     }
    411  1.1.1.3.2.1    yamt 
    412  1.1.1.3.2.1    yamt     /* Typecheck the actual object, it is the next argument */
    413  1.1.1.3.2.1    yamt 
    414  1.1.1.3.2.1    yamt     ObjectOp = Op->Asl.Child->Asl.Next;
    415  1.1.1.3.2.1    yamt     ApCheckObjectType (ThisName->Info.Name, Op->Asl.Child->Asl.Next,
    416  1.1.1.3.2.1    yamt         ThisName->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT);
    417  1.1.1.3.2.1    yamt 
    418  1.1.1.3.2.1    yamt     /* For packages, check the individual package elements */
    419  1.1.1.3.2.1    yamt 
    420  1.1.1.3.2.1    yamt     if (ObjectOp->Asl.ParseOpcode == PARSEOP_PACKAGE)
    421  1.1.1.3.2.1    yamt     {
    422  1.1.1.3.2.1    yamt         ApCheckPackage (ObjectOp, ThisName);
    423  1.1.1.3.2.1    yamt     }
    424          1.1  jruoho }
    425          1.1  jruoho 
    426          1.1  jruoho 
    427          1.1  jruoho /*******************************************************************************
    428          1.1  jruoho  *
    429          1.1  jruoho  * FUNCTION:    ApCheckForPredefinedName
    430          1.1  jruoho  *
    431          1.1  jruoho  * PARAMETERS:  Op              - A parse node
    432          1.1  jruoho  *              Name            - NameSeg to check
    433          1.1  jruoho  *
    434          1.1  jruoho  * RETURN:      None
    435          1.1  jruoho  *
    436          1.1  jruoho  * DESCRIPTION: Check a NameSeg against the reserved list.
    437          1.1  jruoho  *
    438          1.1  jruoho  ******************************************************************************/
    439          1.1  jruoho 
    440          1.1  jruoho UINT32
    441          1.1  jruoho ApCheckForPredefinedName (
    442          1.1  jruoho     ACPI_PARSE_OBJECT       *Op,
    443          1.1  jruoho     char                    *Name)
    444          1.1  jruoho {
    445  1.1.1.3.2.1    yamt     UINT32                      i;
    446  1.1.1.3.2.1    yamt     const ACPI_PREDEFINED_INFO  *ThisName;
    447          1.1  jruoho 
    448          1.1  jruoho 
    449          1.1  jruoho     if (Name[0] == 0)
    450          1.1  jruoho     {
    451          1.1  jruoho         AcpiOsPrintf ("Found a null name, external = %s\n",
    452          1.1  jruoho             Op->Asl.ExternalName);
    453          1.1  jruoho     }
    454          1.1  jruoho 
    455          1.1  jruoho     /* All reserved names are prefixed with a single underscore */
    456          1.1  jruoho 
    457          1.1  jruoho     if (Name[0] != '_')
    458          1.1  jruoho     {
    459          1.1  jruoho         return (ACPI_NOT_RESERVED_NAME);
    460          1.1  jruoho     }
    461          1.1  jruoho 
    462          1.1  jruoho     /* Check for a standard predefined method name */
    463          1.1  jruoho 
    464  1.1.1.3.2.1    yamt     ThisName = AcpiGbl_PredefinedMethods;
    465  1.1.1.3.2.1    yamt     for (i = 0; ThisName->Info.Name[0]; i++)
    466          1.1  jruoho     {
    467  1.1.1.3.2.1    yamt         if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
    468          1.1  jruoho         {
    469          1.1  jruoho             /* Return index into predefined array */
    470          1.1  jruoho             return (i);
    471          1.1  jruoho         }
    472  1.1.1.3.2.1    yamt 
    473  1.1.1.3.2.1    yamt         ThisName++; /* Does not account for extra package data, but is OK */
    474          1.1  jruoho     }
    475          1.1  jruoho 
    476          1.1  jruoho     /* Check for resource names and predefined scope names */
    477          1.1  jruoho 
    478  1.1.1.3.2.1    yamt     ThisName = AcpiGbl_ResourceNames;
    479  1.1.1.3.2.1    yamt     while (ThisName->Info.Name[0])
    480          1.1  jruoho     {
    481  1.1.1.3.2.1    yamt         if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
    482          1.1  jruoho         {
    483          1.1  jruoho             return (ACPI_PREDEFINED_NAME);
    484          1.1  jruoho         }
    485  1.1.1.3.2.1    yamt 
    486  1.1.1.3.2.1    yamt         ThisName++;
    487          1.1  jruoho     }
    488          1.1  jruoho 
    489  1.1.1.3.2.1    yamt     ThisName = AcpiGbl_ScopeNames;
    490  1.1.1.3.2.1    yamt     while (ThisName->Info.Name[0])
    491          1.1  jruoho     {
    492  1.1.1.3.2.1    yamt         if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
    493          1.1  jruoho         {
    494          1.1  jruoho             return (ACPI_PREDEFINED_NAME);
    495          1.1  jruoho         }
    496  1.1.1.3.2.1    yamt 
    497  1.1.1.3.2.1    yamt         ThisName++;
    498          1.1  jruoho     }
    499          1.1  jruoho 
    500          1.1  jruoho     /* Check for _Lxx/_Exx/_Wxx/_Qxx/_T_x. Warning if unknown predefined name */
    501          1.1  jruoho 
    502          1.1  jruoho     return (ApCheckForSpecialName (Op, Name));
    503          1.1  jruoho }
    504          1.1  jruoho 
    505          1.1  jruoho 
    506          1.1  jruoho /*******************************************************************************
    507          1.1  jruoho  *
    508          1.1  jruoho  * FUNCTION:    ApCheckForSpecialName
    509          1.1  jruoho  *
    510          1.1  jruoho  * PARAMETERS:  Op              - A parse node
    511          1.1  jruoho  *              Name            - NameSeg to check
    512          1.1  jruoho  *
    513          1.1  jruoho  * RETURN:      None
    514          1.1  jruoho  *
    515          1.1  jruoho  * DESCRIPTION: Check for the "special" predefined names -
    516          1.1  jruoho  *              _Lxx, _Exx, _Qxx, _Wxx, and _T_x
    517          1.1  jruoho  *
    518          1.1  jruoho  ******************************************************************************/
    519          1.1  jruoho 
    520          1.1  jruoho static UINT32
    521          1.1  jruoho ApCheckForSpecialName (
    522          1.1  jruoho     ACPI_PARSE_OBJECT       *Op,
    523          1.1  jruoho     char                    *Name)
    524          1.1  jruoho {
    525          1.1  jruoho 
    526          1.1  jruoho     /*
    527          1.1  jruoho      * Check for the "special" predefined names. We already know that the
    528          1.1  jruoho      * first character is an underscore.
    529          1.1  jruoho      *   GPE:  _Lxx
    530          1.1  jruoho      *   GPE:  _Exx
    531          1.1  jruoho      *   GPE:  _Wxx
    532          1.1  jruoho      *   EC:   _Qxx
    533          1.1  jruoho      */
    534          1.1  jruoho     if ((Name[1] == 'L') ||
    535          1.1  jruoho         (Name[1] == 'E') ||
    536          1.1  jruoho         (Name[1] == 'W') ||
    537          1.1  jruoho         (Name[1] == 'Q'))
    538          1.1  jruoho     {
    539          1.1  jruoho         /* The next two characters must be hex digits */
    540          1.1  jruoho 
    541          1.1  jruoho         if ((isxdigit ((int) Name[2])) &&
    542          1.1  jruoho             (isxdigit ((int) Name[3])))
    543          1.1  jruoho         {
    544          1.1  jruoho             return (ACPI_EVENT_RESERVED_NAME);
    545          1.1  jruoho         }
    546          1.1  jruoho     }
    547          1.1  jruoho 
    548          1.1  jruoho     /* Check for the names reserved for the compiler itself: _T_x */
    549          1.1  jruoho 
    550          1.1  jruoho     else if ((Op->Asl.ExternalName[1] == 'T') &&
    551          1.1  jruoho              (Op->Asl.ExternalName[2] == '_'))
    552          1.1  jruoho     {
    553          1.1  jruoho         /* Ignore if actually emitted by the compiler */
    554          1.1  jruoho 
    555          1.1  jruoho         if (Op->Asl.CompileFlags & NODE_COMPILER_EMITTED)
    556          1.1  jruoho         {
    557          1.1  jruoho             return (ACPI_NOT_RESERVED_NAME);
    558          1.1  jruoho         }
    559          1.1  jruoho 
    560          1.1  jruoho         /*
    561          1.1  jruoho          * Was not actually emitted by the compiler. This is a special case,
    562          1.1  jruoho          * however. If the ASL code being compiled was the result of a
    563          1.1  jruoho          * dissasembly, it may possibly contain valid compiler-emitted names
    564          1.1  jruoho          * of the form "_T_x". We don't want to issue an error or even a
    565          1.1  jruoho          * warning and force the user to manually change the names. So, we
    566          1.1  jruoho          * will issue a remark instead.
    567          1.1  jruoho          */
    568          1.1  jruoho         AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED, Op, Op->Asl.ExternalName);
    569          1.1  jruoho         return (ACPI_COMPILER_RESERVED_NAME);
    570          1.1  jruoho     }
    571          1.1  jruoho 
    572          1.1  jruoho     /*
    573          1.1  jruoho      * The name didn't match any of the known predefined names. Flag it as a
    574          1.1  jruoho      * warning, since the entire namespace starting with an underscore is
    575          1.1  jruoho      * reserved by the ACPI spec.
    576          1.1  jruoho      */
    577          1.1  jruoho     AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME, Op,
    578          1.1  jruoho         Op->Asl.ExternalName);
    579          1.1  jruoho 
    580          1.1  jruoho     return (ACPI_NOT_RESERVED_NAME);
    581          1.1  jruoho }
    582          1.1  jruoho 
    583          1.1  jruoho 
    584          1.1  jruoho /*******************************************************************************
    585          1.1  jruoho  *
    586          1.1  jruoho  * FUNCTION:    ApCheckObjectType
    587          1.1  jruoho  *
    588  1.1.1.3.2.1    yamt  * PARAMETERS:  PredefinedName  - Name of the predefined object we are checking
    589  1.1.1.3.2.1    yamt  *              Op              - Current parse node
    590          1.1  jruoho  *              ExpectedBtypes  - Bitmap of expected return type(s)
    591  1.1.1.3.2.1    yamt  *              PackageIndex    - Index of object within parent package (if
    592  1.1.1.3.2.1    yamt  *                                applicable - ACPI_NOT_PACKAGE_ELEMENT
    593  1.1.1.3.2.1    yamt  *                                otherwise)
    594          1.1  jruoho  *
    595          1.1  jruoho  * RETURN:      None
    596          1.1  jruoho  *
    597          1.1  jruoho  * DESCRIPTION: Check if the object type is one of the types that is expected
    598          1.1  jruoho  *              by the predefined name. Only a limited number of object types
    599          1.1  jruoho  *              can be returned by the predefined names.
    600          1.1  jruoho  *
    601          1.1  jruoho  ******************************************************************************/
    602          1.1  jruoho 
    603  1.1.1.3.2.1    yamt ACPI_STATUS
    604          1.1  jruoho ApCheckObjectType (
    605  1.1.1.3.2.1    yamt     const char              *PredefinedName,
    606          1.1  jruoho     ACPI_PARSE_OBJECT       *Op,
    607  1.1.1.3.2.1    yamt     UINT32                  ExpectedBtypes,
    608  1.1.1.3.2.1    yamt     UINT32                  PackageIndex)
    609          1.1  jruoho {
    610          1.1  jruoho     UINT32                  ReturnBtype;
    611  1.1.1.3.2.1    yamt     char                    *TypeName;
    612          1.1  jruoho 
    613          1.1  jruoho 
    614  1.1.1.3.2.1    yamt     if (!Op)
    615  1.1.1.3.2.1    yamt     {
    616  1.1.1.3.2.1    yamt         return (AE_TYPE);
    617  1.1.1.3.2.1    yamt     }
    618  1.1.1.3.2.1    yamt 
    619  1.1.1.3.2.1    yamt     /* Map the parse opcode to a bitmapped return type (RTYPE) */
    620  1.1.1.3.2.1    yamt 
    621          1.1  jruoho     switch (Op->Asl.ParseOpcode)
    622          1.1  jruoho     {
    623          1.1  jruoho     case PARSEOP_ZERO:
    624          1.1  jruoho     case PARSEOP_ONE:
    625          1.1  jruoho     case PARSEOP_ONES:
    626          1.1  jruoho     case PARSEOP_INTEGER:
    627          1.1  jruoho 
    628  1.1.1.3.2.1    yamt         ReturnBtype = ACPI_RTYPE_INTEGER;
    629  1.1.1.3.2.1    yamt         TypeName = "Integer";
    630          1.1  jruoho         break;
    631          1.1  jruoho 
    632          1.1  jruoho     case PARSEOP_STRING_LITERAL:
    633  1.1.1.3.2.1    yamt 
    634          1.1  jruoho         ReturnBtype = ACPI_RTYPE_STRING;
    635  1.1.1.3.2.1    yamt         TypeName = "String";
    636  1.1.1.3.2.1    yamt         break;
    637  1.1.1.3.2.1    yamt 
    638  1.1.1.3.2.1    yamt     case PARSEOP_BUFFER:
    639  1.1.1.3.2.1    yamt 
    640  1.1.1.3.2.1    yamt         ReturnBtype = ACPI_RTYPE_BUFFER;
    641  1.1.1.3.2.1    yamt         TypeName = "Buffer";
    642          1.1  jruoho         break;
    643          1.1  jruoho 
    644          1.1  jruoho     case PARSEOP_PACKAGE:
    645  1.1.1.3.2.1    yamt     case PARSEOP_VAR_PACKAGE:
    646  1.1.1.3.2.1    yamt 
    647          1.1  jruoho         ReturnBtype = ACPI_RTYPE_PACKAGE;
    648  1.1.1.3.2.1    yamt         TypeName = "Package";
    649  1.1.1.3.2.1    yamt         break;
    650  1.1.1.3.2.1    yamt 
    651  1.1.1.3.2.1    yamt     case PARSEOP_NAMESEG:
    652  1.1.1.3.2.1    yamt     case PARSEOP_NAMESTRING:
    653  1.1.1.3.2.1    yamt         /*
    654  1.1.1.3.2.1    yamt          * Ignore any named references within a package object.
    655  1.1.1.3.2.1    yamt          *
    656  1.1.1.3.2.1    yamt          * For Package objects, references are allowed instead of any of the
    657  1.1.1.3.2.1    yamt          * standard data types (Integer/String/Buffer/Package). These
    658  1.1.1.3.2.1    yamt          * references are resolved at runtime. NAMESEG and NAMESTRING are
    659  1.1.1.3.2.1    yamt          * impossible to typecheck at compile time because the type of
    660  1.1.1.3.2.1    yamt          * any named object can be changed at runtime (for example,
    661  1.1.1.3.2.1    yamt          * CopyObject will change the type of the target object).
    662  1.1.1.3.2.1    yamt          */
    663  1.1.1.3.2.1    yamt         if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT)
    664  1.1.1.3.2.1    yamt         {
    665  1.1.1.3.2.1    yamt             return (AE_OK);
    666  1.1.1.3.2.1    yamt         }
    667  1.1.1.3.2.1    yamt 
    668  1.1.1.3.2.1    yamt         ReturnBtype = ACPI_RTYPE_REFERENCE;
    669  1.1.1.3.2.1    yamt         TypeName = "Reference";
    670          1.1  jruoho         break;
    671          1.1  jruoho 
    672          1.1  jruoho     default:
    673  1.1.1.3.2.1    yamt 
    674          1.1  jruoho         /* Not one of the supported object types */
    675          1.1  jruoho 
    676  1.1.1.3.2.1    yamt         TypeName = UtGetOpName (Op->Asl.ParseOpcode);
    677          1.1  jruoho         goto TypeErrorExit;
    678          1.1  jruoho     }
    679          1.1  jruoho 
    680          1.1  jruoho     /* Exit if the object is one of the expected types */
    681          1.1  jruoho 
    682          1.1  jruoho     if (ReturnBtype & ExpectedBtypes)
    683          1.1  jruoho     {
    684  1.1.1.3.2.1    yamt         return (AE_OK);
    685          1.1  jruoho     }
    686          1.1  jruoho 
    687          1.1  jruoho 
    688          1.1  jruoho TypeErrorExit:
    689          1.1  jruoho 
    690          1.1  jruoho     /* Format the expected types and emit an error message */
    691          1.1  jruoho 
    692  1.1.1.3.2.1    yamt     AcpiUtGetExpectedReturnTypes (StringBuffer, ExpectedBtypes);
    693          1.1  jruoho 
    694  1.1.1.3.2.1    yamt     if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
    695  1.1.1.3.2.1    yamt     {
    696  1.1.1.3.2.1    yamt         snprintf (MsgBuffer, sizeof(MsgBuffer), "%4.4s: found %s, %s required",
    697  1.1.1.3.2.1    yamt             PredefinedName, TypeName, StringBuffer);
    698  1.1.1.3.2.1    yamt     }
    699  1.1.1.3.2.1    yamt     else
    700  1.1.1.3.2.1    yamt     {
    701  1.1.1.3.2.1    yamt         snprintf (MsgBuffer, sizeof(MsgBuffer), "%4.4s: found %s at index %u, %s required",
    702  1.1.1.3.2.1    yamt             PredefinedName, TypeName, PackageIndex, StringBuffer);
    703  1.1.1.3.2.1    yamt     }
    704          1.1  jruoho 
    705  1.1.1.3.2.1    yamt     AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, MsgBuffer);
    706  1.1.1.3.2.1    yamt     return (AE_TYPE);
    707          1.1  jruoho }
    708          1.1  jruoho 
    709          1.1  jruoho 
    710          1.1  jruoho /*******************************************************************************
    711          1.1  jruoho  *
    712          1.1  jruoho  * FUNCTION:    ApDisplayReservedNames
    713          1.1  jruoho  *
    714          1.1  jruoho  * PARAMETERS:  None
    715          1.1  jruoho  *
    716          1.1  jruoho  * RETURN:      None
    717          1.1  jruoho  *
    718          1.1  jruoho  * DESCRIPTION: Dump information about the ACPI predefined names and predefined
    719          1.1  jruoho  *              resource descriptor names.
    720          1.1  jruoho  *
    721          1.1  jruoho  ******************************************************************************/
    722          1.1  jruoho 
    723          1.1  jruoho void
    724          1.1  jruoho ApDisplayReservedNames (
    725          1.1  jruoho     void)
    726          1.1  jruoho {
    727          1.1  jruoho     const ACPI_PREDEFINED_INFO  *ThisName;
    728          1.1  jruoho     UINT32                      Count;
    729  1.1.1.3.2.1    yamt     UINT32                      NumTypes;
    730          1.1  jruoho 
    731          1.1  jruoho 
    732          1.1  jruoho     /*
    733          1.1  jruoho      * Predefined names/methods
    734          1.1  jruoho      */
    735          1.1  jruoho     printf ("\nPredefined Name Information\n\n");
    736          1.1  jruoho 
    737          1.1  jruoho     Count = 0;
    738  1.1.1.3.2.1    yamt     ThisName = AcpiGbl_PredefinedMethods;
    739          1.1  jruoho     while (ThisName->Info.Name[0])
    740          1.1  jruoho     {
    741  1.1.1.3.2.1    yamt         AcpiUtDisplayPredefinedMethod (MsgBuffer, ThisName, FALSE);
    742          1.1  jruoho         Count++;
    743  1.1.1.3.2.1    yamt         ThisName = AcpiUtGetNextPredefinedMethod (ThisName);
    744          1.1  jruoho     }
    745          1.1  jruoho 
    746          1.1  jruoho     printf ("%u Predefined Names are recognized\n", Count);
    747          1.1  jruoho 
    748          1.1  jruoho     /*
    749          1.1  jruoho      * Resource Descriptor names
    750          1.1  jruoho      */
    751  1.1.1.3.2.1    yamt     printf ("\nPredefined Names for Resource Descriptor Fields\n\n");
    752          1.1  jruoho 
    753          1.1  jruoho     Count = 0;
    754  1.1.1.3.2.1    yamt     ThisName = AcpiGbl_ResourceNames;
    755          1.1  jruoho     while (ThisName->Info.Name[0])
    756          1.1  jruoho     {
    757  1.1.1.3.2.1    yamt         NumTypes = AcpiUtGetResourceBitWidth (MsgBuffer,
    758  1.1.1.3.2.1    yamt             ThisName->Info.ArgumentList);
    759  1.1.1.3.2.1    yamt 
    760  1.1.1.3.2.1    yamt         printf ("%4.4s    Field is %s bits wide%s\n",
    761  1.1.1.3.2.1    yamt             ThisName->Info.Name, MsgBuffer,
    762  1.1.1.3.2.1    yamt             (NumTypes > 1) ? " (depending on descriptor type)" : "");
    763  1.1.1.3.2.1    yamt 
    764          1.1  jruoho         Count++;
    765          1.1  jruoho         ThisName++;
    766          1.1  jruoho     }
    767          1.1  jruoho 
    768  1.1.1.3.2.1    yamt     printf ("%u Resource Descriptor Field Names are recognized\n", Count);
    769          1.1  jruoho 
    770          1.1  jruoho     /*
    771          1.1  jruoho      * Predefined scope names
    772          1.1  jruoho      */
    773  1.1.1.3.2.1    yamt     printf ("\nPredefined Scope/Device Names (automatically created at root)\n\n");
    774          1.1  jruoho 
    775  1.1.1.3.2.1    yamt     ThisName = AcpiGbl_ScopeNames;
    776          1.1  jruoho     while (ThisName->Info.Name[0])
    777          1.1  jruoho     {
    778  1.1.1.3.2.1    yamt         printf ("%4.4s    Scope/Device\n", ThisName->Info.Name);
    779          1.1  jruoho         ThisName++;
    780          1.1  jruoho     }
    781          1.1  jruoho }
    782