From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EEA5B2194EB75 for ; Fri, 15 Feb 2019 07:51:29 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2019 07:51:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,373,1544515200"; d="scan'208";a="320703960" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 15 Feb 2019 07:51:28 -0800 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.115]) by FMSMSX106.amr.corp.intel.com ([169.254.5.24]) with mapi id 14.03.0415.000; Fri, 15 Feb 2019 07:51:28 -0800 From: "Carsey, Jaben" To: "Fan, ZhijuX" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [PATCH] BaseTools:BaseTools supports to the driver combination. Thread-Index: AdTE3Q4tW6KxWQxnQDi9d2UW44OsvQAaTwkQ Date: Fri, 15 Feb 2019 15:51:26 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjVlYjBjNDctOTdiZC00ZGI2LWI0YWQtZjBlZDc0NjVkN2RmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibW5jdHdBSUZJK09keTBrMnBET3B4dVhGZ3ZKMVhnUjVOTVRKdmphUXJ1SEJvU1dIQTBLZGlUTVRrd3JIbUVcL1YifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Subject: Re: [PATCH] BaseTools:BaseTools supports to the driver combination. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2019 15:51:30 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Fan, ZhijuX > Sent: Thursday, February 14, 2019 7:18 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [PATCH] BaseTools:BaseTools supports to the driver > combination. >=20 > BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1520 >=20 > To save the image size without the compression, more than > one drivers can be combined into single one. When more than > one drivers are combined, their depex will be AND together. > Below is the example to combine BootManagerPolicyDxe into > DriverHealthManagerDxe. >=20 > Besides this patch, BaseTools also needs to check the module > type and make sure all module type are same. Otherwise, > BaseTools will report the error. > DRIVER INF has the parameter ENTRY_POINT > LIBRARY INF has the parameter LIBRARY_CLASS >=20 > Cc: Bob Feng > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Zhiju.Fan > --- > BaseTools/Source/Python/AutoGen/GenC.py | 31 > ++++++++++++++++++++++++++----- > 1 file changed, 26 insertions(+), 5 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/GenC.py > b/BaseTools/Source/Python/AutoGen/GenC.py > index 9700bf8527..93e8d78375 100644 > --- a/BaseTools/Source/Python/AutoGen/GenC.py > +++ b/BaseTools/Source/Python/AutoGen/GenC.py > @@ -1455,10 +1455,24 @@ def CreateLibraryDestructorCode(Info, > AutoGenC, AutoGenH): > def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH): > if Info.IsLibrary or Info.ModuleType in [SUP_MODULE_USER_DEFINED, > SUP_MODULE_SEC]: > return > + ModuleEntryPointList =3D [] > + for Lib in Info.DependentLibraryList: > + if len(Lib.ModuleEntryPointList) > 0: > + if Lib.ModuleType =3D=3D Info.ModuleType: > + ModuleEntryPointList =3D ModuleEntryPointList + > Lib.ModuleEntryPointList > + else: > + EdkLogger.error( > + "build", > + CODE_ERROR, > + "%s \nDriver's ModuleType must be consistent" % Lib, > + File=3Dstr(Info) > + ) > + ModuleEntryPointList =3D ModuleEntryPointList + > Info.Module.ModuleEntryPointList > + > # > # Module Entry Points > # > - NumEntryPoints =3D len(Info.Module.ModuleEntryPointList) > + NumEntryPoints =3D len(ModuleEntryPointList) > if 'PI_SPECIFICATION_VERSION' in Info.Module.Specification: > PiSpecVersion =3D > Info.Module.Specification['PI_SPECIFICATION_VERSION'] > else: > @@ -1468,7 +1482,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC, > AutoGenH): > else: > UefiSpecVersion =3D '0x00000000' > Dict =3D { > - 'Function' : Info.Module.ModuleEntryPointList, > + 'Function' : ModuleEntryPointList, > 'PiSpecVersion' : PiSpecVersion + 'U', > 'UefiSpecVersion': UefiSpecVersion + 'U' > } > @@ -1481,7 +1495,7 @@ def CreateModuleEntryPointCode(Info, AutoGenC, > AutoGenH): > AUTOGEN_ERROR, > '%s must have exactly one entry point' % Info.ModuleTy= pe, > File=3Dstr(Info), > - ExtraData=3D ", ".join(Info.Module.ModuleEntryPointLis= t) > + ExtraData=3D ", ".join(ModuleEntryPointList) > ) > if Info.ModuleType =3D=3D SUP_MODULE_PEI_CORE: > AutoGenC.Append(gPeiCoreEntryPointString.Replace(Dict)) > @@ -1535,11 +1549,18 @@ def CreateModuleEntryPointCode(Info, > AutoGenC, AutoGenH): > def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH): > if Info.IsLibrary or Info.ModuleType in [SUP_MODULE_USER_DEFINED, > SUP_MODULE_SEC]: > return > + > + ModuleUnloadImageList =3D [] > + for Lib in Info.DependentLibraryList: > + if len(Lib.ModuleUnloadImageList) > 0: > + ModuleUnloadImageList =3D ModuleUnloadImageList + > Lib.ModuleUnloadImageList > + ModuleUnloadImageList =3D ModuleUnloadImageList + > Info.Module.ModuleUnloadImageList > + > # > # Unload Image Handlers > # > - NumUnloadImage =3D len(Info.Module.ModuleUnloadImageList) > - Dict =3D {'Count':str(NumUnloadImage) + 'U', > 'Function':Info.Module.ModuleUnloadImageList} > + NumUnloadImage =3D len(ModuleUnloadImageList) > + Dict =3D {'Count':str(NumUnloadImage) + 'U', > 'Function':ModuleUnloadImageList} > if NumUnloadImage < 2: >=20 > AutoGenC.Append(gUefiUnloadImageString[NumUnloadImage].Replace(Dic > t)) > else: > -- > 2.14.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel