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

diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf 
b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
index 2e266a9..600ba63 100644
--- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
+++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
@@ -22,6 +22,8 @@
   VERSION_STRING                 = 1.0
   LIBRARY_CLASS                  = VirtioMmioDeviceLib
 
+  CONSTRUCTOR                    = VirtioMmioDeviceLibConstructor
+
 [Sources]
   VirtioMmioDevice.c
   VirtioMmioDeviceFunctions.c
diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c 
b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c
index 4af9dd0..f36ba81 100644
--- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c
+++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c
@@ -222,3 +222,14 @@ VirtioMmioUninstallDevice (
 
   return EFI_SUCCESS;
 }
+
+
+EFI_STATUS
+EFIAPI
+VirtioMmioDeviceLibConstructor (
+  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