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