]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/CapsuleRuntimeDxe/X64/SaveLongModeContext.c
Allocate EfiReservedMemoryType of memory.
[mirror_edk2.git] / MdeModulePkg / Universal / CapsuleRuntimeDxe / X64 / SaveLongModeContext.c
index a5c7c48eeefe4e4c09550a20337f2170f1943b7b..79615c9755398b938463f3e5964bc2a429ce91b5 100644 (file)
@@ -28,23 +28,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/UefiRuntimeLib.h>\r
 #include <Library/BaseLib.h>\r
-#include <Library/LockBoxLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/HobLib.h>\r
 \r
 /**\r
-  Allocate EfiACPIMemoryNVS below 4G memory address.\r
+  Allocate EfiReservedMemoryType below 4G memory address.\r
 \r
-  This function allocates EfiACPIMemoryNVS below 4G memory address.\r
+  This function allocates EfiReservedMemoryType below 4G memory address.\r
 \r
-  @param  Size         Size of memory to allocate.\r
+  @param  Size      Size of memory to allocate.\r
   \r
-  @return Allocated address for output.\r
+  @return Allocated Address for output.\r
 \r
 **/\r
 VOID*\r
-AllocateAcpiNvsMemoryBelow4G (\r
+AllocateReservedMemoryBelow4G (\r
   IN   UINTN   Size\r
   )\r
 {\r
@@ -58,7 +57,7 @@ AllocateAcpiNvsMemoryBelow4G (
 \r
   Status  = gBS->AllocatePages (\r
                    AllocateMaxAddress,\r
-                   EfiACPIMemoryNVS,\r
+                   EfiReservedMemoryType,\r
                    Pages,\r
                    &Address\r
                    );\r
@@ -97,8 +96,8 @@ VariableLockCapsuleLongModeBufferVariable (
 }\r
 \r
 /**\r
-  1. Allocate NVS memory for capsule PEIM to establish a 1:1 Virtual to Physical mapping.\r
-  2. Allocate NVS memroy as a stack for capsule PEIM to transfer from 32-bit mdoe to 64-bit mode.\r
+  1. Allocate Reserved memory for capsule PEIM to establish a 1:1 Virtual to Physical mapping.\r
+  2. Allocate Reserved memroy as a stack for capsule PEIM to transfer from 32-bit mdoe to 64-bit mode.\r
 \r
 **/\r
 VOID\r
@@ -177,7 +176,7 @@ PrepareContextForCapsulePei (
       TotalPagesNum = NumberOfPml4EntriesNeeded + 1;\r
     }\r
     \r
-    LongModeBuffer.PageTableAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateAcpiNvsMemoryBelow4G (EFI_PAGES_TO_SIZE (TotalPagesNum));\r
+    LongModeBuffer.PageTableAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateReservedMemoryBelow4G (EFI_PAGES_TO_SIZE (TotalPagesNum));\r
     ASSERT (LongModeBuffer.PageTableAddress != 0);\r
     PcdSet64 (PcdIdentifyMappingPageTablePtr, LongModeBuffer.PageTableAddress); \r
   }\r
@@ -186,7 +185,7 @@ PrepareContextForCapsulePei (
   // Allocate stack\r
   //\r
   LongModeBuffer.StackSize        = PcdGet32 (PcdCapsulePeiLongModeStackSize);\r
-  LongModeBuffer.StackBaseAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateAcpiNvsMemoryBelow4G (PcdGet32 (PcdCapsulePeiLongModeStackSize));\r
+  LongModeBuffer.StackBaseAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateReservedMemoryBelow4G (PcdGet32 (PcdCapsulePeiLongModeStackSize));\r
   ASSERT (LongModeBuffer.StackBaseAddress != 0);  \r
   \r
   Status = gRT->SetVariable (\r