]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/PiSmmCore/PiSmmCore.c
MdeModulePkg DxeCore/PiSmmCore: Add UEFI memory and SMRAM profile support.
[mirror_edk2.git] / MdeModulePkg / Core / PiSmmCore / PiSmmCore.c
index a7220e4235ab87847f8533d3791c2651239ca15f..d16baedec9c319caa980a3f1fcdbf0f397121d00 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   SMM Core Main Entry Point\r
 \r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2014, 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
@@ -82,6 +82,9 @@ SMM_CORE_SMI_HANDLERS  mSmmCoreSmiHandlers[] = {
   { NULL,                     NULL,                               NULL, FALSE }\r
 };\r
 \r
+UINTN                           mFullSmramRangeCount;\r
+EFI_SMRAM_DESCRIPTOR            *mFullSmramRanges;\r
+\r
 /**\r
   Place holder function until all the SMM System Table Service are available.\r
 \r
@@ -226,6 +229,8 @@ SmmReadyToLockHandler (
   gST = NULL;\r
   gBS = NULL;\r
 \r
+  SmramProfileReadyToLock ();\r
+\r
   return Status;\r
 }\r
 \r
@@ -401,6 +406,16 @@ SmmMain (
   //\r
   SmmInitializeMemoryServices (gSmmCorePrivate->SmramRangeCount, gSmmCorePrivate->SmramRanges);\r
 \r
+  SmramProfileInit ();\r
+\r
+  //\r
+  // Copy FullSmramRanges to SMRAM\r
+  //\r
+  mFullSmramRangeCount = gSmmCorePrivate->FullSmramRangeCount;\r
+  mFullSmramRanges = AllocatePool (mFullSmramRangeCount * sizeof (EFI_SMRAM_DESCRIPTOR));\r
+  ASSERT (mFullSmramRanges != NULL);\r
+  CopyMem (mFullSmramRanges, gSmmCorePrivate->FullSmramRanges, mFullSmramRangeCount * sizeof (EFI_SMRAM_DESCRIPTOR));\r
+\r
   //\r
   // Register all SMI Handlers required by the SMM Core\r
   //\r
@@ -412,6 +427,8 @@ SmmMain (
                );\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
-  \r
+\r
+  RegisterSmramProfileHandler ();\r
+\r
   return EFI_SUCCESS;\r
 }\r