BaseTools: Define and use a set for common list

share a set for both PEI module types

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Carsey, Jaben 2018-04-20 23:51:34 +08:00 committed by Yonghong Zhu
parent 8bb63e377b
commit 88c6c1b64c
3 changed files with 7 additions and 6 deletions

View File

@ -1430,7 +1430,7 @@ class PlatformAutoGen(AutoGen):
# used by DXE module, it should be stored in DXE PCD database. # used by DXE module, it should be stored in DXE PCD database.
# The default Phase is DXE # 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" PcdFromModule.Phase = "PEI"
if PcdFromModule not in self._DynaPcdList_: if PcdFromModule not in self._DynaPcdList_:
self._DynaPcdList_.append(PcdFromModule) self._DynaPcdList_.append(PcdFromModule)
@ -1472,7 +1472,7 @@ class PlatformAutoGen(AutoGen):
# make sure that the "VOID*" kind of datum has MaxDatumSize set # make sure that the "VOID*" kind of datum has MaxDatumSize set
if PcdFromModule.DatumType == TAB_VOID and PcdFromModule.MaxDatumSize in [None, '']: if PcdFromModule.DatumType == TAB_VOID and PcdFromModule.MaxDatumSize in [None, '']:
NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.TokenSpaceGuidCName, PcdFromModule.TokenCName, InfName)) 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" PcdFromModule.Phase = "PEI"
if PcdFromModule not in self._DynaPcdList_ and PcdFromModule.Type in GenC.gDynamicExPcd: if PcdFromModule not in self._DynaPcdList_ and PcdFromModule.Type in GenC.gDynamicExPcd:
self._DynaPcdList_.append(PcdFromModule) self._DynaPcdList_.append(PcdFromModule)

View File

@ -1409,7 +1409,7 @@ def CreateLibraryConstructorCode(Info, AutoGenC, AutoGenH):
if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]: if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
ConstructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict)) ConstructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict))
ConstructorCallingString.Append(gLibraryStructorCall[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)) ConstructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict))
ConstructorCallingString.Append(gLibraryStructorCall['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, elif Lib.ModuleType in [SUP_MODULE_DXE_CORE,SUP_MODULE_DXE_DRIVER,SUP_MODULE_DXE_SMM_DRIVER,SUP_MODULE_DXE_RUNTIME_DRIVER,
@ -1439,7 +1439,7 @@ def CreateLibraryConstructorCode(Info, AutoGenC, AutoGenH):
else: else:
if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]: if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
AutoGenC.Append(gLibraryString[SUP_MODULE_BASE].Replace(Dict)) 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)) 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, 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]: SUP_MODULE_DXE_SAL_DRIVER,SUP_MODULE_UEFI_DRIVER,SUP_MODULE_UEFI_APPLICATION,SUP_MODULE_SMM_CORE]:
@ -1471,7 +1471,7 @@ def CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH):
if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]: if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
DestructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict)) DestructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict))
DestructorCallingString.Append(gLibraryStructorCall[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)) DestructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict))
DestructorCallingString.Append(gLibraryStructorCall['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, elif Lib.ModuleType in [SUP_MODULE_DXE_CORE,SUP_MODULE_DXE_DRIVER,SUP_MODULE_DXE_SMM_DRIVER,SUP_MODULE_DXE_RUNTIME_DRIVER,
@ -1501,7 +1501,7 @@ def CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH):
else: else:
if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]: if Info.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
AutoGenC.Append(gLibraryString[SUP_MODULE_BASE].Replace(Dict)) 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)) 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, 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]: SUP_MODULE_DXE_SAL_DRIVER,SUP_MODULE_UEFI_DRIVER,SUP_MODULE_UEFI_APPLICATION,SUP_MODULE_SMM_CORE]:

View File

@ -81,6 +81,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_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_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_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_LIBRARY = 'LIBRARY'
EDK_COMPONENT_TYPE_SECUARITY_CORE = 'SECUARITY_CORE' EDK_COMPONENT_TYPE_SECUARITY_CORE = 'SECUARITY_CORE'