summaryrefslogtreecommitdiff
path: root/ArmPkg/Library/BdsLib
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2012-02-09 15:25:40 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2012-02-09 15:25:40 +0000
commit4671d15d7a1a749999ee7f900a75d9644bd60a78 (patch)
tree956a7f59d832225c050b362306d105a6e5087adf /ArmPkg/Library/BdsLib
parent995d9676c88617a34c89472c6770a4e52a018c78 (diff)
downloadedk2-platforms-4671d15d7a1a749999ee7f900a75d9644bd60a78.tar.xz
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
Diffstat (limited to 'ArmPkg/Library/BdsLib')
-rw-r--r--ArmPkg/Library/BdsLib/BdsLinuxLoader.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ArmPkg/Library/BdsLib/BdsLinuxLoader.c b/ArmPkg/Library/BdsLib/BdsLinuxLoader.c
index 5c24366e45..12a88623db 100644
--- a/ArmPkg/Library/BdsLib/BdsLinuxLoader.c
+++ b/ArmPkg/Library/BdsLib/BdsLinuxLoader.c
@@ -155,7 +155,12 @@ BdsBootLinuxAtag (
}
if (InitrdDevicePath) {
- Status = BdsLoadImage (InitrdDevicePath, AllocateAnyPages, &InitrdImage, &InitrdImageSize);
+ // 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) {
- Status = BdsLoadImage (InitrdDevicePath, AllocateAnyPages, &InitrdImage, &InitrdImageSize);
+ 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;