summaryrefslogtreecommitdiff
path: root/ArmPkg
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Include/Library/BdsLib.h8
-rw-r--r--ArmPkg/Library/BdsLib/BdsAppLoader.c6
-rw-r--r--ArmPkg/Library/BdsLib/BdsFilePath.c19
3 files changed, 27 insertions, 6 deletions
diff --git a/ArmPkg/Include/Library/BdsLib.h b/ArmPkg/Include/Library/BdsLib.h
index 91c67e726e..bbbdae895b 100644
--- a/ArmPkg/Include/Library/BdsLib.h
+++ b/ArmPkg/Include/Library/BdsLib.h
@@ -100,7 +100,9 @@ BdsBootLinux (
EFI_STATUS
BdsStartEfiApplication (
IN EFI_HANDLE ParentImageHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN UINTN LoadOptionsSize,
+ IN VOID* LoadOptions
);
/**
@@ -116,7 +118,9 @@ BdsStartEfiApplication (
EFI_STATUS
BdsLoadApplication (
IN EFI_HANDLE ParentImageHandle,
- IN CHAR16* EfiApp
+ IN CHAR16* EfiApp,
+ IN UINTN LoadOptionsSize,
+ IN VOID* LoadOptions
);
#endif
diff --git a/ArmPkg/Library/BdsLib/BdsAppLoader.c b/ArmPkg/Library/BdsLib/BdsAppLoader.c
index 8b778b27f7..4f359cda10 100644
--- a/ArmPkg/Library/BdsLib/BdsAppLoader.c
+++ b/ArmPkg/Library/BdsLib/BdsAppLoader.c
@@ -105,7 +105,9 @@ BdsLoadFileFromFirmwareVolume (
EFI_STATUS
BdsLoadApplication (
IN EFI_HANDLE ParentImageHandle,
- IN CHAR16* EfiApp
+ IN CHAR16* EfiApp,
+ IN UINTN LoadOptionsSize,
+ IN VOID* LoadOptions
)
{
EFI_STATUS Status;
@@ -133,7 +135,7 @@ BdsLoadApplication (
Status = BdsLoadFileFromFirmwareVolume (Handles[HandleIndex], EfiApp, EFI_FV_FILETYPE_APPLICATION, &EfiAppDevicePath);
if (!EFI_ERROR (Status)) {
// Start the application
- Status = BdsStartEfiApplication (ParentImageHandle, EfiAppDevicePath);
+ Status = BdsStartEfiApplication (ParentImageHandle, EfiAppDevicePath, LoadOptionsSize, LoadOptions);
return Status;
}
}
diff --git a/ArmPkg/Library/BdsLib/BdsFilePath.c b/ArmPkg/Library/BdsLib/BdsFilePath.c
index 720ae7b9da..9136941ede 100644
--- a/ArmPkg/Library/BdsLib/BdsFilePath.c
+++ b/ArmPkg/Library/BdsLib/BdsFilePath.c
@@ -16,6 +16,7 @@
#include <Protocol/UsbIo.h>
#include <Protocol/DiskIo.h>
+#include <Protocol/LoadedImage.h>
#define IS_DEVICE_PATH_NODE(node,type,subtype) (((node)->Type == (type)) && ((node)->SubType == (subtype)))
@@ -856,16 +857,19 @@ BdsLoadImage (
EFI_STATUS
BdsStartEfiApplication (
IN EFI_HANDLE ParentImageHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN UINTN LoadOptionsSize,
+ IN VOID* LoadOptions
)
{
EFI_STATUS Status;
EFI_HANDLE ImageHandle;
EFI_PHYSICAL_ADDRESS BinaryBuffer;
UINTN BinarySize;
+ EFI_LOADED_IMAGE_PROTOCOL* LoadedImage;
// Find the nearest supported file loader
- Status = BdsLoadImage (DevicePath, AllocateAnyPages,&BinaryBuffer,&BinarySize);
+ Status = BdsLoadImage (DevicePath, AllocateAnyPages, &BinaryBuffer, &BinarySize);
if (EFI_ERROR(Status)) {
return Status;
}
@@ -876,6 +880,17 @@ BdsStartEfiApplication (
return Status;
}
+ // Passed LoadOptions to the EFI Application
+ if (LoadOptionsSize != 0) {
+ Status = gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage);
+ if (EFI_ERROR(Status)) {
+ return Status;
+ }
+
+ LoadedImage->LoadOptionsSize = LoadOptionsSize;
+ LoadedImage->LoadOptions = LoadOptions;
+ }
+
// Before calling the image, enable the Watchdog Timer for the 5 Minute period
gBS->SetWatchdogTimer (5 * 60, 0x0000, 0x00, NULL);
// Start the image