summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler/aslerror.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2013-05-20 23:52:49 +0000
committerjkim <jkim@FreeBSD.org>2013-05-20 23:52:49 +0000
commitca7944e4059769f0f5788417db3d8f3b2a8e7996 (patch)
tree3858a454e4df3ea62639923664ce32f0d9706e26 /sys/contrib/dev/acpica/compiler/aslerror.c
parent4cdc15c1f748d4763888b9351c2316a878059a87 (diff)
parentaf69f95bba3597db53a980597cfd371c9f6ee7cf (diff)
downloadFreeBSD-src-ca7944e4059769f0f5788417db3d8f3b2a8e7996.zip
FreeBSD-src-ca7944e4059769f0f5788417db3d8f3b2a8e7996.tar.gz
Merge ACPICA 20130517.
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/aslerror.c')
-rw-r--r--sys/contrib/dev/acpica/compiler/aslerror.c135
1 files changed, 119 insertions, 16 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslerror.c b/sys/contrib/dev/acpica/compiler/aslerror.c
index 132d0bb..ff6ec36 100644
--- a/sys/contrib/dev/acpica/compiler/aslerror.c
+++ b/sys/contrib/dev/acpica/compiler/aslerror.c
@@ -201,6 +201,7 @@ AePrintException (
switch (Enode->Level)
{
case ASL_REMARK:
+
if (!Gbl_DisplayRemarks)
{
return;
@@ -208,6 +209,7 @@ AePrintException (
break;
case ASL_OPTIMIZATION:
+
if (!Gbl_DisplayOptimizations)
{
return;
@@ -215,6 +217,7 @@ AePrintException (
break;
default:
+
break;
}
}
@@ -676,6 +679,113 @@ AslCommonError (
/*******************************************************************************
*
+ * FUNCTION: AslDisableException
+ *
+ * PARAMETERS: MessageIdString - ID to be disabled
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Enter a message ID into the global disabled messages table
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AslDisableException (
+ char *MessageIdString)
+{
+ UINT32 MessageId;
+
+
+ /* Convert argument to an integer and validate it */
+
+ MessageId = (UINT32) strtoul (MessageIdString, NULL, 0);
+
+ if ((MessageId < 2000) || (MessageId > 5999))
+ {
+ printf ("\"%s\" is not a valid warning/remark ID\n",
+ MessageIdString);
+ return (AE_BAD_PARAMETER);
+ }
+
+ /* Insert value into the global disabled message array */
+
+ if (Gbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES)
+ {
+ printf ("Too many messages have been disabled (max %u)\n",
+ ASL_MAX_DISABLED_MESSAGES);
+ return (AE_LIMIT);
+ }
+
+ Gbl_DisabledMessages[Gbl_DisabledMessagesIndex] = MessageId;
+ Gbl_DisabledMessagesIndex++;
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AslIsExceptionDisabled
+ *
+ * PARAMETERS: Level - Seriousness (Warning/error, etc.)
+ * MessageId - Index into global message buffer
+ *
+ * RETURN: TRUE if exception/message should be ignored
+ *
+ * DESCRIPTION: Check if the user has specified options such that this
+ * exception should be ignored
+ *
+ ******************************************************************************/
+
+BOOLEAN
+AslIsExceptionDisabled (
+ UINT8 Level,
+ UINT8 MessageId)
+{
+ UINT32 EncodedMessageId;
+ UINT32 i;
+
+
+ switch (Level)
+ {
+ case ASL_WARNING2:
+ case ASL_WARNING3:
+
+ /* Check for global disable via -w1/-w2/-w3 options */
+
+ if (Level > Gbl_WarningLevel)
+ {
+ return (TRUE);
+ }
+ /* Fall through */
+
+ case ASL_WARNING:
+ case ASL_REMARK:
+ /*
+ * Ignore this warning/remark if it has been disabled by
+ * the user (-vw option)
+ */
+ EncodedMessageId = MessageId + ((Level + 1) * 1000);
+ for (i = 0; i < Gbl_DisabledMessagesIndex; i++)
+ {
+ /* Simple implementation via fixed array */
+
+ if (EncodedMessageId == Gbl_DisabledMessages[i])
+ {
+ return (TRUE);
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return (FALSE);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AslError
*
* PARAMETERS: Level - Seriousness (Warning/error, etc.)
@@ -698,32 +808,25 @@ AslError (
char *ExtraMessage)
{
- switch (Level)
- {
- case ASL_WARNING2:
- case ASL_WARNING3:
- if (Gbl_WarningLevel < Level)
- {
- return;
- }
- break;
+ /* Check if user wants to ignore this exception */
- default:
- break;
+ if (AslIsExceptionDisabled (Level, MessageId))
+ {
+ return;
}
if (Op)
{
AslCommonError (Level, MessageId, Op->Asl.LineNumber,
- Op->Asl.LogicalLineNumber,
- Op->Asl.LogicalByteOffset,
- Op->Asl.Column,
- Op->Asl.Filename, ExtraMessage);
+ Op->Asl.LogicalLineNumber,
+ Op->Asl.LogicalByteOffset,
+ Op->Asl.Column,
+ Op->Asl.Filename, ExtraMessage);
}
else
{
AslCommonError (Level, MessageId, 0,
- 0, 0, 0, NULL, ExtraMessage);
+ 0, 0, 0, NULL, ExtraMessage);
}
}
OpenPOWER on IntegriCloud