diff options
Diffstat (limited to 'source/compiler/aslerror.c')
-rw-r--r-- | source/compiler/aslerror.c | 125 |
1 files changed, 118 insertions, 7 deletions
diff --git a/source/compiler/aslerror.c b/source/compiler/aslerror.c index 1931fffcf1233..8fae779d639e5 100644 --- a/source/compiler/aslerror.c +++ b/source/compiler/aslerror.c @@ -162,6 +162,8 @@ AeAddToErrorLog ( static BOOLEAN AslIsExceptionExpected ( + char *Filename, + UINT32 LineNumber, UINT8 Level, UINT16 MessageId); @@ -170,7 +172,8 @@ AslIsExceptionDisabled ( UINT8 Level, UINT16 MessageId); -static void AslInitEnode ( +static void +AslInitEnode ( ASL_ERROR_MSG **Enode, UINT8 Level, UINT16 MessageId, @@ -956,7 +959,7 @@ AslCommonError ( { /* Check if user wants to ignore this exception */ - if (AslIsExceptionIgnored (Level, MessageId)) + if (AslIsExceptionIgnored (Filename, LogicalLineNumber, Level, MessageId)) { return; } @@ -1087,6 +1090,8 @@ GetModifiedLevel ( BOOLEAN AslIsExceptionIgnored ( + char *Filename, + UINT32 LineNumber, UINT8 Level, UINT16 MessageId) { @@ -1096,7 +1101,8 @@ AslIsExceptionIgnored ( /* Note: this allows exception to be disabled and expected */ ExceptionIgnored = AslIsExceptionDisabled (Level, MessageId); - ExceptionIgnored |= AslIsExceptionExpected (Level, MessageId); + ExceptionIgnored |= + AslIsExceptionExpected (Filename, LineNumber, Level, MessageId); return (AslGbl_AllExceptionsDisabled || ExceptionIgnored); } @@ -1104,7 +1110,7 @@ AslIsExceptionIgnored ( /******************************************************************************* * - * FUNCTION: AslCheckExpectException + * FUNCTION: AslCheckExpectedException * * PARAMETERS: none * @@ -1120,6 +1126,8 @@ AslCheckExpectedExceptions ( void) { UINT8 i; + ASL_EXPECTED_MSG_NODE *Current = AslGbl_ExpectedErrorCodeList; + ASL_LOCATION_NODE *LocationNode; for (i = 0; i < AslGbl_ExpectedMessagesIndex; ++i) @@ -1130,12 +1138,32 @@ AslCheckExpectedExceptions ( AslGbl_ExpectedMessages[i].MessageIdStr); } } + + while (Current) + { + LocationNode = Current->LocationList; + + while (LocationNode) + { + if (!LocationNode->MessageReceived) + { + AslCommonError (ASL_ERROR, ASL_MSG_EXCEPTION_NOT_RECEIVED, + LocationNode->LineNumber, LocationNode->LineNumber, + LocationNode->LogicalByteOffset, LocationNode->Column, + LocationNode->Filename, Current->MessageIdStr); + } + + LocationNode = LocationNode->Next; + } + + Current = Current->Next; + } } /******************************************************************************* * - * FUNCTION: AslExpectException + * FUNCTION: AslLogExpectedException * * PARAMETERS: MessageIdString - ID of excepted exception during compile * @@ -1148,7 +1176,7 @@ AslCheckExpectedExceptions ( ******************************************************************************/ ACPI_STATUS -AslExpectException ( +AslLogExpectedException ( char *MessageIdString) { UINT32 MessageId; @@ -1184,6 +1212,61 @@ AslExpectException ( /******************************************************************************* * + * FUNCTION: AslLogExpectedExceptionByLine + * + * PARAMETERS: MessageIdString - ID of excepted exception during compile + * + * RETURN: Status + * + * DESCRIPTION: Enter a message ID into the global expected messages table + * based on file and line number. If these messages are not raised + * during the compilation, throw an error. + * + ******************************************************************************/ + +void +AslLogExpectedExceptionByLine ( + char *MessageIdString) +{ + ASL_LOCATION_NODE *NewErrorLocationNode; + ASL_EXPECTED_MSG_NODE *Current = AslGbl_ExpectedErrorCodeList; + UINT32 MessageId; + + + NewErrorLocationNode = UtLocalCalloc (sizeof (ASL_LOCATION_NODE)); + + NewErrorLocationNode->LineNumber = AslGbl_CurrentLineNumber; + NewErrorLocationNode->Filename = AslGbl_Files[ASL_FILE_INPUT].Filename; + NewErrorLocationNode->LogicalByteOffset = AslGbl_CurrentLineOffset; + NewErrorLocationNode->Column = AslGbl_CurrentColumn; + + MessageId = (UINT32) strtoul (MessageIdString, NULL, 0); + + /* search the existing list for a matching message ID */ + + while (Current && Current->MessageId != MessageId ) + { + Current = Current->Next; + } + if (!Current) + { + /* ID was not found, create a new node for this message ID */ + + Current = UtLocalCalloc (sizeof (ASL_EXPECTED_MSG_NODE)); + + Current->Next = AslGbl_ExpectedErrorCodeList; + Current->MessageIdStr = MessageIdString; + Current->MessageId = MessageId; + AslGbl_ExpectedErrorCodeList = Current; + } + + NewErrorLocationNode->Next = Current->LocationList; + Current->LocationList = NewErrorLocationNode; +} + + +/******************************************************************************* + * * FUNCTION: AslDisableException * * PARAMETERS: MessageIdString - ID to be disabled @@ -1272,6 +1355,7 @@ AslElevateException ( return (AE_OK); } + /******************************************************************************* * * FUNCTION: AslIsExceptionDisabled @@ -1288,9 +1372,13 @@ AslElevateException ( static BOOLEAN AslIsExceptionExpected ( + char *Filename, + UINT32 LineNumber, UINT8 Level, UINT16 MessageId) { + ASL_EXPECTED_MSG_NODE *Current = AslGbl_ExpectedErrorCodeList; + ASL_LOCATION_NODE *CurrentErrorLocation; UINT32 EncodedMessageId; UINT32 i; @@ -1308,6 +1396,28 @@ AslIsExceptionExpected ( } } + while (Current && Current->MessageId != EncodedMessageId) + { + Current = Current->Next; + } + if (!Current) + { + return (FALSE); + } + + CurrentErrorLocation = Current->LocationList; + + while (CurrentErrorLocation) + { + if (!strcmp (CurrentErrorLocation->Filename, Filename) && + CurrentErrorLocation->LineNumber == LineNumber) + { + return (CurrentErrorLocation->MessageReceived = TRUE); + } + + CurrentErrorLocation = CurrentErrorLocation->Next; + } + return (FALSE); } @@ -1410,7 +1520,8 @@ AslDualParseOpError ( /* Check if user wants to ignore this exception */ - if (AslIsExceptionIgnored (Level, MainMsgId) || !MainOp) + if (!MainOp || AslIsExceptionIgnored (MainOp->Asl.Filename, + MainOp->Asl.LogicalLineNumber, Level, MainMsgId)) { return; } |