mirror of
https://github.com/acpica/acpica/
synced 2025-02-25 01:44:33 +03:00
Merge branch 'master' of ssh://ssh.github.com/acpica/acpica
This commit is contained in:
commit
5159c55983
@ -773,12 +773,6 @@ CgWriteNode (
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) &&
|
||||
AslGbl_DoExternals == FALSE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Op->Asl.FinalAmlLength = 0;
|
||||
|
||||
switch (Op->Asl.AmlOpcode)
|
||||
|
@ -388,23 +388,20 @@ CmDoCompile (
|
||||
|
||||
/* Resolve External Declarations */
|
||||
|
||||
if (AslGbl_DoExternals)
|
||||
{
|
||||
Event = UtBeginEvent ("Resolve all Externals");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n");
|
||||
Event = UtBeginEvent ("Resolve all Externals");
|
||||
DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n");
|
||||
|
||||
if (AslGbl_DoExternalsInPlace)
|
||||
{
|
||||
TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
|
||||
ExAmlExternalWalkBegin, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
|
||||
ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL);
|
||||
}
|
||||
UtEndEvent (Event);
|
||||
if (AslGbl_DoExternalsInPlace)
|
||||
{
|
||||
TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD,
|
||||
ExAmlExternalWalkBegin, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE,
|
||||
ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL);
|
||||
}
|
||||
UtEndEvent (Event);
|
||||
|
||||
/*
|
||||
* Semantic analysis. This can happen only after the
|
||||
|
@ -474,6 +474,10 @@ ACPI_STATUS
|
||||
AslExpectException (
|
||||
char *MessageIdString);
|
||||
|
||||
ACPI_STATUS
|
||||
AslElevateException (
|
||||
char *MessageIdString);
|
||||
|
||||
ACPI_STATUS
|
||||
AslDisableException (
|
||||
char *MessageIdString);
|
||||
|
@ -201,6 +201,11 @@ AePrintSubError (
|
||||
FILE *OutputFile,
|
||||
ASL_ERROR_MSG *Enode);
|
||||
|
||||
static UINT8
|
||||
GetModifiedLevel (
|
||||
UINT8 Level,
|
||||
UINT16 MessageId);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -968,11 +973,12 @@ AslLogNewError (
|
||||
ASL_ERROR_MSG *SubError)
|
||||
{
|
||||
ASL_ERROR_MSG *Enode = NULL;
|
||||
UINT8 ModifiedLevel = GetModifiedLevel (Level, MessageId);
|
||||
|
||||
|
||||
AslInitEnode (&Enode, Level, MessageId, LineNumber, LogicalLineNumber,
|
||||
LogicalByteOffset, Column, Filename, Message, SourceLine,
|
||||
SubError);
|
||||
AslInitEnode (&Enode, ModifiedLevel, MessageId, LineNumber,
|
||||
LogicalLineNumber, LogicalByteOffset, Column, Filename, Message,
|
||||
SourceLine, SubError);
|
||||
|
||||
/* Add the new node to the error node list */
|
||||
|
||||
@ -985,7 +991,7 @@ AslLogNewError (
|
||||
AePrintException (ASL_FILE_STDERR, Enode, NULL);
|
||||
}
|
||||
|
||||
AslGbl_ExceptionCount[Level]++;
|
||||
AslGbl_ExceptionCount[ModifiedLevel]++;
|
||||
if (AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT)
|
||||
{
|
||||
printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT);
|
||||
@ -999,6 +1005,44 @@ AslLogNewError (
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: GetModifiedLevel
|
||||
*
|
||||
* PARAMETERS: Level - Seriousness (Warning/error, etc.)
|
||||
* MessageId - Index into global message buffer
|
||||
*
|
||||
* RETURN: UINT8 - modified level
|
||||
*
|
||||
* DESCRIPTION: Get the modified level of exception codes that are reported as
|
||||
* errors from the -ww option.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT8
|
||||
GetModifiedLevel (
|
||||
UINT8 Level,
|
||||
UINT16 MessageId)
|
||||
{
|
||||
UINT16 i;
|
||||
UINT16 ExceptionCode;
|
||||
|
||||
|
||||
ExceptionCode = AeBuildFullExceptionCode (Level, MessageId);
|
||||
|
||||
for (i = 0; i < AslGbl_ElevatedMessagesIndex; i++)
|
||||
{
|
||||
if (ExceptionCode == AslGbl_ElevatedMessages[i])
|
||||
{
|
||||
return (ASL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
return (Level);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslIsExceptionIgnored
|
||||
@ -1155,6 +1199,51 @@ AslDisableException (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslElevateException
|
||||
*
|
||||
* PARAMETERS: MessageIdString - ID of excepted exception during compile
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Enter a message ID into the global elevated exceptions table.
|
||||
* These messages will be considered as compilation errors.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AslElevateException (
|
||||
char *MessageIdString)
|
||||
{
|
||||
UINT32 MessageId;
|
||||
|
||||
|
||||
/* Convert argument to an integer and validate it */
|
||||
|
||||
MessageId = (UINT32) strtoul (MessageIdString, NULL, 0);
|
||||
|
||||
if (MessageId > 6999)
|
||||
{
|
||||
printf ("\"%s\" is not a valid warning/remark/erro ID\n",
|
||||
MessageIdString);
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Insert value into the global expected message array */
|
||||
|
||||
if (AslGbl_ElevatedMessagesIndex >= ASL_MAX_ELEVATED_MESSAGES)
|
||||
{
|
||||
printf ("Too many messages have been registered as elevated (max %d)\n",
|
||||
ASL_MAX_DISABLED_MESSAGES);
|
||||
return (AE_LIMIT);
|
||||
}
|
||||
|
||||
AslGbl_ElevatedMessages[AslGbl_ExpectedMessagesIndex] = MessageId;
|
||||
AslGbl_ElevatedMessagesIndex++;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AslIsExceptionDisabled
|
||||
|
@ -255,6 +255,7 @@ extern int AslCompilerdebug;
|
||||
#define ASL_STRING_BUFFER_SIZE (1024 * 32) /* 32k */
|
||||
#define ASL_MAX_DISABLED_MESSAGES 32
|
||||
#define ASL_MAX_EXPECTED_MESSAGES 32
|
||||
#define ASL_MAX_ELEVATED_MESSAGES 32
|
||||
#define HEX_TABLE_LINE_SIZE 8
|
||||
#define HEX_LISTING_LINE_SIZE 8
|
||||
|
||||
@ -319,7 +320,6 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_AllExceptionsDisable
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_PruneParseTree, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoTypechecking, TRUE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_EnableReferenceTypechecking, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoExternals, TRUE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoExternalsInPlace, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoAslConversion, FALSE);
|
||||
ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_OptimizeTrivialParseNodes, TRUE);
|
||||
@ -394,6 +394,7 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_CurrentAmlOffset, 0)
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_CurrentLine, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_DisabledMessagesIndex, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_ExpectedMessagesIndex, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_ElevatedMessagesIndex, 0);
|
||||
ASL_EXTERN UINT8 ASL_INIT_GLOBAL (AslGbl_HexBytesWereWritten, FALSE);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_NumNamespaceObjects, 0);
|
||||
ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_ReservedMethods, 0);
|
||||
@ -435,6 +436,7 @@ ASL_EXTERN char AslGbl_StringBuffer[ASL_STRING_BUFFER_SIZE];
|
||||
ASL_EXTERN char AslGbl_StringBuffer2[ASL_STRING_BUFFER_SIZE];
|
||||
ASL_EXTERN UINT32 AslGbl_DisabledMessages[ASL_MAX_DISABLED_MESSAGES];
|
||||
ASL_EXTERN ASL_EXPECTED_MESSAGE AslGbl_ExpectedMessages[ASL_MAX_EXPECTED_MESSAGES];
|
||||
ASL_EXTERN UINT32 AslGbl_ElevatedMessages[ASL_MAX_ELEVATED_MESSAGES];
|
||||
|
||||
|
||||
#endif /* __ASLGLOBAL_H */
|
||||
|
@ -209,6 +209,7 @@ Usage (
|
||||
ACPI_OPTION ("-vx <messageid>", "Expect a specific warning, remark, or error");
|
||||
ACPI_OPTION ("-w <1|2|3>", "Set warning reporting level");
|
||||
ACPI_OPTION ("-we", "Report warnings as errors");
|
||||
ACPI_OPTION ("-ww <messageid>", "Report specific warning or remark as error");
|
||||
|
||||
printf ("\nAML Bytecode Generation (*.aml):\n");
|
||||
ACPI_OPTION ("-oa", "Disable all optimizations (compatibility mode)");
|
||||
|
@ -519,10 +519,7 @@ CgGenerateAmlLengths (
|
||||
|
||||
case PARSEOP_EXTERNAL:
|
||||
|
||||
if (AslGbl_DoExternals == TRUE)
|
||||
{
|
||||
CgGenerateAmlOpcodeLength (Op);
|
||||
}
|
||||
CgGenerateAmlOpcodeLength (Op);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -927,15 +927,6 @@ OpcGenerateAmlOpcode (
|
||||
AslGbl_HasIncludeFiles = TRUE;
|
||||
break;
|
||||
|
||||
case PARSEOP_EXTERNAL:
|
||||
|
||||
if (AslGbl_DoExternals == FALSE)
|
||||
{
|
||||
Op->Asl.Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
|
||||
Op->Asl.Child->Asl.Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
|
||||
}
|
||||
break;
|
||||
|
||||
case PARSEOP_TIMER:
|
||||
|
||||
if (AcpiGbl_IntegerBitWidth == 32)
|
||||
|
@ -982,6 +982,23 @@ AslDoOptions (
|
||||
AslGbl_WarningsAsErrors = TRUE;
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
|
||||
/* Get the required argument */
|
||||
|
||||
if (AcpiGetoptArgument (argc, argv))
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
|
||||
Status = AslElevateException (AcpiGbl_Optarg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
printf ("Unknown option: -w%s\n", AcpiGbl_Optarg);
|
||||
|
@ -460,11 +460,7 @@ TrTransformSubtree (
|
||||
|
||||
case PARSEOP_EXTERNAL:
|
||||
|
||||
if (AslGbl_DoExternals == TRUE)
|
||||
{
|
||||
ExDoExternal (Op);
|
||||
}
|
||||
|
||||
ExDoExternal (Op);
|
||||
break;
|
||||
|
||||
case PARSEOP___METHOD__:
|
||||
|
Loading…
x
Reference in New Issue
Block a user