| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
#include "aslcompiler.h" |
| 45 |
|
| 46 |
#define _COMPONENT ACPI_COMPILER |
| 47 |
ACPI_MODULE_NAME ("aslmessages") |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
const char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = { |
| 55 |
"Optimize", |
| 56 |
"Remark ", |
| 57 |
"Warning ", |
| 58 |
"Warning ", |
| 59 |
"Warning ", |
| 60 |
"Error " |
| 61 |
}; |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
const char *AslErrorLevelIde [ASL_NUM_REPORT_LEVELS] = { |
| 66 |
"optimize", |
| 67 |
"remark ", |
| 68 |
"warning ", |
| 69 |
"warning ", |
| 70 |
"warning ", |
| 71 |
"error " |
| 72 |
}; |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
const char *AslCompilerMsgs [] = |
| 95 |
{ |
| 96 |
"", |
| 97 |
"Must be a multiple of alignment/granularity value", |
| 98 |
"String must be entirely alphanumeric", |
| 99 |
"Opcode is not implemented in compiler AML code generator", |
| 100 |
"Too many arguments", |
| 101 |
"Too few arguments", |
| 102 |
"Method argument is not initialized", |
| 103 |
"Invalid backwards offset", |
| 104 |
"Effective AML buffer length is zero", |
| 105 |
"Could not close file", |
| 106 |
"Internal compiler error", |
| 107 |
"Use of compiler reserved name", |
| 108 |
"A Connection operator is required for this field SpaceId", |
| 109 |
"Invalid OpRegion SpaceId for use of Connection operator", |
| 110 |
"Could not evaluate constant expression", |
| 111 |
"Constant expression evaluated and reduced", |
| 112 |
"From ACPICA Subsystem", |
| 113 |
"Could not open debug file", |
| 114 |
"Could not create debug filename", |
| 115 |
"Dependent function macros cannot be nested", |
| 116 |
"Invalid DMA channel (must be 0-7)", |
| 117 |
"Too many DMA channels (8 max)", |
| 118 |
"Case value already specified", |
| 119 |
"Duplicate value in list", |
| 120 |
"Premature end-of-file reached", |
| 121 |
"Package length too long to encode", |
| 122 |
"Too many interrupts (255 max)", |
| 123 |
"Too few interrupts (1 minimum required)", |
| 124 |
"Invalid interrupt number (must be 32 bits)", |
| 125 |
"Access width is greater than region size", |
| 126 |
"Access width of Field Unit extends beyond region limit", |
| 127 |
"Field Unit extends beyond region limit", |
| 128 |
"Name conflicts with a previous GPE method", |
| 129 |
"_HID string must be exactly 7 or 8 characters", |
| 130 |
"_HID prefix must be all uppercase or decimal digits", |
| 131 |
"_HID suffix must be all hex digits", |
| 132 |
"Could not open include file", |
| 133 |
"Could not open input file", |
| 134 |
"Truncating 64-bit constant found in 32-bit table", |
| 135 |
"Integer optimized to single-byte AML opcode", |
| 136 |
"Too many interrupts (16 max)", |
| 137 |
"Invalid interrupt number (must be 0-15)", |
| 138 |
"Invalid AccessSize (Maximum is 4 - QWord access)", |
| 139 |
"Invalid combination of Length and Min/Max fixed flags", |
| 140 |
"Invalid operator in constant expression (not type 3/4/5)", |
| 141 |
"EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)", |
| 142 |
"Invalid or unknown escape sequence", |
| 143 |
"Granularity must be zero for fixed Min/Max", |
| 144 |
"Granularity must be zero or a power of two minus one", |
| 145 |
"Length is larger than Min/Max window", |
| 146 |
"Length is not equal to fixed Min/Max window", |
| 147 |
"Address Min is greater than Address Max", |
| 148 |
"Invalid operand", |
| 149 |
"Invalid performance/robustness value", |
| 150 |
"Invalid priority value", |
| 151 |
"Invalid Hex/Octal Escape - Non-ASCII or NULL", |
| 152 |
"Target operand not allowed in constant expression", |
| 153 |
"Time parameter too long (255 max)", |
| 154 |
"Invalid type", |
| 155 |
"UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"", |
| 156 |
"Maximum 10-bit ISA address (0x3FF)", |
| 157 |
"Invalid leading asterisk", |
| 158 |
"Initializer list longer than declared package length", |
| 159 |
"Initializer list shorter than declared package length", |
| 160 |
"Could not open listing file", |
| 161 |
"Could not create listing filename", |
| 162 |
"Method local variable is not initialized", |
| 163 |
"Local or Arg used outside a control method", |
| 164 |
"Splitting long input line", |
| 165 |
"Memory allocation failure", |
| 166 |
"Missing EndDependentFn() macro in dependent resource list", |
| 167 |
"Missing StartDependentFn() macro in dependent resource list", |
| 168 |
"More than one Default statement within Switch construct", |
| 169 |
"Multiple types", |
| 170 |
"Name already exists in scope", |
| 171 |
"NamePath optimized", |
| 172 |
"Creating a named object in a While loop", |
| 173 |
"Nested comment found", |
| 174 |
"No Case statements under Switch", |
| 175 |
"_REG has no corresponding Operation Region", |
| 176 |
"Called method returns no value", |
| 177 |
"No enclosing While statement", |
| 178 |
"Invalid characters found in file", |
| 179 |
"Field length must be non-zero", |
| 180 |
"Object does not exist", |
| 181 |
"Object not found or not accessible from current scope", |
| 182 |
"Not a control method, cannot invoke", |
| 183 |
"Not a parameter, used as local only", |
| 184 |
"Object is not accessible from this scope", |
| 185 |
"Object is not referenced", |
| 186 |
"Min/Max/Length/Gran are all zero, but no resource tag", |
| 187 |
"Invalid zero-length (null) string", |
| 188 |
"Could not open file", |
| 189 |
"Could not open output AML file", |
| 190 |
"Could not create output filename", |
| 191 |
"Effective AML package length is zero", |
| 192 |
"Could not create preprocessor filename", |
| 193 |
"Could not read file", |
| 194 |
"Recursive method call", |
| 195 |
"Host Operation Region requires BufferAcc access", |
| 196 |
"Host Operation Region requires ByteAcc access", |
| 197 |
"Reserved method has too many arguments", |
| 198 |
"Reserved method has too few arguments", |
| 199 |
"Reserved name must be a control method", |
| 200 |
"Reserved method should not return a value", |
| 201 |
"Invalid object type for reserved name", |
| 202 |
"Invalid package length for reserved name", |
| 203 |
"Reserved method must return a value", |
| 204 |
"Invalid use of reserved name", |
| 205 |
"Use of reserved name", |
| 206 |
"Resource field name cannot be used as a target", |
| 207 |
"Missing ResourceSourceIndex (required)", |
| 208 |
"Too many resource items (internal error)", |
| 209 |
"Missing ResourceSource string (required)", |
| 210 |
"Result is not used, operator has no effect", |
| 211 |
"Not all control paths return a value", |
| 212 |
"Forward references from Scope operator not allowed", |
| 213 |
"Existing object has invalid type for Scope operator", |
| 214 |
"Could not seek file", |
| 215 |
"Control Method marked Serialized", |
| 216 |
"Control Method should be made Serialized due to creation of named objects within", |
| 217 |
"NamePath optimized to NameSeg (uses run-time search path)", |
| 218 |
"Called method may not always return a value", |
| 219 |
"String literal too long", |
| 220 |
"Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer", |
| 221 |
"SyncLevel must be in the range 0-15", |
| 222 |
"", |
| 223 |
"Invalid Table Signature", |
| 224 |
"ResourceTag larger than Field", |
| 225 |
"ResourceTag smaller than Field", |
| 226 |
"Result is not used, possible operator timeout will be missed", |
| 227 |
"Method requires too many temporary variables (_T_x)", |
| 228 |
"64-bit return value will be truncated to 32 bits (DSDT or SSDT version < 2)", |
| 229 |
"Unknown reserved name", |
| 230 |
"Statement is unreachable", |
| 231 |
"Unsupported feature", |
| 232 |
"Non-hex letters must be upper case", |
| 233 |
"Too many vendor data bytes (7 max)", |
| 234 |
"Could not write file", |
| 235 |
"Constant out of range", |
| 236 |
"Could not allocate line buffer", |
| 237 |
"Missing dependency", |
| 238 |
"Illegal forward reference", |
| 239 |
"Object is declared in a different method", |
| 240 |
"Method Local is set but never used", |
| 241 |
"Method Argument (as a local) is set but never used", |
| 242 |
"Method Argument is never used", |
| 243 |
"Non-reducible expression", |
| 244 |
"Illegal open scope on external object from within DSDT", |
| 245 |
"Expected remark, warning, or error did not occur. Message ID:", |
| 246 |
"Empty Resource Template (END_TAG only)", |
| 247 |
"Original name creation/declaration below: ", |
| 248 |
"Illegal recursive call to method that creates named objects", |
| 249 |
"Duplicate input files detected:", |
| 250 |
"Warnings detected during compilation", |
| 251 |
"Invalid OEM Table ID", |
| 252 |
"Invalid OEM ID", |
| 253 |
"Unload is not supported by all operating systems", |
| 254 |
"Unnecessary/redundant use of Offset operator", |
| 255 |
"Very long Sleep, greater than 1 second", |
| 256 |
"One or more prefix Scopes do not exist", |
| 257 |
"One or more objects within the Pathname do not exist", |
| 258 |
"Operation Region declared with zero length", |
| 259 |
"Object is created temporarily in another method and cannot be accessed", |
| 260 |
"Named object was declared external but the actual definition does not exist", |
| 261 |
"Buffer field extends beyond end of target buffer", |
| 262 |
"declaration of this named object outside root scope is illegal", |
| 263 |
"_UID inside processor declaration must be an integer", |
| 264 |
"Legacy Processor() keyword detected. Use Device() keyword instead.", |
| 265 |
"NameString contains too many NameSegs (>255)", |
| 266 |
"Original Case value below:", |
| 267 |
"Return type is only allowed for Externals declared as MethodObj", |
| 268 |
"Parameter type is only allowed for Externals declared as MethodObj", |
| 269 |
"Creation of named objects within a method is highly inefficient, use globals or method local variables instead", |
| 270 |
"Method NumArgs count does not match length of ParameterTypes list", |
| 271 |
"Static OperationRegion should be declared outside control method", |
| 272 |
"Type mismatch between external declaration and actual object declaration detected", |
| 273 |
"Actual object declaration:", |
| 274 |
"Type mismatch between multiple external declarations detected", |
| 275 |
"Duplicate external declaration:", |
| 276 |
"CondRefOf parameter requires External() declaration", |
| 277 |
"External declaration below ", |
| 278 |
"At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case", |
| 279 |
"At least one lower case letter found in NamePath, ASL is case insensitive - converting to upper case", |
| 280 |
"Unknown UUID string", |
| 281 |
"DDBHandleObj has been deprecated along with the Unload operator. DDBHandlObj objects are only used in Unload" |
| 282 |
}; |
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
const char *AslTableCompilerMsgs [] = |
| 287 |
{ |
| 288 |
"Invalid element in buffer initializer list", |
| 289 |
"Expression contains divide-by-zero", |
| 290 |
"Flag value is too large", |
| 291 |
"Integer too large for target", |
| 292 |
"Invalid expression", |
| 293 |
"Invalid Field Name", |
| 294 |
"Invalid hex integer constant", |
| 295 |
"OEM table - unknown contents", |
| 296 |
"Reserved field", |
| 297 |
"Label is undefined", |
| 298 |
"Unknown subtable type", |
| 299 |
"Unknown ACPI table signature", |
| 300 |
"Value must be non-zero", |
| 301 |
"Invalid field label detected", |
| 302 |
"Invalid buffer initializer list", |
| 303 |
"Invalid entry initializer list", |
| 304 |
"Unknown format value", |
| 305 |
"Value for field is reserved or unknown", |
| 306 |
"32-bit DSDT Address and 64-bit X_DSDT Address cannot both be zero", |
| 307 |
"Parse tree appears to be ill-defined", |
| 308 |
"Malformed ACPI table header detected" |
| 309 |
}; |
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
const char *AslPreprocessorMsgs [] = |
| 314 |
{ |
| 315 |
"Invalid directive syntax", |
| 316 |
"Mismatched #endif", |
| 317 |
"#error", |
| 318 |
"Name is already defined", |
| 319 |
"Invalid macro invocation", |
| 320 |
"Invalid macro syntax", |
| 321 |
"Too many macro arguments", |
| 322 |
"Unknown directive", |
| 323 |
"Unknown pragma", |
| 324 |
"#warning", |
| 325 |
"Found a # preprocessor directive in ASL Include() file" |
| 326 |
}; |
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
const char * |
| 344 |
AeDecodeMessageId ( |
| 345 |
UINT16 MessageId) |
| 346 |
{ |
| 347 |
UINT32 Index; |
| 348 |
const char **MessageTable; |
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
if (MessageId <= ASL_MSG_MAIN_COMPILER_END) |
| 354 |
{ |
| 355 |
MessageTable = AslCompilerMsgs; |
| 356 |
Index = MessageId; |
| 357 |
|
| 358 |
if (Index >= ACPI_ARRAY_LENGTH (AslCompilerMsgs)) |
| 359 |
{ |
| 360 |
return ("[Unknown iASL Compiler exception ID]"); |
| 361 |
} |
| 362 |
} |
| 363 |
|
| 364 |
|
| 365 |
|
| 366 |
else if (MessageId <= ASL_MSG_TABLE_COMPILER_END) |
| 367 |
{ |
| 368 |
MessageTable = AslTableCompilerMsgs; |
| 369 |
Index = MessageId - ASL_MSG_TABLE_COMPILER; |
| 370 |
|
| 371 |
if (Index >= ACPI_ARRAY_LENGTH (AslTableCompilerMsgs)) |
| 372 |
{ |
| 373 |
return ("[Unknown iASL Table Compiler exception ID]"); |
| 374 |
} |
| 375 |
} |
| 376 |
|
| 377 |
|
| 378 |
|
| 379 |
else if (MessageId <= ASL_MSG_PREPROCESSOR_END) |
| 380 |
{ |
| 381 |
MessageTable = AslPreprocessorMsgs; |
| 382 |
Index = MessageId - ASL_MSG_PREPROCESSOR; |
| 383 |
|
| 384 |
if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs)) |
| 385 |
{ |
| 386 |
return ("[Unknown iASL Preprocessor exception ID]"); |
| 387 |
} |
| 388 |
} |
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
else |
| 393 |
{ |
| 394 |
return ("[Unknown iASL exception ID]"); |
| 395 |
} |
| 396 |
|
| 397 |
return (MessageTable[Index]); |
| 398 |
} |
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
|
| 405 |
|
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
|
| 413 |
|
| 414 |
const char * |
| 415 |
AeDecodeExceptionLevel ( |
| 416 |
UINT8 Level) |
| 417 |
{ |
| 418 |
|
| 419 |
|
| 420 |
if (Level >= ACPI_ARRAY_LENGTH (AslErrorLevel)) |
| 421 |
{ |
| 422 |
return ("Unknown exception level"); |
| 423 |
} |
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
if (AslGbl_VerboseErrors) |
| 428 |
{ |
| 429 |
return (AslErrorLevel[Level]); |
| 430 |
} |
| 431 |
|
| 432 |
return (AslErrorLevelIde[Level]); |
| 433 |
} |
| 434 |
|
| 435 |
|
| 436 |
|
| 437 |
|
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
|
| 446 |
|
| 447 |
|
| 448 |
|
| 449 |
|
| 450 |
UINT16 |
| 451 |
AeBuildFullExceptionCode ( |
| 452 |
UINT8 Level, |
| 453 |
UINT16 MessageId) |
| 454 |
{ |
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
return (((Level + 1) * 1000) + MessageId); |
| 461 |
} |
| 462 |
|
| 463 |
|
| 464 |
#ifdef ACPI_HELP_APP |
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
|
| 480 |
#define AH_DISPLAY_ASL_EXCEPTION_TEXT(Status, Exception) \ |
| 481 |
printf ("%.4X: %s\n", Status, Exception) |
| 482 |
|
| 483 |
#define AH_DISPLAY_EXCEPTION(Status, Name) \ |
| 484 |
printf ("%.4X: %s\n", Status, Name) |
| 485 |
|
| 486 |
|
| 487 |
void |
| 488 |
AhDecodeAslException ( |
| 489 |
char *HexString) |
| 490 |
{ |
| 491 |
UINT32 i; |
| 492 |
UINT32 MessageId; |
| 493 |
const char *OneException; |
| 494 |
UINT32 Index = 1; |
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
if (!HexString) |
| 502 |
{ |
| 503 |
printf ("All defined iASL exception codes:\n\n"); |
| 504 |
printf ("Main iASL exceptions:\n\n"); |
| 505 |
AH_DISPLAY_EXCEPTION (0, |
| 506 |
"AE_OK (No error occurred)"); |
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
for (i = 1; Index < ACPI_ARRAY_LENGTH (AslCompilerMsgs); i++, Index++) |
| 511 |
{ |
| 512 |
AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslCompilerMsgs[i]); |
| 513 |
} |
| 514 |
|
| 515 |
printf ("\niASL Table Compiler exceptions:\n\n"); |
| 516 |
Index = ASL_MSG_TABLE_COMPILER; |
| 517 |
for (i = 0; i < ACPI_ARRAY_LENGTH (AslTableCompilerMsgs); i++, Index++) |
| 518 |
{ |
| 519 |
AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslTableCompilerMsgs[i]); |
| 520 |
} |
| 521 |
|
| 522 |
printf ("\niASL Preprocessor exceptions:\n\n"); |
| 523 |
Index = ASL_MSG_PREPROCESSOR; |
| 524 |
for (i = 0; i < ACPI_ARRAY_LENGTH (AslPreprocessorMsgs); i++, Index++) |
| 525 |
{ |
| 526 |
AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslPreprocessorMsgs[i]); |
| 527 |
} |
| 528 |
return; |
| 529 |
} |
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
MessageId = strtol (HexString, NULL, 16); |
| 534 |
OneException = AeDecodeMessageId ((UINT16) MessageId); |
| 535 |
AH_DISPLAY_ASL_EXCEPTION_TEXT (MessageId, OneException); |
| 536 |
} |
| 537 |
#endif |