]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
Change the minimal SMM core size from 1MB to 256KB-4K.
[mirror_edk2.git] / MdeModulePkg / Core / PiSmmCore / PiSmmIpl.c
index e372e7ecf198062f3ff4cf696db1680d7e4bf760..1029a077794cb23fe8daf7bd5eaa1e713ab97af9 100644 (file)
@@ -87,8 +87,8 @@ SmmBase2GetSmstLocation (
   after SetVirtualAddressMap().\r
 \r
   @param[in]     This                The EFI_SMM_COMMUNICATION_PROTOCOL instance.\r
-  @param[in out] CommBuffer          A pointer to the buffer to convey into SMRAM.\r
-  @param[in out] CommSize            The size of the data buffer being passed in.On exit, the size of data\r
+  @param[in, out] CommBuffer          A pointer to the buffer to convey into SMRAM.\r
+  @param[in, out] CommSize            The size of the data buffer being passed in.On exit, the size of data\r
                                      being returned. Zero if the handler does not wish to reply with any data.\r
 \r
   @retval EFI_SUCCESS                The message was successfully posted.\r
@@ -337,8 +337,8 @@ SmmBase2GetSmstLocation (
   after SetVirtualAddressMap().\r
 \r
   @param[in] This                The EFI_SMM_COMMUNICATION_PROTOCOL instance.\r
-  @param[in out] CommBuffer          A pointer to the buffer to convey into SMRAM.\r
-  @param[in out] CommSize            The size of the data buffer being passed in.On exit, the size of data\r
+  @param[in, out] CommBuffer          A pointer to the buffer to convey into SMRAM.\r
+  @param[in, out] CommSize            The size of the data buffer being passed in.On exit, the size of data\r
                                  being returned. Zero if the handler does not wish to reply with any data.\r
 \r
   @retval EFI_SUCCESS            The message was successfully posted.\r
@@ -920,10 +920,10 @@ SmmIplEntry (
   }\r
   \r
   //\r
-  // Find the largest SMRAM range between 1MB and 4GB that is at least 1MB in size\r
+  // Find the largest SMRAM range between 1MB and 4GB that is at least 256KB - 4K in size\r
   //\r
   mCurrentSmramRange = NULL;\r
-  for (Index = 0, MaxSize = SIZE_1MB; Index < gSmmCorePrivate->SmramRangeCount; Index++) {\r
+  for (Index = 0, MaxSize = SIZE_256KB - EFI_PAGE_SIZE; Index < gSmmCorePrivate->SmramRangeCount; Index++) {\r
     if (gSmmCorePrivate->SmramRanges[Index].CpuStart >= BASE_1MB) {\r
       if ((gSmmCorePrivate->SmramRanges[Index].CpuStart + gSmmCorePrivate->SmramRanges[Index].PhysicalSize) <= BASE_4GB) {\r
         if (gSmmCorePrivate->SmramRanges[Index].PhysicalSize >= MaxSize) {\r