mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
35c290c580
commit
2fd3009fb2
|
@ -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
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue