OvmfPkg/PlatformBootManagerLib: Init console vars in *BeforeConsole()

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>
This commit is contained in:
Ruiyu Ni 2016-04-20 17:36:14 +08:00
parent 77f47588a7
commit e9e9ad644f
3 changed files with 21 additions and 109 deletions

View File

@ -164,6 +164,8 @@ Returns:
&gEfiDxeSmmReadyToLockProtocolGuid, EFI_NATIVE_INTERFACE,
NULL);
ASSERT_EFI_ERROR (Status);
PlatformInitializeConsole (gPlatformConsole);
}
@ -669,9 +671,9 @@ DetectAndPreparePlatformPciDevicePaths (
}
EFI_STATUS
PlatformBdsConnectConsole (
IN BDS_CONSOLE_CONNECT_ENTRY *PlatformConsole
VOID
PlatformInitializeConsole (
IN PLATFORM_CONSOLE_CONNECT_ENTRY *PlatformConsole
)
/*++
@ -683,37 +685,17 @@ Routine Description:
Arguments:
PlatformConsole - Predfined platform default console device array.
Returns:
EFI_SUCCESS - Success connect at least one ConIn and ConOut
device, there must have one ConOut device is
active vga device.
EFI_STATUS - Return the status of
BdsLibConnectAllDefaultConsoles ()
--*/
{
EFI_STATUS Status;
UINTN Index;
EFI_DEVICE_PATH_PROTOCOL *VarConout;
EFI_DEVICE_PATH_PROTOCOL *VarConin;
UINTN DevicePathSize;
//
// Connect RootBridge
//
VarConout = BdsLibGetVariableAndSize (
VarConsoleOut,
&gEfiGlobalVariableGuid,
&DevicePathSize
);
VarConin = BdsLibGetVariableAndSize (
VarConsoleInp,
&gEfiGlobalVariableGuid,
&DevicePathSize
);
GetEfiGlobalVariable2 (EFI_CON_OUT_VARIABLE_NAME, (VOID **) &VarConout, NULL);
GetEfiGlobalVariable2 (EFI_CON_IN_VARIABLE_NAME, (VOID **) &VarConin, NULL);
if (VarConout == NULL || VarConin == NULL) {
//
@ -746,16 +728,6 @@ Returns:
//
DetectAndPreparePlatformPciDevicePaths (TRUE);
}
//
// Connect the all the default console with current cosole variable
//
Status = BdsLibConnectAllDefaultConsoles ();
if (EFI_ERROR (Status)) {
return Status;
}
return EFI_SUCCESS;
}
@ -1294,16 +1266,6 @@ Routine Description:
// Notes: this part code can be change with the table policy
//
ASSERT (BootMode == BOOT_WITH_FULL_CONFIGURATION);
//
// Connect platform console
//
Status = PlatformBdsConnectConsole (gPlatformConsole);
if (EFI_ERROR (Status)) {
//
// Here OEM/IBV can customize with defined action
//
PlatformBdsNoConsoleAction ();
}
//
// Memory test and Logo show
@ -1417,31 +1379,6 @@ Returns:
}
}
EFI_STATUS
PlatformBdsNoConsoleAction (
VOID
)
/*++
Routine Description:
This function is remained for IBV/OEM to do some platform action,
if there no console device can be connected.
Arguments:
None.
Returns:
EFI_SUCCESS - Direct return success now.
--*/
{
DEBUG ((EFI_D_INFO, "PlatformBdsNoConsoleAction\n"));
return EFI_SUCCESS;
}
VOID
EFIAPI
PlatformBdsLockNonUpdatableFlash (
@ -1566,23 +1503,3 @@ PlatformBootManagerWaitCallback (
{
}
/**
Lock the ConsoleIn device in system table. All key
presses will be ignored until the Password is typed in. The only way to
disable the password is to type it in to a ConIn device.
@param Password Password used to lock ConIn device.
@retval EFI_SUCCESS lock the Console In Spliter virtual handle successfully.
@retval EFI_UNSUPPORTED Password not found
**/
EFI_STATUS
EFIAPI
LockKeyboards (
IN CHAR16 *Password
)
{
return EFI_UNSUPPORTED;
}

View File

@ -65,22 +65,12 @@ Abstract:
#include <OvmfPlatforms.h>
extern BDS_CONSOLE_CONNECT_ENTRY gPlatformConsole[];
extern EFI_DEVICE_PATH_PROTOCOL *gPlatformConnectSequence[];
extern EFI_DEVICE_PATH_PROTOCOL *gPlatformDriverOption[];
extern ACPI_HID_DEVICE_PATH gPnpPs2KeyboardDeviceNode;
extern ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode;
extern UART_DEVICE_PATH gUartDeviceNode;
extern VENDOR_DEVICE_PATH gTerminalTypeDeviceNode;
//
//
//
#define VarConsoleInpDev L"ConInDev"
#define VarConsoleInp L"ConIn"
#define VarConsoleOutDev L"ConOutDev"
#define VarConsoleOut L"ConOut"
#define VarErrorOutDev L"ErrOutDev"
#define VarErrorOut L"ErrOut"
#define PCI_DEVICE_PATH_NODE(Func, Dev) \
{ \
@ -205,6 +195,16 @@ typedef struct {
EFI_DEVICE_PATH_PROTOCOL End;
} USB_CLASS_FORMAT_DEVICE_PATH;
typedef struct {
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
UINTN ConnectType;
} PLATFORM_CONSOLE_CONNECT_ENTRY;
#define CONSOLE_OUT BIT0
#define CONSOLE_IN BIT1
#define STD_ERROR BIT2
extern PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[];
//
// Platform BDS Functions
//
@ -239,14 +239,9 @@ ProcessCapsules (
EFI_BOOT_MODE BootMode
);
EFI_STATUS
PlatformBdsConnectConsole (
IN BDS_CONSOLE_CONNECT_ENTRY *PlatformConsole
);
EFI_STATUS
PlatformBdsNoConsoleAction (
VOID
PlatformInitializeConsole (
IN PLATFORM_CONSOLE_CONNECT_ENTRY *PlatformConsole
);
EFI_STATUS

View File

@ -32,7 +32,7 @@ VENDOR_DEVICE_PATH gTerminalTypeDeviceNode = gPcAnsiTerminal;
//
// Predefined platform default console device path
//
BDS_CONSOLE_CONNECT_ENTRY gPlatformConsole[] = {
PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] = {
{
NULL,
0