Deleted Added
full compact
aslerror.c (249112) aslerror.c (250838)
1/******************************************************************************
2 *
3 * Module Name: aslerror - Error handling and statistics
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2013, Intel Corp.

--- 187 unchanged lines hidden (view full) ---

196 */
197 if (!Header)
198 {
199 /* Ignore remarks if requested */
200
201 switch (Enode->Level)
202 {
203 case ASL_REMARK:
1/******************************************************************************
2 *
3 * Module Name: aslerror - Error handling and statistics
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2013, Intel Corp.

--- 187 unchanged lines hidden (view full) ---

196 */
197 if (!Header)
198 {
199 /* Ignore remarks if requested */
200
201 switch (Enode->Level)
202 {
203 case ASL_REMARK:
204
204 if (!Gbl_DisplayRemarks)
205 {
206 return;
207 }
208 break;
209
210 case ASL_OPTIMIZATION:
205 if (!Gbl_DisplayRemarks)
206 {
207 return;
208 }
209 break;
210
211 case ASL_OPTIMIZATION:
212
211 if (!Gbl_DisplayOptimizations)
212 {
213 return;
214 }
215 break;
216
217 default:
213 if (!Gbl_DisplayOptimizations)
214 {
215 return;
216 }
217 break;
218
219 default:
220
218 break;
219 }
220 }
221
222 /* Get the file handles */
223
224 OutputFile = Gbl_Files[FileId].Handle;
225

--- 445 unchanged lines hidden (view full) ---

671 }
672
673 return;
674}
675
676
677/*******************************************************************************
678 *
221 break;
222 }
223 }
224
225 /* Get the file handles */
226
227 OutputFile = Gbl_Files[FileId].Handle;
228

--- 445 unchanged lines hidden (view full) ---

674 }
675
676 return;
677}
678
679
680/*******************************************************************************
681 *
682 * FUNCTION: AslDisableException
683 *
684 * PARAMETERS: MessageIdString - ID to be disabled
685 *
686 * RETURN: Status
687 *
688 * DESCRIPTION: Enter a message ID into the global disabled messages table
689 *
690 ******************************************************************************/
691
692ACPI_STATUS
693AslDisableException (
694 char *MessageIdString)
695{
696 UINT32 MessageId;
697
698
699 /* Convert argument to an integer and validate it */
700
701 MessageId = (UINT32) strtoul (MessageIdString, NULL, 0);
702
703 if ((MessageId < 2000) || (MessageId > 5999))
704 {
705 printf ("\"%s\" is not a valid warning/remark ID\n",
706 MessageIdString);
707 return (AE_BAD_PARAMETER);
708 }
709
710 /* Insert value into the global disabled message array */
711
712 if (Gbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES)
713 {
714 printf ("Too many messages have been disabled (max %u)\n",
715 ASL_MAX_DISABLED_MESSAGES);
716 return (AE_LIMIT);
717 }
718
719 Gbl_DisabledMessages[Gbl_DisabledMessagesIndex] = MessageId;
720 Gbl_DisabledMessagesIndex++;
721 return (AE_OK);
722}
723
724
725/*******************************************************************************
726 *
727 * FUNCTION: AslIsExceptionDisabled
728 *
729 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
730 * MessageId - Index into global message buffer
731 *
732 * RETURN: TRUE if exception/message should be ignored
733 *
734 * DESCRIPTION: Check if the user has specified options such that this
735 * exception should be ignored
736 *
737 ******************************************************************************/
738
739BOOLEAN
740AslIsExceptionDisabled (
741 UINT8 Level,
742 UINT8 MessageId)
743{
744 UINT32 EncodedMessageId;
745 UINT32 i;
746
747
748 switch (Level)
749 {
750 case ASL_WARNING2:
751 case ASL_WARNING3:
752
753 /* Check for global disable via -w1/-w2/-w3 options */
754
755 if (Level > Gbl_WarningLevel)
756 {
757 return (TRUE);
758 }
759 /* Fall through */
760
761 case ASL_WARNING:
762 case ASL_REMARK:
763 /*
764 * Ignore this warning/remark if it has been disabled by
765 * the user (-vw option)
766 */
767 EncodedMessageId = MessageId + ((Level + 1) * 1000);
768 for (i = 0; i < Gbl_DisabledMessagesIndex; i++)
769 {
770 /* Simple implementation via fixed array */
771
772 if (EncodedMessageId == Gbl_DisabledMessages[i])
773 {
774 return (TRUE);
775 }
776 }
777 break;
778
779 default:
780 break;
781 }
782
783 return (FALSE);
784}
785
786
787/*******************************************************************************
788 *
679 * FUNCTION: AslError
680 *
681 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
682 * MessageId - Index into global message buffer
683 * Op - Parse node where error happened
684 * ExtraMessage - additional error message
685 *
686 * RETURN: None

--- 6 unchanged lines hidden (view full) ---

693void
694AslError (
695 UINT8 Level,
696 UINT8 MessageId,
697 ACPI_PARSE_OBJECT *Op,
698 char *ExtraMessage)
699{
700
789 * FUNCTION: AslError
790 *
791 * PARAMETERS: Level - Seriousness (Warning/error, etc.)
792 * MessageId - Index into global message buffer
793 * Op - Parse node where error happened
794 * ExtraMessage - additional error message
795 *
796 * RETURN: None

--- 6 unchanged lines hidden (view full) ---

803void
804AslError (
805 UINT8 Level,
806 UINT8 MessageId,
807 ACPI_PARSE_OBJECT *Op,
808 char *ExtraMessage)
809{
810
701 switch (Level)
702 {
703 case ASL_WARNING2:
704 case ASL_WARNING3:
705 if (Gbl_WarningLevel < Level)
706 {
707 return;
708 }
709 break;
811 /* Check if user wants to ignore this exception */
710
812
711 default:
712 break;
813 if (AslIsExceptionDisabled (Level, MessageId))
814 {
815 return;
713 }
714
715 if (Op)
716 {
717 AslCommonError (Level, MessageId, Op->Asl.LineNumber,
816 }
817
818 if (Op)
819 {
820 AslCommonError (Level, MessageId, Op->Asl.LineNumber,
718 Op->Asl.LogicalLineNumber,
719 Op->Asl.LogicalByteOffset,
720 Op->Asl.Column,
721 Op->Asl.Filename, ExtraMessage);
821 Op->Asl.LogicalLineNumber,
822 Op->Asl.LogicalByteOffset,
823 Op->Asl.Column,
824 Op->Asl.Filename, ExtraMessage);
722 }
723 else
724 {
725 AslCommonError (Level, MessageId, 0,
825 }
826 else
827 {
828 AslCommonError (Level, MessageId, 0,
726 0, 0, 0, NULL, ExtraMessage);
829 0, 0, 0, NULL, ExtraMessage);
727 }
728}
729
730
731/*******************************************************************************
732 *
733 * FUNCTION: AslCoreSubsystemError
734 *

--- 69 unchanged lines hidden ---
830 }
831}
832
833
834/*******************************************************************************
835 *
836 * FUNCTION: AslCoreSubsystemError
837 *

--- 69 unchanged lines hidden ---