mirror of https://github.com/acidanthera/audk.git
Update PI SMM Core to ignore memory ranges from SMRAM Descriptors that are already allocated or not tested or not ECC initialized yet
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10132 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
3c5963cf29
commit
3df4b6e7e9
|
@ -312,6 +312,16 @@ SmmAddMemoryRegion (
|
|||
{
|
||||
UINTN AlignedMemBase;
|
||||
|
||||
//
|
||||
// Do not add memory regions that is already allocated, needs testing, or needs ECC initialization
|
||||
//
|
||||
if ((Attributes & (EFI_ALLOCATED | EFI_NEEDS_TESTING | EFI_NEEDS_ECC_INITIALIZATION)) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Align range on an EFI_PAGE_SIZE boundary
|
||||
//
|
||||
AlignedMemBase = (UINTN)(MemBase + EFI_PAGE_MASK) & ~EFI_PAGE_MASK;
|
||||
MemLength -= AlignedMemBase - MemBase;
|
||||
SmmFreePages (AlignedMemBase, TRUNCATE_TO_PAGES ((UINTN)MemLength));
|
||||
|
|
Loading…
Reference in New Issue