summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/GenDepex.py
diff options
context:
space:
mode:
authorYunhua Feng <yunhuax.feng@intel.com>2018-07-13 17:05:20 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-07-23 08:56:37 +0800
commita10def91653163dbc6a38a609a87b370e9035654 (patch)
tree62cf82aa0f28a78a0cfd7f4a5477a163098bbab8 /BaseTools/Source/Python/AutoGen/GenDepex.py
parentd9e206d4bf9124fe526baaa0ec56a7d2316ca6b3 (diff)
downloadedk2-a10def91653163dbc6a38a609a87b370e9035654.tar.gz
edk2-a10def91653163dbc6a38a609a87b370e9035654.tar.bz2
edk2-a10def91653163dbc6a38a609a87b370e9035654.zip
BaseTools: enable FixedAtBuild (VOID*) PCD use in the [DEPEX] section
V3: Add some invalid type and datum check V2: limit the PCD used in the [Depex] section should be used in the module The PCD item used in INF [Depex] section must be defined as FixedAtBuild type and VOID* datum type, and the size of the PCD must be 16 bytes. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=443 Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/GenDepex.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenDepex.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py b/BaseTools/Source/Python/AutoGen/GenDepex.py
index d3b1eae181..c12b6139e1 100644
--- a/BaseTools/Source/Python/AutoGen/GenDepex.py
+++ b/BaseTools/Source/Python/AutoGen/GenDepex.py
@@ -22,6 +22,8 @@ from struct import pack
from Common.BuildToolError import *
from Common.Misc import SaveFileOnChange
from Common.Misc import GuidStructureStringToGuidString
+from Common.Misc import GuidStructureByteArrayToGuidString
+from Common.Misc import GuidStringToGuidStructureString
from Common import EdkLogger as EdkLogger
from Common.BuildVersion import gBUILD_VERSION
from Common.DataType import *
@@ -333,6 +335,10 @@ class DependencyExpression:
def GetGuidValue(self, Guid):
GuidValueString = Guid.replace("{", "").replace("}", "").replace(" ", "")
GuidValueList = GuidValueString.split(",")
+ if len(GuidValueList) != 11 and len(GuidValueList) == 16:
+ GuidValueString = GuidStringToGuidStructureString(GuidStructureByteArrayToGuidString(Guid))
+ GuidValueString = GuidValueString.replace("{", "").replace("}", "").replace(" ", "")
+ GuidValueList = GuidValueString.split(",")
if len(GuidValueList) != 11:
EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid GUID value string or opcode: %s" % Guid)
return pack("1I2H8B", *(int(value, 16) for value in GuidValueList))