]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / Acpi / AcpiTableDxe / AcpiTableProtocol.c
old mode 100755 (executable)
new mode 100644 (file)
index 7cf4cc5..b32c3d7
@@ -1,8 +1,8 @@
 /** @file\r
   ACPI Table Protocol Implementation\r
 \r
-  Copyright (c) 2006 - 2009, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
+  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
   http://opensource.org/licenses/bsd-license.php\r
@@ -288,6 +288,8 @@ PublishTables (
 \r
 /**\r
   Installs an ACPI table into the RSDT/XSDT.\r
+  Note that the ACPI table should be checksumed before installing it.\r
+  Otherwise it will assert.\r
 \r
   @param  This                 Protocol instance pointer.\r
   @param  AcpiTableBuffer      A pointer to a buffer containing the ACPI table to be installed.\r
@@ -313,6 +315,8 @@ InstallAcpiTable (
   EFI_ACPI_TABLE_INSTANCE   *AcpiTableInstance;\r
   EFI_STATUS                Status;\r
   VOID                      *AcpiTableBufferConst;\r
+  UINT32                    Length;\r
+  UINT8                     Checksum;\r
 \r
   //\r
   // Check for invalid input parameters\r
@@ -322,6 +326,10 @@ InstallAcpiTable (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  Length   = ((EFI_ACPI_COMMON_HEADER *) AcpiTableBuffer)->Length;\r
+  Checksum = CalculateCheckSum8 ((UINT8 *)AcpiTableBuffer, Length);\r
+  ASSERT (Checksum == 0);\r
+\r
   //\r
   // Get the instance of the ACPI table protocol\r
   //\r
@@ -1394,6 +1402,8 @@ RemoveTableFromList (
   EFI_ACPI_TABLE_LIST *Table;\r
   EFI_STATUS          Status;\r
 \r
+  Table = (EFI_ACPI_TABLE_LIST*) NULL;\r
+\r
   //\r
   // Check for invalid input parameters\r
   //\r