]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/PiSmmCore/Pool.c
Patch from open source community for CryptoPkg to allow it to build for ARM using...
[mirror_edk2.git] / MdeModulePkg / Core / PiSmmCore / Pool.c
index ea28484d68d9cf00fb8680a91f5dfcd1be48598c..beb5cd965e0a157403649d1b90b01bf4070c9c0c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   SMM Memory pool management functions.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials are licensed and made available \r
   under the terms and conditions of the BSD License which accompanies this \r
   distribution.  The full text of the license may be found at        \r
@@ -86,6 +86,13 @@ SmmInitializeMemoryServices (
     // Find the largest SMRAM range between 1MB and 4GB that is at least 256KB - 4K in size\r
     //\r
     for (Index = 0, MaxSize = SIZE_256KB - EFI_PAGE_SIZE; Index < SmramRangeCount; Index++) {\r
+      //\r
+      // Skip any SMRAM region that is already allocated, needs testing, or needs ECC initialization\r
+      //\r
+      if ((SmramRanges[Index].RegionState & (EFI_ALLOCATED | EFI_NEEDS_TESTING | EFI_NEEDS_ECC_INITIALIZATION)) != 0) {\r
+        continue;\r
+      }\r
+\r
       if (SmramRanges[Index].CpuStart >= BASE_1MB) {\r
         if ((SmramRanges[Index].CpuStart + SmramRanges[Index].PhysicalSize) <= BASE_4GB) {\r
           if (SmramRanges[Index].PhysicalSize >= MaxSize) {\r