]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
ArmPkg/PlatformBootManagerLib: register 's' as UEFI Shell hotkey
[mirror_edk2.git] / ArmPkg / Library / PlatformBootManagerLib / PlatformBm.c
index 4aca1382b042d366b63cffc8a09e6946d9ebc6fa..23c925bbdb9c0b4e827a782d6b4f56ef9bb84eb8 100644 (file)
@@ -357,7 +357,8 @@ VOID
 PlatformRegisterFvBootOption (\r
   CONST EFI_GUID                   *FileGuid,\r
   CHAR16                           *Description,\r
-  UINT32                           Attributes\r
+  UINT32                           Attributes,\r
+  EFI_INPUT_KEY                    *Key\r
   )\r
 {\r
   EFI_STATUS                        Status;\r
@@ -409,6 +410,9 @@ PlatformRegisterFvBootOption (
   if (OptionIndex == -1) {\r
     Status = EfiBootManagerAddLoadOptionVariable (&NewOption, MAX_UINTN);\r
     ASSERT_EFI_ERROR (Status);\r
+    Status = EfiBootManagerAddKeyOptionVariable (NULL,\r
+               (UINT16)NewOption.OptionNumber, 0, Key, NULL);\r
+    ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED);\r
   }\r
   EfiBootManagerFreeLoadOption (&NewOption);\r
   EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);\r
@@ -721,6 +725,7 @@ PlatformBootManagerAfterConsole (
   UINTN                         FirmwareVerLength;\r
   UINTN                         PosX;\r
   UINTN                         PosY;\r
+  EFI_INPUT_KEY                 Key;\r
 \r
   FirmwareVerLength = StrLen (PcdGetPtr (PcdFirmwareVersionString));\r
 \r
@@ -770,8 +775,10 @@ PlatformBootManagerAfterConsole (
   //\r
   // Register UEFI Shell\r
   //\r
+  Key.ScanCode     = SCAN_NULL;\r
+  Key.UnicodeChar  = L's';\r
   PlatformRegisterFvBootOption (\r
-    &gUefiShellFileGuid, L"UEFI Shell", LOAD_OPTION_ACTIVE\r
+    &gUefiShellFileGuid, L"UEFI Shell", LOAD_OPTION_ACTIVE, &Key\r
     );\r
 }\r
 \r