diff options
author | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-03-01 05:32:59 +0000 |
---|---|---|
committer | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-03-01 05:32:59 +0000 |
commit | 3df4b6e7e96f671a0fc045119e44130936666030 (patch) | |
tree | b798b89eb7e2baf26a074a554ed0b729c27518d3 /MdeModulePkg | |
parent | 3c5963cf299e0abd4c2ce7156b171fa66546dc85 (diff) | |
download | edk2-platforms-3df4b6e7e96f671a0fc045119e44130936666030.tar.xz |
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
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Core/PiSmmCore/Page.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/PiSmmCore/Page.c b/MdeModulePkg/Core/PiSmmCore/Page.c index ec4dd4fcb8..781707e244 100644 --- a/MdeModulePkg/Core/PiSmmCore/Page.c +++ b/MdeModulePkg/Core/PiSmmCore/Page.c @@ -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));
|