xref: /freebsd/sys/contrib/dev/acpica/compiler/aslmessages.c (revision 313a0c13efa638cf248e35eed49f36ec0a1a7f26)
1*313a0c13SJung-uk Kim /******************************************************************************
2*313a0c13SJung-uk Kim  *
3*313a0c13SJung-uk Kim  * Module Name: aslmessages.c - Compiler error/warning message strings
4*313a0c13SJung-uk Kim  *
5*313a0c13SJung-uk Kim  *****************************************************************************/
6*313a0c13SJung-uk Kim 
7*313a0c13SJung-uk Kim /*
8*313a0c13SJung-uk Kim  * Copyright (C) 2000 - 2014, Intel Corp.
9*313a0c13SJung-uk Kim  * All rights reserved.
10*313a0c13SJung-uk Kim  *
11*313a0c13SJung-uk Kim  * Redistribution and use in source and binary forms, with or without
12*313a0c13SJung-uk Kim  * modification, are permitted provided that the following conditions
13*313a0c13SJung-uk Kim  * are met:
14*313a0c13SJung-uk Kim  * 1. Redistributions of source code must retain the above copyright
15*313a0c13SJung-uk Kim  *    notice, this list of conditions, and the following disclaimer,
16*313a0c13SJung-uk Kim  *    without modification.
17*313a0c13SJung-uk Kim  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18*313a0c13SJung-uk Kim  *    substantially similar to the "NO WARRANTY" disclaimer below
19*313a0c13SJung-uk Kim  *    ("Disclaimer") and any redistribution must be conditioned upon
20*313a0c13SJung-uk Kim  *    including a substantially similar Disclaimer requirement for further
21*313a0c13SJung-uk Kim  *    binary redistribution.
22*313a0c13SJung-uk Kim  * 3. Neither the names of the above-listed copyright holders nor the names
23*313a0c13SJung-uk Kim  *    of any contributors may be used to endorse or promote products derived
24*313a0c13SJung-uk Kim  *    from this software without specific prior written permission.
25*313a0c13SJung-uk Kim  *
26*313a0c13SJung-uk Kim  * Alternatively, this software may be distributed under the terms of the
27*313a0c13SJung-uk Kim  * GNU General Public License ("GPL") version 2 as published by the Free
28*313a0c13SJung-uk Kim  * Software Foundation.
29*313a0c13SJung-uk Kim  *
30*313a0c13SJung-uk Kim  * NO WARRANTY
31*313a0c13SJung-uk Kim  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32*313a0c13SJung-uk Kim  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33*313a0c13SJung-uk Kim  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34*313a0c13SJung-uk Kim  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35*313a0c13SJung-uk Kim  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36*313a0c13SJung-uk Kim  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37*313a0c13SJung-uk Kim  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38*313a0c13SJung-uk Kim  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39*313a0c13SJung-uk Kim  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40*313a0c13SJung-uk Kim  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41*313a0c13SJung-uk Kim  * POSSIBILITY OF SUCH DAMAGES.
42*313a0c13SJung-uk Kim  */
43*313a0c13SJung-uk Kim 
44*313a0c13SJung-uk Kim #include <contrib/dev/acpica/compiler/aslcompiler.h>
45*313a0c13SJung-uk Kim 
46*313a0c13SJung-uk Kim #define _COMPONENT          ACPI_COMPILER
47*313a0c13SJung-uk Kim         ACPI_MODULE_NAME    ("aslmessages")
48*313a0c13SJung-uk Kim 
49*313a0c13SJung-uk Kim 
50*313a0c13SJung-uk Kim /*
51*313a0c13SJung-uk Kim  * Strings for message reporting levels, must match error
52*313a0c13SJung-uk Kim  * type string tables in aslmessages.c
53*313a0c13SJung-uk Kim  */
54*313a0c13SJung-uk Kim const char              *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
55*313a0c13SJung-uk Kim     "Optimize",
56*313a0c13SJung-uk Kim     "Remark  ",
57*313a0c13SJung-uk Kim     "Warning ",
58*313a0c13SJung-uk Kim     "Warning ",
59*313a0c13SJung-uk Kim     "Warning ",
60*313a0c13SJung-uk Kim     "Error   "
61*313a0c13SJung-uk Kim };
62*313a0c13SJung-uk Kim 
63*313a0c13SJung-uk Kim /* All lowercase versions for IDEs */
64*313a0c13SJung-uk Kim 
65*313a0c13SJung-uk Kim const char              *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
66*313a0c13SJung-uk Kim     "optimize",
67*313a0c13SJung-uk Kim     "remark  ",
68*313a0c13SJung-uk Kim     "warning ",
69*313a0c13SJung-uk Kim     "warning ",
70*313a0c13SJung-uk Kim     "warning ",
71*313a0c13SJung-uk Kim     "error   "
72*313a0c13SJung-uk Kim };
73*313a0c13SJung-uk Kim 
74*313a0c13SJung-uk Kim 
75*313a0c13SJung-uk Kim /*
76*313a0c13SJung-uk Kim  * Actual message strings for each compiler message ID. There are currently
77*313a0c13SJung-uk Kim  * three distinct blocks of error messages (so that they can be expanded
78*313a0c13SJung-uk Kim  * individually):
79*313a0c13SJung-uk Kim  *      Main ASL compiler
80*313a0c13SJung-uk Kim  *      Data Table compiler
81*313a0c13SJung-uk Kim  *      Preprocessor
82*313a0c13SJung-uk Kim  *
83*313a0c13SJung-uk Kim  * NOTE1: These tables must match the enum list of message IDs in the file
84*313a0c13SJung-uk Kim  * aslmessages.h exactly.
85*313a0c13SJung-uk Kim  *
86*313a0c13SJung-uk Kim  * NOTE2: With the introduction of the -vw option to disable specific messages,
87*313a0c13SJung-uk Kim  * new messages should only be added to the end of this list, so that values
88*313a0c13SJung-uk Kim  * for existing messages are not disturbed.
89*313a0c13SJung-uk Kim  */
90*313a0c13SJung-uk Kim 
91*313a0c13SJung-uk Kim /* ASL compiler */
92*313a0c13SJung-uk Kim 
93*313a0c13SJung-uk Kim const char                      *AslCompilerMsgs [] =
94*313a0c13SJung-uk Kim {
95*313a0c13SJung-uk Kim /*    The zeroth message is reserved */    "",
96*313a0c13SJung-uk Kim /*    ASL_MSG_ALIGNMENT */                  "Must be a multiple of alignment/granularity value",
97*313a0c13SJung-uk Kim /*    ASL_MSG_ALPHANUMERIC_STRING */        "String must be entirely alphanumeric",
98*313a0c13SJung-uk Kim /*    ASL_MSG_AML_NOT_IMPLEMENTED */        "Opcode is not implemented in compiler AML code generator",
99*313a0c13SJung-uk Kim /*    ASL_MSG_ARG_COUNT_HI */               "Too many arguments",
100*313a0c13SJung-uk Kim /*    ASL_MSG_ARG_COUNT_LO */               "Too few arguments",
101*313a0c13SJung-uk Kim /*    ASL_MSG_ARG_INIT */                   "Method argument is not initialized",
102*313a0c13SJung-uk Kim /*    ASL_MSG_BACKWARDS_OFFSET */           "Invalid backwards offset",
103*313a0c13SJung-uk Kim /*    ASL_MSG_BUFFER_LENGTH */              "Effective AML buffer length is zero",
104*313a0c13SJung-uk Kim /*    ASL_MSG_CLOSE */                      "Could not close file",
105*313a0c13SJung-uk Kim /*    ASL_MSG_COMPILER_INTERNAL */          "Internal compiler error",
106*313a0c13SJung-uk Kim /*    ASL_MSG_COMPILER_RESERVED */          "Use of compiler reserved name",
107*313a0c13SJung-uk Kim /*    ASL_MSG_CONNECTION_MISSING */         "A Connection operator is required for this field SpaceId",
108*313a0c13SJung-uk Kim /*    ASL_MSG_CONNECTION_INVALID */         "Invalid OpRegion SpaceId for use of Connection operator",
109*313a0c13SJung-uk Kim /*    ASL_MSG_CONSTANT_EVALUATION */        "Could not evaluate constant expression",
110*313a0c13SJung-uk Kim /*    ASL_MSG_CONSTANT_FOLDED */            "Constant expression evaluated and reduced",
111*313a0c13SJung-uk Kim /*    ASL_MSG_CORE_EXCEPTION */             "From ACPICA Subsystem",
112*313a0c13SJung-uk Kim /*    ASL_MSG_DEBUG_FILE_OPEN */            "Could not open debug file",
113*313a0c13SJung-uk Kim /*    ASL_MSG_DEBUG_FILENAME */             "Could not create debug filename",
114*313a0c13SJung-uk Kim /*    ASL_MSG_DEPENDENT_NESTING */          "Dependent function macros cannot be nested",
115*313a0c13SJung-uk Kim /*    ASL_MSG_DMA_CHANNEL */                "Invalid DMA channel (must be 0-7)",
116*313a0c13SJung-uk Kim /*    ASL_MSG_DMA_LIST */                   "Too many DMA channels (8 max)",
117*313a0c13SJung-uk Kim /*    ASL_MSG_DUPLICATE_CASE */             "Case value already specified",
118*313a0c13SJung-uk Kim /*    ASL_MSG_DUPLICATE_ITEM */             "Duplicate value in list",
119*313a0c13SJung-uk Kim /*    ASL_MSG_EARLY_EOF */                  "Premature end-of-file reached",
120*313a0c13SJung-uk Kim /*    ASL_MSG_ENCODING_LENGTH */            "Package length too long to encode",
121*313a0c13SJung-uk Kim /*    ASL_MSG_EX_INTERRUPT_LIST */          "Too many interrupts (255 max)",
122*313a0c13SJung-uk Kim /*    ASL_MSG_EX_INTERRUPT_LIST_MIN */      "Too few interrupts (1 minimum required)",
123*313a0c13SJung-uk Kim /*    ASL_MSG_EX_INTERRUPT_NUMBER */        "Invalid interrupt number (must be 32 bits)",
124*313a0c13SJung-uk Kim /*    ASL_MSG_FIELD_ACCESS_WIDTH */         "Access width is greater than region size",
125*313a0c13SJung-uk Kim /*    ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */    "Access width of Field Unit extends beyond region limit",
126*313a0c13SJung-uk Kim /*    ASL_MSG_FIELD_UNIT_OFFSET */          "Field Unit extends beyond region limit",
127*313a0c13SJung-uk Kim /*    ASL_MSG_GPE_NAME_CONFLICT */          "Name conflicts with a previous GPE method",
128*313a0c13SJung-uk Kim /*    ASL_MSG_HID_LENGTH */                 "_HID string must be exactly 7 or 8 characters",
129*313a0c13SJung-uk Kim /*    ASL_MSG_HID_PREFIX */                 "_HID prefix must be all uppercase or decimal digits",
130*313a0c13SJung-uk Kim /*    ASL_MSG_HID_SUFFIX */                 "_HID suffix must be all hex digits",
131*313a0c13SJung-uk Kim /*    ASL_MSG_INCLUDE_FILE_OPEN */          "Could not open include file",
132*313a0c13SJung-uk Kim /*    ASL_MSG_INPUT_FILE_OPEN */            "Could not open input file",
133*313a0c13SJung-uk Kim /*    ASL_MSG_INTEGER_LENGTH */             "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
134*313a0c13SJung-uk Kim /*    ASL_MSG_INTEGER_OPTIMIZATION */       "Integer optimized to single-byte AML opcode",
135*313a0c13SJung-uk Kim /*    ASL_MSG_INTERRUPT_LIST */             "Too many interrupts (16 max)",
136*313a0c13SJung-uk Kim /*    ASL_MSG_INTERRUPT_NUMBER */           "Invalid interrupt number (must be 0-15)",
137*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_ACCESS_SIZE */        "Invalid AccessSize (Maximum is 4 - QWord access)",
138*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_ADDR_FLAGS */         "Invalid combination of Length and Min/Max fixed flags",
139*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_CONSTANT_OP */        "Invalid operator in constant expression (not type 3/4/5)",
140*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_EISAID */             "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
141*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_ESCAPE */             "Invalid or unknown escape sequence",
142*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_GRAN_FIXED */         "Granularity must be zero for fixed Min/Max",
143*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_GRANULARITY */        "Granularity must be zero or a power of two minus one",
144*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_LENGTH */             "Length is larger than Min/Max window",
145*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_LENGTH_FIXED */       "Length is not equal to fixed Min/Max window",
146*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_MIN_MAX */            "Address Min is greater than Address Max",
147*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_OPERAND */            "Invalid operand",
148*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_PERFORMANCE */        "Invalid performance/robustness value",
149*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_PRIORITY */           "Invalid priority value",
150*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_STRING */             "Invalid Hex/Octal Escape - Non-ASCII or NULL",
151*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_TARGET */             "Target operand not allowed in constant expression",
152*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_TIME */               "Time parameter too long (255 max)",
153*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_TYPE */               "Invalid type",
154*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_UUID */               "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
155*313a0c13SJung-uk Kim /*    ASL_MSG_ISA_ADDRESS */                "Maximum 10-bit ISA address (0x3FF)",
156*313a0c13SJung-uk Kim /*    ASL_MSG_LEADING_ASTERISK */           "Invalid leading asterisk",
157*313a0c13SJung-uk Kim /*    ASL_MSG_LIST_LENGTH_LONG */           "Initializer list longer than declared package length",
158*313a0c13SJung-uk Kim /*    ASL_MSG_LIST_LENGTH_SHORT */          "Initializer list shorter than declared package length",
159*313a0c13SJung-uk Kim /*    ASL_MSG_LISTING_FILE_OPEN */          "Could not open listing file",
160*313a0c13SJung-uk Kim /*    ASL_MSG_LISTING_FILENAME */           "Could not create listing filename",
161*313a0c13SJung-uk Kim /*    ASL_MSG_LOCAL_INIT */                 "Method local variable is not initialized",
162*313a0c13SJung-uk Kim /*    ASL_MSG_LOCAL_OUTSIDE_METHOD */       "Local or Arg used outside a control method",
163*313a0c13SJung-uk Kim /*    ASL_MSG_LONG_LINE */                  "Splitting long input line",
164*313a0c13SJung-uk Kim /*    ASL_MSG_MEMORY_ALLOCATION */          "Memory allocation failure",
165*313a0c13SJung-uk Kim /*    ASL_MSG_MISSING_ENDDEPENDENT */       "Missing EndDependentFn() macro in dependent resource list",
166*313a0c13SJung-uk Kim /*    ASL_MSG_MISSING_STARTDEPENDENT */     "Missing StartDependentFn() macro in dependent resource list",
167*313a0c13SJung-uk Kim /*    ASL_MSG_MULTIPLE_DEFAULT */           "More than one Default statement within Switch construct",
168*313a0c13SJung-uk Kim /*    ASL_MSG_MULTIPLE_TYPES */             "Multiple types",
169*313a0c13SJung-uk Kim /*    ASL_MSG_NAME_EXISTS */                "Name already exists in scope",
170*313a0c13SJung-uk Kim /*    ASL_MSG_NAME_OPTIMIZATION */          "NamePath optimized",
171*313a0c13SJung-uk Kim /*    ASL_MSG_NAMED_OBJECT_IN_WHILE */      "Creating a named object in a While loop",
172*313a0c13SJung-uk Kim /*    ASL_MSG_NESTED_COMMENT */             "Nested comment found",
173*313a0c13SJung-uk Kim /*    ASL_MSG_NO_CASES */                   "No Case statements under Switch",
174*313a0c13SJung-uk Kim /*    ASL_MSG_NO_REGION */                  "_REG has no corresponding Operation Region",
175*313a0c13SJung-uk Kim /*    ASL_MSG_NO_RETVAL */                  "Called method returns no value",
176*313a0c13SJung-uk Kim /*    ASL_MSG_NO_WHILE */                   "No enclosing While statement",
177*313a0c13SJung-uk Kim /*    ASL_MSG_NON_ASCII */                  "Invalid characters found in file",
178*313a0c13SJung-uk Kim /*    ASL_MSG_NON_ZERO */                   "Operand evaluates to zero",
179*313a0c13SJung-uk Kim /*    ASL_MSG_NOT_EXIST */                  "Object does not exist",
180*313a0c13SJung-uk Kim /*    ASL_MSG_NOT_FOUND */                  "Object not found or not accessible from scope",
181*313a0c13SJung-uk Kim /*    ASL_MSG_NOT_METHOD */                 "Not a control method, cannot invoke",
182*313a0c13SJung-uk Kim /*    ASL_MSG_NOT_PARAMETER */              "Not a parameter, used as local only",
183*313a0c13SJung-uk Kim /*    ASL_MSG_NOT_REACHABLE */              "Object is not accessible from this scope",
184*313a0c13SJung-uk Kim /*    ASL_MSG_NOT_REFERENCED */             "Object is not referenced",
185*313a0c13SJung-uk Kim /*    ASL_MSG_NULL_DESCRIPTOR */            "Min/Max/Length/Gran are all zero, but no resource tag",
186*313a0c13SJung-uk Kim /*    ASL_MSG_NULL_STRING */                "Invalid zero-length (null) string",
187*313a0c13SJung-uk Kim /*    ASL_MSG_OPEN */                       "Could not open file",
188*313a0c13SJung-uk Kim /*    ASL_MSG_OUTPUT_FILE_OPEN */           "Could not open output AML file",
189*313a0c13SJung-uk Kim /*    ASL_MSG_OUTPUT_FILENAME */            "Could not create output filename",
190*313a0c13SJung-uk Kim /*    ASL_MSG_PACKAGE_LENGTH */             "Effective AML package length is zero",
191*313a0c13SJung-uk Kim /*    ASL_MSG_PREPROCESSOR_FILENAME */      "Could not create preprocessor filename",
192*313a0c13SJung-uk Kim /*    ASL_MSG_READ */                       "Could not read file",
193*313a0c13SJung-uk Kim /*    ASL_MSG_RECURSION */                  "Recursive method call",
194*313a0c13SJung-uk Kim /*    ASL_MSG_REGION_BUFFER_ACCESS */       "Host Operation Region requires BufferAcc access",
195*313a0c13SJung-uk Kim /*    ASL_MSG_REGION_BYTE_ACCESS */         "Host Operation Region requires ByteAcc access",
196*313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_ARG_COUNT_HI */      "Reserved method has too many arguments",
197*313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_ARG_COUNT_LO */      "Reserved method has too few arguments",
198*313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_METHOD */            "Reserved name must be a control method",
199*313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_NO_RETURN_VAL */     "Reserved method should not return a value",
200*313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_OPERAND_TYPE */      "Invalid object type for reserved name",
201*313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_PACKAGE_LENGTH */    "Invalid package length for reserved name",
202*313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_RETURN_VALUE */      "Reserved method must return a value",
203*313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_USE */               "Invalid use of reserved name",
204*313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_WORD */              "Use of reserved name",
205*313a0c13SJung-uk Kim /*    ASL_MSG_RESOURCE_FIELD */             "Resource field name cannot be used as a target",
206*313a0c13SJung-uk Kim /*    ASL_MSG_RESOURCE_INDEX */             "Missing ResourceSourceIndex (required)",
207*313a0c13SJung-uk Kim /*    ASL_MSG_RESOURCE_LIST */              "Too many resource items (internal error)",
208*313a0c13SJung-uk Kim /*    ASL_MSG_RESOURCE_SOURCE */            "Missing ResourceSource string (required)",
209*313a0c13SJung-uk Kim /*    ASL_MSG_RESULT_NOT_USED */            "Result is not used, operator has no effect",
210*313a0c13SJung-uk Kim /*    ASL_MSG_RETURN_TYPES */               "Not all control paths return a value",
211*313a0c13SJung-uk Kim /*    ASL_MSG_SCOPE_FWD_REF */              "Forward references from Scope operator not allowed",
212*313a0c13SJung-uk Kim /*    ASL_MSG_SCOPE_TYPE */                 "Existing object has invalid type for Scope operator",
213*313a0c13SJung-uk Kim /*    ASL_MSG_SEEK */                       "Could not seek file",
214*313a0c13SJung-uk Kim /*    ASL_MSG_SERIALIZED */                 "Control Method marked Serialized",
215*313a0c13SJung-uk Kim /*    ASL_MSG_SERIALIZED_REQUIRED */        "Control Method should be made Serialized",
216*313a0c13SJung-uk Kim /*    ASL_MSG_SINGLE_NAME_OPTIMIZATION */   "NamePath optimized to NameSeg (uses run-time search path)",
217*313a0c13SJung-uk Kim /*    ASL_MSG_SOME_NO_RETVAL */             "Called method may not always return a value",
218*313a0c13SJung-uk Kim /*    ASL_MSG_STRING_LENGTH */              "String literal too long",
219*313a0c13SJung-uk Kim /*    ASL_MSG_SWITCH_TYPE */                "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
220*313a0c13SJung-uk Kim /*    ASL_MSG_SYNC_LEVEL */                 "SyncLevel must be in the range 0-15",
221*313a0c13SJung-uk Kim /*    ASL_MSG_SYNTAX */                     "",
222*313a0c13SJung-uk Kim /*    ASL_MSG_TABLE_SIGNATURE */            "Invalid Table Signature",
223*313a0c13SJung-uk Kim /*    ASL_MSG_TAG_LARGER */                 "ResourceTag larger than Field",
224*313a0c13SJung-uk Kim /*    ASL_MSG_TAG_SMALLER */                "ResourceTag smaller than Field",
225*313a0c13SJung-uk Kim /*    ASL_MSG_TIMEOUT */                    "Result is not used, possible operator timeout will be missed",
226*313a0c13SJung-uk Kim /*    ASL_MSG_TOO_MANY_TEMPS */             "Method requires too many temporary variables (_T_x)",
227*313a0c13SJung-uk Kim /*    ASL_MSG_TRUNCATION */                 "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
228*313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_RESERVED_NAME */      "Unknown reserved name",
229*313a0c13SJung-uk Kim /*    ASL_MSG_UNREACHABLE_CODE */           "Statement is unreachable",
230*313a0c13SJung-uk Kim /*    ASL_MSG_UNSUPPORTED */                "Unsupported feature",
231*313a0c13SJung-uk Kim /*    ASL_MSG_UPPER_CASE */                 "Non-hex letters must be upper case",
232*313a0c13SJung-uk Kim /*    ASL_MSG_VENDOR_LIST */                "Too many vendor data bytes (7 max)",
233*313a0c13SJung-uk Kim /*    ASL_MSG_WRITE */                      "Could not write file",
234*313a0c13SJung-uk Kim /*    ASL_MSG_RANGE */                      "Constant out of range",
235*313a0c13SJung-uk Kim /*    ASL_MSG_BUFFER_ALLOCATION */          "Could not allocate line buffer",
236*313a0c13SJung-uk Kim /*    ASL_MSG_MISSING_DEPENDENCY */         "Missing dependency",
237*313a0c13SJung-uk Kim /*    ASL_MSG_ILLEGAL_FORWARD_REF */        "Illegal forward reference within a method",
238*313a0c13SJung-uk Kim /*    ASL_MSG_ILLEGAL_METHOD_REF */         "Illegal reference across two methods"
239*313a0c13SJung-uk Kim };
240*313a0c13SJung-uk Kim 
241*313a0c13SJung-uk Kim /* Table compiler */
242*313a0c13SJung-uk Kim 
243*313a0c13SJung-uk Kim const char                      *AslTableCompilerMsgs [] =
244*313a0c13SJung-uk Kim {
245*313a0c13SJung-uk Kim /*    ASL_MSG_BUFFER_ELEMENT */             "Invalid element in buffer initializer list",
246*313a0c13SJung-uk Kim /*    ASL_MSG_DIVIDE_BY_ZERO */             "Expression contains divide-by-zero",
247*313a0c13SJung-uk Kim /*    ASL_MSG_FLAG_VALUE */                 "Flag value is too large",
248*313a0c13SJung-uk Kim /*    ASL_MSG_INTEGER_SIZE */               "Integer too large for target",
249*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_EXPRESSION */         "Invalid expression",
250*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_FIELD_NAME */         "Invalid Field Name",
251*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_HEX_INTEGER */        "Invalid hex integer constant",
252*313a0c13SJung-uk Kim /*    ASL_MSG_OEM_TABLE */                  "OEM table - unknown contents",
253*313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_VALUE */             "Reserved field",
254*313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_LABEL */              "Label is undefined",
255*313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_SUBTABLE */           "Unknown subtable type",
256*313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_TABLE */              "Unknown ACPI table signature",
257*313a0c13SJung-uk Kim /*    ASL_MSG_ZERO_VALUE */                 "Value must be non-zero"
258*313a0c13SJung-uk Kim };
259*313a0c13SJung-uk Kim 
260*313a0c13SJung-uk Kim /* Preprocessor */
261*313a0c13SJung-uk Kim 
262*313a0c13SJung-uk Kim const char                      *AslPreprocessorMsgs [] =
263*313a0c13SJung-uk Kim {
264*313a0c13SJung-uk Kim /*    ASL_MSG_DIRECTIVE_SYNTAX */           "Invalid directive syntax",
265*313a0c13SJung-uk Kim /*    ASL_MSG_ENDIF_MISMATCH */             "Mismatched #endif",
266*313a0c13SJung-uk Kim /*    ASL_MSG_ERROR_DIRECTIVE */            "#error",
267*313a0c13SJung-uk Kim /*    ASL_MSG_EXISTING_NAME */              "Name is already defined",
268*313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_INVOCATION */         "Invalid macro invocation",
269*313a0c13SJung-uk Kim /*    ASL_MSG_MACRO_SYNTAX */               "Invalid macro syntax",
270*313a0c13SJung-uk Kim /*    ASL_MSG_TOO_MANY_ARGUMENTS */         "Too many macro arguments",
271*313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_DIRECTIVE */          "Unknown directive",
272*313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_PRAGMA */             "Unknown pragma",
273*313a0c13SJung-uk Kim /*    ASL_MSG_WARNING_DIRECTIVE */          "#warning"
274*313a0c13SJung-uk Kim };
275*313a0c13SJung-uk Kim 
276*313a0c13SJung-uk Kim 
277*313a0c13SJung-uk Kim /*******************************************************************************
278*313a0c13SJung-uk Kim  *
279*313a0c13SJung-uk Kim  * FUNCTION:    AeDecodeMessageId
280*313a0c13SJung-uk Kim  *
281*313a0c13SJung-uk Kim  * PARAMETERS:  MessageId               - ASL message ID (exception code) to be
282*313a0c13SJung-uk Kim  *                                        formatted. Possibly fully encoded.
283*313a0c13SJung-uk Kim  *
284*313a0c13SJung-uk Kim  * RETURN:      A string containing the exception message text.
285*313a0c13SJung-uk Kim  *
286*313a0c13SJung-uk Kim  * DESCRIPTION: This function validates and translates an ASL message ID into
287*313a0c13SJung-uk Kim  *              an ASCII string.
288*313a0c13SJung-uk Kim  *
289*313a0c13SJung-uk Kim  ******************************************************************************/
290*313a0c13SJung-uk Kim 
291*313a0c13SJung-uk Kim const char *
292*313a0c13SJung-uk Kim AeDecodeMessageId (
293*313a0c13SJung-uk Kim     UINT16                  MessageId)
294*313a0c13SJung-uk Kim {
295*313a0c13SJung-uk Kim     UINT32                  Index;
296*313a0c13SJung-uk Kim     const char              **MessageTable;
297*313a0c13SJung-uk Kim 
298*313a0c13SJung-uk Kim 
299*313a0c13SJung-uk Kim     /* Main ASL Compiler messages */
300*313a0c13SJung-uk Kim 
301*313a0c13SJung-uk Kim     if (MessageId <= ASL_MSG_MAIN_COMPILER_END)
302*313a0c13SJung-uk Kim     {
303*313a0c13SJung-uk Kim         MessageTable = AslCompilerMsgs;
304*313a0c13SJung-uk Kim         Index = MessageId;
305*313a0c13SJung-uk Kim 
306*313a0c13SJung-uk Kim         if (Index >= ACPI_ARRAY_LENGTH (AslCompilerMsgs))
307*313a0c13SJung-uk Kim         {
308*313a0c13SJung-uk Kim             return ("[Unknown ASL Compiler exception ID]");
309*313a0c13SJung-uk Kim         }
310*313a0c13SJung-uk Kim     }
311*313a0c13SJung-uk Kim 
312*313a0c13SJung-uk Kim     /* Data Table Compiler messages */
313*313a0c13SJung-uk Kim 
314*313a0c13SJung-uk Kim     else if (MessageId <= ASL_MSG_TABLE_COMPILER_END)
315*313a0c13SJung-uk Kim     {
316*313a0c13SJung-uk Kim         MessageTable = AslTableCompilerMsgs;
317*313a0c13SJung-uk Kim         Index = MessageId - ASL_MSG_TABLE_COMPILER;
318*313a0c13SJung-uk Kim 
319*313a0c13SJung-uk Kim         if (Index >= ACPI_ARRAY_LENGTH (AslTableCompilerMsgs))
320*313a0c13SJung-uk Kim         {
321*313a0c13SJung-uk Kim             return ("[Unknown Table Compiler exception ID]");
322*313a0c13SJung-uk Kim         }
323*313a0c13SJung-uk Kim     }
324*313a0c13SJung-uk Kim 
325*313a0c13SJung-uk Kim     /* Preprocessor messages */
326*313a0c13SJung-uk Kim 
327*313a0c13SJung-uk Kim     else if (MessageId <= ASL_MSG_PREPROCESSOR_END)
328*313a0c13SJung-uk Kim     {
329*313a0c13SJung-uk Kim         MessageTable = AslPreprocessorMsgs;
330*313a0c13SJung-uk Kim         Index = MessageId - ASL_MSG_PREPROCESSOR;
331*313a0c13SJung-uk Kim 
332*313a0c13SJung-uk Kim         if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs))
333*313a0c13SJung-uk Kim         {
334*313a0c13SJung-uk Kim             return ("[Unknown Preprocesor exception ID]");
335*313a0c13SJung-uk Kim         }
336*313a0c13SJung-uk Kim     }
337*313a0c13SJung-uk Kim 
338*313a0c13SJung-uk Kim     /* Everything else is unknown */
339*313a0c13SJung-uk Kim 
340*313a0c13SJung-uk Kim     else
341*313a0c13SJung-uk Kim     {
342*313a0c13SJung-uk Kim         return ("[Unknown exception/component ID]");
343*313a0c13SJung-uk Kim     }
344*313a0c13SJung-uk Kim 
345*313a0c13SJung-uk Kim     return (MessageTable[Index]);
346*313a0c13SJung-uk Kim }
347*313a0c13SJung-uk Kim 
348*313a0c13SJung-uk Kim 
349*313a0c13SJung-uk Kim /*******************************************************************************
350*313a0c13SJung-uk Kim  *
351*313a0c13SJung-uk Kim  * FUNCTION:    AeDecodeExceptionLevel
352*313a0c13SJung-uk Kim  *
353*313a0c13SJung-uk Kim  * PARAMETERS:  Level               - The ASL error level to be decoded
354*313a0c13SJung-uk Kim  *
355*313a0c13SJung-uk Kim  * RETURN:      A string containing the error level text
356*313a0c13SJung-uk Kim  *
357*313a0c13SJung-uk Kim  * DESCRIPTION: This function validates and translates an ASL error level into
358*313a0c13SJung-uk Kim  *              an ASCII string.
359*313a0c13SJung-uk Kim  *
360*313a0c13SJung-uk Kim  ******************************************************************************/
361*313a0c13SJung-uk Kim 
362*313a0c13SJung-uk Kim const char *
363*313a0c13SJung-uk Kim AeDecodeExceptionLevel (
364*313a0c13SJung-uk Kim     UINT8                   Level)
365*313a0c13SJung-uk Kim {
366*313a0c13SJung-uk Kim     /* Range check on Level */
367*313a0c13SJung-uk Kim 
368*313a0c13SJung-uk Kim     if (Level >= ACPI_ARRAY_LENGTH (AslErrorLevel))
369*313a0c13SJung-uk Kim     {
370*313a0c13SJung-uk Kim         return ("Unknown exception level");
371*313a0c13SJung-uk Kim     }
372*313a0c13SJung-uk Kim 
373*313a0c13SJung-uk Kim     /* Differentiate the string type to be used (IDE is all lower case) */
374*313a0c13SJung-uk Kim 
375*313a0c13SJung-uk Kim     if (Gbl_VerboseErrors)
376*313a0c13SJung-uk Kim     {
377*313a0c13SJung-uk Kim         return (AslErrorLevel[Level]);
378*313a0c13SJung-uk Kim     }
379*313a0c13SJung-uk Kim 
380*313a0c13SJung-uk Kim     return (AslErrorLevelIde[Level]);
381*313a0c13SJung-uk Kim }
382*313a0c13SJung-uk Kim 
383*313a0c13SJung-uk Kim 
384*313a0c13SJung-uk Kim /*******************************************************************************
385*313a0c13SJung-uk Kim  *
386*313a0c13SJung-uk Kim  * FUNCTION:    AeBuildFullExceptionCode
387*313a0c13SJung-uk Kim  *
388*313a0c13SJung-uk Kim  * PARAMETERS:  Level               - ASL error level
389*313a0c13SJung-uk Kim  *              MessageId           - ASL exception code to be formatted
390*313a0c13SJung-uk Kim  *
391*313a0c13SJung-uk Kim  * RETURN:      Fully encoded exception code
392*313a0c13SJung-uk Kim  *
393*313a0c13SJung-uk Kim  * DESCRIPTION: Build the full exception code from the error level and the
394*313a0c13SJung-uk Kim  *              actual message ID.
395*313a0c13SJung-uk Kim  *
396*313a0c13SJung-uk Kim  ******************************************************************************/
397*313a0c13SJung-uk Kim 
398*313a0c13SJung-uk Kim UINT16
399*313a0c13SJung-uk Kim AeBuildFullExceptionCode (
400*313a0c13SJung-uk Kim     UINT8                   Level,
401*313a0c13SJung-uk Kim     UINT16                  MessageId)
402*313a0c13SJung-uk Kim {
403*313a0c13SJung-uk Kim 
404*313a0c13SJung-uk Kim     /*
405*313a0c13SJung-uk Kim      * Error level is in the thousands slot (error/warning/remark, etc.)
406*313a0c13SJung-uk Kim      * Error codes are 0 - 999
407*313a0c13SJung-uk Kim      */
408*313a0c13SJung-uk Kim     return (((Level + 1) * 1000) + MessageId);
409*313a0c13SJung-uk Kim }
410