diff mbox

[edk2,03/12] OvmfPkg: LoadLinuxLib: add constructor

Message ID 1409698598-9766-3-git-send-email-lersek@redhat.com
State New
Headers show

Commit Message

Laszlo Ersek Sept. 2, 2014, 10:56 p.m. UTC
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 <lersek@redhat.com>
---
 OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf | 2 ++
 OvmfPkg/Library/LoadLinuxLib/Linux.c          | 9 +++++++++
 2 files changed, 11 insertions(+)
diff mbox

Patch

diff --git a/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf b/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf
index b8f987c..2a0283a 100644
--- a/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf
+++ b/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf
@@ -20,6 +20,8 @@ 
   VERSION_STRING                 = 1.0
   LIBRARY_CLASS                  = LoadLinuxLib
 
+  CONSTRUCTOR                    = LoadLinuxLibConstructor
+
 #
 # The following information is for reference only and not required by the build tools.
 #
diff --git a/OvmfPkg/Library/LoadLinuxLib/Linux.c b/OvmfPkg/Library/LoadLinuxLib/Linux.c
index 37b14f5..0e6b453 100644
--- a/OvmfPkg/Library/LoadLinuxLib/Linux.c
+++ b/OvmfPkg/Library/LoadLinuxLib/Linux.c
@@ -667,3 +667,12 @@  LoadLinux (
   return EFI_SUCCESS;
 }
 
+
+RETURN_STATUS
+EFIAPI
+LoadLinuxLibConstructor (
+  VOID
+  )
+{
+  return RETURN_SUCCESS;
+}