diff options
author | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-24 09:44:32 +0000 |
---|---|---|
committer | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-24 09:44:32 +0000 |
commit | 2fd3009fb25d79d53cc6ae6cdd872d78b41e4bc1 (patch) | |
tree | 0f09264bc99b759bcff54fbd5c941b6d273fa448 /MdeModulePkg/Universal/Acpi | |
parent | 35c290c5805c4b0266898040e44b905c19aeda3d (diff) | |
download | edk2-platforms-2fd3009fb25d79d53cc6ae6cdd872d78b41e4bc1.tar.xz |
add assertion to ensure ACPI table is checksumed.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8650 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Acpi')
-rwxr-xr-x | MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c index 459a977e7b..b2f14a1a38 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
//
|