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/NvVarsFileLib/NvVarsFileLib.inf | 2 ++
 OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.c   | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf 
b/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf
index 76fbae0..58371d3 100644
--- a/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf
+++ b/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf
@@ -24,6 +24,8 @@
   VERSION_STRING                 = 1.0
   LIBRARY_CLASS                  = NvVarsFileLib|DXE_DRIVER DXE_RUNTIME_DRIVER 
DXE_SAL_DRIVER UEFI_DRIVER
 
+  CONSTRUCTOR                    = NvVarsFileLibConstructor
+
 #
 # The following information is for reference only and not required by the 
build tools.
 #
diff --git a/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.c 
b/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.c
index c89bb4a..acb0418 100644
--- a/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.c
+++ b/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.c
@@ -81,3 +81,12 @@ UpdateNvVarsOnFileSystem (
 }
 
 
+EFI_STATUS
+EFIAPI
+NvVarsFileLibConstructor (
+  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