OpenCore
1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcConsoleControlEntryModeLib.c
Go to the documentation of this file.
1
14
#include <Uefi.h>
15
16
#include <
Protocol/ConsoleControl.h
>
17
18
#include <Library/PcdLib.h>
19
#include <Library/UefiBootServicesTableLib.h>
20
21
EFI_STATUS
22
EFIAPI
23
OcConsoleControlEntryModeConstructor
(
24
IN EFI_HANDLE ImageHandle,
25
IN EFI_SYSTEM_TABLE *SystemTable
26
)
27
{
28
EFI_STATUS Status;
29
EFI_CONSOLE_CONTROL_PROTOCOL
*ConsoleControl;
30
31
if
(FixedPcdGet8 (PcdConsoleControlEntryMode) <
EfiConsoleControlScreenMaxValue
) {
32
//
33
// On several types of firmware, we need to use legacy console control protocol to
34
// switch to text mode, otherwise a black screen will be shown.
35
//
36
Status =
gBS
->HandleProtocol (
37
gST
->ConsoleOutHandle,
38
&
gEfiConsoleControlProtocolGuid
,
39
(VOID **)&ConsoleControl
40
);
41
if
(EFI_ERROR (Status)) {
42
Status =
gBS
->LocateProtocol (
43
&
gEfiConsoleControlProtocolGuid
,
44
NULL,
45
(VOID **)&ConsoleControl
46
);
47
}
48
49
if
(!EFI_ERROR (Status)) {
50
ConsoleControl->SetMode (
51
ConsoleControl,
52
FixedPcdGet8 (PcdConsoleControlEntryMode)
53
);
54
}
55
}
56
57
return
EFI_SUCCESS;
58
}
ConsoleControl.h
EfiConsoleControlScreenMaxValue
@ EfiConsoleControlScreenMaxValue
Definition
ConsoleControl.h:26
gEfiConsoleControlProtocolGuid
EFI_GUID gEfiConsoleControlProtocolGuid
gST
EFI_SYSTEM_TABLE * gST
Definition
OcBootServicesTableLib.c:28
gBS
EFI_BOOT_SERVICES * gBS
Definition
OcBootServicesTableLib.c:29
OcConsoleControlEntryModeConstructor
EFI_STATUS EFIAPI OcConsoleControlEntryModeConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition
OcConsoleControlEntryModeLib.c:23
EFI_CONSOLE_CONTROL_PROTOCOL
Definition
ConsoleControl.h:88
Library
OcConsoleControlEntryModeLib
OcConsoleControlEntryModeLib.c
Generated by
1.12.0