summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
authorOlivier Martin <olivier.martin@arm.com>2014-04-11 10:57:00 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2014-04-11 10:57:00 +0000
commit06044819bb273fd0db56a988ed307cd70fa34358 (patch)
tree265f59c6af6a1eaf63e1948b28a00eb4ec829be6 /ArmPlatformPkg
parent90a44ec4d85a03cf8feb4a95183aa3acfe246d13 (diff)
downloadedk2-platforms-06044819bb273fd0db56a988ed307cd70fa34358.tar.xz
ArmPlatformPkg/Bds: Added support to pass parameters to EFI applications
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15452 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r--ArmPlatformPkg/Bds/Bds.c4
-rw-r--r--ArmPlatformPkg/Bds/BootMenu.c18
2 files changed, 15 insertions, 7 deletions
diff --git a/ArmPlatformPkg/Bds/Bds.c b/ArmPlatformPkg/Bds/Bds.c
index 2888843058..fa9dfbafc4 100644
--- a/ArmPlatformPkg/Bds/Bds.c
+++ b/ArmPlatformPkg/Bds/Bds.c
@@ -321,8 +321,8 @@ DefineDefaultBootEntries (
OptionalData = (UINT8*)BootArguments;
} else {
- OptionalData = NULL;
- OptionalDataSize = 0;
+ OptionalData = (UINT8*)DefaultBootArgument;
+ OptionalDataSize = CmdLineSize;
}
BootOptionCreate (LOAD_OPTION_ACTIVE | LOAD_OPTION_CATEGORY_BOOT,
diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c
index b04ebd35a2..9ca703842f 100644
--- a/ArmPlatformPkg/Bds/BootMenu.c
+++ b/ArmPlatformPkg/Bds/BootMenu.c
@@ -120,7 +120,8 @@ BootMenuAddBootOption (
BDS_SUPPORTED_DEVICE* SupportedBootDevice;
ARM_BDS_LOADER_ARGUMENTS* BootArguments;
CHAR16 BootDescription[BOOT_DEVICE_DESCRIPTION_MAX];
- CHAR8 CmdLine[BOOT_DEVICE_OPTION_MAX];
+ CHAR8 AsciiCmdLine[BOOT_DEVICE_OPTION_MAX];
+ CHAR16 CmdLine[BOOT_DEVICE_OPTION_MAX];
UINT32 Attributes;
ARM_BDS_LOADER_TYPE BootType;
BDS_LOAD_OPTION_ENTRY *BdsLoadOptionEntry;
@@ -188,13 +189,13 @@ BootMenuAddBootOption (
}
Print(L"Arguments to pass to the binary: ");
- Status = GetHIInputAscii (CmdLine,BOOT_DEVICE_OPTION_MAX);
+ Status = GetHIInputAscii (AsciiCmdLine, BOOT_DEVICE_OPTION_MAX);
if (EFI_ERROR(Status)) {
Status = EFI_ABORTED;
goto FREE_DEVICE_PATH;
}
- CmdLineSize = AsciiStrSize (CmdLine);
+ CmdLineSize = AsciiStrSize (AsciiCmdLine);
InitrdSize = GetDevicePathSize (InitrdPath);
OptionalDataSize = sizeof(ARM_BDS_LOADER_ARGUMENTS) + CmdLineSize + InitrdSize;
@@ -207,8 +208,15 @@ BootMenuAddBootOption (
OptionalData = (UINT8*)BootArguments;
} else {
- OptionalData = NULL;
- OptionalDataSize = 0;
+ Print (L"Arguments to pass to the EFI Application: ");
+ Status = GetHIInputStr (CmdLine, BOOT_DEVICE_OPTION_MAX);
+ if (EFI_ERROR (Status)) {
+ Status = EFI_ABORTED;
+ goto EXIT;
+ }
+
+ OptionalData = (UINT8*)CmdLine;
+ OptionalDataSize = StrSize (CmdLine);
}
Print(L"Description for this new Entry: ");