MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
committed by
mergify[bot]
parent
7c7184e201
commit
1436aea4d5
@@ -8,26 +8,26 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
#include "BootManager.h"
|
||||
|
||||
UINT16 mKeyInput;
|
||||
EFI_GUID mBootManagerGuid = BOOT_MANAGER_FORMSET_GUID;
|
||||
UINT16 mKeyInput;
|
||||
EFI_GUID mBootManagerGuid = BOOT_MANAGER_FORMSET_GUID;
|
||||
//
|
||||
// Boot video resolution and text mode.
|
||||
//
|
||||
UINT32 mBmBootHorizontalResolution = 0;
|
||||
UINT32 mBmBootVerticalResolution = 0;
|
||||
UINT32 mBmBootTextModeColumn = 0;
|
||||
UINT32 mBmBootTextModeRow = 0;
|
||||
UINT32 mBmBootHorizontalResolution = 0;
|
||||
UINT32 mBmBootVerticalResolution = 0;
|
||||
UINT32 mBmBootTextModeColumn = 0;
|
||||
UINT32 mBmBootTextModeRow = 0;
|
||||
//
|
||||
// BIOS setup video resolution and text mode.
|
||||
//
|
||||
UINT32 mBmSetupTextModeColumn = 0;
|
||||
UINT32 mBmSetupTextModeRow = 0;
|
||||
UINT32 mBmSetupHorizontalResolution = 0;
|
||||
UINT32 mBmSetupVerticalResolution = 0;
|
||||
UINT32 mBmSetupTextModeColumn = 0;
|
||||
UINT32 mBmSetupTextModeRow = 0;
|
||||
UINT32 mBmSetupHorizontalResolution = 0;
|
||||
UINT32 mBmSetupVerticalResolution = 0;
|
||||
|
||||
BOOLEAN mBmModeInitialized = FALSE;
|
||||
BOOLEAN mBmModeInitialized = FALSE;
|
||||
|
||||
CHAR16 *mDeviceTypeStr[] = {
|
||||
CHAR16 *mDeviceTypeStr[] = {
|
||||
L"Legacy BEV",
|
||||
L"Legacy Floppy",
|
||||
L"Legacy Hard Drive",
|
||||
@@ -44,21 +44,22 @@ HII_VENDOR_DEVICE_PATH mBootManagerHiiVendorDevicePath = {
|
||||
HARDWARE_DEVICE_PATH,
|
||||
HW_VENDOR_DP,
|
||||
{
|
||||
(UINT8) (sizeof (VENDOR_DEVICE_PATH)),
|
||||
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
||||
(UINT8)(sizeof (VENDOR_DEVICE_PATH)),
|
||||
(UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
||||
}
|
||||
},
|
||||
//
|
||||
// {1DDDBE15-481D-4d2b-8277-B191EAF66525}
|
||||
//
|
||||
{ 0x1dddbe15, 0x481d, 0x4d2b, { 0x82, 0x77, 0xb1, 0x91, 0xea, 0xf6, 0x65, 0x25 } }
|
||||
{ 0x1dddbe15, 0x481d, 0x4d2b, { 0x82, 0x77, 0xb1, 0x91, 0xea, 0xf6, 0x65, 0x25 }
|
||||
}
|
||||
},
|
||||
{
|
||||
END_DEVICE_PATH_TYPE,
|
||||
END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
{
|
||||
(UINT8) (END_DEVICE_PATH_LENGTH),
|
||||
(UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
|
||||
(UINT8)(END_DEVICE_PATH_LENGTH),
|
||||
(UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -116,7 +117,7 @@ BmSetConsoleMode (
|
||||
Status = gBS->HandleProtocol (
|
||||
gST->ConsoleOutHandle,
|
||||
&gEfiGraphicsOutputProtocolGuid,
|
||||
(VOID**)&GraphicsOutput
|
||||
(VOID **)&GraphicsOutput
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
GraphicsOutput = NULL;
|
||||
@@ -125,7 +126,7 @@ BmSetConsoleMode (
|
||||
Status = gBS->HandleProtocol (
|
||||
gST->ConsoleOutHandle,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
(VOID**)&SimpleTextOut
|
||||
(VOID **)&SimpleTextOut
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
SimpleTextOut = NULL;
|
||||
@@ -154,7 +155,7 @@ BmSetConsoleMode (
|
||||
}
|
||||
|
||||
if (GraphicsOutput != NULL) {
|
||||
MaxGopMode = GraphicsOutput->Mode->MaxMode;
|
||||
MaxGopMode = GraphicsOutput->Mode->MaxMode;
|
||||
}
|
||||
|
||||
if (SimpleTextOut != NULL) {
|
||||
@@ -170,22 +171,24 @@ BmSetConsoleMode (
|
||||
//
|
||||
for (ModeNumber = 0; ModeNumber < MaxGopMode; ModeNumber++) {
|
||||
Status = GraphicsOutput->QueryMode (
|
||||
GraphicsOutput,
|
||||
ModeNumber,
|
||||
&SizeOfInfo,
|
||||
&Info
|
||||
);
|
||||
GraphicsOutput,
|
||||
ModeNumber,
|
||||
&SizeOfInfo,
|
||||
&Info
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
if ((Info->HorizontalResolution == NewHorizontalResolution) &&
|
||||
(Info->VerticalResolution == NewVerticalResolution)) {
|
||||
(Info->VerticalResolution == NewVerticalResolution))
|
||||
{
|
||||
if ((GraphicsOutput->Mode->Info->HorizontalResolution == NewHorizontalResolution) &&
|
||||
(GraphicsOutput->Mode->Info->VerticalResolution == NewVerticalResolution)) {
|
||||
(GraphicsOutput->Mode->Info->VerticalResolution == NewVerticalResolution))
|
||||
{
|
||||
//
|
||||
// Current resolution is same with required resolution, check if text mode need be set
|
||||
//
|
||||
Status = SimpleTextOut->QueryMode (SimpleTextOut, SimpleTextOut->Mode->Mode, &CurrentColumn, &CurrentRow);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (CurrentColumn == NewColumns && CurrentRow == NewRows) {
|
||||
if ((CurrentColumn == NewColumns) && (CurrentRow == NewRows)) {
|
||||
//
|
||||
// If current text mode is same with required text mode. Do nothing
|
||||
//
|
||||
@@ -197,7 +200,7 @@ BmSetConsoleMode (
|
||||
//
|
||||
for (Index = 0; Index < MaxTextMode; Index++) {
|
||||
Status = SimpleTextOut->QueryMode (SimpleTextOut, Index, &CurrentColumn, &CurrentRow);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
if (!EFI_ERROR (Status)) {
|
||||
if ((CurrentColumn == NewColumns) && (CurrentRow == NewRows)) {
|
||||
//
|
||||
// Required text mode is supported, set it.
|
||||
@@ -216,6 +219,7 @@ BmSetConsoleMode (
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Index == MaxTextMode) {
|
||||
//
|
||||
// If required text mode is not supported, return error.
|
||||
@@ -236,6 +240,7 @@ BmSetConsoleMode (
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FreePool (Info);
|
||||
}
|
||||
}
|
||||
@@ -266,19 +271,21 @@ BmSetConsoleMode (
|
||||
// Locate all the handles with GOP protocol and reconnect it.
|
||||
//
|
||||
Status = gBS->LocateHandleBuffer (
|
||||
ByProtocol,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
NULL,
|
||||
&HandleCount,
|
||||
&HandleBuffer
|
||||
);
|
||||
ByProtocol,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
NULL,
|
||||
&HandleCount,
|
||||
&HandleBuffer
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
for (Index = 0; Index < HandleCount; Index++) {
|
||||
gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);
|
||||
}
|
||||
|
||||
for (Index = 0; Index < HandleCount; Index++) {
|
||||
gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
|
||||
}
|
||||
|
||||
if (HandleBuffer != NULL) {
|
||||
FreePool (HandleBuffer);
|
||||
}
|
||||
@@ -297,20 +304,20 @@ BmSetupResetReminder (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_INPUT_KEY Key;
|
||||
CHAR16 *StringBuffer1;
|
||||
CHAR16 *StringBuffer2;
|
||||
EFI_STATUS Status;
|
||||
EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL *FormBrowserEx2;
|
||||
EFI_INPUT_KEY Key;
|
||||
CHAR16 *StringBuffer1;
|
||||
CHAR16 *StringBuffer2;
|
||||
EFI_STATUS Status;
|
||||
EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL *FormBrowserEx2;
|
||||
|
||||
//
|
||||
// Use BrowserEx2 protocol to check whether reset is required.
|
||||
//
|
||||
Status = gBS->LocateProtocol (&gEdkiiFormBrowserEx2ProtocolGuid, NULL, (VOID **) &FormBrowserEx2);
|
||||
Status = gBS->LocateProtocol (&gEdkiiFormBrowserEx2ProtocolGuid, NULL, (VOID **)&FormBrowserEx2);
|
||||
//
|
||||
//check any reset required change is applied? if yes, reset system
|
||||
// check any reset required change is applied? if yes, reset system
|
||||
//
|
||||
if (!EFI_ERROR(Status) && FormBrowserEx2->IsResetRequired ()) {
|
||||
if (!EFI_ERROR (Status) && FormBrowserEx2->IsResetRequired ()) {
|
||||
StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
|
||||
ASSERT (StringBuffer1 != NULL);
|
||||
StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
|
||||
@@ -352,20 +359,20 @@ GroupMultipleLegacyBootOption4SameType (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN Index;
|
||||
UINTN DeviceIndex;
|
||||
UINTN DeviceTypeIndex[7];
|
||||
UINTN *NextIndex;
|
||||
UINT16 OptionNumber;
|
||||
UINT16 *BootOrder;
|
||||
UINTN BootOrderSize;
|
||||
CHAR16 OptionName[sizeof ("Boot####")];
|
||||
EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
|
||||
EFI_STATUS Status;
|
||||
UINTN Index;
|
||||
UINTN DeviceIndex;
|
||||
UINTN DeviceTypeIndex[7];
|
||||
UINTN *NextIndex;
|
||||
UINT16 OptionNumber;
|
||||
UINT16 *BootOrder;
|
||||
UINTN BootOrderSize;
|
||||
CHAR16 OptionName[sizeof ("Boot####")];
|
||||
EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
|
||||
|
||||
SetMem (DeviceTypeIndex, sizeof (DeviceTypeIndex), 0xff);
|
||||
|
||||
GetEfiGlobalVariable2 (L"BootOrder", (VOID **) &BootOrder, &BootOrderSize);
|
||||
GetEfiGlobalVariable2 (L"BootOrder", (VOID **)&BootOrder, &BootOrderSize);
|
||||
if (BootOrder == NULL) {
|
||||
return;
|
||||
}
|
||||
@@ -376,15 +383,16 @@ GroupMultipleLegacyBootOption4SameType (
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
if ((DevicePathType (BootOption.FilePath) == BBS_DEVICE_PATH) &&
|
||||
(DevicePathSubType (BootOption.FilePath) == BBS_BBS_DP)) {
|
||||
(DevicePathSubType (BootOption.FilePath) == BBS_BBS_DP))
|
||||
{
|
||||
//
|
||||
// Legacy Boot Option
|
||||
//
|
||||
DEBUG ((DEBUG_ERROR, "[BootManagerDxe] ==== Find Legacy Boot Option 0x%x! ==== \n", Index));
|
||||
ASSERT ((((BBS_BBS_DEVICE_PATH *) BootOption.FilePath)->DeviceType & 0xF) < ARRAY_SIZE (DeviceTypeIndex));
|
||||
NextIndex = &DeviceTypeIndex[((BBS_BBS_DEVICE_PATH *) BootOption.FilePath)->DeviceType & 0xF];
|
||||
ASSERT ((((BBS_BBS_DEVICE_PATH *)BootOption.FilePath)->DeviceType & 0xF) < ARRAY_SIZE (DeviceTypeIndex));
|
||||
NextIndex = &DeviceTypeIndex[((BBS_BBS_DEVICE_PATH *)BootOption.FilePath)->DeviceType & 0xF];
|
||||
|
||||
if (*NextIndex == (UINTN) -1) {
|
||||
if (*NextIndex == (UINTN)-1) {
|
||||
//
|
||||
// *NextIndex is the Index in BootOrder to put the next Option Number for the same type
|
||||
//
|
||||
@@ -401,12 +409,13 @@ GroupMultipleLegacyBootOption4SameType (
|
||||
// Update the DeviceTypeIndex array to reflect the right shift operation
|
||||
//
|
||||
for (DeviceIndex = 0; DeviceIndex < ARRAY_SIZE (DeviceTypeIndex); DeviceIndex++) {
|
||||
if (DeviceTypeIndex[DeviceIndex] != (UINTN) -1 && DeviceTypeIndex[DeviceIndex] >= *NextIndex) {
|
||||
if ((DeviceTypeIndex[DeviceIndex] != (UINTN)-1) && (DeviceTypeIndex[DeviceIndex] >= *NextIndex)) {
|
||||
DeviceTypeIndex[DeviceIndex]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EfiBootManagerFreeLoadOption (&BootOption);
|
||||
}
|
||||
|
||||
@@ -430,12 +439,12 @@ GroupMultipleLegacyBootOption4SameType (
|
||||
**/
|
||||
CHAR16 *
|
||||
BmDevicePathToStr (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevPath
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevPath
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
CHAR16 *ToText;
|
||||
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;
|
||||
EFI_STATUS Status;
|
||||
CHAR16 *ToText;
|
||||
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;
|
||||
|
||||
if (DevPath == NULL) {
|
||||
return NULL;
|
||||
@@ -444,7 +453,7 @@ BmDevicePathToStr (
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiDevicePathToTextProtocolGuid,
|
||||
NULL,
|
||||
(VOID **) &DevPathToText
|
||||
(VOID **)&DevPathToText
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
ToText = DevPathToText->ConvertDevicePathToText (
|
||||
@@ -485,7 +494,7 @@ UpdateBootManager (
|
||||
BOOLEAN NeedEndOp;
|
||||
UINTN MaxLen;
|
||||
|
||||
DeviceType = (UINT16) -1;
|
||||
DeviceType = (UINT16)-1;
|
||||
|
||||
//
|
||||
// for better user experience
|
||||
@@ -516,18 +525,18 @@ UpdateBootManager (
|
||||
//
|
||||
// Create Hii Extend Label OpCode as the start opcode
|
||||
//
|
||||
StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||
StartLabel = (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||
StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||
StartLabel->Number = LABEL_BOOT_OPTION;
|
||||
|
||||
//
|
||||
// Create Hii Extend Label OpCode as the end opcode
|
||||
//
|
||||
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||
EndLabel = (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||
EndLabel->Number = LABEL_BOOT_OPTION_END;
|
||||
mKeyInput = 0;
|
||||
NeedEndOp = FALSE;
|
||||
mKeyInput = 0;
|
||||
NeedEndOp = FALSE;
|
||||
for (Index = 0; Index < BootOptionCount; Index++) {
|
||||
//
|
||||
// At this stage we are creating a menu entry, thus the Keys are reproduceable
|
||||
@@ -544,28 +553,28 @@ UpdateBootManager (
|
||||
//
|
||||
// Group the legacy boot option in the sub title created dynamically
|
||||
//
|
||||
IsLegacyOption = (BOOLEAN) (
|
||||
(DevicePathType (BootOption[Index].FilePath) == BBS_DEVICE_PATH) &&
|
||||
(DevicePathSubType (BootOption[Index].FilePath) == BBS_BBS_DP)
|
||||
);
|
||||
IsLegacyOption = (BOOLEAN)(
|
||||
(DevicePathType (BootOption[Index].FilePath) == BBS_DEVICE_PATH) &&
|
||||
(DevicePathSubType (BootOption[Index].FilePath) == BBS_BBS_DP)
|
||||
);
|
||||
|
||||
if (!IsLegacyOption && NeedEndOp) {
|
||||
NeedEndOp = FALSE;
|
||||
HiiCreateEndOpCode (StartOpCodeHandle);
|
||||
}
|
||||
|
||||
if (IsLegacyOption && DeviceType != ((BBS_BBS_DEVICE_PATH *) BootOption[Index].FilePath)->DeviceType) {
|
||||
if (IsLegacyOption && (DeviceType != ((BBS_BBS_DEVICE_PATH *)BootOption[Index].FilePath)->DeviceType)) {
|
||||
if (NeedEndOp) {
|
||||
HiiCreateEndOpCode (StartOpCodeHandle);
|
||||
}
|
||||
|
||||
DeviceType = ((BBS_BBS_DEVICE_PATH *) BootOption[Index].FilePath)->DeviceType;
|
||||
DeviceType = ((BBS_BBS_DEVICE_PATH *)BootOption[Index].FilePath)->DeviceType;
|
||||
Token = HiiSetString (
|
||||
HiiHandle,
|
||||
0,
|
||||
mDeviceTypeStr[
|
||||
MIN (DeviceType & 0xF, ARRAY_SIZE (mDeviceTypeStr) - 1)
|
||||
],
|
||||
MIN (DeviceType & 0xF, ARRAY_SIZE (mDeviceTypeStr) - 1)
|
||||
],
|
||||
NULL
|
||||
);
|
||||
HiiCreateSubTitleOpCode (StartOpCodeHandle, Token, 0, 0, 1);
|
||||
@@ -576,10 +585,10 @@ UpdateBootManager (
|
||||
|
||||
Token = HiiSetString (HiiHandle, 0, BootOption[Index].Description, NULL);
|
||||
|
||||
TempStr = BmDevicePathToStr (BootOption[Index].FilePath);
|
||||
TempSize = StrSize (TempStr);
|
||||
TempStr = BmDevicePathToStr (BootOption[Index].FilePath);
|
||||
TempSize = StrSize (TempStr);
|
||||
HelpString = AllocateZeroPool (TempSize + StrSize (L"Device Path : "));
|
||||
MaxLen = (TempSize + StrSize (L"Device Path : "))/sizeof(CHAR16);
|
||||
MaxLen = (TempSize + StrSize (L"Device Path : "))/sizeof (CHAR16);
|
||||
ASSERT (HelpString != NULL);
|
||||
StrCatS (HelpString, MaxLen, L"Device Path : ");
|
||||
StrCatS (HelpString, MaxLen, TempStr);
|
||||
@@ -639,15 +648,16 @@ UpdateBootManager (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BootManagerExtractConfig (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN CONST EFI_STRING Request,
|
||||
OUT EFI_STRING *Progress,
|
||||
OUT EFI_STRING *Results
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN CONST EFI_STRING Request,
|
||||
OUT EFI_STRING *Progress,
|
||||
OUT EFI_STRING *Results
|
||||
)
|
||||
{
|
||||
if (Progress == NULL || Results == NULL) {
|
||||
if ((Progress == NULL) || (Results == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*Progress = Request;
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
@@ -671,12 +681,12 @@ BootManagerExtractConfig (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BootManagerRouteConfig (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN CONST EFI_STRING Configuration,
|
||||
OUT EFI_STRING *Progress
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN CONST EFI_STRING Configuration,
|
||||
OUT EFI_STRING *Progress
|
||||
)
|
||||
{
|
||||
if (Configuration == NULL || Progress == NULL) {
|
||||
if ((Configuration == NULL) || (Progress == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
@@ -694,11 +704,11 @@ BmInitialBootModeInfo (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut;
|
||||
UINTN BootTextColumn;
|
||||
UINTN BootTextRow;
|
||||
EFI_STATUS Status;
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOut;
|
||||
UINTN BootTextColumn;
|
||||
UINTN BootTextRow;
|
||||
|
||||
if (mBmModeInitialized) {
|
||||
return;
|
||||
@@ -711,7 +721,7 @@ BmInitialBootModeInfo (
|
||||
Status = gBS->HandleProtocol (
|
||||
gST->ConsoleOutHandle,
|
||||
&gEfiGraphicsOutputProtocolGuid,
|
||||
(VOID**)&GraphicsOutput
|
||||
(VOID **)&GraphicsOutput
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
GraphicsOutput = NULL;
|
||||
@@ -720,7 +730,7 @@ BmInitialBootModeInfo (
|
||||
Status = gBS->HandleProtocol (
|
||||
gST->ConsoleOutHandle,
|
||||
&gEfiSimpleTextOutProtocolGuid,
|
||||
(VOID**)&SimpleTextOut
|
||||
(VOID **)&SimpleTextOut
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
SimpleTextOut = NULL;
|
||||
@@ -753,7 +763,7 @@ BmInitialBootModeInfo (
|
||||
mBmSetupTextModeColumn = PcdGet32 (PcdSetupConOutColumn);
|
||||
mBmSetupTextModeRow = PcdGet32 (PcdSetupConOutRow);
|
||||
|
||||
mBmModeInitialized = TRUE;
|
||||
mBmModeInitialized = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -777,26 +787,27 @@ BmInitialBootModeInfo (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BootManagerCallback (
|
||||
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
|
||||
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_BOOT_MANAGER_LOAD_OPTION *BootOption;
|
||||
UINTN BootOptionCount;
|
||||
EFI_INPUT_KEY Key;
|
||||
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
|
||||
UINTN BootOptionCount;
|
||||
EFI_INPUT_KEY Key;
|
||||
|
||||
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
|
||||
//
|
||||
//Means enter the boot manager form.
|
||||
//Update the boot manage page,because the boot option may changed.
|
||||
// Means enter the boot manager form.
|
||||
// Update the boot manage page,because the boot option may changed.
|
||||
//
|
||||
if (QuestionId == 0x1212){
|
||||
UpdateBootManager();
|
||||
if (QuestionId == 0x1212) {
|
||||
UpdateBootManager ();
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -820,7 +831,7 @@ BootManagerCallback (
|
||||
gST->ConOut->ClearScreen (gST->ConOut);
|
||||
|
||||
//
|
||||
//check any reset required change is applied? if yes, reset system
|
||||
// check any reset required change is applied? if yes, reset system
|
||||
//
|
||||
BmSetupResetReminder ();
|
||||
|
||||
@@ -833,9 +844,9 @@ BootManagerCallback (
|
||||
|
||||
if (EFI_ERROR (BootOption[QuestionId - 1].Status)) {
|
||||
gST->ConOut->OutputString (
|
||||
gST->ConOut,
|
||||
HiiGetString (gBootManagerPrivate.HiiHandle, STRING_TOKEN (STR_ANY_KEY_CONTINUE), NULL)
|
||||
);
|
||||
gST->ConOut,
|
||||
HiiGetString (gBootManagerPrivate.HiiHandle, STRING_TOKEN (STR_ANY_KEY_CONTINUE), NULL)
|
||||
);
|
||||
gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||
}
|
||||
|
||||
@@ -858,24 +869,24 @@ BootManagerCallback (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BootManagerUiLibConstructor (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Install Device Path Protocol and Config Access protocol to driver handle
|
||||
//
|
||||
gBootManagerPrivate.DriverHandle = NULL;
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&gBootManagerPrivate.DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mBootManagerHiiVendorDevicePath,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
&gBootManagerPrivate.ConfigAccess,
|
||||
NULL
|
||||
);
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&gBootManagerPrivate.DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mBootManagerHiiVendorDevicePath,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
&gBootManagerPrivate.ConfigAccess,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
@@ -906,11 +917,11 @@ BootManagerUiLibConstructor (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BootManagerUiLibDestructor (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
gBootManagerPrivate.DriverHandle,
|
||||
|
@@ -33,8 +33,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
/// HII specific Vendor Device Path definition.
|
||||
///
|
||||
typedef struct {
|
||||
VENDOR_DEVICE_PATH VendorDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL End;
|
||||
VENDOR_DEVICE_PATH VendorDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL End;
|
||||
} HII_VENDOR_DEVICE_PATH;
|
||||
#pragma pack()
|
||||
|
||||
@@ -46,11 +46,11 @@ typedef struct {
|
||||
0x847bc3fe, 0xb974, 0x446d, {0x94, 0x49, 0x5a, 0xd5, 0x41, 0x2e, 0x99, 0x3b} \
|
||||
}
|
||||
|
||||
#define BOOT_MANAGER_FORM_ID 0x1000
|
||||
#define BOOT_MANAGER_FORM_ID 0x1000
|
||||
|
||||
#define LABEL_BOOT_OPTION 0x00
|
||||
#define LABEL_BOOT_OPTION_END 0x01
|
||||
#define MAX_STRING_LEN 200
|
||||
#define LABEL_BOOT_OPTION 0x00
|
||||
#define LABEL_BOOT_OPTION_END 0x01
|
||||
#define MAX_STRING_LEN 200
|
||||
|
||||
//
|
||||
// Variable created with this flag will be "Efi:...."
|
||||
@@ -60,23 +60,23 @@ typedef struct {
|
||||
//
|
||||
// These are the VFR compiler generated data representing our VFR data.
|
||||
//
|
||||
extern UINT8 BootManagerVfrBin[];
|
||||
extern UINT8 BootManagerVfrBin[];
|
||||
|
||||
#define BOOT_MANAGER_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('B', 'M', 'C', 'B')
|
||||
|
||||
typedef struct {
|
||||
UINTN Signature;
|
||||
UINTN Signature;
|
||||
|
||||
//
|
||||
// HII relative handles
|
||||
//
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
EFI_HANDLE DriverHandle;
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
EFI_HANDLE DriverHandle;
|
||||
|
||||
//
|
||||
// Produced protocols
|
||||
//
|
||||
EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
|
||||
EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
|
||||
} BOOT_MANAGER_CALLBACK_DATA;
|
||||
|
||||
/**
|
||||
@@ -100,12 +100,12 @@ typedef struct {
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BootManagerCallback (
|
||||
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
|
||||
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
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -133,10 +133,10 @@ BootManagerCallback (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BootManagerExtractConfig (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN CONST EFI_STRING Request,
|
||||
OUT EFI_STRING *Progress,
|
||||
OUT EFI_STRING *Results
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN CONST EFI_STRING Request,
|
||||
OUT EFI_STRING *Progress,
|
||||
OUT EFI_STRING *Results
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -158,9 +158,9 @@ BootManagerExtractConfig (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BootManagerRouteConfig (
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN CONST EFI_STRING Configuration,
|
||||
OUT EFI_STRING *Progress
|
||||
IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
|
||||
IN CONST EFI_STRING Configuration,
|
||||
OUT EFI_STRING *Progress
|
||||
);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user