diff options
Diffstat (limited to 'source/compiler')
-rw-r--r-- | source/compiler/aslbtypes.c | 2 | ||||
-rw-r--r-- | source/compiler/aslcodegen.c | 2 | ||||
-rw-r--r-- | source/compiler/aslmap.c | 2 | ||||
-rw-r--r-- | source/compiler/aslmessages.c | 85 | ||||
-rw-r--r-- | source/compiler/aslmessages.h | 7 | ||||
-rw-r--r-- | source/compiler/aslnamesp.c | 35 | ||||
-rw-r--r-- | source/compiler/aslopcodes.c | 6 | ||||
-rw-r--r-- | source/compiler/aslprimaries.y | 10 | ||||
-rw-r--r-- | source/compiler/aslrules.y | 4 | ||||
-rw-r--r-- | source/compiler/asltypes.y | 1 |
10 files changed, 133 insertions, 21 deletions
diff --git a/source/compiler/aslbtypes.c b/source/compiler/aslbtypes.c index 796b61acc0c06..4e579c7eaf73b 100644 --- a/source/compiler/aslbtypes.c +++ b/source/compiler/aslbtypes.c @@ -672,7 +672,7 @@ AnMapObjTypeToBtype ( * * PARAMETERS: Btype - Bitfield of ACPI types * - * RETURN: The Etype corresponding the the Btype + * RETURN: The Etype corresponding the Btype * * DESCRIPTION: Convert a bitfield type to an encoded type * diff --git a/source/compiler/aslcodegen.c b/source/compiler/aslcodegen.c index 61e0673579546..ba0384e8452bd 100644 --- a/source/compiler/aslcodegen.c +++ b/source/compiler/aslcodegen.c @@ -700,7 +700,7 @@ CgUpdateHeader ( Checksum = (UINT8) (0 - Sum); - /* Re-write the the checksum byte */ + /* Re-write the checksum byte */ FlSeekFile (ASL_FILE_AML_OUTPUT, Op->Asl.FinalAmlOffset + ACPI_OFFSET (ACPI_TABLE_HEADER, Checksum)); diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c index 2c03cd0805a43..9a3ea588ba919 100644 --- a/source/compiler/aslmap.c +++ b/source/compiler/aslmap.c @@ -538,7 +538,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* TYPE_TRANSLATION */ OP_TABLE_ENTRY (AML_BYTE_OP, 1, 0, 0), /* UART_SERIALBUS */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), /* UART_SERIALBUSV2 */ OP_TABLE_ENTRY (AML_DEFAULT_ARG_OP, 0, 0, 0), -/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, 0), +/* UNICODE */ OP_TABLE_ENTRY (AML_BUFFER_OP, 0, OP_AML_PACKAGE, ACPI_BTYPE_BUFFER), /* UNLOAD */ OP_TABLE_ENTRY (AML_UNLOAD_OP, 0, 0, 0), /* UPDATERULE_ONES */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_WRITE_AS_ONES, 0, 0), /* UPDATERULE_PRESERVE */ OP_TABLE_ENTRY (AML_BYTE_OP, AML_FIELD_UPDATE_PRESERVE, 0, 0), diff --git a/source/compiler/aslmessages.c b/source/compiler/aslmessages.c index 320ad2aefa9b9..d883bc581d77a 100644 --- a/source/compiler/aslmessages.c +++ b/source/compiler/aslmessages.c @@ -384,6 +384,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_EXTERNAL_FOUND_HERE */ "External declaration below ", /* ASL_MSG_LOWER_CASE_NAMESEG */ "At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case", /* ASL_MSG_LOWER_CASE_NAMEPATH */ "At least one lower case letter found in NamePath, ASL is case insensitive - converting to upper case", +/* ASL_MSG_UUID_NOT_FOUND */ "Unknown UUID string" }; /* Table compiler */ @@ -457,7 +458,7 @@ AeDecodeMessageId ( if (Index >= ACPI_ARRAY_LENGTH (AslCompilerMsgs)) { - return ("[Unknown ASL Compiler exception ID]"); + return ("[Unknown iASL Compiler exception ID]"); } } @@ -470,7 +471,7 @@ AeDecodeMessageId ( if (Index >= ACPI_ARRAY_LENGTH (AslTableCompilerMsgs)) { - return ("[Unknown Table Compiler exception ID]"); + return ("[Unknown iASL Table Compiler exception ID]"); } } @@ -483,7 +484,7 @@ AeDecodeMessageId ( if (Index >= ACPI_ARRAY_LENGTH (AslPreprocessorMsgs)) { - return ("[Unknown Preprocessor exception ID]"); + return ("[Unknown iASL Preprocessor exception ID]"); } } @@ -491,7 +492,7 @@ AeDecodeMessageId ( else { - return ("[Unknown exception/component ID]"); + return ("[Unknown iASL exception ID]"); } return (MessageTable[Index]); @@ -559,3 +560,79 @@ AeBuildFullExceptionCode ( */ return (((Level + 1) * 1000) + MessageId); } + + +#ifdef ACPI_HELP_APP +/******************************************************************************* + * + * FUNCTION: AhDecodeAslException + * + * PARAMETERS: HexString - iASL status string from command line, in + * hex. If null, display all exceptions. + * + * RETURN: None + * + * DESCRIPTION: Decode and display an iASL exception code. Note1: a + * NULL string for HexString displays all known iASL exceptions. Note2: + * implements the -x option for AcpiHelp. + * + ******************************************************************************/ + +#define AH_DISPLAY_ASL_EXCEPTION_TEXT(Status, Exception) \ + printf ("%.4X: %s\n", Status, Exception) + +#define AH_DISPLAY_EXCEPTION(Status, Name) \ + printf ("%.4X: %s\n", Status, Name) + + +void +AhDecodeAslException ( + char *HexString) +{ + UINT32 i; + UINT32 MessageId; + const char *OneException; + UINT32 Index = 1; + + + /* + * A null input string means to decode and display all known + * exception codes. + */ + if (!HexString) + { + printf ("All defined iASL exception codes:\n\n"); + printf ("Main iASL exceptions:\n\n"); + AH_DISPLAY_EXCEPTION (0, + "AE_OK (No error occurred)"); + + /* Display codes in each block of exception types */ + + for (i = 1; Index < ACPI_ARRAY_LENGTH (AslCompilerMsgs); i++, Index++) + { + AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslCompilerMsgs[i]); + } + + printf ("\niASL Table Compiler exceptions:\n\n"); + Index = ASL_MSG_TABLE_COMPILER; + for (i = 0; i < ACPI_ARRAY_LENGTH (AslTableCompilerMsgs); i++, Index++) + { + AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslTableCompilerMsgs[i]); + } + + printf ("\niASL Preprocessor exceptions:\n\n"); + Index = ASL_MSG_PREPROCESSOR; + for (i = 0; i < ACPI_ARRAY_LENGTH (AslPreprocessorMsgs); i++, Index++) + { + AH_DISPLAY_ASL_EXCEPTION_TEXT (Index, AslPreprocessorMsgs[i]); + } + return; + } + + /* HexString is valid - convert it to a MessageId and decode it */ + + MessageId = strtol (HexString, NULL, 16); + OneException = AeDecodeMessageId ((UINT16) MessageId); + AH_DISPLAY_ASL_EXCEPTION_TEXT (MessageId, OneException); +} +#endif diff --git a/source/compiler/aslmessages.h b/source/compiler/aslmessages.h index 8a2b5c6c7da7e..2313d212a4efe 100644 --- a/source/compiler/aslmessages.h +++ b/source/compiler/aslmessages.h @@ -152,7 +152,6 @@ #ifndef __ASLMESSAGES_H #define __ASLMESSAGES_H - /* These values must match error type string tables in aslmessages.c */ typedef enum @@ -167,9 +166,12 @@ typedef enum } ASL_MESSAGE_TYPES; - #define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings for types above */ +void +AhDecodeAslException ( + char *HexString); + /* * Exception code blocks, 0 - 999 * Available for new exception blocks: 600 - 999 @@ -386,6 +388,7 @@ typedef enum ASL_MSG_EXTERNAL_FOUND_HERE, ASL_MSG_LOWER_CASE_NAMESEG, ASL_MSG_LOWER_CASE_NAMEPATH, + ASL_MSG_UUID_NOT_FOUND, /* These messages are used by the Data Table compiler only */ diff --git a/source/compiler/aslnamesp.c b/source/compiler/aslnamesp.c index f74b5ffb45335..0a099a0b9b1e8 100644 --- a/source/compiler/aslnamesp.c +++ b/source/compiler/aslnamesp.c @@ -226,8 +226,8 @@ NsDisplayNamespace ( /* File header */ - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Contents of ACPI Namespace\n\n"); - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Count Depth Name - Type\n\n"); + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "Contents of ACPI Namespace\n\n" + "Count Depth Name - Type\n\n"); /* Walk entire namespace from the root */ @@ -239,14 +239,21 @@ NsDisplayNamespace ( return (Status); } - /* Print the full pathname for each namespace node */ + /* Print the full pathname for each namespace node in the common namespace */ - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "\nNamespace pathnames\n\n"); + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, + "\nNamespace pathnames and where declared:\n" + "<NamePath, Object type, Containing file, Line number within file>\n\n"); Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, FALSE, NsDoOnePathname, NULL, NULL, NULL); + /* + * We just dumped the entire common namespace, we don't want to do it + * again for other input files. + */ + AslGbl_NsOutputFlag = FALSE; return (Status); } @@ -512,7 +519,7 @@ NsDoOneNamespaceObject ( * * RETURN: Status * - * DESCRIPTION: Print the full pathname for a namespace node. + * DESCRIPTION: Print the full pathname and addtional info for a namespace node. * ******************************************************************************/ @@ -528,6 +535,13 @@ NsDoOnePathname ( ACPI_BUFFER TargetPath; + /* Ignore predefined namespace nodes and External declarations */ + + if (!Node->Op || (Node->Flags & ANOBJ_IS_EXTERNAL)) + { + return (AE_OK); + } + TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER; Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE); if (ACPI_FAILURE (Status)) @@ -535,8 +549,15 @@ NsDoOnePathname ( return (Status); } - FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", - ACPI_CAST_PTR (char, TargetPath.Pointer)); + /* + * Print the full pathname (and other information) + * for each namespace node in the common namespace + */ + FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%-41s %-12s %s, %u\n", + ACPI_CAST_PTR (char, TargetPath.Pointer), + AcpiUtGetTypeName (Node->Type), + Node->Op->Asl.Filename, Node->Op->Asl.LogicalLineNumber); + ACPI_FREE (TargetPath.Pointer); return (AE_OK); } diff --git a/source/compiler/aslopcodes.c b/source/compiler/aslopcodes.c index 14eb63ddcdb2f..b2a0236503d7d 100644 --- a/source/compiler/aslopcodes.c +++ b/source/compiler/aslopcodes.c @@ -798,7 +798,13 @@ OpcDoUuId ( } else { + /* Convert UUID string to a buffer, check for a known UUID */ + AcpiUtConvertStringToUuid (InString, Buffer); + if (!AcpiAhMatchUuid (Buffer)) + { + AslError (ASL_REMARK, ASL_MSG_UUID_NOT_FOUND, Op, NULL); + } } /* Change Op to a Buffer */ diff --git a/source/compiler/aslprimaries.y b/source/compiler/aslprimaries.y index 1fb9e501dddd3..68fdbe840de9d 100644 --- a/source/compiler/aslprimaries.y +++ b/source/compiler/aslprimaries.y @@ -500,7 +500,7 @@ DivideTerm EISAIDTerm : PARSEOP_EISAID PARSEOP_OPEN_PAREN - StringData + StringLiteral PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_EISAID, $3);} | PARSEOP_EISAID PARSEOP_OPEN_PAREN @@ -635,7 +635,7 @@ FprintfTerm : PARSEOP_FPRINTF PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_FPRINTF);} TermArg ',' - StringData + StringLiteral PrintfArgList PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,3,$4,$6,$7);} | PARSEOP_FPRINTF @@ -1091,7 +1091,7 @@ PowerResTerm PrintfTerm : PARSEOP_PRINTF PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_PRINTF);} - StringData + StringLiteral PrintfArgList PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,$4,$5);} | PARSEOP_PRINTF @@ -1412,7 +1412,7 @@ ToStringTerm ToUUIDTerm : PARSEOP_TOUUID PARSEOP_OPEN_PAREN - StringData + StringLiteral PARSEOP_CLOSE_PAREN {$$ = TrSetOpIntegerValue (PARSEOP_TOUUID, $3);} | PARSEOP_TOUUID PARSEOP_OPEN_PAREN @@ -1422,7 +1422,7 @@ ToUUIDTerm UnicodeTerm : PARSEOP_UNICODE PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafOp (PARSEOP_UNICODE);} - StringData + StringLiteral PARSEOP_CLOSE_PAREN {$$ = TrLinkOpChildren ($<n>3,2,0,$4);} | PARSEOP_UNICODE PARSEOP_OPEN_PAREN diff --git a/source/compiler/aslrules.y b/source/compiler/aslrules.y index f998527b3a36b..e7e678d2058e4 100644 --- a/source/compiler/aslrules.y +++ b/source/compiler/aslrules.y @@ -523,6 +523,10 @@ StringData | String {} ; +StringLiteral + : String {} + ; + ByteConst : Integer {$$ = TrSetOpIntegerValue (PARSEOP_BYTECONST, $1);} ; diff --git a/source/compiler/asltypes.y b/source/compiler/asltypes.y index 85d3af9acf8d3..5c07c5df8e355 100644 --- a/source/compiler/asltypes.y +++ b/source/compiler/asltypes.y @@ -178,6 +178,7 @@ NoEcho(' %type <n> RequiredTarget %type <n> SimpleName %type <n> StringData +%type <n> StringLiteral %type <n> Target %type <n> Term %type <n> TermArg |