Prints BootXXXX vars found listed in BootOrder, plus print others if AllBootOptions == TRUE. */
| 830 | |
| 831 | /** Prints BootXXXX vars found listed in BootOrder, plus print others if AllBootOptions == TRUE. */ |
| 832 | VOID |
| 833 | PrintBootOptions ( |
| 834 | IN BOOLEAN AllBootOptions |
| 835 | ) |
| 836 | { |
| 837 | EFI_STATUS Status; |
| 838 | UINT16 *BootOrder; |
| 839 | UINTN BootOrderLen; |
| 840 | UINTN Index; |
| 841 | UINTN BootNum; |
| 842 | BO_BOOT_OPTION BootOption; |
| 843 | BOOLEAN FoundOthers; |
| 844 | |
| 845 | |
| 846 | DBG("\nBoot options:\n-------------\n"); |
| 847 | |
| 848 | // |
| 849 | // Get BootOrder - we will search only options listed in BootOrder. |
| 850 | // |
| 851 | Status = GetBootOrder (&BootOrder, &BootOrderLen); |
| 852 | if (EFI_ERROR(Status)) { |
| 853 | return; |
| 854 | } |
| 855 | |
| 856 | // |
| 857 | // Iterate over all BootXXXX vars (actually, only ones that are in BootOrder list) |
| 858 | // |
| 859 | BootOption.Variable = NULL; |
| 860 | for (Index = 0; Index < BootOrderLen; Index++) { |
| 861 | // |
| 862 | // Get boot option |
| 863 | // |
| 864 | Status = GetBootOption (BootOrder[Index], &BootOption); |
| 865 | if (EFI_ERROR(Status)) { |
| 866 | DBG("%2llu) Boot%04hX: ERROR, not found: %s\n", Index, BootOrder[Index], efiStrError(Status)); |
| 867 | continue; |
| 868 | } |
| 869 | |
| 870 | PrintBootOption (&BootOption, Index); |
| 871 | FreePool(BootOption.Variable); |
| 872 | } |
| 873 | |
| 874 | if (AllBootOptions) { |
| 875 | DBG("\nBoot options not in BootOrder list:\n"); |
| 876 | FoundOthers = FALSE; |
| 877 | // |
| 878 | // Additionally print BootXXXX vars which are not in BootOrder |
| 879 | // |
| 880 | BootOption.Variable = NULL; |
| 881 | for (BootNum = 0; BootNum <= 0xFFFF; BootNum++) { |
| 882 | // |
| 883 | // Check if it is in BootOrder |
| 884 | // |
| 885 | for (Index = 0; Index < BootOrderLen; Index++) { |
| 886 | if (BootNum == (UINTN)BootOrder[Index]) { |
| 887 | break; |
| 888 | } |
| 889 | } |
no test coverage detected