1 /******************************************************************************
3 * Module Name: aslpredef - support for ACPI predefined names
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************
116 * Alternatively, you may choose to be licensed under the terms of the
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
122 * 1. Redistributions of source code must retain the above copyright
123 * notice, this list of conditions, and the following disclaimer,
124 * without modification.
125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 * substantially similar to the "NO WARRANTY" disclaimer below
127 * ("Disclaimer") and any redistribution must be conditioned upon
128 * including a substantially similar Disclaimer requirement for further
129 * binary redistribution.
130 * 3. Neither the names of the above-listed copyright holders nor the names
131 * of any contributors may be used to endorse or promote products derived
132 * from this software without specific prior written permission.
134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146 * Alternatively, you may choose to be licensed under the terms of the
147 * GNU General Public License ("GPL") version 2 as published by the Free
148 * Software Foundation.
150 *****************************************************************************/
152 #define ACPI_CREATE_PREDEFINED_TABLE
153 #define ACPI_CREATE_RESOURCE_TABLE
155 #include <contrib/dev/acpica/compiler/aslcompiler.h>
156 #include "aslcompiler.y.h"
157 #include <contrib/dev/acpica/include/acpredef.h>
158 #include <contrib/dev/acpica/include/acnamesp.h>
161 #define _COMPONENT ACPI_COMPILER
162 ACPI_MODULE_NAME ("aslpredef")
165 /* Local prototypes */
168 ApCheckForUnexpectedReturnValue (
169 ACPI_PARSE_OBJECT *Op,
170 ASL_METHOD_INFO *MethodInfo);
173 ApCheckForSpecialName (
174 ACPI_PARSE_OBJECT *Op,
178 /*******************************************************************************
180 * FUNCTION: ApCheckForPredefinedMethod
182 * PARAMETERS: Op - A parse node of type "METHOD".
183 * MethodInfo - Saved info about this method
187 * DESCRIPTION: If method is a predefined name, check that the number of
188 * arguments and the return type (returns a value or not)
191 ******************************************************************************/
194 ApCheckForPredefinedMethod (
195 ACPI_PARSE_OBJECT *Op,
196 ASL_METHOD_INFO *MethodInfo)
199 UINT32 RequiredArgCount;
200 const ACPI_PREDEFINED_INFO *ThisName;
203 /* Check for a match against the predefined name list */
205 Index = ApCheckForPredefinedName (Op, Op->Asl.NameSeg);
209 case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */
210 case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */
211 case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */
213 /* Just return, nothing to do */
217 case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */
219 Gbl_ReservedMethods++;
221 /* NumArguments must be zero for all _Lxx/_Exx/_Wxx/_Qxx methods */
223 if (MethodInfo->NumArguments != 0)
225 sprintf (MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0);
227 AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
235 * Matched a predefined method name - validate the ASL-defined
236 * argument count against the ACPI specification.
238 * Some methods are allowed to have a "minimum" number of args
239 * (_SCP) because their definition in ACPI has changed over time.
241 Gbl_ReservedMethods++;
242 ThisName = &AcpiGbl_PredefinedMethods[Index];
243 RequiredArgCount = METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList);
245 if (MethodInfo->NumArguments != RequiredArgCount)
247 sprintf (MsgBuffer, "%4.4s requires %u",
248 ThisName->Info.Name, RequiredArgCount);
250 if (MethodInfo->NumArguments < RequiredArgCount)
252 AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op,
255 else if ((MethodInfo->NumArguments > RequiredArgCount) &&
256 !(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM))
258 AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op,
264 * Check if method returns no value, but the predefined name is
265 * required to return a value
267 if (MethodInfo->NumReturnNoValue &&
268 ThisName->Info.ExpectedBtypes)
270 AcpiUtGetExpectedReturnTypes (StringBuffer,
271 ThisName->Info.ExpectedBtypes);
273 sprintf (MsgBuffer, "%s required for %4.4s",
274 StringBuffer, ThisName->Info.Name);
276 AslError (ASL_WARNING, ASL_MSG_RESERVED_RETURN_VALUE, Op,
286 /*******************************************************************************
288 * FUNCTION: ApCheckForUnexpectedReturnValue
290 * PARAMETERS: Op - A parse node of type "RETURN".
291 * MethodInfo - Saved info about this method
295 * DESCRIPTION: Check for an unexpected return value from a predefined method.
296 * Invoked for predefined methods that are defined to not return
297 * any value. If there is a return value, issue a remark, since
298 * the ASL writer may be confused as to the method definition
299 * and/or functionality.
301 * Note: We ignore all return values of "Zero", since this is what a standalone
302 * Return() statement will always generate -- so we ignore it here --
303 * i.e., there is no difference between Return() and Return(Zero).
304 * Also, a null Return() will be disassembled to return(Zero) -- so, we
305 * don't want to generate extraneous remarks/warnings for a disassembled
308 ******************************************************************************/
311 ApCheckForUnexpectedReturnValue (
312 ACPI_PARSE_OBJECT *Op,
313 ASL_METHOD_INFO *MethodInfo)
315 ACPI_PARSE_OBJECT *ReturnValueOp;
318 /* Ignore Return() and Return(Zero) (they are the same) */
320 ReturnValueOp = Op->Asl.Child;
321 if (ReturnValueOp->Asl.ParseOpcode == PARSEOP_ZERO)
326 /* We have a valid return value, but the reserved name did not expect it */
328 AslError (ASL_WARNING, ASL_MSG_RESERVED_NO_RETURN_VAL,
329 Op, MethodInfo->Op->Asl.ExternalName);
333 /*******************************************************************************
335 * FUNCTION: ApCheckPredefinedReturnValue
337 * PARAMETERS: Op - A parse node of type "RETURN".
338 * MethodInfo - Saved info about this method
342 * DESCRIPTION: If method is a predefined name, attempt to validate the return
343 * value. Only "static" types can be validated - a simple return
344 * of an integer/string/buffer/package or a named reference to
345 * a static object. Values such as a Localx or Argx or a control
346 * method invocation are not checked. Issue a warning if there is
347 * a valid return value, but the reserved method defines no
350 ******************************************************************************/
353 ApCheckPredefinedReturnValue (
354 ACPI_PARSE_OBJECT *Op,
355 ASL_METHOD_INFO *MethodInfo)
358 ACPI_PARSE_OBJECT *ReturnValueOp;
359 const ACPI_PREDEFINED_INFO *ThisName;
363 * Check parent method for a match against the predefined name list.
365 * Note: Disable compiler errors/warnings because any errors will be
366 * caught when analyzing the parent method. Eliminates duplicate errors.
368 Gbl_AllExceptionsDisabled = TRUE;
369 Index = ApCheckForPredefinedName (MethodInfo->Op,
370 MethodInfo->Op->Asl.NameSeg);
371 Gbl_AllExceptionsDisabled = FALSE;
375 case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */
377 /* No return value expected, warn if there is one */
379 ApCheckForUnexpectedReturnValue (Op, MethodInfo);
382 case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */
383 case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */
384 case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */
386 /* Just return, nothing to do */
389 default: /* A standard predefined ACPI name */
391 ThisName = &AcpiGbl_PredefinedMethods[Index];
392 if (!ThisName->Info.ExpectedBtypes)
394 /* No return value expected, warn if there is one */
396 ApCheckForUnexpectedReturnValue (Op, MethodInfo);
400 /* Get the object returned, it is the next argument */
402 ReturnValueOp = Op->Asl.Child;
403 switch (ReturnValueOp->Asl.ParseOpcode)
408 case PARSEOP_INTEGER:
409 case PARSEOP_STRING_LITERAL:
411 case PARSEOP_PACKAGE:
413 /* Static data return object - check against expected type */
415 ApCheckObjectType (ThisName->Info.Name, ReturnValueOp,
416 ThisName->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT);
418 /* For packages, check the individual package elements */
420 if (ReturnValueOp->Asl.ParseOpcode == PARSEOP_PACKAGE)
422 ApCheckPackage (ReturnValueOp, ThisName);
428 * All other ops are very difficult or impossible to typecheck at
429 * compile time. These include all Localx, Argx, and method
430 * invocations. Also, NAMESEG and NAMESTRING because the type of
431 * any named object can be changed at runtime (for example,
432 * CopyObject will change the type of the target object.)
440 /*******************************************************************************
442 * FUNCTION: ApCheckForPredefinedObject
444 * PARAMETERS: Op - A parse node
445 * Name - The ACPI name to be checked
449 * DESCRIPTION: Check for a predefined name for a static object (created via
450 * the ASL Name operator). If it is a predefined ACPI name, ensure
451 * that the name does not require any arguments (which would
452 * require a control method implemenation of the name), and that
453 * the type of the object is one of the expected types for the
456 ******************************************************************************/
459 ApCheckForPredefinedObject (
460 ACPI_PARSE_OBJECT *Op,
464 ACPI_PARSE_OBJECT *ObjectOp;
465 const ACPI_PREDEFINED_INFO *ThisName;
469 * Check for a real predefined name -- not a resource descriptor name
470 * or a predefined scope name
472 Index = ApCheckForPredefinedName (Op, Name);
476 case ACPI_NOT_RESERVED_NAME: /* No underscore or _Txx or _xxx name not matched */
477 case ACPI_PREDEFINED_NAME: /* Resource Name or reserved scope name */
478 case ACPI_COMPILER_RESERVED_NAME: /* A _Txx that was not emitted by compiler */
483 case ACPI_EVENT_RESERVED_NAME: /* _Lxx/_Exx/_Wxx/_Qxx methods */
486 * These names must be control methods, by definition in ACPI spec.
487 * Also because they are defined to return no value. None of them
488 * require any arguments.
490 AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
491 "with zero arguments");
499 /* A standard predefined ACPI name */
502 * If this predefined name requires input arguments, then
503 * it must be implemented as a control method
505 ThisName = &AcpiGbl_PredefinedMethods[Index];
506 if (METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList) > 0)
508 AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
514 * If no return value is expected from this predefined name, then
515 * it follows that it must be implemented as a control method
516 * (with zero args, because the args > 0 case was handled above)
517 * Examples are: _DIS, _INI, _IRC, _OFF, _ON, _PSx
519 if (!ThisName->Info.ExpectedBtypes)
521 AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op,
522 "with zero arguments");
526 /* Typecheck the actual object, it is the next argument */
528 ObjectOp = Op->Asl.Child->Asl.Next;
529 ApCheckObjectType (ThisName->Info.Name, Op->Asl.Child->Asl.Next,
530 ThisName->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT);
532 /* For packages, check the individual package elements */
534 if (ObjectOp->Asl.ParseOpcode == PARSEOP_PACKAGE)
536 ApCheckPackage (ObjectOp, ThisName);
541 /*******************************************************************************
543 * FUNCTION: ApCheckForPredefinedName
545 * PARAMETERS: Op - A parse node
546 * Name - NameSeg to check
550 * DESCRIPTION: Check a NameSeg against the reserved list.
552 ******************************************************************************/
555 ApCheckForPredefinedName (
556 ACPI_PARSE_OBJECT *Op,
560 const ACPI_PREDEFINED_INFO *ThisName;
565 AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
566 "zero length name found");
569 /* All reserved names are prefixed with a single underscore */
573 return (ACPI_NOT_RESERVED_NAME);
576 /* Check for a standard predefined method name */
578 ThisName = AcpiGbl_PredefinedMethods;
579 for (i = 0; ThisName->Info.Name[0]; i++)
581 if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
583 /* Return index into predefined array */
587 ThisName++; /* Does not account for extra package data, but is OK */
590 /* Check for resource names and predefined scope names */
592 ThisName = AcpiGbl_ResourceNames;
593 while (ThisName->Info.Name[0])
595 if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
597 return (ACPI_PREDEFINED_NAME);
603 ThisName = AcpiGbl_ScopeNames;
604 while (ThisName->Info.Name[0])
606 if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
608 return (ACPI_PREDEFINED_NAME);
614 /* Check for _Lxx/_Exx/_Wxx/_Qxx/_T_x. Warning if unknown predefined name */
616 return (ApCheckForSpecialName (Op, Name));
620 /*******************************************************************************
622 * FUNCTION: ApCheckForSpecialName
624 * PARAMETERS: Op - A parse node
625 * Name - NameSeg to check
629 * DESCRIPTION: Check for the "special" predefined names -
630 * _Lxx, _Exx, _Qxx, _Wxx, and _T_x
632 ******************************************************************************/
635 ApCheckForSpecialName (
636 ACPI_PARSE_OBJECT *Op,
641 * Check for the "special" predefined names. We already know that the
642 * first character is an underscore.
648 if ((Name[1] == 'L') ||
653 /* The next two characters must be hex digits */
655 if ((isxdigit ((int) Name[2])) &&
656 (isxdigit ((int) Name[3])))
658 return (ACPI_EVENT_RESERVED_NAME);
662 /* Check for the names reserved for the compiler itself: _T_x */
664 else if ((Op->Asl.ExternalName[1] == 'T') &&
665 (Op->Asl.ExternalName[2] == '_'))
667 /* Ignore if actually emitted by the compiler */
669 if (Op->Asl.CompileFlags & OP_COMPILER_EMITTED)
671 return (ACPI_NOT_RESERVED_NAME);
675 * Was not actually emitted by the compiler. This is a special case,
676 * however. If the ASL code being compiled was the result of a
677 * dissasembly, it may possibly contain valid compiler-emitted names
678 * of the form "_T_x". We don't want to issue an error or even a
679 * warning and force the user to manually change the names. So, we
680 * will issue a remark instead.
682 AslError (ASL_REMARK, ASL_MSG_COMPILER_RESERVED,
683 Op, Op->Asl.ExternalName);
684 return (ACPI_COMPILER_RESERVED_NAME);
688 * The name didn't match any of the known predefined names. Flag it as a
689 * warning, since the entire namespace starting with an underscore is
690 * reserved by the ACPI spec.
692 AslError (ASL_WARNING, ASL_MSG_UNKNOWN_RESERVED_NAME,
693 Op, Op->Asl.ExternalName);
695 return (ACPI_NOT_RESERVED_NAME);
699 /*******************************************************************************
701 * FUNCTION: ApCheckObjectType
703 * PARAMETERS: PredefinedName - Name of the predefined object we are checking
704 * Op - Current parse node
705 * ExpectedBtypes - Bitmap of expected return type(s)
706 * PackageIndex - Index of object within parent package (if
707 * applicable - ACPI_NOT_PACKAGE_ELEMENT
712 * DESCRIPTION: Check if the object type is one of the types that is expected
713 * by the predefined name. Only a limited number of object types
714 * can be returned by the predefined names.
716 ******************************************************************************/
720 const char *PredefinedName,
721 ACPI_PARSE_OBJECT *Op,
722 UINT32 ExpectedBtypes,
734 /* Map the parse opcode to a bitmapped return type (RTYPE) */
736 switch (Op->Asl.ParseOpcode)
741 case PARSEOP_INTEGER:
743 ReturnBtype = ACPI_RTYPE_INTEGER;
744 TypeName = "Integer";
747 case PARSEOP_STRING_LITERAL:
749 ReturnBtype = ACPI_RTYPE_STRING;
755 ReturnBtype = ACPI_RTYPE_BUFFER;
759 case PARSEOP_PACKAGE:
760 case PARSEOP_VAR_PACKAGE:
762 ReturnBtype = ACPI_RTYPE_PACKAGE;
763 TypeName = "Package";
766 case PARSEOP_NAMESEG:
767 case PARSEOP_NAMESTRING:
769 * Ignore any named references within a package object.
771 * For Package objects, references are allowed instead of any of the
772 * standard data types (Integer/String/Buffer/Package). These
773 * references are resolved at runtime. NAMESEG and NAMESTRING are
774 * impossible to typecheck at compile time because the type of
775 * any named object can be changed at runtime (for example,
776 * CopyObject will change the type of the target object).
778 if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT)
783 ReturnBtype = ACPI_RTYPE_REFERENCE;
784 TypeName = "Reference";
789 /* Not one of the supported object types */
791 TypeName = UtGetOpName (Op->Asl.ParseOpcode);
795 /* Exit if the object is one of the expected types */
797 if (ReturnBtype & ExpectedBtypes)
805 /* Format the expected types and emit an error message */
807 AcpiUtGetExpectedReturnTypes (StringBuffer, ExpectedBtypes);
809 if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
811 sprintf (MsgBuffer, "%4.4s: found %s, %s required",
812 PredefinedName, TypeName, StringBuffer);
816 sprintf (MsgBuffer, "%4.4s: found %s at index %u, %s required",
817 PredefinedName, TypeName, PackageIndex, StringBuffer);
820 AslError (ASL_ERROR, ASL_MSG_RESERVED_OPERAND_TYPE, Op, MsgBuffer);
825 /*******************************************************************************
827 * FUNCTION: ApDisplayReservedNames
833 * DESCRIPTION: Dump information about the ACPI predefined names and predefined
834 * resource descriptor names.
836 ******************************************************************************/
839 ApDisplayReservedNames (
842 const ACPI_PREDEFINED_INFO *ThisName;
848 * Predefined names/methods
850 printf ("\nPredefined Name Information\n\n");
853 ThisName = AcpiGbl_PredefinedMethods;
854 while (ThisName->Info.Name[0])
856 AcpiUtDisplayPredefinedMethod (MsgBuffer, ThisName, FALSE);
858 ThisName = AcpiUtGetNextPredefinedMethod (ThisName);
861 printf ("%u Predefined Names are recognized\n", Count);
864 * Resource Descriptor names
866 printf ("\nPredefined Names for Resource Descriptor Fields\n\n");
869 ThisName = AcpiGbl_ResourceNames;
870 while (ThisName->Info.Name[0])
872 NumTypes = AcpiUtGetResourceBitWidth (MsgBuffer,
873 ThisName->Info.ArgumentList);
875 printf ("%4.4s Field is %s bits wide%s\n",
876 ThisName->Info.Name, MsgBuffer,
877 (NumTypes > 1) ? " (depending on descriptor type)" : "");
883 printf ("%u Resource Descriptor Field Names are recognized\n", Count);
886 * Predefined scope names
888 printf ("\nPredefined Scope/Device Names (automatically created at root)\n\n");
890 ThisName = AcpiGbl_ScopeNames;
891 while (ThisName->Info.Name[0])
893 printf ("%4.4s Scope/Device\n", ThisName->Info.Name);