On 04/29/16 09:00, Ruiyu Ni wrote:
> 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...@intel.com>
> Cc: Jordan Justen <jordan.l.jus...@intel.com>
> Cc: Laszlo Ersek <ler...@redhat.com>
> ---
>  .../Library/PlatformBootManagerLib/BdsPlatform.c   | 97 
> ++--------------------
>  .../Library/PlatformBootManagerLib/BdsPlatform.h   | 31 +++----
>  .../Library/PlatformBootManagerLib/PlatformData.c  |  2 +-
>  3 files changed, 21 insertions(+), 109 deletions(-)

Reviewed-by: Laszlo Ersek <ler...@redhat.com>

Thanks!
Laszlo

> diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c 
> b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
> index 5c053ce..cae2192 100644
> --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
> +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
> @@ -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;
> -}
> -
> diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h 
> b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
> index 922744f..6ea61ee 100644
> --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
> +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h
> @@ -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
> +VOID
> +PlatformInitializeConsole (
> +  IN PLATFORM_CONSOLE_CONNECT_ENTRY   *PlatformConsole
>    );
>  
>  EFI_STATUS
> diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c 
> b/OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c
> index f69c1a8..4f8cdf7 100644
> --- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c
> +++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c
> @@ -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
> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to