From 06044819bb273fd0db56a988ed307cd70fa34358 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Fri, 11 Apr 2014 10:57:00 +0000 Subject: ArmPlatformPkg/Bds: Added support to pass parameters to EFI applications Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15452 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/Bds.c | 4 ++-- ArmPlatformPkg/Bds/BootMenu.c | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'ArmPlatformPkg') 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: "); -- cgit v1.2.3