ArmPkg/BdsLib: Load initrd next to the Linux kernel to allow to reduce the memory from the Linux command line

The initrd was loaded at the top of the UEFI System Memory. By consequence, if the system memory
was reduced by the Linux command line then the initrd was not part of the system memory.



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12994 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
oliviermartin 2012-02-09 15:25:40 +00:00
parent 995d9676c8
commit 4671d15d7a
1 changed files with 11 additions and 2 deletions

View File

@ -155,7 +155,12 @@ BdsBootLinuxAtag (
}
if (InitrdDevicePath) {
// Load the initrd near to the Linux kernel
InitrdImage = LINUX_KERNEL_MAX_OFFSET;
Status = BdsLoadImage (InitrdDevicePath, AllocateMaxAddress, &InitrdImage, &InitrdImageSize);
if (Status == EFI_OUT_OF_RESOURCES) {
Status = BdsLoadImage (InitrdDevicePath, AllocateAnyPages, &InitrdImage, &InitrdImageSize);
}
if (EFI_ERROR(Status)) {
Print (L"ERROR: Did not find initrd image.\n");
return Status;
@ -218,7 +223,11 @@ BdsBootLinuxFdt (
}
if (InitrdDevicePath) {
InitrdImage = LINUX_KERNEL_MAX_OFFSET;
Status = BdsLoadImage (InitrdDevicePath, AllocateMaxAddress, &InitrdImage, &InitrdImageSize);
if (Status == EFI_OUT_OF_RESOURCES) {
Status = BdsLoadImage (InitrdDevicePath, AllocateAnyPages, &InitrdImage, &InitrdImageSize);
}
if (EFI_ERROR(Status)) {
Print (L"ERROR: Did not find initrd image.\n");
return Status;