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.20; helo=mga02.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 1894B2272960F for ; Fri, 20 Apr 2018 08:51:56 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Apr 2018 08:51:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,302,1520924400"; d="scan'208";a="44811588" Received: from jcarsey-desk1.amr.corp.intel.com ([10.7.159.144]) by orsmga003.jf.intel.com with ESMTP; 20 Apr 2018 08:51:53 -0700 From: Jaben Carsey To: edk2-devel@lists.01.org Cc: Liming Gao , Yonghong Zhu Date: Fri, 20 Apr 2018 08:51:34 -0700 Message-Id: <0b41afa05a1cb9805122cec7cd54a58fee8319c5.1524239027.git.jaben.carsey@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: References: In-Reply-To: References: Subject: [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: Fri, 20 Apr 2018 15:51:56 -0000 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 database. # The default Phase is DXE # - if M.ModuleType in [SUP_MODULE_PEIM, SUP_MODULE_PEI_CORE]: + if M.ModuleType in SUP_MODULE_SET_PEI: PcdFromModule.Phase = "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 MaxDatumSize set if PcdFromModule.DatumType == "VOID*" and PcdFromModule.MaxDatumSize in [None, '']: NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, InfName)) - if M.ModuleType in [SUP_MODULE_PEIM, SUP_MODULE_PEI_CORE]: + if M.ModuleType in SUP_MODULE_SET_PEI: PcdFromModule.Phase = "PEI" if PcdFromModule not in self._DynaPcdList_ and PcdFromModule.Type in GenC.gDynamicExPcd: self._DynaPcdList_.append(PcdFromModule) diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/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, AutoGenH): if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]: ConstructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict)) ConstructorCallingString.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: ConstructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict)) ConstructorCallingString.Append(gLibraryStructorCall['PEI'].Replace(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, AutoGenH): 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, AutoGenH): 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['PEI'].Replace(Dict)) DestructorCallingString.Append(gLibraryStructorCall['PEI'].Replace(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, AutoGenH): 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 = [SUP_MODULE_BASE, SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MOD SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVER, SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_UEFI_DRIVER, \ SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_USER_DEFINED, SUP_MODULE_SMM_CORE, SUP_MODULE_MM_STANDALONE, SUP_MODULE_MM_CORE_STANDALONE] SUP_MODULE_LIST_STRING = TAB_VALUE_SPLIT.join(SUP_MODULE_LIST) +SUP_MODULE_SET_PEI = {SUP_MODULE_PEIM, SUP_MODULE_PEI_CORE} EDK_COMPONENT_TYPE_LIBRARY = 'LIBRARY' EDK_COMPONENT_TYPE_SECUARITY_CORE = 'SECUARITY_CORE' -- 2.16.2.windows.1