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

Go to the source code of this file.

Macros

#define FRONT_PAGE_KEY_OFFSET   0x4000
 

Functions

VOID InitAllMenu (IN BMM_CALLBACK_DATA *CallbackData)
 
VOID FreeAllMenu (VOID)
 
VOID CustomizeMenus (VOID)
 
EFI_STATUS BmmSetConsoleMode (BOOLEAN IsSetupMode)
 
CHAR16 * UiDevicePathToStr (IN EFI_DEVICE_PATH_PROTOCOL *DevPath)
 
CHAR16 * ExtractFileNameFromDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 
CHAR16 * BmmExtractDevicePathFromHiiHandle (IN EFI_HII_HANDLE Handle)
 
VOID HiiToLower (IN EFI_STRING ConfigString)
 
EFI_STRING UpdateProgress (IN UINTN Offset, IN EFI_STRING Configuration)
 
VOID UpdateTerminalContent (IN BMM_FAKE_NV_DATA *BmmData)
 
VOID UpdateConsoleContent (IN CHAR16 *ConsoleName, IN BMM_FAKE_NV_DATA *BmmData)
 
EFI_STATUS EFIAPI BootMaintExtractConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
 
EFI_STATUS EFIAPI BootMaintRouteConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
 
EFI_STATUS EFIAPI BootMaintCallback (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
 
VOID DiscardChangeHandler (IN BMM_CALLBACK_DATA *Private, IN BMM_FAKE_NV_DATA *CurrentFakeNVMap)
 
VOID CleanUselessBeforeSubmit (IN BMM_CALLBACK_DATA *Private)
 
VOID InitializeBmmConfig (IN BMM_CALLBACK_DATA *CallbackData)
 
VOID BmmInitialBootModeInfo (VOID)
 
EFI_STATUS EFIAPI BootMaintenanceManagerUiLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI BootMaintenanceManagerUiLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

UINT32 mBmmBootHorizontalResolution = 0
 
UINT32 mBmmBootVerticalResolution = 0
 
UINT32 mBmmBootTextModeColumn = 0
 
UINT32 mBmmBootTextModeRow = 0
 
UINT32 mBmmSetupTextModeColumn = 0
 
UINT32 mBmmSetupTextModeRow = 0
 
UINT32 mBmmSetupHorizontalResolution = 0
 
UINT32 mBmmSetupVerticalResolution = 0
 
BOOLEAN mBmmModeInitialized = FALSE
 
EFI_DEVICE_PATH_PROTOCOL EndDevicePath []
 
HII_VENDOR_DEVICE_PATH mBmmHiiVendorDevicePath
 
EFI_GUID mBootMaintGuid = BOOT_MAINT_FORMSET_GUID
 
CHAR16 mBootMaintStorageName [] = L"BmmData"
 
BMM_CALLBACK_DATA gBootMaintenancePrivate
 
BMM_CALLBACK_DATAmBmmCallbackInfo = &gBootMaintenancePrivate
 
BOOLEAN mAllMenuInit = FALSE
 
BOOLEAN mFirstEnterBMMForm = FALSE
 

Detailed Description

The functions for Boot Maintainence Main menu.

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

Definition in file BootMaintenance.c.

Macro Definition Documentation

◆ FRONT_PAGE_KEY_OFFSET

#define FRONT_PAGE_KEY_OFFSET   0x4000

Definition at line 11 of file BootMaintenance.c.

Function Documentation

◆ BmmExtractDevicePathFromHiiHandle()

CHAR16 * BmmExtractDevicePathFromHiiHandle ( IN EFI_HII_HANDLE  Handle)

Extract device path for given HII handle and class guid.

Parameters
HandleThe HII handle.
Return values
NULLFail to get the device path string.
Returns
PathString Get the device path string.

Definition at line 422 of file BootMaintenance.c.

◆ BmmInitialBootModeInfo()

VOID BmmInitialBootModeInfo ( VOID  )

Initial the boot mode related parameters.

Definition at line 1602 of file BootMaintenance.c.

◆ BmmSetConsoleMode()

EFI_STATUS BmmSetConsoleMode ( BOOLEAN  IsSetupMode)

This function will change video resolution and text mode according to defined setup mode or defined boot mode

Parameters
IsSetupModeIndicate mode is changed to setup mode or boot mode.
Return values
EFI_SUCCESSMode is changed successfully.
OthersMode failed to be changed.

Definition at line 125 of file BootMaintenance.c.

◆ BootMaintCallback()

EFI_STATUS EFIAPI BootMaintCallback ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN EFI_BROWSER_ACTION  Action,
IN EFI_QUESTION_ID  QuestionId,
IN UINT8  Type,
IN EFI_IFR_TYPE_VALUE Value,
OUT EFI_BROWSER_ACTION_REQUEST *  ActionRequest 
)

This function processes the results of changes in configuration.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
ActionSpecifies the type of action taken by the browser.
QuestionIdA unique value which is sent to the original exporting driver so that it can identify the type of data to expect.
TypeThe type of value for the question.
ValueA pointer to the data being sent to the original exporting driver.
ActionRequestOn return, points to the action requested by the callback function.
Return values
EFI_SUCCESSThe callback successfully handled the action.
EFI_OUT_OF_RESOURCESNot enough storage is available to hold the variable and its data.
EFI_DEVICE_ERRORThe variable could not be saved.
EFI_UNSUPPORTEDThe specified Action is not supported by the callback.
EFI_INVALID_PARAMETERThe parameter of Value or ActionRequest is invalid.

Definition at line 1096 of file BootMaintenance.c.

◆ BootMaintenanceManagerUiLibConstructor()

EFI_STATUS EFIAPI BootMaintenanceManagerUiLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Install Boot Maintenance Manager Menu driver.

Parameters
ImageHandleThe image handle.
SystemTableThe system table.
Return values
EFI_SUCEESSInstall Boot manager menu success.
OtherReturn error status.

Definition at line 1681 of file BootMaintenance.c.

◆ BootMaintenanceManagerUiLibDestructor()

EFI_STATUS EFIAPI BootMaintenanceManagerUiLibDestructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Unloads the application and its installed protocol.

Parameters
ImageHandleHandle that identifies the image to be unloaded.
SystemTableThe system table.
Return values
EFI_SUCCESSThe image has been unloaded.

Definition at line 1770 of file BootMaintenance.c.

◆ BootMaintExtractConfig()

EFI_STATUS EFIAPI BootMaintExtractConfig ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN CONST EFI_STRING  Request,
OUT EFI_STRING *  Progress,
OUT EFI_STRING *  Results 
)

This function allows a caller to extract the current configuration for one or more named elements from the target driver.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
RequestA null-terminated Unicode string in <ConfigRequest> format.
ProgressOn return, points to a character in the Request string. Points to the string's null terminator if request was successful. Points to the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) if the request was not successful.
ResultsA null-terminated Unicode string in <ConfigAltResp> format which has all values filled in for the names in the Request string. String to be allocated by the called function.
Return values
EFI_SUCCESSThe Results is filled with the requested values.
EFI_OUT_OF_RESOURCESNot enough memory to store the results.
EFI_INVALID_PARAMETERRequest is NULL, illegal syntax, or unknown name.
EFI_NOT_FOUNDRouting data doesn't match any storage in this driver.

Definition at line 661 of file BootMaintenance.c.

◆ BootMaintRouteConfig()

EFI_STATUS EFIAPI BootMaintRouteConfig ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN CONST EFI_STRING  Configuration,
OUT EFI_STRING *  Progress 
)

This function applies changes in a driver's configuration. Input is a Configuration, which has the routing data for this driver followed by name / value configuration pairs. The driver must apply those pairs to its configurable storage. If the driver's configuration is stored in a linear block of data and the driver's name / value pairs are in <BlockConfig> format, it may use the ConfigToBlock helper function (above) to simplify the job. Currently not implemented.

Parameters
[in]ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
[in]ConfigurationA null-terminated Unicode string in <ConfigString> format.
[out]ProgressA pointer to a string filled in with the offset of the most recent '&' before the first failing name / value pair (or the beginn ing of the string if the failure is in the first name / value pair) or the terminating NULL if all was successful.
Return values
EFI_SUCCESSThe results have been distributed or are awaiting distribution.
EFI_OUT_OF_RESOURCESNot enough memory to store the parts of the results that must be stored awaiting possible future protocols.
EFI_INVALID_PARAMETERSPassing in a NULL for the Results parameter would result in this type of error.
EFI_NOT_FOUNDTarget for the specified routing data was not found.

Definition at line 774 of file BootMaintenance.c.

◆ CleanUselessBeforeSubmit()

VOID CleanUselessBeforeSubmit ( IN BMM_CALLBACK_DATA Private)

This function is to clean some useless data before submit changes.

Parameters
PrivateThe BMM context data.

Definition at line 1410 of file BootMaintenance.c.

◆ CustomizeMenus()

VOID CustomizeMenus ( VOID  )

Update the menus in the BMM page.

Definition at line 1441 of file BootMaintenance.c.

◆ DiscardChangeHandler()

VOID DiscardChangeHandler ( IN BMM_CALLBACK_DATA Private,
IN BMM_FAKE_NV_DATA CurrentFakeNVMap 
)

Discard all changes done to the BMM pages such as Boot Order change, Driver order change.

Parameters
PrivateThe BMM context data.
CurrentFakeNVMapThe current Fack NV Map.

Definition at line 1351 of file BootMaintenance.c.

◆ ExtractFileNameFromDevicePath()

CHAR16 * ExtractFileNameFromDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL DevicePath)

Extract filename from device path. The returned buffer is allocated using AllocateCopyPool. The caller is responsible for freeing the allocated buffer using FreePool().

Parameters
DevicePathDevice path.
Returns
A new allocated string that represents the file name.

Definition at line 379 of file BootMaintenance.c.

◆ FreeAllMenu()

VOID FreeAllMenu ( VOID  )

Free up all Menu Option list.

Definition at line 1582 of file BootMaintenance.c.

◆ HiiToLower()

VOID HiiToLower ( IN EFI_STRING  ConfigString)

Converts the unicode character of the string from uppercase to lowercase. This is a internal function.

Parameters
ConfigStringString to be converted

Definition at line 454 of file BootMaintenance.c.

◆ InitAllMenu()

VOID InitAllMenu ( IN BMM_CALLBACK_DATA CallbackData)

Init all memu.

Parameters
CallbackDataThe BMM context data.

Initialized all Menu Option List.

Parameters
CallbackDataThe BMM context data.

Definition at line 1559 of file BootMaintenance.c.

◆ InitializeBmmConfig()

VOID InitializeBmmConfig ( IN BMM_CALLBACK_DATA CallbackData)

Create dynamic code for BMM and initialize all of BMM configuration data in BmmFakeNvData and BmmOldFakeNVData member in BMM context data.

Parameters
CallbackDataThe BMM context data.

Definition at line 1499 of file BootMaintenance.c.

◆ UiDevicePathToStr()

CHAR16 * UiDevicePathToStr ( IN EFI_DEVICE_PATH_PROTOCOL DevPath)

This function converts an input device structure to a Unicode string.

Parameters
DevPathA pointer to the device path structure.
Returns
A new allocated Unicode string that represents the device path.

Definition at line 342 of file BootMaintenance.c.

◆ UpdateConsoleContent()

VOID UpdateConsoleContent ( IN CHAR16 *  ConsoleName,
IN BMM_FAKE_NV_DATA BmmData 
)

Update the console content in ConsoleMenu.

Parameters
ConsoleNameThe name for the console device type.
BmmDataThe BMM fake NV data.

Definition at line 579 of file BootMaintenance.c.

◆ UpdateProgress()

EFI_STRING UpdateProgress ( IN UINTN  Offset,
IN EFI_STRING  Configuration 
)

Update the progress string through the offset value.

Parameters
OffsetThe offset value
ConfigurationPoint to the configuration string.

Definition at line 485 of file BootMaintenance.c.

◆ UpdateTerminalContent()

VOID UpdateTerminalContent ( IN BMM_FAKE_NV_DATA BmmData)

Update the terminal content in TerminalMenu.

Parameters
BmmDataThe BMM fake NV data.

Definition at line 538 of file BootMaintenance.c.

Variable Documentation

◆ EndDevicePath

EFI_DEVICE_PATH_PROTOCOL EndDevicePath[]
Initial value:
= {
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{
END_DEVICE_PATH_LENGTH,
0
}
}
}

Definition at line 29 of file BootMaintenance.c.

◆ gBootMaintenancePrivate

BMM_CALLBACK_DATA gBootMaintenancePrivate
Initial value:
= {
BMM_CALLBACK_DATA_SIGNATURE,
{
}
}
EFI_STATUS EFIAPI BootMaintCallback(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
EFI_STATUS EFIAPI BootMaintExtractConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
EFI_STATUS EFIAPI BootMaintRouteConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
#define NULL
Definition: Base.h:319

Definition at line 69 of file BootMaintenance.c.

◆ mAllMenuInit

BOOLEAN mAllMenuInit = FALSE

Definition at line 81 of file BootMaintenance.c.

◆ mBmmBootHorizontalResolution

UINT32 mBmmBootHorizontalResolution = 0

Definition at line 15 of file BootMaintenance.c.

◆ mBmmBootTextModeColumn

UINT32 mBmmBootTextModeColumn = 0

Definition at line 17 of file BootMaintenance.c.

◆ mBmmBootTextModeRow

UINT32 mBmmBootTextModeRow = 0

Definition at line 18 of file BootMaintenance.c.

◆ mBmmBootVerticalResolution

UINT32 mBmmBootVerticalResolution = 0

Definition at line 16 of file BootMaintenance.c.

◆ mBmmCallbackInfo

BMM_CALLBACK_DATA* mBmmCallbackInfo = &gBootMaintenancePrivate

Definition at line 80 of file BootMaintenance.c.

◆ mBmmHiiVendorDevicePath

HII_VENDOR_DEVICE_PATH mBmmHiiVendorDevicePath
Initial value:
= {
{
{
{
(UINT8)(sizeof (VENDOR_DEVICE_PATH)),
(UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
}
},
{ 0x165a028f, 0xbb2, 0x4b5f, { 0x87, 0x47, 0x77, 0x59, 0x2e, 0x3f, 0x64, 0x99 }
}
},
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{
(UINT8)(END_DEVICE_PATH_LENGTH),
(UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
}
}
}
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define HW_VENDOR_DP
Definition: DevicePath.h:133

Definition at line 40 of file BootMaintenance.c.

◆ mBmmModeInitialized

BOOLEAN mBmmModeInitialized = FALSE

Definition at line 27 of file BootMaintenance.c.

◆ mBmmSetupHorizontalResolution

UINT32 mBmmSetupHorizontalResolution = 0

Definition at line 24 of file BootMaintenance.c.

◆ mBmmSetupTextModeColumn

UINT32 mBmmSetupTextModeColumn = 0

Definition at line 22 of file BootMaintenance.c.

◆ mBmmSetupTextModeRow

UINT32 mBmmSetupTextModeRow = 0

Definition at line 23 of file BootMaintenance.c.

◆ mBmmSetupVerticalResolution

UINT32 mBmmSetupVerticalResolution = 0

Definition at line 25 of file BootMaintenance.c.

◆ mBootMaintGuid

EFI_GUID mBootMaintGuid = BOOT_MAINT_FORMSET_GUID

Definition at line 66 of file BootMaintenance.c.

◆ mBootMaintStorageName

CHAR16 mBootMaintStorageName[] = L"BmmData"

Definition at line 68 of file BootMaintenance.c.

◆ mFirstEnterBMMForm

BOOLEAN mFirstEnterBMMForm = FALSE

Definition at line 82 of file BootMaintenance.c.