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/ResetSystemLib/ResetSystemLib.inf |  4 +++-
 OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c   | 10 ++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf 
b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
index b6a3ffe..ab5838e 100644
--- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
+++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf
@@ -20,6 +20,8 @@
   VERSION_STRING                 = 1.0
   LIBRARY_CLASS                  = ResetSystemLib
 
+  CONSTRUCTOR                    = ResetSystemLibConstructor
+
 #
 # The following information is for reference only and not required by the 
build tools.
 #
@@ -39,4 +41,4 @@
   TimerLib
 
 [Pcd]
-  gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
\ No newline at end of file
+  gUefiOvmfPkgTokenSpaceGuid.PcdAcpiPmBaseAddress
diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c 
b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
index 6d149e8..2d177f7 100644
--- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
@@ -106,3 +106,13 @@ EnterS3WithImmediateWake (
   AcpiPmControl (1);
   ASSERT (FALSE);
 }
+
+
+RETURN_STATUS
+EFIAPI
+ResetSystemLibConstructor (
+  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