\r
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2011, Apple Inc. All rights reserved.\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
PrintXY (10, 50, &White, &Black, L"Enter to boot directly.");\r
}\r
\r
+/**\r
+ Returns the priority number.\r
+\r
+ @param BootOption\r
+**/\r
+UINTN\r
+BootOptionPriority (\r
+ CONST EFI_BOOT_MANAGER_LOAD_OPTION *BootOption\r
+ )\r
+{\r
+ //\r
+ // Make sure Shell is first\r
+ //\r
+ if (StrCmp (BootOption->Description, L"UEFI Shell") == 0) {\r
+ return 0;\r
+ }\r
+ return 100;\r
+}\r
+\r
+INTN\r
+EFIAPI\r
+CompareBootOption (\r
+ CONST EFI_BOOT_MANAGER_LOAD_OPTION *Left,\r
+ CONST EFI_BOOT_MANAGER_LOAD_OPTION *Right\r
+ )\r
+{\r
+ return BootOptionPriority (Left) - BootOptionPriority (Right);\r
+}\r
+\r
/**\r
Do the platform specific action after the console is connected.\r
\r
PlatformBdsRegisterStaticBootOptions ();\r
PlatformBdsConnectSequence ();\r
EfiBootManagerRefreshAllBootOption ();\r
+ EfiBootManagerSortLoadOptionVariable (LoadOptionTypeBoot, (SORT_COMPARE)CompareBootOption);\r
break;\r
}\r
}\r