Calls to constructors of interdependent library instances are generated in
the correct order only if all library instances in question have
constructors. If some have no constructors, then the rest may see their
constructors called out of order.

Cycle detection also only works when all library instances have
constructors.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
---
 OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf |  2 ++
 OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.c   | 10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf 
b/OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf
index 267bc18..02d0fec 100644
--- a/OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf
+++ b/OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.inf
@@ -20,6 +20,8 @@
   VERSION_STRING                 = 1.0
   LIBRARY_CLASS                  = PlatformSecureLib|DXE_RUNTIME_DRIVER 
DXE_SMM_DRIVER DXE_DRIVER
 
+  CONSTRUCTOR                    = PlatformSecureLibConstructor
+
 #
 # The following information is for reference only and not required by the 
build tools.
 #
diff --git a/OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.c 
b/OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.c
index de0e4fa..4ffbb23 100644
--- a/OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.c
+++ b/OvmfPkg/Library/PlatformSecureLib/PlatformSecureLib.c
@@ -38,3 +38,13 @@ UserPhysicalPresent (
 {
   return TRUE;
 }
+
+EFI_STATUS
+EFIAPI
+PlatformSecureLibConstructor (
+  IN EFI_HANDLE       ImageHandle,
+  IN EFI_SYSTEM_TABLE *SystemTable
+  )
+{
+  return EFI_SUCCESS;
+}
-- 
1.8.3.1



------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to