From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 B638820352138 for ; Tue, 1 May 2018 23:48:58 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 May 2018 23:48:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,353,1520924400"; d="scan'208";a="36184902" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga007.fm.intel.com with ESMTP; 01 May 2018 23:48:58 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 1 May 2018 23:48:58 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 1 May 2018 23:48:57 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.210]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.40]) with mapi id 14.03.0319.002; Wed, 2 May 2018 14:48:55 +0800 From: "Zhu, Yonghong" To: "Carsey, Jaben" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH v1 14/27] BaseTools: Define and use a set for common list Thread-Index: AQHT2L+IfThhN6MM0ESIBbZfjhepvKQcEcNw Date: Wed, 2 May 2018 06:48:55 +0000 Message-ID: References: <0b41afa05a1cb9805122cec7cd54a58fee8319c5.1524239027.git.jaben.carsey@intel.com> In-Reply-To: <0b41afa05a1cb9805122cec7cd54a58fee8319c5.1524239027.git.jaben.carsey@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v1 14/27] BaseTools: Define and use a set for common list X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 May 2018 06:48:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: Carsey, Jaben=20 Sent: Friday, April 20, 2018 11:52 PM To: edk2-devel@lists.01.org Cc: Gao, Liming ; Zhu, Yonghong Subject: [PATCH v1 14/27] BaseTools: Define and use a set for common list share a set for both PEI module types Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 4 ++-- BaseTools/Source/Python/AutoGen/GenC.py | 8 ++++---- BaseTools/Source/Python/Common/DataType.py | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 9c3bf864e360..60088c87a03b 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1431,7 +1431,7 @@ class PlatformAutoGen(AutoGen): # used by DXE module, it should be stored in DXE PCD d= atabase. # The default Phase is DXE # - if M.ModuleType in [SUP_MODULE_PEIM, SUP_MODULE_PEI_CO= RE]: + if M.ModuleType in SUP_MODULE_SET_PEI: PcdFromModule.Phase =3D "PEI" if PcdFromModule not in self._DynaPcdList_: self._DynaPcdList_.append(PcdFromModule) @@ -1473,7 +1473,7 @@ class PlatformAutoGen(AutoGen): # make sure that the "VOID*" kind of datum has MaxDatu= mSize set if PcdFromModule.DatumType =3D=3D "VOID*" and PcdFromM= odule.MaxDatumSize in [None, '']: NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModu= le.TokenSpaceGuidCName, PcdFromModule.TokenCName, InfName)) - if M.ModuleType in [SUP_MODULE_PEIM, SUP_MODULE_PEI_CO= RE]: + if M.ModuleType in SUP_MODULE_SET_PEI: PcdFromModule.Phase =3D "PEI" if PcdFromModule not in self._DynaPcdList_ and PcdFrom= Module.Type in GenC.gDynamicExPcd: self._DynaPcdList_.append(PcdFromModule) diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Pyt= hon/AutoGen/GenC.py index 7bc352274e66..57ff699a968a 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -1411,7 +1411,7 @@ def CreateLibraryConstructorCode(Info, AutoGenC, Auto= GenH): if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]: ConstructorPrototypeString.Append(gLibraryStructorPrototype[SU= P_MODULE_BASE].Replace(Dict)) ConstructorCallingString.Append(gLibraryStructorCall[SUP_MODUL= E_BASE].Replace(Dict)) - elif Lib.ModuleType in [SUP_MODULE_PEI_CORE,SUP_MODULE_PEIM]: + elif Lib.ModuleType in SUP_MODULE_SET_PEI: ConstructorPrototypeString.Append(gLibraryStructorPrototype['P= EI'].Replace(Dict)) ConstructorCallingString.Append(gLibraryStructorCall['PEI'].Re= place(Dict)) elif Lib.ModuleType in [SUP_MODULE_DXE_CORE,SUP_MODULE_DXE_DRIVER,= SUP_MODULE_DXE_SMM_DRIVER,SUP_MODULE_DXE_RUNTIME_DRIVER, @@ -1441,7 +1441,7 @@ def CreateLibraryConstructorCode(Info, AutoGenC, Auto= GenH): else: if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]: AutoGenC.Append(gLibraryString[SUP_MODULE_BASE].Replace(Dict)) - elif Info.ModuleType in [SUP_MODULE_PEI_CORE,SUP_MODULE_PEIM]: + elif Info.ModuleType in SUP_MODULE_SET_PEI: AutoGenC.Append(gLibraryString['PEI'].Replace(Dict)) elif Info.ModuleType in [SUP_MODULE_DXE_CORE,SUP_MODULE_DXE_DRIVER= ,SUP_MODULE_DXE_SMM_DRIVER,SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVER,SUP_MODULE_UEFI= _DRIVER,SUP_MODULE_UEFI_APPLICATION,SUP_MODULE_SMM_CORE]: @@ -1473,7 +1473,7 @@ def CreateLibraryDestructorCode(Info, AutoGenC, AutoG= enH): if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]: DestructorPrototypeString.Append(gLibraryStructorPrototype[SUP= _MODULE_BASE].Replace(Dict)) DestructorCallingString.Append(gLibraryStructorCall[SUP_MODULE= _BASE].Replace(Dict)) - elif Lib.ModuleType in [SUP_MODULE_PEI_CORE,SUP_MODULE_PEIM]: + elif Lib.ModuleType in SUP_MODULE_SET_PEI: DestructorPrototypeString.Append(gLibraryStructorPrototype['PE= I'].Replace(Dict)) DestructorCallingString.Append(gLibraryStructorCall['PEI'].Rep= lace(Dict)) elif Lib.ModuleType in [SUP_MODULE_DXE_CORE,SUP_MODULE_DXE_DRIVER,= SUP_MODULE_DXE_SMM_DRIVER,SUP_MODULE_DXE_RUNTIME_DRIVER, @@ -1503,7 +1503,7 @@ def CreateLibraryDestructorCode(Info, AutoGenC, AutoG= enH): else: if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]: AutoGenC.Append(gLibraryString[SUP_MODULE_BASE].Replace(Dict)) - elif Info.ModuleType in [SUP_MODULE_PEI_CORE,SUP_MODULE_PEIM]: + elif Info.ModuleType in SUP_MODULE_SET_PEI: AutoGenC.Append(gLibraryString['PEI'].Replace(Dict)) elif Info.ModuleType in [SUP_MODULE_DXE_CORE,SUP_MODULE_DXE_DRIVER= ,SUP_MODULE_DXE_SMM_DRIVER,SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVER,SUP_MODULE_UEFI= _DRIVER,SUP_MODULE_UEFI_APPLICATION,SUP_MODULE_SMM_CORE]: diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/= Python/Common/DataType.py index 0bd55494df66..06e8defcf927 100644 --- a/BaseTools/Source/Python/Common/DataType.py +++ b/BaseTools/Source/Python/Common/DataType.py @@ -77,6 +77,7 @@ SUP_MODULE_LIST =3D [SUP_MODULE_BASE, SUP_MODULE_SEC, SUP= _MODULE_PEI_CORE, SUP_MOD SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVE= R, SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_UEFI_DRIVER, \ SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_USER_DEFINED, S= UP_MODULE_SMM_CORE, SUP_MODULE_MM_STANDALONE, SUP_MODULE_MM_CORE_STANDALONE= ] SUP_MODULE_LIST_STRING =3D TAB_VALUE_SPLIT.join(SUP_MODULE_LIST) +SUP_MODULE_SET_PEI =3D {SUP_MODULE_PEIM, SUP_MODULE_PEI_CORE} =20 EDK_COMPONENT_TYPE_LIBRARY =3D 'LIBRARY' EDK_COMPONENT_TYPE_SECUARITY_CORE =3D 'SECUARITY_CORE' -- 2.16.2.windows.1