diff options
Diffstat (limited to 'MdeModulePkg/Library')
-rw-r--r-- | MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c index 3343e60..22ab4d7 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -1404,7 +1404,7 @@ BmDestroyRamDisk ( Status = mRamDisk->Unregister (RamDiskDevicePath);
ASSERT_EFI_ERROR (Status);
- FreePages (RamDiskBuffer, RamDiskSizeInPages);
+ FreeAlignedPages (RamDiskBuffer, RamDiskSizeInPages);
}
/**
@@ -1454,8 +1454,12 @@ BmExpandLoadFile ( //
// The load option resides in a RAM disk.
+ // Use a reasonable default of 2MB for alignment as the ramdisk device is
+ // implemented as an NVDIMM persistent memory and operating systems may
+ // wish to map this with huge page support.
//
- FileBuffer = AllocateReservedPages (EFI_SIZE_TO_PAGES (BufferSize));
+
+ FileBuffer = AllocateAlignedReservedPages (EFI_SIZE_TO_PAGES (BufferSize), SIZE_2MB);
if (FileBuffer == NULL) {
DEBUG_CODE_BEGIN ();
EFI_DEVICE_PATH *LoadFilePath;
@@ -1496,7 +1500,7 @@ BmExpandLoadFile ( Status = LoadFile->LoadFile (LoadFile, FilePath, TRUE, &BufferSize, FileBuffer);
if (EFI_ERROR (Status)) {
- FreePages (FileBuffer, EFI_SIZE_TO_PAGES (BufferSize));
+ FreeAlignedPages (FileBuffer, EFI_SIZE_TO_PAGES (BufferSize));
return NULL;
}
|