xref: /freebsd/sys/contrib/dev/acpica/compiler/aslmessages.c (revision fe0f0bbb19f4f267df5c6249d1af4d6f665dfd52)
1313a0c13SJung-uk Kim /******************************************************************************
2313a0c13SJung-uk Kim  *
3313a0c13SJung-uk Kim  * Module Name: aslmessages.c - Compiler error/warning message strings
4313a0c13SJung-uk Kim  *
5313a0c13SJung-uk Kim  *****************************************************************************/
6313a0c13SJung-uk Kim 
7313a0c13SJung-uk Kim /*
81c0e1b6dSJung-uk Kim  * Copyright (C) 2000 - 2015, Intel Corp.
9313a0c13SJung-uk Kim  * All rights reserved.
10313a0c13SJung-uk Kim  *
11313a0c13SJung-uk Kim  * Redistribution and use in source and binary forms, with or without
12313a0c13SJung-uk Kim  * modification, are permitted provided that the following conditions
13313a0c13SJung-uk Kim  * are met:
14313a0c13SJung-uk Kim  * 1. Redistributions of source code must retain the above copyright
15313a0c13SJung-uk Kim  *    notice, this list of conditions, and the following disclaimer,
16313a0c13SJung-uk Kim  *    without modification.
17313a0c13SJung-uk Kim  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18313a0c13SJung-uk Kim  *    substantially similar to the "NO WARRANTY" disclaimer below
19313a0c13SJung-uk Kim  *    ("Disclaimer") and any redistribution must be conditioned upon
20313a0c13SJung-uk Kim  *    including a substantially similar Disclaimer requirement for further
21313a0c13SJung-uk Kim  *    binary redistribution.
22313a0c13SJung-uk Kim  * 3. Neither the names of the above-listed copyright holders nor the names
23313a0c13SJung-uk Kim  *    of any contributors may be used to endorse or promote products derived
24313a0c13SJung-uk Kim  *    from this software without specific prior written permission.
25313a0c13SJung-uk Kim  *
26313a0c13SJung-uk Kim  * Alternatively, this software may be distributed under the terms of the
27313a0c13SJung-uk Kim  * GNU General Public License ("GPL") version 2 as published by the Free
28313a0c13SJung-uk Kim  * Software Foundation.
29313a0c13SJung-uk Kim  *
30313a0c13SJung-uk Kim  * NO WARRANTY
31313a0c13SJung-uk Kim  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32313a0c13SJung-uk Kim  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33313a0c13SJung-uk Kim  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34313a0c13SJung-uk Kim  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35313a0c13SJung-uk Kim  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36313a0c13SJung-uk Kim  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37313a0c13SJung-uk Kim  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38313a0c13SJung-uk Kim  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39313a0c13SJung-uk Kim  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40313a0c13SJung-uk Kim  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41313a0c13SJung-uk Kim  * POSSIBILITY OF SUCH DAMAGES.
42313a0c13SJung-uk Kim  */
43313a0c13SJung-uk Kim 
44313a0c13SJung-uk Kim #include <contrib/dev/acpica/compiler/aslcompiler.h>
45313a0c13SJung-uk Kim 
46313a0c13SJung-uk Kim #define _COMPONENT          ACPI_COMPILER
47313a0c13SJung-uk Kim         ACPI_MODULE_NAME    ("aslmessages")
48313a0c13SJung-uk Kim 
49313a0c13SJung-uk Kim 
50313a0c13SJung-uk Kim /*
51313a0c13SJung-uk Kim  * Strings for message reporting levels, must match error
52313a0c13SJung-uk Kim  * type string tables in aslmessages.c
53313a0c13SJung-uk Kim  */
54313a0c13SJung-uk Kim const char              *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = {
55313a0c13SJung-uk Kim     "Optimize",
56313a0c13SJung-uk Kim     "Remark  ",
57313a0c13SJung-uk Kim     "Warning ",
58313a0c13SJung-uk Kim     "Warning ",
59313a0c13SJung-uk Kim     "Warning ",
60313a0c13SJung-uk Kim     "Error   "
61313a0c13SJung-uk Kim };
62313a0c13SJung-uk Kim 
63313a0c13SJung-uk Kim /* All lowercase versions for IDEs */
64313a0c13SJung-uk Kim 
65313a0c13SJung-uk Kim const char              *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = {
66313a0c13SJung-uk Kim     "optimize",
67313a0c13SJung-uk Kim     "remark  ",
68313a0c13SJung-uk Kim     "warning ",
69313a0c13SJung-uk Kim     "warning ",
70313a0c13SJung-uk Kim     "warning ",
71313a0c13SJung-uk Kim     "error   "
72313a0c13SJung-uk Kim };
73313a0c13SJung-uk Kim 
74313a0c13SJung-uk Kim 
75313a0c13SJung-uk Kim /*
76313a0c13SJung-uk Kim  * Actual message strings for each compiler message ID. There are currently
77313a0c13SJung-uk Kim  * three distinct blocks of error messages (so that they can be expanded
78313a0c13SJung-uk Kim  * individually):
79313a0c13SJung-uk Kim  *      Main ASL compiler
80313a0c13SJung-uk Kim  *      Data Table compiler
81313a0c13SJung-uk Kim  *      Preprocessor
82313a0c13SJung-uk Kim  *
83313a0c13SJung-uk Kim  * NOTE1: These tables must match the enum list of message IDs in the file
84313a0c13SJung-uk Kim  * aslmessages.h exactly.
85313a0c13SJung-uk Kim  *
86313a0c13SJung-uk Kim  * NOTE2: With the introduction of the -vw option to disable specific messages,
87313a0c13SJung-uk Kim  * new messages should only be added to the end of this list, so that values
88313a0c13SJung-uk Kim  * for existing messages are not disturbed.
89313a0c13SJung-uk Kim  */
90313a0c13SJung-uk Kim 
91313a0c13SJung-uk Kim /* ASL compiler */
92313a0c13SJung-uk Kim 
93313a0c13SJung-uk Kim const char                      *AslCompilerMsgs [] =
94313a0c13SJung-uk Kim {
95313a0c13SJung-uk Kim /*    The zeroth message is reserved */    "",
96313a0c13SJung-uk Kim /*    ASL_MSG_ALIGNMENT */                  "Must be a multiple of alignment/granularity value",
97313a0c13SJung-uk Kim /*    ASL_MSG_ALPHANUMERIC_STRING */        "String must be entirely alphanumeric",
98313a0c13SJung-uk Kim /*    ASL_MSG_AML_NOT_IMPLEMENTED */        "Opcode is not implemented in compiler AML code generator",
99313a0c13SJung-uk Kim /*    ASL_MSG_ARG_COUNT_HI */               "Too many arguments",
100313a0c13SJung-uk Kim /*    ASL_MSG_ARG_COUNT_LO */               "Too few arguments",
101313a0c13SJung-uk Kim /*    ASL_MSG_ARG_INIT */                   "Method argument is not initialized",
102313a0c13SJung-uk Kim /*    ASL_MSG_BACKWARDS_OFFSET */           "Invalid backwards offset",
103313a0c13SJung-uk Kim /*    ASL_MSG_BUFFER_LENGTH */              "Effective AML buffer length is zero",
104313a0c13SJung-uk Kim /*    ASL_MSG_CLOSE */                      "Could not close file",
105313a0c13SJung-uk Kim /*    ASL_MSG_COMPILER_INTERNAL */          "Internal compiler error",
106313a0c13SJung-uk Kim /*    ASL_MSG_COMPILER_RESERVED */          "Use of compiler reserved name",
107313a0c13SJung-uk Kim /*    ASL_MSG_CONNECTION_MISSING */         "A Connection operator is required for this field SpaceId",
108313a0c13SJung-uk Kim /*    ASL_MSG_CONNECTION_INVALID */         "Invalid OpRegion SpaceId for use of Connection operator",
109313a0c13SJung-uk Kim /*    ASL_MSG_CONSTANT_EVALUATION */        "Could not evaluate constant expression",
110313a0c13SJung-uk Kim /*    ASL_MSG_CONSTANT_FOLDED */            "Constant expression evaluated and reduced",
111313a0c13SJung-uk Kim /*    ASL_MSG_CORE_EXCEPTION */             "From ACPICA Subsystem",
112313a0c13SJung-uk Kim /*    ASL_MSG_DEBUG_FILE_OPEN */            "Could not open debug file",
113313a0c13SJung-uk Kim /*    ASL_MSG_DEBUG_FILENAME */             "Could not create debug filename",
114313a0c13SJung-uk Kim /*    ASL_MSG_DEPENDENT_NESTING */          "Dependent function macros cannot be nested",
115313a0c13SJung-uk Kim /*    ASL_MSG_DMA_CHANNEL */                "Invalid DMA channel (must be 0-7)",
116313a0c13SJung-uk Kim /*    ASL_MSG_DMA_LIST */                   "Too many DMA channels (8 max)",
117313a0c13SJung-uk Kim /*    ASL_MSG_DUPLICATE_CASE */             "Case value already specified",
118313a0c13SJung-uk Kim /*    ASL_MSG_DUPLICATE_ITEM */             "Duplicate value in list",
119313a0c13SJung-uk Kim /*    ASL_MSG_EARLY_EOF */                  "Premature end-of-file reached",
120313a0c13SJung-uk Kim /*    ASL_MSG_ENCODING_LENGTH */            "Package length too long to encode",
121313a0c13SJung-uk Kim /*    ASL_MSG_EX_INTERRUPT_LIST */          "Too many interrupts (255 max)",
122313a0c13SJung-uk Kim /*    ASL_MSG_EX_INTERRUPT_LIST_MIN */      "Too few interrupts (1 minimum required)",
123313a0c13SJung-uk Kim /*    ASL_MSG_EX_INTERRUPT_NUMBER */        "Invalid interrupt number (must be 32 bits)",
124313a0c13SJung-uk Kim /*    ASL_MSG_FIELD_ACCESS_WIDTH */         "Access width is greater than region size",
125313a0c13SJung-uk Kim /*    ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */    "Access width of Field Unit extends beyond region limit",
126313a0c13SJung-uk Kim /*    ASL_MSG_FIELD_UNIT_OFFSET */          "Field Unit extends beyond region limit",
127313a0c13SJung-uk Kim /*    ASL_MSG_GPE_NAME_CONFLICT */          "Name conflicts with a previous GPE method",
128313a0c13SJung-uk Kim /*    ASL_MSG_HID_LENGTH */                 "_HID string must be exactly 7 or 8 characters",
129313a0c13SJung-uk Kim /*    ASL_MSG_HID_PREFIX */                 "_HID prefix must be all uppercase or decimal digits",
130313a0c13SJung-uk Kim /*    ASL_MSG_HID_SUFFIX */                 "_HID suffix must be all hex digits",
131313a0c13SJung-uk Kim /*    ASL_MSG_INCLUDE_FILE_OPEN */          "Could not open include file",
132313a0c13SJung-uk Kim /*    ASL_MSG_INPUT_FILE_OPEN */            "Could not open input file",
133313a0c13SJung-uk Kim /*    ASL_MSG_INTEGER_LENGTH */             "64-bit integer in 32-bit table, truncating (DSDT version < 2)",
134313a0c13SJung-uk Kim /*    ASL_MSG_INTEGER_OPTIMIZATION */       "Integer optimized to single-byte AML opcode",
135313a0c13SJung-uk Kim /*    ASL_MSG_INTERRUPT_LIST */             "Too many interrupts (16 max)",
136313a0c13SJung-uk Kim /*    ASL_MSG_INTERRUPT_NUMBER */           "Invalid interrupt number (must be 0-15)",
137313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_ACCESS_SIZE */        "Invalid AccessSize (Maximum is 4 - QWord access)",
138313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_ADDR_FLAGS */         "Invalid combination of Length and Min/Max fixed flags",
139313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_CONSTANT_OP */        "Invalid operator in constant expression (not type 3/4/5)",
140313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_EISAID */             "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)",
141313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_ESCAPE */             "Invalid or unknown escape sequence",
142313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_GRAN_FIXED */         "Granularity must be zero for fixed Min/Max",
143313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_GRANULARITY */        "Granularity must be zero or a power of two minus one",
144313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_LENGTH */             "Length is larger than Min/Max window",
145313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_LENGTH_FIXED */       "Length is not equal to fixed Min/Max window",
146313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_MIN_MAX */            "Address Min is greater than Address Max",
147313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_OPERAND */            "Invalid operand",
148313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_PERFORMANCE */        "Invalid performance/robustness value",
149313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_PRIORITY */           "Invalid priority value",
150313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_STRING */             "Invalid Hex/Octal Escape - Non-ASCII or NULL",
151313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_TARGET */             "Target operand not allowed in constant expression",
152313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_TIME */               "Time parameter too long (255 max)",
153313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_TYPE */               "Invalid type",
154313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_UUID */               "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"",
155313a0c13SJung-uk Kim /*    ASL_MSG_ISA_ADDRESS */                "Maximum 10-bit ISA address (0x3FF)",
156313a0c13SJung-uk Kim /*    ASL_MSG_LEADING_ASTERISK */           "Invalid leading asterisk",
157313a0c13SJung-uk Kim /*    ASL_MSG_LIST_LENGTH_LONG */           "Initializer list longer than declared package length",
158313a0c13SJung-uk Kim /*    ASL_MSG_LIST_LENGTH_SHORT */          "Initializer list shorter than declared package length",
159313a0c13SJung-uk Kim /*    ASL_MSG_LISTING_FILE_OPEN */          "Could not open listing file",
160313a0c13SJung-uk Kim /*    ASL_MSG_LISTING_FILENAME */           "Could not create listing filename",
161313a0c13SJung-uk Kim /*    ASL_MSG_LOCAL_INIT */                 "Method local variable is not initialized",
162313a0c13SJung-uk Kim /*    ASL_MSG_LOCAL_OUTSIDE_METHOD */       "Local or Arg used outside a control method",
163313a0c13SJung-uk Kim /*    ASL_MSG_LONG_LINE */                  "Splitting long input line",
164313a0c13SJung-uk Kim /*    ASL_MSG_MEMORY_ALLOCATION */          "Memory allocation failure",
165313a0c13SJung-uk Kim /*    ASL_MSG_MISSING_ENDDEPENDENT */       "Missing EndDependentFn() macro in dependent resource list",
166313a0c13SJung-uk Kim /*    ASL_MSG_MISSING_STARTDEPENDENT */     "Missing StartDependentFn() macro in dependent resource list",
167313a0c13SJung-uk Kim /*    ASL_MSG_MULTIPLE_DEFAULT */           "More than one Default statement within Switch construct",
168313a0c13SJung-uk Kim /*    ASL_MSG_MULTIPLE_TYPES */             "Multiple types",
169313a0c13SJung-uk Kim /*    ASL_MSG_NAME_EXISTS */                "Name already exists in scope",
170313a0c13SJung-uk Kim /*    ASL_MSG_NAME_OPTIMIZATION */          "NamePath optimized",
171313a0c13SJung-uk Kim /*    ASL_MSG_NAMED_OBJECT_IN_WHILE */      "Creating a named object in a While loop",
172313a0c13SJung-uk Kim /*    ASL_MSG_NESTED_COMMENT */             "Nested comment found",
173313a0c13SJung-uk Kim /*    ASL_MSG_NO_CASES */                   "No Case statements under Switch",
174313a0c13SJung-uk Kim /*    ASL_MSG_NO_REGION */                  "_REG has no corresponding Operation Region",
175313a0c13SJung-uk Kim /*    ASL_MSG_NO_RETVAL */                  "Called method returns no value",
176313a0c13SJung-uk Kim /*    ASL_MSG_NO_WHILE */                   "No enclosing While statement",
177313a0c13SJung-uk Kim /*    ASL_MSG_NON_ASCII */                  "Invalid characters found in file",
178313a0c13SJung-uk Kim /*    ASL_MSG_NON_ZERO */                   "Operand evaluates to zero",
179313a0c13SJung-uk Kim /*    ASL_MSG_NOT_EXIST */                  "Object does not exist",
180313a0c13SJung-uk Kim /*    ASL_MSG_NOT_FOUND */                  "Object not found or not accessible from scope",
181313a0c13SJung-uk Kim /*    ASL_MSG_NOT_METHOD */                 "Not a control method, cannot invoke",
182313a0c13SJung-uk Kim /*    ASL_MSG_NOT_PARAMETER */              "Not a parameter, used as local only",
183313a0c13SJung-uk Kim /*    ASL_MSG_NOT_REACHABLE */              "Object is not accessible from this scope",
184313a0c13SJung-uk Kim /*    ASL_MSG_NOT_REFERENCED */             "Object is not referenced",
185313a0c13SJung-uk Kim /*    ASL_MSG_NULL_DESCRIPTOR */            "Min/Max/Length/Gran are all zero, but no resource tag",
186313a0c13SJung-uk Kim /*    ASL_MSG_NULL_STRING */                "Invalid zero-length (null) string",
187313a0c13SJung-uk Kim /*    ASL_MSG_OPEN */                       "Could not open file",
188313a0c13SJung-uk Kim /*    ASL_MSG_OUTPUT_FILE_OPEN */           "Could not open output AML file",
189313a0c13SJung-uk Kim /*    ASL_MSG_OUTPUT_FILENAME */            "Could not create output filename",
190313a0c13SJung-uk Kim /*    ASL_MSG_PACKAGE_LENGTH */             "Effective AML package length is zero",
191313a0c13SJung-uk Kim /*    ASL_MSG_PREPROCESSOR_FILENAME */      "Could not create preprocessor filename",
192313a0c13SJung-uk Kim /*    ASL_MSG_READ */                       "Could not read file",
193313a0c13SJung-uk Kim /*    ASL_MSG_RECURSION */                  "Recursive method call",
194313a0c13SJung-uk Kim /*    ASL_MSG_REGION_BUFFER_ACCESS */       "Host Operation Region requires BufferAcc access",
195313a0c13SJung-uk Kim /*    ASL_MSG_REGION_BYTE_ACCESS */         "Host Operation Region requires ByteAcc access",
196313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_ARG_COUNT_HI */      "Reserved method has too many arguments",
197313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_ARG_COUNT_LO */      "Reserved method has too few arguments",
198313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_METHOD */            "Reserved name must be a control method",
199313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_NO_RETURN_VAL */     "Reserved method should not return a value",
200313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_OPERAND_TYPE */      "Invalid object type for reserved name",
201313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_PACKAGE_LENGTH */    "Invalid package length for reserved name",
202313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_RETURN_VALUE */      "Reserved method must return a value",
203313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_USE */               "Invalid use of reserved name",
204313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_WORD */              "Use of reserved name",
205313a0c13SJung-uk Kim /*    ASL_MSG_RESOURCE_FIELD */             "Resource field name cannot be used as a target",
206313a0c13SJung-uk Kim /*    ASL_MSG_RESOURCE_INDEX */             "Missing ResourceSourceIndex (required)",
207313a0c13SJung-uk Kim /*    ASL_MSG_RESOURCE_LIST */              "Too many resource items (internal error)",
208313a0c13SJung-uk Kim /*    ASL_MSG_RESOURCE_SOURCE */            "Missing ResourceSource string (required)",
209313a0c13SJung-uk Kim /*    ASL_MSG_RESULT_NOT_USED */            "Result is not used, operator has no effect",
210313a0c13SJung-uk Kim /*    ASL_MSG_RETURN_TYPES */               "Not all control paths return a value",
211313a0c13SJung-uk Kim /*    ASL_MSG_SCOPE_FWD_REF */              "Forward references from Scope operator not allowed",
212313a0c13SJung-uk Kim /*    ASL_MSG_SCOPE_TYPE */                 "Existing object has invalid type for Scope operator",
213313a0c13SJung-uk Kim /*    ASL_MSG_SEEK */                       "Could not seek file",
214313a0c13SJung-uk Kim /*    ASL_MSG_SERIALIZED */                 "Control Method marked Serialized",
215313a0c13SJung-uk Kim /*    ASL_MSG_SERIALIZED_REQUIRED */        "Control Method should be made Serialized",
216313a0c13SJung-uk Kim /*    ASL_MSG_SINGLE_NAME_OPTIMIZATION */   "NamePath optimized to NameSeg (uses run-time search path)",
217313a0c13SJung-uk Kim /*    ASL_MSG_SOME_NO_RETVAL */             "Called method may not always return a value",
218313a0c13SJung-uk Kim /*    ASL_MSG_STRING_LENGTH */              "String literal too long",
219313a0c13SJung-uk Kim /*    ASL_MSG_SWITCH_TYPE */                "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer",
220313a0c13SJung-uk Kim /*    ASL_MSG_SYNC_LEVEL */                 "SyncLevel must be in the range 0-15",
221313a0c13SJung-uk Kim /*    ASL_MSG_SYNTAX */                     "",
222313a0c13SJung-uk Kim /*    ASL_MSG_TABLE_SIGNATURE */            "Invalid Table Signature",
223313a0c13SJung-uk Kim /*    ASL_MSG_TAG_LARGER */                 "ResourceTag larger than Field",
224313a0c13SJung-uk Kim /*    ASL_MSG_TAG_SMALLER */                "ResourceTag smaller than Field",
225313a0c13SJung-uk Kim /*    ASL_MSG_TIMEOUT */                    "Result is not used, possible operator timeout will be missed",
226313a0c13SJung-uk Kim /*    ASL_MSG_TOO_MANY_TEMPS */             "Method requires too many temporary variables (_T_x)",
227313a0c13SJung-uk Kim /*    ASL_MSG_TRUNCATION */                 "64-bit return value will be truncated to 32 bits (DSDT version < 2)",
228313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_RESERVED_NAME */      "Unknown reserved name",
229313a0c13SJung-uk Kim /*    ASL_MSG_UNREACHABLE_CODE */           "Statement is unreachable",
230313a0c13SJung-uk Kim /*    ASL_MSG_UNSUPPORTED */                "Unsupported feature",
231313a0c13SJung-uk Kim /*    ASL_MSG_UPPER_CASE */                 "Non-hex letters must be upper case",
232313a0c13SJung-uk Kim /*    ASL_MSG_VENDOR_LIST */                "Too many vendor data bytes (7 max)",
233313a0c13SJung-uk Kim /*    ASL_MSG_WRITE */                      "Could not write file",
234313a0c13SJung-uk Kim /*    ASL_MSG_RANGE */                      "Constant out of range",
235313a0c13SJung-uk Kim /*    ASL_MSG_BUFFER_ALLOCATION */          "Could not allocate line buffer",
236313a0c13SJung-uk Kim /*    ASL_MSG_MISSING_DEPENDENCY */         "Missing dependency",
237313a0c13SJung-uk Kim /*    ASL_MSG_ILLEGAL_FORWARD_REF */        "Illegal forward reference within a method",
238*fe0f0bbbSJung-uk Kim /*    ASL_MSG_ILLEGAL_METHOD_REF */         "Illegal reference across two methods",
239*fe0f0bbbSJung-uk Kim /*    ASL_MSG_LOCAL_NOT_USED */             "Method Local is set but never used",
240*fe0f0bbbSJung-uk Kim /*    ASL_MSG_ARG_AS_LOCAL_NOT_USED */      "Method Argument (as a local) is set but never used",
241*fe0f0bbbSJung-uk Kim /*    ASL_MSG_ARG_NOT_USED */               "Method Argument is never used"
242*fe0f0bbbSJung-uk Kim 
243313a0c13SJung-uk Kim };
244313a0c13SJung-uk Kim 
245313a0c13SJung-uk Kim /* Table compiler */
246313a0c13SJung-uk Kim 
247313a0c13SJung-uk Kim const char                      *AslTableCompilerMsgs [] =
248313a0c13SJung-uk Kim {
249313a0c13SJung-uk Kim /*    ASL_MSG_BUFFER_ELEMENT */             "Invalid element in buffer initializer list",
250313a0c13SJung-uk Kim /*    ASL_MSG_DIVIDE_BY_ZERO */             "Expression contains divide-by-zero",
251313a0c13SJung-uk Kim /*    ASL_MSG_FLAG_VALUE */                 "Flag value is too large",
252313a0c13SJung-uk Kim /*    ASL_MSG_INTEGER_SIZE */               "Integer too large for target",
253313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_EXPRESSION */         "Invalid expression",
254313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_FIELD_NAME */         "Invalid Field Name",
255313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_HEX_INTEGER */        "Invalid hex integer constant",
256313a0c13SJung-uk Kim /*    ASL_MSG_OEM_TABLE */                  "OEM table - unknown contents",
257313a0c13SJung-uk Kim /*    ASL_MSG_RESERVED_VALUE */             "Reserved field",
258313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_LABEL */              "Label is undefined",
259313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_SUBTABLE */           "Unknown subtable type",
260313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_TABLE */              "Unknown ACPI table signature",
261313a0c13SJung-uk Kim /*    ASL_MSG_ZERO_VALUE */                 "Value must be non-zero"
262313a0c13SJung-uk Kim };
263313a0c13SJung-uk Kim 
264313a0c13SJung-uk Kim /* Preprocessor */
265313a0c13SJung-uk Kim 
266313a0c13SJung-uk Kim const char                      *AslPreprocessorMsgs [] =
267313a0c13SJung-uk Kim {
268313a0c13SJung-uk Kim /*    ASL_MSG_DIRECTIVE_SYNTAX */           "Invalid directive syntax",
269313a0c13SJung-uk Kim /*    ASL_MSG_ENDIF_MISMATCH */             "Mismatched #endif",
270313a0c13SJung-uk Kim /*    ASL_MSG_ERROR_DIRECTIVE */            "#error",
271313a0c13SJung-uk Kim /*    ASL_MSG_EXISTING_NAME */              "Name is already defined",
272313a0c13SJung-uk Kim /*    ASL_MSG_INVALID_INVOCATION */         "Invalid macro invocation",
273313a0c13SJung-uk Kim /*    ASL_MSG_MACRO_SYNTAX */               "Invalid macro syntax",
274313a0c13SJung-uk Kim /*    ASL_MSG_TOO_MANY_ARGUMENTS */         "Too many macro arguments",
275313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_DIRECTIVE */          "Unknown directive",
276313a0c13SJung-uk Kim /*    ASL_MSG_UNKNOWN_PRAGMA */             "Unknown pragma",
277a371a5fdSJung-uk Kim /*    ASL_MSG_WARNING_DIRECTIVE */          "#warning",
278a371a5fdSJung-uk Kim /*    ASL_MSG_INCLUDE_FILE */               "Found a # preprocessor directive in ASL Include() file"
279313a0c13SJung-uk Kim };
280313a0c13SJung-uk Kim 
281313a0c13SJung-uk Kim 
282313a0c13SJung-uk Kim /*******************************************************************************
283313a0c13SJung-uk Kim  *
284313a0c13SJung-uk Kim  * FUNCTION:    AeDecodeMessageId
285313a0c13SJung-uk Kim  *
286313a0c13SJung-uk Kim  * PARAMETERS:  MessageId               - ASL message ID (exception code) to be
287313a0c13SJung-uk Kim  *                                        formatted. Possibly fully encoded.
288313a0c13SJung-uk Kim  *
289313a0c13SJung-uk Kim  * RETURN:      A string containing the exception message text.
290313a0c13SJung-uk Kim  *
291313a0c13SJung-uk Kim  * DESCRIPTION: This function validates and translates an ASL message ID into
292313a0c13SJung-uk Kim  *              an ASCII string.
293313a0c13SJung-uk Kim  *
294313a0c13SJung-uk Kim  ******************************************************************************/
295313a0c13SJung-uk Kim 
296313a0c13SJung-uk Kim const char *
297313a0c13SJung-uk Kim AeDecodeMessageId (
298313a0c13SJung-uk Kim     UINT16                  MessageId)
299313a0c13SJung-uk Kim {
300313a0c13SJung-uk Kim     UINT32                  Index;
301313a0c13SJung-uk Kim     const char              **MessageTable;
302313a0c13SJung-uk Kim 
303313a0c13SJung-uk Kim 
304313a0c13SJung-uk Kim     /* Main ASL Compiler messages */
305313a0c13SJung-uk Kim 
306313a0c13SJung-uk Kim     if (MessageId <= ASL_MSG_MAIN_COMPILER_END)
307313a0c13SJung-uk Kim     {
308313a0c13SJung-uk Kim         MessageTable = AslCompilerMsgs;
309313a0c13SJung-uk Kim         Index = MessageId;
310313a0c13SJung-uk Kim 
311313a0c13SJung-uk Kim         if (Index >= ACPI_ARRAY_LENGTH (AslCompilerMsgs))
312313a0c13SJung-uk Kim         {
313313a0c13SJung-uk Kim             return ("[Unknown ASL Compiler exception ID]");
314313a0c13SJung-uk Kim         }
315313a0c13SJung-uk Kim     }
316313a0c13SJung-uk Kim 
317313a0c13SJung-uk Kim     /* Data Table Compiler messages */
318313a0c13SJung-uk Kim 
319313a0c13SJung-uk Kim     else if (MessageId <= ASL_MSG_TABLE_COMPILER_END)
320313a0c13SJung-uk Kim     {
321313a0c13SJung-uk Kim         MessageTable = AslTableCompilerMsgs;
322313a0c13SJung-uk Kim         Index = MessageId - ASL_MSG_TABLE_COMPILER;
323313a0c13SJung-uk Kim 
324313a0c13SJung-uk Kim         if (Index >= ACPI_ARRAY_LENGTH (AslTableCompilerMsgs))
325313a0c13SJung-uk Kim         {
326313a0c13SJung-uk Kim             return ("[Unknown Table Compiler exception ID]");
327313a0c13SJung-uk Kim         }
328313a0c13SJung-uk Kim     }
329313a0c13SJung-uk Kim 
330313a0c13SJung-uk Kim     /* Preprocessor messages */
331313a0c13SJung-uk Kim 
332313a0c13SJung-uk Kim     else if (MessageId <= ASL_MSG_PREPROCESSOR_END)
333313a0c13SJung-uk Kim     {
334313a0c13SJung-uk Kim         MessageTable = AslPreprocessorMsgs;
335313a0c13SJung-uk Kim         Index = MessageId - ASL_MSG_PREPROCESSOR;
336313a0c13SJung-uk Kim 
337313a0c13SJung-uk Kim         if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs))
338313a0c13SJung-uk Kim         {
339a371a5fdSJung-uk Kim             return ("[Unknown Preprocessor exception ID]");
340313a0c13SJung-uk Kim         }
341313a0c13SJung-uk Kim     }
342313a0c13SJung-uk Kim 
343313a0c13SJung-uk Kim     /* Everything else is unknown */
344313a0c13SJung-uk Kim 
345313a0c13SJung-uk Kim     else
346313a0c13SJung-uk Kim     {
347313a0c13SJung-uk Kim         return ("[Unknown exception/component ID]");
348313a0c13SJung-uk Kim     }
349313a0c13SJung-uk Kim 
350313a0c13SJung-uk Kim     return (MessageTable[Index]);
351313a0c13SJung-uk Kim }
352313a0c13SJung-uk Kim 
353313a0c13SJung-uk Kim 
354313a0c13SJung-uk Kim /*******************************************************************************
355313a0c13SJung-uk Kim  *
356313a0c13SJung-uk Kim  * FUNCTION:    AeDecodeExceptionLevel
357313a0c13SJung-uk Kim  *
358313a0c13SJung-uk Kim  * PARAMETERS:  Level               - The ASL error level to be decoded
359313a0c13SJung-uk Kim  *
360313a0c13SJung-uk Kim  * RETURN:      A string containing the error level text
361313a0c13SJung-uk Kim  *
362313a0c13SJung-uk Kim  * DESCRIPTION: This function validates and translates an ASL error level into
363313a0c13SJung-uk Kim  *              an ASCII string.
364313a0c13SJung-uk Kim  *
365313a0c13SJung-uk Kim  ******************************************************************************/
366313a0c13SJung-uk Kim 
367313a0c13SJung-uk Kim const char *
368313a0c13SJung-uk Kim AeDecodeExceptionLevel (
369313a0c13SJung-uk Kim     UINT8                   Level)
370313a0c13SJung-uk Kim {
371313a0c13SJung-uk Kim     /* Range check on Level */
372313a0c13SJung-uk Kim 
373313a0c13SJung-uk Kim     if (Level >= ACPI_ARRAY_LENGTH (AslErrorLevel))
374313a0c13SJung-uk Kim     {
375313a0c13SJung-uk Kim         return ("Unknown exception level");
376313a0c13SJung-uk Kim     }
377313a0c13SJung-uk Kim 
378313a0c13SJung-uk Kim     /* Differentiate the string type to be used (IDE is all lower case) */
379313a0c13SJung-uk Kim 
380313a0c13SJung-uk Kim     if (Gbl_VerboseErrors)
381313a0c13SJung-uk Kim     {
382313a0c13SJung-uk Kim         return (AslErrorLevel[Level]);
383313a0c13SJung-uk Kim     }
384313a0c13SJung-uk Kim 
385313a0c13SJung-uk Kim     return (AslErrorLevelIde[Level]);
386313a0c13SJung-uk Kim }
387313a0c13SJung-uk Kim 
388313a0c13SJung-uk Kim 
389313a0c13SJung-uk Kim /*******************************************************************************
390313a0c13SJung-uk Kim  *
391313a0c13SJung-uk Kim  * FUNCTION:    AeBuildFullExceptionCode
392313a0c13SJung-uk Kim  *
393313a0c13SJung-uk Kim  * PARAMETERS:  Level               - ASL error level
394313a0c13SJung-uk Kim  *              MessageId           - ASL exception code to be formatted
395313a0c13SJung-uk Kim  *
396313a0c13SJung-uk Kim  * RETURN:      Fully encoded exception code
397313a0c13SJung-uk Kim  *
398313a0c13SJung-uk Kim  * DESCRIPTION: Build the full exception code from the error level and the
399313a0c13SJung-uk Kim  *              actual message ID.
400313a0c13SJung-uk Kim  *
401313a0c13SJung-uk Kim  ******************************************************************************/
402313a0c13SJung-uk Kim 
403313a0c13SJung-uk Kim UINT16
404313a0c13SJung-uk Kim AeBuildFullExceptionCode (
405313a0c13SJung-uk Kim     UINT8                   Level,
406313a0c13SJung-uk Kim     UINT16                  MessageId)
407313a0c13SJung-uk Kim {
408313a0c13SJung-uk Kim 
409313a0c13SJung-uk Kim     /*
410313a0c13SJung-uk Kim      * Error level is in the thousands slot (error/warning/remark, etc.)
411313a0c13SJung-uk Kim      * Error codes are 0 - 999
412313a0c13SJung-uk Kim      */
413313a0c13SJung-uk Kim     return (((Level + 1) * 1000) + MessageId);
414313a0c13SJung-uk Kim }
415