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