summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h2
-rw-r--r--ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf3
-rw-r--r--ArmVirtPkg/ArmVirtCloudHv.dsc1
-rw-r--r--ArmVirtPkg/ArmVirtKvmTool.dsc1
-rw-r--r--ArmVirtPkg/ArmVirtQemu.dsc1
-rw-r--r--ArmVirtPkg/ArmVirtQemuKernel.dsc1
-rw-r--r--ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManagerDxe.inf1
-rw-r--r--ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf1
-rw-r--r--ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf1
-rwxr-xr-xBaseTools/Conf/tools_def.template6
-rw-r--r--BaseTools/Source/C/Include/Protocol/HiiFramework.h50
-rw-r--r--BaseTools/Source/C/Include/Protocol/UgaDraw.h161
-rw-r--r--BaseTools/set_vsprefix_envs.bat7
-rwxr-xr-xBaseTools/toolsetup.bat11
-rw-r--r--EmbeddedPkg/EmbeddedPkg.dec2
-rw-r--r--EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c74
-rw-r--r--EmulatorPkg/EmuGopDxe/Gop.h8
-rw-r--r--EmulatorPkg/EmuGopDxe/GopScreen.c14
-rw-r--r--EmulatorPkg/Include/Protocol/EmuFileSystem.h18
-rw-r--r--EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h18
-rw-r--r--EmulatorPkg/Library/PlatformBmLib/PlatformBm.h2
-rw-r--r--EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c4
-rw-r--r--EmulatorPkg/Unix/Host/Gasket.h10
-rw-r--r--EmulatorPkg/Unix/Host/Host.h1
-rw-r--r--EmulatorPkg/Unix/Host/Ia32/Gasket.S2
-rw-r--r--EmulatorPkg/Unix/Host/X11GraphicsWindow.c82
-rw-r--r--EmulatorPkg/Unix/Host/X64/Gasket.S2
-rw-r--r--EmulatorPkg/Win/Host/WinGopScreen.c10
-rw-r--r--Maintainers.txt4
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c2
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c11
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain.h2
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain.inf1
-rw-r--r--MdeModulePkg/Core/Dxe/Mem/Page.c32
-rw-r--r--MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c63
-rw-r--r--MdeModulePkg/Include/Library/BootLogoLib.h2
-rw-r--r--MdeModulePkg/Library/BootLogoLib/BootLogoLib.c229
-rw-r--r--MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf4
-rw-r--r--MdeModulePkg/MdeModulePkg.dec10
-rw-r--r--MdeModulePkg/MdeModulePkg.uni6
-rw-r--r--MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c317
-rw-r--r--MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h134
-rw-r--r--MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf14
-rw-r--r--MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni11
-rw-r--r--MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c308
-rw-r--r--MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c300
-rw-r--r--MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h19
-rw-r--r--MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf6
-rw-r--r--MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.uni4
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/Image.c2
-rw-r--r--MdePkg/Include/Guid/FdtHob.h (renamed from EmbeddedPkg/Include/Guid/FdtHob.h)0
-rw-r--r--MdePkg/Include/Protocol/UgaDraw.h159
-rw-r--r--MdePkg/Include/Protocol/UgaIo.h189
-rw-r--r--MdePkg/Library/UefiLib/UefiLib.inf2
-rw-r--r--MdePkg/Library/UefiLib/UefiLibInternal.h1
-rw-r--r--MdePkg/Library/UefiLib/UefiLibPrint.c90
-rw-r--r--MdePkg/MdePkg.dec15
-rw-r--r--MdePkg/MdePkg.dsc3
-rw-r--r--MdePkg/MdePkg.uni6
-rw-r--r--OvmfPkg/AmdSev/AmdSevX64.dsc1
-rw-r--r--OvmfPkg/Bhyve/BhyveRfbDxe/GopScreen.c4
-rw-r--r--OvmfPkg/Bhyve/BhyveX64.dsc1
-rw-r--r--OvmfPkg/CloudHv/CloudHvX64.dsc1
-rw-r--r--OvmfPkg/IntelTdx/IntelTdxX64.dsc1
-rw-r--r--OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c4
-rw-r--r--OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc1
-rw-r--r--OvmfPkg/Microvm/MicrovmX64.dsc1
-rw-r--r--OvmfPkg/OvmfPkgIa32.dsc1
-rw-r--r--OvmfPkg/OvmfPkgIa32X64.dsc1
-rw-r--r--OvmfPkg/OvmfPkgX64.dsc1
-rw-r--r--OvmfPkg/OvmfXen.dsc1
-rw-r--r--OvmfPkg/PlatformCI/PlatformBuildLib.py15
-rw-r--r--OvmfPkg/PlatformDxe/Platform.c26
-rw-r--r--OvmfPkg/PlatformDxe/Platform.inf2
-rw-r--r--OvmfPkg/RiscVVirt/RiscVVirt.fdf.inc1
-rw-r--r--OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc1
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c2
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h2
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf2
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni2
-rw-r--r--StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.c216
-rw-r--r--StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.h64
-rw-r--r--StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.inf3
-rw-r--r--StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.c265
-rw-r--r--StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.h156
-rw-r--r--StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.inf51
-rw-r--r--StandaloneMmPkg/StandaloneMmPkg.dsc3
-rw-r--r--UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c2
-rw-r--r--UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h1
-rw-r--r--UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf2
-rw-r--r--UefiCpuPkg/CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf2
-rw-r--r--UefiCpuPkg/CpuTimerDxeRiscV64/Timer.c7
-rw-r--r--UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf6
-rw-r--r--UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/CpuTimerLib.c57
-rw-r--r--UefiCpuPkg/Library/MpInitLib/DxeMpLib.c64
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c18
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.h19
-rw-r--r--UefiCpuPkg/Library/MpInitLib/PeiMpLib.c101
-rw-r--r--UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h2
-rw-r--r--UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf2
-rw-r--r--UefiPayloadPkg/UefiPayloadPkg.dsc1
-rw-r--r--pip-requirements.txt4
102 files changed, 1169 insertions, 2388 deletions
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
index a40a2ff..6bf4c09 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.h
@@ -43,7 +43,7 @@ EnableQuietBoot (
Simple Text Out screens will now be synced up with all non video output
devices
- @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
+ @retval EFI_SUCCESS Devices are back in text mode and synced up.
**/
EFI_STATUS
DisableQuietBoot (
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index bc029be..44b9a25 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -52,9 +52,6 @@
UefiLib
UefiRuntimeServicesTableLib
-[FeaturePcd]
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
-
[FixedPcd]
gArmTokenSpaceGuid.PcdUefiShellDefaultBootEnable
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc
index b076f59..541e7c9 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.dsc
+++ b/ArmVirtPkg/ArmVirtCloudHv.dsc
@@ -87,7 +87,6 @@
## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
# It could be set FALSE to save size.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
index 5cb3e45..9d0411d 100644
--- a/ArmVirtPkg/ArmVirtKvmTool.dsc
+++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
@@ -127,7 +127,6 @@
## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
# It could be set FALSE to save size.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
# Use MMIO for accessing RTC controller registers.
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcUseMmio|TRUE
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 00f9651..fadd15f 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -153,7 +153,6 @@
## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
# It could be set FALSE to save size.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc
index 9821b0d..eee9590 100644
--- a/ArmVirtPkg/ArmVirtQemuKernel.dsc
+++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc
@@ -122,7 +122,6 @@
## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
# It could be set FALSE to save size.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
diff --git a/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManagerDxe.inf b/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManagerDxe.inf
index a333966..c6d7e85 100644
--- a/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManagerDxe.inf
+++ b/ArmVirtPkg/KvmtoolCfgMgrDxe/ConfigurationManagerDxe.inf
@@ -30,7 +30,6 @@
[Packages]
ArmVirtPkg/ArmVirtPkg.dec
DynamicTablesPkg/DynamicTablesPkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
diff --git a/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf
index 77c0b92..d642cc8 100644
--- a/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf
+++ b/ArmVirtPkg/Library/KvmtoolPlatformPeiLib/KvmtoolPlatformPeiLib.inf
@@ -21,7 +21,6 @@
[Packages]
ArmPkg/ArmPkg.dec
ArmVirtPkg/ArmVirtPkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
diff --git a/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf b/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf
index e9a34b6..d6c1b13 100644
--- a/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf
+++ b/ArmVirtPkg/Library/PlatformPeiLib/PlatformPeiLib.inf
@@ -21,7 +21,6 @@
[Packages]
ArmPkg/ArmPkg.dec
ArmVirtPkg/ArmVirtPkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index cca699c..2108948 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -1932,11 +1932,11 @@ RELEASE_GCC_LOONGARCH64_CC_FLAGS = DEF(GCC5_LOONGARCH64_CC_FLAGS) -Wno-unu
DEFINE CLANGPDB_IA32_PREFIX = ENV(CLANG_BIN)
DEFINE CLANGPDB_X64_PREFIX = ENV(CLANG_BIN)
-DEFINE CLANGPDB_IA32_TARGET = -target i686-unknown-windows-gnu
-DEFINE CLANGPDB_X64_TARGET = -target x86_64-unknown-windows-gnu
+DEFINE CLANGPDB_IA32_TARGET = -target i686-pc-windows-msvc
+DEFINE CLANGPDB_X64_TARGET = -target x86_64-pc-windows-msvc
DEFINE CLANGPDB_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unused-const-variable -Wno-varargs -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-unused-const-variable -Wno-unaligned-access -Wno-microsoft-enum-forward-reference
-DEFINE CLANGPDB_ALL_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) DEF(CLANGPDB_WARNING_OVERRIDES) -fno-stack-protector -funsigned-char -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -Wno-null-dereference -mno-implicit-float -mms-bitfields -mno-stack-arg-probe -nostdlib -nostdlibinc -fseh-exceptions
+DEFINE CLANGPDB_ALL_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) DEF(CLANGPDB_WARNING_OVERRIDES) -fno-stack-protector -funsigned-char -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -Wno-address -Wno-shift-negative-value -Wno-unknown-pragmas -Wno-incompatible-library-redeclaration -Wno-null-dereference -mno-implicit-float -mms-bitfields -mno-stack-arg-probe -nostdlib -nostdlibinc -fno-omit-frame-pointer -U _MSC_VER -D __GNUC__
###########################
# CLANGPDB IA32 definitions
diff --git a/BaseTools/Source/C/Include/Protocol/HiiFramework.h b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
index 4483509..21abdf0 100644
--- a/BaseTools/Source/C/Include/Protocol/HiiFramework.h
+++ b/BaseTools/Source/C/Include/Protocol/HiiFramework.h
@@ -28,19 +28,6 @@
0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \
}
-// BugBug:
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-// If UGA goes away we need to put this some place. I'm not sure where?
-//
-//typedef struct {
-// UINT8 Blue;
-// UINT8 Green;
-// UINT8 Red;
-// UINT8 Reserved;
-//} EFI_UGA_PIXEL;
-
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-//
typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;
@@ -576,39 +563,6 @@ EFI_STATUS
);
/**
- Translates a glyph into the format required for input to the Universal
- Graphics Adapter (UGA) Block Transfer (BLT) routines.
-
- @param This A pointer to the EFI_HII_PROTOCOL instance.
- @param GlyphBuffer A pointer to the buffer that contains glyph data.
- @param Foreground The foreground setting requested to be used for the
- generated BltBuffer data.
- @param Background The background setting requested to be used for the
- generated BltBuffer data.
- @param Count The entry in the BltBuffer upon which to act.
- @param Width The width in bits of the glyph being converted.
- @param Height The height in bits of the glyph being converted
- @param BltBuffer A pointer to the buffer that contains the data that is
- ready to be used by the UGA BLT routines.
-
- @retval EFI_SUCCESS It worked.
- @retval EFI_NOT_FOUND A glyph for a character was not found.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_HII_GLYPH_TO_BLT) (
- IN EFI_HII_PROTOCOL *This,
- IN UINT8 *GlyphBuffer,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
- IN UINTN Count,
- IN UINTN Width,
- IN UINTN Height,
- IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
- );
-
-/**
Allows a new string to be added to an already existing string package.
@param This A pointer to the EFI_HII_PROTOCOL instance.
@@ -878,9 +832,6 @@ EFI_STATUS
@param GetGlyph
Translates a Unicode character into the corresponding font glyph.
- @param GlyphToBlt
- Converts a glyph value into a format that is ready for a UGA BLT command.
-
@param NewString
Allows a new string to be added to an already existing string package.
@@ -924,7 +875,6 @@ struct _EFI_HII_PROTOCOL {
EFI_HII_TEST_STRING TestString;
EFI_HII_GET_GLYPH GetGlyph;
- EFI_HII_GLYPH_TO_BLT GlyphToBlt;
EFI_HII_NEW_STRING NewString;
EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;
diff --git a/BaseTools/Source/C/Include/Protocol/UgaDraw.h b/BaseTools/Source/C/Include/Protocol/UgaDraw.h
deleted file mode 100644
index 412b000..0000000
--- a/BaseTools/Source/C/Include/Protocol/UgaDraw.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file
- UGA Draw protocol from the EFI 1.1 specification.
-
- Abstraction of a very simple graphics device.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __UGA_DRAW_H__
-#define __UGA_DRAW_H__
-
-#define EFI_UGA_DRAW_PROTOCOL_GUID \
- { \
- 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
- }
-
-typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
-
-/**
- Return the current video mode information.
-
- @param This Protocol instance pointer.
- @param HorizontalResolution Current video horizontal resolution in pixels
- @param VerticalResolution Current video vertical resolution in pixels
- @param ColorDepth Current video color depth in bits per pixel
- @param RefreshRate Current video refresh rate in Hz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
- @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- OUT UINT32 *HorizontalResolution,
- OUT UINT32 *VerticalResolution,
- OUT UINT32 *ColorDepth,
- OUT UINT32 *RefreshRate
- )
-;
-
-/**
- Return the current video mode information.
-
- @param This Protocol instance pointer.
- @param HorizontalResolution Current video horizontal resolution in pixels
- @param VerticalResolution Current video vertical resolution in pixels
- @param ColorDepth Current video color depth in bits per pixel
- @param RefreshRate Current video refresh rate in Hz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- IN UINT32 HorizontalResolution,
- IN UINT32 VerticalResolution,
- IN UINT32 ColorDepth,
- IN UINT32 RefreshRate
- )
-;
-
-typedef struct {
- UINT8 Blue;
- UINT8 Green;
- UINT8 Red;
- UINT8 Reserved;
-} EFI_UGA_PIXEL;
-
-typedef union {
- EFI_UGA_PIXEL Pixel;
- UINT32 Raw;
-} EFI_UGA_PIXEL_UNION;
-
-typedef enum {
- EfiUgaVideoFill,
- EfiUgaVideoToBltBuffer,
- EfiUgaBltBufferToVideo,
- EfiUgaVideoToVideo,
- EfiUgaBltMax
-} EFI_UGA_BLT_OPERATION;
-
-/**
- Type specifying a pointer to a function to perform an UGA Blt operation.
-
- The following table defines actions for BltOperations:
-
- <B>EfiUgaVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY)
- directly to every pixel of the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- Only one pixel will be used from the BltBuffer. Delta is NOT used.
-
- <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
- the BltBuffer rectangle (DestinationX, DestinationY )
- (DestinationX + Width, DestinationY + Height). If DestinationX or
- DestinationY is not zero then Delta must be set to the length in bytes
- of a row in the BltBuffer.
-
- <B>EfiUgaBltBufferToVideo</B> - Write data from the BltBuffer rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
- video display rectangle (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
- not zero then Delta must be set to the length in bytes of a row in the
- BltBuffer.
-
- <B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)
- (SourceX + Width, SourceY + Height) .to the video display rectangle
- (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- The BltBuffer and Delta are not used in this mode.
-
-
- @param[in] This - Protocol instance pointer.
- @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
- buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
- @param[in] BltOperation - Operation to perform on BlitBuffer and video memory
- @param[in] SourceX - X coordinate of source for the BltBuffer.
- @param[in] SourceY - Y coordinate of source for the BltBuffer.
- @param[in] DestinationX - X coordinate of destination for the BltBuffer.
- @param[in] DestinationY - Y coordinate of destination for the BltBuffer.
- @param[in] Width - Width of rectangle in BltBuffer in pixels.
- @param[in] Height - Height of rectangle in BltBuffer in pixels.
- @param[in] Delta - OPTIONAL
-
- @retval EFI_SUCCESS - The Blt operation completed.
- @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
- @retval EFI_DEVICE_ERROR - A hardware error occurred writing to the video buffer.
-
---*/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (
- IN EFI_UGA_DRAW_PROTOCOL * This,
- IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL
- IN EFI_UGA_BLT_OPERATION BltOperation,
- IN UINTN SourceX,
- IN UINTN SourceY,
- IN UINTN DestinationX,
- IN UINTN DestinationY,
- IN UINTN Width,
- IN UINTN Height,
- IN UINTN Delta OPTIONAL
- );
-
-struct _EFI_UGA_DRAW_PROTOCOL {
- EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;
- EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;
- EFI_UGA_DRAW_PROTOCOL_BLT Blt;
-};
-
-extern EFI_GUID gEfiUgaDrawProtocolGuid;
-
-#endif
diff --git a/BaseTools/set_vsprefix_envs.bat b/BaseTools/set_vsprefix_envs.bat
index df2c771..5565f61 100644
--- a/BaseTools/set_vsprefix_envs.bat
+++ b/BaseTools/set_vsprefix_envs.bat
@@ -242,7 +242,12 @@ if not defined WINDDK3790_PREFIX (
)
if not defined IASL_PREFIX (
- set IASL_PREFIX=C:\ASL\
+ if exist "C:\ASL\" (
+ set IASL_PREFIX=C:\ASL\
+ ) else (
+ @echo.
+ @echo !!! WARNING !!! IASL_PREFIX environment variable is not set
+ )
)
popd
diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat
index ac52f7a..92eb682 100755
--- a/BaseTools/toolsetup.bat
+++ b/BaseTools/toolsetup.bat
@@ -333,6 +333,17 @@ if defined VS2022 (
call %EDK_TOOLS_PATH%\set_vsprefix_envs.bat
call %EDK_TOOLS_PATH%\get_vsvars.bat
)
+if defined BASETOOLS_MINGW_BUILD (
+ if not defined IASL_PREFIX (
+ REM For VS builds this environment variable is set via set_vsprefix_envs.bat
+ if exist "C:\ASL\" (
+ set IASL_PREFIX=C:\ASL\
+ ) else (
+ @echo.
+ @echo !!! WARNING !!! IASL_PREFIX environment variable is not set
+ )
+ )
+)
if %SCRIPT_ERROR% NEQ 0 (
@echo.
@echo !!! ERROR !!! %VSTool% is not installed !!!
diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec
index bb0b677..d386bda 100644
--- a/EmbeddedPkg/EmbeddedPkg.dec
+++ b/EmbeddedPkg/EmbeddedPkg.dec
@@ -53,8 +53,6 @@
## FDT Configuration Table
# Include/Guid/Fdt.h
gFdtTableGuid = { 0xb1b621d5, 0xf19c, 0x41a5, { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } }
- # Include/Guid/FdtHob.h
- gFdtHobGuid = { 0x16958446, 0x19B7, 0x480B, { 0xB0, 0x47, 0x74, 0x85, 0xAD, 0x3F, 0x71, 0x6D } }
gFdtVariableGuid = { 0x25a4fd4a, 0x9703, 0x4ba9, { 0xa1, 0x90, 0xb7, 0xc8, 0x4e, 0xfb, 0x3e, 0x57 } }
## Include/Guid/PlatformHasDeviceTree.h
diff --git a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
index f4077c0..f280483 100644
--- a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
+++ b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
@@ -99,6 +99,28 @@ AllocateRuntimePages (
}
/**
+ Allocates one or more 4KB pages of type EfiReservedMemoryType.
+
+ Allocates the number of 4KB pages of type EfiReservedMemoryTypes and returns a pointer to the
+ allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
+ is returned. If there is not enough memory remaining to satisfy the request, then NULL is
+ returned.
+
+ @param Pages The number of 4 KB pages to allocate.
+
+ @return A pointer to the allocated buffer or NULL if allocation fails.
+
+**/
+VOID *
+EFIAPI
+AllocateReservedPages (
+ IN UINTN Pages
+ )
+{
+ return InternalAllocatePages (Pages, EfiReservedMemoryType);
+}
+
+/**
Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.
Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an
@@ -151,6 +173,58 @@ AllocateAlignedPages (
}
/**
+ Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment.
+
+ Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType with an
+ alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is
+ returned. If there is not enough memory at the specified alignment remaining to satisfy the
+ request, then NULL is returned.
+ If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+
+ @param Pages The number of 4 KB pages to allocate.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
+
+ @return A pointer to the allocated buffer or NULL if allocation fails.
+
+**/
+VOID *
+EFIAPI
+AllocateAlignedReservedPages (
+ IN UINTN Pages,
+ IN UINTN Alignment
+ )
+{
+ VOID *Memory;
+ UINTN AlignmentMask;
+
+ //
+ // Alignment must be a power of two or zero.
+ //
+ ASSERT ((Alignment & (Alignment - 1)) == 0);
+
+ if (Pages == 0) {
+ return NULL;
+ }
+
+ //
+ // Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.
+ //
+ ASSERT (Pages <= (MAX_ADDRESS - EFI_SIZE_TO_PAGES (Alignment)));
+ //
+ // We would rather waste some memory to save PEI code size.
+ //
+ Memory = (VOID *)(UINTN)AllocateReservedPages (Pages + EFI_SIZE_TO_PAGES (Alignment));
+ if (Alignment == 0) {
+ AlignmentMask = Alignment;
+ } else {
+ AlignmentMask = Alignment - 1;
+ }
+
+ return (VOID *)(UINTN)(((UINTN)Memory + AlignmentMask) & ~AlignmentMask);
+}
+
+/**
Frees one or more 4KB pages that were previously allocated with one of the page allocation
functions in the Memory Allocation Library.
diff --git a/EmulatorPkg/EmuGopDxe/Gop.h b/EmulatorPkg/EmuGopDxe/Gop.h
index 7f7dc4e..e7c5ecf 100644
--- a/EmulatorPkg/EmuGopDxe/Gop.h
+++ b/EmulatorPkg/EmuGopDxe/Gop.h
@@ -6,8 +6,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
-#ifndef __UGA_H_
-#define __UGA_H_
+#ifndef __GOP_H_
+#define __GOP_H_
#include <PiDxe.h>
@@ -60,8 +60,6 @@ typedef struct {
extern EFI_DRIVER_BINDING_PROTOCOL gEmuGopDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL gEmuGopComponentName;
-#define EMU_UGA_CLASS_NAME L"EmuGopWindow"
-
#define GOP_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('G', 'o', 'p', 'N')
typedef struct {
UINT64 Signature;
@@ -83,7 +81,7 @@ typedef struct {
GOP_MODE_DATA *ModeData;
//
- // UGA Private Data knowing when to start hardware
+ // Private Data knowing when to start hardware
//
BOOLEAN HardwareNeedsStarting;
diff --git a/EmulatorPkg/EmuGopDxe/GopScreen.c b/EmulatorPkg/EmuGopDxe/GopScreen.c
index 88d95b8..113b496 100644
--- a/EmulatorPkg/EmuGopDxe/GopScreen.c
+++ b/EmulatorPkg/EmuGopDxe/GopScreen.c
@@ -10,7 +10,7 @@ Module Name:
Abstract:
- This file produces the graphics abstration of UGA. It is called by
+ This file produces the graphics abstration of GOP. It is called by
EmuGopDriver.c file which deals with the EFI 1.1 driver model.
This file just does graphics.
@@ -209,7 +209,7 @@ EmuGopBlt (
// the number of bytes in each row can be computed.
//
if (Delta == 0) {
- Delta = Width * sizeof (EFI_UGA_PIXEL);
+ Delta = Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
}
//
@@ -220,8 +220,8 @@ EmuGopBlt (
OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);
//
- // Pack UGA Draw protocol parameters to EMU_GRAPHICS_WINDOWS__BLT_ARGS structure to adapt to
- // GopBlt() API of Unix UGA IO protocol.
+ // Pack GOP protocol parameters to EMU_GRAPHICS_WINDOWS__BLT_ARGS structure to adapt to
+ // GopBlt() API of GOP protocol.
//
GopBltArgs.DestinationX = DestinationX;
GopBltArgs.DestinationY = DestinationY;
@@ -232,8 +232,8 @@ EmuGopBlt (
GopBltArgs.Delta = Delta;
Status = Private->EmuGraphicsWindow->Blt (
Private->EmuGraphicsWindow,
- (EFI_UGA_PIXEL *)BltBuffer,
- (EFI_UGA_BLT_OPERATION)BltOperation,
+ BltBuffer,
+ BltOperation,
&GopBltArgs
);
@@ -384,7 +384,7 @@ ShutdownGopEvent (
Routine Description:
- This is the UGA screen's callback notification function for exit-boot-services.
+ This is the screen's callback notification function for exit-boot-services.
All we do here is call EmuGopDestructor().
Arguments:
diff --git a/EmulatorPkg/Include/Protocol/EmuFileSystem.h b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
index 15de43a..90c075e 100644
--- a/EmulatorPkg/Include/Protocol/EmuFileSystem.h
+++ b/EmulatorPkg/Include/Protocol/EmuFileSystem.h
@@ -13,13 +13,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
-#ifndef _EMU_UGA_IO_H_
-#define _EMU_UGA_IO_H_
+#ifndef _EMU_GRAPHICS_WINDOW_H_
+#define _EMU_GRAPHICS_WINDOW_H_
#include <Protocol/SimplePointer.h>
#include <Protocol/SimpleTextIn.h>
#include <Protocol/SimpleTextInEx.h>
-#include <Protocol/UgaDraw.h>
+#include <Protocol/GraphicsOutput.h>
#define EMU_GRAPHICS_WINDOW_PROTOCOL_GUID \
{ 0x30FD316A, 0x6728, 0x2E41, { 0xA6, 0x90, 0x0D, 0x13, 0x33, 0xD8, 0xCA, 0xC1 } }
@@ -29,13 +29,13 @@ typedef struct _EMU_GRAPHICS_WINDOW_PROTOCOL EMU_GRAPHICS_WINDOW_PROTOCOL;
typedef
EFI_STATUS
(EFIAPI *EMU_GRAPHICS_WINDOWS_CLOSE)(
- EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
+ EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows
);
typedef
EFI_STATUS
(EFIAPI *EMU_GRAPHICS_WINDOWS_SIZE)(
- EMU_GRAPHICS_WINDOW_PROTOCOL *Uga,
+ EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows,
UINT32 Width,
UINT32 Height
);
@@ -43,13 +43,13 @@ EFI_STATUS
typedef
EFI_STATUS
(EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_KEY)(
- EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
+ EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows
);
typedef
EFI_STATUS
(EFIAPI *EMU_GRAPHICS_WINDOWS_GET_KEY)(
- EMU_GRAPHICS_WINDOW_PROTOCOL *Uga,
+ EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows,
EFI_KEY_DATA *key
);
@@ -89,8 +89,8 @@ typedef
EFI_STATUS
(EFIAPI *EMU_GRAPHICS_WINDOWS_BLT)(
IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows,
- IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
- IN EFI_UGA_BLT_OPERATION BltOperation,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL,
+ IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
IN EMU_GRAPHICS_WINDOWS__BLT_ARGS *Args
);
diff --git a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
index 7c495b2..68b2098 100644
--- a/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
+++ b/EmulatorPkg/Include/Protocol/EmuGraphicsWindow.h
@@ -6,13 +6,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
-#ifndef _EMU_UGA_IO_H_
-#define _EMU_UGA_IO_H_
+#ifndef _EMU_GRAPHICS_WINDOW_H_
+#define _EMU_GRAPHICS_WINDOW_H_
#include <Protocol/SimplePointer.h>
#include <Protocol/SimpleTextIn.h>
#include <Protocol/SimpleTextInEx.h>
-#include <Protocol/UgaDraw.h>
+#include <Protocol/GraphicsOutput.h>
#define EMU_GRAPHICS_WINDOW_PROTOCOL_GUID \
{ 0x30FD316A, 0x6728, 0x2E41, { 0xA6, 0x90, 0x0D, 0x13, 0x33, 0xD8, 0xCA, 0xC1 } }
@@ -22,13 +22,13 @@ typedef struct _EMU_GRAPHICS_WINDOW_PROTOCOL EMU_GRAPHICS_WINDOW_PROTOCOL;
typedef
EFI_STATUS
(EFIAPI *EMU_GRAPHICS_WINDOWS_CLOSE)(
- EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
+ EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow
);
typedef
EFI_STATUS
(EFIAPI *EMU_GRAPHICS_WINDOWS_SIZE)(
- EMU_GRAPHICS_WINDOW_PROTOCOL *Uga,
+ EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow,
UINT32 Width,
UINT32 Height
);
@@ -36,13 +36,13 @@ EFI_STATUS
typedef
EFI_STATUS
(EFIAPI *EMU_GRAPHICS_WINDOWS_CHECK_KEY)(
- EMU_GRAPHICS_WINDOW_PROTOCOL *Uga
+ EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow
);
typedef
EFI_STATUS
(EFIAPI *EMU_GRAPHICS_WINDOWS_GET_KEY)(
- EMU_GRAPHICS_WINDOW_PROTOCOL *Uga,
+ EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindow,
EFI_KEY_DATA *key
);
@@ -83,8 +83,8 @@ typedef
EFI_STATUS
(EFIAPI *EMU_GRAPHICS_WINDOWS_BLT)(
IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows,
- IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
- IN EFI_UGA_BLT_OPERATION BltOperation,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL,
+ IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
IN EMU_GRAPHICS_WINDOWS__BLT_ARGS *Args
);
diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
index b89ffd7..01fc45f 100644
--- a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
+++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.h
@@ -60,7 +60,7 @@ typedef struct {
EMU_VENDOR_DEVICE_PATH_NODE EmuBus;
EMU_VENDOR_DEVICE_PATH_NODE EmuGraphicsWindow;
EFI_DEVICE_PATH_PROTOCOL End;
-} EMU_PLATFORM_UGA_DEVICE_PATH;
+} EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH;
//
// Platform BDS Functions
diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
index efb03de..ee6966b 100644
--- a/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
+++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBmData.c
@@ -8,7 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include "PlatformBm.h"
-EMU_PLATFORM_UGA_DEVICE_PATH gGopDevicePath = {
+EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH gGopDevicePath = {
{
{
{
@@ -40,7 +40,7 @@ EMU_PLATFORM_UGA_DEVICE_PATH gGopDevicePath = {
gEndEntire
};
-EMU_PLATFORM_UGA_DEVICE_PATH gGopDevicePath2 = {
+EMU_PLATFORM_GRAPHICS_WINDOW_DEVICE_PATH gGopDevicePath2 = {
{
{
{
diff --git a/EmulatorPkg/Unix/Host/Gasket.h b/EmulatorPkg/Unix/Host/Gasket.h
index 71b459d..65b2c72 100644
--- a/EmulatorPkg/Unix/Host/Gasket.h
+++ b/EmulatorPkg/Unix/Host/Gasket.h
@@ -200,7 +200,7 @@ ReverseGasketUint64Uint64 (
);
//
-// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
+// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
//
EFI_STATUS
@@ -243,10 +243,10 @@ GasketX11RegisterKeyNotify (
EFI_STATUS
EFIAPI
GasketX11Blt (
- IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows,
- IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
- IN EFI_UGA_BLT_OPERATION BltOperation,
- IN EMU_GRAPHICS_WINDOWS__BLT_ARGS *Args
+ IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL,
+ IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
+ IN EMU_GRAPHICS_WINDOWS__BLT_ARGS *Args
);
EFI_STATUS
diff --git a/EmulatorPkg/Unix/Host/Host.h b/EmulatorPkg/Unix/Host/Host.h
index 0c81cdf..b62496b 100644
--- a/EmulatorPkg/Unix/Host/Host.h
+++ b/EmulatorPkg/Unix/Host/Host.h
@@ -106,7 +106,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Protocol/SimplePointer.h>
#include <Protocol/SimpleTextIn.h>
#include <Protocol/SimpleTextInEx.h>
-#include <Protocol/UgaDraw.h>
#include <Protocol/SimpleFileSystem.h>
#include <Protocol/EmuThunk.h>
diff --git a/EmulatorPkg/Unix/Host/Ia32/Gasket.S b/EmulatorPkg/Unix/Host/Ia32/Gasket.S
index 36197ff..6fcdd26 100644
--- a/EmulatorPkg/Unix/Host/Ia32/Gasket.S
+++ b/EmulatorPkg/Unix/Host/Ia32/Gasket.S
@@ -371,7 +371,7 @@ ASM_PFX(GasketSecEmuThunkAddress):
ret
//
-// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
+// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
//
ASM_GLOBAL ASM_PFX(GasketX11Size)
diff --git a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
index a30cc19..94ddf50 100644
--- a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
+++ b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
@@ -700,8 +700,8 @@ HandleEvents (
unsigned long
X11PixelToColor (
- IN GRAPHICS_IO_PRIVATE *Drv,
- IN EFI_UGA_PIXEL pixel
+ IN GRAPHICS_IO_PRIVATE *Drv,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL pixel
)
{
return ((pixel.Red >> Drv->r.csize) << Drv->r.shift)
@@ -709,15 +709,15 @@ X11PixelToColor (
| ((pixel.Blue >> Drv->b.csize) << Drv->b.shift);
}
-EFI_UGA_PIXEL
+EFI_GRAPHICS_OUTPUT_BLT_PIXEL
X11ColorToPixel (
IN GRAPHICS_IO_PRIVATE *Drv,
IN unsigned long val
)
{
- EFI_UGA_PIXEL Pixel;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;
- memset (&Pixel, 0, sizeof (EFI_UGA_PIXEL));
+ memset (&Pixel, 0, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
// Truncation not an issue since X11 and EFI are both using 8 bits per color
Pixel.Red = (val >> Drv->r.shift) << Drv->r.csize;
@@ -782,7 +782,7 @@ X11KeySetState (
if ((Drv->KeyState.KeyToggleState & EFI_CAPS_LOCK_ACTIVE) == 0) {
//
// We could create an XKeyEvent and send a XK_Caps_Lock to
- // the UGA/GOP Window
+ // the GOP Window
//
}
}
@@ -812,32 +812,32 @@ X11RegisterKeyNotify (
EFI_STATUS
X11Blt (
- IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsIo,
- IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
- IN EFI_UGA_BLT_OPERATION BltOperation,
- IN EMU_GRAPHICS_WINDOWS__BLT_ARGS *Args
+ IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsIo,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL,
+ IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
+ IN EMU_GRAPHICS_WINDOWS__BLT_ARGS *Args
)
{
- GRAPHICS_IO_PRIVATE *Private;
- UINTN DstY;
- UINTN SrcY;
- UINTN DstX;
- UINTN SrcX;
- UINTN Index;
- EFI_UGA_PIXEL *Blt;
- UINT8 *Dst;
- UINT8 *Src;
- UINTN Nbr;
- unsigned long Color;
- XEvent ev;
+ GRAPHICS_IO_PRIVATE *Private;
+ UINTN DstY;
+ UINTN SrcY;
+ UINTN DstX;
+ UINTN SrcX;
+ UINTN Index;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;
+ UINT8 *Dst;
+ UINT8 *Src;
+ UINTN Nbr;
+ unsigned long Color;
+ XEvent ev;
Private = (GRAPHICS_IO_PRIVATE *)GraphicsIo;
//
// Check bounds
//
- if ( (BltOperation == EfiUgaVideoToBltBuffer)
- || (BltOperation == EfiUgaVideoToVideo))
+ if ( (BltOperation == EfiBltVideoToBltBuffer)
+ || (BltOperation == EfiBltVideoToVideo))
{
//
// Source is Video.
@@ -851,9 +851,9 @@ X11Blt (
}
}
- if ( (BltOperation == EfiUgaBltBufferToVideo)
- || (BltOperation == EfiUgaVideoToVideo)
- || (BltOperation == EfiUgaVideoFill))
+ if ( (BltOperation == EfiBltBufferToVideo)
+ || (BltOperation == EfiBltVideoToVideo)
+ || (BltOperation == EfiBltVideoFill))
{
//
// Destination is Video
@@ -868,32 +868,32 @@ X11Blt (
}
switch (BltOperation) {
- case EfiUgaVideoToBltBuffer:
- Blt = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->DestinationY * Args->Delta) + Args->DestinationX * sizeof (EFI_UGA_PIXEL));
- Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
+ case EfiBltVideoToBltBuffer:
+ Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)BltBuffer + (Args->DestinationY * Args->Delta) + Args->DestinationX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
+ Args->Delta -= Args->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
for (SrcY = Args->SourceY; SrcY < (Args->Height + Args->SourceY); SrcY++) {
for (SrcX = Args->SourceX; SrcX < (Args->Width + Args->SourceX); SrcX++) {
*Blt++ = X11ColorToPixel (Private, XGetPixel (Private->image, SrcX, SrcY));
}
- Blt = (EFI_UGA_PIXEL *)((UINT8 *)Blt + Args->Delta);
+ Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)Blt + Args->Delta);
}
break;
- case EfiUgaBltBufferToVideo:
- Blt = (EFI_UGA_PIXEL *)((UINT8 *)BltBuffer + (Args->SourceY * Args->Delta) + Args->SourceX * sizeof (EFI_UGA_PIXEL));
- Args->Delta -= Args->Width * sizeof (EFI_UGA_PIXEL);
+ case EfiBltBufferToVideo:
+ Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)BltBuffer + (Args->SourceY * Args->Delta) + Args->SourceX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
+ Args->Delta -= Args->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
for (DstY = Args->DestinationY; DstY < (Args->Height + Args->DestinationY); DstY++) {
for (DstX = Args->DestinationX; DstX < (Args->Width + Args->DestinationX); DstX++) {
XPutPixel (Private->image, DstX, DstY, X11PixelToColor (Private, *Blt));
Blt++;
}
- Blt = (EFI_UGA_PIXEL *)((UINT8 *)Blt + Args->Delta);
+ Blt = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)((UINT8 *)Blt + Args->Delta);
}
break;
- case EfiUgaVideoToVideo:
+ case EfiBltVideoToVideo:
Dst = Private->image_data + (Args->DestinationX << Private->pixel_shift)
+ Args->DestinationY * Private->line_bytes;
Src = Private->image_data + (Args->SourceX << Private->pixel_shift)
@@ -920,7 +920,7 @@ X11Blt (
}
break;
- case EfiUgaVideoFill:
+ case EfiBltVideoFill:
Color = X11PixelToColor (Private, *BltBuffer);
for (DstY = Args->DestinationY; DstY < (Args->Height + Args->DestinationY); DstY++) {
for (DstX = Args->DestinationX; DstX < (Args->Width + Args->DestinationX); DstX++) {
@@ -937,7 +937,7 @@ X11Blt (
// Refresh screen.
//
switch (BltOperation) {
- case EfiUgaVideoToVideo:
+ case EfiBltVideoToVideo:
XCopyArea (
Private->display,
Private->win,
@@ -960,7 +960,7 @@ X11Blt (
}
break;
- case EfiUgaVideoFill:
+ case EfiBltVideoFill:
Color = X11PixelToColor (Private, *BltBuffer);
XSetForeground (Private->display, Private->gc, Color);
XFillRectangle (
@@ -974,7 +974,7 @@ X11Blt (
);
XFlush (Private->display);
break;
- case EfiUgaBltBufferToVideo:
+ case EfiBltBufferToVideo:
Redraw (Private, Args->DestinationX, Args->DestinationY, Args->Width, Args->Height);
break;
default:
@@ -1060,7 +1060,7 @@ X11GraphicsWindowOpen (
Drv->display = XOpenDisplay (display_name);
if (Drv->display == NULL) {
- fprintf (stderr, "uga: cannot connect to X server %s\n", XDisplayName (display_name));
+ fprintf (stderr, "GOP: cannot connect to X server %s\n", XDisplayName (display_name));
free (Drv);
return EFI_DEVICE_ERROR;
}
diff --git a/EmulatorPkg/Unix/Host/X64/Gasket.S b/EmulatorPkg/Unix/Host/X64/Gasket.S
index 030faa8..1b4614a 100644
--- a/EmulatorPkg/Unix/Host/X64/Gasket.S
+++ b/EmulatorPkg/Unix/Host/X64/Gasket.S
@@ -427,7 +427,7 @@ ASM_PFX(GasketSecEmuThunkAddress):
ret
//
-// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
+// Gasket functions for EFI_EMU_GRAPHICS_WINDOW_PROTOCOL
//
ASM_GLOBAL ASM_PFX(GasketX11Size)
diff --git a/EmulatorPkg/Win/Host/WinGopScreen.c b/EmulatorPkg/Win/Host/WinGopScreen.c
index cf27c34..5a33d7e 100644
--- a/EmulatorPkg/Win/Host/WinGopScreen.c
+++ b/EmulatorPkg/Win/Host/WinGopScreen.c
@@ -396,10 +396,10 @@ WinNtWndSize (
// TODO: Delta - add argument and description to function comment
EFI_STATUS
WinNtWndBlt (
- IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsIo,
- IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
- IN EFI_UGA_BLT_OPERATION BltOperation,
- IN EMU_GRAPHICS_WINDOWS__BLT_ARGS *Args
+ IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsIo,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL,
+ IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
+ IN EMU_GRAPHICS_WINDOWS__BLT_ARGS *Args
)
{
RETURN_STATUS RStatus;
@@ -423,7 +423,7 @@ WinNtWndBlt (
return (EFI_STATUS)RStatus;
}
- if (BltOperation != EfiUgaVideoToBltBuffer) {
+ if (BltOperation != EfiBltVideoToBltBuffer) {
//
// Mark the area we just blted as Invalid so WM_PAINT will update.
//
diff --git a/Maintainers.txt b/Maintainers.txt
index ee0142f..85d53ff 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -209,7 +209,6 @@ W: https://github.com/tianocore/tianocore.github.io/wiki/EmulatorPkg
M: Oliver Smith-Denny <osde@microsoft.com> [os-d]
M: Andrew Fish <afish@apple.com> [ajfish]
M: Michael Kubacki <mikuback@linux.microsoft.com> [makubacki]
-M: Ray Ni <ray.ni@intel.com> [niruiyu]
S: Maintained
EmulatorPkg: Redfish-related modules
@@ -314,7 +313,7 @@ F: MdeModulePkg/Include/Ppi/StorageSecurityCommand.h
F: MdeModulePkg/Include/Protocol/Ps2Policy.h
F: MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/
F: MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/
-R: Ray Ni <ray.ni@intel.com> [niruiyu]
+R: Jacek Kolakowski <jacek.kolakowski@intel.com> [jkolakow]
MdeModulePkg: Disk modules
F: MdeModulePkg/Universal/Disk/
@@ -673,7 +672,6 @@ M: Guo Dong <guo.dong@intel.com> [gdong1]
M: Sean Rhodes <sean@starlabs.systems> [Sean-StarLabs]
M: James Lu <james.lu@intel.com> [jameslu8]
M: Benjamin Doron <benjamin.doron@9elements.com> [benjamindoron]
-M: Linus Liu <linus.liu@intel.com> [LinusvPelt]
R: Gua Guo <gua.guo@intel.com> [gguo11837463]
M: Chasel Chiu <chasel.chiu@intel.com> [ChaselChiu]
R: Shuo Liu <shuo.liu@intel.com> [shuoliu0]
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
index 337b209..a21c94c 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
@@ -49,7 +49,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_PCI_HOTPLUG_REQUEST_PROTOCOL mPciHotPlugReque
Installs driver module protocols and. Creates virtual device handles for ConIn,
ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex protocol,
Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers.
- Installs Graphics Output protocol and/or UGA Draw protocol if needed.
+ Installs Graphics Output protocol if needed.
@param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
index b3a4063..713415d 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
@@ -900,12 +900,17 @@ UsbEnumeratePort (
Child = NULL;
HubApi = HubIf->HubApi;
+ // Zero out PortState in case GetPortStatus does not set
+ // it and we continue on the EFI_DEVICE_ERROR path
+ PortState.PortStatus = 0;
+ PortState.PortChangeStatus = 0;
+
//
// Host learns of the new device by polling the hub for port changes.
//
Status = HubApi->GetPortStatus (HubIf, Port, &PortState);
- if (EFI_ERROR (Status)) {
+ if (EFI_ERROR (Status) && (Status != EFI_DEVICE_ERROR)) {
DEBUG ((DEBUG_ERROR, "UsbEnumeratePort: failed to get state of port %d\n", Port));
return Status;
}
@@ -987,7 +992,9 @@ UsbEnumeratePort (
// Now, new device connected, enumerate and configure the device
//
DEBUG ((DEBUG_INFO, "UsbEnumeratePort: new device connected at port %d\n", Port));
- if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET)) {
+ if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET) &&
+ (Status != EFI_DEVICE_ERROR))
+ {
Status = UsbEnumerateNewDev (HubIf, Port, FALSE);
} else {
Status = UsbEnumerateNewDev (HubIf, Port, TRUE);
diff --git a/MdeModulePkg/Core/Dxe/DxeMain.h b/MdeModulePkg/Core/Dxe/DxeMain.h
index cd3940d..6f08554 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain.h
+++ b/MdeModulePkg/Core/Dxe/DxeMain.h
@@ -45,6 +45,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Protocol/HiiPackageList.h>
#include <Protocol/SmmBase2.h>
#include <Protocol/PeCoffImageEmulator.h>
+#include <Protocol/MemoryAttribute.h>
#include <Guid/MemoryTypeInformation.h>
#include <Guid/FirmwareFileSystem2.h>
#include <Guid/FirmwareFileSystem3.h>
@@ -250,6 +251,7 @@ extern EFI_SECURITY_ARCH_PROTOCOL *gSecurity;
extern EFI_SECURITY2_ARCH_PROTOCOL *gSecurity2;
extern EFI_BDS_ARCH_PROTOCOL *gBds;
extern EFI_SMM_BASE2_PROTOCOL *gSmmBase2;
+extern EFI_MEMORY_ATTRIBUTE_PROTOCOL *gMemoryAttributeProtocol;
extern EFI_TPL gEfiCurrentTpl;
diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf b/MdeModulePkg/Core/Dxe/DxeMain.inf
index cc315ac..40e7dc8 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain.inf
+++ b/MdeModulePkg/Core/Dxe/DxeMain.inf
@@ -156,6 +156,7 @@
gEfiHiiPackageListProtocolGuid ## SOMETIMES_PRODUCES
gEfiSmmBase2ProtocolGuid ## SOMETIMES_CONSUMES
gEdkiiPeCoffImageEmulatorProtocolGuid ## SOMETIMES_CONSUMES
+ gEfiMemoryAttributeProtocolGuid ## CONSUMES
# Arch Protocols
gEfiBdsArchProtocolGuid ## CONSUMES
diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c
index 9df64cc..27c2788 100644
--- a/MdeModulePkg/Core/Dxe/Mem/Page.c
+++ b/MdeModulePkg/Core/Dxe/Mem/Page.c
@@ -1746,6 +1746,38 @@ CoreFreePages (
{
EFI_STATUS Status;
EFI_MEMORY_TYPE MemoryType;
+ UINT64 Attributes;
+
+ // check if this memory is returned to the core as RW at a minimum. If the memory attribute protocol is not installed,
+ // then we assume that the memory is RW by default and continue to free it.
+ if (gMemoryAttributeProtocol != NULL) {
+ Status = gMemoryAttributeProtocol->GetMemoryAttributes (
+ gMemoryAttributeProtocol,
+ Memory,
+ EFI_PAGES_TO_SIZE (NumberOfPages),
+ &Attributes
+ );
+
+ // if we failed to get the attributes, or if the memory is read-only or read-protected,
+ // then we leak the memory and return success. This is done because the UEFI spec does not specify whether pages
+ // should be freed with any specific permission attributes. As such, there exist bootloaders in the wild that will
+ // free memory that is marked RO, which can crash the core if DebugClearMemory is enabled or can be passed out to a
+ // driver in the next AllocatePages() call, which can cause a crash later on. It is deemed lower risk to leak the
+ // memory than to attempt to fix up the attributes as that requires syncing the GCD and the page table.
+ if (EFI_ERROR (Status) || (Attributes & EFI_MEMORY_RO) || (Attributes & EFI_MEMORY_RP)) {
+ DEBUG ((
+ DEBUG_WARN,
+ "%a: Memory %llx for %llx Pages failed to get attributes with status %r or it is read-only or read-protected. "
+ "Attributes: %llx. Leaking memory!\n",
+ __func__,
+ Memory,
+ NumberOfPages,
+ Status,
+ Attributes
+ ));
+ return EFI_SUCCESS;
+ }
+ }
Status = CoreInternalFreePages (Memory, NumberOfPages, &MemoryType);
if (!EFI_ERROR (Status)) {
diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
index 33357eb..69d26cb 100644
--- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
+++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c
@@ -38,6 +38,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Guid/MemoryAttributesTable.h>
#include <Protocol/FirmwareVolume2.h>
+#include <Protocol/MemoryAttribute.h>
#include <Protocol/SimpleFileSystem.h>
#include "DxeMain.h"
@@ -67,6 +68,8 @@ extern LIST_ENTRY mGcdMemorySpaceMap;
STATIC LIST_ENTRY mProtectedImageRecordList;
+EFI_MEMORY_ATTRIBUTE_PROTOCOL *gMemoryAttributeProtocol;
+
/**
Get the image type.
@@ -1034,6 +1037,37 @@ DisableNullDetectionAtTheEndOfDxe (
}
/**
+ A notification for the Memory Attribute Protocol Installation.
+
+ @param[in] Event Event whose notification function is being invoked.
+ @param[in] Context Pointer to the notification function's context,
+ which is implementation-dependent.
+
+**/
+VOID
+EFIAPI
+MemoryAttributeProtocolNotify (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ EFI_STATUS Status;
+
+ Status = gBS->LocateProtocol (&gEfiMemoryAttributeProtocolGuid, NULL, (VOID **)&gMemoryAttributeProtocol);
+
+ if (EFI_ERROR (Status)) {
+ DEBUG ((
+ DEBUG_INFO,
+ "%a - Unable to locate the memory attribute protocol! Status = %r\n",
+ __func__,
+ Status
+ ));
+ }
+
+ CoreCloseEvent (Event);
+}
+
+/**
Initialize Memory Protection support.
**/
VOID
@@ -1084,6 +1118,35 @@ CoreInitializeMemoryProtection (
);
ASSERT_EFI_ERROR (Status);
+ // Register an event to populate the memory attribute protocol
+ Status = CoreCreateEvent (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ MemoryAttributeProtocolNotify,
+ NULL,
+ &Event
+ );
+
+ // if we fail to create the event or the protocol notify, we should still continue, we won't be able to query the
+ // memory attributes on FreePages(), so we may encounter a driver or bootloader that has not set attributes back to
+ // RW, but this matches the state of the world before this protocol was introduced, so it is not a regression.
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "%a - Failed to create event for the Memory Attribute Protocol notification: %r\n", __func__, Status));
+ ASSERT_EFI_ERROR (Status);
+ }
+
+ // Register for protocol notification
+ Status = CoreRegisterProtocolNotify (
+ &gEfiMemoryAttributeProtocolGuid,
+ Event,
+ &Registration
+ );
+
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "%a - Failed to register for the Memory Attribute Protocol notification: %r\n", __func__, Status));
+ ASSERT_EFI_ERROR (Status);
+ }
+
//
// Register a callback to disable NULL pointer detection at EndOfDxe
//
diff --git a/MdeModulePkg/Include/Library/BootLogoLib.h b/MdeModulePkg/Include/Library/BootLogoLib.h
index 2d6209a..a2fd667 100644
--- a/MdeModulePkg/Include/Library/BootLogoLib.h
+++ b/MdeModulePkg/Include/Library/BootLogoLib.h
@@ -26,7 +26,7 @@ BootLogoEnableLogo (
Use SystemTable ConOut to turn on video based Simple Text Out consoles. The
Simple Text Out screens will now be synced up with all non-video output devices.
- @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
+ @retval EFI_SUCCESS Devices are back in text mode and synced up.
**/
EFI_STATUS
diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
index 478ec2d..5beb0e0 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
@@ -12,7 +12,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Protocol/GraphicsOutput.h>
#include <Protocol/SimpleTextOut.h>
#include <Protocol/PlatformLogo.h>
-#include <Protocol/UgaDraw.h>
#include <Protocol/BootLogo.h>
#include <Protocol/BootLogo2.h>
#include <Library/BaseLib.h>
@@ -47,9 +46,6 @@ BootLogoEnableLogo (
UINT32 Instance;
EFI_IMAGE_INPUT Image;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
EFI_BOOT_LOGO_PROTOCOL *BootLogo;
EDKII_BOOT_LOGO2_PROTOCOL *BootLogo2;
@@ -68,22 +64,10 @@ BootLogoEnableLogo (
return EFI_UNSUPPORTED;
}
- UgaDraw = NULL;
//
// Try to open GOP first
//
Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput);
- if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
- GraphicsOutput = NULL;
- //
- // Open GOP failed, try to open UGA
- //
- Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID **)&UgaDraw);
- if (EFI_ERROR (Status)) {
- UgaDraw = NULL;
- }
- }
-
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
@@ -109,16 +93,8 @@ BootLogoEnableLogo (
//
gST->ConOut->EnableCursor (gST->ConOut, FALSE);
- if (GraphicsOutput != NULL) {
- SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
- SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
- } else {
- ASSERT (UgaDraw != NULL);
- Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
- }
+ SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
+ SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
Blt = NULL;
NumberOfLogos = 0;
@@ -206,34 +182,18 @@ BootLogoEnableLogo (
DestY += OffsetY;
if ((DestX >= 0) && (DestY >= 0)) {
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->Blt (
- GraphicsOutput,
- Blt,
- EfiBltBufferToVideo,
- 0,
- 0,
- (UINTN)DestX,
- (UINTN)DestY,
- Image.Width,
- Image.Height,
- Image.Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- } else {
- ASSERT (UgaDraw != NULL);
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)Blt,
- EfiUgaBltBufferToVideo,
- 0,
- 0,
- (UINTN)DestX,
- (UINTN)DestY,
- Image.Width,
- Image.Height,
- Image.Width * sizeof (EFI_UGA_PIXEL)
- );
- }
+ Status = GraphicsOutput->Blt (
+ GraphicsOutput,
+ Blt,
+ EfiBltBufferToVideo,
+ 0,
+ 0,
+ (UINTN)DestX,
+ (UINTN)DestY,
+ Image.Width,
+ Image.Height,
+ Image.Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+ );
//
// Report displayed Logo information.
@@ -307,33 +267,18 @@ BootLogoEnableLogo (
return EFI_OUT_OF_RESOURCES;
}
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->Blt (
- GraphicsOutput,
- LogoBlt,
- EfiBltVideoToBltBuffer,
- LogoDestX,
- LogoDestY,
- 0,
- 0,
- LogoWidth,
- LogoHeight,
- LogoWidth * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- } else {
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)LogoBlt,
- EfiUgaVideoToBltBuffer,
- LogoDestX,
- LogoDestY,
- 0,
- 0,
- LogoWidth,
- LogoHeight,
- LogoWidth * sizeof (EFI_UGA_PIXEL)
- );
- }
+ Status = GraphicsOutput->Blt (
+ GraphicsOutput,
+ LogoBlt,
+ EfiBltVideoToBltBuffer,
+ LogoDestX,
+ LogoDestY,
+ 0,
+ 0,
+ LogoWidth,
+ LogoHeight,
+ LogoWidth * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+ );
}
if (!EFI_ERROR (Status)) {
@@ -368,7 +313,7 @@ BootLogoEnableLogo (
Use SystemTable Conout to turn on video based Simple Text Out consoles. The
Simple Text Out screens will now be synced up with all non video output devices
- @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
+ @retval EFI_SUCCESS GOP devices are back in text mode and synced up.
**/
EFI_STATUS
@@ -411,11 +356,8 @@ BootLogoUpdateProgress (
{
EFI_STATUS Status;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
UINT32 SizeOfX;
UINT32 SizeOfY;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color;
UINTN BlockHeight;
UINTN BlockWidth;
@@ -428,40 +370,13 @@ BootLogoUpdateProgress (
return EFI_INVALID_PARAMETER;
}
- UgaDraw = NULL;
- Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput);
- if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
- GraphicsOutput = NULL;
-
- Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID **)&UgaDraw);
- if (EFI_ERROR (Status)) {
- UgaDraw = NULL;
- }
- }
-
+ Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
- SizeOfX = 0;
- SizeOfY = 0;
- if (GraphicsOutput != NULL) {
- SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
- SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
- } else if (UgaDraw != NULL) {
- Status = UgaDraw->GetMode (
- UgaDraw,
- &SizeOfX,
- &SizeOfY,
- &ColorDepth,
- &RefreshRate
- );
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
- } else {
- return EFI_UNSUPPORTED;
- }
+ SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
+ SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
BlockWidth = SizeOfX / 100;
BlockHeight = SizeOfY / 50;
@@ -477,71 +392,37 @@ BootLogoUpdateProgress (
//
SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->Blt (
- GraphicsOutput,
- &Color,
- EfiBltVideoFill,
- 0,
- 0,
- 0,
- PosY - EFI_GLYPH_HEIGHT - 1,
- SizeOfX,
- SizeOfY - (PosY - EFI_GLYPH_HEIGHT - 1),
- SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)&Color,
- EfiUgaVideoFill,
- 0,
- 0,
- 0,
- PosY - EFI_GLYPH_HEIGHT - 1,
- SizeOfX,
- SizeOfY - (PosY - EFI_GLYPH_HEIGHT - 1),
- SizeOfX * sizeof (EFI_UGA_PIXEL)
- );
- } else {
- return EFI_UNSUPPORTED;
- }
+ Status = GraphicsOutput->Blt (
+ GraphicsOutput,
+ &Color,
+ EfiBltVideoFill,
+ 0,
+ 0,
+ 0,
+ PosY - EFI_GLYPH_HEIGHT - 1,
+ SizeOfX,
+ SizeOfY - (PosY - EFI_GLYPH_HEIGHT - 1),
+ SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+ );
}
//
// Show progress by drawing blocks
//
for (Index = PreviousValue; Index < BlockNum; Index++) {
- PosX = Index * BlockWidth;
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->Blt (
- GraphicsOutput,
- &ProgressColor,
- EfiBltVideoFill,
- 0,
- 0,
- PosX,
- PosY,
- BlockWidth - 1,
- BlockHeight,
- (BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)&ProgressColor,
- EfiUgaVideoFill,
- 0,
- 0,
- PosX,
- PosY,
- BlockWidth - 1,
- BlockHeight,
- (BlockWidth) * sizeof (EFI_UGA_PIXEL)
- );
- } else {
- return EFI_UNSUPPORTED;
- }
+ PosX = Index * BlockWidth;
+ Status = GraphicsOutput->Blt (
+ GraphicsOutput,
+ &ProgressColor,
+ EfiBltVideoFill,
+ 0,
+ 0,
+ PosX,
+ PosY,
+ BlockWidth - 1,
+ BlockHeight,
+ (BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
+ );
}
PrintXY (
diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
index 7d50f2d..03fd704 100644
--- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
+++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
@@ -42,11 +42,7 @@
[Protocols]
gEfiGraphicsOutputProtocolGuid ## SOMETIMES_CONSUMES
- gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport ## SOMETIMES_CONSUMES
gEfiBootLogoProtocolGuid ## SOMETIMES_CONSUMES
gEdkiiBootLogo2ProtocolGuid ## SOMETIMES_CONSUMES
gEfiUserManagerProtocolGuid ## CONSUMES
gEdkiiPlatformLogoProtocolGuid ## CONSUMES
-
-[FeaturePcd]
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 3698caf..6ccca34 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -824,13 +824,6 @@
# @Prompt Enable ConOut GOP support.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE|BOOLEAN|0x00010042
- ## Indicates if UGA Draw Protocol will be installed on virtual handle created by ConsplitterDxe.
- # It could be set FALSE to save size.<BR><BR>
- # TRUE - Installs UGA Draw Protocol on virtual handle created by ConsplitterDxe.<BR>
- # FALSE - Does not install UGA Draw Protocol on virtual handle created by ConsplitterDxe.<BR>
- # @Prompt Enable ConOut UGA support.
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|TRUE|BOOLEAN|0x00010043
-
## Indicates PeiCore will first search TE section from the PEIM to load the image, or PE32 section, when PeiCore dispatches a PEI module.
# This PCD is used to tune PEI phase performance to reduce the search image time.
# It can be set according to the generated image section type.<BR><BR>
@@ -1515,8 +1508,7 @@
# OEM Reserved 0x4000000000000000<BR>
# OS Reserved 0x8000000000000000<BR>
#
- # NOTE: User must NOT set NX protection for EfiLoaderCode / EfiBootServicesCode / EfiRuntimeServicesCode. <BR>
- # User MUST set the same NX protection for EfiBootServicesData and EfiConventionalMemory. <BR>
+ # NOTE: User MUST set the same NX protection for EfiBootServicesData and EfiConventionalMemory. <BR>
#
# e.g. 0x7FD5 can be used for all memory except Code. <BR>
# e.g. 0x7BD4 can be used for all memory except Code and ACPINVS/Reserved. <BR>
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index 6079285..7aa8322 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
@@ -709,12 +709,6 @@
"TRUE - Installs Graphics Output Protocol on virtual handle created by ConsplitterDxe.<BR>\n"
"FALSE - Does not install Graphics Output Protocol on virtual handle created by ConsplitterDxe.<BR>"
-#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdConOutUgaSupport_PROMPT #language en-US "Enable ConOut UGA support"
-
-#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdConOutUgaSupport_HELP #language en-US "Indicates if UGA Draw Protocol will be installed on virtual handle created by ConsplitterDxe. It could be set FALSE to save size.<BR><BR>\n"
- "TRUE - Installs UGA Draw Protocol on virtual handle created by ConsplitterDxe.<BR>\n"
- "FALSE - Does not install UGA Draw Protocol on virtual handle created by ConsplitterDxe.<BR>"
-
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPeiCoreImageLoaderSearchTeSectionFirst_PROMPT #language en-US "PeiCore search TE section first"
#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdPeiCoreImageLoaderSearchTeSectionFirst_HELP #language en-US "Indicates PeiCore will first search TE section from the PEIM to load the image, or PE32 section, when PeiCore dispatches a PEI module. This PCD is used to tune PEI phase performance to reduce the search image time. It can be set according to the generated image section type.<BR><BR>\n"
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
index 0a776f3..2dbb7ea 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
@@ -108,15 +108,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_IN_SPLITTER_PRIVATE_DATA mConIn = {
};
//
-// Uga Draw Protocol Private Data template
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UGA_DRAW_PROTOCOL mUgaDrawProtocolTemplate = {
- ConSplitterUgaDrawGetMode,
- ConSplitterUgaDrawSetMode,
- ConSplitterUgaDrawBlt
-};
-
-//
// Graphics Output Protocol Private Data template
//
GLOBAL_REMOVE_IF_UNREFERENCED EFI_GRAPHICS_OUTPUT_PROTOCOL mGraphicsOutputProtocolTemplate = {
@@ -156,22 +147,11 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE_DATA mConOut = {
{
NULL,
NULL,
- NULL
- },
- 0,
- 0,
- 0,
- 0,
-
- {
- NULL,
- NULL,
NULL,
NULL
},
(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *)NULL,
0,
- 0,
0,
(TEXT_OUT_AND_GOP_DATA *)NULL,
@@ -212,22 +192,11 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE_DATA mStdErr = {
{
NULL,
NULL,
- NULL
- },
- 0,
- 0,
- 0,
- 0,
-
- {
- NULL,
- NULL,
NULL,
NULL
},
(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *)NULL,
0,
- 0,
0,
(TEXT_OUT_AND_GOP_DATA *)NULL,
@@ -422,7 +391,7 @@ ToggleStateSyncReInitialization (
Installs driver module protocols and. Creates virtual device handles for ConIn,
ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex protocol,
Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers.
- Installs Graphics Output protocol and/or UGA Draw protocol if needed.
+ Installs Graphics Output protocol.
@param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.
@@ -494,12 +463,9 @@ ConSplitterDriverEntry (
ASSERT_EFI_ERROR (Status);
//
- // Either Graphics Output protocol or UGA Draw protocol must be supported.
+ // Graphics Output protocol must be supported.
//
- ASSERT (
- FeaturePcdGet (PcdConOutGopSupport) ||
- FeaturePcdGet (PcdConOutUgaSupport)
- );
+ ASSERT (FeaturePcdGet (PcdConOutGopSupport));
//
// The driver creates virtual handles for ConIn, ConOut, StdErr.
@@ -757,10 +723,6 @@ ConSplitterTextOutConstructor (
//
// Copy protocols template
//
- if (FeaturePcdGet (PcdConOutUgaSupport)) {
- CopyMem (&ConOutPrivate->UgaDraw, &mUgaDrawProtocolTemplate, sizeof (EFI_UGA_DRAW_PROTOCOL));
- }
-
if (FeaturePcdGet (PcdConOutGopSupport)) {
CopyMem (&ConOutPrivate->GraphicsOutput, &mGraphicsOutputProtocolTemplate, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL));
}
@@ -806,13 +768,6 @@ ConSplitterTextOutConstructor (
ConOutPrivate->TextOutQueryData[0].Rows = 25;
TextOutSetMode (ConOutPrivate, 0);
- if (FeaturePcdGet (PcdConOutUgaSupport)) {
- //
- // Setup the UgaDraw to 800 x 600 x 32 bits per pixel, 60Hz.
- //
- ConSplitterUgaDrawSetMode (&ConOutPrivate->UgaDraw, 800, 600, 32, 60);
- }
-
if (FeaturePcdGet (PcdConOutGopSupport)) {
//
// Setup resource for mode information in Graphics Output Protocol interface
@@ -1335,7 +1290,6 @@ ConSplitterConOutDriverBindingStart (
EFI_STATUS Status;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
UINTN SizeOfInfo;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
@@ -1356,7 +1310,6 @@ ConSplitterConOutDriverBindingStart (
}
GraphicsOutput = NULL;
- UgaDraw = NULL;
//
// Try to Open Graphics Output protocol
//
@@ -1369,20 +1322,6 @@ ConSplitterConOutDriverBindingStart (
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
- if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // Open UGA DRAW protocol
- //
- gBS->OpenProtocol (
- ControllerHandle,
- &gEfiUgaDrawProtocolGuid,
- (VOID **)&UgaDraw,
- This->DriverBindingHandle,
- mConOut.VirtualHandle,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- }
-
//
// When new console device is added, the new mode will be set later,
// so put current mode back to init state.
@@ -1393,36 +1332,18 @@ ConSplitterConOutDriverBindingStart (
// If both ConOut and StdErr incorporate the same Text Out device,
// their MaxMode and QueryData should be the intersection of both.
//
- Status = ConSplitterTextOutAddDevice (&mConOut, TextOut, GraphicsOutput, UgaDraw);
+ Status = ConSplitterTextOutAddDevice (&mConOut, TextOut, GraphicsOutput);
ConSplitterTextOutSetAttribute (&mConOut.TextOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
- if (FeaturePcdGet (PcdConOutUgaSupport)) {
- //
- // Get the UGA mode data of ConOut from the current mode
- //
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput->Mode->Mode, &SizeOfInfo, &Info);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- ASSERT (SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
-
- mConOut.UgaHorizontalResolution = Info->HorizontalResolution;
- mConOut.UgaVerticalResolution = Info->VerticalResolution;
- mConOut.UgaColorDepth = 32;
- mConOut.UgaRefreshRate = 60;
-
- FreePool (Info);
- } else if (UgaDraw != NULL) {
- Status = UgaDraw->GetMode (
- UgaDraw,
- &mConOut.UgaHorizontalResolution,
- &mConOut.UgaVerticalResolution,
- &mConOut.UgaColorDepth,
- &mConOut.UgaRefreshRate
- );
+ if (GraphicsOutput != NULL) {
+ Status = GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput->Mode->Mode, &SizeOfInfo, &Info);
+ if (EFI_ERROR (Status)) {
+ return Status;
}
+
+ ASSERT (SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
+
+ FreePool (Info);
}
return Status;
@@ -1477,7 +1398,7 @@ ConSplitterStdErrDriverBindingStart (
// If both ConOut and StdErr incorporate the same Text Out device,
// their MaxMode and QueryData should be the intersection of both.
//
- Status = ConSplitterTextOutAddDevice (&mStdErr, TextOut, NULL, NULL);
+ Status = ConSplitterTextOutAddDevice (&mStdErr, TextOut, NULL);
ConSplitterTextOutSetAttribute (&mStdErr.TextOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
return Status;
@@ -2737,7 +2658,6 @@ ConSplitterGetIntersectionBetweenConOutAndStrErr (
@param Private Text Out Splitter pointer.
@param GraphicsOutput Graphics Output protocol pointer.
- @param UgaDraw UGA Draw protocol pointer.
@retval EFI_SUCCESS Output mode added successfully.
@retval other Failed to add output mode.
@@ -2746,8 +2666,7 @@ ConSplitterGetIntersectionBetweenConOutAndStrErr (
EFI_STATUS
ConSplitterAddGraphicsOutputMode (
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
- IN EFI_UGA_DRAW_PROTOCOL *UgaDraw
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput
)
{
EFI_STATUS Status;
@@ -2762,12 +2681,8 @@ ConSplitterAddGraphicsOutputMode (
UINTN NumberIndex;
BOOLEAN Match;
BOOLEAN AlreadyExist;
- UINT32 UgaHorizontalResolution;
- UINT32 UgaVerticalResolution;
- UINT32 UgaColorDepth;
- UINT32 UgaRefreshRate;
- ASSERT (GraphicsOutput != NULL || UgaDraw != NULL);
+ ASSERT (GraphicsOutput != NULL);
CurrentGraphicsOutputMode = Private->GraphicsOutput.Mode;
@@ -2775,15 +2690,6 @@ ConSplitterAddGraphicsOutputMode (
CurrentIndex = 0;
Status = EFI_SUCCESS;
- if (Private->CurrentNumberOfUgaDraw != 0) {
- //
- // If any UGA device has already been added, then there is no need to
- // calculate intersection of display mode of different GOP/UGA device,
- // since only one display mode will be exported (i.e. user-defined mode)
- //
- goto Done;
- }
-
if (GraphicsOutput != NULL) {
if (Private->CurrentNumberOfGraphicsOutput == 0) {
//
@@ -2937,51 +2843,12 @@ ConSplitterAddGraphicsOutputMode (
}
}
}
- } else if (UgaDraw != NULL) {
- //
- // Graphics console driver can ensure the same mode for all GOP devices
- // so we can get the current mode from this video device
- //
- UgaDraw->GetMode (
- UgaDraw,
- &UgaHorizontalResolution,
- &UgaVerticalResolution,
- &UgaColorDepth,
- &UgaRefreshRate
- );
-
- CurrentGraphicsOutputMode->MaxMode = 1;
- Info = CurrentGraphicsOutputMode->Info;
- Info->Version = 0;
- Info->HorizontalResolution = UgaHorizontalResolution;
- Info->VerticalResolution = UgaVerticalResolution;
- Info->PixelFormat = PixelBltOnly;
- Info->PixelsPerScanLine = UgaHorizontalResolution;
- CurrentGraphicsOutputMode->SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
- CurrentGraphicsOutputMode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS)(UINTN)NULL;
- CurrentGraphicsOutputMode->FrameBufferSize = 0;
-
- //
- // Update the private mode buffer
- //
- CopyMem (&Private->GraphicsOutputModeBuffer[0], Info, sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
-
- //
- // Only mode 0 is available to be set
- //
- CurrentIndex = 0;
}
-Done:
-
if (GraphicsOutput != NULL) {
Private->CurrentNumberOfGraphicsOutput++;
}
- if (UgaDraw != NULL) {
- Private->CurrentNumberOfUgaDraw++;
- }
-
//
// Force GraphicsOutput mode to be set,
//
@@ -3130,7 +2997,6 @@ ConsplitterSetConsoleOutMode (
@param Private Text Out Splitter pointer.
@param TextOut Simple Text Output protocol pointer.
@param GraphicsOutput Graphics Output protocol pointer.
- @param UgaDraw UGA Draw protocol pointer.
@retval EFI_SUCCESS Text Output Device added successfully.
@retval EFI_OUT_OF_RESOURCES Could not grow the buffer size.
@@ -3140,17 +3006,12 @@ EFI_STATUS
ConSplitterTextOutAddDevice (
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut,
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
- IN EFI_UGA_DRAW_PROTOCOL *UgaDraw
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput
)
{
EFI_STATUS Status;
UINTN CurrentNumOfConsoles;
INT32 MaxMode;
- UINT32 UgaHorizontalResolution;
- UINT32 UgaVerticalResolution;
- UINT32 UgaColorDepth;
- UINT32 UgaRefreshRate;
TEXT_OUT_AND_GOP_DATA *TextAndGop;
UINTN SizeOfInfo;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
@@ -3186,7 +3047,6 @@ ConSplitterTextOutAddDevice (
TextAndGop->TextOut = TextOut;
TextAndGop->GraphicsOutput = GraphicsOutput;
- TextAndGop->UgaDraw = UgaDraw;
if (CurrentNumOfConsoles == 0) {
//
@@ -3215,101 +3075,33 @@ ConSplitterTextOutAddDevice (
//
// This device display mode will be added into Graphics Ouput modes.
//
- if ((GraphicsOutput != NULL) || (UgaDraw != NULL)) {
- DeviceStatus = ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput, UgaDraw);
+ if (GraphicsOutput != NULL) {
+ DeviceStatus = ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput);
}
- if (FeaturePcdGet (PcdConOutUgaSupport)) {
- //
- // If UGA is produced by Consplitter
- //
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput->Mode->Mode, &SizeOfInfo, &Info);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- ASSERT (SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
-
- UgaHorizontalResolution = Info->HorizontalResolution;
- UgaVerticalResolution = Info->VerticalResolution;
-
- FreePool (Info);
- } else if (UgaDraw != NULL) {
- Status = UgaDraw->GetMode (
- UgaDraw,
- &UgaHorizontalResolution,
- &UgaVerticalResolution,
- &UgaColorDepth,
- &UgaRefreshRate
- );
- if (!EFI_ERROR (Status) && EFI_ERROR (DeviceStatus)) {
- //
- // if GetMode is successfully and UGA device hasn't been set, set it
- //
- Status = ConSplitterUgaDrawSetMode (
- &Private->UgaDraw,
- UgaHorizontalResolution,
- UgaVerticalResolution,
- UgaColorDepth,
- UgaRefreshRate
- );
- }
-
- //
- // If GetMode/SetMode is failed, set to 800x600 mode
- //
- if (EFI_ERROR (Status)) {
- Status = ConSplitterUgaDrawSetMode (
- &Private->UgaDraw,
- 800,
- 600,
- 32,
- 60
- );
- }
+ if (GraphicsOutput != NULL) {
+ Status = GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput->Mode->Mode, &SizeOfInfo, &Info);
+ if (EFI_ERROR (Status)) {
+ return Status;
}
+
+ ASSERT (SizeOfInfo <= sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
+ FreePool (Info);
}
if (((!EFI_ERROR (DeviceStatus)) || (!EFI_ERROR (Status))) &&
- ((Private->CurrentNumberOfGraphicsOutput + Private->CurrentNumberOfUgaDraw) == 1))
+ ((Private->CurrentNumberOfGraphicsOutput) == 1))
{
- if (!FeaturePcdGet (PcdConOutGopSupport)) {
- //
- // If Graphics Outpurt protocol not supported, UGA Draw protocol is installed
- // on the virtual handle.
- //
- Status = gBS->InstallMultipleProtocolInterfaces (
- &mConOut.VirtualHandle,
- &gEfiUgaDrawProtocolGuid,
- &mConOut.UgaDraw,
- NULL
- );
- } else if (!FeaturePcdGet (PcdConOutUgaSupport)) {
- //
- // If UGA Draw protocol not supported, Graphics Output Protocol is installed
- // on virtual handle.
- //
- Status = gBS->InstallMultipleProtocolInterfaces (
- &mConOut.VirtualHandle,
- &gEfiGraphicsOutputProtocolGuid,
- &mConOut.GraphicsOutput,
- NULL
- );
- } else {
- //
- // Boot Graphics Output protocol and UGA Draw protocol are supported,
- // both they will be installed on virtual handle.
- //
- Status = gBS->InstallMultipleProtocolInterfaces (
- &mConOut.VirtualHandle,
- &gEfiGraphicsOutputProtocolGuid,
- &mConOut.GraphicsOutput,
- &gEfiUgaDrawProtocolGuid,
- &mConOut.UgaDraw,
- NULL
- );
- }
+ //
+ // Graphics Output Protocol is installed
+ // on virtual handle.
+ //
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mConOut.VirtualHandle,
+ &gEfiGraphicsOutputProtocolGuid,
+ &mConOut.GraphicsOutput,
+ NULL
+ );
}
//
@@ -3353,10 +3145,6 @@ ConSplitterTextOutDeleteDevice (
TextOutList = Private->TextOutList;
while (Index >= 0) {
if (TextOutList->TextOut == TextOut) {
- if (TextOutList->UgaDraw != NULL) {
- Private->CurrentNumberOfUgaDraw--;
- }
-
if (TextOutList->GraphicsOutput != NULL) {
Private->CurrentNumberOfGraphicsOutput--;
}
@@ -3377,33 +3165,16 @@ ConSplitterTextOutDeleteDevice (
return EFI_NOT_FOUND;
}
- if ((Private->CurrentNumberOfGraphicsOutput == 0) && (Private->CurrentNumberOfUgaDraw == 0)) {
+ if ((Private->CurrentNumberOfGraphicsOutput == 0)) {
//
- // If there is not any physical GOP and UGA device in system,
- // Consplitter GOP or UGA protocol will be uninstalled
+ // If there is not any physical GOP in system,
+ // Consplitter GOP protocol will be uninstalled
//
- if (!FeaturePcdGet (PcdConOutGopSupport)) {
- Status = gBS->UninstallProtocolInterface (
- Private->VirtualHandle,
- &gEfiUgaDrawProtocolGuid,
- &Private->UgaDraw
- );
- } else if (!FeaturePcdGet (PcdConOutUgaSupport)) {
- Status = gBS->UninstallProtocolInterface (
- Private->VirtualHandle,
- &gEfiGraphicsOutputProtocolGuid,
- &Private->GraphicsOutput
- );
- } else {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- Private->VirtualHandle,
- &gEfiUgaDrawProtocolGuid,
- &Private->UgaDraw,
- &gEfiGraphicsOutputProtocolGuid,
- &Private->GraphicsOutput,
- NULL
- );
- }
+ Status = gBS->UninstallProtocolInterface (
+ Private->VirtualHandle,
+ &gEfiGraphicsOutputProtocolGuid,
+ &Private->GraphicsOutput
+ );
}
if (CurrentNumOfConsoles == 0) {
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
index 354107c..f6d90d5 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
@@ -21,7 +21,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Protocol/SimpleTextIn.h>
#include <Protocol/SimpleTextInEx.h>
#include <Protocol/GraphicsOutput.h>
-#include <Protocol/UgaDraw.h>
#include <Guid/ConsoleInDevice.h>
#include <Guid/StandardErrorDevice.h>
@@ -182,7 +181,6 @@ typedef struct {
typedef struct {
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut;
} TEXT_OUT_AND_GOP_DATA;
@@ -195,16 +193,9 @@ typedef struct {
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL TextOut;
EFI_SIMPLE_TEXT_OUTPUT_MODE TextOutMode;
- EFI_UGA_DRAW_PROTOCOL UgaDraw;
- UINT32 UgaHorizontalResolution;
- UINT32 UgaVerticalResolution;
- UINT32 UgaColorDepth;
- UINT32 UgaRefreshRate;
-
EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *GraphicsOutputModeBuffer;
UINTN CurrentNumberOfGraphicsOutput;
- UINTN CurrentNumberOfUgaDraw;
UINTN CurrentNumberOfConsoles;
TEXT_OUT_AND_GOP_DATA *TextOutList;
@@ -230,13 +221,6 @@ typedef struct {
TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \
)
-#define UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
- CR ((a), \
- TEXT_OUT_SPLITTER_PRIVATE_DATA, \
- UgaDraw, \
- TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \
- )
-
#define CONSOLE_CONTROL_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \
CR ((a), \
TEXT_OUT_SPLITTER_PRIVATE_DATA, \
@@ -254,7 +238,7 @@ typedef struct {
Installs driver module protocols and. Creates virtual device handles for ConIn,
ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex protocol,
Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers.
- Installs Graphics Output protocol and/or UGA Draw protocol if needed.
+ Installs Graphics Output protocol if needed.
@param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.
@@ -1202,7 +1186,6 @@ ConSplitterSimplePointerDeleteDevice (
@param Private Text Out Splitter pointer.
@param TextOut Simple Text Output protocol pointer.
@param GraphicsOutput Graphics Output protocol pointer.
- @param UgaDraw UGA Draw protocol pointer.
@retval EFI_SUCCESS Text Output Device added successfully.
@retval EFI_OUT_OF_RESOURCES Could not grow the buffer size.
@@ -1212,8 +1195,7 @@ EFI_STATUS
ConSplitterTextOutAddDevice (
IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut,
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
- IN EFI_UGA_DRAW_PROTOCOL *UgaDraw
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput
);
/**
@@ -1858,118 +1840,6 @@ ConSplitterGraphicsOutputBlt (
);
/**
- Return the current video mode information.
-
- @param This The EFI_UGA_DRAW_PROTOCOL instance.
- @param HorizontalResolution The size of video screen in pixels in the X dimension.
- @param VerticalResolution The size of video screen in pixels in the Y dimension.
- @param ColorDepth Number of bits per pixel, currently defined to be 32.
- @param RefreshRate The refresh rate of the monitor in Hertz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
- @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawGetMode (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- OUT UINT32 *HorizontalResolution,
- OUT UINT32 *VerticalResolution,
- OUT UINT32 *ColorDepth,
- OUT UINT32 *RefreshRate
- );
-
-/**
- Set the current video mode information.
-
- @param This The EFI_UGA_DRAW_PROTOCOL instance.
- @param HorizontalResolution The size of video screen in pixels in the X dimension.
- @param VerticalResolution The size of video screen in pixels in the Y dimension.
- @param ColorDepth Number of bits per pixel, currently defined to be 32.
- @param RefreshRate The refresh rate of the monitor in Hertz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
- @retval EFI_OUT_OF_RESOURCES Out of resources.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawSetMode (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- IN UINT32 HorizontalResolution,
- IN UINT32 VerticalResolution,
- IN UINT32 ColorDepth,
- IN UINT32 RefreshRate
- );
-
-/**
- Blt a rectangle of pixels on the graphics screen.
-
- The following table defines actions for BltOperations.
-
- EfiUgaVideoFill:
- Write data from the BltBuffer pixel (SourceX, SourceY)
- directly to every pixel of the video display rectangle
- (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height).
- Only one pixel will be used from the BltBuffer. Delta is NOT used.
- EfiUgaVideoToBltBuffer:
- Read data from the video display rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
- the BltBuffer rectangle (DestinationX, DestinationY )
- (DestinationX + Width, DestinationY + Height). If DestinationX or
- DestinationY is not zero then Delta must be set to the length in bytes
- of a row in the BltBuffer.
- EfiUgaBltBufferToVideo:
- Write data from the BltBuffer rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
- video display rectangle (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
- not zero then Delta must be set to the length in bytes of a row in the
- BltBuffer.
- EfiUgaVideoToVideo:
- Copy from the video display rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) .
- to the video display rectangle (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height).
- The BltBuffer and Delta are not used in this mode.
-
- @param This Protocol instance pointer.
- @param BltBuffer Buffer containing data to blit into video buffer. This
- buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
- @param BltOperation Operation to perform on BlitBuffer and video memory
- @param SourceX X coordinate of source for the BltBuffer.
- @param SourceY Y coordinate of source for the BltBuffer.
- @param DestinationX X coordinate of destination for the BltBuffer.
- @param DestinationY Y coordinate of destination for the BltBuffer.
- @param Width Width of rectangle in BltBuffer in pixels.
- @param Height Hight of rectangle in BltBuffer in pixels.
- @param Delta OPTIONAL
-
- @retval EFI_SUCCESS The Blt operation completed.
- @retval EFI_INVALID_PARAMETER BltOperation is not valid.
- @retval EFI_DEVICE_ERROR A hardware error occurred writting to the video buffer.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawBlt (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
- IN EFI_UGA_BLT_OPERATION BltOperation,
- IN UINTN SourceX,
- IN UINTN SourceY,
- IN UINTN DestinationX,
- IN UINTN DestinationY,
- IN UINTN Width,
- IN UINTN Height,
- IN UINTN Delta OPTIONAL
- );
-
-/**
Sets the output device(s) to a specified mode.
@param Private Text Out Splitter pointer.
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
index 9aa1dad..156757a 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
@@ -3,12 +3,9 @@
#
# This driver acts as a virtual console, takes over the console I/O control from selected
# standard console devices, and transmits console I/O to related console device drivers.
-# Consplitter could install Graphics Output protocol and/or UGA Draw protocol in system
-# table according PCD settings(PcdConOutGopSupport, and PcdConOutUgaSupport). It always
-# consumes Graphics Output protocol which is produced by display device, and consumes UGA Draw
-# protocol which is produced by display device according to PcdUgaConsumeSupport value.
-# Note: If only UGA Draw protocol is installed in system, PcdUgaConsumeSupport should be
-# set to TRUE.
+# Consplitter could install Graphics Output protocol in system
+# table according PCD settings(PcdConOutGopSupport). It always
+# consumes Graphics Output protocol which is produced by display device
#
# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
#
@@ -92,14 +89,9 @@
## SOMETIMES_PRODUCES
## SOMETIMES_CONSUMES
gEfiGraphicsOutputProtocolGuid
- ## SOMETIMES_PRODUCES
- ## SOMETIMES_CONSUMES
- gEfiUgaDrawProtocolGuid
[FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport ## CONSUMES
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport ## CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES
[Pcd]
## SOMETIMES_PRODUCES
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni
index 13c25b2..903c505 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni
@@ -3,12 +3,9 @@
//
// This driver acts as a virtual console, takes over the console I/O control from selected
// standard console devices, and transmits console I/O to related console device drivers.
-// Consplitter could install Graphics Output protocol and/or UGA Draw protocol in system
-// table according PCD settings(PcdConOutGopSupport, and PcdConOutUgaSupport). It always
-// consumes Graphics Output protocol which is produced by display device, and consumes UGA Draw
-// protocol which is produced by display device according to PcdUgaConsumeSupport value.
-// Note: If only UGA Draw protocol is installed in system, PcdUgaConsumeSupport should be
-// set to TRUE.
+// Consplitter could install Graphics Output protocol in system
+// table according PCD settings(PcdConOutGopSupport). It always
+// consumes Graphics Output protocol which is produced by display device
//
// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
//
@@ -19,5 +16,5 @@
#string STR_MODULE_ABSTRACT #language en-US "Provides multi console support"
-#string STR_MODULE_DESCRIPTION #language en-US "This driver acts as a virtual console, takes over the console I/O control from selected standard console devices, and transmits console I/O to related console device drivers. Consplitter could install Graphics Output protocol and/or UGA Draw protocol in system table according PCD settings(PcdConOutGopSupport, and PcdConOutUgaSupport). It always consumes Graphics Output protocol, which is produced by display device, and consumes UGA Draw protocol, which is produced by display device according to PcdUgaConsumeSupport value. Note: If only UGA Draw protocol is installed in system, PcdUgaConsumeSupport should be set to TRUE."
+#string STR_MODULE_DESCRIPTION #language en-US "This driver acts as a virtual console, takes over the console I/O control from selected standard console devices, and transmits console I/O to related console device drivers. Consplitter could install Graphics Output protocol in system table according PCD settings(PcdConOutGopSupport). It always consumes Graphics Output protocol, which is produced by display device."
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
index 64ad567..8353f0b 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
@@ -117,7 +117,6 @@ ConSplitterGraphicsOutputSetMode (
UINTN NumberIndex;
UINTN SizeOfInfo;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
if (ModeNumber >= This->Mode->MaxMode) {
return EFI_UNSUPPORTED;
@@ -157,20 +156,6 @@ ConSplitterGraphicsOutputSetMode (
if (EFI_ERROR (Status)) {
ReturnStatus = Status;
}
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- UgaDraw = Private->TextOutList[Index].UgaDraw;
- if (UgaDraw != NULL) {
- Status = UgaDraw->SetMode (
- UgaDraw,
- Mode->HorizontalResolution,
- Mode->VerticalResolution,
- 32,
- 60
- );
- if (EFI_ERROR (Status)) {
- ReturnStatus = Status;
- }
- }
}
}
@@ -261,7 +246,6 @@ ConSplitterGraphicsOutputBlt (
TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
UINTN Index;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
if ((This == NULL) || (((UINTN)BltOperation) >= EfiGraphicsOutputBltOperationMax)) {
return EFI_INVALID_PARAMETER;
@@ -298,298 +282,6 @@ ConSplitterGraphicsOutputBlt (
return EFI_SUCCESS;
}
}
-
- UgaDraw = Private->TextOutList[Index].UgaDraw;
- if ((UgaDraw != NULL) && FeaturePcdGet (PcdUgaConsumeSupport)) {
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)BltBuffer,
- (EFI_UGA_BLT_OPERATION)BltOperation,
- SourceX,
- SourceY,
- DestinationX,
- DestinationY,
- Width,
- Height,
- Delta
- );
- if (EFI_ERROR (Status)) {
- ReturnStatus = Status;
- } else if (BltOperation == EfiBltVideoToBltBuffer) {
- //
- // Only need to read the data into buffer one time
- //
- return EFI_SUCCESS;
- }
- }
- }
-
- return ReturnStatus;
-}
-
-/**
- Return the current video mode information.
-
- @param This The EFI_UGA_DRAW_PROTOCOL instance.
- @param HorizontalResolution The size of video screen in pixels in the X dimension.
- @param VerticalResolution The size of video screen in pixels in the Y dimension.
- @param ColorDepth Number of bits per pixel, currently defined to be 32.
- @param RefreshRate The refresh rate of the monitor in Hertz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
- @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawGetMode (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- OUT UINT32 *HorizontalResolution,
- OUT UINT32 *VerticalResolution,
- OUT UINT32 *ColorDepth,
- OUT UINT32 *RefreshRate
- )
-{
- TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
-
- if ((HorizontalResolution == NULL) ||
- (VerticalResolution == NULL) ||
- (RefreshRate == NULL) ||
- (ColorDepth == NULL))
- {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // retrieve private data
- //
- Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
-
- *HorizontalResolution = Private->UgaHorizontalResolution;
- *VerticalResolution = Private->UgaVerticalResolution;
- *ColorDepth = Private->UgaColorDepth;
- *RefreshRate = Private->UgaRefreshRate;
-
- return EFI_SUCCESS;
-}
-
-/**
- Set the current video mode information.
-
- @param This The EFI_UGA_DRAW_PROTOCOL instance.
- @param HorizontalResolution The size of video screen in pixels in the X dimension.
- @param VerticalResolution The size of video screen in pixels in the Y dimension.
- @param ColorDepth Number of bits per pixel, currently defined to be 32.
- @param RefreshRate The refresh rate of the monitor in Hertz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
- @retval EFI_OUT_OF_RESOURCES Out of resources.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawSetMode (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- IN UINT32 HorizontalResolution,
- IN UINT32 VerticalResolution,
- IN UINT32 ColorDepth,
- IN UINT32 RefreshRate
- )
-{
- EFI_STATUS Status;
- TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
- UINTN Index;
- EFI_STATUS ReturnStatus;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- UINTN NumberIndex;
- UINTN SizeOfInfo;
- EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
-
- Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
-
- ReturnStatus = EFI_SUCCESS;
-
- //
- // Update the Mode data
- //
- Private->UgaHorizontalResolution = HorizontalResolution;
- Private->UgaVerticalResolution = VerticalResolution;
- Private->UgaColorDepth = ColorDepth;
- Private->UgaRefreshRate = RefreshRate;
-
- //
- // return the worst status met
- //
- for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
- GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
- if (GraphicsOutput != NULL) {
- //
- // Find corresponding ModeNumber of this GraphicsOutput instance
- //
- for (NumberIndex = 0; NumberIndex < GraphicsOutput->Mode->MaxMode; NumberIndex++) {
- Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32)NumberIndex, &SizeOfInfo, &Info);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if ((Info->HorizontalResolution == HorizontalResolution) && (Info->VerticalResolution == VerticalResolution)) {
- FreePool (Info);
- break;
- }
-
- FreePool (Info);
- }
-
- Status = GraphicsOutput->SetMode (GraphicsOutput, (UINT32)NumberIndex);
- if (EFI_ERROR (Status)) {
- ReturnStatus = Status;
- }
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- UgaDraw = Private->TextOutList[Index].UgaDraw;
- if (UgaDraw != NULL) {
- Status = UgaDraw->SetMode (
- UgaDraw,
- HorizontalResolution,
- VerticalResolution,
- ColorDepth,
- RefreshRate
- );
- if (EFI_ERROR (Status)) {
- ReturnStatus = Status;
- }
- }
- }
- }
-
- return ReturnStatus;
-}
-
-/**
- Blt a rectangle of pixels on the graphics screen.
-
- The following table defines actions for BltOperations.
-
- EfiUgaVideoFill:
- Write data from the BltBuffer pixel (SourceX, SourceY)
- directly to every pixel of the video display rectangle
- (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height).
- Only one pixel will be used from the BltBuffer. Delta is NOT used.
- EfiUgaVideoToBltBuffer:
- Read data from the video display rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
- the BltBuffer rectangle (DestinationX, DestinationY )
- (DestinationX + Width, DestinationY + Height). If DestinationX or
- DestinationY is not zero then Delta must be set to the length in bytes
- of a row in the BltBuffer.
- EfiUgaBltBufferToVideo:
- Write data from the BltBuffer rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
- video display rectangle (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
- not zero then Delta must be set to the length in bytes of a row in the
- BltBuffer.
- EfiUgaVideoToVideo:
- Copy from the video display rectangle
- (SourceX, SourceY) (SourceX + Width, SourceY + Height) .
- to the video display rectangle (DestinationX, DestinationY)
- (DestinationX + Width, DestinationY + Height).
- The BltBuffer and Delta are not used in this mode.
-
- @param This Protocol instance pointer.
- @param BltBuffer Buffer containing data to blit into video buffer. This
- buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
- @param BltOperation Operation to perform on BlitBuffer and video memory
- @param SourceX X coordinate of source for the BltBuffer.
- @param SourceY Y coordinate of source for the BltBuffer.
- @param DestinationX X coordinate of destination for the BltBuffer.
- @param DestinationY Y coordinate of destination for the BltBuffer.
- @param Width Width of rectangle in BltBuffer in pixels.
- @param Height Hight of rectangle in BltBuffer in pixels.
- @param Delta OPTIONAL
-
- @retval EFI_SUCCESS The Blt operation completed.
- @retval EFI_INVALID_PARAMETER BltOperation is not valid.
- @retval EFI_DEVICE_ERROR A hardware error occurred writting to the video buffer.
-
-**/
-EFI_STATUS
-EFIAPI
-ConSplitterUgaDrawBlt (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
- IN EFI_UGA_BLT_OPERATION BltOperation,
- IN UINTN SourceX,
- IN UINTN SourceY,
- IN UINTN DestinationX,
- IN UINTN DestinationY,
- IN UINTN Width,
- IN UINTN Height,
- IN UINTN Delta OPTIONAL
- )
-{
- EFI_STATUS Status;
- TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
- UINTN Index;
- EFI_STATUS ReturnStatus;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
-
- Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
-
- ReturnStatus = EFI_SUCCESS;
- //
- // return the worst status met
- //
- for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
- GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->Blt (
- GraphicsOutput,
- (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)BltBuffer,
- (EFI_GRAPHICS_OUTPUT_BLT_OPERATION)BltOperation,
- SourceX,
- SourceY,
- DestinationX,
- DestinationY,
- Width,
- Height,
- Delta
- );
- if (EFI_ERROR (Status)) {
- ReturnStatus = Status;
- } else if (BltOperation == EfiUgaVideoToBltBuffer) {
- //
- // Only need to read the data into buffer one time
- //
- return EFI_SUCCESS;
- }
- }
-
- if ((Private->TextOutList[Index].UgaDraw != NULL) && FeaturePcdGet (PcdUgaConsumeSupport)) {
- Status = Private->TextOutList[Index].UgaDraw->Blt (
- Private->TextOutList[Index].UgaDraw,
- BltBuffer,
- BltOperation,
- SourceX,
- SourceY,
- DestinationX,
- DestinationY,
- Width,
- Height,
- Delta
- );
- if (EFI_ERROR (Status)) {
- ReturnStatus = Status;
- } else if (BltOperation == EfiUgaVideoToBltBuffer) {
- //
- // Only need to read the data into buffer one time
- //
- return EFI_SUCCESS;
- }
- }
}
return ReturnStatus;
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
index b895daf..facb813 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
@@ -14,7 +14,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
GRAPHICS_CONSOLE_DEV mGraphicsConsoleDevTemplate = {
GRAPHICS_CONSOLE_DEV_SIGNATURE,
(EFI_GRAPHICS_OUTPUT_PROTOCOL *)NULL,
- (EFI_UGA_DRAW_PROTOCOL *)NULL,
{
GraphicsConsoleConOutReset,
GraphicsConsoleConOutOutputString,
@@ -104,9 +103,8 @@ EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding = {
/**
Test to see if Graphics Console could be supported on the Controller.
- Graphics Console could be supported if Graphics Output Protocol or UGA Draw
- Protocol exists on the Controller. (UGA Draw Protocol could be skipped
- if PcdUgaConsumeSupport is set to FALSE.)
+ Graphics Console could be supported if Graphics Output Protocol
+ exists on the Controller.
@param This Protocol instance pointer.
@param Controller Handle of device to test.
@@ -127,11 +125,9 @@ GraphicsConsoleControllerDriverSupported (
{
EFI_STATUS Status;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
GraphicsOutput = NULL;
- UgaDraw = NULL;
//
// Open the IO Abstraction(s) needed to perform the supported test
//
@@ -143,21 +139,6 @@ GraphicsConsoleControllerDriverSupported (
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
-
- if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // Open Graphics Output Protocol failed, try to open UGA Draw Protocol
- //
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiUgaDrawProtocolGuid,
- (VOID **)&UgaDraw,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- }
-
if (EFI_ERROR (Status)) {
return Status;
}
@@ -202,13 +183,6 @@ Error:
This->DriverBindingHandle,
Controller
);
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- gBS->CloseProtocol (
- Controller,
- &gEfiUgaDrawProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
}
return Status;
@@ -369,9 +343,8 @@ InitializeGraphicsConsoleTextMode (
}
/**
- Start this driver on Controller by opening Graphics Output protocol or
- UGA Draw protocol, and installing Simple Text Out protocol on Controller.
- (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
+ Start this driver on Controller by opening Graphics Output protocol
+ and installing Simple Text Out protocol on Controller.
@param This Protocol instance pointer.
@param Controller Handle of device to bind driver to
@@ -394,8 +367,6 @@ GraphicsConsoleControllerDriverStart (
GRAPHICS_CONSOLE_DEV *Private;
UINT32 HorizontalResolution;
UINT32 VerticalResolution;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
UINT32 ModeIndex;
UINTN MaxMode;
UINT32 ModeNumber;
@@ -432,18 +403,6 @@ GraphicsConsoleControllerDriverStart (
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
-
- if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiUgaDrawProtocolGuid,
- (VOID **)&Private->UgaDraw,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- }
-
if (EFI_ERROR (Status)) {
goto Error;
}
@@ -534,43 +493,6 @@ GraphicsConsoleControllerDriverStart (
goto Error;
}
}
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // At first try to set user-defined resolution
- //
- ColorDepth = 32;
- RefreshRate = 60;
- Status = Private->UgaDraw->SetMode (
- Private->UgaDraw,
- HorizontalResolution,
- VerticalResolution,
- ColorDepth,
- RefreshRate
- );
- if (EFI_ERROR (Status)) {
- //
- // Try to set 800*600 which is required by UEFI/EFI spec
- //
- Status = Private->UgaDraw->SetMode (
- Private->UgaDraw,
- 800,
- 600,
- ColorDepth,
- RefreshRate
- );
- if (EFI_ERROR (Status)) {
- Status = Private->UgaDraw->GetMode (
- Private->UgaDraw,
- &HorizontalResolution,
- &VerticalResolution,
- &ColorDepth,
- &RefreshRate
- );
- if (EFI_ERROR (Status)) {
- goto Error;
- }
- }
- }
}
DEBUG ((DEBUG_INFO, "GraphicsConsole video resolution %d x %d\n", HorizontalResolution, VerticalResolution));
@@ -638,7 +560,7 @@ GraphicsConsoleControllerDriverStart (
Error:
if (EFI_ERROR (Status)) {
//
- // Close the GOP and UGA Draw Protocol
+ // Close the GOP
//
if (Private->GraphicsOutput != NULL) {
gBS->CloseProtocol (
@@ -647,13 +569,6 @@ Error:
This->DriverBindingHandle,
Controller
);
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- gBS->CloseProtocol (
- Controller,
- &gEfiUgaDrawProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
}
if (Private->LineBuffer != NULL) {
@@ -675,9 +590,7 @@ Error:
/**
Stop this driver on Controller by removing Simple Text Out protocol
- and closing the Graphics Output Protocol or UGA Draw protocol on Controller.
- (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
-
+ and closing the Graphics Output Protocol on Controller.
@param This Protocol instance pointer.
@param Controller Handle of device to stop driver on
@@ -726,7 +639,7 @@ GraphicsConsoleControllerDriverStop (
if (!EFI_ERROR (Status)) {
//
- // Close the GOP or UGA IO Protocol
+ // Close the GOP Protocol
//
if (Private->GraphicsOutput != NULL) {
gBS->CloseProtocol (
@@ -735,13 +648,6 @@ GraphicsConsoleControllerDriverStop (
This->DriverBindingHandle,
Controller
);
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- gBS->CloseProtocol (
- Controller,
- &gEfiUgaDrawProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
}
if (Private->LineBuffer != NULL) {
@@ -933,7 +839,6 @@ GraphicsConsoleConOutOutputString (
{
GRAPHICS_CONSOLE_DEV *Private;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
INTN Mode;
UINTN MaxColumn;
UINTN MaxRow;
@@ -967,7 +872,6 @@ GraphicsConsoleConOutOutputString (
Mode = This->Mode->Mode;
Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
GraphicsOutput = Private->GraphicsOutput;
- UgaDraw = Private->UgaDraw;
MaxColumn = Private->ModeData[Mode].Columns;
MaxRow = Private->ModeData[Mode].Rows;
@@ -1055,38 +959,6 @@ GraphicsConsoleConOutOutputString (
EFI_GLYPH_HEIGHT,
Delta
);
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // Scroll Screen Up One Row
- //
- UgaDraw->Blt (
- UgaDraw,
- NULL,
- EfiUgaVideoToVideo,
- DeltaX,
- DeltaY + EFI_GLYPH_HEIGHT,
- DeltaX,
- DeltaY,
- Width,
- Height,
- Delta
- );
-
- //
- // Print Blank Line at last line
- //
- UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)(UINTN)&Background,
- EfiUgaVideoFill,
- 0,
- 0,
- DeltaX,
- DeltaY + Height,
- Width,
- EFI_GLYPH_HEIGHT,
- Delta
- );
}
} else {
This->Mode->CursorRow++;
@@ -1320,19 +1192,13 @@ GraphicsConsoleConOutSetMode (
GRAPHICS_CONSOLE_DEV *Private;
GRAPHICS_CONSOLE_MODE_DATA *ModeData;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *NewLineBuffer;
- UINT32 HorizontalResolution;
- UINT32 VerticalResolution;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
EFI_TPL OldTpl;
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
GraphicsOutput = Private->GraphicsOutput;
- UgaDraw = Private->UgaDraw;
//
// Make sure the requested mode number is supported
@@ -1366,7 +1232,7 @@ GraphicsConsoleConOutSetMode (
}
//
- // Otherwise, the size of the text console and/or the GOP/UGA mode will be changed,
+ // Otherwise, the size of the text console and/or the GOP mode will be changed,
// so erase the cursor, and free the LineBuffer for the current mode
//
FlushCursor (This);
@@ -1422,51 +1288,6 @@ GraphicsConsoleConOutSetMode (
0
);
}
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // Get the current UGA Draw mode information
- //
- Status = UgaDraw->GetMode (
- UgaDraw,
- &HorizontalResolution,
- &VerticalResolution,
- &ColorDepth,
- &RefreshRate
- );
- if (EFI_ERROR (Status) || (HorizontalResolution != ModeData->GopWidth) || (VerticalResolution != ModeData->GopHeight)) {
- //
- // Either no graphics mode is currently set, or it is set to the wrong resolution, so set the new graphics mode
- //
- Status = UgaDraw->SetMode (
- UgaDraw,
- ModeData->GopWidth,
- ModeData->GopHeight,
- 32,
- 60
- );
- if (EFI_ERROR (Status)) {
- //
- // The mode set operation failed
- //
- goto Done;
- }
- } else {
- //
- // The current graphics mode is correct, so simply clear the entire display
- //
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)(UINTN)&mGraphicsEfiColors[0],
- EfiUgaVideoFill,
- 0,
- 0,
- 0,
- 0,
- ModeData->GopWidth,
- ModeData->GopHeight,
- 0
- );
- }
}
//
@@ -1558,7 +1379,6 @@ GraphicsConsoleConOutClearScreen (
GRAPHICS_CONSOLE_DEV *Private;
GRAPHICS_CONSOLE_MODE_DATA *ModeData;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background;
EFI_TPL OldTpl;
@@ -1574,7 +1394,6 @@ GraphicsConsoleConOutClearScreen (
Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
GraphicsOutput = Private->GraphicsOutput;
- UgaDraw = Private->UgaDraw;
ModeData = &(Private->ModeData[This->Mode->Mode]);
GetTextColors (This, &Foreground, &Background);
@@ -1591,19 +1410,6 @@ GraphicsConsoleConOutClearScreen (
ModeData->GopHeight,
0
);
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)(UINTN)&Background,
- EfiUgaVideoFill,
- 0,
- 0,
- 0,
- 0,
- ModeData->GopWidth,
- ModeData->GopHeight,
- 0
- );
} else {
Status = EFI_UNSUPPORTED;
}
@@ -1764,7 +1570,7 @@ GetTextColors (
@param Count The count of Unicode string.
@retval EFI_OUT_OF_RESOURCES If no memory resource to use.
- @retval EFI_UNSUPPORTED If no Graphics Output protocol and UGA Draw
+ @retval EFI_UNSUPPORTED If no Graphics Output protocol
protocol exist.
@retval EFI_SUCCESS Drawing Unicode string implemented successfully.
@@ -1781,9 +1587,6 @@ DrawUnicodeWeightAtCursorN (
EFI_IMAGE_OUTPUT *Blt;
EFI_STRING String;
EFI_FONT_DISPLAY_INFO *FontInfo;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- EFI_HII_ROW_INFO *RowInfoArray;
- UINTN RowInfoArraySize;
Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
Blt = (EFI_IMAGE_OUTPUT *)AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT));
@@ -1835,63 +1638,6 @@ DrawUnicodeWeightAtCursorN (
NULL,
NULL
);
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // If Graphics Output protocol cannot be found and PcdUgaConsumeSupport enabled,
- // using UGA Draw protocol to draw.
- //
- ASSERT (Private->UgaDraw != NULL);
-
- UgaDraw = Private->UgaDraw;
-
- Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- if (Blt->Image.Bitmap == NULL) {
- FreePool (Blt);
- FreePool (String);
- return EFI_OUT_OF_RESOURCES;
- }
-
- RowInfoArray = NULL;
- //
- // StringToImage only support blt'ing image to device using GOP protocol. If GOP is not supported in this platform,
- // we ask StringToImage to print the string to blt buffer, then blt to device using UgaDraw.
- //
- Status = mHiiFont->StringToImage (
- mHiiFont,
- EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_IGNORE_LINE_BREAK,
- String,
- FontInfo,
- &Blt,
- This->Mode->CursorColumn * EFI_GLYPH_WIDTH + Private->ModeData[This->Mode->Mode].DeltaX,
- This->Mode->CursorRow * EFI_GLYPH_HEIGHT + Private->ModeData[This->Mode->Mode].DeltaY,
- &RowInfoArray,
- &RowInfoArraySize,
- NULL
- );
-
- if (!EFI_ERROR (Status)) {
- //
- // Line breaks are handled by caller of DrawUnicodeWeightAtCursorN, so the updated parameter RowInfoArraySize by StringToImage will
- // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure.
- //
- ASSERT (RowInfoArraySize <= 1);
-
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)Blt->Image.Bitmap,
- EfiUgaBltBufferToVideo,
- This->Mode->CursorColumn * EFI_GLYPH_WIDTH + Private->ModeData[This->Mode->Mode].DeltaX,
- (This->Mode->CursorRow) * EFI_GLYPH_HEIGHT + Private->ModeData[This->Mode->Mode].DeltaY,
- This->Mode->CursorColumn * EFI_GLYPH_WIDTH + Private->ModeData[This->Mode->Mode].DeltaX,
- (This->Mode->CursorRow) * EFI_GLYPH_HEIGHT + Private->ModeData[This->Mode->Mode].DeltaY,
- RowInfoArray[0].LineWidth,
- RowInfoArray[0].LineHeight,
- Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- }
-
- FreePool (RowInfoArray);
- FreePool (Blt->Image.Bitmap);
} else {
Status = EFI_UNSUPPORTED;
}
@@ -1934,7 +1680,6 @@ FlushCursor (
INTN GlyphX;
INTN GlyphY;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Foreground;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Background;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION BltChar[EFI_GLYPH_HEIGHT][EFI_GLYPH_WIDTH];
@@ -1949,7 +1694,6 @@ FlushCursor (
Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
GraphicsOutput = Private->GraphicsOutput;
- UgaDraw = Private->UgaDraw;
//
// In this driver, only narrow character was supported.
@@ -1972,19 +1716,6 @@ FlushCursor (
EFI_GLYPH_HEIGHT,
EFI_GLYPH_WIDTH * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
);
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)(UINTN)BltChar,
- EfiUgaVideoToBltBuffer,
- GlyphX,
- GlyphY,
- 0,
- 0,
- EFI_GLYPH_WIDTH,
- EFI_GLYPH_HEIGHT,
- EFI_GLYPH_WIDTH * sizeof (EFI_UGA_PIXEL)
- );
}
GetTextColors (This, &Foreground.Pixel, &Background.Pixel);
@@ -2013,19 +1744,6 @@ FlushCursor (
EFI_GLYPH_HEIGHT,
EFI_GLYPH_WIDTH * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
);
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)(UINTN)BltChar,
- EfiUgaBltBufferToVideo,
- 0,
- 0,
- GlyphX,
- GlyphY,
- EFI_GLYPH_WIDTH,
- EFI_GLYPH_HEIGHT,
- EFI_GLYPH_WIDTH * sizeof (EFI_UGA_PIXEL)
- );
}
return EFI_SUCCESS;
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h
index e4abad4..e1a6b37 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h
@@ -12,7 +12,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Uefi.h>
#include <Protocol/SimpleTextOut.h>
#include <Protocol/GraphicsOutput.h>
-#include <Protocol/UgaDraw.h>
#include <Protocol/DevicePath.h>
#include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h>
@@ -59,7 +58,6 @@ typedef struct {
typedef struct {
UINTN Signature;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput;
EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode;
GRAPHICS_CONSOLE_MODE_DATA *ModeData;
@@ -417,9 +415,8 @@ GraphicsConsoleConOutEnableCursor (
/**
Test to see if Graphics Console could be supported on the Controller.
- Graphics Console could be supported if Graphics Output Protocol or UGADraw
- Protocol exists on the Controller. (UGA Draw Protocol could be skipped
- if PcdUgaConsumeSupport is set to FALSE.)
+ Graphics Console could be supported if Graphics Output Protocol
+ exists on the Controller.
@param This Protocol instance pointer.
@param Controller Handle of device to test.
@@ -439,9 +436,8 @@ GraphicsConsoleControllerDriverSupported (
);
/**
- Start this driver on Controller by opening Graphics Output protocol or
- UGA Draw protocol, and installing Simple Text Out protocol on Controller.
- (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
+ Start this driver on Controller by opening Graphics Output protocol
+ and installing Simple Text Out protocol on Controller.
@param This Protocol instance pointer.
@param Controller Handle of device to bind driver to
@@ -462,9 +458,7 @@ GraphicsConsoleControllerDriverStart (
/**
Stop this driver on Controller by removing Simple Text Out protocol
- and closing the Graphics Output Protocol or UGA Draw protocol on Controller.
- (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
-
+ and closing the Graphics Output Protocol on Controller.
@param This Protocol instance pointer.
@param Controller Handle of device to stop driver on
@@ -526,8 +520,7 @@ GetTextColors (
@param Count The count of Unicode string.
@retval EFI_OUT_OF_RESOURCES If no memory resource to use.
- @retval EFI_UNSUPPORTED If no Graphics Output protocol and UGA Draw
- protocol exist.
+ @retval EFI_UNSUPPORTED If no Graphics Output protocol exist.
@retval EFI_SUCCESS Drawing Unicode string implemented successfully.
**/
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
index bcfd306..975871b 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
@@ -2,7 +2,7 @@
# Console support on graphic devices.
#
# This driver will install Simple Text Output protocol by consuming Graphices Output
-# protocol or UGA Draw protocol on graphic devices.
+# protocol on graphic devices.
#
# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -53,15 +53,11 @@
gEfiDevicePathProtocolGuid ## TO_START
gEfiSimpleTextOutProtocolGuid ## BY_START
gEfiGraphicsOutputProtocolGuid ## TO_START
- gEfiUgaDrawProtocolGuid ## TO_START
gEfiHiiFontProtocolGuid ## TO_START
## TO_START
## NOTIFY
gEfiHiiDatabaseProtocolGuid
-[FeaturePcd]
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES
-
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution ## SOMETIMES_CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution ## SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.uni b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.uni
index aec5d57..45dbb24 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.uni
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.uni
@@ -2,7 +2,7 @@
// Console support on graphic devices.
//
// This driver will install Simple Text Output protocol by consuming Graphices Output
-// protocol or UGA Draw protocol on graphic devices.
+// protocol on graphic devices.
//
// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
//
@@ -14,5 +14,5 @@
#string STR_MODULE_ABSTRACT #language en-US "Console support on graphic devices"
#string STR_MODULE_DESCRIPTION #language en-US "This driver will install SimpleTextOutputProtocol by consuming GraphicesOutput\n"
- "Protocol or UgaDrawProtocol on graphics devices."
+ "Protocol on graphics devices."
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
index b35360e..ae5eff7 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
@@ -1407,7 +1407,7 @@ HiiDrawImage (
//
if ((Flags & EFI_HII_DIRECT_TO_SCREEN) == EFI_HII_DIRECT_TO_SCREEN) {
//
- // Caller should make sure the current UGA console is grarphic mode.
+ // Caller should make sure the current console is grarphic mode.
//
//
diff --git a/EmbeddedPkg/Include/Guid/FdtHob.h b/MdePkg/Include/Guid/FdtHob.h
index 2425a13..2425a13 100644
--- a/EmbeddedPkg/Include/Guid/FdtHob.h
+++ b/MdePkg/Include/Guid/FdtHob.h
diff --git a/MdePkg/Include/Protocol/UgaDraw.h b/MdePkg/Include/Protocol/UgaDraw.h
deleted file mode 100644
index 8d33bf8..0000000
--- a/MdePkg/Include/Protocol/UgaDraw.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/** @file
- UGA Draw protocol from the EFI 1.10 specification.
-
- Abstraction of a very simple graphics device.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __UGA_DRAW_H__
-#define __UGA_DRAW_H__
-
-#define EFI_UGA_DRAW_PROTOCOL_GUID \
- { \
- 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
- }
-
-typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
-
-/**
- Return the current video mode information.
-
- @param This The EFI_UGA_DRAW_PROTOCOL instance.
- @param HorizontalResolution The size of video screen in pixels in the X dimension.
- @param VerticalResolution The size of video screen in pixels in the Y dimension.
- @param ColorDepth Number of bits per pixel, currently defined to be 32.
- @param RefreshRate The refresh rate of the monitor in Hertz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
- @retval EFI_INVALID_PARAMETER One of the input args was NULL.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE)(
- IN EFI_UGA_DRAW_PROTOCOL *This,
- OUT UINT32 *HorizontalResolution,
- OUT UINT32 *VerticalResolution,
- OUT UINT32 *ColorDepth,
- OUT UINT32 *RefreshRate
- );
-
-/**
- Set the current video mode information.
-
- @param This The EFI_UGA_DRAW_PROTOCOL instance.
- @param HorizontalResolution The size of video screen in pixels in the X dimension.
- @param VerticalResolution The size of video screen in pixels in the Y dimension.
- @param ColorDepth Number of bits per pixel, currently defined to be 32.
- @param RefreshRate The refresh rate of the monitor in Hertz.
-
- @retval EFI_SUCCESS Mode information returned.
- @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE)(
- IN EFI_UGA_DRAW_PROTOCOL *This,
- IN UINT32 HorizontalResolution,
- IN UINT32 VerticalResolution,
- IN UINT32 ColorDepth,
- IN UINT32 RefreshRate
- );
-
-typedef struct {
- UINT8 Blue;
- UINT8 Green;
- UINT8 Red;
- UINT8 Reserved;
-} EFI_UGA_PIXEL;
-
-typedef union {
- EFI_UGA_PIXEL Pixel;
- UINT32 Raw;
-} EFI_UGA_PIXEL_UNION;
-
-///
-/// Enumration value for actions of Blt operations.
-///
-typedef enum {
- EfiUgaVideoFill, ///< Write data from the BltBuffer pixel (SourceX, SourceY)
- ///< directly to every pixel of the video display rectangle
- ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- ///< Only one pixel will be used from the BltBuffer. Delta is NOT used.
-
- EfiUgaVideoToBltBuffer, ///< Read data from the video display rectangle
- ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
- ///< the BltBuffer rectangle (DestinationX, DestinationY )
- ///< (DestinationX + Width, DestinationY + Height). If DestinationX or
- ///< DestinationY is not zero then Delta must be set to the length in bytes
- ///< of a row in the BltBuffer.
-
- EfiUgaBltBufferToVideo, ///< Write data from the BltBuffer rectangle
- ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
- ///< video display rectangle (DestinationX, DestinationY)
- ///< (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
- ///< not zero then Delta must be set to the length in bytes of a row in the
- ///< BltBuffer.
-
- EfiUgaVideoToVideo, ///< Copy from the video display rectangle (SourceX, SourceY)
- ///< (SourceX + Width, SourceY + Height) .to the video display rectangle
- ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
- ///< The BltBuffer and Delta are not used in this mode.
-
- EfiUgaBltMax ///< Maxmimum value for enumration value of Blt operation. If a Blt operation
- ///< larger or equal to this enumration value, it is invalid.
-} EFI_UGA_BLT_OPERATION;
-
-/**
- Blt a rectangle of pixels on the graphics screen.
-
- @param[in] This - Protocol instance pointer.
- @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
- buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
- @param[in] BltOperation - Operation to perform on BlitBuffer and video memory
- @param[in] SourceX - X coordinate of source for the BltBuffer.
- @param[in] SourceY - Y coordinate of source for the BltBuffer.
- @param[in] DestinationX - X coordinate of destination for the BltBuffer.
- @param[in] DestinationY - Y coordinate of destination for the BltBuffer.
- @param[in] Width - Width of rectangle in BltBuffer in pixels.
- @param[in] Height - Hight of rectangle in BltBuffer in pixels.
- @param[in] Delta - OPTIONAL
-
- @retval EFI_SUCCESS - The Blt operation completed.
- @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
- @retval EFI_DEVICE_ERROR - A hardware error occurred writting to the video buffer.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT)(
- IN EFI_UGA_DRAW_PROTOCOL *This,
- IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
- IN EFI_UGA_BLT_OPERATION BltOperation,
- IN UINTN SourceX,
- IN UINTN SourceY,
- IN UINTN DestinationX,
- IN UINTN DestinationY,
- IN UINTN Width,
- IN UINTN Height,
- IN UINTN Delta OPTIONAL
- );
-
-///
-/// This protocol provides a basic abstraction to set video modes and
-/// copy pixels to and from the graphics controller's frame buffer.
-///
-struct _EFI_UGA_DRAW_PROTOCOL {
- EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;
- EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;
- EFI_UGA_DRAW_PROTOCOL_BLT Blt;
-};
-
-extern EFI_GUID gEfiUgaDrawProtocolGuid;
-
-#endif
diff --git a/MdePkg/Include/Protocol/UgaIo.h b/MdePkg/Include/Protocol/UgaIo.h
deleted file mode 100644
index ffc5b3a..0000000
--- a/MdePkg/Include/Protocol/UgaIo.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/** @file
- UGA IO protocol from the EFI 1.10 specification.
-
- Abstraction of a very simple graphics device.
-
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef __UGA_IO_H__
-#define __UGA_IO_H__
-
-#define EFI_UGA_IO_PROTOCOL_GUID \
- { 0x61a4d49e, 0x6f68, 0x4f1b, { 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0xb, 0x7, 0xa2 } }
-
-typedef struct _EFI_UGA_IO_PROTOCOL EFI_UGA_IO_PROTOCOL;
-
-typedef UINT32 UGA_STATUS;
-
-typedef enum {
- UgaDtParentBus = 1,
- UgaDtGraphicsController,
- UgaDtOutputController,
- UgaDtOutputPort,
- UgaDtOther
-} UGA_DEVICE_TYPE, *PUGA_DEVICE_TYPE;
-
-typedef UINT32 UGA_DEVICE_ID, *PUGA_DEVICE_ID;
-
-typedef struct {
- UGA_DEVICE_TYPE deviceType;
- UGA_DEVICE_ID deviceId;
- UINT32 ui32DeviceContextSize;
- UINT32 ui32SharedContextSize;
-} UGA_DEVICE_DATA, *PUGA_DEVICE_DATA;
-
-typedef struct _UGA_DEVICE {
- VOID *pvDeviceContext;
- VOID *pvSharedContext;
- VOID *pvRunTimeContext;
- struct _UGA_DEVICE *pParentDevice;
- VOID *pvBusIoServices;
- VOID *pvStdIoServices;
- UGA_DEVICE_DATA deviceData;
-} UGA_DEVICE, *PUGA_DEVICE;
-
-typedef enum {
- UgaIoGetVersion = 1,
- UgaIoGetChildDevice,
- UgaIoStartDevice,
- UgaIoStopDevice,
- UgaIoFlushDevice,
- UgaIoResetDevice,
- UgaIoGetDeviceState,
- UgaIoSetDeviceState,
- UgaIoSetPowerState,
- UgaIoGetMemoryConfiguration,
- UgaIoSetVideoMode,
- UgaIoCopyRectangle,
- UgaIoGetEdidSegment,
- UgaIoDeviceChannelOpen,
- UgaIoDeviceChannelClose,
- UgaIoDeviceChannelRead,
- UgaIoDeviceChannelWrite,
- UgaIoGetPersistentDataSize,
- UgaIoGetPersistentData,
- UgaIoSetPersistentData,
- UgaIoGetDevicePropertySize,
- UgaIoGetDeviceProperty,
- UgaIoBtPrivateInterface
-} UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;
-
-typedef struct {
- IN UGA_IO_REQUEST_CODE ioRequestCode;
- IN VOID *pvInBuffer;
- IN UINT64 ui64InBufferSize;
- OUT VOID *pvOutBuffer;
- IN UINT64 ui64OutBufferSize;
- OUT UINT64 ui64BytesReturned;
-} UGA_IO_REQUEST, *PUGA_IO_REQUEST;
-
-/**
- Dynamically allocate storage for a child UGA_DEVICE.
-
- @param[in] This The EFI_UGA_IO_PROTOCOL instance.
- @param[in] ParentDevice ParentDevice specifies a pointer to the parent device of Device.
- @param[in] DeviceData A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()
- with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice.
- @param[in] RunTimeContext Context to associate with Device.
- @param[out] Device The Device returns a dynamically allocated child UGA_DEVICE object
- for ParentDevice. The caller is responsible for deleting Device.
-
-
- @retval EFI_SUCCESS Device was returned.
- @retval EFI_INVALID_PARAMETER One of the arguments was not valid.
- @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_IO_PROTOCOL_CREATE_DEVICE)(
- IN EFI_UGA_IO_PROTOCOL *This,
- IN UGA_DEVICE *ParentDevice,
- IN UGA_DEVICE_DATA *DeviceData,
- IN VOID *RunTimeContext,
- OUT UGA_DEVICE **Device
- );
-
-/**
- Delete a dynamically allocated child UGA_DEVICE object that was allocated via CreateDevice().
-
- @param[in] This The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is
- defined in Section 10.7.
- @param[in] Device The Device points to a UGA_DEVICE object that was dynamically
- allocated via a CreateDevice() call.
-
-
- @retval EFI_SUCCESS Device was returned.
- @retval EFI_INVALID_PARAMETER The Device was not allocated via CreateDevice().
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_UGA_IO_PROTOCOL_DELETE_DEVICE)(
- IN EFI_UGA_IO_PROTOCOL *This,
- IN UGA_DEVICE *Device
- );
-
-/**
- This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.
-
- @param pDevice pDevice specifies a pointer to a device object associated with a
- device enumerated by a pIoRequest->ioRequestCode of type
- UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL
- is represented by pDevice being set to NULL.
-
- @param pIoRequest
- pIoRequest points to a caller allocated buffer that contains data
- defined by pIoRequest->ioRequestCode. See Related Definitions for
- a definition of UGA_IO_REQUEST_CODE s and their associated data
- structures.
-
- @return UGA_STATUS
-
-**/
-typedef UGA_STATUS
-(EFIAPI *PUGA_FW_SERVICE_DISPATCH)(
- IN PUGA_DEVICE pDevice,
- IN OUT PUGA_IO_REQUEST pIoRequest
- );
-
-///
-/// Provides a basic abstraction to send I/O requests to the graphics device and any of its children.
-///
-struct _EFI_UGA_IO_PROTOCOL {
- EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;
- EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;
- PUGA_FW_SERVICE_DISPATCH DispatchService;
-};
-
-extern EFI_GUID gEfiUgaIoProtocolGuid;
-
-//
-// Data structure that is stored in the EFI Configuration Table with the
-// EFI_UGA_IO_PROTOCOL_GUID. The option ROMs listed in this table may have
-// EBC UGA drivers.
-//
-typedef struct {
- UINT32 Version;
- UINT32 HeaderSize;
- UINT32 SizeOfEntries;
- UINT32 NumberOfEntries;
-} EFI_DRIVER_OS_HANDOFF_HEADER;
-
-typedef enum {
- EfiUgaDriverFromPciRom,
- EfiUgaDriverFromSystem,
- EfiDriverHandoffMax
-} EFI_DRIVER_HANOFF_ENUM;
-
-typedef struct {
- EFI_DRIVER_HANOFF_ENUM Type;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- VOID *PciRomImage;
- UINT64 PciRomSize;
-} EFI_DRIVER_OS_HANDOFF;
-
-#endif
diff --git a/MdePkg/Library/UefiLib/UefiLib.inf b/MdePkg/Library/UefiLib/UefiLib.inf
index 3aced47..8a35276 100644
--- a/MdePkg/Library/UefiLib/UefiLib.inf
+++ b/MdePkg/Library/UefiLib/UefiLib.inf
@@ -68,7 +68,6 @@
gEfiGraphicsOutputProtocolGuid ## SOMETIMES_CONSUMES
gEfiHiiFontProtocolGuid ## SOMETIMES_CONSUMES
gEfiSimpleFileSystemProtocolGuid ## SOMETIMES_CONSUMES
- gEfiUgaDrawProtocolGuid | gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## SOMETIMES_CONSUMES # Consumes if gEfiGraphicsOutputProtocolGuid uninstalled
gEfiComponentNameProtocolGuid | NOT gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable ## SOMETIMES_PRODUCES # User chooses to produce it
gEfiComponentName2ProtocolGuid | NOT gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable ## SOMETIMES_PRODUCES # User chooses to produce it
gEfiDriverConfigurationProtocolGuid ## SOMETIMES_PRODUCES # User chooses to produce it
@@ -85,5 +84,4 @@
gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable ## CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable ## CONSUMES
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES
diff --git a/MdePkg/Library/UefiLib/UefiLibInternal.h b/MdePkg/Library/UefiLib/UefiLibInternal.h
index 4365282..b98f66e 100644
--- a/MdePkg/Library/UefiLib/UefiLibInternal.h
+++ b/MdePkg/Library/UefiLib/UefiLibInternal.h
@@ -18,7 +18,6 @@
#include <Protocol/DriverDiagnostics2.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/GraphicsOutput.h>
-#include <Protocol/UgaDraw.h>
#include <Protocol/HiiFont.h>
#include <Guid/EventGroup.h>
diff --git a/MdePkg/Library/UefiLib/UefiLibPrint.c b/MdePkg/Library/UefiLib/UefiLibPrint.c
index c2c6cac..32b17ab 100644
--- a/MdePkg/Library/UefiLib/UefiLibPrint.c
+++ b/MdePkg/Library/UefiLib/UefiLibPrint.c
@@ -352,20 +352,14 @@ InternalPrintGraphic (
EFI_STATUS Status;
UINT32 HorizontalResolution;
UINT32 VerticalResolution;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
EFI_HII_FONT_PROTOCOL *HiiFont;
EFI_IMAGE_OUTPUT *Blt;
EFI_FONT_DISPLAY_INFO FontInfo;
EFI_HII_ROW_INFO *RowInfoArray;
UINTN RowInfoArraySize;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Sto;
EFI_HANDLE ConsoleHandle;
- UINTN Width;
- UINTN Height;
- UINTN Delta;
HorizontalResolution = 0;
VerticalResolution = 0;
@@ -381,21 +375,6 @@ InternalPrintGraphic (
&gEfiGraphicsOutputProtocolGuid,
(VOID **)&GraphicsOutput
);
-
- UgaDraw = NULL;
- if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // If no GOP available, try to open UGA Draw protocol if supported.
- //
- GraphicsOutput = NULL;
-
- Status = gBS->HandleProtocol (
- ConsoleHandle,
- &gEfiUgaDrawProtocolGuid,
- (VOID **)&UgaDraw
- );
- }
-
if (EFI_ERROR (Status)) {
goto Error;
}
@@ -413,8 +392,6 @@ InternalPrintGraphic (
if (GraphicsOutput != NULL) {
HorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;
VerticalResolution = GraphicsOutput->Mode->Info->VerticalResolution;
- } else if ((UgaDraw != NULL) && FeaturePcdGet (PcdUgaConsumeSupport)) {
- UgaDraw->GetMode (UgaDraw, &HorizontalResolution, &VerticalResolution, &ColorDepth, &RefreshRate);
} else {
goto Error;
}
@@ -478,73 +455,6 @@ InternalPrintGraphic (
if (EFI_ERROR (Status)) {
goto Error;
}
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- ASSERT (UgaDraw != NULL);
-
- //
- // Ensure Width * Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow.
- //
- if (Blt->Width > DivU64x32 (MAX_UINTN, Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL))) {
- goto Error;
- }
-
- Blt->Image.Bitmap = AllocateZeroPool ((UINT32)Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- ASSERT (Blt->Image.Bitmap != NULL);
-
- //
- // StringToImage only support blt'ing image to device using GOP protocol. If GOP is not supported in this platform,
- // we ask StringToImage to print the string to blt buffer, then blt to device using UgaDraw.
- //
- Status = HiiFont->StringToImage (
- HiiFont,
- EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_OUT_FLAG_CLIP |
- EFI_HII_OUT_FLAG_CLIP_CLEAN_X | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y |
- EFI_HII_IGNORE_LINE_BREAK,
- Buffer,
- &FontInfo,
- &Blt,
- PointX,
- PointY,
- &RowInfoArray,
- &RowInfoArraySize,
- NULL
- );
-
- if (!EFI_ERROR (Status)) {
- ASSERT (RowInfoArray != NULL);
- //
- // Explicit Line break characters are ignored, so the updated parameter RowInfoArraySize by StringToImage will
- // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure.
- //
- ASSERT (RowInfoArraySize <= 1);
-
- if (RowInfoArraySize != 0) {
- Width = RowInfoArray[0].LineWidth;
- Height = RowInfoArray[0].LineHeight;
- Delta = Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
- } else {
- Width = 0;
- Height = 0;
- Delta = 0;
- }
-
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *)Blt->Image.Bitmap,
- EfiUgaBltBufferToVideo,
- PointX,
- PointY,
- PointX,
- PointY,
- Width,
- Height,
- Delta
- );
- } else {
- goto Error;
- }
-
- FreePool (Blt->Image.Bitmap);
} else {
goto Error;
}
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 43b0973..ea8bf0f 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -612,6 +612,9 @@
## Include/Protocol/UserManager.h
gEfiUserInfoAccessSetupRestrictedGuid = { 0xbdb38125, 0x4d63, 0x49f4, { 0x82, 0x12, 0x61, 0xcf, 0x5a, 0x19, 0xa, 0xf8 }}
+ ## Include/Guid/FdtHob.h
+ gFdtHobGuid = { 0x16958446, 0x19B7, 0x480B, { 0xB0, 0x47, 0x74, 0x85, 0xAD, 0x3F, 0x71, 0x6D } }
+
## Include/Guid/ImageAuthentication.h
gEfiImageSecurityDatabaseGuid = { 0xd719b2cb, 0x3d3a, 0x4596, {0xa3, 0xbc, 0xda, 0xd0, 0xe, 0x67, 0x65, 0x6f }}
gEfiCertSha256Guid = { 0xc1c41626, 0x504c, 0x4092, {0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28 }}
@@ -1582,12 +1585,6 @@
## Include/Protocol/EdidOverride.h
gEfiEdidOverrideProtocolGuid = { 0x48ECB431, 0xFB72, 0x45C0, { 0xA9, 0x22, 0xF4, 0x58, 0xFE, 0x04, 0x0B, 0xD5 }}
- ## Include/Protocol/UgaIo.h
- gEfiUgaIoProtocolGuid = { 0x61A4D49E, 0x6F68, 0x4F1B, { 0xB9, 0x22, 0xA8, 0x6E, 0xED, 0x0B, 0x07, 0xA2 }}
-
- ## Include/Protocol/UgaDraw.h
- gEfiUgaDrawProtocolGuid = { 0x982C298B, 0xF4FA, 0x41CB, { 0xB8, 0x38, 0x77, 0xAA, 0x68, 0x8F, 0xB8, 0x39 }}
-
## Include/Protocol/LoadedImage.h
gEfiLoadedImageProtocolGuid = { 0x5B1B31A1, 0x9562, 0x11D2, { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }}
@@ -2078,12 +2075,6 @@
# @Prompt Deprecate Global Variable LangCodes.
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDeprecate|FALSE|BOOLEAN|0x00000012
- ## Indicates if UGA Draw Protocol is still consumed.<BR><BR>
- # TRUE - Consume UGA Draw protocol.<BR>
- # FALSE - Does not consume UGA Draw protocol.<BR>
- # @Prompt Consume UGA Draw Protocol.
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|TRUE|BOOLEAN|0x00000027
-
## Indicates if a check will be made to see if a specified node is a member of linked list
# in the following BaseLib functions: GetNextNode(), IsNull(), IsNodeAtEnd(), SwapListEntries().<BR><BR>
# TRUE - Verify a specified node is a member of linked list.<BR>
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index 2abd7b8..066507b 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -24,9 +24,6 @@
!include MdePkg/MdeLibs.dsc.inc
-[PcdsFeatureFlag]
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|TRUE
-
[PcdsFixedAtBuild]
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
diff --git a/MdePkg/MdePkg.uni b/MdePkg/MdePkg.uni
index 67b79f0..eaf1b9e 100644
--- a/MdePkg/MdePkg.uni
+++ b/MdePkg/MdePkg.uni
@@ -379,12 +379,6 @@
"TRUE - Deprecate global variable LangCodes.<BR>\n"
"FALSE - Does not deprecate global variable LangCodes.<BR>"
-#string STR_gEfiMdePkgTokenSpaceGuid_PcdUgaConsumeSupport_PROMPT #language en-US "Consume UGA Draw Protocol"
-
-#string STR_gEfiMdePkgTokenSpaceGuid_PcdUgaConsumeSupport_HELP #language en-US "Indicates if UGA Draw Protocol is still consumed.<BR><BR>\n"
- "TRUE - Consume UGA Draw protocol.<BR>\n"
- "FALSE - Does not consume UGA Draw protocol.<BR>"
-
#string STR_gEfiMdePkgTokenSpaceGuid_PcdVerifyNodeInList_PROMPT #language en-US "Verify Node In List"
#string STR_gEfiMdePkgTokenSpaceGuid_PcdVerifyNodeInList_HELP #language en-US "Indicates if a check will be made to see if a specified node is a member of linked list in the following BaseLib functions: GetNextNode(), IsNull(), IsNodeAtEnd(), SwapListEntries().<BR><BR>\n"
diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index 3592381..8e7e69d 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -386,7 +386,6 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
[PcdsFixedAtBuild]
diff --git a/OvmfPkg/Bhyve/BhyveRfbDxe/GopScreen.c b/OvmfPkg/Bhyve/BhyveRfbDxe/GopScreen.c
index 2fcc1dd..8f49843 100644
--- a/OvmfPkg/Bhyve/BhyveRfbDxe/GopScreen.c
+++ b/OvmfPkg/Bhyve/BhyveRfbDxe/GopScreen.c
@@ -13,7 +13,7 @@ Module Name:
Abstract:
- This file produces the graphics abstration of UGA. It is called by
+ This file produces the graphics abstration of GOP. It is called by
EmuGopDriver.c file which deals with the EFI 1.1 driver model.
This file just does graphics.
@@ -378,7 +378,7 @@ ShutdownGopEvent (
Routine Description:
- This is the UGA screen's callback notification function for exit-boot-services.
+ This is the GOP screen's callback notification function for exit-boot-services.
All we do here is call EmuGopDestructor().
Arguments:
diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index c465863..131f16f 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -432,7 +432,6 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
!if $(SECURE_BOOT_ENABLE) == TRUE
gEfiMdeModulePkgTokenSpaceGuid.PcdRequireSelfSignedPk|TRUE
diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc
index d6db3ee..d941d6d 100644
--- a/OvmfPkg/CloudHv/CloudHvX64.dsc
+++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
@@ -477,7 +477,6 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
!if $(SMM_REQUIRE) == TRUE
gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire|TRUE
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
index 637dc7d..18fd116 100644
--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
@@ -377,7 +377,6 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
!if $(SECURE_BOOT_ENABLE) == TRUE
gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootSupported|TRUE
diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
index 0be04cb..f07e994e 100644
--- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
+++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
@@ -235,7 +235,9 @@ DebugAssert (
//
// Send the string to Memory Debug Log
//
- MemDebugLogWrite (Buffer, Length);
+ if (MemDebugLogEnabled ()) {
+ MemDebugLogWrite (Buffer, Length);
+ }
//
// Generate a Breakpoint, DeadLoop, or NOP based on PCD settings
diff --git a/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc b/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc
index 3f16e20..df6a6e1 100644
--- a/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc
+++ b/OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc
@@ -314,7 +314,6 @@
# gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory | TRUE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress | TRUE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport | TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport | FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdPciBusHotplugDeviceSupport | FALSE
gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation | TRUE
gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation | TRUE
diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
index d470ffb..884d5a9 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -470,7 +470,6 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
!if $(SECURE_BOOT_ENABLE) == TRUE
gUefiOvmfPkgTokenSpaceGuid.PcdSecureBootSupported|TRUE
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 86c1d6e..550c54d 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -463,7 +463,6 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
!if $(SMM_REQUIRE) == TRUE
gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire|TRUE
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 836d9ff..06fc031 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -485,7 +485,6 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
!if $(SMM_REQUIRE) == TRUE
gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire|TRUE
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 20e7358..ace2dfc 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -559,7 +559,6 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
!if $(SMM_REQUIRE) == TRUE
gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire|TRUE
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 1c797e0..4e99acb 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -363,7 +363,6 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
[PcdsFixedAtBuild]
diff --git a/OvmfPkg/PlatformCI/PlatformBuildLib.py b/OvmfPkg/PlatformCI/PlatformBuildLib.py
index 6e0b9e4..19f92ac 100644
--- a/OvmfPkg/PlatformCI/PlatformBuildLib.py
+++ b/OvmfPkg/PlatformCI/PlatformBuildLib.py
@@ -110,21 +110,8 @@ class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalSetting
The tuple should be (<workspace relative path to dsc file>, <input dictionary of dsc key value pairs>)
'''
- import re
- import sys
-
- cmd_line_input_vars = {}
- for arg in sys.argv:
- if "=" in arg:
- key, value = arg.split("=", 1)
- if key.startswith("-"):
- continue
- if re.match(r"BLD_.+_", key):
- key = re.sub(r"^BLD_.+?_", "", key, count=1)
- cmd_line_input_vars[key] = value
-
dsc = CommonPlatform.GetDscName(",".join(self.ActualArchitectures))
- return (f"OvmfPkg/{dsc}", cmd_line_input_vars)
+ return (f"OvmfPkg/{dsc}", {})
# ####################################################################################### #
diff --git a/OvmfPkg/PlatformDxe/Platform.c b/OvmfPkg/PlatformDxe/Platform.c
index 5b3e566..aee5a39 100644
--- a/OvmfPkg/PlatformDxe/Platform.c
+++ b/OvmfPkg/PlatformDxe/Platform.c
@@ -13,6 +13,8 @@
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/HiiLib.h>
+#include <Library/HobLib.h>
+#include <Library/MemDebugLogLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
@@ -944,6 +946,28 @@ GopInstalled (
}
/**
+ If a memory debug log buffer is present, register the buffer location as
+ config table so the OS can find and show it.
+**/
+VOID
+EFIAPI
+MemDebugLogInstallTable (
+ VOID
+ )
+{
+ EFI_HOB_GUID_TYPE *GuidHob;
+ MEM_DEBUG_LOG_HOB_DATA *HobData;
+ VOID *LogBuffer;
+
+ GuidHob = GetFirstGuidHob (&gMemDebugLogHobGuid);
+ if (GuidHob != NULL) {
+ HobData = (MEM_DEBUG_LOG_HOB_DATA *)GET_GUID_HOB_DATA (GuidHob);
+ LogBuffer = (VOID *)(UINTN)HobData->MemDebugLogBufAddr;
+ gBS->InstallConfigurationTable (&gMemDebugLogHobGuid, LogBuffer);
+ }
+}
+
+/**
Entry point for this driver.
@param[in] ImageHandle Image handle of this driver.
@@ -1030,6 +1054,8 @@ PlatformInit (
Status = gBS->SignalEvent (mGopEvent);
ASSERT_EFI_ERROR (Status);
+ MemDebugLogInstallTable ();
+
return EFI_SUCCESS;
CloseGopEvent:
diff --git a/OvmfPkg/PlatformDxe/Platform.inf b/OvmfPkg/PlatformDxe/Platform.inf
index dd22c4f..4b5a255 100644
--- a/OvmfPkg/PlatformDxe/Platform.inf
+++ b/OvmfPkg/PlatformDxe/Platform.inf
@@ -36,6 +36,7 @@
DebugLib
DevicePathLib
HiiLib
+ HobLib
MemoryAllocationLib
PrintLib
UefiBootServicesTableLib
@@ -59,6 +60,7 @@
[Guids]
gEfiIfrTianoGuid
gOvmfPlatformConfigGuid
+ gMemDebugLogHobGuid
[Depex]
gEfiHiiConfigRoutingProtocolGuid AND
diff --git a/OvmfPkg/RiscVVirt/RiscVVirt.fdf.inc b/OvmfPkg/RiscVVirt/RiscVVirt.fdf.inc
index eba6123..6db361e 100644
--- a/OvmfPkg/RiscVVirt/RiscVVirt.fdf.inc
+++ b/OvmfPkg/RiscVVirt/RiscVVirt.fdf.inc
@@ -34,6 +34,5 @@ DEFINE VARS_FTW_WORKING_SIZE = 0x00040000
DEFINE VARS_FTW_SPARE_OFFSET = $(VARS_FTW_WORKING_OFFSET) + $(VARS_FTW_WORKING_SIZE)
DEFINE VARS_FTW_SPARE_SIZE = 0x00040000
-SET gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency = 10000000
SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase = 0x83FF0000
SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize = 0x00010000
diff --git a/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc b/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc
index 03bdbf4..b4f24ee 100644
--- a/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc
+++ b/OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc
@@ -172,7 +172,6 @@
## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
# It could be set FALSE to save size.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index 51b7783..14f1725 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -2308,8 +2308,6 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
{ STRING_TOKEN (STR_SHELL_ENV2), &gEfiShellEnvironment2Guid, NULL },
{ STRING_TOKEN (STR_SHELL_ENV), &gEfiShellEnvironment2Guid, NULL },
{ STRING_TOKEN (STR_DEVICE_IO), &gEfiDeviceIoProtocolGuid, NULL },
- { STRING_TOKEN (STR_UGA_DRAW), &gEfiUgaDrawProtocolGuid, NULL },
- { STRING_TOKEN (STR_UGA_IO), &gEfiUgaIoProtocolGuid, NULL },
{ STRING_TOKEN (STR_ESP), &gEfiPartTypeSystemPartGuid, NULL },
{ STRING_TOKEN (STR_GPT_NBR), &gEfiPartTypeLegacyMbrGuid, NULL },
{ STRING_TOKEN (STR_DRIVER_CONFIG), &gEfiDriverConfigurationProtocolGuid, NULL },
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
index 4c3ed14..40eed67 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
@@ -93,8 +93,6 @@
#include <Protocol/HiiConfigAccess.h>
#include <Protocol/FormBrowser2.h>
#include <Protocol/DeviceIo.h>
-#include <Protocol/UgaDraw.h>
-#include <Protocol/UgaIo.h>
#include <Protocol/DriverConfiguration.h>
#include <Protocol/DriverConfiguration2.h>
#include <Protocol/DevicePathUtilities.h>
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
index 6e1ed77..0cc0ce9 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
@@ -128,8 +128,6 @@
gEfiHiiConfigAccessProtocolGuid ## UNDEFINED
gEfiFormBrowser2ProtocolGuid ## UNDEFINED
gEfiDeviceIoProtocolGuid ## UNDEFINED
- gEfiUgaDrawProtocolGuid ## UNDEFINED
- gEfiUgaIoProtocolGuid ## UNDEFINED
gEfiDriverConfigurationProtocolGuid ## UNDEFINED
gEfiDriverConfiguration2ProtocolGuid ## UNDEFINED
gEfiSimpleTextInputExProtocolGuid ## UNDEFINED
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index dcd1b23..7f5d2a3 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -160,8 +160,6 @@
#string STR_SHELL_ALIAS #language en-US "ShellAlias"
#string STR_DEVICE_IO #language en-US "DeviceIO"
#string STR_TCP #language en-US "TCP"
-#string STR_UGA_DRAW #language en-US "UGADraw"
-#string STR_UGA_IO #language en-US "UGAIO"
#string STR_ESP #language en-US "EFISystemPartition"
#string STR_GPT_NBR #language en-US "LegacyMBR"
#string STR_DRIVER_CONFIG #language en-US "DriverConfiguration"
diff --git a/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.c b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.c
index ba0b2ec..f5b1d2a 100644
--- a/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.c
+++ b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.c
@@ -33,188 +33,7 @@ EFI_MM_COMMUNICATION_PROTOCOL mMmCommunication = {
MM_COMM_BUFFER mMmCommonBuffer;
EFI_SMM_CONTROL2_PROTOCOL *mSmmControl2;
EFI_SMM_ACCESS2_PROTOCOL *mSmmAccess;
-BOOLEAN mSmmLocked = FALSE;
-BOOLEAN mEndOfDxe = FALSE;
-
-//
-// Table of Protocol notification and GUIDed Event notifications that the Standalone Mm requires
-//
-MM_EVENT_NOTIFICATION mMmEvents[] = {
- //
- // Declare protocol notification on DxeMmReadyToLock protocols. When this notification is established,
- // the associated event is immediately signalled, so the notification function will be executed and the
- // DXE Mm Ready To Lock Protocol will be found if it is already in the handle database.
- //
- { ProtocolNotify, TRUE, &gEfiDxeMmReadyToLockProtocolGuid, MmReadyToLockEventNotify, &gEfiDxeMmReadyToLockProtocolGuid, NULL },
- //
- // Declare event notification on Ready To Boot Event Group. This is an extra event notification that is
- // used to make sure SMRAM is locked before any boot options are processed.
- //
- { EventNotify, TRUE, &gEfiEventReadyToBootGuid, MmReadyToLockEventNotify, &gEfiEventReadyToBootGuid, NULL },
- //
- // Declare event notification on Ready To Boot Event Group. This is used to inform the MM Core
- // to notify MM driver that system enter ready to boot.
- //
- { EventNotify, FALSE, &gEfiEventReadyToBootGuid, MmGuidedEventNotify, &gEfiEventReadyToBootGuid, NULL },
- //
- // Declare event notification on EndOfDxe event. When this notification is established,
- // the associated event is immediately signalled, so the notification function will be executed and the
- // End Of Dxe Protocol will be found if it is already in the handle database.
- //
- { EventNotify, TRUE, &gEfiEndOfDxeEventGroupGuid, MmGuidedEventNotify, &gEfiEndOfDxeEventGroupGuid, NULL },
- //
- // Declare event notification on EndOfDxe event. This is used to set EndOfDxe event signaled flag.
- //
- { EventNotify, TRUE, &gEfiEndOfDxeEventGroupGuid, MmEndOfDxeEventNotify, &gEfiEndOfDxeEventGroupGuid, NULL },
- //
- // Declare event notification on Exit Boot Services Event Group. This is used to inform the MM Core
- // to notify MM driver that system enter exit boot services.
- //
- { EventNotify, FALSE, &gEfiEventExitBootServicesGuid, MmGuidedEventNotify, &gEfiEventExitBootServicesGuid, NULL },
- //
- // Declare event notification on SetVirtualAddressMap() Event Group. This is used to convert fixed MM communication buffer
- // and MM_COMM_BUFFER_STATUS in mMmCommonBuffer, mSmmControl2 from physical addresses to virtual addresses.
- //
- { EventNotify, FALSE, &gEfiEventVirtualAddressChangeGuid, MmVirtualAddressChangeEvent, NULL, NULL },
- //
- // Terminate the table of event notifications
- //
- { EndNotify, FALSE, NULL, NULL, NULL, NULL }
-};
-
-/**
- Event notification that is fired when GUIDed Event Group is signaled.
-
- @param Event The Event that is being processed, not used.
- @param Context Event Context, not used.
-
-**/
-VOID
-EFIAPI
-MmGuidedEventNotify (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- UINTN Size;
- EFI_MM_COMMUNICATE_HEADER *CommunicateHeader;
-
- CommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *)(UINTN)mMmCommonBuffer.PhysicalStart;
-
- //
- // Use Guid to initialize EFI_MM_COMMUNICATE_HEADER structure
- //
- CopyGuid (&CommunicateHeader->HeaderGuid, (EFI_GUID *)Context);
- CommunicateHeader->MessageLength = 1;
- CommunicateHeader->Data[0] = 0;
-
- //
- // Generate the Software SMI and return the result
- //
- Size = sizeof (EFI_MM_COMMUNICATE_HEADER);
- MmCommunicate2 (&mMmCommunication2, CommunicateHeader, CommunicateHeader, &Size);
-}
-
-/**
- Event notification that is fired every time a DxeSmmReadyToLock protocol is added
- or if gEfiEventReadyToBootGuid is signaled.
-
- @param Event The Event that is being processed, not used.
- @param Context Event Context, not used.
-
-**/
-VOID
-EFIAPI
-MmReadyToLockEventNotify (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- EFI_STATUS Status;
- VOID *Interface;
- UINTN Index;
-
- //
- // See if we are already locked
- //
- if (mSmmLocked) {
- return;
- }
-
- //
- // Make sure this notification is for this handler
- //
- if (CompareGuid ((EFI_GUID *)Context, &gEfiDxeMmReadyToLockProtocolGuid)) {
- Status = gBS->LocateProtocol (&gEfiDxeMmReadyToLockProtocolGuid, NULL, &Interface);
- if (EFI_ERROR (Status)) {
- return;
- }
- } else {
- //
- // If MM is not locked yet and we got here from gEfiEventReadyToBootGuid being
- // signaled, then gEfiDxeMmReadyToLockProtocolGuid was not installed as expected.
- // Print a warning on debug builds.
- //
- DEBUG ((DEBUG_WARN, "DXE Mm Ready To Lock Protocol not installed before Ready To Boot signal\n"));
- }
-
- if (!mEndOfDxe) {
- DEBUG ((DEBUG_ERROR, "EndOfDxe Event must be signaled before DxeSmmReadyToLock Protocol installation!\n"));
- REPORT_STATUS_CODE (
- EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED,
- (EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)
- );
- ASSERT (FALSE);
- }
-
- //
- // Lock the SMRAM (Note: Locking SMRAM may not be supported on all platforms)
- //
- mSmmAccess->Lock (mSmmAccess);
-
- //
- // Close protocol and event notification events that do not apply after the
- // DXE MM Ready To Lock Protocol has been installed or the Ready To Boot
- // event has been signalled.
- //
- for (Index = 0; mMmEvents[Index].NotifyFunction != NULL; Index++) {
- if (mMmEvents[Index].CloseOnLock) {
- gBS->CloseEvent (mMmEvents[Index].Event);
- }
- }
-
- //
- // Inform MM Core that the DxeSmmReadyToLock protocol was installed
- //
- MmGuidedEventNotify (Event, (VOID *)&gEfiDxeMmReadyToLockProtocolGuid);
-
- //
- // Print debug message that the SMRAM window is now locked.
- //
- DEBUG ((DEBUG_INFO, "MmCommunicationDxe locked SMRAM window\n"));
-
- //
- // Set flag so this operation will not be performed again
- //
- mSmmLocked = TRUE;
-}
-
-/**
- Event notification that is fired when EndOfDxe Event Group is signaled.
-
- @param Event The Event that is being processed, not used.
- @param Context Event Context, not used.
-
-**/
-VOID
-EFIAPI
-MmEndOfDxeEventNotify (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- mEndOfDxe = TRUE;
-}
+EFI_EVENT mVirtualAddressChangeEvent = NULL;
/**
Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE.
@@ -458,8 +277,6 @@ MmCommunicationEntryPoint (
EFI_HANDLE Handle;
EFI_HOB_GUID_TYPE *GuidHob;
MM_COMM_BUFFER *MmCommonBuffer;
- UINTN Index;
- VOID *Registration;
//
// Locate gMmCommBufferHobGuid and cache the content
@@ -507,29 +324,16 @@ MmCommunicationEntryPoint (
ASSERT_EFI_ERROR (Status);
//
- // Create the set of protocol and event notifications that the Standalone Mm requires
+ // Register the event to convert the pointer for runtime.
//
- for (Index = 0; mMmEvents[Index].NotificationType != EndNotify; Index++) {
- if (mMmEvents[Index].NotificationType == ProtocolNotify) {
- mMmEvents[Index].Event = EfiCreateProtocolNotifyEvent (
- mMmEvents[Index].Guid,
- TPL_CALLBACK,
- mMmEvents[Index].NotifyFunction,
- mMmEvents[Index].NotifyContext,
- &Registration
- );
- } else {
- Status = gBS->CreateEventEx (
- EVT_NOTIFY_SIGNAL,
- TPL_CALLBACK,
- mMmEvents[Index].NotifyFunction,
- mMmEvents[Index].NotifyContext,
- mMmEvents[Index].Guid,
- &mMmEvents[Index].Event
- );
- ASSERT_EFI_ERROR (Status);
- }
- }
+ gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_NOTIFY,
+ MmVirtualAddressChangeEvent,
+ NULL,
+ &gEfiEventVirtualAddressChangeGuid,
+ &mVirtualAddressChangeEvent
+ );
return EFI_SUCCESS;
}
diff --git a/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.h b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.h
index 3b399da..80d2bfa 100644
--- a/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.h
+++ b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.h
@@ -25,30 +25,9 @@
#include <Protocol/MmCommunication3.h>
#include <Protocol/MmCommunication2.h>
#include <Protocol/MmCommunication.h>
-#include <Protocol/DxeMmReadyToLock.h>
#include <Protocol/SmmAccess2.h>
#include <Guid/MmCommBuffer.h>
-#include <Guid/EventGroup.h>
-
-typedef enum {
- EventNotify,
- ProtocolNotify,
- EndNotify,
-} NOTIFICATION_TYPE;
-
-//
-// Data structure used to declare a table of protocol notifications and event
-// notifications required by the Standalone Mm environment
-//
-typedef struct {
- NOTIFICATION_TYPE NotificationType;
- BOOLEAN CloseOnLock;
- EFI_GUID *Guid;
- EFI_EVENT_NOTIFY NotifyFunction;
- VOID *NotifyContext;
- EFI_EVENT Event;
-} MM_EVENT_NOTIFICATION;
/**
Communicates with a registered handler.
@@ -144,49 +123,6 @@ MmCommunicate (
);
/**
- Event notification that is fired every time a DxeSmmReadyToLock protocol is added
- or if gEfiEventReadyToBootGuid is signaled.
-
- @param Event The Event that is being processed, not used.
- @param Context Event Context, not used.
-
-**/
-VOID
-EFIAPI
-MmReadyToLockEventNotify (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-
-/**
- Event notification that is fired when GUIDed Event Group is signaled.
-
- @param Event The Event that is being processed, not used.
- @param Context Event Context, not used.
-
-**/
-VOID
-EFIAPI
-MmGuidedEventNotify (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-
-/**
- Event notification that is fired when EndOfDxe Event Group is signaled.
-
- @param Event The Event that is being processed, not used.
- @param Context Event Context, not used.
-
-**/
-VOID
-EFIAPI
-MmEndOfDxeEventNotify (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-
-/**
Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE.
This is a notification function registered on EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event.
diff --git a/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.inf b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.inf
index dd5a0b1..2f23007 100644
--- a/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.inf
+++ b/StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.inf
@@ -42,8 +42,6 @@
[Guids]
gMmCommBufferHobGuid
gEfiEventVirtualAddressChangeGuid
- gEfiEndOfDxeEventGroupGuid
- gEfiEventExitBootServicesGuid
gEfiMmCommunicateHeaderV3Guid
[Protocols]
@@ -51,7 +49,6 @@
gEfiMmCommunication2ProtocolGuid
gEfiSmmControl2ProtocolGuid
gEfiMmCommunicationProtocolGuid
- gEfiDxeMmReadyToLockProtocolGuid
gEfiSmmAccess2ProtocolGuid
[Depex]
diff --git a/StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.c b/StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.c
new file mode 100644
index 0000000..8e49b53
--- /dev/null
+++ b/StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.c
@@ -0,0 +1,265 @@
+/** @file
+ MmCommunicationNotifyDxe driver creates the notifications of
+ some protocols and event.
+
+ Copyright (c) 2025, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "MmCommunicationNotifyDxe.h"
+
+//
+// PI 1.7 MM Communication Protocol 2 instance
+//
+EFI_MM_COMMUNICATION2_PROTOCOL *mMmCommunication2;
+MM_COMM_BUFFER mMmCommonBuffer;
+EFI_SMM_ACCESS2_PROTOCOL *mSmmAccess;
+BOOLEAN mSmmLocked = FALSE;
+BOOLEAN mEndOfDxe = FALSE;
+
+//
+// Table of Protocol notification and GUIDed Event notifications that the Standalone Mm requires
+//
+MM_EVENT_NOTIFICATION mMmEvents[] = {
+ //
+ // Declare protocol notification on DxeMmReadyToLock protocols. When this notification is established,
+ // the associated event is immediately signalled, so the notification function will be executed and the
+ // DXE Mm Ready To Lock Protocol will be found if it is already in the handle database.
+ //
+ { ProtocolNotify, TRUE, &gEfiDxeMmReadyToLockProtocolGuid, MmReadyToLockEventNotify, &gEfiDxeMmReadyToLockProtocolGuid, NULL },
+ //
+ // Declare event notification on Ready To Boot Event Group. This is an extra event notification that is
+ // used to make sure SMRAM is locked before any boot options are processed.
+ //
+ { EventNotify, TRUE, &gEfiEventReadyToBootGuid, MmReadyToLockEventNotify, &gEfiEventReadyToBootGuid, NULL },
+ //
+ // Declare event notification on Ready To Boot Event Group. This is used to inform the MM Core
+ // to notify MM driver that system enter ready to boot.
+ //
+ { EventNotify, FALSE, &gEfiEventReadyToBootGuid, MmGuidedEventNotify, &gEfiEventReadyToBootGuid, NULL },
+ //
+ // Declare event notification on EndOfDxe event. When this notification is established,
+ // the associated event is immediately signalled, so the notification function will be executed and the
+ // End Of Dxe Protocol will be found if it is already in the handle database.
+ //
+ { EventNotify, TRUE, &gEfiEndOfDxeEventGroupGuid, MmGuidedEventNotify, &gEfiEndOfDxeEventGroupGuid, NULL },
+ //
+ // Declare event notification on EndOfDxe event. This is used to set EndOfDxe event signaled flag.
+ //
+ { EventNotify, TRUE, &gEfiEndOfDxeEventGroupGuid, MmEndOfDxeEventNotify, &gEfiEndOfDxeEventGroupGuid, NULL },
+ //
+ // Declare event notification on Exit Boot Services Event Group. This is used to inform the MM Core
+ // to notify MM driver that system enter exit boot services.
+ //
+ { EventNotify, FALSE, &gEfiEventExitBootServicesGuid, MmGuidedEventNotify, &gEfiEventExitBootServicesGuid, NULL },
+ //
+ // Terminate the table of event notifications
+ //
+ { EndNotify, FALSE, NULL, NULL, NULL, NULL }
+};
+
+/**
+ Event notification that is fired when GUIDed Event Group is signaled.
+
+ @param Event The Event that is being processed, not used.
+ @param Context Event Context, not used.
+
+**/
+VOID
+EFIAPI
+MmGuidedEventNotify (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ UINTN Size;
+ EFI_MM_COMMUNICATE_HEADER *CommunicateHeader;
+
+ CommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *)(UINTN)mMmCommonBuffer.PhysicalStart;
+
+ //
+ // Use Guid to initialize EFI_MM_COMMUNICATE_HEADER structure
+ //
+ CopyGuid (&CommunicateHeader->HeaderGuid, (EFI_GUID *)Context);
+ CommunicateHeader->MessageLength = 1;
+ CommunicateHeader->Data[0] = 0;
+
+ //
+ // Generate the Software SMI and return the result
+ //
+ Size = sizeof (EFI_MM_COMMUNICATE_HEADER);
+ mMmCommunication2->Communicate (mMmCommunication2, CommunicateHeader, CommunicateHeader, &Size);
+}
+
+/**
+ Event notification that is fired every time a DxeSmmReadyToLock protocol is added
+ or if gEfiEventReadyToBootGuid is signaled.
+
+ @param Event The Event that is being processed, not used.
+ @param Context Event Context, not used.
+
+**/
+VOID
+EFIAPI
+MmReadyToLockEventNotify (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ EFI_STATUS Status;
+ VOID *Interface;
+ UINTN Index;
+
+ //
+ // See if we are already locked
+ //
+ if (mSmmLocked) {
+ return;
+ }
+
+ //
+ // Make sure this notification is for this handler
+ //
+ if (CompareGuid ((EFI_GUID *)Context, &gEfiDxeMmReadyToLockProtocolGuid)) {
+ Status = gBS->LocateProtocol (&gEfiDxeMmReadyToLockProtocolGuid, NULL, &Interface);
+ if (EFI_ERROR (Status)) {
+ return;
+ }
+ } else {
+ //
+ // If MM is not locked yet and we got here from gEfiEventReadyToBootGuid being
+ // signaled, then gEfiDxeMmReadyToLockProtocolGuid was not installed as expected.
+ // Print a warning on debug builds.
+ //
+ DEBUG ((DEBUG_WARN, "DXE Mm Ready To Lock Protocol not installed before Ready To Boot signal\n"));
+ }
+
+ if (!mEndOfDxe) {
+ DEBUG ((DEBUG_ERROR, "EndOfDxe Event must be signaled before DxeSmmReadyToLock Protocol installation!\n"));
+ REPORT_STATUS_CODE (
+ EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED,
+ (EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)
+ );
+ ASSERT (FALSE);
+ }
+
+ //
+ // Lock the SMRAM (Note: Locking SMRAM may not be supported on all platforms)
+ //
+ mSmmAccess->Lock (mSmmAccess);
+
+ //
+ // Close protocol and event notification events that do not apply after the
+ // DXE MM Ready To Lock Protocol has been installed or the Ready To Boot
+ // event has been signalled.
+ //
+ for (Index = 0; mMmEvents[Index].NotifyFunction != NULL; Index++) {
+ if (mMmEvents[Index].CloseOnLock) {
+ gBS->CloseEvent (mMmEvents[Index].Event);
+ }
+ }
+
+ //
+ // Inform MM Core that the DxeSmmReadyToLock protocol was installed
+ //
+ MmGuidedEventNotify (Event, (VOID *)&gEfiDxeMmReadyToLockProtocolGuid);
+
+ //
+ // Print debug message that the SMRAM window is now locked.
+ //
+ DEBUG ((DEBUG_INFO, "MmCommunicationNotifyDxe locked SMRAM window\n"));
+
+ //
+ // Set flag so this operation will not be performed again
+ //
+ mSmmLocked = TRUE;
+}
+
+/**
+ Event notification that is fired when EndOfDxe Event Group is signaled.
+
+ @param Event The Event that is being processed, not used.
+ @param Context Event Context, not used.
+
+**/
+VOID
+EFIAPI
+MmEndOfDxeEventNotify (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ mEndOfDxe = TRUE;
+}
+
+/**
+ The Entry Point for MmCommunicateNotifyDxe driver.
+
+ @param ImageHandle The firmware allocated handle for the EFI image.
+ @param SystemTable A pointer to the EFI System Table.
+
+ @retval EFI_SUCCESS The entry point is executed successfully.
+ @retval Other Some error occurred when executing this entry point.
+
+**/
+EFI_STATUS
+EFIAPI
+MmCommunicationNotifyEntryPoint (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+ EFI_HOB_GUID_TYPE *GuidHob;
+ MM_COMM_BUFFER *MmCommonBuffer;
+ UINTN Index;
+ VOID *Registration;
+
+ //
+ // Locate gMmCommBufferHobGuid and cache the content
+ //
+ GuidHob = GetFirstGuidHob (&gMmCommBufferHobGuid);
+ ASSERT (GuidHob != NULL);
+ MmCommonBuffer = GET_GUID_HOB_DATA (GuidHob);
+ CopyMem (&mMmCommonBuffer, MmCommonBuffer, sizeof (MM_COMM_BUFFER));
+
+ //
+ // Get SMM Access Protocol
+ //
+ Status = gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid, NULL, (VOID **)&mSmmAccess);
+ ASSERT_EFI_ERROR (Status);
+
+ //
+ // Get MM Communication Protocol 2 instance
+ //
+ Status = gBS->LocateProtocol (&gEfiMmCommunication2ProtocolGuid, NULL, (VOID **)&mMmCommunication2);
+ ASSERT_EFI_ERROR (Status);
+
+ //
+ // Create the set of protocol and event notifications that the Standalone Mm requires
+ //
+ for (Index = 0; mMmEvents[Index].NotificationType != EndNotify; Index++) {
+ if (mMmEvents[Index].NotificationType == ProtocolNotify) {
+ mMmEvents[Index].Event = EfiCreateProtocolNotifyEvent (
+ mMmEvents[Index].Guid,
+ TPL_CALLBACK,
+ mMmEvents[Index].NotifyFunction,
+ mMmEvents[Index].NotifyContext,
+ &Registration
+ );
+ } else {
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ mMmEvents[Index].NotifyFunction,
+ mMmEvents[Index].NotifyContext,
+ mMmEvents[Index].Guid,
+ &mMmEvents[Index].Event
+ );
+ ASSERT_EFI_ERROR (Status);
+ }
+ }
+
+ return EFI_SUCCESS;
+}
diff --git a/StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.h b/StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.h
new file mode 100644
index 0000000..83391dc
--- /dev/null
+++ b/StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.h
@@ -0,0 +1,156 @@
+/** @file
+
+ Copyright (c) 2025, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef MM_COMMUNICATION_NOTIFY_DXE_H_
+#define MM_COMMUNICATION_NOTIFY_DXE_H_
+
+#include <PiDxe.h>
+
+#include <Library/BaseLib.h>
+#include <Library/DebugLib.h>
+#include <Library/HobLib.h>
+#include <Library/UefiLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/ReportStatusCodeLib.h>
+
+#include <Protocol/SmmControl2.h>
+#include <Protocol/MmCommunication2.h>
+#include <Protocol/MmCommunication.h>
+#include <Protocol/DxeMmReadyToLock.h>
+#include <Protocol/SmmAccess2.h>
+
+#include <Guid/MmCommBuffer.h>
+#include <Guid/EventGroup.h>
+
+typedef enum {
+ EventNotify,
+ ProtocolNotify,
+ EndNotify,
+} NOTIFICATION_TYPE;
+
+//
+// Data structure used to declare a table of protocol notifications and event
+// notifications required by the Standalone Mm environment
+//
+typedef struct {
+ NOTIFICATION_TYPE NotificationType;
+ BOOLEAN CloseOnLock;
+ EFI_GUID *Guid;
+ EFI_EVENT_NOTIFY NotifyFunction;
+ VOID *NotifyContext;
+ EFI_EVENT Event;
+} MM_EVENT_NOTIFICATION;
+
+/**
+ Communicates with a registered handler.
+
+ This function provides a service to send and receive messages from a registered UEFI service.
+
+ @param[in] This The EFI_MM_COMMUNICATION_PROTOCOL instance.
+ @param[in, out] CommBufferPhysical Physical address of the MM communication buffer.
+ @param[in, out] CommBufferVirtual Virtual address of the MM communication buffer.
+ @param[in, out] CommSize The size of the data buffer being passed in. On exit, the size of data
+ being returned. Zero if the handler does not wish to reply with any data.
+ This parameter is optional and may be NULL.
+
+ @retval EFI_SUCCESS The message was successfully posted.
+ @retval EFI_INVALID_PARAMETER The CommBuffer was NULL.
+ @retval EFI_BAD_BUFFER_SIZE The buffer is too large for the MM implementation.
+ If this error is returned, the MessageLength field
+ in the CommBuffer header or the integer pointed by
+ CommSize, are updated to reflect the maximum payload
+ size the implementation can accommodate.
+ @retval EFI_ACCESS_DENIED The CommunicateBuffer parameter or CommSize parameter,
+ if not omitted, are in address range that cannot be
+ accessed by the MM environment.
+
+**/
+EFI_STATUS
+EFIAPI
+MmCommunicate2 (
+ IN CONST EFI_MM_COMMUNICATION2_PROTOCOL *This,
+ IN OUT VOID *CommBufferPhysical,
+ IN OUT VOID *CommBufferVirtual,
+ IN OUT UINTN *CommSize OPTIONAL
+ );
+
+/**
+ Communicates with a registered handler.
+
+ This function provides a service to send and receive messages from a registered UEFI service.
+
+ @param[in] This The EFI_MM_COMMUNICATION_PROTOCOL instance.
+ @param[in, out] CommBufferPhysical Physical address of the MM communication buffer
+ @param[in, out] CommSize The size of the data buffer being passed in. On exit, the size of data
+ being returned. Zero if the handler does not wish to reply with any data.
+ This parameter is optional and may be NULL.
+
+ @retval EFI_SUCCESS The message was successfully posted.
+ @retval EFI_INVALID_PARAMETER The CommBuffer was NULL.
+ @retval EFI_BAD_BUFFER_SIZE The buffer is too large for the MM implementation.
+ If this error is returned, the MessageLength field
+ in the CommBuffer header or the integer pointed by
+ CommSize, are updated to reflect the maximum payload
+ size the implementation can accommodate.
+ @retval EFI_ACCESS_DENIED The CommunicateBuffer parameter or CommSize parameter,
+ if not omitted, are in address range that cannot be
+ accessed by the MM environment.
+
+**/
+EFI_STATUS
+EFIAPI
+MmCommunicate (
+ IN CONST EFI_MM_COMMUNICATION_PROTOCOL *This,
+ IN OUT VOID *CommBufferPhysical,
+ IN OUT UINTN *CommSize OPTIONAL
+ );
+
+/**
+ Event notification that is fired every time a DxeSmmReadyToLock protocol is added
+ or if gEfiEventReadyToBootGuid is signaled.
+
+ @param Event The Event that is being processed, not used.
+ @param Context Event Context, not used.
+
+**/
+VOID
+EFIAPI
+MmReadyToLockEventNotify (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ );
+
+/**
+ Event notification that is fired when GUIDed Event Group is signaled.
+
+ @param Event The Event that is being processed, not used.
+ @param Context Event Context, not used.
+
+**/
+VOID
+EFIAPI
+MmGuidedEventNotify (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ );
+
+/**
+ Event notification that is fired when EndOfDxe Event Group is signaled.
+
+ @param Event The Event that is being processed, not used.
+ @param Context Event Context, not used.
+
+**/
+VOID
+EFIAPI
+MmEndOfDxeEventNotify (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ );
+
+#endif
diff --git a/StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.inf b/StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.inf
new file mode 100644
index 0000000..670ae22
--- /dev/null
+++ b/StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.inf
@@ -0,0 +1,51 @@
+## @file
+# MmCommunicationNotifyDxe driver create the notifications of
+# some protocols and event.
+#
+# Copyright (c) 2025, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x0001001A
+ BASE_NAME = MmCommunicationNotifyDxe
+ FILE_GUID = DE05B887-A2EF-4D81-BFFE-FF9CDE458753
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ PI_SPECIFICATION_VERSION = 0x00010032
+ ENTRY_POINT = MmCommunicationNotifyEntryPoint
+
+[Sources]
+ MmCommunicationNotifyDxe.c
+ MmCommunicationNotifyDxe.h
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ UefiCpuPkg/UefiCpuPkg.dec
+ StandaloneMmPkg/StandaloneMmPkg.dec
+
+[LibraryClasses]
+ UefiDriverEntryPoint
+ BaseLib
+ DebugLib
+ HobLib
+ BaseMemoryLib
+ UefiBootServicesTableLib
+ UefiLib
+ ReportStatusCodeLib
+
+[Guids]
+ gMmCommBufferHobGuid
+ gEfiEndOfDxeEventGroupGuid
+ gEfiEventExitBootServicesGuid
+
+[Protocols]
+ gEfiDxeMmReadyToLockProtocolGuid
+ gEfiSmmAccess2ProtocolGuid
+ gEfiMmCommunication2ProtocolGuid
+
+[Depex]
+ gEfiMmCommunication2ProtocolGuid
diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc
index d36081e..caf0b50 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -96,6 +96,8 @@
[LibraryClasses.common.DXE_RUNTIME_DRIVER]
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
+
+[LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
@@ -147,6 +149,7 @@
StandaloneMmPkg/Library/SmmLockBoxMmDependency/SmmLockBoxMmDependency.inf
StandaloneMmPkg/Library/MmPlatformHobProducerLibNull/MmPlatformHobProducerLibNull.inf
StandaloneMmPkg/Drivers/MmCommunicationDxe/MmCommunicationDxe.inf
+ StandaloneMmPkg/Drivers/MmCommunicationNotifyDxe/MmCommunicationNotifyDxe.inf
StandaloneMmPkg/Library/StandaloneMmExtractGuidedSectionLib/StandaloneMmExtractGuidedSectionLib.inf
[Components.AARCH64, Components.ARM]
diff --git a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
index 6a22e01..4f9d53e 100644
--- a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
+++ b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c
@@ -269,7 +269,7 @@ CpuGetTimerValue (
if (TimerPeriod != NULL) {
*TimerPeriod = DivU64x32 (
1000000000000000u,
- PcdGet64 (PcdCpuCoreCrystalClockFrequency)
+ GetPerformanceCounterProperties (NULL, NULL)
);
}
diff --git a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h
index 40077d6..0c4ef2e 100644
--- a/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h
+++ b/UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h
@@ -17,6 +17,7 @@
#include <Library/BaseRiscVFpuLib.h>
#include <Library/BaseRiscVSbiLib.h>
#include <Library/BaseRiscVMmuLib.h>
+#include <Library/TimerLib.h>
#include <Library/BaseLib.h>
#include <Library/CacheMaintenanceLib.h>
#include <Library/CpuExceptionHandlerLib.h>
diff --git a/UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf b/UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf
index cb0f71e..7600c88 100644
--- a/UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf
+++ b/UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf
@@ -40,6 +40,7 @@
RiscVMmuLib
RiscVFpuLib
CacheMaintenanceLib
+ TimerLib
[Sources]
CpuDxe.c
@@ -62,7 +63,6 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize ## CONSUMES
- gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency ## CONSUMES
[Depex]
TRUE
diff --git a/UefiCpuPkg/CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf b/UefiCpuPkg/CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf
index f2a2cf1..812b674 100644
--- a/UefiCpuPkg/CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf
+++ b/UefiCpuPkg/CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf
@@ -32,6 +32,7 @@
CpuLib
UefiBootServicesTableLib
UefiDriverEntryPoint
+ TimerLib
[LibraryClasses.RISCV64]
RiscVSbiLib
@@ -42,7 +43,6 @@
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdRiscVFeatureOverride ## CONSUMES
- gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency ## CONSUMES
[Protocols]
gEfiCpuArchProtocolGuid ## CONSUMES
diff --git a/UefiCpuPkg/CpuTimerDxeRiscV64/Timer.c b/UefiCpuPkg/CpuTimerDxeRiscV64/Timer.c
index 216f48a..14780e4 100644
--- a/UefiCpuPkg/CpuTimerDxeRiscV64/Timer.c
+++ b/UefiCpuPkg/CpuTimerDxeRiscV64/Timer.c
@@ -10,6 +10,7 @@
#include <Library/BaseLib.h>
#include <Library/BaseRiscVSbiLib.h>
#include <Library/UefiLib.h>
+#include <Library/TimerLib.h>
#include "Timer.h"
//
@@ -114,7 +115,7 @@ TimerInterruptHandler (
mTimerNotifyFunction (
DivU64x32 (
EFI_TIMER_PERIOD_SECONDS (PeriodStart - mLastPeriodStart),
- PcdGet64 (PcdCpuCoreCrystalClockFrequency)
+ GetPerformanceCounterProperties (NULL, NULL)
)
);
}
@@ -129,7 +130,7 @@ TimerInterruptHandler (
PeriodStart += DivU64x32 (
MultU64x32 (
mTimerPeriod,
- PcdGet64 (PcdCpuCoreCrystalClockFrequency)
+ GetPerformanceCounterProperties (NULL, NULL)
),
1000000u
); // convert to tick
@@ -232,7 +233,7 @@ TimerDriverSetTimerPeriod (
PeriodStart += DivU64x32 (
MultU64x32 (
mTimerPeriod,
- PcdGet64 (PcdCpuCoreCrystalClockFrequency)
+ GetPerformanceCounterProperties (NULL, NULL)
),
1000000u
); // convert to tick
diff --git a/UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf b/UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf
index 3d5eaa4..b7ae1e8 100644
--- a/UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf
+++ b/UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLib.inf
@@ -28,6 +28,8 @@
BaseLib
PcdLib
DebugLib
+ FdtLib
+ HobLib
-[Pcd]
- gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency ## CONSUMES
+[Guids]
+ gFdtHobGuid
diff --git a/UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/CpuTimerLib.c b/UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/CpuTimerLib.c
index 27d7276..080e229 100644
--- a/UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/CpuTimerLib.c
+++ b/UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/CpuTimerLib.c
@@ -12,6 +12,12 @@
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
#include <Register/RiscV64/RiscVImpl.h>
+#include <Pi/PiBootMode.h>
+#include <Pi/PiHob.h>
+#include <Library/HobLib.h>
+#include <Library/FdtLib.h>
+
+STATIC UINT64 mTimeBase;
/**
Stalls the CPU for at least the given number of ticks.
@@ -57,7 +63,7 @@ MicroSecondDelay (
DivU64x32 (
MultU64x32 (
MicroSeconds,
- PcdGet64 (PcdCpuCoreCrystalClockFrequency)
+ mTimeBase
),
1000000u
)
@@ -85,7 +91,7 @@ NanoSecondDelay (
DivU64x32 (
MultU64x32 (
NanoSeconds,
- PcdGet64 (PcdCpuCoreCrystalClockFrequency)
+ mTimeBase
),
1000000000u
)
@@ -152,7 +158,48 @@ GetPerformanceCounterProperties (
*EndValue = 32 - 1;
}
- return PcdGet64 (PcdCpuCoreCrystalClockFrequency);
+ if (mTimeBase != 0) {
+ return mTimeBase;
+ }
+
+ //
+ // Locate the FDT HOB and validate header
+ //
+ CONST EFI_HOB_GUID_TYPE *Hob = GetFirstGuidHob (&gFdtHobGuid);
+
+ ASSERT (Hob != NULL);
+
+ CONST VOID *DeviceTreeBase =
+ (CONST VOID *)(UINTN)*(CONST UINT64 *)GET_GUID_HOB_DATA (Hob);
+
+ ASSERT (FdtCheckHeader (DeviceTreeBase) == 0);
+
+ //
+ // /cpus node
+ //
+ INT32 Node = FdtSubnodeOffsetNameLen (
+ DeviceTreeBase,
+ 0,
+ "cpus",
+ sizeof ("cpus") - 1
+ );
+
+ ASSERT (Node >= 0);
+
+ //
+ // timebase-frequency property
+ //
+ INT32 Len;
+ CONST FDT_PROPERTY *Prop =
+ FdtGetProperty (DeviceTreeBase, Node, "timebase-frequency", &Len);
+
+ ASSERT (Prop != NULL && Len == sizeof (UINT32));
+
+ //
+ // Device-tree cells are big-endian
+ //
+ mTimeBase = SwapBytes32 (*(CONST UINT32 *)Prop->Data);
+ return mTimeBase;
}
/**
@@ -180,13 +227,13 @@ GetTimeInNanoSecond (
// Time = --------- x 1,000,000,000
// Frequency
//
- NanoSeconds = MultU64x32 (DivU64x32Remainder (Ticks, PcdGet64 (PcdCpuCoreCrystalClockFrequency), &Remainder), 1000000000u);
+ NanoSeconds = MultU64x32 (DivU64x32Remainder (Ticks, mTimeBase, &Remainder), 1000000000u);
//
// Frequency < 0x100000000, so Remainder < 0x100000000, then (Remainder * 1,000,000,000)
// will not overflow 64-bit.
//
- NanoSeconds += DivU64x32 (MultU64x32 ((UINT64)Remainder, 1000000000u), PcdGet64 (PcdCpuCoreCrystalClockFrequency));
+ NanoSeconds += DivU64x32 (MultU64x32 ((UINT64)Remainder, 1000000000u), mTimeBase);
return NanoSeconds;
}
diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
index 8c1428c..f5f6074 100644
--- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
@@ -160,7 +160,7 @@ GetWakeupBuffer (
@retval 0 Cannot find free memory below 4GB.
**/
UINTN
-AllocateCodeBuffer (
+AllocateCodePage (
IN UINTN BufferSize
)
{
@@ -417,14 +417,46 @@ AllocateApLoopCodeBuffer (
/**
Remove Nx protection for the range specific by BaseAddress and Length.
- The PEI implementation uses CpuPageTableLib to change the attribute.
- The DXE implementation uses gDS to change the attribute.
+ @param[in] BaseAddress BaseAddress of the range.
+ @param[in] Length Length of the range.
+**/
+VOID
+RemoveNxProtection (
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINTN Length
+ )
+{
+ EFI_STATUS Status;
+ EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc;
+
+ Status = gDS->GetMemorySpaceDescriptor (BaseAddress, &MemDesc);
+ if (!EFI_ERROR (Status)) {
+ if (((MemDesc.Capabilities & EFI_MEMORY_XP) == EFI_MEMORY_XP) && ((MemDesc.Attributes & EFI_MEMORY_XP) == EFI_MEMORY_XP)) {
+ Status = gDS->SetMemorySpaceAttributes (
+ BaseAddress,
+ Length,
+ MemDesc.Attributes & (~EFI_MEMORY_XP)
+ );
+
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "%a - Setting Nx on 0x%p returned %r\n", __func__, BaseAddress, Status));
+ ASSERT_EFI_ERROR (Status);
+ }
+ }
+ } else {
+ DEBUG ((DEBUG_ERROR, "%a - Memory Address was not found in Memory map! %lp %r\n", __func__, BaseAddress, Status));
+ ASSERT_EFI_ERROR (Status);
+ }
+}
+
+/**
+ Add ReadOnly protection to the range specified by BaseAddress and Length.
@param[in] BaseAddress BaseAddress of the range.
@param[in] Length Length of the range.
**/
VOID
-RemoveNxprotection (
+ApplyRoProtection (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINTN Length
)
@@ -432,17 +464,23 @@ RemoveNxprotection (
EFI_STATUS Status;
EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc;
- //
- // TODO: Check EFI_MEMORY_XP bit set or not once it's available in DXE GCD
- // service.
- //
Status = gDS->GetMemorySpaceDescriptor (BaseAddress, &MemDesc);
if (!EFI_ERROR (Status)) {
- gDS->SetMemorySpaceAttributes (
- BaseAddress,
- Length,
- MemDesc.Attributes & (~EFI_MEMORY_XP)
- );
+ if (((MemDesc.Capabilities & EFI_MEMORY_RO) == EFI_MEMORY_RO) && ((MemDesc.Attributes & EFI_MEMORY_RO) != EFI_MEMORY_RO)) {
+ Status = gDS->SetMemorySpaceAttributes (
+ BaseAddress,
+ Length,
+ MemDesc.Attributes | EFI_MEMORY_RO
+ );
+
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "%a - Setting Ro on 0x%p returned %r\n", __func__, BaseAddress, Status));
+ ASSERT_EFI_ERROR (Status);
+ }
+ }
+ } else {
+ DEBUG ((DEBUG_ERROR, "%a - Memory Address was not found in Memory map! %lp %r\n", __func__, BaseAddress, Status));
+ ASSERT_EFI_ERROR (Status);
}
}
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index ffaff18..96c0980 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -2072,6 +2072,7 @@ MpInitLibInitialize (
UINTN ApResetVectorSizeAbove1Mb;
UINTN BackupBufferAddr;
UINTN ApIdtBase;
+ IA32_CR0 Cr0;
FirstMpHandOff = GetNextMpHandOffHob (NULL);
if (FirstMpHandOff != NULL) {
@@ -2248,7 +2249,13 @@ MpInitLibInitialize (
// Copy all 32-bit code and 64-bit code into memory with type of
// EfiBootServicesCode to avoid page fault if NX memory protection is enabled.
//
- CpuMpData->WakeupBufferHigh = AllocateCodeBuffer (ApResetVectorSizeAbove1Mb);
+ CpuMpData->WakeupBufferHigh = AllocateCodePage (ApResetVectorSizeAbove1Mb);
+
+ Cr0.UintN = AsmReadCr0 ();
+ if (Cr0.Bits.PG != 0) {
+ RemoveNxProtection ((EFI_PHYSICAL_ADDRESS)(UINTN)CpuMpData->WakeupBufferHigh, ALIGN_VALUE (ApResetVectorSizeAbove1Mb, EFI_PAGE_SIZE));
+ }
+
CopyMem (
(VOID *)CpuMpData->WakeupBufferHigh,
CpuMpData->AddressMap.RendezvousFunnelAddress +
@@ -2256,6 +2263,9 @@ MpInitLibInitialize (
ApResetVectorSizeAbove1Mb
);
DEBUG ((DEBUG_INFO, "AP Vector: non-16-bit = %p/%x\n", CpuMpData->WakeupBufferHigh, ApResetVectorSizeAbove1Mb));
+ if (Cr0.Bits.PG != 0) {
+ ApplyRoProtection ((EFI_PHYSICAL_ADDRESS)(UINTN)CpuMpData->WakeupBufferHigh, ALIGN_VALUE (ApResetVectorSizeAbove1Mb, EFI_PAGE_SIZE));
+ }
//
// Save APIC mode for AP to sync
@@ -3484,7 +3494,7 @@ PrepareApLoopCode (
// Make sure that the buffer memory is executable if NX protection is enabled
// for EfiReservedMemoryType.
//
- RemoveNxprotection (Address, EFI_PAGES_TO_SIZE (FuncPages));
+ RemoveNxProtection (Address, EFI_PAGES_TO_SIZE (FuncPages));
}
mReservedTopOfApStack = (UINTN)Address + EFI_PAGES_TO_SIZE (StackPages+FuncPages);
@@ -3492,6 +3502,10 @@ PrepareApLoopCode (
mReservedApLoop.Data = (VOID *)(UINTN)Address;
ASSERT (mReservedApLoop.Data != NULL);
CopyMem (mReservedApLoop.Data, ApLoopFunc, ApLoopFuncSize);
+ if (Cr0.Bits.PG != 0) {
+ ApplyRoProtection (Address, EFI_PAGES_TO_SIZE (FuncPages));
+ }
+
if (!CpuMpData->UseSevEsAPMethod) {
//
// processors without SEV-ES and paging is enabled
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/MpInitLib/MpLib.h
index b30dcb3..60cae3b 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.h
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h
@@ -533,7 +533,7 @@ GetNextMpHandOffHob (
@retval 0 Cannot find free memory below 4GB.
**/
UINTN
-AllocateCodeBuffer (
+AllocateCodePage (
IN UINTN BufferSize
);
@@ -991,14 +991,23 @@ AllocateApLoopCodeBuffer (
/**
Remove Nx protection for the range specific by BaseAddress and Length.
- The PEI implementation uses CpuPageTableLib to change the attribute.
- The DXE implementation uses gDS to change the attribute.
-
@param[in] BaseAddress BaseAddress of the range.
@param[in] Length Length of the range.
**/
VOID
-RemoveNxprotection (
+RemoveNxProtection (
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINTN Length
+ );
+
+/**
+Add ReadOnly protection to the range specified by BaseAddress and Length.
+
+@param[in] BaseAddress BaseAddress of the range.
+@param[in] Length Length of the range.
+**/
+VOID
+ApplyRoProtection (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINTN Length
);
diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
index bb28794..443508f 100644
--- a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c
@@ -290,7 +290,7 @@ GetWakeupBuffer (
@retval 0 Cannot find free memory below 4GB.
**/
UINTN
-AllocateCodeBuffer (
+AllocateCodePage (
IN UINTN BufferSize
)
{
@@ -819,31 +819,21 @@ AllocateApLoopCodeBuffer (
}
/**
- Remove Nx protection for the range specific by BaseAddress and Length.
-
- The PEI implementation uses CpuPageTableLib to change the attribute.
- The DXE implementation uses gDS to change the attribute.
+ Determine the Paging Mode that the system is currently
+ using.
- @param[in] BaseAddress BaseAddress of the range.
- @param[in] Length Length of the range.
-**/
-VOID
-RemoveNxprotection (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINTN Length
+ @retval PAGING_MODE
+ **/
+PAGING_MODE
+DetermineCurrentPagingMode (
+ VOID
)
{
- EFI_STATUS Status;
- UINTN PageTable;
- EFI_PHYSICAL_ADDRESS Buffer;
- UINTN BufferSize;
- IA32_MAP_ATTRIBUTE MapAttribute;
- IA32_MAP_ATTRIBUTE MapMask;
PAGING_MODE PagingMode;
IA32_CR4 Cr4;
BOOLEAN Page5LevelSupport;
- UINT32 RegEax;
BOOLEAN Page1GSupport;
+ UINT32 RegEax;
CPUID_EXTENDED_CPU_SIG_EDX RegEdx;
if (sizeof (UINTN) == sizeof (UINT64)) {
@@ -877,12 +867,36 @@ RemoveNxprotection (
PagingMode = PagingPae;
}
+ return PagingMode;
+}
+
+/**
+ Remove Nx protection for the range specific by BaseAddress and Length.
+
+ @param[in] BaseAddress BaseAddress of the range.
+ @param[in] Length Length of the range.
+**/
+VOID
+RemoveNxProtection (
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINTN Length
+ )
+{
+ EFI_STATUS Status;
+ UINTN PageTable;
+ EFI_PHYSICAL_ADDRESS Buffer;
+ UINTN BufferSize;
+ IA32_MAP_ATTRIBUTE MapAttribute;
+ IA32_MAP_ATTRIBUTE MapMask;
+ PAGING_MODE PagingMode;
+
MapAttribute.Uint64 = 0;
MapMask.Uint64 = 0;
MapMask.Bits.Nx = 1;
PageTable = AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64;
BufferSize = 0;
+ PagingMode = DetermineCurrentPagingMode ();
//
// Get required buffer size for changing the pagetable.
//
@@ -903,3 +917,52 @@ RemoveNxprotection (
ASSERT_EFI_ERROR (Status);
AsmWriteCr3 (PageTable);
}
+
+/**
+ Add ReadOnly protection to the range specified by BaseAddress and Length.
+
+ @param[in] BaseAddress BaseAddress of the range.
+ @param[in] Length Length of the range.
+**/
+VOID
+ApplyRoProtection (
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINTN Length
+ )
+{
+ EFI_STATUS Status;
+ UINTN PageTable;
+ EFI_PHYSICAL_ADDRESS Buffer;
+ UINTN BufferSize;
+ IA32_MAP_ATTRIBUTE MapAttribute;
+ IA32_MAP_ATTRIBUTE MapMask;
+ PAGING_MODE PagingMode;
+
+ MapAttribute.Uint64 = 0;
+ MapMask.Uint64 = 0;
+ MapMask.Bits.ReadWrite = 1;
+ PageTable = AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64;
+ BufferSize = 0;
+
+ PagingMode = DetermineCurrentPagingMode ();
+ //
+ // Get required buffer size for changing the pagetable.
+ //
+ Status = PageTableMap (&PageTable, PagingMode, 0, &BufferSize, BaseAddress, Length, &MapAttribute, &MapMask, NULL);
+ if (Status == EFI_BUFFER_TOO_SMALL) {
+ //
+ // Allocate required Buffer.
+ //
+ Status = PeiServicesAllocatePages (
+ EfiBootServicesData,
+ EFI_SIZE_TO_PAGES (BufferSize),
+ &Buffer
+ );
+ ASSERT_EFI_ERROR (Status);
+ Status = PageTableMap (&PageTable, PagingMode, (VOID *)(UINTN)Buffer, &BufferSize, BaseAddress, Length, &MapAttribute, &MapMask, NULL);
+ }
+
+ ASSERT_EFI_ERROR (Status);
+ AsmWriteCr3 (PageTable);
+ return;
+}
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
index 5614aad..2110997 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
@@ -98,7 +98,7 @@ PlatformBootManagerEnableQuietBoot (
Use SystemTable Conout to turn on video based Simple Text Out consoles. The
Simple Text Out screens will now be synced up with all non video output devices
- @retval EFI_SUCCESS UGA devices are back in text mode and synced up.
+ @retval EFI_SUCCESS Devices are back in text mode and synced up.
**/
EFI_STATUS
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index ff92c95..987c730 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -55,7 +55,6 @@
[Protocols]
gEfiGenericMemTestProtocolGuid ## CONSUMES
gEfiGraphicsOutputProtocolGuid ## CONSUMES
- gEfiUgaDrawProtocolGuid ## CONSUMES
gEfiBootLogoProtocolGuid ## CONSUMES
gEfiDxeSmmReadyToLockProtocolGuid
gEfiSmmAccess2ProtocolGuid
@@ -64,7 +63,6 @@
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 6310c5b..34de87f 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -549,7 +549,6 @@
################################################################################
[PcdsFeatureFlag]
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
## This PCD specified whether ACPI SDT protocol is installed.
gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
gEfiMdeModulePkgTokenSpaceGuid.PcdHiiOsRuntimeSupport|FALSE
diff --git a/pip-requirements.txt b/pip-requirements.txt
index 93fadfe..d2365e7 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -12,8 +12,8 @@
# https://www.python.org/dev/peps/pep-0440/#version-specifiers
##
-edk2-pytool-library~=0.23.0
-edk2-pytool-extensions~=0.29.0
+edk2-pytool-library~=0.23.4
+edk2-pytool-extensions~=0.29.11
antlr4-python3-runtime==4.9
lcov-cobertura==2.1.1
regex==2024.11.6