]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/Bds: Added support to pass parameters to EFI applications
authorOlivier Martin <olivier.martin@arm.com>
Fri, 11 Apr 2014 10:57:00 +0000 (10:57 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 11 Apr 2014 10:57:00 +0000 (10:57 +0000)
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

ArmPlatformPkg/Bds/Bds.c
ArmPlatformPkg/Bds/BootMenu.c

index 2888843058afc4f06765eb82eaa45c615ba9dfcb..fa9dfbafc429d6839aff6ebf950e17cac8872683 100644 (file)
@@ -321,8 +321,8 @@ DefineDefaultBootEntries (
 \r
         OptionalData = (UINT8*)BootArguments;\r
       } else {\r
-        OptionalData = NULL;\r
-        OptionalDataSize = 0;\r
+        OptionalData = (UINT8*)DefaultBootArgument;\r
+        OptionalDataSize = CmdLineSize;\r
       }\r
 \r
       BootOptionCreate (LOAD_OPTION_ACTIVE | LOAD_OPTION_CATEGORY_BOOT,\r
index b04ebd35a2ed8ffc388caebb6fc26e1fd1ec92ac..9ca703842f2996d22d8c6bca4d68c5ee8a83e569 100644 (file)
@@ -120,7 +120,8 @@ BootMenuAddBootOption (
   BDS_SUPPORTED_DEVICE*     SupportedBootDevice;\r
   ARM_BDS_LOADER_ARGUMENTS* BootArguments;\r
   CHAR16                    BootDescription[BOOT_DEVICE_DESCRIPTION_MAX];\r
-  CHAR8                     CmdLine[BOOT_DEVICE_OPTION_MAX];\r
+  CHAR8                     AsciiCmdLine[BOOT_DEVICE_OPTION_MAX];\r
+  CHAR16                    CmdLine[BOOT_DEVICE_OPTION_MAX];\r
   UINT32                    Attributes;\r
   ARM_BDS_LOADER_TYPE       BootType;\r
   BDS_LOAD_OPTION_ENTRY     *BdsLoadOptionEntry;\r
@@ -188,13 +189,13 @@ BootMenuAddBootOption (
     }\r
 \r
     Print(L"Arguments to pass to the binary: ");\r
-    Status = GetHIInputAscii (CmdLine,BOOT_DEVICE_OPTION_MAX);\r
+    Status = GetHIInputAscii (AsciiCmdLine, BOOT_DEVICE_OPTION_MAX);\r
     if (EFI_ERROR(Status)) {\r
       Status = EFI_ABORTED;\r
       goto FREE_DEVICE_PATH;\r
     }\r
 \r
-    CmdLineSize = AsciiStrSize (CmdLine);\r
+    CmdLineSize = AsciiStrSize (AsciiCmdLine);\r
     InitrdSize = GetDevicePathSize (InitrdPath);\r
 \r
     OptionalDataSize = sizeof(ARM_BDS_LOADER_ARGUMENTS) + CmdLineSize + InitrdSize;\r
@@ -207,8 +208,15 @@ BootMenuAddBootOption (
 \r
     OptionalData = (UINT8*)BootArguments;\r
   } else {\r
-    OptionalData = NULL;\r
-    OptionalDataSize = 0;\r
+    Print (L"Arguments to pass to the EFI Application: ");\r
+    Status = GetHIInputStr (CmdLine, BOOT_DEVICE_OPTION_MAX);\r
+    if (EFI_ERROR (Status)) {\r
+      Status = EFI_ABORTED;\r
+      goto EXIT;\r
+    }\r
+\r
+    OptionalData = (UINT8*)CmdLine;\r
+    OptionalDataSize = StrSize (CmdLine);\r
   }\r
 \r
   Print(L"Description for this new Entry: ");\r