summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/GenFds/DepexSection.py
diff options
context:
space:
mode:
authorCarsey, Jaben <jaben.carsey@intel.com>2018-04-26 19:57:53 +0300
committerYonghong Zhu <yonghong.zhu@intel.com>2018-05-02 09:56:31 +0300
commit8bb63e377bf10f5769e1502f8d22579fdd40c701 (patch)
treeca0ac4f1fd763587c189055c4d9173be6fc64705 /BaseTools/Source/Python/GenFds/DepexSection.py
parent50874612be60df3752327fb488799074826b759e (diff)
downloadedk2-8bb63e377bf10f5769e1502f8d22579fdd40c701.tar.xz
BaseTools: replace string constants used for module types
replace raw strings in the code (note: except UPT) with constants. SUP_MODULE_BASE was 'BASE' SUP_MODULE_SEC was 'SEC' SUP_MODULE_PEI_CORE was 'PEI_CORE' SUP_MODULE_PEIM was 'PEIM' SUP_MODULE_DXE_CORE was 'DXE_CORE' SUP_MODULE_DXE_DRIVER was 'DXE_DRIVER' SUP_MODULE_DXE_RUNTIME_DRIVER was 'DXE_RUNTIME_DRIVER' SUP_MODULE_DXE_SAL_DRIVER was 'DXE_SAL_DRIVER' SUP_MODULE_DXE_SMM_DRIVER was 'DXE_SMM_DRIVER' SUP_MODULE_UEFI_DRIVER was 'UEFI_DRIVER' SUP_MODULE_UEFI_APPLICATION was 'UEFI_APPLICATION' SUP_MODULE_USER_DEFINED was 'USER_DEFINED' SUP_MODULE_SMM_CORE was 'SMM_CORE' SUP_MODULE_MM_STANDALONE was 'MM_STANDALONE' SUP_MODULE_MM_CORE_STANDALONE was 'MM_CORE_STANDALONE' 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>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/DepexSection.py')
-rw-r--r--BaseTools/Source/Python/GenFds/DepexSection.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/BaseTools/Source/Python/GenFds/DepexSection.py b/BaseTools/Source/Python/GenFds/DepexSection.py
index 4ed1aa7792..d04160e890 100644
--- a/BaseTools/Source/Python/GenFds/DepexSection.py
+++ b/BaseTools/Source/Python/GenFds/DepexSection.py
@@ -25,6 +25,7 @@ from AutoGen.GenDepex import DependencyExpression
from Common import EdkLogger
from Common.BuildToolError import *
from Common.Misc import PathClass
+from Common.DataType import *
## generate data section
#
@@ -94,24 +95,24 @@ class DepexSection (DepexSectionClassObject):
self.ExpressionProcessed = True
if self.DepexType == 'PEI_DEPEX_EXP':
- ModuleType = 'PEIM'
+ ModuleType = SUP_MODULE_PEIM
SecType = 'PEI_DEPEX'
elif self.DepexType == 'DXE_DEPEX_EXP':
- ModuleType = 'DXE_DRIVER'
+ ModuleType = SUP_MODULE_DXE_DRIVER
SecType = 'DXE_DEPEX'
elif self.DepexType == 'SMM_DEPEX_EXP':
- ModuleType = 'DXE_SMM_DRIVER'
+ ModuleType = SUP_MODULE_DXE_SMM_DRIVER
SecType = 'SMM_DEPEX'
else:
EdkLogger.error("GenFds", FORMAT_INVALID,
"Depex type %s is not valid for module %s" % (self.DepexType, ModuleName))
- InputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.depex')
+ InputFile = os.path.join (OutputPath, ModuleName + SUP_MODULE_SEC + SecNum + '.depex')
InputFile = os.path.normpath(InputFile)
Depex = DependencyExpression(self.Expression, ModuleType)
Depex.Generate(InputFile)
- OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + '.dpx')
+ OutputFile = os.path.join (OutputPath, ModuleName + SUP_MODULE_SEC + SecNum + '.dpx')
OutputFile = os.path.normpath(OutputFile)
GenFdsGlobalVariable.GenerateSection(OutputFile, [InputFile], Section.Section.SectionType.get (SecType), IsMakefile=IsMakefile)