]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c
Use SmmMemLib to check communication buffer.
[mirror_edk2.git] / MdeModulePkg / Library / PiSmmCoreMemoryAllocationLib / MemoryAllocationLib.c
index f0f48438f4581e2ca8411e6007c0ddb425d15ff4..e4f7756f72e108bbb220feff9e5a30ac5ff35040 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support routines for memory allocation routines based on SMM Core internal functions.\r
 \r
-  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -936,3 +936,28 @@ FreePool (
   ASSERT_EFI_ERROR (Status);\r
 }\r
 \r
+/**\r
+  The constructor function calls SmmInitializeMemoryServices to initialize memory in SMRAM.\r
+\r
+  @param  ImageHandle   The firmware allocated handle for the EFI image.\r
+  @param  SystemTable   A pointer to the EFI System Table.\r
+\r
+  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PiSmmCoreMemoryAllocationLibConstructor (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
+  )\r
+{\r
+  SMM_CORE_PRIVATE_DATA  *SmmCorePrivate;\r
+\r
+  SmmCorePrivate = (SMM_CORE_PRIVATE_DATA *)ImageHandle;\r
+  //\r
+  // Initialize memory service using free SMRAM\r
+  //\r
+  SmmInitializeMemoryServices (SmmCorePrivate->SmramRangeCount, SmmCorePrivate->SmramRanges);\r
+  return EFI_SUCCESS;\r
+}\r