]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/PlatformBootManagerLib: Init console vars in *BeforeConsole()
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 20 Apr 2016 09:36:14 +0000 (17:36 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Wed, 4 May 2016 00:47:39 +0000 (08:47 +0800)
The major difference between IntelFrameworkModulePkg/BDS and
MdeModulePkg/BDS is the latter connects the consoles in core
code while the former connects in platform code.
The change initializes the console variables in
PlatformBootManagerBeforeConsole() and removes the console
connection code.
It also removes unused functions: PlatformBdsNoConsoleAction()
and LockKeyboards().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c

index 5c053ce99eab35d7e648e76872f14b1640c16222..cae2192f9a318be65c1b08823fc8d5be90e18120 100644 (file)
@@ -164,6 +164,8 @@ Returns:
                   &gEfiDxeSmmReadyToLockProtocolGuid, EFI_NATIVE_INTERFACE,\r
                   NULL);\r
   ASSERT_EFI_ERROR (Status);\r
+\r
+  PlatformInitializeConsole (gPlatformConsole);\r
 }\r
 \r
 \r
@@ -669,9 +671,9 @@ DetectAndPreparePlatformPciDevicePaths (
 }\r
 \r
 \r
-EFI_STATUS\r
-PlatformBdsConnectConsole (\r
-  IN BDS_CONSOLE_CONNECT_ENTRY   *PlatformConsole\r
+VOID\r
+PlatformInitializeConsole (\r
+  IN PLATFORM_CONSOLE_CONNECT_ENTRY   *PlatformConsole\r
   )\r
 /*++\r
 \r
@@ -683,37 +685,17 @@ Routine Description:
 Arguments:\r
 \r
   PlatformConsole         - Predfined platform default console device array.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS             - Success connect at least one ConIn and ConOut\r
-                            device, there must have one ConOut device is\r
-                            active vga device.\r
-\r
-  EFI_STATUS              - Return the status of\r
-                            BdsLibConnectAllDefaultConsoles ()\r
-\r
 --*/\r
 {\r
-  EFI_STATUS                         Status;\r
   UINTN                              Index;\r
   EFI_DEVICE_PATH_PROTOCOL           *VarConout;\r
   EFI_DEVICE_PATH_PROTOCOL           *VarConin;\r
-  UINTN                              DevicePathSize;\r
 \r
   //\r
   // Connect RootBridge\r
   //\r
-  VarConout = BdsLibGetVariableAndSize (\r
-                VarConsoleOut,\r
-                &gEfiGlobalVariableGuid,\r
-                &DevicePathSize\r
-                );\r
-  VarConin = BdsLibGetVariableAndSize (\r
-               VarConsoleInp,\r
-               &gEfiGlobalVariableGuid,\r
-               &DevicePathSize\r
-               );\r
+  GetEfiGlobalVariable2 (EFI_CON_OUT_VARIABLE_NAME, (VOID **) &VarConout, NULL);\r
+  GetEfiGlobalVariable2 (EFI_CON_IN_VARIABLE_NAME, (VOID **) &VarConin, NULL);\r
 \r
   if (VarConout == NULL || VarConin == NULL) {\r
     //\r
@@ -746,16 +728,6 @@ Returns:
     //\r
     DetectAndPreparePlatformPciDevicePaths (TRUE);\r
   }\r
-\r
-  //\r
-  // Connect the all the default console with current cosole variable\r
-  //\r
-  Status = BdsLibConnectAllDefaultConsoles ();\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
 }\r
 \r
 \r
@@ -1294,16 +1266,6 @@ Routine Description:
   // Notes: this part code can be change with the table policy\r
   //\r
   ASSERT (BootMode == BOOT_WITH_FULL_CONFIGURATION);\r
-  //\r
-  // Connect platform console\r
-  //\r
-  Status = PlatformBdsConnectConsole (gPlatformConsole);\r
-  if (EFI_ERROR (Status)) {\r
-    //\r
-    // Here OEM/IBV can customize with defined action\r
-    //\r
-    PlatformBdsNoConsoleAction ();\r
-  }\r
 \r
   //\r
   // Memory test and Logo show\r
@@ -1417,31 +1379,6 @@ Returns:
   }\r
 }\r
 \r
-EFI_STATUS\r
-PlatformBdsNoConsoleAction (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function is remained for IBV/OEM to do some platform action,\r
-  if there no console device can be connected.\r
-\r
-Arguments:\r
-\r
-  None.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS      - Direct return success now.\r
-\r
---*/\r
-{\r
-  DEBUG ((EFI_D_INFO, "PlatformBdsNoConsoleAction\n"));\r
-  return EFI_SUCCESS;\r
-}\r
-\r
 VOID\r
 EFIAPI\r
 PlatformBdsLockNonUpdatableFlash (\r
@@ -1566,23 +1503,3 @@ PlatformBootManagerWaitCallback (
 {\r
 }\r
 \r
-/**\r
-  Lock the ConsoleIn device in system table. All key\r
-  presses will be ignored until the Password is typed in. The only way to\r
-  disable the password is to type it in to a ConIn device.\r
-\r
-  @param  Password        Password used to lock ConIn device.\r
-\r
-  @retval EFI_SUCCESS     lock the Console In Spliter virtual handle successfully.\r
-  @retval EFI_UNSUPPORTED Password not found\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-LockKeyboards (\r
-  IN  CHAR16    *Password\r
-  )\r
-{\r
-    return EFI_UNSUPPORTED;\r
-}\r
-\r
index 922744f68a29984cdd2c617854467e3acdd9a7a4..6ea61eefe7b426f5c2f01cbf7ec7959f37f8c0b0 100644 (file)
@@ -65,22 +65,12 @@ Abstract:
 \r
 #include <OvmfPlatforms.h>\r
 \r
-extern BDS_CONSOLE_CONNECT_ENTRY  gPlatformConsole[];\r
 extern EFI_DEVICE_PATH_PROTOCOL   *gPlatformConnectSequence[];\r
 extern EFI_DEVICE_PATH_PROTOCOL   *gPlatformDriverOption[];\r
 extern ACPI_HID_DEVICE_PATH       gPnpPs2KeyboardDeviceNode;\r
 extern ACPI_HID_DEVICE_PATH       gPnp16550ComPortDeviceNode;\r
 extern UART_DEVICE_PATH           gUartDeviceNode;\r
 extern VENDOR_DEVICE_PATH         gTerminalTypeDeviceNode;\r
-//\r
-//\r
-//\r
-#define VarConsoleInpDev        L"ConInDev"\r
-#define VarConsoleInp           L"ConIn"\r
-#define VarConsoleOutDev        L"ConOutDev"\r
-#define VarConsoleOut           L"ConOut"\r
-#define VarErrorOutDev          L"ErrOutDev"\r
-#define VarErrorOut             L"ErrOut"\r
 \r
 #define PCI_DEVICE_PATH_NODE(Func, Dev) \\r
   { \\r
@@ -205,6 +195,16 @@ typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        End;\r
 } USB_CLASS_FORMAT_DEVICE_PATH;\r
 \r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
+  UINTN                     ConnectType;\r
+} PLATFORM_CONSOLE_CONNECT_ENTRY;\r
+\r
+#define CONSOLE_OUT BIT0\r
+#define CONSOLE_IN  BIT1\r
+#define STD_ERROR   BIT2\r
+extern PLATFORM_CONSOLE_CONNECT_ENTRY  gPlatformConsole[];\r
+\r
 //\r
 // Platform BDS Functions\r
 //\r
@@ -239,14 +239,9 @@ ProcessCapsules (
   EFI_BOOT_MODE BootMode\r
   );\r
 \r
-EFI_STATUS\r
-PlatformBdsConnectConsole (\r
-  IN BDS_CONSOLE_CONNECT_ENTRY   *PlatformConsole\r
-  );\r
-\r
-EFI_STATUS\r
-PlatformBdsNoConsoleAction (\r
-  VOID\r
+VOID\r
+PlatformInitializeConsole (\r
+  IN PLATFORM_CONSOLE_CONNECT_ENTRY   *PlatformConsole\r
   );\r
 \r
 EFI_STATUS\r
index f69c1a8714ec21b2f8e3c969fd5cc8063f379819..4f8cdf7112c4814990f28d31021127c937130d1d 100644 (file)
@@ -32,7 +32,7 @@ VENDOR_DEVICE_PATH         gTerminalTypeDeviceNode    = gPcAnsiTerminal;
 //\r
 // Predefined platform default console device path\r
 //\r
-BDS_CONSOLE_CONNECT_ENTRY   gPlatformConsole[] = {\r
+PLATFORM_CONSOLE_CONNECT_ENTRY   gPlatformConsole[] = {\r
   {\r
     NULL,\r
     0\r