Don't check acpi table length for the revision values larger than the largest publish...
authorlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 12 Aug 2009 01:23:33 +0000 (01:23 +0000)
committerlgao4 <lgao4@7335b38e-4728-0410-8992-fb3ffe349368>
Wed, 12 Aug 2009 01:23:33 +0000 (01:23 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1678 7335b38e-4728-0410-8992-fb3ffe349368

Source/C/GenFw/GenFw.c
Source/C/Include/IndustryStandard/Acpi1_0.h

index fd2b9d4..562ad7d 100644 (file)
@@ -324,6 +324,10 @@ Returns:
       ExpectedLength = sizeof(EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE);\r
       break;\r
     default:\r
+      if (AcpiHeader->Revision > EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION) {\r
+        ExpectedLength = AcpiHeader->Length;\r
+        break;\r
+      }\r
       Error (NULL, 0, 3000, "Invalid", "FACP revision check failed.");\r
       return STATUS_ERROR;\r
     }\r
@@ -338,7 +342,10 @@ Returns:
   //\r
   case EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE:\r
     Facs = (EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *)AcpiTable;\r
-    if ((Facs->Version != 0) &&\r
+    if (Facs->Version > EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION) {\r
+      break;\r
+    }\r
+    if ((Facs->Version != EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION) &&\r
         (Facs->Version != EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION) &&\r
         (Facs->Version != EFI_ACPI_3_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION)){\r
       Error (NULL, 0, 3000, "Invalid", "FACS version check failed.");\r
@@ -357,8 +364,7 @@ Returns:
   //\r
   case EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE:\r
     if (AcpiHeader->Revision > EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION) {\r
-      Error (NULL, 0, 3000, "Invalid", "DSDT revision check failed.");\r
-      return STATUS_ERROR;\r
+      break;\r
     }\r
     if (AcpiHeader->Length <= sizeof(EFI_ACPI_DESCRIPTION_HEADER)) {\r
       Error (NULL, 0, 3000, "Invalid", "DSDT length check failed.");\r
@@ -370,6 +376,9 @@ Returns:
   // "APIC" Multiple APIC Description Table\r
   //\r
   case EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE:\r
+    if (AcpiHeader->Revision > EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION) {\r
+      break;\r
+    }\r
     if ((AcpiHeader->Revision != EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION) &&\r
         (AcpiHeader->Revision != EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION) &&\r
         (AcpiHeader->Revision != EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION)) {\r
@@ -386,6 +395,9 @@ Returns:
   // "MCFG" PCI Express Memory Mapped Configuration Space Base Address Description Table\r
   //\r
   case EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE:\r
+    if (AcpiHeader->Revision > EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION) {\r
+      break;\r
+    }\r
     if (AcpiHeader->Revision != EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION) {\r
       Error (NULL, 0, 3000, "Invalid", "MCFG revision check failed.");\r
       return STATUS_ERROR;\r
index 946c524..fb85993 100644 (file)
@@ -114,6 +114,7 @@ typedef struct {
 #define EFI_ACPI_1_0_TMR_VAL_EXT  (1 << 8)\r
 #define EFI_ACPI_1_0_DCK_CAP      (1 << 9)\r
 \r
+#define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION  0x0\r
 //\r
 // Firmware ACPI Control Structure\r
 //\r