From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.3296.1632542383734152108 for ; Fri, 24 Sep 2021 20:59:44 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: guo.dong@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10117"; a="224251305" X-IronPort-AV: E=Sophos;i="5.85,321,1624345200"; d="scan'208";a="224251305" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2021 20:59:42 -0700 X-IronPort-AV: E=Sophos;i="5.85,321,1624345200"; d="scan'208";a="552087712" Received: from gdong1-mobl1.amr.corp.intel.com ([10.212.80.242]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2021 20:59:42 -0700 From: "Guo Dong" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Maurice Ma , Benjamin You Subject: [`edk2-devel][PATCH] UefiPayloadPkg: Use dummy constructor for PlatformHookLib Date: Fri, 24 Sep 2021 20:59:32 -0700 Message-Id: <20210925035932.81-1-guo.dong@intel.com> X-Mailer: git-send-email 2.32.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Guo Dong 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 Signed-off-by: Guo Dong --- UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.c = | 17 +++++++++++++++++ UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLib.inf= | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/Platfor= mHookLib.c b/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/Platfor= mHookLib.c index bd433bdbe0..004fcd8b7c 100644 --- a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLi= b.c +++ b/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLi= b.c @@ -13,6 +13,23 @@ #include =0D #include =0D =0D +=0D +/** Library Constructor=0D +=0D + @retval RETURN_SUCCESS Success.=0D +**/=0D +EFI_STATUS=0D +EFIAPI=0D +PlatformHookSerialPortConstructor (=0D + VOID=0D + )=0D +{=0D + // Nothing to do here. This constructor is added to=0D + // enable the chain of constructor invocation for=0D + // dependent libraries.=0D + return RETURN_SUCCESS;=0D +}=0D +=0D /**=0D Performs platform specific initialization required for the CPU to access= =0D the hardware associated with a SerialPortLib instance. This function do= es=0D diff --git a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/Platfor= mHookLib.inf b/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/Platf= ormHookLib.inf index 2dfd8b1216..7ac6bfa1b1 100644 --- a/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLi= b.inf +++ b/UefiPayloadPkg/Library/UniversalPayloadPlatformHookLib/PlatformHookLi= b.inf @@ -14,7 +14,7 @@ MODULE_TYPE =3D BASE=0D VERSION_STRING =3D 1.0=0D LIBRARY_CLASS =3D PlatformHookLib=0D - CONSTRUCTOR =3D PlatformHookSerialPortInitialize=0D + CONSTRUCTOR =3D PlatformHookSerialPortConstructor=0D =0D [Sources]=0D PlatformHookLib.c=0D --=20 2.32.0.windows.2