mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
48 lines
1.4 KiB
C
48 lines
1.4 KiB
C
/** @file
|
|
Copyright (C) 2019, Download-Fritz. All rights reserved.
|
|
|
|
This program and the accompanying materials
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
**/
|
|
|
|
#include <Uefi.h>
|
|
|
|
#include <Protocol/ConsoleControl.h>
|
|
|
|
#include <Library/PcdLib.h>
|
|
#include <Library/UefiBootServicesTableLib.h>
|
|
|
|
EFI_STATUS
|
|
EFIAPI
|
|
OcConsoleControlEntryModeInit (
|
|
IN EFI_HANDLE ImageHandle,
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
|
)
|
|
{
|
|
EFI_STATUS Status;
|
|
EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;
|
|
//
|
|
// On several firmwares we need to use legacy console control protocol to
|
|
// switch to text mode, otherwise a black screen will be shown.
|
|
//
|
|
Status = gBS->HandleProtocol (
|
|
gST->ConsoleOutHandle,
|
|
&gEfiConsoleControlProtocolGuid,
|
|
(VOID **)&ConsoleControl
|
|
);
|
|
if (!EFI_ERROR (Status)) {
|
|
ConsoleControl->SetMode (
|
|
ConsoleControl,
|
|
PcdGet8 (PcdConsoleControlEntryMode)
|
|
);
|
|
}
|
|
|
|
return EFI_SUCCESS;
|
|
}
|