summaryrefslogtreecommitdiff
path: root/ArmPkg/Library/BdsLib/BdsFilePath.c
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-09 10:53:42 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-09 10:53:42 +0000
commit2755d844f9ccc57108b49d5f91f38085de01760a (patch)
tree671d03d74292fa34ea65afd1edc323ae2d568c78 /ArmPkg/Library/BdsLib/BdsFilePath.c
parenta6e97d28aa583e4b7959431cbf8bbd7269d5065d (diff)
ArmPkg/BdsLib: Add support to pass argument to a loaded EFI application
OptionalData argument has to be set in the Loaded Image Protocol of the new EFI application. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12313 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Library/BdsLib/BdsFilePath.c')
-rw-r--r--ArmPkg/Library/BdsLib/BdsFilePath.c19
1 files changed, 17 insertions, 2 deletions
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