From: Guo Dong Date: Fri, 24 Sep 2021 04:56:16 +0000 (-0700) Subject: UefiPayloadPkg: Use dummy constructor for PlatformHookLib X-Git-Tag: edk2-stable202202~469 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=dc430ccf3f664d26fe2a963cf2e21dca80069bf1 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 --- 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