]> git.proxmox.com Git - mirror_edk2.git/commitdiff
clean console control protocol in bds module.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 20 Mar 2009 09:25:28 +0000 (09:25 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 20 Mar 2009 09:25:28 +0000 (09:25 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7915 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c
IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h
IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c

index 1e34c03e2073fb35c04293b36ff19cf393cc3997..30a6c3e6ed6a6a9e2b9db7f826493504bc11ef01 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   BDS Lib functions which contain all the code to connect console device\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2004 - 2009, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -728,16 +728,7 @@ LockKeyboards (
   IN  CHAR16    *Password\r
   )\r
 {\r
-  EFI_STATUS                    Status;\r
-  EFI_CONSOLE_CONTROL_PROTOCOL  *ConsoleControl;\r
-\r
-  Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID **) &ConsoleControl);\r
-  if (EFI_ERROR (Status)) {\r
     return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  Status = ConsoleControl->LockStdIn (ConsoleControl, Password);\r
-  return Status;\r
 }\r
 \r
 \r
@@ -758,7 +749,6 @@ EnableQuietBoot (
   )\r
 {\r
   EFI_STATUS                    Status;\r
-  EFI_CONSOLE_CONTROL_PROTOCOL  *ConsoleControl;\r
   EFI_OEM_BADGING_PROTOCOL      *Badging;\r
   UINT32                        SizeOfX;\r
   UINT32                        SizeOfY;\r
@@ -780,11 +770,6 @@ EnableQuietBoot (
   UINT32                        RefreshRate;\r
   EFI_GRAPHICS_OUTPUT_PROTOCOL  *GraphicsOutput;\r
 \r
-  Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID **) &ConsoleControl);\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
   UgaDraw = NULL;\r
   //\r
   // Try to open GOP first\r
@@ -801,16 +786,13 @@ EnableQuietBoot (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  Badging = NULL;\r
-  Status  = gBS->LocateProtocol (&gEfiOEMBadgingProtocolGuid, NULL, (VOID **) &Badging);\r
-\r
   //\r
-  // Set console control to graphics mode.\r
+  // Erase Cursor from screen\r
   //\r
-  Status = ConsoleControl->SetMode (ConsoleControl, EfiConsoleControlScreenGraphics);\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
+  gST->ConOut->EnableCursor (gST->ConOut, FALSE);\r
+\r
+  Badging = NULL;\r
+  Status  = gBS->LocateProtocol (&gEfiOEMBadgingProtocolGuid, NULL, (VOID **) &Badging);\r
 \r
   if (GraphicsOutput != NULL) {\r
     SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;\r
@@ -1004,17 +986,11 @@ DisableQuietBoot (
   VOID\r
   )\r
 {\r
-  EFI_STATUS                    Status;\r
-  EFI_CONSOLE_CONTROL_PROTOCOL  *ConsoleControl;\r
-\r
-  Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID **) &ConsoleControl);\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
 \r
   //\r
-  // Set console control to text mode.\r
+  // Enable Cursor on Screen\r
   //\r
-  return ConsoleControl->SetMode (ConsoleControl, EfiConsoleControlScreenText);\r
+  gST->ConOut->EnableCursor (gST->ConOut, TRUE);\r
+  return EFI_SUCCESS;\r
 }\r
 \r
index 983280a666bdeeadd1c70cd8abe48d3bb60fe2e7..52467067cd9c14ccb291a78c48520e404e6df61d 100644 (file)
@@ -5,7 +5,7 @@
 #  2) BDS boot device connect interface;\r
 #  3) BDS Misc interfaces for mainting boot variable, ouput string, etc.\r
 #  \r
-#  Copyright (c) 2007 - 2008, Intel Corporation. <BR>\r
+#  Copyright (c) 2007 - 2009, Intel Corporation. <BR>\r
 #  All rights reserved. This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
   gEfiAcpiS3SaveProtocolGuid                    # PROTOCOL CONSUMES\r
   gEfiGraphicsOutputProtocolGuid                # PROTOCOL SOMETIMES_CONSUMES\r
   gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport # PROTOCOL SOMETIMES_CONSUMES\r
-  gEfiConsoleControlProtocolGuid                # PROTOCOL CONSUMES\r
   gEfiOEMBadgingProtocolGuid                    # PROTOCOL CONSUMES\r
   gEfiHiiFontProtocolGuid                       # PROTOCOL CONSUMES\r
   gEfiSecurityArchProtocolGuid\r
index 61d5227c0910a8463b1003cb263841a230dca81f..3b2fe859543c4bfb06b3da010de3ba7116514b54 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   BDS library definition, include the file and data structure\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2004 - 2009, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -34,7 +34,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/PciIo.h>\r
 #include <Protocol/AcpiS3Save.h>\r
 #include <Protocol/OEMBadging.h>\r
-#include <Protocol/ConsoleControl.h>\r
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/UgaDraw.h>\r
 #include <Protocol/HiiFont.h>\r
index 2471c12be7439d1d87574b7dbe03cf822020f7d6..50e5689ccedb92af29db32bdea50a0af8bfa59b0 100644 (file)
@@ -31,7 +31,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/BlockIo.h>\r
 #include <Guid/GlobalVariable.h>\r
 #include <Guid/CapsuleVendor.h>\r
-#include <Protocol/ConsoleControl.h>\r
 #include <Protocol/GenericMemoryTest.h>\r
 #include <Protocol/FormBrowser2.h>\r
 #include <Protocol/HiiConfigAccess.h>\r
index 19294ae9d3d30031602934d9b8848613df446487..2daacb6d6f4fc6a3c3f93419cc96ab66f99bd4cd 100644 (file)
   gEfiDataHubProtocolGuid                       # PROTOCOL ALWAYS_CONSUMES\r
   gEfiGenericMemTestProtocolGuid                # PROTOCOL ALWAYS_CONSUMES\r
   gEfiLegacyBiosProtocolGuid                    # PROTOCOL ALWAYS_CONSUMES\r
-  gEfiConsoleControlProtocolGuid                # PROTOCOL ALWAYS_CONSUMES\r
   gEfiHiiDatabaseProtocolGuid                   # PROTOCOL ALWAYS_CONSUMES\r
   gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport # PROTOCOL SOMETIMES_CONSUMES\r
   gEfiBlockIoProtocolGuid                       # PROTOCOL ALWAYS_CONSUMES\r
index c1b4eff1cd7eef849f581d86a5bd1d8ec718d747..fb605d57d9e15f6272a690ab98d5ed4bcc3157d7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   FrontPage routines to handle the callbacks and browser calls\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2004 - 2009, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -856,7 +856,6 @@ PlatformBdsEnterFrontPage (
   )\r
 {\r
   EFI_STATUS                    Status;\r
-  EFI_CONSOLE_CONTROL_PROTOCOL  *ConsoleControl;\r
 \r
   PERF_START (0, "BdsTimeOut", "BDS", 0);\r
   //\r
@@ -970,8 +969,4 @@ Exit:
   // takes affect\r
   //\r
   PERF_END (0, "BdsTimeOut", "BDS", 0);\r
-  Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID **) &ConsoleControl);\r
-  if (Status == EFI_SUCCESS) {\r
-    ConsoleControl->SetMode (ConsoleControl, EfiConsoleControlScreenText);\r
-  }\r
 }\r
index 854f8952c44bf340a2088e94c3561913e38b425f..59759509e24e3dd2935b848660705cb72a4fa9a0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Perform the platform memory test\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2004 - 2009, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -222,7 +222,7 @@ BdsMemoryTest (
   BOOLEAN                           ErrorOut;\r
   BOOLEAN                           TestAbort;\r
   EFI_INPUT_KEY                     Key;\r
-  CHAR16                            StrPercent[16];\r
+  CHAR16                            StrPercent[80];\r
   CHAR16                            *StrTotalMemory;\r
   CHAR16                            *Pos;\r
   CHAR16                            *TmpStr;\r
@@ -255,10 +255,6 @@ BdsMemoryTest (
 \r
   RequireSoftECCInit = FALSE;\r
 \r
-  gST->ConOut->ClearScreen (gST->ConOut);\r
-  gST->ConOut->SetAttribute (gST->ConOut, EFI_YELLOW | EFI_BRIGHT);\r
-  gST->ConOut->EnableCursor (gST->ConOut, FALSE);\r
-\r
   Status = gBS->LocateProtocol (\r
                   &gEfiGenericMemTestProtocolGuid,\r
                   NULL,\r
@@ -286,11 +282,10 @@ BdsMemoryTest (
     return EFI_SUCCESS;\r
   }\r
 \r
-  gST->ConOut->SetCursorPosition (gST->ConOut, 0, 2);\r
   TmpStr = GetStringById (STRING_TOKEN (STR_ESC_TO_SKIP_MEM_TEST));\r
 \r
   if (TmpStr != NULL) {\r
-    gST->ConOut->OutputString (gST->ConOut, TmpStr);\r
+    PrintXY (10, 10, NULL, NULL, TmpStr);\r
     FreePool (TmpStr);\r
   }\r
 \r
@@ -306,8 +301,6 @@ BdsMemoryTest (
       TmpStr = GetStringById (STRING_TOKEN (STR_SYSTEM_MEM_ERROR));\r
       if (TmpStr != NULL) {\r
         PrintXY (10, 10, NULL, NULL, TmpStr);\r
-        gST->ConOut->SetCursorPosition (gST->ConOut, 0, 4);\r
-        gST->ConOut->OutputString (gST->ConOut, TmpStr);\r
         FreePool (TmpStr);\r
       }\r
 \r
@@ -321,10 +314,13 @@ BdsMemoryTest (
                             );\r
     if (TestPercent != PreviousValue) {\r
       UnicodeValueToString (StrPercent, 0, TestPercent, 0);\r
-      gST->ConOut->SetCursorPosition (gST->ConOut, 0, 0);\r
       TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT));\r
       if (TmpStr != NULL) {\r
-        BdsLibOutputStrings (gST->ConOut, StrPercent, TmpStr, NULL);\r
+        //\r
+        // TmpStr size is 64, StrPercent is reserved to 16.\r
+        //\r
+        StrCat (StrPercent, TmpStr);\r
+        PrintXY (10, 10, NULL, NULL, StrPercent);\r
         FreePool (TmpStr);\r
       }\r
 \r
@@ -360,8 +356,7 @@ BdsMemoryTest (
           FreePool (TmpStr);\r
         }\r
 \r
-        gST->ConOut->SetCursorPosition (gST->ConOut, 0, 0);\r
-        gST->ConOut->OutputString (gST->ConOut, L"100");\r
+        PrintXY (10, 10, NULL, NULL, L"100");\r
         Status = GenMemoryTest->Finished (GenMemoryTest);\r
         goto Done;\r
       }\r
@@ -384,10 +379,7 @@ Done:
     FreePool (TmpStr);\r
   }\r
 \r
-  gST->ConOut->ClearScreen (gST->ConOut);\r
-  gST->ConOut->SetAttribute (gST->ConOut, EFI_YELLOW | EFI_BRIGHT);\r
-  gST->ConOut->EnableCursor (gST->ConOut, FALSE);\r
-  gST->ConOut->OutputString (gST->ConOut, StrTotalMemory);\r
+  PrintXY (10, 10, NULL, NULL, StrTotalMemory);\r
   PlatformBdsShowProgress (\r
     Foreground,\r
     Background,\r