]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportAcpiSupportProtocol.c
InstallAcpiTable() - Do not update the checksum in the passed in buffer – the buffer...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / Acpi / AcpiSupportDxe / AcpiSupportAcpiSupportProtocol.c
index 6312e2ba363a19088cb395770273cd150d8e4cc4..a54cffb169fb844e495b9627823ea3a982a4e65c 100644 (file)
@@ -390,8 +390,6 @@ InstallAcpiTable (
   EFI_ACPI_SUPPORT_PROTOCOL *AcpiSupport;\r
   EFI_STATUS                Status;\r
   VOID                      *AcpiTableBufferConst;\r
-  UINT32                    Length;\r
-  UINT8                     Checksum;\r
 \r
   //\r
   // Check for invalid input parameters\r
@@ -401,16 +399,6 @@ InstallAcpiTable (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  Length = ((EFI_ACPI_COMMON_HEADER *) AcpiTableBuffer)->Length;\r
-  Checksum = CalculateCheckSum8 ((UINT8 *)AcpiTableBuffer, Length);\r
-  if (Checksum != 0) {\r
-    AcpiPlatformChecksum (\r
-      (VOID *)AcpiTableBuffer,\r
-      (UINTN)Length,\r
-      OFFSET_OF (EFI_ACPI_DESCRIPTION_HEADER, Checksum)\r
-      );\r
-  }\r
-\r
   //\r
   // Get the instance of the ACPI support protocol\r
   //\r
@@ -425,7 +413,7 @@ InstallAcpiTable (
   Status = AcpiSupport->SetAcpiTable (\r
                           AcpiSupport,\r
                           AcpiTableBufferConst,\r
-                          FALSE,\r
+                          TRUE,\r
                           EFI_ACPI_TABLE_VERSION_1_0B | EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0,\r
                           TableKey\r
                           );\r
@@ -789,22 +777,21 @@ AddTableToList (
       //\r
       // Update pointers in FADT.  If tables don't exist this will put NULL pointers there.\r
       //\r
-      if (AcpiSupportInstance->Fadt3 != NULL) {\r
-        AcpiSupportInstance->Fadt3->FirmwareCtrl  = (UINT32) (UINTN) AcpiSupportInstance->Facs3;\r
-        Buffer64 = (UINT64) (UINTN) AcpiSupportInstance->Facs3;\r
-        CopyMem (\r
-          &AcpiSupportInstance->Fadt3->XFirmwareCtrl,\r
-          &Buffer64,\r
-          sizeof (UINT64)\r
-          );\r
-        AcpiSupportInstance->Fadt3->Dsdt  = (UINT32) (UINTN) AcpiSupportInstance->Dsdt3;\r
-        Buffer64                          = (UINT64) (UINTN) AcpiSupportInstance->Dsdt3;\r
-        CopyMem (\r
-          &AcpiSupportInstance->Fadt3->XDsdt,\r
-          &Buffer64,\r
-          sizeof (UINT64)\r
-          );\r
-      }\r
+      AcpiSupportInstance->Fadt3->FirmwareCtrl  = (UINT32) (UINTN) AcpiSupportInstance->Facs3;\r
+      Buffer64 = (UINT64) (UINTN) AcpiSupportInstance->Facs3;\r
+      CopyMem (\r
+        &AcpiSupportInstance->Fadt3->XFirmwareCtrl,\r
+        &Buffer64,\r
+        sizeof (UINT64)\r
+        );\r
+      AcpiSupportInstance->Fadt3->Dsdt  = (UINT32) (UINTN) AcpiSupportInstance->Dsdt3;\r
+      Buffer64                          = (UINT64) (UINTN) AcpiSupportInstance->Dsdt3;\r
+      CopyMem (\r
+        &AcpiSupportInstance->Fadt3->XDsdt,\r
+        &Buffer64,\r
+        sizeof (UINT64)\r
+        );\r
+\r
       //\r
       // RSDP OEM information is updated to match the FADT OEM information\r
       //\r
@@ -843,7 +830,8 @@ AddTableToList (
         sizeof (UINT64)\r
         );\r
       AcpiSupportInstance->Xsdt->OemRevision = AcpiSupportInstance->Fadt3->Header.OemRevision;\r
-    }    \r
+    }\r
+\r
     //\r
     // Checksum the table\r
     //\r
@@ -1336,40 +1324,42 @@ DeleteTable (
   // Init locals\r
   //\r
   RemoveFromRsdt        = TRUE;\r
-  CurrentTableSignature = ((EFI_ACPI_COMMON_HEADER *) Table->Table)->Signature;\r
 \r
-  //\r
-  // Basic tasks to accomplish delete are:\r
-  //   Determine removal requirements (in RSDT/XSDT or not)\r
-  //   Remove entry from RSDT/XSDT\r
-  //   Remove any table references to the table\r
-  //   If no one is using the table\r
-  //      Free the table (removing pointers from private data and tables)\r
-  //      Remove from list\r
-  //      Free list structure\r
-  //\r
-  //\r
-  // Determine if this table is in the RSDT or XSDT\r
-  //\r
-  if ((CurrentTableSignature == EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) ||\r
-      (CurrentTableSignature == EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) ||\r
-      (CurrentTableSignature == EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)\r
-      ) {\r
-    RemoveFromRsdt = FALSE;\r
-  }\r
-  //\r
-  // We don't remove the FADT in the standard way because some\r
-  // OS expect the FADT to be early in the table list.\r
-  // So we always put it as the first element in the list.\r
-  //\r
-  if (CurrentTableSignature == EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE) {\r
-    RemoveFromRsdt = FALSE;\r
-  }\r
-\r
-  //\r
-  // Remove the table from RSDT and XSDT\r
-  //\r
   if (Table->Table != NULL) {\r
+    CurrentTableSignature = ((EFI_ACPI_COMMON_HEADER *) Table->Table)->Signature;\r
+\r
+    //\r
+    // Basic tasks to accomplish delete are:\r
+    //   Determine removal requirements (in RSDT/XSDT or not)\r
+    //   Remove entry from RSDT/XSDT\r
+    //   Remove any table references to the table\r
+    //   If no one is using the table\r
+    //      Free the table (removing pointers from private data and tables)\r
+    //      Remove from list\r
+    //      Free list structure\r
+    //\r
+    //\r
+    // Determine if this table is in the RSDT or XSDT\r
+    //\r
+    if ((CurrentTableSignature == EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) ||\r
+        (CurrentTableSignature == EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) ||\r
+        (CurrentTableSignature == EFI_ACPI_3_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)\r
+        ) {\r
+      RemoveFromRsdt = FALSE;\r
+    }\r
+    //\r
+    // We don't remove the FADT in the standard way because some\r
+    // OS expect the FADT to be early in the table list.\r
+    // So we always put it as the first element in the list.\r
+    //\r
+    if (CurrentTableSignature == EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE) {\r
+      RemoveFromRsdt = FALSE;\r
+    }\r
+\r
+    //\r
+    // Remove the table from RSDT and XSDT\r
+    //\r
+\r
     //\r
     // This is a basic table, remove it from any lists and the Rsdt and/or Xsdt\r
     //\r