TianoCore EDK2 master
Loading...
Searching...
No Matches
BootOption.c File Reference

Go to the source code of this file.

Macros

#define MAX_CHAR   480
 

Functions

VOID BmmSetupResetReminder (VOID)
 
BM_MENU_ENTRYBOpt_CreateMenuEntry (UINTN MenuType)
 
VOID BOpt_DestroyMenuEntry (BM_MENU_ENTRY *MenuEntry)
 
BM_MENU_ENTRYBOpt_GetMenuEntry (BM_MENU_OPTION *MenuOption, UINTN MenuNumber)
 
VOID BOpt_FreeMenu (BM_MENU_OPTION *FreeMenu)
 
EFI_STATUS BOpt_GetBootOptions (IN BMM_CALLBACK_DATA *CallbackData)
 
EFI_STATUS BOpt_FindDrivers (VOID)
 
UINT16 BOpt_GetOptionNumber (CHAR16 *Type)
 
UINT16 BOpt_GetBootOptionNumber (VOID)
 
UINT16 BOpt_GetDriverOptionNumber (VOID)
 
EFI_STATUS BOpt_GetDriverOptions (IN BMM_CALLBACK_DATA *CallbackData)
 
VOID GetBootOrder (IN BMM_CALLBACK_DATA *CallbackData)
 
VOID GetDriverOrder (IN BMM_CALLBACK_DATA *CallbackData)
 
BOOLEAN EFIAPI BootFromFile (IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
 
BOOLEAN ReSendForm (IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_FORM_ID FormId)
 
BOOLEAN EFIAPI CreateBootOptionFromFile (IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
 
BOOLEAN EFIAPI CreateDriverOptionFromFile (IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
 

Detailed Description

Provide boot option support for Application "BootMaint"

Include file system navigation, system handle selection

Boot option manipulation

Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file BootOption.c.

Macro Definition Documentation

◆ MAX_CHAR

#define MAX_CHAR   480

Define the maximum characters that will be accepted.

Definition at line 18 of file BootOption.c.

Function Documentation

◆ BmmSetupResetReminder()

VOID BmmSetupResetReminder ( VOID  )

Check whether a reset is needed, if reset is needed, Popup a menu to notice user.

Definition at line 26 of file BootOption.c.

◆ BootFromFile()

BOOLEAN EFIAPI BootFromFile ( IN EFI_DEVICE_PATH_PROTOCOL FilePath)

Boot the file specified by the input file path info.

Parameters
FilePathPoint to the file path.
Return values
TRUEExit caller function.
FALSENot exit caller function.

Definition at line 908 of file BootOption.c.

◆ BOpt_CreateMenuEntry()

BM_MENU_ENTRY * BOpt_CreateMenuEntry ( UINTN  MenuType)

Create a menu entry by given menu type.

Parameters
MenuTypeThe Menu type to be created.
Return values
NULLIf failed to create the menu.
Returns
the new menu entry.

Definition at line 75 of file BootOption.c.

◆ BOpt_DestroyMenuEntry()

VOID BOpt_DestroyMenuEntry ( BM_MENU_ENTRY MenuEntry)

Free up all resource allocated for a BM_MENU_ENTRY.

Parameters
MenuEntryA pointer to BM_MENU_ENTRY.

Definition at line 141 of file BootOption.c.

◆ BOpt_FindDrivers()

EFI_STATUS BOpt_FindDrivers ( VOID  )

Find drivers that will be added as Driver#### variables from handles in current system environment All valid handles in the system except those consume SimpleFs, LoadFile are stored in DriverMenu for future use.

Return values
EFI_SUCCESSThe function complets successfully.
Returns
Other value if failed to build the DriverMenu.

Definition at line 492 of file BootOption.c.

◆ BOpt_FreeMenu()

VOID BOpt_FreeMenu ( BM_MENU_OPTION FreeMenu)

Free resources allocated in Allocate Rountine.

Parameters
FreeMenuMenu to be freed

Definition at line 256 of file BootOption.c.

◆ BOpt_GetBootOptionNumber()

UINT16 BOpt_GetBootOptionNumber ( VOID  )

Get the Option Number for Boot#### that does not used.

Returns
The available Option Number.

Definition at line 644 of file BootOption.c.

◆ BOpt_GetBootOptions()

EFI_STATUS BOpt_GetBootOptions ( IN BMM_CALLBACK_DATA CallbackData)

Build the BootOptionMenu according to BootOrder Variable. This Routine will access the Boot#### to get EFI_LOAD_OPTION.

Parameters
CallbackDataThe BMM context data.
Returns
EFI_NOT_FOUND Fail to find "BootOrder" variable.
EFI_SUCESS Success build boot option menu.

Definition at line 288 of file BootOption.c.

◆ BOpt_GetDriverOptionNumber()

UINT16 BOpt_GetDriverOptionNumber ( VOID  )

Get the Option Number for Driver#### that does not used.

Returns
The unused Option Number.

Definition at line 659 of file BootOption.c.

◆ BOpt_GetDriverOptions()

EFI_STATUS BOpt_GetDriverOptions ( IN BMM_CALLBACK_DATA CallbackData)

Build up all DriverOptionMenu

Parameters
CallbackDataThe BMM context data.
Return values
EFI_SUCESSThe functin completes successfully.
EFI_OUT_OF_RESOURCESNot enough memory to compete the operation.
EFI_NOT_FOUNDFail to get "DriverOrder" variable.

Definition at line 678 of file BootOption.c.

◆ BOpt_GetMenuEntry()

BM_MENU_ENTRY * BOpt_GetMenuEntry ( BM_MENU_OPTION MenuOption,
UINTN  MenuNumber 
)

Get the Menu Entry from the list in Menu Entry List.

If MenuNumber is great or equal to the number of Menu Entry in the list, then ASSERT.

Parameters
MenuOptionThe Menu Entry List to read the menu entry.
MenuNumberThe index of Menu Entry.
Returns
The Menu Entry.

Definition at line 229 of file BootOption.c.

◆ BOpt_GetOptionNumber()

UINT16 BOpt_GetOptionNumber ( CHAR16 *  Type)

Get the Option Number that has not been allocated for use.

Parameters
TypeThe type of Option.
Returns
The available Option Number.

Definition at line 586 of file BootOption.c.

◆ CreateBootOptionFromFile()

BOOLEAN EFIAPI CreateBootOptionFromFile ( IN EFI_DEVICE_PATH_PROTOCOL FilePath)

Create boot option base on the input file path info.

Parameters
FilePathPoint to the file path.
Return values
TRUEExit caller function.
FALSENot exit caller function.

Definition at line 994 of file BootOption.c.

◆ CreateDriverOptionFromFile()

BOOLEAN EFIAPI CreateDriverOptionFromFile ( IN EFI_DEVICE_PATH_PROTOCOL FilePath)

Create driver option base on the input file path info.

Parameters
FilePathPoint to the file path.
Return values
TRUEExit caller function.
FALSENot exit caller function.

Definition at line 1012 of file BootOption.c.

◆ GetBootOrder()

VOID GetBootOrder ( IN BMM_CALLBACK_DATA CallbackData)

Get option number according to Boot#### and BootOrder variable. The value is saved as #### + 1.

Parameters
CallbackDataThe BMM context data.

Definition at line 811 of file BootOption.c.

◆ GetDriverOrder()

VOID GetDriverOrder ( IN BMM_CALLBACK_DATA CallbackData)

Get driver option order from globalc DriverOptionMenu.

Parameters
CallbackDataThe BMM context data.

Definition at line 858 of file BootOption.c.

◆ ReSendForm()

BOOLEAN ReSendForm ( IN EFI_DEVICE_PATH_PROTOCOL FilePath,
IN EFI_FORM_ID  FormId 
)

Display the form base on the selected file.

Parameters
FilePathPoint to the file path.
FormIdThe form need to display.

Definition at line 963 of file BootOption.c.