From: Dandan Bi Date: Mon, 17 Apr 2017 08:12:48 +0000 (+0800) Subject: MdeModulePkg/BMMUiLib: Update codes of initializing ConsoleXXXCheck array X-Git-Tag: edk2-stable201903~4149 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=d508fe87fe73f1e99c5e71ff2aa49459cbe68d2f;p=mirror_edk2.git MdeModulePkg/BMMUiLib: Update codes of initializing ConsoleXXXCheck array When initializing ConsoleOutCheck/ConsoleInCheck/ConsoleErrCheck array in BMM_FAKE_NV_DATA structure, also need to consider whether the terminal device is ConOut/ConIn/ConErr or not. Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Eric Dong --- diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c index a145a77c70..b25c7a651b 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c @@ -1031,6 +1031,7 @@ GetConsoleInCheck ( BM_MENU_ENTRY *NewMenuEntry; UINT8 *ConInCheck; BM_CONSOLE_CONTEXT *NewConsoleContext; + BM_TERMINAL_CONTEXT *NewTerminalContext; ASSERT (CallbackData != NULL); @@ -1041,6 +1042,13 @@ GetConsoleInCheck ( NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext; ConInCheck[Index] = NewConsoleContext->IsActive; } + + for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) { + NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index); + NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext; + ASSERT (Index + ConsoleInpMenu.MenuNumber < MAX_MENU_NUMBER); + ConInCheck[Index + ConsoleInpMenu.MenuNumber] = NewTerminalContext->IsConIn; + } } /** @@ -1060,7 +1068,8 @@ GetConsoleOutCheck ( BM_MENU_ENTRY *NewMenuEntry; UINT8 *ConOutCheck; BM_CONSOLE_CONTEXT *NewConsoleContext; - + BM_TERMINAL_CONTEXT *NewTerminalContext; + ASSERT (CallbackData != NULL); ConOutCheck = &CallbackData->BmmFakeNvData.ConsoleOutCheck[0]; for (Index = 0; ((Index < ConsoleOutMenu.MenuNumber) && \ @@ -1069,6 +1078,13 @@ GetConsoleOutCheck ( NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext; ConOutCheck[Index] = NewConsoleContext->IsActive; } + + for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) { + NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index); + NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext; + ASSERT (Index + ConsoleOutMenu.MenuNumber < MAX_MENU_NUMBER); + ConOutCheck[Index + ConsoleOutMenu.MenuNumber] = NewTerminalContext->IsConOut; + } } /** @@ -1088,6 +1104,7 @@ GetConsoleErrCheck ( BM_MENU_ENTRY *NewMenuEntry; UINT8 *ConErrCheck; BM_CONSOLE_CONTEXT *NewConsoleContext; + BM_TERMINAL_CONTEXT *NewTerminalContext; ASSERT (CallbackData != NULL); ConErrCheck = &CallbackData->BmmFakeNvData.ConsoleErrCheck[0]; @@ -1097,6 +1114,13 @@ GetConsoleErrCheck ( NewConsoleContext = (BM_CONSOLE_CONTEXT *) NewMenuEntry->VariableContext; ConErrCheck[Index] = NewConsoleContext->IsActive; } + + for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) { + NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index); + NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext; + ASSERT (Index + ConsoleErrMenu.MenuNumber < MAX_MENU_NUMBER); + ConErrCheck[Index + ConsoleErrMenu.MenuNumber] = NewTerminalContext->IsStdErr; + } } /**