From dc430ccf3f664d26fe2a963cf2e21dca80069bf1 Mon Sep 17 00:00:00 2001 From: Guo Dong Date: Thu, 23 Sep 2021 21:56:16 -0700 Subject: [PATCH] UefiPayloadPkg: Use dummy constructor for PlatformHookLib The Library constructor is only used for library dependency. So use a dummy function to make it clear instead of using an actual function. Cc: Ray Ni Cc: Maurice Ma Cc: Benjamin You Reviewed-by: Ray Ni Signed-off-by: Guo Dong --- .../PlatformHookLib.c | 17 +++++++++++++++++ .../PlatformHookLib.inf | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.c b/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.c index bd433bdbe0..004fcd8b7c 100644 --- a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.c +++ b/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.c @@ -13,6 +13,23 @@ #include #include + +/** Library Constructor + + @retval RETURN_SUCCESS Success. +**/ +EFI_STATUS +EFIAPI +PlatformHookSerialPortConstructor ( + VOID + ) +{ + // Nothing to do here. This constructor is added to + // enable the chain of constructor invocation for + // dependent libraries. + return RETURN_SUCCESS; +} + /** Performs platform specific initialization required for the CPU to access the hardware associated with a SerialPortLib instance. This function does diff --git a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.inf b/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.inf index 2dfd8b1216..7ac6bfa1b1 100644 --- a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.inf +++ b/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.inf @@ -14,7 +14,7 @@ MODULE_TYPE = BASE VERSION_STRING = 1.0 LIBRARY_CLASS = PlatformHookLib - CONSTRUCTOR = PlatformHookSerialPortInitialize + CONSTRUCTOR = PlatformHookSerialPortConstructor [Sources] PlatformHookLib.c -- 2.39.2