Home | History | Annotate | Line # | Download | only in compiler
aslmessages.c revision 1.1.1.23
      1       1.1  christos /******************************************************************************
      2       1.1  christos  *
      3       1.1  christos  * Module Name: aslmessages.c - Compiler error/warning message strings
      4       1.1  christos  *
      5       1.1  christos  *****************************************************************************/
      6       1.1  christos 
      7       1.1  christos /*
      8  1.1.1.23  christos  * Copyright (C) 2000 - 2023, Intel Corp.
      9       1.1  christos  * All rights reserved.
     10       1.1  christos  *
     11       1.1  christos  * Redistribution and use in source and binary forms, with or without
     12       1.1  christos  * modification, are permitted provided that the following conditions
     13       1.1  christos  * are met:
     14       1.1  christos  * 1. Redistributions of source code must retain the above copyright
     15       1.1  christos  *    notice, this list of conditions, and the following disclaimer,
     16       1.1  christos  *    without modification.
     17       1.1  christos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18       1.1  christos  *    substantially similar to the "NO WARRANTY" disclaimer below
     19       1.1  christos  *    ("Disclaimer") and any redistribution must be conditioned upon
     20       1.1  christos  *    including a substantially similar Disclaimer requirement for further
     21       1.1  christos  *    binary redistribution.
     22       1.1  christos  * 3. Neither the names of the above-listed copyright holders nor the names
     23       1.1  christos  *    of any contributors may be used to endorse or promote products derived
     24       1.1  christos  *    from this software without specific prior written permission.
     25       1.1  christos  *
     26       1.1  christos  * Alternatively, this software may be distributed under the terms of the
     27       1.1  christos  * GNU General Public License ("GPL") version 2 as published by the Free
     28       1.1  christos  * Software Foundation.
     29       1.1  christos  *
     30       1.1  christos  * NO WARRANTY
     31       1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32       1.1  christos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33  1.1.1.19  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     34       1.1  christos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35       1.1  christos  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36       1.1  christos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37       1.1  christos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38       1.1  christos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39       1.1  christos  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40       1.1  christos  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41       1.1  christos  * POSSIBILITY OF SUCH DAMAGES.
     42       1.1  christos  */
     43       1.1  christos 
     44       1.1  christos #include "aslcompiler.h"
     45       1.1  christos 
     46       1.1  christos #define _COMPONENT          ACPI_COMPILER
     47       1.1  christos         ACPI_MODULE_NAME    ("aslmessages")
     48       1.1  christos 
     49       1.1  christos 
     50       1.1  christos /*
     51       1.1  christos  * Strings for message reporting levels, must match error
     52       1.1  christos  * type string tables in aslmessages.c
     53       1.1  christos  */
     54       1.1  christos const char              *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
     55       1.1  christos     "Optimize",
     56       1.1  christos     "Remark  ",
     57       1.1  christos     "Warning ",
     58       1.1  christos     "Warning ",
     59       1.1  christos     "Warning ",
     60       1.1  christos     "Error   "
     61       1.1  christos };
     62       1.1  christos 
     63       1.1  christos /* All lowercase versions for IDEs */
     64       1.1  christos 
     65       1.1  christos const char              *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
     66       1.1  christos     "optimize",
     67       1.1  christos     "remark  ",
     68       1.1  christos     "warning ",
     69       1.1  christos     "warning ",
     70       1.1  christos     "warning ",
     71       1.1  christos     "error   "
     72       1.1  christos };
     73       1.1  christos 
     74       1.1  christos 
     75       1.1  christos /*
     76       1.1  christos  * Actual message strings for each compiler message ID. There are currently
     77       1.1  christos  * three distinct blocks of error messages (so that they can be expanded
     78       1.1  christos  * individually):
     79       1.1  christos  *      Main ASL compiler
     80       1.1  christos  *      Data Table compiler
     81       1.1  christos  *      Preprocessor
     82       1.1  christos  *
     83       1.1  christos  * NOTE1: These tables must match the enum list of message IDs in the file
     84       1.1  christos  * aslmessages.h exactly.
     85       1.1  christos  *
     86       1.1  christos  * NOTE2: With the introduction of the -vw option to disable specific messages,
     87       1.1  christos  * new messages should only be added to the end of this list, so that values
     88  1.1.1.22  christos  * for existing messages are not disturbed. As important, obsolete messages
     89  1.1.1.22  christos  * cannot be removed from this list, as it will affect the -vw option.
     90       1.1  christos  */
     91       1.1  christos 
     92       1.1  christos /* ASL compiler */
     93       1.1  christos 
     94       1.1  christos const char                      *AslCompilerMsgs [] =
     95       1.1  christos {
     96       1.1  christos /*    The zeroth message is reserved */    "",
     97       1.1  christos /*    ASL_MSG_ALIGNMENT */                  "Must be a multiple of alignment/granularity value",
     98       1.1  christos /*    ASL_MSG_ALPHANUMERIC_STRING */        "String must be entirely alphanumeric",
     99       1.1  christos /*    ASL_MSG_AML_NOT_IMPLEMENTED */        "Opcode is not implemented in compiler AML code generator",
    100       1.1  christos /*    ASL_MSG_ARG_COUNT_HI */               "Too many arguments",
    101       1.1  christos /*    ASL_MSG_ARG_COUNT_LO */               "Too few arguments",
    102       1.1  christos /*    ASL_MSG_ARG_INIT */                   "Method argument is not initialized",
    103       1.1  christos /*    ASL_MSG_BACKWARDS_OFFSET */           "Invalid backwards offset",
    104       1.1  christos /*    ASL_MSG_BUFFER_LENGTH */              "Effective AML buffer length is zero",
    105       1.1  christos /*    ASL_MSG_CLOSE */                      "Could not close file",
    106       1.1  christos /*    ASL_MSG_COMPILER_INTERNAL */          "Internal compiler error",
    107       1.1  christos /*    ASL_MSG_COMPILER_RESERVED */          "Use of compiler reserved name",
    108       1.1  christos /*    ASL_MSG_CONNECTION_MISSING */         "A Connection operator is required for this field SpaceId",
    109       1.1  christos /*    ASL_MSG_CONNECTION_INVALID */         "Invalid OpRegion SpaceId for use of Connection operator",
    110       1.1  christos /*    ASL_MSG_CONSTANT_EVALUATION */        "Could not evaluate constant expression",
    111       1.1  christos /*    ASL_MSG_CONSTANT_FOLDED */            "Constant expression evaluated and reduced",
    112       1.1  christos /*    ASL_MSG_CORE_EXCEPTION */             "From ACPICA Subsystem",
    113       1.1  christos /*    ASL_MSG_DEBUG_FILE_OPEN */            "Could not open debug file",
    114       1.1  christos /*    ASL_MSG_DEBUG_FILENAME */             "Could not create debug filename",
    115       1.1  christos /*    ASL_MSG_DEPENDENT_NESTING */          "Dependent function macros cannot be nested",
    116       1.1  christos /*    ASL_MSG_DMA_CHANNEL */                "Invalid DMA channel (must be 0-7)",
    117       1.1  christos /*    ASL_MSG_DMA_LIST */                   "Too many DMA channels (8 max)",
    118       1.1  christos /*    ASL_MSG_DUPLICATE_CASE */             "Case value already specified",
    119       1.1  christos /*    ASL_MSG_DUPLICATE_ITEM */             "Duplicate value in list",
    120       1.1  christos /*    ASL_MSG_EARLY_EOF */                  "Premature end-of-file reached",
    121       1.1  christos /*    ASL_MSG_ENCODING_LENGTH */            "Package length too long to encode",
    122       1.1  christos /*    ASL_MSG_EX_INTERRUPT_LIST */          "Too many interrupts (255 max)",
    123       1.1  christos /*    ASL_MSG_EX_INTERRUPT_LIST_MIN */      "Too few interrupts (1 minimum required)",
    124       1.1  christos /*    ASL_MSG_EX_INTERRUPT_NUMBER */        "Invalid interrupt number (must be 32 bits)",
    125       1.1  christos /*    ASL_MSG_FIELD_ACCESS_WIDTH */         "Access width is greater than region size",
    126       1.1  christos /*    ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */    "Access width of Field Unit extends beyond region limit",
    127       1.1  christos /*    ASL_MSG_FIELD_UNIT_OFFSET */          "Field Unit extends beyond region limit",
    128       1.1  christos /*    ASL_MSG_GPE_NAME_CONFLICT */          "Name conflicts with a previous GPE method",
    129       1.1  christos /*    ASL_MSG_HID_LENGTH */                 "_HID string must be exactly 7 or 8 characters",
    130       1.1  christos /*    ASL_MSG_HID_PREFIX */                 "_HID prefix must be all uppercase or decimal digits",
    131       1.1  christos /*    ASL_MSG_HID_SUFFIX */                 "_HID suffix must be all hex digits",
    132       1.1  christos /*    ASL_MSG_INCLUDE_FILE_OPEN */          "Could not open include file",
    133       1.1  christos /*    ASL_MSG_INPUT_FILE_OPEN */            "Could not open input file",
    134   1.1.1.7  christos /*    ASL_MSG_INTEGER_LENGTH */             "Truncating 64-bit constant found in 32-bit table",
    135       1.1  christos /*    ASL_MSG_INTEGER_OPTIMIZATION */       "Integer optimized to single-byte AML opcode",
    136       1.1  christos /*    ASL_MSG_INTERRUPT_LIST */             "Too many interrupts (16 max)",
    137       1.1  christos /*    ASL_MSG_INTERRUPT_NUMBER */           "Invalid interrupt number (must be 0-15)",
    138       1.1  christos /*    ASL_MSG_INVALID_ACCESS_SIZE */        "Invalid AccessSize (Maximum is 4 - QWord access)",
    139       1.1  christos /*    ASL_MSG_INVALID_ADDR_FLAGS */         "Invalid combination of Length and Min/Max fixed flags",
    140       1.1  christos /*    ASL_MSG_INVALID_CONSTANT_OP */        "Invalid operator in constant expression (not type 3/4/5)",
    141       1.1  christos /*    ASL_MSG_INVALID_EISAID */             "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
    142       1.1  christos /*    ASL_MSG_INVALID_ESCAPE */             "Invalid or unknown escape sequence",
    143       1.1  christos /*    ASL_MSG_INVALID_GRAN_FIXED */         "Granularity must be zero for fixed Min/Max",
    144       1.1  christos /*    ASL_MSG_INVALID_GRANULARITY */        "Granularity must be zero or a power of two minus one",
    145       1.1  christos /*    ASL_MSG_INVALID_LENGTH */             "Length is larger than Min/Max window",
    146       1.1  christos /*    ASL_MSG_INVALID_LENGTH_FIXED */       "Length is not equal to fixed Min/Max window",
    147       1.1  christos /*    ASL_MSG_INVALID_MIN_MAX */            "Address Min is greater than Address Max",
    148       1.1  christos /*    ASL_MSG_INVALID_OPERAND */            "Invalid operand",
    149       1.1  christos /*    ASL_MSG_INVALID_PERFORMANCE */        "Invalid performance/robustness value",
    150       1.1  christos /*    ASL_MSG_INVALID_PRIORITY */           "Invalid priority value",
    151       1.1  christos /*    ASL_MSG_INVALID_STRING */             "Invalid Hex/Octal Escape - Non-ASCII or NULL",
    152       1.1  christos /*    ASL_MSG_INVALID_TARGET */             "Target operand not allowed in constant expression",
    153       1.1  christos /*    ASL_MSG_INVALID_TIME */               "Time parameter too long (255 max)",
    154       1.1  christos /*    ASL_MSG_INVALID_TYPE */               "Invalid type",
    155       1.1  christos /*    ASL_MSG_INVALID_UUID */               "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
    156       1.1  christos /*    ASL_MSG_ISA_ADDRESS */                "Maximum 10-bit ISA address (0x3FF)",
    157       1.1  christos /*    ASL_MSG_LEADING_ASTERISK */           "Invalid leading asterisk",
    158       1.1  christos /*    ASL_MSG_LIST_LENGTH_LONG */           "Initializer list longer than declared package length",
    159       1.1  christos /*    ASL_MSG_LIST_LENGTH_SHORT */          "Initializer list shorter than declared package length",
    160       1.1  christos /*    ASL_MSG_LISTING_FILE_OPEN */          "Could not open listing file",
    161       1.1  christos /*    ASL_MSG_LISTING_FILENAME */           "Could not create listing filename",
    162       1.1  christos /*    ASL_MSG_LOCAL_INIT */                 "Method local variable is not initialized",
    163       1.1  christos /*    ASL_MSG_LOCAL_OUTSIDE_METHOD */       "Local or Arg used outside a control method",
    164       1.1  christos /*    ASL_MSG_LONG_LINE */                  "Splitting long input line",
    165       1.1  christos /*    ASL_MSG_MEMORY_ALLOCATION */          "Memory allocation failure",
    166       1.1  christos /*    ASL_MSG_MISSING_ENDDEPENDENT */       "Missing EndDependentFn() macro in dependent resource list",
    167       1.1  christos /*    ASL_MSG_MISSING_STARTDEPENDENT */     "Missing StartDependentFn() macro in dependent resource list",
    168       1.1  christos /*    ASL_MSG_MULTIPLE_DEFAULT */           "More than one Default statement within Switch construct",
    169       1.1  christos /*    ASL_MSG_MULTIPLE_TYPES */             "Multiple types",
    170       1.1  christos /*    ASL_MSG_NAME_EXISTS */                "Name already exists in scope",
    171       1.1  christos /*    ASL_MSG_NAME_OPTIMIZATION */          "NamePath optimized",
    172       1.1  christos /*    ASL_MSG_NAMED_OBJECT_IN_WHILE */      "Creating a named object in a While loop",
    173       1.1  christos /*    ASL_MSG_NESTED_COMMENT */             "Nested comment found",
    174       1.1  christos /*    ASL_MSG_NO_CASES */                   "No Case statements under Switch",
    175       1.1  christos /*    ASL_MSG_NO_REGION */                  "_REG has no corresponding Operation Region",
    176       1.1  christos /*    ASL_MSG_NO_RETVAL */                  "Called method returns no value",
    177       1.1  christos /*    ASL_MSG_NO_WHILE */                   "No enclosing While statement",
    178       1.1  christos /*    ASL_MSG_NON_ASCII */                  "Invalid characters found in file",
    179  1.1.1.14  christos /*    ASL_MSG_BUFFER_FIELD_LENGTH */        "Field length must be non-zero",
    180       1.1  christos /*    ASL_MSG_NOT_EXIST */                  "Object does not exist",
    181  1.1.1.12  christos /*    ASL_MSG_NOT_FOUND */                  "Object not found or not accessible from current scope",
    182       1.1  christos /*    ASL_MSG_NOT_METHOD */                 "Not a control method, cannot invoke",
    183       1.1  christos /*    ASL_MSG_NOT_PARAMETER */              "Not a parameter, used as local only",
    184       1.1  christos /*    ASL_MSG_NOT_REACHABLE */              "Object is not accessible from this scope",
    185       1.1  christos /*    ASL_MSG_NOT_REFERENCED */             "Object is not referenced",
    186       1.1  christos /*    ASL_MSG_NULL_DESCRIPTOR */            "Min/Max/Length/Gran are all zero, but no resource tag",
    187       1.1  christos /*    ASL_MSG_NULL_STRING */                "Invalid zero-length (null) string",
    188       1.1  christos /*    ASL_MSG_OPEN */                       "Could not open file",
    189       1.1  christos /*    ASL_MSG_OUTPUT_FILE_OPEN */           "Could not open output AML file",
    190       1.1  christos /*    ASL_MSG_OUTPUT_FILENAME */            "Could not create output filename",
    191       1.1  christos /*    ASL_MSG_PACKAGE_LENGTH */             "Effective AML package length is zero",
    192       1.1  christos /*    ASL_MSG_PREPROCESSOR_FILENAME */      "Could not create preprocessor filename",
    193       1.1  christos /*    ASL_MSG_READ */                       "Could not read file",
    194       1.1  christos /*    ASL_MSG_RECURSION */                  "Recursive method call",
    195       1.1  christos /*    ASL_MSG_REGION_BUFFER_ACCESS */       "Host Operation Region requires BufferAcc access",
    196       1.1  christos /*    ASL_MSG_REGION_BYTE_ACCESS */         "Host Operation Region requires ByteAcc access",
    197       1.1  christos /*    ASL_MSG_RESERVED_ARG_COUNT_HI */      "Reserved method has too many arguments",
    198       1.1  christos /*    ASL_MSG_RESERVED_ARG_COUNT_LO */      "Reserved method has too few arguments",
    199       1.1  christos /*    ASL_MSG_RESERVED_METHOD */            "Reserved name must be a control method",
    200       1.1  christos /*    ASL_MSG_RESERVED_NO_RETURN_VAL */     "Reserved method should not return a value",
    201       1.1  christos /*    ASL_MSG_RESERVED_OPERAND_TYPE */      "Invalid object type for reserved name",
    202       1.1  christos /*    ASL_MSG_RESERVED_PACKAGE_LENGTH */    "Invalid package length for reserved name",
    203       1.1  christos /*    ASL_MSG_RESERVED_RETURN_VALUE */      "Reserved method must return a value",
    204       1.1  christos /*    ASL_MSG_RESERVED_USE */               "Invalid use of reserved name",
    205       1.1  christos /*    ASL_MSG_RESERVED_WORD */              "Use of reserved name",
    206       1.1  christos /*    ASL_MSG_RESOURCE_FIELD */             "Resource field name cannot be used as a target",
    207       1.1  christos /*    ASL_MSG_RESOURCE_INDEX */             "Missing ResourceSourceIndex (required)",
    208       1.1  christos /*    ASL_MSG_RESOURCE_LIST */              "Too many resource items (internal error)",
    209       1.1  christos /*    ASL_MSG_RESOURCE_SOURCE */            "Missing ResourceSource string (required)",
    210       1.1  christos /*    ASL_MSG_RESULT_NOT_USED */            "Result is not used, operator has no effect",
    211       1.1  christos /*    ASL_MSG_RETURN_TYPES */               "Not all control paths return a value",
    212       1.1  christos /*    ASL_MSG_SCOPE_FWD_REF */              "Forward references from Scope operator not allowed",
    213       1.1  christos /*    ASL_MSG_SCOPE_TYPE */                 "Existing object has invalid type for Scope operator",
    214       1.1  christos /*    ASL_MSG_SEEK */                       "Could not seek file",
    215       1.1  christos /*    ASL_MSG_SERIALIZED */                 "Control Method marked Serialized",
    216  1.1.1.16  christos /*    ASL_MSG_SERIALIZED_REQUIRED */        "Control Method should be made Serialized due to creation of named objects within",
    217       1.1  christos /*    ASL_MSG_SINGLE_NAME_OPTIMIZATION */   "NamePath optimized to NameSeg (uses run-time search path)",
    218       1.1  christos /*    ASL_MSG_SOME_NO_RETVAL */             "Called method may not always return a value",
    219       1.1  christos /*    ASL_MSG_STRING_LENGTH */              "String literal too long",
    220       1.1  christos /*    ASL_MSG_SWITCH_TYPE */                "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
    221       1.1  christos /*    ASL_MSG_SYNC_LEVEL */                 "SyncLevel must be in the range 0-15",
    222       1.1  christos /*    ASL_MSG_SYNTAX */                     "",
    223       1.1  christos /*    ASL_MSG_TABLE_SIGNATURE */            "Invalid Table Signature",
    224       1.1  christos /*    ASL_MSG_TAG_LARGER */                 "ResourceTag larger than Field",
    225       1.1  christos /*    ASL_MSG_TAG_SMALLER */                "ResourceTag smaller than Field",
    226       1.1  christos /*    ASL_MSG_TIMEOUT */                    "Result is not used, possible operator timeout will be missed",
    227       1.1  christos /*    ASL_MSG_TOO_MANY_TEMPS */             "Method requires too many temporary variables (_T_x)",
    228   1.1.1.5  christos /*    ASL_MSG_TRUNCATION */                 "64-bit return value will be truncated to 32 bits (DSDT or SSDT version < 2)",
    229       1.1  christos /*    ASL_MSG_UNKNOWN_RESERVED_NAME */      "Unknown reserved name",
    230       1.1  christos /*    ASL_MSG_UNREACHABLE_CODE */           "Statement is unreachable",
    231       1.1  christos /*    ASL_MSG_UNSUPPORTED */                "Unsupported feature",
    232       1.1  christos /*    ASL_MSG_UPPER_CASE */                 "Non-hex letters must be upper case",
    233       1.1  christos /*    ASL_MSG_VENDOR_LIST */                "Too many vendor data bytes (7 max)",
    234       1.1  christos /*    ASL_MSG_WRITE */                      "Could not write file",
    235       1.1  christos /*    ASL_MSG_RANGE */                      "Constant out of range",
    236       1.1  christos /*    ASL_MSG_BUFFER_ALLOCATION */          "Could not allocate line buffer",
    237       1.1  christos /*    ASL_MSG_MISSING_DEPENDENCY */         "Missing dependency",
    238  1.1.1.14  christos /*    ASL_MSG_ILLEGAL_FORWARD_REF */        "Illegal forward reference",
    239  1.1.1.10  christos /*    ASL_MSG_ILLEGAL_METHOD_REF */         "Object is declared in a different method",
    240   1.1.1.3  christos /*    ASL_MSG_LOCAL_NOT_USED */             "Method Local is set but never used",
    241   1.1.1.3  christos /*    ASL_MSG_ARG_AS_LOCAL_NOT_USED */      "Method Argument (as a local) is set but never used",
    242   1.1.1.4  christos /*    ASL_MSG_ARG_NOT_USED */               "Method Argument is never used",
    243   1.1.1.4  christos /*    ASL_MSG_CONSTANT_REQUIRED */          "Non-reducible expression",
    244   1.1.1.7  christos /*    ASL_MSG_CROSS_TABLE_SCOPE */          "Illegal open scope on external object from within DSDT",
    245   1.1.1.7  christos /*    ASL_MSG_EXCEPTION_NOT_RECEIVED */     "Expected remark, warning, or error did not occur. Message ID:",
    246   1.1.1.8  christos /*    ASL_MSG_NULL_RESOURCE_TEMPLATE */     "Empty Resource Template (END_TAG only)",
    247   1.1.1.8  christos /*    ASL_MSG_FOUND_HERE */                 "Original name creation/declaration below: ",
    248   1.1.1.9  christos /*    ASL_MSG_ILLEGAL_RECURSION */          "Illegal recursive call to method that creates named objects",
    249  1.1.1.13  christos /*    ASL_MSG_DUPLICATE_INPUT_FILE */       "Duplicate input files detected:",
    250  1.1.1.13  christos /*    ASL_MSG_WARNING_AS_ERROR */           "Warnings detected during compilation",
    251  1.1.1.10  christos /*    ASL_MSG_OEM_TABLE_ID */               "Invalid OEM Table ID",
    252  1.1.1.11  christos /*    ASL_MSG_OEM_ID */                     "Invalid OEM ID",
    253  1.1.1.12  christos /*    ASL_MSG_UNLOAD */                     "Unload is not supported by all operating systems",
    254  1.1.1.12  christos /*    ASL_MSG_OFFSET */                     "Unnecessary/redundant use of Offset operator",
    255  1.1.1.12  christos /*    ASL_MSG_LONG_SLEEP */                 "Very long Sleep, greater than 1 second",
    256  1.1.1.12  christos /*    ASL_MSG_PREFIX_NOT_EXIST */           "One or more prefix Scopes do not exist",
    257  1.1.1.13  christos /*    ASL_MSG_NAMEPATH_NOT_EXIST */         "One or more objects within the Pathname do not exist",
    258  1.1.1.13  christos /*    ASL_MSG_REGION_LENGTH */              "Operation Region declared with zero length",
    259  1.1.1.13  christos /*    ASL_MSG_TEMPORARY_OBJECT */           "Object is created temporarily in another method and cannot be accessed",
    260  1.1.1.14  christos /*    ASL_MSG_UNDEFINED_EXTERNAL */         "Named object was declared external but the actual definition does not exist",
    261  1.1.1.14  christos /*    ASL_MSG_BUFFER_FIELD_OVERFLOW */      "Buffer field extends beyond end of target buffer",
    262  1.1.1.14  christos /*    ASL_MSG_INVALID_SPECIAL_NAME */       "declaration of this named object outside root scope is illegal",
    263  1.1.1.14  christos /*    ASL_MSG_INVALID_PROCESSOR_UID */      "_UID inside processor declaration must be an integer",
    264  1.1.1.15  christos /*    ASL_MSG_LEGACY_PROCESSOR_OP */        "Legacy Processor() keyword detected. Use Device() keyword instead.",
    265  1.1.1.15  christos /*    ASL_MSG_NAMESTRING_LENGTH */          "NameString contains too many NameSegs (>255)",
    266  1.1.1.16  christos /*    ASL_MSG_CASE_FOUND_HERE */            "Original Case value below:",
    267  1.1.1.16  christos /*    ASL_MSG_EXTERN_INVALID_RET_TYPE */    "Return type is only allowed for Externals declared as MethodObj",
    268  1.1.1.16  christos /*    ASL_MSG_EXTERN_INVALID_PARAM_TYPE */  "Parameter type is only allowed for Externals declared as MethodObj",
    269  1.1.1.16  christos /*    ASL_MSG_NAMED_OBJECT_CREATION */      "Creation of named objects within a method is highly inefficient, use globals or method local variables instead",
    270  1.1.1.16  christos /*    ASL_MSG_ARG_COUNT_MISMATCH */         "Method NumArgs count does not match length of ParameterTypes list",
    271  1.1.1.16  christos /*    ASL_MSG_STATIC_OPREGION_IN_METHOD */  "Static OperationRegion should be declared outside control method",
    272  1.1.1.16  christos /*    ASL_MSG_DECLARATION_TYPE_MISMATCH */  "Type mismatch between external declaration and actual object declaration detected",
    273  1.1.1.16  christos /*    ASL_MSG_TYPE_MISMATCH_FOUND_HERE */   "Actual object declaration:",
    274  1.1.1.16  christos /*    ASL_MSG_DUPLICATE_EXTERN_MISMATCH */  "Type mismatch between multiple external declarations detected",
    275  1.1.1.16  christos /*    ASL_MSG_DUPLICATE_EXTERN_FOUND_HERE */"Duplicate external declaration:",
    276  1.1.1.17  christos /*    ASL_MSG_CONDREF_NEEDS_EXTERNAL_DECL */"CondRefOf parameter requires External() declaration",
    277  1.1.1.18  christos /*    ASL_MSG_EXTERNAL_FOUND_HERE */        "External declaration below ",
    278  1.1.1.18  christos /*    ASL_MSG_LOWER_CASE_NAMESEG */         "At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case",
    279  1.1.1.18  christos /*    ASL_MSG_LOWER_CASE_NAMEPATH */        "At least one lower case letter found in NamePath, ASL is case insensitive - converting to upper case",
    280  1.1.1.19  christos /*    ASL_MSG_UUID_NOT_FOUND */             "Unknown UUID string",
    281  1.1.1.19  christos /*    ASL_MSG_LEGACY_DDB_TYPE */            "DDBHandleObj has been deprecated along with the Unload operator. DDBHandlObj objects are only used in Unload"
    282       1.1  christos };
    283       1.1  christos 
    284       1.1  christos /* Table compiler */
    285       1.1  christos 
    286       1.1  christos const char                      *AslTableCompilerMsgs [] =
    287       1.1  christos {
    288       1.1  christos /*    ASL_MSG_BUFFER_ELEMENT */             "Invalid element in buffer initializer list",
    289       1.1  christos /*    ASL_MSG_DIVIDE_BY_ZERO */             "Expression contains divide-by-zero",
    290       1.1  christos /*    ASL_MSG_FLAG_VALUE */                 "Flag value is too large",
    291       1.1  christos /*    ASL_MSG_INTEGER_SIZE */               "Integer too large for target",
    292       1.1  christos /*    ASL_MSG_INVALID_EXPRESSION */         "Invalid expression",
    293       1.1  christos /*    ASL_MSG_INVALID_FIELD_NAME */         "Invalid Field Name",
    294       1.1  christos /*    ASL_MSG_INVALID_HEX_INTEGER */        "Invalid hex integer constant",
    295       1.1  christos /*    ASL_MSG_OEM_TABLE */                  "OEM table - unknown contents",
    296  1.1.1.20  christos /*    ASL_MSG_RESERVED_FIELD */             "Reserved field",
    297       1.1  christos /*    ASL_MSG_UNKNOWN_LABEL */              "Label is undefined",
    298       1.1  christos /*    ASL_MSG_UNKNOWN_SUBTABLE */           "Unknown subtable type",
    299       1.1  christos /*    ASL_MSG_UNKNOWN_TABLE */              "Unknown ACPI table signature",
    300  1.1.1.15  christos /*    ASL_MSG_ZERO_VALUE */                 "Value must be non-zero",
    301  1.1.1.15  christos /*    ASL_MSG_INVALID_LABEL */              "Invalid field label detected",
    302  1.1.1.15  christos /*    ASL_MSG_BUFFER_LIST */                "Invalid buffer initializer list",
    303  1.1.1.20  christos /*    ASL_MSG_ENTRY_LIST */                 "Invalid entry initializer list",
    304  1.1.1.20  christos /*    ASL_MSG_UNKNOWN_FORMAT */             "Unknown format value",
    305  1.1.1.20  christos /*    ASL_MSG_RESERVED_VALUE */             "Value for field is reserved or unknown",
    306  1.1.1.21  christos /*    ASL_MSG_TWO_ZERO_VALUES */            "32-bit DSDT Address and 64-bit X_DSDT Address cannot both be zero",
    307  1.1.1.21  christos /*    ASL_MSG_BAD_PARSE_TREE */             "Parse tree appears to be ill-defined"
    308       1.1  christos };
    309       1.1  christos 
    310       1.1  christos /* Preprocessor */
    311       1.1  christos 
    312       1.1  christos const char                      *AslPreprocessorMsgs [] =
    313       1.1  christos {
    314       1.1  christos /*    ASL_MSG_DIRECTIVE_SYNTAX */           "Invalid directive syntax",
    315       1.1  christos /*    ASL_MSG_ENDIF_MISMATCH */             "Mismatched #endif",
    316       1.1  christos /*    ASL_MSG_ERROR_DIRECTIVE */            "#error",
    317       1.1  christos /*    ASL_MSG_EXISTING_NAME */              "Name is already defined",
    318       1.1  christos /*    ASL_MSG_INVALID_INVOCATION */         "Invalid macro invocation",
    319       1.1  christos /*    ASL_MSG_MACRO_SYNTAX */               "Invalid macro syntax",
    320       1.1  christos /*    ASL_MSG_TOO_MANY_ARGUMENTS */         "Too many macro arguments",
    321       1.1  christos /*    ASL_MSG_UNKNOWN_DIRECTIVE */          "Unknown directive",
    322       1.1  christos /*    ASL_MSG_UNKNOWN_PRAGMA */             "Unknown pragma",
    323   1.1.1.3  christos /*    ASL_MSG_WARNING_DIRECTIVE */          "#warning",
    324   1.1.1.3  christos /*    ASL_MSG_INCLUDE_FILE */               "Found a # preprocessor directive in ASL Include() file"
    325       1.1  christos };
    326       1.1  christos 
    327       1.1  christos 
    328       1.1  christos /*******************************************************************************
    329       1.1  christos  *
    330       1.1  christos  * FUNCTION:    AeDecodeMessageId
    331       1.1  christos  *
    332       1.1  christos  * PARAMETERS:  MessageId               - ASL message ID (exception code) to be
    333       1.1  christos  *                                        formatted. Possibly fully encoded.
    334       1.1  christos  *
    335       1.1  christos  * RETURN:      A string containing the exception message text.
    336       1.1  christos  *
    337       1.1  christos  * DESCRIPTION: This function validates and translates an ASL message ID into
    338       1.1  christos  *              an ASCII string.
    339       1.1  christos  *
    340       1.1  christos  ******************************************************************************/
    341       1.1  christos 
    342       1.1  christos const char *
    343       1.1  christos AeDecodeMessageId (
    344       1.1  christos     UINT16                  MessageId)
    345       1.1  christos {
    346       1.1  christos     UINT32                  Index;
    347       1.1  christos     const char              **MessageTable;
    348       1.1  christos 
    349       1.1  christos 
    350       1.1  christos     /* Main ASL Compiler messages */
    351       1.1  christos 
    352       1.1  christos     if (MessageId <= ASL_MSG_MAIN_COMPILER_END)
    353       1.1  christos     {
    354       1.1  christos         MessageTable = AslCompilerMsgs;
    355       1.1  christos         Index = MessageId;
    356       1.1  christos 
    357       1.1  christos         if (Index >= ACPI_ARRAY_LENGTH (AslCompilerMsgs))
    358       1.1  christos         {
    359  1.1.1.18  christos             return ("[Unknown iASL Compiler exception ID]");
    360       1.1  christos         }
    361       1.1  christos     }
    362       1.1  christos 
    363       1.1  christos     /* Data Table Compiler messages */
    364       1.1  christos 
    365       1.1  christos     else if (MessageId <= ASL_MSG_TABLE_COMPILER_END)
    366       1.1  christos     {
    367       1.1  christos         MessageTable = AslTableCompilerMsgs;
    368       1.1  christos         Index = MessageId - ASL_MSG_TABLE_COMPILER;
    369       1.1  christos 
    370       1.1  christos         if (Index >= ACPI_ARRAY_LENGTH (AslTableCompilerMsgs))
    371       1.1  christos         {
    372  1.1.1.18  christos             return ("[Unknown iASL Table Compiler exception ID]");
    373       1.1  christos         }
    374       1.1  christos     }
    375       1.1  christos 
    376       1.1  christos     /* Preprocessor messages */
    377       1.1  christos 
    378       1.1  christos     else if (MessageId <= ASL_MSG_PREPROCESSOR_END)
    379       1.1  christos     {
    380       1.1  christos         MessageTable = AslPreprocessorMsgs;
    381       1.1  christos         Index = MessageId - ASL_MSG_PREPROCESSOR;
    382       1.1  christos 
    383       1.1  christos         if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs))
    384       1.1  christos         {
    385  1.1.1.18  christos             return ("[Unknown iASL Preprocessor exception ID]");
    386       1.1  christos         }
    387       1.1  christos     }
    388       1.1  christos 
    389       1.1  christos     /* Everything else is unknown */
    390       1.1  christos 
    391       1.1  christos     else
    392       1.1  christos     {
    393  1.1.1.18  christos         return ("[Unknown iASL exception ID]");
    394       1.1  christos     }
    395       1.1  christos 
    396       1.1  christos     return (MessageTable[Index]);
    397       1.1  christos }
    398       1.1  christos 
    399       1.1  christos 
    400       1.1  christos /*******************************************************************************
    401       1.1  christos  *
    402       1.1  christos  * FUNCTION:    AeDecodeExceptionLevel
    403       1.1  christos  *
    404       1.1  christos  * PARAMETERS:  Level               - The ASL error level to be decoded
    405       1.1  christos  *
    406       1.1  christos  * RETURN:      A string containing the error level text
    407       1.1  christos  *
    408       1.1  christos  * DESCRIPTION: This function validates and translates an ASL error level into
    409       1.1  christos  *              an ASCII string.
    410       1.1  christos  *
    411       1.1  christos  ******************************************************************************/
    412       1.1  christos 
    413       1.1  christos const char *
    414       1.1  christos AeDecodeExceptionLevel (
    415       1.1  christos     UINT8                   Level)
    416       1.1  christos {
    417       1.1  christos     /* Range check on Level */
    418       1.1  christos 
    419       1.1  christos     if (Level >= ACPI_ARRAY_LENGTH (AslErrorLevel))
    420       1.1  christos     {
    421       1.1  christos         return ("Unknown exception level");
    422       1.1  christos     }
    423       1.1  christos 
    424       1.1  christos     /* Differentiate the string type to be used (IDE is all lower case) */
    425       1.1  christos 
    426  1.1.1.12  christos     if (AslGbl_VerboseErrors)
    427       1.1  christos     {
    428       1.1  christos         return (AslErrorLevel[Level]);
    429       1.1  christos     }
    430       1.1  christos 
    431       1.1  christos     return (AslErrorLevelIde[Level]);
    432       1.1  christos }
    433       1.1  christos 
    434       1.1  christos 
    435       1.1  christos /*******************************************************************************
    436       1.1  christos  *
    437       1.1  christos  * FUNCTION:    AeBuildFullExceptionCode
    438       1.1  christos  *
    439       1.1  christos  * PARAMETERS:  Level               - ASL error level
    440       1.1  christos  *              MessageId           - ASL exception code to be formatted
    441       1.1  christos  *
    442       1.1  christos  * RETURN:      Fully encoded exception code
    443       1.1  christos  *
    444       1.1  christos  * DESCRIPTION: Build the full exception code from the error level and the
    445       1.1  christos  *              actual message ID.
    446       1.1  christos  *
    447       1.1  christos  ******************************************************************************/
    448       1.1  christos 
    449       1.1  christos UINT16
    450       1.1  christos AeBuildFullExceptionCode (
    451       1.1  christos     UINT8                   Level,
    452       1.1  christos     UINT16                  MessageId)
    453       1.1  christos {
    454       1.1  christos 
    455       1.1  christos     /*
    456       1.1  christos      * Error level is in the thousands slot (error/warning/remark, etc.)
    457       1.1  christos      * Error codes are 0 - 999
    458       1.1  christos      */
    459       1.1  christos     return (((Level + 1) * 1000) + MessageId);
    460       1.1  christos }
    461  1.1.1.18  christos 
    462  1.1.1.18  christos 
    463  1.1.1.18  christos #ifdef ACPI_HELP_APP
    464  1.1.1.18  christos /*******************************************************************************
    465  1.1.1.18  christos  *
    466  1.1.1.18  christos  * FUNCTION:    AhDecodeAslException
    467  1.1.1.18  christos  *
    468  1.1.1.18  christos  * PARAMETERS:  HexString           - iASL status string from command line, in
    469  1.1.1.18  christos  *                                    hex. If null, display all exceptions.
    470  1.1.1.18  christos  *
    471  1.1.1.18  christos  * RETURN:      None
    472  1.1.1.18  christos  *
    473  1.1.1.18  christos  * DESCRIPTION: Decode and display an iASL exception code. Note1: a
    474  1.1.1.18  christos  * NULL string for HexString displays all known iASL exceptions. Note2:
    475  1.1.1.18  christos  * implements the -x option for AcpiHelp.
    476  1.1.1.18  christos  *
    477  1.1.1.18  christos  ******************************************************************************/
    478  1.1.1.18  christos 
    479  1.1.1.18  christos #define AH_DISPLAY_ASL_EXCEPTION_TEXT(Status, Exception) \
    480  1.1.1.18  christos     printf ("%.4X: %s\n", Status, Exception)
    481  1.1.1.18  christos 
    482  1.1.1.18  christos #define AH_DISPLAY_EXCEPTION(Status, Name) \
    483  1.1.1.18  christos     printf ("%.4X: %s\n", Status, Name)
    484  1.1.1.18  christos 
    485  1.1.1.18  christos 
    486  1.1.1.18  christos void
    487  1.1.1.18  christos AhDecodeAslException (
    488  1.1.1.18  christos     char                    *HexString)
    489  1.1.1.18  christos {
    490  1.1.1.18  christos     UINT32                  i;
    491  1.1.1.18  christos     UINT32                  MessageId;
    492  1.1.1.18  christos     const char              *OneException;
    493  1.1.1.18  christos     UINT32                  Index = 1;
    494  1.1.1.18  christos 
    495  1.1.1.18  christos 
    496  1.1.1.18  christos     /*
    497  1.1.1.18  christos      * A null input string means to decode and display all known
    498  1.1.1.18  christos      * exception codes.
    499  1.1.1.18  christos      */
    500  1.1.1.18  christos     if (!HexString)
    501  1.1.1.18  christos     {
    502  1.1.1.18  christos         printf ("All defined iASL exception codes:\n\n");
    503  1.1.1.18  christos         printf ("Main iASL exceptions:\n\n");
    504  1.1.1.18  christos         AH_DISPLAY_EXCEPTION (0,
    505  1.1.1.18  christos             "AE_OK                        (No error occurred)");
    506  1.1.1.18  christos 
    507  1.1.1.18  christos         /* Display codes in each block of exception types */
    508  1.1.1.18  christos 
    509  1.1.1.18  christos         for (i = 1; Index < ACPI_ARRAY_LENGTH (AslCompilerMsgs); i++, Index++)
    510  1.1.1.18  christos         {
    511  1.1.1.18  christos             AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslCompilerMsgs[i]);
    512  1.1.1.18  christos         }
    513  1.1.1.18  christos 
    514  1.1.1.18  christos         printf ("\niASL Table Compiler exceptions:\n\n");
    515  1.1.1.18  christos         Index = ASL_MSG_TABLE_COMPILER;
    516  1.1.1.18  christos         for (i = 0; i < ACPI_ARRAY_LENGTH (AslTableCompilerMsgs); i++, Index++)
    517  1.1.1.18  christos         {
    518  1.1.1.18  christos             AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslTableCompilerMsgs[i]);
    519  1.1.1.18  christos         }
    520  1.1.1.18  christos 
    521  1.1.1.18  christos         printf ("\niASL Preprocessor exceptions:\n\n");
    522  1.1.1.18  christos         Index = ASL_MSG_PREPROCESSOR;
    523  1.1.1.18  christos         for (i = 0; i < ACPI_ARRAY_LENGTH (AslPreprocessorMsgs); i++, Index++)
    524  1.1.1.18  christos         {
    525  1.1.1.18  christos             AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslPreprocessorMsgs[i]);
    526  1.1.1.18  christos         }
    527  1.1.1.18  christos         return;
    528  1.1.1.18  christos     }
    529  1.1.1.18  christos 
    530  1.1.1.18  christos     /* HexString is valid - convert it to a MessageId and decode it */
    531  1.1.1.18  christos 
    532  1.1.1.18  christos     MessageId = strtol (HexString, NULL, 16);
    533  1.1.1.18  christos     OneException = AeDecodeMessageId ((UINT16) MessageId);
    534  1.1.1.18  christos     AH_DISPLAY_ASL_EXCEPTION_TEXT (MessageId, OneException);
    535  1.1.1.18  christos }
    536  1.1.1.18  christos #endif
    537