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/PlatformFvbLibNull/PlatformFvbLibNull.inf | 2 ++
 OvmfPkg/Library/PlatformFvbLibNull/PlatformFvbLibNull.c   | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/OvmfPkg/Library/PlatformFvbLibNull/PlatformFvbLibNull.inf 
b/OvmfPkg/Library/PlatformFvbLibNull/PlatformFvbLibNull.inf
index 5f51391..3e409a0 100644
--- a/OvmfPkg/Library/PlatformFvbLibNull/PlatformFvbLibNull.inf
+++ b/OvmfPkg/Library/PlatformFvbLibNull/PlatformFvbLibNull.inf
@@ -23,6 +23,8 @@
   VERSION_STRING                 = 1.0
   LIBRARY_CLASS                  = PlatformFvbLib|DXE_RUNTIME_DRIVER
 
+  CONSTRUCTOR                    = PlatformFvbLibNullConstructor
+
 #
 # The following information is for reference only and not required by the 
build tools.
 #
diff --git a/OvmfPkg/Library/PlatformFvbLibNull/PlatformFvbLibNull.c 
b/OvmfPkg/Library/PlatformFvbLibNull/PlatformFvbLibNull.c
index ea5da6e..2a8c64a 100644
--- a/OvmfPkg/Library/PlatformFvbLibNull/PlatformFvbLibNull.c
+++ b/OvmfPkg/Library/PlatformFvbLibNull/PlatformFvbLibNull.c
@@ -87,3 +87,11 @@ PlatformFvbBlocksErased (
 }
 
 
+RETURN_STATUS
+EFIAPI
+PlatformFvbLibNullConstructor (
+  VOID
+  )
+{
+  return RETURN_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