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

diff --git a/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf 
b/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf
index b0c12b0..baec28e 100644
--- a/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf
+++ b/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf
@@ -22,6 +22,8 @@
   VERSION_STRING                 = 1.0
   LIBRARY_CLASS                  = SerializeVariablesLib|DXE_DRIVER 
DXE_RUNTIME_DRIVER DXE_SAL_DRIVER UEFI_DRIVER
 
+  CONSTRUCTOR                    = DxeSerializeVariablesLibConstructor
+
 [Sources]
   SerializeVariablesLib.c
 
diff --git a/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c 
b/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c
index 19569b2..dfff3a2 100644
--- a/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c
+++ b/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.c
@@ -868,3 +868,13 @@ SerializeVariablesToBuffer (
   return RETURN_SUCCESS;
 }
 
+
+EFI_STATUS
+EFIAPI
+DxeSerializeVariablesLibConstructor (
+  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