summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
index 459a977..b2f14a1 100755
--- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
+++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c
@@ -288,6 +288,8 @@ PublishTables (
/**
Installs an ACPI table into the RSDT/XSDT.
+ Note that the ACPI table should be checksumed before installing it.
+ Otherwise it will assert.
@param This Protocol instance pointer.
@param AcpiTableBuffer A pointer to a buffer containing the ACPI table to be installed.
@@ -313,6 +315,8 @@ InstallAcpiTable (
EFI_ACPI_TABLE_INSTANCE *AcpiTableInstance;
EFI_STATUS Status;
VOID *AcpiTableBufferConst;
+ UINT32 Length;
+ UINT8 Checksum;
//
// Check for invalid input parameters
@@ -322,6 +326,10 @@ InstallAcpiTable (
return EFI_INVALID_PARAMETER;
}
+ Length = ((EFI_ACPI_COMMON_HEADER *) AcpiTableBuffer)->Length;
+ Checksum = CalculateCheckSum8 ((UINT8 *)AcpiTableBuffer, Length);
+ ASSERT (Checksum == 0);
+
//
// Get the instance of the ACPI table protocol
//