]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/PiSmmCore/PiSmmCorePrivateData.h
MdeModulePkg DxeCore/PiSmmCore: Add UEFI memory and SMRAM profile support.
[mirror_edk2.git] / MdeModulePkg / Core / PiSmmCore / PiSmmCorePrivateData.h
index 411ebd823f2f5f1897faf287847c2ff479b8a1d6..3934d2f2eccae31291fb13932fae667adba8884f 100644 (file)
@@ -2,7 +2,7 @@
   The internal header file that declared a data structure that is shared\r
   between the SMM IPL and the SMM Core.\r
 \r
-  Copyright (c) 2009 - 2011, 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
@@ -116,6 +116,57 @@ typedef struct {
   /// a software SMI handler back to the caller of the SMM Communication Protocol.\r
   ///\r
   EFI_STATUS                      ReturnStatus;\r
+\r
+  EFI_PHYSICAL_ADDRESS            PiSmmCoreImageBase;\r
+  UINT64                          PiSmmCoreImageSize;\r
+  EFI_PHYSICAL_ADDRESS            PiSmmCoreEntryPoint;\r
+\r
+  UINTN                           FullSmramRangeCount;\r
+  EFI_SMRAM_DESCRIPTOR            *FullSmramRanges;\r
 } SMM_CORE_PRIVATE_DATA;\r
 \r
+//\r
+// Page management\r
+//\r
+\r
+typedef struct {\r
+  LIST_ENTRY  Link;\r
+  UINTN       NumberOfPages;\r
+} FREE_PAGE_LIST;\r
+\r
+extern LIST_ENTRY  mSmmMemoryMap;\r
+\r
+//\r
+// Pool management\r
+//\r
+\r
+//\r
+// MIN_POOL_SHIFT must not be less than 5\r
+//\r
+#define MIN_POOL_SHIFT  6\r
+#define MIN_POOL_SIZE   (1 << MIN_POOL_SHIFT)\r
+\r
+//\r
+// MAX_POOL_SHIFT must not be less than EFI_PAGE_SHIFT - 1\r
+//\r
+#define MAX_POOL_SHIFT  (EFI_PAGE_SHIFT - 1)\r
+#define MAX_POOL_SIZE   (1 << MAX_POOL_SHIFT)\r
+\r
+//\r
+// MAX_POOL_INDEX are calculated by maximum and minimum pool sizes\r
+//\r
+#define MAX_POOL_INDEX  (MAX_POOL_SHIFT - MIN_POOL_SHIFT + 1)\r
+\r
+typedef struct {\r
+  UINTN        Size;\r
+  BOOLEAN      Available;\r
+} POOL_HEADER;\r
+\r
+typedef struct {\r
+  POOL_HEADER  Header;\r
+  LIST_ENTRY   Link;\r
+} FREE_POOL_HEADER;\r
+\r
+extern LIST_ENTRY  mSmmPoolLists[MAX_POOL_INDEX];\r
+\r
 #endif\r