public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] MdeModulePkg/BMMUiLib: Update codes of initializing ConsoleXXXCheck array
@ 2017-04-18  3:50 Dandan Bi
  2017-04-18  4:51 ` Dong, Eric
  0 siblings, 1 reply; 2+ messages in thread
From: Dandan Bi @ 2017-04-18  3:50 UTC (permalink / raw)
  To: edk2-devel; +Cc: Eric Dong

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 <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 .../BootMaintenanceManagerUiLib/ConsoleOption.c    | 26 +++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
index a145a77..b25c7a6 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
@@ -1029,20 +1029,28 @@ GetConsoleInCheck (
 {
   UINT16              Index;
   BM_MENU_ENTRY       *NewMenuEntry; 
   UINT8               *ConInCheck;
   BM_CONSOLE_CONTEXT  *NewConsoleContext;
+  BM_TERMINAL_CONTEXT *NewTerminalContext;
 
   ASSERT (CallbackData != NULL);
 
   ConInCheck = &CallbackData->BmmFakeNvData.ConsoleInCheck[0];
   for (Index = 0; ((Index < ConsoleInpMenu.MenuNumber) && \
        (Index < MAX_MENU_NUMBER)) ; Index++) {  
     NewMenuEntry      = BOpt_GetMenuEntry (&ConsoleInpMenu, Index);
     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;
+  }
 }
 
 /**
 
   Initialize console output device check box to ConsoleOutCheck[MAX_MENU_NUMBER]
@@ -1058,19 +1066,27 @@ GetConsoleOutCheck (
 {
   UINT16              Index;
   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) && \
        (Index < MAX_MENU_NUMBER)) ; Index++) {  
     NewMenuEntry      = BOpt_GetMenuEntry (&ConsoleOutMenu, Index);
     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;
+  }
 }
 
 /**
 
   Initialize standard error output device check box to ConsoleErrCheck[MAX_MENU_NUMBER]
@@ -1086,19 +1102,27 @@ GetConsoleErrCheck (
 {
   UINT16              Index;
   BM_MENU_ENTRY       *NewMenuEntry; 
   UINT8               *ConErrCheck;
   BM_CONSOLE_CONTEXT  *NewConsoleContext;
+  BM_TERMINAL_CONTEXT *NewTerminalContext;
 
   ASSERT (CallbackData != NULL);
   ConErrCheck = &CallbackData->BmmFakeNvData.ConsoleErrCheck[0];
   for (Index = 0; ((Index < ConsoleErrMenu.MenuNumber) && \
        (Index < MAX_MENU_NUMBER)) ; Index++) {  
     NewMenuEntry      = BOpt_GetMenuEntry (&ConsoleErrMenu, Index);
     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;
+  }
 }
 
 /**
 
   Initialize terminal attributes (baudrate, data rate, stop bits, parity and terminal type)
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-18  4:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-18  3:50 [patch] MdeModulePkg/BMMUiLib: Update codes of initializing ConsoleXXXCheck array Dandan Bi
2017-04-18  4:51 ` Dong, Eric

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox