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