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