Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
MdeModulePkg/RamDiskDxe: 4K align ram disk sizes
Browse files Browse the repository at this point in the history
When a ram disk is passed to an OS through NFIT, page size is the
smallest sensible granularity for a ram disk size. FreeBSD's
nvdimm(4) driver will refuse to handle an SPA whose length is not
zero module page size.
  • Loading branch information
D Scott Phillips committed Mar 28, 2019
1 parent 64b23f4 commit 976fc1f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ HiiCreateRamDisk (
}

if (Size > (UINTN) -1) {
// 4k align size for consumption by NFIT drivers
Size = (Size + 0xfff) & ~0xfffULL;
do {
CreatePopUp (
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
Expand Down

0 comments on commit 976fc1f

Please sign in to comment.