diff mbox

[edk2,05/12] OvmfPkg: PlatformBdsLib: add constructor

Message ID 1409698598-9766-5-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/PlatformBdsLib/PlatformBdsLib.inf |  2 ++
 OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c      | 10 ++++++++++
 2 files changed, 12 insertions(+)
diff mbox

Patch

diff --git a/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf b/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf
index a2b72ba..a28534b 100644
--- a/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf
+++ b/OvmfPkg/Library/PlatformBdsLib/PlatformBdsLib.inf
@@ -20,6 +20,8 @@ 
   VERSION_STRING                 = 1.0
   LIBRARY_CLASS                  = PlatformBdsLib|DXE_DRIVER
 
+  CONSTRUCTOR                    = PlatformBdsLibConstructor
+
 #
 # The following information is for reference only and not required by the build tools.
 #
diff --git a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
index 2a1ca88..3a70799 100644
--- a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
@@ -1447,3 +1447,13 @@  LockKeyboards (
     return EFI_UNSUPPORTED;
 }
 
+
+EFI_STATUS
+EFIAPI
+PlatformBdsLibConstructor (
+  IN EFI_HANDLE       ImageHandle,
+  IN EFI_SYSTEM_TABLE *SystemTable
+  )
+{
+  return EFI_SUCCESS;
+}