diff options
author | Aaron Antone <aanton@microsoft.com> | 2019-04-08 11:03:26 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2019-04-22 09:52:54 +0800 |
commit | e72920ec617ba1fceb114b3bb2a587a8e836734b (patch) | |
tree | f73e210794bde721094fa451ef240b74ded64d41 /MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf | |
parent | 452702d0bc51b608491a96b3634ded7a57727455 (diff) | |
download | edk2-e72920ec617ba1fceb114b3bb2a587a8e836734b.tar.gz |
MdePkg/UefiDebugLibStdErr: Make it runtime safe
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1416
After ExitBootServices, some pointer would be invalid such as
the Protocol pointer and gST. The function depend on those should
be prevent. So disable the related function while after
ExitBootServices.
Change the gST to a internal one, because there will be a cycle
consume between UefiBootServicesTableLib and DebugLib due to the
library constructors.
Also remove the SMM support for this instance.
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Turner <Michael.Turner@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf')
-rw-r--r-- | MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf b/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf index 865cc98753..deaa3427f6 100644 --- a/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf +++ b/MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf @@ -3,7 +3,9 @@ #
# Debug Lib that sends messages to the the Standard Error Device in the EFI System Table.
#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2018, Microsoft Corporation
+#
+# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -17,8 +19,9 @@ FILE_GUID = b57a1df6-ffdb-4247-a3df-3a562176751a
MODULE_TYPE = UEFI_DRIVER
VERSION_STRING = 1.0
- LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
+ LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_APPLICATION UEFI_DRIVER
+ CONSTRUCTOR = DxeDebugLibConstructor
#
# VALID_ARCHITECTURES = IA32 X64 EBC
@@ -26,6 +29,7 @@ [Sources]
DebugLib.c
+ DebugLibConstructor.c
[Packages]
@@ -37,9 +41,11 @@ BaseLib
PcdLib
PrintLib
- UefiBootServicesTableLib
DebugPrintErrorLevelLib
+[Guids]
+ gEfiEventExitBootServicesGuid ## CONSUMES
+
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES
|